diff --git a/.ci.yaml b/.ci.yaml index c5edcecf6d50..94780f2513cb 100644 --- a/.ci.yaml +++ b/.ci.yaml @@ -31,7 +31,7 @@ platform_properties: {"dependency": "android_sdk", "version": "version:33v6"}, {"dependency": "open_jdk", "version": "version:17"}, {"dependency": "curl", "version": "version:7.64.0"}, - {"dependency": "avd_cipd_version", "version": "build_id:8759428741582061553"} + {"dependency": "avd_cipd_version", "version": "build_id:8739520057779466577"} ] linux_android_legacy: properties: @@ -44,7 +44,7 @@ platform_properties: {"dependency": "open_jdk", "version": "version:17"}, {"dependency": "curl", "version": "version:7.64.0"}, {"dependency": "android_virtual_device", "version": "generic_android22.textpb"}, - {"dependency": "avd_cipd_version", "version": "build_id:8759428741582061553"} + {"dependency": "avd_cipd_version", "version": "build_id:8739520057779466577"} ] linux_desktop: properties: diff --git a/.ci/flutter_master.version b/.ci/flutter_master.version index b1c0bfa3b026..e8948f8d5021 100644 --- a/.ci/flutter_master.version +++ b/.ci/flutter_master.version @@ -1 +1 @@ -cc13cd1f11916857ec5adbe43ce4e747fb07a5d5 +6790525ce673734ef3a913e301a7001e2f500703 diff --git a/.ci/flutter_stable.version b/.ci/flutter_stable.version index 63b582393523..7b741fa7ed37 100644 --- a/.ci/flutter_stable.version +++ b/.ci/flutter_stable.version @@ -1 +1 @@ -80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819 +2663184aa79047d0a33a14a3b607954f8fdd8730 diff --git a/.ci/legacy_project/all_packages/android/app/build.gradle b/.ci/legacy_project/all_packages/android/app/build.gradle index 2170e19cea13..ce520a90d1f5 100644 --- a/.ci/legacy_project/all_packages/android/app/build.gradle +++ b/.ci/legacy_project/all_packages/android/app/build.gradle @@ -25,6 +25,7 @@ apply plugin: 'com.android.application' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { + namespace = "com.example.all_packages" compileSdkVersion 33 defaultConfig { diff --git a/.ci/targets/ios_platform_tests.yaml b/.ci/targets/ios_platform_tests.yaml index e679834961f1..bc962e41ecea 100644 --- a/.ci/targets/ios_platform_tests.yaml +++ b/.ci/targets/ios_platform_tests.yaml @@ -18,7 +18,7 @@ tasks: - name: xcode analyze deprecation # Ensure we don't accidentally introduce deprecated code. script: .ci/scripts/tool_runner.sh - args: ["xcode-analyze", "--ios", "--ios-min-version=13.0"] + args: ["xcode-analyze", "--ios", "--ios-min-version=14.0", "--exclude=script/configs/exclude_xcode_deprecation.yaml"] - name: native test script: .ci/scripts/tool_runner.sh # Simulator name and version must match name and version in create_simulator.sh diff --git a/.ci/targets/macos_platform_tests.yaml b/.ci/targets/macos_platform_tests.yaml index 1dd105f109f9..c3a5d83b11e2 100644 --- a/.ci/targets/macos_platform_tests.yaml +++ b/.ci/targets/macos_platform_tests.yaml @@ -15,7 +15,7 @@ tasks: - name: xcode analyze deprecation # Ensure we don't accidentally introduce deprecated code. script: .ci/scripts/tool_runner.sh - args: ["xcode-analyze", "--macos", "--macos-min-version=12.3"] + args: ["xcode-analyze", "--macos", "--macos-min-version=14.0", "--exclude=script/configs/exclude_xcode_deprecation.yaml"] - name: native test script: .ci/scripts/tool_runner.sh args: ["native-test", "--macos"] diff --git a/.github/labeler.yml b/.github/labeler.yml index d44cb1298ec0..c1a7a366025d 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -108,6 +108,11 @@ - any-glob-to-any-file: - packages/in_app_purchase/**/* +'p: interactive_media_ads': + - changed-files: + - any-glob-to-any-file: + - packages/interactive_media_ads/**/* + 'p: ios_platform_images': - changed-files: - any-glob-to-any-file: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f673a71f0340..79a2ba562b45 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -36,7 +36,7 @@ jobs: cd $GITHUB_WORKSPACE # Checks out a copy of the repo. - name: Check out code - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 with: fetch-depth: 0 # Fetch all history so the tool can get all the tags to determine version. - name: Set up tools diff --git a/.github/workflows/scorecards-analysis.yml b/.github/workflows/scorecards-analysis.yml deleted file mode 100644 index 8bf508c7c201..000000000000 --- a/.github/workflows/scorecards-analysis.yml +++ /dev/null @@ -1,54 +0,0 @@ -name: Scorecards supply-chain security -on: - push: - branches: - - main - -# Declare default permissions as read only. -permissions: read-all - -jobs: - analysis: - name: Scorecards analysis - runs-on: ubuntu-latest - permissions: - # Needed to upload the results to code-scanning dashboard. - security-events: write - actions: read - contents: read - # Needed to access OIDC token. - id-token: write - - steps: - - name: "Checkout code" - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v2.4.0 - with: - persist-credentials: false - - - name: "Run analysis" - uses: ossf/scorecard-action@62b2cac7ed8198b15735ed49ab1e5cf35480ba46 # v2.0.3 - with: - results_file: results.sarif - results_format: sarif - # Read-only PAT token. To create it, - # follow the steps in https://github.com/ossf/scorecard-action#pat-token-creation. - repo_token: ${{ secrets.SCORECARD_READ_TOKEN }} - # Publish the results to enable scorecard badges. For more details, see - # https://github.com/ossf/scorecard-action#publishing-results. - # For private repositories, `publish_results` will automatically be set to `false`, - # regardless of the value entered here. - publish_results: true - - # Upload the results as artifacts (optional). - - name: "Upload artifact" - uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v2.3.1 - with: - name: SARIF file - path: results.sarif - retention-days: 5 - - # Upload the results to GitHub's code scanning dashboard. - - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@eb055d739abdc2e8de2e5f4ba1a8b246daa779aa # v1.0.26 - with: - sarif_file: results.sarif diff --git a/CODEOWNERS b/CODEOWNERS index d7c37efa2fbb..bfdb5af89d81 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -45,6 +45,7 @@ packages/web_benchmarks/** @yjbanov packages/webview_flutter/** @bparrishMines packages/xdg_directories/** @stuartmorgan third_party/packages/cupertino_icons/** @MitchellGoodwin +third_party/packages/cupertino_icons/test/goldens/** @LongCatIsLooong # Plugin platform implementation rules. These should stay last, since the last # matching entry takes precedence. @@ -62,9 +63,8 @@ packages/video_player/video_player_web/** @ditman packages/webview_flutter/webview_flutter_web/** @ditman # - Android -# TODO(matanlurey): Remove @matanlurey after https://github.com/flutter/flutter/issues/151018. -packages/camera/camera_android/** @camsim99 @matanlurey -packages/camera/camera_android_camerax/** @camsim99 @matanlurey +packages/camera/camera_android/** @camsim99 +packages/camera/camera_android_camerax/** @camsim99 packages/espresso/** @reidbaker packages/file_selector/file_selector_android/** @gmackall packages/flutter_plugin_android_lifecycle/** @reidbaker diff --git a/README.md b/README.md index 494f828b91a2..08507abcb9f2 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,6 @@ [![Release Status](https://github.com/flutter/packages/actions/workflows/release.yml/badge.svg)](https://github.com/flutter/packages/actions/workflows/release.yml) [![Flutter CI Status](https://flutter-dashboard.appspot.com/api/public/build-status-badge?repo=packages)](https://flutter-dashboard.appspot.com/#/build?repo=packages) -[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/flutter/packages/badge)](https://deps.dev/project/github/flutter%2Fpackages) This repo is a companion repo to the main [flutter repo]( https://github.com/flutter/flutter). It contains the source code for Flutter's diff --git a/analysis_options.yaml b/analysis_options.yaml index fc0097b37805..6f7467b38d33 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -132,7 +132,7 @@ linter: # - one_member_abstracts # too many false positives - only_throw_errors # this does get disabled in a few places where we have legacy code that uses strings et al - overridden_fields - - package_api_docs + # - package_api_docs # Deprecated (https://github.com/dart-lang/linter/issues/5107) - package_names - package_prefixed_library_names # - parameter_assignments # we do this commonly diff --git a/packages/animations/example/android/build.gradle b/packages/animations/example/android/build.gradle index d13ef556e261..491936f2fbef 100644 --- a/packages/animations/example/android/build.gradle +++ b/packages/animations/example/android/build.gradle @@ -6,7 +6,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:7.4.2' + classpath 'com.android.tools.build:gradle:8.5.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } diff --git a/packages/animations/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/animations/example/android/gradle/wrapper/gradle-wrapper.properties index aeaff6f869f3..7aeeb11c6ee5 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-8.7-all.zip 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..d951fac2bf31 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-8.7-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/packages/camera/camera/example/android/build.gradle b/packages/camera/camera/example/android/build.gradle index cec92de922cf..6104b2634228 100644 --- a/packages/camera/camera/example/android/build.gradle +++ b/packages/camera/camera/example/android/build.gradle @@ -5,7 +5,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:7.4.2' + classpath 'com.android.tools.build:gradle:8.5.1' } } 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..3c85cfe057a1 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-8.7-all.zip diff --git a/packages/camera/camera/example/lib/main.dart b/packages/camera/camera/example/lib/main.dart index f7b209a768b3..d048fc794f28 100644 --- a/packages/camera/camera/example/lib/main.dart +++ b/packages/camera/camera/example/lib/main.dart @@ -534,7 +534,7 @@ class _CameraExampleHomeState extends State onPressed: cameraController != null && cameraController.value.isInitialized && cameraController.value.isRecordingVideo - ? (cameraController.value.isRecordingPaused) + ? cameraController.value.isRecordingPaused ? onResumeButtonPressed : onPauseButtonPressed : null, @@ -689,7 +689,6 @@ class _CameraExampleHomeState extends State showInSnackBar('Audio access is restricted.'); default: _showCameraException(e); - break; } } diff --git a/packages/camera/camera/pubspec.yaml b/packages/camera/camera/pubspec.yaml index 931f091bbdcc..0b8ebb4a3b5c 100644 --- a/packages/camera/camera/pubspec.yaml +++ b/packages/camera/camera/pubspec.yaml @@ -32,7 +32,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - mockito: 5.4.4 + mockito: ^5.4.4 plugin_platform_interface: ^2.1.7 topics: diff --git a/packages/camera/camera_android/CHANGELOG.md b/packages/camera/camera_android/CHANGELOG.md index 9f5c4aebe193..c844cc61abbf 100644 --- a/packages/camera/camera_android/CHANGELOG.md +++ b/packages/camera/camera_android/CHANGELOG.md @@ -1,3 +1,24 @@ +## 0.10.9+16 + +* Updates annotations lib to 1.9.0. + +## 0.10.9+15 + +* Converts Dart to native platform calls to Pigeon. + +## 0.10.9+14 + +* Converts native to Dart platform calls to Pigeon. + +## 0.10.9+13 + +* Converts `getAvailableCameras` to Pigeon. + +## 0.10.9+12 + +* Updates Java compatibility version to 11. +* Updates minimum supported SDK version to Flutter 3.24/Dart 3.5. + ## 0.10.9+11 * Updates annotations lib to 1.8.2. diff --git a/packages/camera/camera_android/android/build.gradle b/packages/camera/camera_android/android/build.gradle index 6ea5b3c121bf..cbe399571dcd 100644 --- a/packages/camera/camera_android/android/build.gradle +++ b/packages/camera/camera_android/android/build.gradle @@ -30,10 +30,7 @@ android { buildFeatures { buildConfig true } - // Conditional for compatibility with AGP <4.2. - if (project.android.hasProperty("namespace")) { - namespace 'io.flutter.plugins.camera' - } + namespace 'io.flutter.plugins.camera' compileSdk 34 defaultConfig { @@ -46,14 +43,18 @@ buildFeatures { disable 'AndroidGradlePluginVersion', 'InvalidPackage', 'GradleDependency', 'NewerVersionAvailable' } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_11 + targetCompatibility JavaVersion.VERSION_11 } testOptions { unitTests.includeAndroidResources = true unitTests.returnDefaultValues = true unitTests.all { + // The org.gradle.jvmargs property that may be set in gradle.properties does not impact + // the Java heap size when running the Android unit tests. The following property here + // sets the heap size to a size large enough to run the robolectric tests across + // multiple SDK levels. jvmArgs "-Xmx1g" testLogging { events "passed", "skipped", "failed", "standardOut", "standardError" @@ -65,7 +66,7 @@ buildFeatures { } dependencies { - implementation 'androidx.annotation:annotation:1.8.2' + implementation 'androidx.annotation:annotation:1.9.0' testImplementation 'junit:junit:4.13.2' testImplementation 'org.mockito:mockito-inline:5.0.0' testImplementation 'androidx.test:core:1.4.0' 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 7668ec97eec7..cfddf2d3bc34 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 @@ -39,8 +39,6 @@ import io.flutter.BuildConfig; import io.flutter.embedding.engine.systemchannels.PlatformChannel; import io.flutter.plugin.common.EventChannel; -import io.flutter.plugin.common.MethodChannel; -import io.flutter.plugin.common.MethodChannel.Result; import io.flutter.plugins.camera.features.CameraFeature; import io.flutter.plugins.camera.features.CameraFeatureFactory; import io.flutter.plugins.camera.features.CameraFeatures; @@ -68,7 +66,6 @@ import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; -import java.util.HashMap; import java.util.List; import java.util.Locale; import java.util.concurrent.Executors; @@ -83,23 +80,13 @@ class Camera ImageReader.OnImageAvailableListener { private static final String TAG = "Camera"; - private static final HashMap supportedImageFormats; - - // Current supported outputs. - static { - supportedImageFormats = new HashMap<>(); - supportedImageFormats.put("yuv420", ImageFormat.YUV_420_888); - supportedImageFormats.put("jpeg", ImageFormat.JPEG); - supportedImageFormats.put("nv21", ImageFormat.NV21); - } - /** * Holds all of the camera features/settings and will be used to update the request builder when * one changes. */ CameraFeatures cameraFeatures; - private String imageFormatGroup; + private int imageFormatGroup; /** * Takes an input/output surface and orients the recording correctly. This is needed because @@ -148,7 +135,7 @@ class Camera /** Holds the last known capture properties */ private CameraCaptureProperties captureProps; - MethodChannel.Result flutterResult; + Messages.Result flutterResult; /** A CameraDeviceWrapper implementation that forwards calls to a CameraDevice. */ private class DefaultCameraDeviceWrapper implements CameraDeviceWrapper { @@ -340,7 +327,7 @@ private void prepareMediaRecorder(String outputFilePath) throws IOException { } @SuppressLint("MissingPermission") - public void open(String imageFormatGroup) throws CameraAccessException { + public void open(Integer imageFormatGroup) throws CameraAccessException { this.imageFormatGroup = imageFormatGroup; final ResolutionFeature resolutionFeature = cameraFeatures.getResolution(); @@ -363,17 +350,11 @@ public void open(String imageFormatGroup) throws CameraAccessException { ImageFormat.JPEG, 1); - // For image streaming, use the provided image format or fall back to YUV420. - Integer imageFormat = supportedImageFormats.get(imageFormatGroup); - if (imageFormat == null) { - Log.w(TAG, "The selected imageFormatGroup is not supported by Android. Defaulting to yuv420"); - imageFormat = ImageFormat.YUV_420_888; - } imageStreamReader = new ImageStreamReader( resolutionFeature.getPreviewSize().getWidth(), resolutionFeature.getPreviewSize().getHeight(), - imageFormat, + this.imageFormatGroup, 1); // Open the camera. @@ -396,10 +377,14 @@ public void onOpened(@NonNull CameraDevice device) { cameraFeatures.getFocusPoint().checkIsSupported()); } } catch (Exception e) { + String message = + (e.getMessage() == null) + ? (e.getClass().getName() + " occurred while opening camera.") + : e.getMessage(); if (BuildConfig.DEBUG) { - Log.i(TAG, "open | onOpened error: " + e.getMessage()); + Log.i(TAG, "open | onOpened error: " + message); } - dartMessenger.sendCameraErrorEvent(e.getMessage()); + dartMessenger.sendCameraErrorEvent(message); close(); } } @@ -618,10 +603,12 @@ private void startCapture(boolean record, boolean stream) throws CameraAccessExc CameraDevice.TEMPLATE_RECORD, successCallback, surfaces.toArray(new Surface[0])); } - public void takePicture(@NonNull final Result result) { + public void takePicture(@NonNull final Messages.Result result) { // Only take one picture at a time. if (cameraCaptureCallback.getCameraState() != CameraState.STATE_PREVIEW) { - result.error("captureAlreadyActive", "Picture is currently already being captured", null); + result.error( + new Messages.FlutterError( + "captureAlreadyActive", "Picture is currently already being captured", null)); return; } @@ -792,7 +779,11 @@ private void lockAutoFocus() { try { captureSession.capture(previewRequestBuilder.build(), null, backgroundHandler); } catch (CameraAccessException e) { - dartMessenger.sendCameraErrorEvent(e.getMessage()); + String message = + (e.getMessage() == null) + ? "CameraAccessException occurred while locking autofocus." + : e.getMessage(); + dartMessenger.sendCameraErrorEvent(message); } } @@ -815,7 +806,11 @@ void unlockAutoFocus() { captureSession.capture(previewRequestBuilder.build(), null, backgroundHandler); } catch (CameraAccessException e) { - dartMessenger.sendCameraErrorEvent(e.getMessage()); + String message = + (e.getMessage() == null) + ? "CameraAccessException occurred while unlocking autofocus." + : e.getMessage(); + dartMessenger.sendCameraErrorEvent(message); return; } @@ -825,9 +820,8 @@ void unlockAutoFocus() { dartMessenger.error(flutterResult, errorCode, errorMessage, null)); } - public void startVideoRecording( - @NonNull Result result, @Nullable EventChannel imageStreamChannel) { - prepareRecording(result); + public void startVideoRecording(@Nullable EventChannel imageStreamChannel) { + prepareRecording(); if (imageStreamChannel != null) { setStreamHandler(imageStreamChannel); @@ -836,11 +830,10 @@ public void startVideoRecording( recordingVideo = true; try { startCapture(true, imageStreamChannel != null); - result.success(null); } catch (CameraAccessException e) { recordingVideo = false; captureFile = null; - result.error("videoRecordingFailed", e.getMessage(), null); + throw new Messages.FlutterError("videoRecordingFailed", e.getMessage(), null); } } @@ -851,10 +844,9 @@ private void closeRenderer() { } } - public void stopVideoRecording(@NonNull final Result result) { + public String stopVideoRecording() { if (!recordingVideo) { - result.success(null); - return; + return ""; } // Re-create autofocus feature so it's using continuous capture focus mode now. cameraFeatures.setAutoFocus( @@ -871,16 +863,15 @@ public void stopVideoRecording(@NonNull final Result result) { try { startPreview(); } catch (CameraAccessException | IllegalStateException | InterruptedException e) { - result.error("videoRecordingFailed", e.getMessage(), null); - return; + throw new Messages.FlutterError("videoRecordingFailed", e.getMessage(), null); } - result.success(captureFile.getAbsolutePath()); + String path = captureFile.getAbsolutePath(); captureFile = null; + return path; } - public void pauseVideoRecording(@NonNull final Result result) { + public void pauseVideoRecording() { if (!recordingVideo) { - result.success(null); return; } @@ -888,20 +879,16 @@ public void pauseVideoRecording(@NonNull final Result result) { if (SdkCapabilityChecker.supportsVideoPause()) { mediaRecorder.pause(); } else { - result.error("videoRecordingFailed", "pauseVideoRecording requires Android API +24.", null); - return; + throw new Messages.FlutterError( + "videoRecordingFailed", "pauseVideoRecording requires Android API +24.", null); } } catch (IllegalStateException e) { - result.error("videoRecordingFailed", e.getMessage(), null); - return; + throw new Messages.FlutterError("videoRecordingFailed", e.getMessage(), null); } - - result.success(null); } - public void resumeVideoRecording(@NonNull final Result result) { + public void resumeVideoRecording() { if (!recordingVideo) { - result.success(null); return; } @@ -909,16 +896,12 @@ public void resumeVideoRecording(@NonNull final Result result) { if (SdkCapabilityChecker.supportsVideoPause()) { mediaRecorder.resume(); } else { - result.error( + throw new Messages.FlutterError( "videoRecordingFailed", "resumeVideoRecording requires Android API +24.", null); - return; } } catch (IllegalStateException e) { - result.error("videoRecordingFailed", e.getMessage(), null); - return; + throw new Messages.FlutterError("videoRecordingFailed", e.getMessage(), null); } - - result.success(null); } /** @@ -927,15 +910,18 @@ public void resumeVideoRecording(@NonNull final Result result) { * @param result Flutter result. * @param newMode new mode. */ - public void setFlashMode(@NonNull final Result result, @NonNull FlashMode newMode) { + public void setFlashMode(@NonNull final Messages.VoidResult result, @NonNull FlashMode newMode) { // Save the new flash mode setting. final FlashFeature flashFeature = cameraFeatures.getFlash(); flashFeature.setValue(newMode); flashFeature.updateBuilder(previewRequestBuilder); refreshPreviewCaptureSession( - () -> result.success(null), - (code, message) -> result.error("setFlashModeFailed", "Could not set flash mode.", null)); + result::success, + (code, message) -> + result.error( + new Messages.FlutterError( + "setFlashModeFailed", "Could not set flash mode.", null))); } /** @@ -944,15 +930,18 @@ public void setFlashMode(@NonNull final Result result, @NonNull FlashMode newMod * @param result Flutter result. * @param newMode new mode. */ - public void setExposureMode(@NonNull final Result result, @NonNull ExposureMode newMode) { + public void setExposureMode( + @NonNull final Messages.VoidResult result, @NonNull ExposureMode newMode) { final ExposureLockFeature exposureLockFeature = cameraFeatures.getExposureLock(); exposureLockFeature.setValue(newMode); exposureLockFeature.updateBuilder(previewRequestBuilder); refreshPreviewCaptureSession( - () -> result.success(null), + result::success, (code, message) -> - result.error("setExposureModeFailed", "Could not set exposure mode.", null)); + result.error( + new Messages.FlutterError( + "setExposureModeFailed", "Could not set exposure mode.", null))); } /** @@ -961,15 +950,17 @@ public void setExposureMode(@NonNull final Result result, @NonNull ExposureMode * @param result Flutter result. * @param point The exposure point. */ - public void setExposurePoint(@NonNull final Result result, @Nullable Point point) { + public void setExposurePoint(@NonNull final Messages.VoidResult result, @Nullable Point point) { final ExposurePointFeature exposurePointFeature = cameraFeatures.getExposurePoint(); exposurePointFeature.setValue(point); exposurePointFeature.updateBuilder(previewRequestBuilder); refreshPreviewCaptureSession( - () -> result.success(null), + result::success, (code, message) -> - result.error("setExposurePointFailed", "Could not set exposure point.", null)); + result.error( + new Messages.FlutterError( + "setExposurePointFailed", "Could not set exposure point.", null))); } /** Return the max exposure offset value supported by the camera to dart. */ @@ -990,10 +981,9 @@ public double getExposureOffsetStepSize() { /** * Sets new focus mode from dart. * - * @param result Flutter result. * @param newMode New mode. */ - public void setFocusMode(final Result result, @NonNull FocusMode newMode) { + public void setFocusMode(@NonNull FocusMode newMode) { final AutoFocusFeature autoFocusFeature = cameraFeatures.getAutoFocus(); autoFocusFeature.setValue(newMode); autoFocusFeature.updateBuilder(previewRequestBuilder); @@ -1020,11 +1010,8 @@ public void setFocusMode(final Result result, @NonNull FocusMode newMode) { captureSession.setRepeatingRequest( previewRequestBuilder.build(), null, backgroundHandler); } catch (CameraAccessException e) { - if (result != null) { - result.error( - "setFocusModeFailed", "Error setting focus mode: " + e.getMessage(), null); - } - return; + throw new Messages.FlutterError( + "setFocusModeFailed", "Error setting focus mode: " + e.getMessage(), null); } break; case auto: @@ -1033,10 +1020,6 @@ public void setFocusMode(final Result result, @NonNull FocusMode newMode) { break; } } - - if (result != null) { - result.success(null); - } } /** @@ -1045,16 +1028,19 @@ public void setFocusMode(final Result result, @NonNull FocusMode newMode) { * @param result Flutter result. * @param point the new coordinates. */ - public void setFocusPoint(@NonNull final Result result, @Nullable Point point) { + public void setFocusPoint(@NonNull final Messages.VoidResult result, @Nullable Point point) { final FocusPointFeature focusPointFeature = cameraFeatures.getFocusPoint(); focusPointFeature.setValue(point); focusPointFeature.updateBuilder(previewRequestBuilder); refreshPreviewCaptureSession( - () -> result.success(null), - (code, message) -> result.error("setFocusPointFailed", "Could not set focus point.", null)); + result::success, + (code, message) -> + result.error( + new Messages.FlutterError( + "setFocusPointFailed", "Could not set focus point.", null))); - this.setFocusMode(null, cameraFeatures.getAutoFocus().getValue()); + this.setFocusMode(cameraFeatures.getAutoFocus().getValue()); } /** @@ -1064,7 +1050,7 @@ public void setFocusPoint(@NonNull final Result result, @Nullable Point point) { * @param result flutter result. * @param offset new value. */ - public void setExposureOffset(@NonNull final Result result, double offset) { + public void setExposureOffset(@NonNull final Messages.Result result, double offset) { final ExposureOffsetFeature exposureOffsetFeature = cameraFeatures.getExposureOffset(); exposureOffsetFeature.setValue(offset); exposureOffsetFeature.updateBuilder(previewRequestBuilder); @@ -1072,7 +1058,9 @@ public void setExposureOffset(@NonNull final Result result, double offset) { refreshPreviewCaptureSession( () -> result.success(exposureOffsetFeature.getValue()), (code, message) -> - result.error("setExposureOffsetFailed", "Could not set exposure offset.", null)); + result.error( + new Messages.FlutterError( + "setExposureOffsetFailed", "Could not set exposure offset.", null))); } public float getMaxZoomLevel() { @@ -1103,7 +1091,7 @@ DeviceOrientationManager getDeviceOrientationManager() { * @param result Flutter result. * @param zoom new value. */ - public void setZoomLevel(@NonNull final Result result, float zoom) throws CameraAccessException { + public void setZoomLevel(@NonNull final Messages.VoidResult result, float zoom) { final ZoomLevelFeature zoomLevel = cameraFeatures.getZoomLevel(); float maxZoom = zoomLevel.getMaximumZoomLevel(); float minZoom = zoomLevel.getMinimumZoomLevel(); @@ -1115,7 +1103,7 @@ public void setZoomLevel(@NonNull final Result result, float zoom) throws Camera "Zoom level out of bounds (zoom level should be between %f and %f).", minZoom, maxZoom); - result.error("ZOOM_ERROR", errorMessage, null); + result.error(new Messages.FlutterError("ZOOM_ERROR", errorMessage, null)); return; } @@ -1123,8 +1111,11 @@ public void setZoomLevel(@NonNull final Result result, float zoom) throws Camera zoomLevel.updateBuilder(previewRequestBuilder); refreshPreviewCaptureSession( - () -> result.success(null), - (code, message) -> result.error("setZoomLevelFailed", "Could not set zoom level.", null)); + result::success, + (code, message) -> + result.error( + new Messages.FlutterError( + "setZoomLevelFailed", "Could not set zoom level.", null))); } /** @@ -1231,12 +1222,12 @@ public void onImageAvailable(ImageReader reader) { captureFile, new ImageSaver.Callback() { @Override - public void onComplete(String absolutePath) { + public void onComplete(@NonNull String absolutePath) { dartMessenger.finish(flutterResult, absolutePath); } @Override - public void onError(String errorCode, String errorMessage) { + public void onError(@NonNull String errorCode, @NonNull String errorMessage) { dartMessenger.error(flutterResult, errorCode, errorMessage, null); } })); @@ -1244,21 +1235,19 @@ public void onError(String errorCode, String errorMessage) { } @VisibleForTesting - void prepareRecording(@NonNull Result result) { + void prepareRecording() { final File outputDir = applicationContext.getCacheDir(); try { captureFile = File.createTempFile("REC", ".mp4", outputDir); } catch (IOException | SecurityException e) { - result.error("cannotCreateFile", e.getMessage(), null); - return; + throw new Messages.FlutterError("cannotCreateFile", e.getMessage(), null); } try { prepareMediaRecorder(captureFile.getAbsolutePath()); } catch (IOException e) { recordingVideo = false; captureFile = null; - result.error("videoRecordingFailed", e.getMessage(), null); - return; + throw new Messages.FlutterError("videoRecordingFailed", e.getMessage(), null); } // Re-create autofocus feature so it's using video focus mode now. cameraFeatures.setAutoFocus( @@ -1359,21 +1348,19 @@ public void uncaughtException(Thread thread, Throwable ex) { videoRendererUncaughtExceptionHandler); } - public void setDescriptionWhileRecording( - @NonNull final Result result, CameraProperties properties) { + public void setDescriptionWhileRecording(CameraProperties properties) { if (!recordingVideo) { - result.error("setDescriptionWhileRecordingFailed", "Device was not recording", null); - return; + throw new Messages.FlutterError( + "setDescriptionWhileRecordingFailed", "Device was not recording", null); } // See VideoRenderer.java; support for this EGL extension is required to switch camera while recording. if (!SdkCapabilityChecker.supportsEglRecordableAndroid()) { - result.error( + throw new Messages.FlutterError( "setDescriptionWhileRecordingFailed", "Device does not support switching the camera while recording", null); - return; } stopAndReleaseCamera(); @@ -1391,9 +1378,8 @@ public void setDescriptionWhileRecording( try { open(imageFormatGroup); } catch (CameraAccessException e) { - result.error("setDescriptionWhileRecordingFailed", e.getMessage(), null); + throw new Messages.FlutterError("setDescriptionWhileRecordingFailed", e.getMessage(), null); } - result.success(null); } public void dispose() { diff --git a/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/CameraApiImpl.java b/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/CameraApiImpl.java new file mode 100644 index 000000000000..552a7ddfa3f5 --- /dev/null +++ b/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/CameraApiImpl.java @@ -0,0 +1,352 @@ +// 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. + +package io.flutter.plugins.camera; + +import android.app.Activity; +import android.hardware.camera2.CameraAccessException; +import android.os.Handler; +import android.os.Looper; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.annotation.VisibleForTesting; +import io.flutter.plugin.common.BinaryMessenger; +import io.flutter.plugin.common.EventChannel; +import io.flutter.plugins.camera.CameraPermissions.PermissionsRegistry; +import io.flutter.plugins.camera.features.CameraFeatureFactoryImpl; +import io.flutter.plugins.camera.features.Point; +import io.flutter.plugins.camera.features.exposurelock.ExposureMode; +import io.flutter.plugins.camera.features.flash.FlashMode; +import io.flutter.plugins.camera.features.resolution.ResolutionPreset; +import io.flutter.view.TextureRegistry; +import java.util.Collections; +import java.util.List; + +final class CameraApiImpl implements Messages.CameraApi { + private final Activity activity; + private final BinaryMessenger messenger; + private final CameraPermissions cameraPermissions; + private final PermissionsRegistry permissionsRegistry; + private final TextureRegistry textureRegistry; + private final EventChannel imageStreamChannel; + @VisibleForTesting @Nullable Camera camera; + + CameraApiImpl( + Activity activity, + BinaryMessenger messenger, + CameraPermissions cameraPermissions, + PermissionsRegistry permissionsAdder, + TextureRegistry textureRegistry) { + this.activity = activity; + this.messenger = messenger; + this.cameraPermissions = cameraPermissions; + this.permissionsRegistry = permissionsAdder; + this.textureRegistry = textureRegistry; + + imageStreamChannel = + new EventChannel(messenger, "plugins.flutter.io/camera_android/imageStream"); + Messages.CameraApi.setUp(messenger, this); + } + + void tearDownMessageHandler() { + Messages.CameraApi.setUp(messenger, null); + } + + private Long instantiateCamera(String cameraName, Messages.PlatformMediaSettings settings) + throws CameraAccessException { + TextureRegistry.SurfaceTextureEntry flutterSurfaceTexture = + textureRegistry.createSurfaceTexture(); + long cameraId = flutterSurfaceTexture.id(); + DartMessenger dartMessenger = + new DartMessenger( + new Handler(Looper.getMainLooper()), + new Messages.CameraGlobalEventApi(messenger), + new Messages.CameraEventApi(messenger, String.valueOf(cameraId))); + CameraProperties cameraProperties = + new CameraPropertiesImpl(cameraName, CameraUtils.getCameraManager(activity)); + Integer fps = (settings.getFps() == null) ? null : settings.getFps().intValue(); + Integer videoBitrate = + (settings.getVideoBitrate() == null) ? null : settings.getVideoBitrate().intValue(); + Integer audioBitrate = + (settings.getAudioBitrate() == null) ? null : settings.getAudioBitrate().intValue(); + ResolutionPreset resolutionPreset = + CameraUtils.resolutionPresetFromPigeon(settings.getResolutionPreset()); + + camera = + new Camera( + activity, + flutterSurfaceTexture, + new CameraFeatureFactoryImpl(), + dartMessenger, + cameraProperties, + new Camera.VideoCaptureSettings( + resolutionPreset, settings.getEnableAudio(), fps, videoBitrate, audioBitrate)); + + return flutterSurfaceTexture.id(); + } + + // We move catching CameraAccessException out of onMethodCall because it causes a crash + // on plugin registration for sdks incompatible with Camera2 (< 21). We want this plugin to + // to be able to compile with <21 sdks for apps that want the camera and support earlier version. + @SuppressWarnings("ConstantConditions") + private void handleException(Exception exception, Messages.Result result) { + // The code below exactly preserves the format of the native exceptions generated by pre-Pigeon + // code. Since `camera` currently leaks the raw platform exceptions to clients, there may be client + // code that relies on specific string values here, so these should not be changed. See + // https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#platform-exception-handling + // for longer-term solutions to this. + if (exception instanceof CameraAccessException) { + result.error(new Messages.FlutterError("CameraAccess", exception.getMessage(), null)); + return; + } + result.error(new Messages.FlutterError("error", exception.getMessage(), null)); + } + + private void handleException(Exception exception, Messages.VoidResult result) { + // The code below exactly preserves the format of the native exceptions generated by pre-Pigeon + // code. Since `camera` currently leaks the raw platform exceptions to clients, there may be client + // code that relies on specific string values here, so these should not be changed. See + // https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#platform-exception-handling + // for longer-term solutions to this. + if (exception instanceof CameraAccessException) { + result.error(new Messages.FlutterError("CameraAccess", exception.getMessage(), null)); + return; + } + result.error(new Messages.FlutterError("error", exception.getMessage(), null)); + } + + @NonNull + @Override + public List getAvailableCameras() { + if (activity == null) { + return Collections.emptyList(); + } + try { + return CameraUtils.getAvailableCameras(activity); + } catch (CameraAccessException e) { + throw new RuntimeException(e); + } + } + + @Override + public void create( + @NonNull String cameraName, + @NonNull Messages.PlatformMediaSettings settings, + @NonNull Messages.Result result) { + if (camera != null) { + camera.close(); + } + + cameraPermissions.requestPermissions( + activity, + permissionsRegistry, + settings.getEnableAudio(), + (String errCode, String errDesc) -> { + if (errCode == null) { + try { + result.success(instantiateCamera(cameraName, settings)); + } catch (Exception e) { + handleException(e, result); + } + } else { + result.error(new Messages.FlutterError(errCode, errDesc, null)); + } + }); + } + + @Override + public void initialize(@NonNull Messages.PlatformImageFormatGroup imageFormat) { + if (camera == null) { + throw new Messages.FlutterError( + "cameraNotFound", + "Camera not found. Please call the 'create' method before calling 'initialize'.", + null); + } + try { + camera.open(CameraUtils.imageFormatGroupFromPigeon(imageFormat)); + } catch (CameraAccessException e) { + throw new Messages.FlutterError("CameraAccessException", e.getMessage(), null); + } + } + + @Override + public void takePicture(@NonNull Messages.Result result) { + camera.takePicture(result); + } + + @Override + public void startVideoRecording(@NonNull Boolean enableStream) { + camera.startVideoRecording(enableStream ? imageStreamChannel : null); + } + + @NonNull + @Override + public String stopVideoRecording() { + return camera.stopVideoRecording(); + } + + @Override + public void pauseVideoRecording() { + camera.pauseVideoRecording(); + } + + @Override + public void resumeVideoRecording() { + camera.resumeVideoRecording(); + } + + @Override + public void setFlashMode( + @NonNull Messages.PlatformFlashMode flashMode, @NonNull Messages.VoidResult result) { + FlashMode mode = CameraUtils.flashModeFromPigeon(flashMode); + try { + camera.setFlashMode(result, mode); + } catch (Exception e) { + handleException(e, result); + } + } + + @Override + public void setExposureMode( + @NonNull Messages.PlatformExposureMode exposureMode, @NonNull Messages.VoidResult result) { + ExposureMode mode = CameraUtils.exposureModeFromPigeon(exposureMode); + try { + camera.setExposureMode(result, mode); + } catch (Exception e) { + handleException(e, result); + } + } + + @Override + public void setExposurePoint( + @Nullable Messages.PlatformPoint point, @NonNull Messages.VoidResult result) { + try { + camera.setExposurePoint(result, point == null ? null : new Point(point.getX(), point.getY())); + } catch (Exception e) { + handleException(e, result); + } + } + + @NonNull + @Override + public Double getMinExposureOffset() { + return camera.getMinExposureOffset(); + } + + @NonNull + @Override + public Double getMaxExposureOffset() { + return camera.getMaxExposureOffset(); + } + + @NonNull + @Override + public Double getExposureOffsetStepSize() { + return camera.getExposureOffsetStepSize(); + } + + @Override + public void setExposureOffset(@NonNull Double offset, @NonNull Messages.Result result) { + try { + camera.setExposureOffset(result, offset); + } catch (Exception e) { + handleException(e, result); + } + } + + @Override + public void setFocusMode(@NonNull Messages.PlatformFocusMode focusMode) { + camera.setFocusMode(CameraUtils.focusModeFromPigeon(focusMode)); + } + + @Override + public void setFocusPoint( + @Nullable Messages.PlatformPoint point, @NonNull Messages.VoidResult result) { + try { + camera.setFocusPoint(result, point == null ? null : new Point(point.getX(), point.getY())); + } catch (Exception e) { + handleException(e, result); + } + } + + @Override + public void startImageStream() { + try { + camera.startPreviewWithImageStream(imageStreamChannel); + } catch (CameraAccessException e) { + throw new Messages.FlutterError("CameraAccessException", e.getMessage(), null); + } + } + + @Override + public void stopImageStream() { + try { + camera.startPreview(); + } catch (Exception e) { + throw new Messages.FlutterError(e.getClass().getName(), e.getMessage(), null); + } + } + + @NonNull + @Override + public Double getMaxZoomLevel() { + assert camera != null; + return (double) camera.getMaxZoomLevel(); + } + + @NonNull + @Override + public Double getMinZoomLevel() { + assert camera != null; + return (double) camera.getMinZoomLevel(); + } + + @Override + public void setZoomLevel(@NonNull Double zoom, @NonNull Messages.VoidResult result) { + assert camera != null; + camera.setZoomLevel(result, zoom.floatValue()); + } + + @Override + public void lockCaptureOrientation( + @NonNull Messages.PlatformDeviceOrientation platformOrientation) { + camera.lockCaptureOrientation(CameraUtils.orientationFromPigeon(platformOrientation)); + } + + @Override + public void unlockCaptureOrientation() { + camera.unlockCaptureOrientation(); + } + + @Override + public void pausePreview() { + try { + camera.pausePreview(); + } catch (CameraAccessException e) { + throw new Messages.FlutterError("CameraAccessException", e.getMessage(), null); + } + } + + @Override + public void resumePreview() { + camera.resumePreview(); + } + + @Override + public void setDescriptionWhileRecording(@NonNull String cameraName) { + try { + camera.setDescriptionWhileRecording( + new CameraPropertiesImpl(cameraName, CameraUtils.getCameraManager(activity))); + } catch (CameraAccessException e) { + throw new Messages.FlutterError("CameraAccessException", e.getMessage(), null); + } + } + + @Override + public void dispose() { + if (camera != null) { + camera.dispose(); + } + } +} diff --git a/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/CameraPlugin.java b/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/CameraPlugin.java index aff225e2c35a..e7f6a56a976f 100644 --- a/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/CameraPlugin.java +++ b/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/CameraPlugin.java @@ -24,7 +24,7 @@ public final class CameraPlugin implements FlutterPlugin, ActivityAware { private static final String TAG = "CameraPlugin"; private @Nullable FlutterPluginBinding flutterPluginBinding; - private @Nullable MethodCallHandlerImpl methodCallHandler; + private @Nullable CameraApiImpl cameraApi; /** * Initialize this within the {@code #configureFlutterEngine} of a Flutter activity or fragment. @@ -55,9 +55,9 @@ public void onAttachedToActivity(@NonNull ActivityPluginBinding binding) { @Override public void onDetachedFromActivity() { // Could be on too low of an SDK to have started listening originally. - if (methodCallHandler != null) { - methodCallHandler.stopListening(); - methodCallHandler = null; + if (cameraApi != null) { + cameraApi.tearDownMessageHandler(); + cameraApi = null; } } @@ -76,8 +76,8 @@ private void maybeStartListening( BinaryMessenger messenger, PermissionsRegistry permissionsRegistry, TextureRegistry textureRegistry) { - methodCallHandler = - new MethodCallHandlerImpl( + cameraApi = + new CameraApiImpl( activity, messenger, new CameraPermissions(), permissionsRegistry, textureRegistry); } } diff --git a/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/CameraUtils.java b/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/CameraUtils.java index d98984cbf2f5..c5f077c9e184 100644 --- a/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/CameraUtils.java +++ b/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/CameraUtils.java @@ -6,16 +6,19 @@ import android.app.Activity; import android.content.Context; +import android.graphics.ImageFormat; import android.hardware.camera2.CameraAccessException; import android.hardware.camera2.CameraCharacteristics; import android.hardware.camera2.CameraManager; import android.hardware.camera2.CameraMetadata; import androidx.annotation.NonNull; import io.flutter.embedding.engine.systemchannels.PlatformChannel; +import io.flutter.plugins.camera.features.autofocus.FocusMode; +import io.flutter.plugins.camera.features.exposurelock.ExposureMode; +import io.flutter.plugins.camera.features.flash.FlashMode; +import io.flutter.plugins.camera.features.resolution.ResolutionPreset; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; -import java.util.Map; /** Provides various utilities for camera. */ public final class CameraUtils { @@ -33,56 +36,24 @@ static CameraManager getCameraManager(Context context) { } /** - * Serializes the {@link PlatformChannel.DeviceOrientation} to a string value. + * Converts a raw integer to a PlatformCameraLensDirection enum. * - * @param orientation The orientation to serialize. - * @return The serialized orientation. - * @throws UnsupportedOperationException when the provided orientation not have a corresponding - * string value. + * @param lensDirection One of CameraMetadata.LENS_FACING_FRONT, LENS_FACING_BACK, or + * LENS_FACING_EXTERNAL. + * @return One of Messages.PlatformCameraLensDirection.FRONT, BACK, or EXTERNAL. */ - static String serializeDeviceOrientation(PlatformChannel.DeviceOrientation orientation) { - if (orientation == null) - throw new UnsupportedOperationException("Could not serialize null device orientation."); - switch (orientation) { - case PORTRAIT_UP: - return "portraitUp"; - case PORTRAIT_DOWN: - return "portraitDown"; - case LANDSCAPE_LEFT: - return "landscapeLeft"; - case LANDSCAPE_RIGHT: - return "landscapeRight"; - default: - throw new UnsupportedOperationException( - "Could not serialize device orientation: " + orientation.toString()); - } - } - - /** - * Deserializes a string value to its corresponding {@link PlatformChannel.DeviceOrientation} - * value. - * - * @param orientation The string value to deserialize. - * @return The deserialized orientation. - * @throws UnsupportedOperationException when the provided string value does not have a - * corresponding {@link PlatformChannel.DeviceOrientation}. - */ - static PlatformChannel.DeviceOrientation deserializeDeviceOrientation(String orientation) { - if (orientation == null) - throw new UnsupportedOperationException("Could not deserialize null device orientation."); - switch (orientation) { - case "portraitUp": - return PlatformChannel.DeviceOrientation.PORTRAIT_UP; - case "portraitDown": - return PlatformChannel.DeviceOrientation.PORTRAIT_DOWN; - case "landscapeLeft": - return PlatformChannel.DeviceOrientation.LANDSCAPE_LEFT; - case "landscapeRight": - return PlatformChannel.DeviceOrientation.LANDSCAPE_RIGHT; - default: - throw new UnsupportedOperationException( - "Could not deserialize device orientation: " + orientation); + static Messages.PlatformCameraLensDirection lensDirectionFromInteger(int lensDirection) { + switch (lensDirection) { + case CameraMetadata.LENS_FACING_FRONT: + return Messages.PlatformCameraLensDirection.FRONT; + case CameraMetadata.LENS_FACING_BACK: + return Messages.PlatformCameraLensDirection.BACK; + case CameraMetadata.LENS_FACING_EXTERNAL: + return Messages.PlatformCameraLensDirection.EXTERNAL; } + // CameraMetadata is defined in the Android API. In the event that a new value is added, a + // default fallback value of FRONT is returned. + return Messages.PlatformCameraLensDirection.FRONT; } /** @@ -93,11 +64,11 @@ static PlatformChannel.DeviceOrientation deserializeDeviceOrientation(String ori * @throws CameraAccessException when the camera could not be accessed. */ @NonNull - public static List> getAvailableCameras(@NonNull Activity activity) - throws CameraAccessException { + public static List getAvailableCameras( + @NonNull Activity activity) throws CameraAccessException { CameraManager cameraManager = (CameraManager) activity.getSystemService(Context.CAMERA_SERVICE); String[] cameraNames = cameraManager.getCameraIdList(); - List> cameras = new ArrayList<>(); + List cameras = new ArrayList<>(); for (String cameraName : cameraNames) { int cameraId; try { @@ -109,26 +80,201 @@ public static List> getAvailableCameras(@NonNull Activity ac continue; } - HashMap details = new HashMap<>(); CameraCharacteristics characteristics = cameraManager.getCameraCharacteristics(cameraName); - details.put("name", cameraName); int sensorOrientation = characteristics.get(CameraCharacteristics.SENSOR_ORIENTATION); - details.put("sensorOrientation", sensorOrientation); int lensFacing = characteristics.get(CameraCharacteristics.LENS_FACING); - switch (lensFacing) { - case CameraMetadata.LENS_FACING_FRONT: - details.put("lensFacing", "front"); - break; - case CameraMetadata.LENS_FACING_BACK: - details.put("lensFacing", "back"); - break; - case CameraMetadata.LENS_FACING_EXTERNAL: - details.put("lensFacing", "external"); - break; - } + Messages.PlatformCameraLensDirection lensDirection = lensDirectionFromInteger(lensFacing); + Messages.PlatformCameraDescription details = + new Messages.PlatformCameraDescription.Builder() + .setName(cameraName) + .setSensorOrientation((long) sensorOrientation) + .setLensDirection(lensDirection) + .build(); cameras.add(details); } return cameras; } + + /** + * Converts a DeviceOrientation from the systemchannels package to a PlatformDeviceOrientation + * from Pigeon. + * + * @param orientation A DeviceOrientation. + * @return The corresponding PlatformDeviceOrientation. + */ + @NonNull + public static Messages.PlatformDeviceOrientation orientationToPigeon( + @NonNull PlatformChannel.DeviceOrientation orientation) { + switch (orientation) { + case PORTRAIT_UP: + return Messages.PlatformDeviceOrientation.PORTRAIT_UP; + case PORTRAIT_DOWN: + return Messages.PlatformDeviceOrientation.PORTRAIT_DOWN; + case LANDSCAPE_LEFT: + return Messages.PlatformDeviceOrientation.LANDSCAPE_LEFT; + case LANDSCAPE_RIGHT: + return Messages.PlatformDeviceOrientation.LANDSCAPE_RIGHT; + } + return Messages.PlatformDeviceOrientation.PORTRAIT_UP; + } + + /** + * Converts a PlatformDeviceOrientation from Pigeon to DeviceOrientation from PlatformChannel. + * + * @param orientation A PlatformDeviceOrientation + * @return The corresponding DeviceOrientation. Defaults to PORTRAIT_UP. + */ + @NonNull + public static PlatformChannel.DeviceOrientation orientationFromPigeon( + @NonNull Messages.PlatformDeviceOrientation orientation) { + switch (orientation) { + case PORTRAIT_UP: + return PlatformChannel.DeviceOrientation.PORTRAIT_UP; + case PORTRAIT_DOWN: + return PlatformChannel.DeviceOrientation.PORTRAIT_DOWN; + case LANDSCAPE_LEFT: + return PlatformChannel.DeviceOrientation.LANDSCAPE_LEFT; + case LANDSCAPE_RIGHT: + return PlatformChannel.DeviceOrientation.LANDSCAPE_RIGHT; + } + throw new IllegalStateException("Unreachable code"); + } + + /** + * Converts a FocusMode from the autofocus package to a PlatformFocusMode from Pigeon. + * + * @param focusMode A FocusMode. + * @return The corresponding PlatformFocusMode. + */ + @NonNull + public static Messages.PlatformFocusMode focusModeToPigeon(@NonNull FocusMode focusMode) { + switch (focusMode) { + case auto: + return Messages.PlatformFocusMode.AUTO; + case locked: + return Messages.PlatformFocusMode.LOCKED; + } + return Messages.PlatformFocusMode.AUTO; + } + + /** + * Converts a PlatformFocusMode from Pigeon to a FocusMode from the autofocus package. + * + * @param focusMode A PlatformFocusMode. + * @return The corresponding FocusMode. + */ + @NonNull + public static FocusMode focusModeFromPigeon(@NonNull Messages.PlatformFocusMode focusMode) { + switch (focusMode) { + case AUTO: + return FocusMode.auto; + case LOCKED: + return FocusMode.locked; + } + throw new IllegalStateException("Unreachable code"); + } + + /** + * Converts an ExposureMode from the exposurelock package to a PlatformExposureMode from Pigeon. + * + * @param exposureMode An ExposureMode. + * @return The corresponding PlatformExposureMode. + */ + @NonNull + public static Messages.PlatformExposureMode exposureModeToPigeon( + @NonNull ExposureMode exposureMode) { + switch (exposureMode) { + case auto: + return Messages.PlatformExposureMode.AUTO; + case locked: + return Messages.PlatformExposureMode.LOCKED; + } + return Messages.PlatformExposureMode.AUTO; + } + + /** + * Converts a PlatformExposureMode to ExposureMode from the exposurelock package. + * + * @param mode A PlatformExposureMode. + * @return The corresponding ExposureMode. + */ + @NonNull + public static ExposureMode exposureModeFromPigeon(@NonNull Messages.PlatformExposureMode mode) { + switch (mode) { + case AUTO: + return ExposureMode.auto; + case LOCKED: + return ExposureMode.locked; + } + throw new IllegalStateException("Unreachable code"); + } + + /** + * Converts a PlatformResolutionPreset from Pigeon to a ResolutionPreset from the resolution + * package. + * + * @param preset A PlatformResolutionPreset. + * @return The corresponding ResolutionPreset. + */ + @NonNull + public static ResolutionPreset resolutionPresetFromPigeon( + @NonNull Messages.PlatformResolutionPreset preset) { + switch (preset) { + case LOW: + return ResolutionPreset.low; + case MEDIUM: + return ResolutionPreset.medium; + case HIGH: + return ResolutionPreset.high; + case VERY_HIGH: + return ResolutionPreset.veryHigh; + case ULTRA_HIGH: + return ResolutionPreset.ultraHigh; + case MAX: + return ResolutionPreset.max; + } + throw new IllegalStateException("Unreachable code"); + } + + /** + * Converts a PlatformImageFormatGroup from Pigeon to an Integer representing an image format. + * + * @param format A PlatformImageFormatGroup. + * @return The corresponding integer code. Defaults to YUV_420_888. + */ + @NonNull + public static Integer imageFormatGroupFromPigeon( + @NonNull Messages.PlatformImageFormatGroup format) { + switch (format) { + case YUV420: + return ImageFormat.YUV_420_888; + case JPEG: + return ImageFormat.JPEG; + case NV21: + return ImageFormat.NV21; + } + throw new IllegalStateException("Unreachable code"); + } + + /** + * Converts a PlatformFlashMode from Pigeon to a FlashMode from the flash package. + * + * @param mode A PlatformFlashMode. + * @return The corresponding FlashMode. + */ + @NonNull + public static FlashMode flashModeFromPigeon(@NonNull Messages.PlatformFlashMode mode) { + switch (mode) { + case AUTO: + return FlashMode.auto; + case OFF: + return FlashMode.off; + case ALWAYS: + return FlashMode.always; + case TORCH: + return FlashMode.torch; + } + throw new IllegalStateException("Unreachable code"); + } } diff --git a/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/DartMessenger.java b/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/DartMessenger.java index e2b2ef80820d..800e823346b8 100644 --- a/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/DartMessenger.java +++ b/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/DartMessenger.java @@ -5,69 +5,36 @@ package io.flutter.plugins.camera; import android.os.Handler; -import android.text.TextUtils; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import io.flutter.embedding.engine.systemchannels.PlatformChannel; -import io.flutter.plugin.common.BinaryMessenger; import io.flutter.plugin.common.MethodChannel; import io.flutter.plugins.camera.features.autofocus.FocusMode; import io.flutter.plugins.camera.features.exposurelock.ExposureMode; -import java.util.HashMap; -import java.util.Map; /** Utility class that facilitates communication to the Flutter client */ public class DartMessenger { @NonNull private final Handler handler; - @Nullable MethodChannel cameraChannel; - @Nullable MethodChannel deviceChannel; - - /** Specifies the different device related message types. */ - enum DeviceEventType { - /** Indicates the device's orientation has changed. */ - ORIENTATION_CHANGED("orientation_changed"); - final String method; - - DeviceEventType(String method) { - this.method = method; - } - } - - /** Specifies the different camera related message types. */ - enum CameraEventType { - /** Indicates that an error occurred while interacting with the camera. */ - ERROR("error"), - /** Indicates that the camera is closing. */ - CLOSING("camera_closing"), - /** Indicates that the camera is initialized. */ - INITIALIZED("initialized"); - - final String method; - - /** - * Converts the supplied method name to the matching {@link CameraEventType}. - * - * @param method name to be converted into a {@link CameraEventType}. - */ - CameraEventType(String method) { - this.method = method; - } - } + Messages.CameraGlobalEventApi globalEventApi; + Messages.CameraEventApi eventApi; /** * Creates a new instance of the {@link DartMessenger} class. * - * @param messenger is the {@link BinaryMessenger} that is used to communicate with Flutter. - * @param cameraId identifies the camera which is the source of the communication. * @param handler the handler used to manage the thread's message queue. This should always be a * handler managing the main thread since communication with Flutter should always happen on * the main thread. The handler is mainly supplied so it will be easier test this class. + * @param globalEventApi the API used to consume calls to dart that are not tied to a specific + * camera instance. + * @param eventApi the API used to consume calls to dart that are tied to this specific camera. */ - DartMessenger(BinaryMessenger messenger, long cameraId, @NonNull Handler handler) { - cameraChannel = - new MethodChannel(messenger, "plugins.flutter.io/camera_android/camera" + cameraId); - deviceChannel = new MethodChannel(messenger, "plugins.flutter.io/camera_android/fromPlatform"); + DartMessenger( + @NonNull Handler handler, + Messages.CameraGlobalEventApi globalEventApi, + Messages.CameraEventApi eventApi) { this.handler = handler; + this.globalEventApi = globalEventApi; + this.eventApi = eventApi; } /** @@ -77,13 +44,10 @@ enum CameraEventType { */ public void sendDeviceOrientationChangeEvent( @NonNull PlatformChannel.DeviceOrientation orientation) { - this.send( - DeviceEventType.ORIENTATION_CHANGED, - new HashMap() { - { - put("orientation", CameraUtils.serializeDeviceOrientation(orientation)); - } - }); + handler.post( + () -> + globalEventApi.deviceOrientationChanged( + CameraUtils.orientationToPigeon(orientation), new NoOpVoidResult())); } /** @@ -109,23 +73,26 @@ void sendCameraInitializedEvent( assert (focusMode != null); assert (exposurePointSupported != null); assert (focusPointSupported != null); - this.send( - CameraEventType.INITIALIZED, - new HashMap() { - { - put("previewWidth", previewWidth.doubleValue()); - put("previewHeight", previewHeight.doubleValue()); - put("exposureMode", exposureMode.toString()); - put("focusMode", focusMode.toString()); - put("exposurePointSupported", exposurePointSupported); - put("focusPointSupported", focusPointSupported); - } - }); + handler.post( + () -> + eventApi.initialized( + new Messages.PlatformCameraState.Builder() + .setPreviewSize( + new Messages.PlatformSize.Builder() + .setWidth(previewWidth.doubleValue()) + .setHeight(previewHeight.doubleValue()) + .build()) + .setExposurePointSupported(exposurePointSupported) + .setFocusPointSupported(focusPointSupported) + .setExposureMode(CameraUtils.exposureModeToPigeon(exposureMode)) + .setFocusMode(CameraUtils.focusModeToPigeon(focusMode)) + .build(), + new NoOpVoidResult())); } /** Sends a message to the Flutter client informing that the camera is closing. */ void sendCameraClosingEvent() { - send(CameraEventType.CLOSING); + handler.post(() -> eventApi.closed(new NoOpVoidResult())); } /** @@ -134,44 +101,8 @@ void sendCameraClosingEvent() { * * @param description contains details regarding the error that occurred. */ - void sendCameraErrorEvent(@Nullable String description) { - this.send( - CameraEventType.ERROR, - new HashMap() { - { - if (!TextUtils.isEmpty(description)) put("description", description); - } - }); - } - - private void send(CameraEventType eventType) { - send(eventType, new HashMap<>()); - } - - private void send(CameraEventType eventType, Map args) { - if (cameraChannel == null) { - return; - } - - handler.post( - new Runnable() { - @Override - public void run() { - cameraChannel.invokeMethod(eventType.method, args); - } - }); - } - - private void send(DeviceEventType eventType) { - send(eventType, new HashMap<>()); - } - - private void send(DeviceEventType eventType, Map args) { - if (deviceChannel == null) { - return; - } - - handler.post(() -> deviceChannel.invokeMethod(eventType.method, args)); + void sendCameraErrorEvent(@NonNull String description) { + handler.post(() -> eventApi.error(description, new NoOpVoidResult())); } /** @@ -179,7 +110,7 @@ private void send(DeviceEventType eventType, Map args) { * * @param payload The payload to send. */ - public void finish(@NonNull MethodChannel.Result result, @Nullable Object payload) { + public void finish(@NonNull Messages.Result result, @NonNull T payload) { handler.post(() -> result.success(payload)); } @@ -190,11 +121,12 @@ public void finish(@NonNull MethodChannel.Result result, @Nullable Object payloa * @param errorMessage error message. * @param errorDetails error details. */ - public void error( - @NonNull MethodChannel.Result result, + public void error( + @NonNull Messages.Result result, @NonNull String errorCode, @Nullable String errorMessage, @Nullable Object errorDetails) { - handler.post(() -> result.error(errorCode, errorMessage, errorDetails)); + handler.post( + () -> result.error(new Messages.FlutterError(errorCode, errorMessage, errorDetails))); } } diff --git a/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/Messages.java b/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/Messages.java new file mode 100644 index 000000000000..bdb6e2b41387 --- /dev/null +++ b/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/Messages.java @@ -0,0 +1,1926 @@ +// 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 (v22.4.1), do not edit directly. +// See also: https://pub.dev/packages/pigeon + +package io.flutter.plugins.camera; + +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; +import io.flutter.plugin.common.BasicMessageChannel; +import io.flutter.plugin.common.BinaryMessenger; +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; +import java.util.List; +import java.util.Objects; + +/** Generated class from Pigeon. */ +@SuppressWarnings({"unused", "unchecked", "CodeBlock2Expr", "RedundantSuppression", "serial"}) +public class Messages { + + /** Error class for passing custom error details to Flutter via a thrown PlatformException. */ + public static class FlutterError extends RuntimeException { + + /** The error code. */ + public final String code; + + /** The error details. Must be a datatype supported by the api codec. */ + public final Object details; + + public FlutterError(@NonNull String code, @Nullable String message, @Nullable Object details) { + super(message); + this.code = code; + this.details = details; + } + } + + @NonNull + protected static ArrayList wrapError(@NonNull Throwable exception) { + ArrayList errorList = new ArrayList<>(3); + if (exception instanceof FlutterError) { + FlutterError error = (FlutterError) exception; + errorList.add(error.code); + errorList.add(error.getMessage()); + errorList.add(error.details); + } else { + errorList.add(exception.toString()); + errorList.add(exception.getClass().getSimpleName()); + errorList.add( + "Cause: " + exception.getCause() + ", Stacktrace: " + Log.getStackTraceString(exception)); + } + return errorList; + } + + @NonNull + protected static FlutterError createConnectionError(@NonNull String channelName) { + return new FlutterError( + "channel-error", "Unable to establish connection on channel: " + channelName + ".", ""); + } + + @Target(METHOD) + @Retention(CLASS) + @interface CanIgnoreReturnValue {} + + /** Pigeon equivalent of [CameraLensDirection]. */ + public enum PlatformCameraLensDirection { + FRONT(0), + BACK(1), + EXTERNAL(2); + + final int index; + + PlatformCameraLensDirection(final int index) { + this.index = index; + } + } + + /** Pigeon equivalent of [DeviceOrientation]. */ + public enum PlatformDeviceOrientation { + PORTRAIT_UP(0), + PORTRAIT_DOWN(1), + LANDSCAPE_LEFT(2), + LANDSCAPE_RIGHT(3); + + final int index; + + PlatformDeviceOrientation(final int index) { + this.index = index; + } + } + + /** Pigeon equivalent of [ExposureMode]. */ + public enum PlatformExposureMode { + AUTO(0), + LOCKED(1); + + final int index; + + PlatformExposureMode(final int index) { + this.index = index; + } + } + + /** Pigeon equivalent of [FocusMode]. */ + public enum PlatformFocusMode { + AUTO(0), + LOCKED(1); + + final int index; + + PlatformFocusMode(final int index) { + this.index = index; + } + } + + /** Pigeon equivalent of [ResolutionPreset]. */ + public enum PlatformResolutionPreset { + LOW(0), + MEDIUM(1), + HIGH(2), + VERY_HIGH(3), + ULTRA_HIGH(4), + MAX(5); + + final int index; + + PlatformResolutionPreset(final int index) { + this.index = index; + } + } + + /** Pigeon equivalent of [ImageFormatGroup]. */ + public enum PlatformImageFormatGroup { + /** The default for Android. */ + YUV420(0), + JPEG(1), + NV21(2); + + final int index; + + PlatformImageFormatGroup(final int index) { + this.index = index; + } + } + + /** Pigeon equivalent of [FlashMode]. */ + public enum PlatformFlashMode { + OFF(0), + AUTO(1), + ALWAYS(2), + TORCH(3); + + final int index; + + PlatformFlashMode(final int index) { + this.index = index; + } + } + + /** + * Pigeon equivalent of [CameraDescription]. + * + *

Generated class from Pigeon that represents data sent in messages. + */ + public static final class PlatformCameraDescription { + private @NonNull String name; + + public @NonNull String getName() { + return name; + } + + public void setName(@NonNull String setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"name\" is null."); + } + this.name = setterArg; + } + + private @NonNull PlatformCameraLensDirection lensDirection; + + public @NonNull PlatformCameraLensDirection getLensDirection() { + return lensDirection; + } + + public void setLensDirection(@NonNull PlatformCameraLensDirection setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"lensDirection\" is null."); + } + this.lensDirection = setterArg; + } + + private @NonNull Long sensorOrientation; + + public @NonNull Long getSensorOrientation() { + return sensorOrientation; + } + + public void setSensorOrientation(@NonNull Long setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"sensorOrientation\" is null."); + } + this.sensorOrientation = setterArg; + } + + /** Constructor is non-public to enforce null safety; use Builder. */ + PlatformCameraDescription() {} + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlatformCameraDescription that = (PlatformCameraDescription) o; + return name.equals(that.name) + && lensDirection.equals(that.lensDirection) + && sensorOrientation.equals(that.sensorOrientation); + } + + @Override + public int hashCode() { + return Objects.hash(name, lensDirection, sensorOrientation); + } + + public static final class Builder { + + private @Nullable String name; + + @CanIgnoreReturnValue + public @NonNull Builder setName(@NonNull String setterArg) { + this.name = setterArg; + return this; + } + + private @Nullable PlatformCameraLensDirection lensDirection; + + @CanIgnoreReturnValue + public @NonNull Builder setLensDirection(@NonNull PlatformCameraLensDirection setterArg) { + this.lensDirection = setterArg; + return this; + } + + private @Nullable Long sensorOrientation; + + @CanIgnoreReturnValue + public @NonNull Builder setSensorOrientation(@NonNull Long setterArg) { + this.sensorOrientation = setterArg; + return this; + } + + public @NonNull PlatformCameraDescription build() { + PlatformCameraDescription pigeonReturn = new PlatformCameraDescription(); + pigeonReturn.setName(name); + pigeonReturn.setLensDirection(lensDirection); + pigeonReturn.setSensorOrientation(sensorOrientation); + return pigeonReturn; + } + } + + @NonNull + ArrayList toList() { + ArrayList toListResult = new ArrayList<>(3); + toListResult.add(name); + toListResult.add(lensDirection); + toListResult.add(sensorOrientation); + return toListResult; + } + + static @NonNull PlatformCameraDescription fromList(@NonNull ArrayList pigeonVar_list) { + PlatformCameraDescription pigeonResult = new PlatformCameraDescription(); + Object name = pigeonVar_list.get(0); + pigeonResult.setName((String) name); + Object lensDirection = pigeonVar_list.get(1); + pigeonResult.setLensDirection((PlatformCameraLensDirection) lensDirection); + Object sensorOrientation = pigeonVar_list.get(2); + pigeonResult.setSensorOrientation((Long) sensorOrientation); + return pigeonResult; + } + } + + /** + * Data needed for [CameraInitializedEvent]. + * + *

Generated class from Pigeon that represents data sent in messages. + */ + public static final class PlatformCameraState { + private @NonNull PlatformSize previewSize; + + public @NonNull PlatformSize getPreviewSize() { + return previewSize; + } + + public void setPreviewSize(@NonNull PlatformSize setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"previewSize\" is null."); + } + this.previewSize = setterArg; + } + + private @NonNull PlatformExposureMode exposureMode; + + public @NonNull PlatformExposureMode getExposureMode() { + return exposureMode; + } + + public void setExposureMode(@NonNull PlatformExposureMode setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"exposureMode\" is null."); + } + this.exposureMode = setterArg; + } + + private @NonNull PlatformFocusMode focusMode; + + public @NonNull PlatformFocusMode getFocusMode() { + return focusMode; + } + + public void setFocusMode(@NonNull PlatformFocusMode setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"focusMode\" is null."); + } + this.focusMode = setterArg; + } + + private @NonNull Boolean exposurePointSupported; + + public @NonNull Boolean getExposurePointSupported() { + return exposurePointSupported; + } + + public void setExposurePointSupported(@NonNull Boolean setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"exposurePointSupported\" is null."); + } + this.exposurePointSupported = setterArg; + } + + private @NonNull Boolean focusPointSupported; + + public @NonNull Boolean getFocusPointSupported() { + return focusPointSupported; + } + + public void setFocusPointSupported(@NonNull Boolean setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"focusPointSupported\" is null."); + } + this.focusPointSupported = setterArg; + } + + /** Constructor is non-public to enforce null safety; use Builder. */ + PlatformCameraState() {} + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlatformCameraState that = (PlatformCameraState) o; + return previewSize.equals(that.previewSize) + && exposureMode.equals(that.exposureMode) + && focusMode.equals(that.focusMode) + && exposurePointSupported.equals(that.exposurePointSupported) + && focusPointSupported.equals(that.focusPointSupported); + } + + @Override + public int hashCode() { + return Objects.hash( + previewSize, exposureMode, focusMode, exposurePointSupported, focusPointSupported); + } + + public static final class Builder { + + private @Nullable PlatformSize previewSize; + + @CanIgnoreReturnValue + public @NonNull Builder setPreviewSize(@NonNull PlatformSize setterArg) { + this.previewSize = setterArg; + return this; + } + + private @Nullable PlatformExposureMode exposureMode; + + @CanIgnoreReturnValue + public @NonNull Builder setExposureMode(@NonNull PlatformExposureMode setterArg) { + this.exposureMode = setterArg; + return this; + } + + private @Nullable PlatformFocusMode focusMode; + + @CanIgnoreReturnValue + public @NonNull Builder setFocusMode(@NonNull PlatformFocusMode setterArg) { + this.focusMode = setterArg; + return this; + } + + private @Nullable Boolean exposurePointSupported; + + @CanIgnoreReturnValue + public @NonNull Builder setExposurePointSupported(@NonNull Boolean setterArg) { + this.exposurePointSupported = setterArg; + return this; + } + + private @Nullable Boolean focusPointSupported; + + @CanIgnoreReturnValue + public @NonNull Builder setFocusPointSupported(@NonNull Boolean setterArg) { + this.focusPointSupported = setterArg; + return this; + } + + public @NonNull PlatformCameraState build() { + PlatformCameraState pigeonReturn = new PlatformCameraState(); + pigeonReturn.setPreviewSize(previewSize); + pigeonReturn.setExposureMode(exposureMode); + pigeonReturn.setFocusMode(focusMode); + pigeonReturn.setExposurePointSupported(exposurePointSupported); + pigeonReturn.setFocusPointSupported(focusPointSupported); + return pigeonReturn; + } + } + + @NonNull + ArrayList toList() { + ArrayList toListResult = new ArrayList<>(5); + toListResult.add(previewSize); + toListResult.add(exposureMode); + toListResult.add(focusMode); + toListResult.add(exposurePointSupported); + toListResult.add(focusPointSupported); + return toListResult; + } + + static @NonNull PlatformCameraState fromList(@NonNull ArrayList pigeonVar_list) { + PlatformCameraState pigeonResult = new PlatformCameraState(); + Object previewSize = pigeonVar_list.get(0); + pigeonResult.setPreviewSize((PlatformSize) previewSize); + Object exposureMode = pigeonVar_list.get(1); + pigeonResult.setExposureMode((PlatformExposureMode) exposureMode); + Object focusMode = pigeonVar_list.get(2); + pigeonResult.setFocusMode((PlatformFocusMode) focusMode); + Object exposurePointSupported = pigeonVar_list.get(3); + pigeonResult.setExposurePointSupported((Boolean) exposurePointSupported); + Object focusPointSupported = pigeonVar_list.get(4); + pigeonResult.setFocusPointSupported((Boolean) focusPointSupported); + return pigeonResult; + } + } + + /** + * Pigeon equivalent of [Size]. + * + *

Generated class from Pigeon that represents data sent in messages. + */ + public static final class PlatformSize { + private @NonNull Double width; + + public @NonNull Double getWidth() { + return width; + } + + public void setWidth(@NonNull Double setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"width\" is null."); + } + this.width = setterArg; + } + + private @NonNull Double height; + + public @NonNull Double getHeight() { + return height; + } + + public void setHeight(@NonNull Double setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"height\" is null."); + } + this.height = setterArg; + } + + /** Constructor is non-public to enforce null safety; use Builder. */ + PlatformSize() {} + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlatformSize that = (PlatformSize) o; + return width.equals(that.width) && height.equals(that.height); + } + + @Override + public int hashCode() { + return Objects.hash(width, height); + } + + public static final class Builder { + + private @Nullable Double width; + + @CanIgnoreReturnValue + public @NonNull Builder setWidth(@NonNull Double setterArg) { + this.width = setterArg; + return this; + } + + private @Nullable Double height; + + @CanIgnoreReturnValue + public @NonNull Builder setHeight(@NonNull Double setterArg) { + this.height = setterArg; + return this; + } + + public @NonNull PlatformSize build() { + PlatformSize pigeonReturn = new PlatformSize(); + pigeonReturn.setWidth(width); + pigeonReturn.setHeight(height); + return pigeonReturn; + } + } + + @NonNull + ArrayList toList() { + ArrayList toListResult = new ArrayList<>(2); + toListResult.add(width); + toListResult.add(height); + return toListResult; + } + + static @NonNull PlatformSize fromList(@NonNull ArrayList pigeonVar_list) { + PlatformSize pigeonResult = new PlatformSize(); + Object width = pigeonVar_list.get(0); + pigeonResult.setWidth((Double) width); + Object height = pigeonVar_list.get(1); + pigeonResult.setHeight((Double) height); + return pigeonResult; + } + } + + /** + * Pigeon equivalent of [Point]. + * + *

Generated class from Pigeon that represents data sent in messages. + */ + public static final class PlatformPoint { + private @NonNull Double x; + + public @NonNull Double getX() { + return x; + } + + public void setX(@NonNull Double setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"x\" is null."); + } + this.x = setterArg; + } + + private @NonNull Double y; + + public @NonNull Double getY() { + return y; + } + + public void setY(@NonNull Double setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"y\" is null."); + } + this.y = setterArg; + } + + /** Constructor is non-public to enforce null safety; use Builder. */ + PlatformPoint() {} + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlatformPoint that = (PlatformPoint) o; + return x.equals(that.x) && y.equals(that.y); + } + + @Override + public int hashCode() { + return Objects.hash(x, y); + } + + public static final class Builder { + + private @Nullable Double x; + + @CanIgnoreReturnValue + public @NonNull Builder setX(@NonNull Double setterArg) { + this.x = setterArg; + return this; + } + + private @Nullable Double y; + + @CanIgnoreReturnValue + public @NonNull Builder setY(@NonNull Double setterArg) { + this.y = setterArg; + return this; + } + + public @NonNull PlatformPoint build() { + PlatformPoint pigeonReturn = new PlatformPoint(); + pigeonReturn.setX(x); + pigeonReturn.setY(y); + return pigeonReturn; + } + } + + @NonNull + ArrayList toList() { + ArrayList toListResult = new ArrayList<>(2); + toListResult.add(x); + toListResult.add(y); + return toListResult; + } + + static @NonNull PlatformPoint fromList(@NonNull ArrayList pigeonVar_list) { + PlatformPoint pigeonResult = new PlatformPoint(); + Object x = pigeonVar_list.get(0); + pigeonResult.setX((Double) x); + Object y = pigeonVar_list.get(1); + pigeonResult.setY((Double) y); + return pigeonResult; + } + } + + /** + * Pigeon equivalent of [MediaSettings]. + * + *

Generated class from Pigeon that represents data sent in messages. + */ + public static final class PlatformMediaSettings { + private @NonNull PlatformResolutionPreset resolutionPreset; + + public @NonNull PlatformResolutionPreset getResolutionPreset() { + return resolutionPreset; + } + + public void setResolutionPreset(@NonNull PlatformResolutionPreset setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"resolutionPreset\" is null."); + } + this.resolutionPreset = setterArg; + } + + private @Nullable Long fps; + + public @Nullable Long getFps() { + return fps; + } + + public void setFps(@Nullable Long setterArg) { + this.fps = setterArg; + } + + private @Nullable Long videoBitrate; + + public @Nullable Long getVideoBitrate() { + return videoBitrate; + } + + public void setVideoBitrate(@Nullable Long setterArg) { + this.videoBitrate = setterArg; + } + + private @Nullable Long audioBitrate; + + public @Nullable Long getAudioBitrate() { + return audioBitrate; + } + + public void setAudioBitrate(@Nullable Long setterArg) { + this.audioBitrate = setterArg; + } + + private @NonNull Boolean enableAudio; + + public @NonNull Boolean getEnableAudio() { + return enableAudio; + } + + public void setEnableAudio(@NonNull Boolean setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"enableAudio\" is null."); + } + this.enableAudio = setterArg; + } + + /** Constructor is non-public to enforce null safety; use Builder. */ + PlatformMediaSettings() {} + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlatformMediaSettings that = (PlatformMediaSettings) o; + return resolutionPreset.equals(that.resolutionPreset) + && Objects.equals(fps, that.fps) + && Objects.equals(videoBitrate, that.videoBitrate) + && Objects.equals(audioBitrate, that.audioBitrate) + && enableAudio.equals(that.enableAudio); + } + + @Override + public int hashCode() { + return Objects.hash(resolutionPreset, fps, videoBitrate, audioBitrate, enableAudio); + } + + public static final class Builder { + + private @Nullable PlatformResolutionPreset resolutionPreset; + + @CanIgnoreReturnValue + public @NonNull Builder setResolutionPreset(@NonNull PlatformResolutionPreset setterArg) { + this.resolutionPreset = setterArg; + return this; + } + + private @Nullable Long fps; + + @CanIgnoreReturnValue + public @NonNull Builder setFps(@Nullable Long setterArg) { + this.fps = setterArg; + return this; + } + + private @Nullable Long videoBitrate; + + @CanIgnoreReturnValue + public @NonNull Builder setVideoBitrate(@Nullable Long setterArg) { + this.videoBitrate = setterArg; + return this; + } + + private @Nullable Long audioBitrate; + + @CanIgnoreReturnValue + public @NonNull Builder setAudioBitrate(@Nullable Long setterArg) { + this.audioBitrate = setterArg; + return this; + } + + private @Nullable Boolean enableAudio; + + @CanIgnoreReturnValue + public @NonNull Builder setEnableAudio(@NonNull Boolean setterArg) { + this.enableAudio = setterArg; + return this; + } + + public @NonNull PlatformMediaSettings build() { + PlatformMediaSettings pigeonReturn = new PlatformMediaSettings(); + pigeonReturn.setResolutionPreset(resolutionPreset); + pigeonReturn.setFps(fps); + pigeonReturn.setVideoBitrate(videoBitrate); + pigeonReturn.setAudioBitrate(audioBitrate); + pigeonReturn.setEnableAudio(enableAudio); + return pigeonReturn; + } + } + + @NonNull + ArrayList toList() { + ArrayList toListResult = new ArrayList<>(5); + toListResult.add(resolutionPreset); + toListResult.add(fps); + toListResult.add(videoBitrate); + toListResult.add(audioBitrate); + toListResult.add(enableAudio); + return toListResult; + } + + static @NonNull PlatformMediaSettings fromList(@NonNull ArrayList pigeonVar_list) { + PlatformMediaSettings pigeonResult = new PlatformMediaSettings(); + Object resolutionPreset = pigeonVar_list.get(0); + pigeonResult.setResolutionPreset((PlatformResolutionPreset) resolutionPreset); + Object fps = pigeonVar_list.get(1); + pigeonResult.setFps((Long) fps); + Object videoBitrate = pigeonVar_list.get(2); + pigeonResult.setVideoBitrate((Long) videoBitrate); + Object audioBitrate = pigeonVar_list.get(3); + pigeonResult.setAudioBitrate((Long) audioBitrate); + Object enableAudio = pigeonVar_list.get(4); + pigeonResult.setEnableAudio((Boolean) enableAudio); + return pigeonResult; + } + } + + private static class PigeonCodec extends StandardMessageCodec { + public static final PigeonCodec INSTANCE = new PigeonCodec(); + + private PigeonCodec() {} + + @Override + protected Object readValueOfType(byte type, @NonNull ByteBuffer buffer) { + switch (type) { + case (byte) 129: + { + Object value = readValue(buffer); + return value == null + ? null + : PlatformCameraLensDirection.values()[((Long) value).intValue()]; + } + case (byte) 130: + { + Object value = readValue(buffer); + return value == null + ? null + : PlatformDeviceOrientation.values()[((Long) value).intValue()]; + } + case (byte) 131: + { + Object value = readValue(buffer); + return value == null ? null : PlatformExposureMode.values()[((Long) value).intValue()]; + } + case (byte) 132: + { + Object value = readValue(buffer); + return value == null ? null : PlatformFocusMode.values()[((Long) value).intValue()]; + } + case (byte) 133: + { + Object value = readValue(buffer); + return value == null + ? null + : PlatformResolutionPreset.values()[((Long) value).intValue()]; + } + case (byte) 134: + { + Object value = readValue(buffer); + return value == null + ? null + : PlatformImageFormatGroup.values()[((Long) value).intValue()]; + } + case (byte) 135: + { + Object value = readValue(buffer); + return value == null ? null : PlatformFlashMode.values()[((Long) value).intValue()]; + } + case (byte) 136: + return PlatformCameraDescription.fromList((ArrayList) readValue(buffer)); + case (byte) 137: + return PlatformCameraState.fromList((ArrayList) readValue(buffer)); + case (byte) 138: + return PlatformSize.fromList((ArrayList) readValue(buffer)); + case (byte) 139: + return PlatformPoint.fromList((ArrayList) readValue(buffer)); + case (byte) 140: + return PlatformMediaSettings.fromList((ArrayList) readValue(buffer)); + default: + return super.readValueOfType(type, buffer); + } + } + + @Override + protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { + if (value instanceof PlatformCameraLensDirection) { + stream.write(129); + writeValue(stream, value == null ? null : ((PlatformCameraLensDirection) value).index); + } else if (value instanceof PlatformDeviceOrientation) { + stream.write(130); + writeValue(stream, value == null ? null : ((PlatformDeviceOrientation) value).index); + } else if (value instanceof PlatformExposureMode) { + stream.write(131); + writeValue(stream, value == null ? null : ((PlatformExposureMode) value).index); + } else if (value instanceof PlatformFocusMode) { + stream.write(132); + writeValue(stream, value == null ? null : ((PlatformFocusMode) value).index); + } else if (value instanceof PlatformResolutionPreset) { + stream.write(133); + writeValue(stream, value == null ? null : ((PlatformResolutionPreset) value).index); + } else if (value instanceof PlatformImageFormatGroup) { + stream.write(134); + writeValue(stream, value == null ? null : ((PlatformImageFormatGroup) value).index); + } else if (value instanceof PlatformFlashMode) { + stream.write(135); + writeValue(stream, value == null ? null : ((PlatformFlashMode) value).index); + } else if (value instanceof PlatformCameraDescription) { + stream.write(136); + writeValue(stream, ((PlatformCameraDescription) value).toList()); + } else if (value instanceof PlatformCameraState) { + stream.write(137); + writeValue(stream, ((PlatformCameraState) value).toList()); + } else if (value instanceof PlatformSize) { + stream.write(138); + writeValue(stream, ((PlatformSize) value).toList()); + } else if (value instanceof PlatformPoint) { + stream.write(139); + writeValue(stream, ((PlatformPoint) value).toList()); + } else if (value instanceof PlatformMediaSettings) { + stream.write(140); + writeValue(stream, ((PlatformMediaSettings) value).toList()); + } else { + super.writeValue(stream, value); + } + } + } + + /** Asynchronous error handling return type for non-nullable API method returns. */ + public interface Result { + /** Success case callback method for handling returns. */ + void success(@NonNull T result); + + /** Failure case callback method for handling errors. */ + void error(@NonNull Throwable error); + } + /** Asynchronous error handling return type for nullable API method returns. */ + public interface NullableResult { + /** Success case callback method for handling returns. */ + void success(@Nullable T result); + + /** Failure case callback method for handling errors. */ + void error(@NonNull Throwable error); + } + /** Asynchronous error handling return type for void API method returns. */ + public interface VoidResult { + /** Success case callback method for handling returns. */ + void success(); + + /** Failure case callback method for handling errors. */ + void error(@NonNull Throwable error); + } + /** + * Handles calls from Dart to the native side. + * + *

Generated interface from Pigeon that represents a handler of messages from Flutter. + */ + public interface CameraApi { + /** Returns the list of available cameras. */ + @NonNull + List getAvailableCameras(); + /** Creates a new camera with the given name and settings and returns its ID. */ + void create( + @NonNull String cameraName, + @NonNull PlatformMediaSettings mediaSettings, + @NonNull Result result); + /** Initializes the camera with the given ID for the given image format. */ + void initialize(@NonNull PlatformImageFormatGroup imageFormat); + /** Disposes of the camera with the given ID. */ + void dispose(); + /** Locks the camera with the given ID to the given orientation. */ + void lockCaptureOrientation(@NonNull PlatformDeviceOrientation orientation); + /** Unlocks the orientation for the camera with the given ID. */ + void unlockCaptureOrientation(); + /** Takes a picture on the camera with the given ID and returns a path to the resulting file. */ + void takePicture(@NonNull Result result); + /** Starts recording a video on the camera with the given ID. */ + void startVideoRecording(@NonNull Boolean enableStream); + /** + * Ends video recording on the camera with the given ID and returns the path to the resulting + * file. + */ + @NonNull + String stopVideoRecording(); + /** Pauses video recording on the camera with the given ID. */ + void pauseVideoRecording(); + /** Resumes previously paused video recording on the camera with the given ID. */ + void resumeVideoRecording(); + /** Begins streaming frames from the camera. */ + void startImageStream(); + /** Stops streaming frames from the camera. */ + void stopImageStream(); + /** Sets the flash mode of the camera with the given ID. */ + void setFlashMode(@NonNull PlatformFlashMode flashMode, @NonNull VoidResult result); + /** Sets the exposure mode of the camera with the given ID. */ + void setExposureMode(@NonNull PlatformExposureMode exposureMode, @NonNull VoidResult result); + /** + * Sets the exposure point of the camera with the given ID. + * + *

A null value resets to the default exposure point. + */ + void setExposurePoint(@Nullable PlatformPoint point, @NonNull VoidResult result); + /** Returns the minimum exposure offset of the camera with the given ID. */ + @NonNull + Double getMinExposureOffset(); + /** Returns the maximum exposure offset of the camera with the given ID. */ + @NonNull + Double getMaxExposureOffset(); + /** Returns the exposure step size of the camera with the given ID. */ + @NonNull + Double getExposureOffsetStepSize(); + /** + * Sets the exposure offset of the camera with the given ID and returns the actual exposure + * offset. + */ + void setExposureOffset(@NonNull Double offset, @NonNull Result result); + /** Sets the focus mode of the camera with the given ID. */ + void setFocusMode(@NonNull PlatformFocusMode focusMode); + /** + * Sets the focus point of the camera with the given ID. + * + *

A null value resets to the default focus point. + */ + void setFocusPoint(@Nullable PlatformPoint point, @NonNull VoidResult result); + /** Returns the maximum zoom level of the camera with the given ID. */ + @NonNull + Double getMaxZoomLevel(); + /** Returns the minimum zoom level of the camera with the given ID. */ + @NonNull + Double getMinZoomLevel(); + /** Sets the zoom level of the camera with the given ID. */ + void setZoomLevel(@NonNull Double zoom, @NonNull VoidResult result); + /** Pauses streaming of preview frames. */ + void pausePreview(); + /** Resumes previously paused streaming of preview frames. */ + void resumePreview(); + /** + * Changes the camera while recording video. + * + *

This should be called only while video recording is active. + */ + void setDescriptionWhileRecording(@NonNull String description); + + /** The codec used by CameraApi. */ + static @NonNull MessageCodec getCodec() { + return PigeonCodec.INSTANCE; + } + /** Sets up an instance of `CameraApi` to handle messages through the `binaryMessenger`. */ + static void setUp(@NonNull BinaryMessenger binaryMessenger, @Nullable CameraApi api) { + setUp(binaryMessenger, "", api); + } + + static void setUp( + @NonNull BinaryMessenger binaryMessenger, + @NonNull String messageChannelSuffix, + @Nullable CameraApi api) { + messageChannelSuffix = messageChannelSuffix.isEmpty() ? "" : "." + messageChannelSuffix; + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.camera_android.CameraApi.getAvailableCameras" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + try { + List output = api.getAvailableCameras(); + wrapped.add(0, output); + } catch (Throwable exception) { + wrapped = wrapError(exception); + } + reply.reply(wrapped); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.camera_android.CameraApi.create" + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + String cameraNameArg = (String) args.get(0); + PlatformMediaSettings mediaSettingsArg = (PlatformMediaSettings) args.get(1); + Result resultCallback = + new Result() { + public void success(Long result) { + wrapped.add(0, result); + reply.reply(wrapped); + } + + public void error(Throwable error) { + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); + } + }; + + api.create(cameraNameArg, mediaSettingsArg, resultCallback); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.camera_android.CameraApi.initialize" + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + PlatformImageFormatGroup imageFormatArg = (PlatformImageFormatGroup) args.get(0); + try { + api.initialize(imageFormatArg); + wrapped.add(0, null); + } catch (Throwable exception) { + wrapped = wrapError(exception); + } + reply.reply(wrapped); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.camera_android.CameraApi.dispose" + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + try { + api.dispose(); + wrapped.add(0, null); + } catch (Throwable exception) { + wrapped = wrapError(exception); + } + reply.reply(wrapped); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.camera_android.CameraApi.lockCaptureOrientation" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + PlatformDeviceOrientation orientationArg = (PlatformDeviceOrientation) args.get(0); + try { + api.lockCaptureOrientation(orientationArg); + wrapped.add(0, null); + } catch (Throwable exception) { + wrapped = wrapError(exception); + } + reply.reply(wrapped); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.camera_android.CameraApi.unlockCaptureOrientation" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + try { + api.unlockCaptureOrientation(); + wrapped.add(0, null); + } catch (Throwable exception) { + wrapped = wrapError(exception); + } + reply.reply(wrapped); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.camera_android.CameraApi.takePicture" + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + Result resultCallback = + new Result() { + public void success(String result) { + wrapped.add(0, result); + reply.reply(wrapped); + } + + public void error(Throwable error) { + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); + } + }; + + api.takePicture(resultCallback); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.camera_android.CameraApi.startVideoRecording" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + Boolean enableStreamArg = (Boolean) args.get(0); + try { + api.startVideoRecording(enableStreamArg); + wrapped.add(0, null); + } catch (Throwable exception) { + wrapped = wrapError(exception); + } + reply.reply(wrapped); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.camera_android.CameraApi.stopVideoRecording" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + try { + String output = api.stopVideoRecording(); + wrapped.add(0, output); + } catch (Throwable exception) { + wrapped = wrapError(exception); + } + reply.reply(wrapped); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.camera_android.CameraApi.pauseVideoRecording" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + try { + api.pauseVideoRecording(); + wrapped.add(0, null); + } catch (Throwable exception) { + wrapped = wrapError(exception); + } + reply.reply(wrapped); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.camera_android.CameraApi.resumeVideoRecording" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + try { + api.resumeVideoRecording(); + wrapped.add(0, null); + } catch (Throwable exception) { + wrapped = wrapError(exception); + } + reply.reply(wrapped); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.camera_android.CameraApi.startImageStream" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + try { + api.startImageStream(); + wrapped.add(0, null); + } catch (Throwable exception) { + wrapped = wrapError(exception); + } + reply.reply(wrapped); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.camera_android.CameraApi.stopImageStream" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + try { + api.stopImageStream(); + wrapped.add(0, null); + } catch (Throwable exception) { + wrapped = wrapError(exception); + } + reply.reply(wrapped); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.camera_android.CameraApi.setFlashMode" + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + PlatformFlashMode flashModeArg = (PlatformFlashMode) args.get(0); + VoidResult resultCallback = + new VoidResult() { + public void success() { + wrapped.add(0, null); + reply.reply(wrapped); + } + + public void error(Throwable error) { + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); + } + }; + + api.setFlashMode(flashModeArg, resultCallback); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.camera_android.CameraApi.setExposureMode" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + PlatformExposureMode exposureModeArg = (PlatformExposureMode) args.get(0); + VoidResult resultCallback = + new VoidResult() { + public void success() { + wrapped.add(0, null); + reply.reply(wrapped); + } + + public void error(Throwable error) { + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); + } + }; + + api.setExposureMode(exposureModeArg, resultCallback); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.camera_android.CameraApi.setExposurePoint" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + PlatformPoint pointArg = (PlatformPoint) args.get(0); + VoidResult resultCallback = + new VoidResult() { + public void success() { + wrapped.add(0, null); + reply.reply(wrapped); + } + + public void error(Throwable error) { + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); + } + }; + + api.setExposurePoint(pointArg, resultCallback); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.camera_android.CameraApi.getMinExposureOffset" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + try { + Double output = api.getMinExposureOffset(); + wrapped.add(0, output); + } catch (Throwable exception) { + wrapped = wrapError(exception); + } + reply.reply(wrapped); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.camera_android.CameraApi.getMaxExposureOffset" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + try { + Double output = api.getMaxExposureOffset(); + wrapped.add(0, output); + } catch (Throwable exception) { + wrapped = wrapError(exception); + } + reply.reply(wrapped); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.camera_android.CameraApi.getExposureOffsetStepSize" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + try { + Double output = api.getExposureOffsetStepSize(); + wrapped.add(0, output); + } catch (Throwable exception) { + wrapped = wrapError(exception); + } + reply.reply(wrapped); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.camera_android.CameraApi.setExposureOffset" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + Double offsetArg = (Double) args.get(0); + Result resultCallback = + new Result() { + public void success(Double result) { + wrapped.add(0, result); + reply.reply(wrapped); + } + + public void error(Throwable error) { + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); + } + }; + + api.setExposureOffset(offsetArg, resultCallback); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.camera_android.CameraApi.setFocusMode" + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + PlatformFocusMode focusModeArg = (PlatformFocusMode) args.get(0); + try { + api.setFocusMode(focusModeArg); + wrapped.add(0, null); + } catch (Throwable exception) { + wrapped = wrapError(exception); + } + reply.reply(wrapped); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.camera_android.CameraApi.setFocusPoint" + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + PlatformPoint pointArg = (PlatformPoint) args.get(0); + VoidResult resultCallback = + new VoidResult() { + public void success() { + wrapped.add(0, null); + reply.reply(wrapped); + } + + public void error(Throwable error) { + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); + } + }; + + api.setFocusPoint(pointArg, resultCallback); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.camera_android.CameraApi.getMaxZoomLevel" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + try { + Double output = api.getMaxZoomLevel(); + wrapped.add(0, output); + } catch (Throwable exception) { + wrapped = wrapError(exception); + } + reply.reply(wrapped); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.camera_android.CameraApi.getMinZoomLevel" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + try { + Double output = api.getMinZoomLevel(); + wrapped.add(0, output); + } catch (Throwable exception) { + wrapped = wrapError(exception); + } + reply.reply(wrapped); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.camera_android.CameraApi.setZoomLevel" + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + Double zoomArg = (Double) args.get(0); + VoidResult resultCallback = + new VoidResult() { + public void success() { + wrapped.add(0, null); + reply.reply(wrapped); + } + + public void error(Throwable error) { + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); + } + }; + + api.setZoomLevel(zoomArg, resultCallback); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.camera_android.CameraApi.pausePreview" + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + try { + api.pausePreview(); + wrapped.add(0, null); + } catch (Throwable exception) { + wrapped = wrapError(exception); + } + reply.reply(wrapped); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.camera_android.CameraApi.resumePreview" + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + try { + api.resumePreview(); + wrapped.add(0, null); + } catch (Throwable exception) { + wrapped = wrapError(exception); + } + reply.reply(wrapped); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.camera_android.CameraApi.setDescriptionWhileRecording" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + String descriptionArg = (String) args.get(0); + try { + api.setDescriptionWhileRecording(descriptionArg); + wrapped.add(0, null); + } catch (Throwable exception) { + wrapped = wrapError(exception); + } + reply.reply(wrapped); + }); + } else { + channel.setMessageHandler(null); + } + } + } + } + /** + * Handles calls from native side to Dart that are not camera-specific. + * + *

Generated class from Pigeon that represents Flutter messages that can be called from Java. + */ + public static class CameraGlobalEventApi { + private final @NonNull BinaryMessenger binaryMessenger; + private final String messageChannelSuffix; + + public CameraGlobalEventApi(@NonNull BinaryMessenger argBinaryMessenger) { + this(argBinaryMessenger, ""); + } + + public CameraGlobalEventApi( + @NonNull BinaryMessenger argBinaryMessenger, @NonNull String messageChannelSuffix) { + this.binaryMessenger = argBinaryMessenger; + this.messageChannelSuffix = messageChannelSuffix.isEmpty() ? "" : "." + messageChannelSuffix; + } + + /** Public interface for sending reply. The codec used by CameraGlobalEventApi. */ + static @NonNull MessageCodec getCodec() { + return PigeonCodec.INSTANCE; + } + /** Called when the device's physical orientation changes. */ + public void deviceOrientationChanged( + @NonNull PlatformDeviceOrientation orientationArg, @NonNull VoidResult result) { + final String channelName = + "dev.flutter.pigeon.camera_android.CameraGlobalEventApi.deviceOrientationChanged" + + messageChannelSuffix; + BasicMessageChannel channel = + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + channel.send( + new ArrayList<>(Collections.singletonList(orientationArg)), + channelReply -> { + if (channelReply instanceof List) { + List listReply = (List) channelReply; + if (listReply.size() > 1) { + result.error( + new FlutterError( + (String) listReply.get(0), (String) listReply.get(1), listReply.get(2))); + } else { + result.success(); + } + } else { + result.error(createConnectionError(channelName)); + } + }); + } + } + /** + * Handles device-specific calls from native side to Dart. + * + *

Generated class from Pigeon that represents Flutter messages that can be called from Java. + */ + public static class CameraEventApi { + private final @NonNull BinaryMessenger binaryMessenger; + private final String messageChannelSuffix; + + public CameraEventApi(@NonNull BinaryMessenger argBinaryMessenger) { + this(argBinaryMessenger, ""); + } + + public CameraEventApi( + @NonNull BinaryMessenger argBinaryMessenger, @NonNull String messageChannelSuffix) { + this.binaryMessenger = argBinaryMessenger; + this.messageChannelSuffix = messageChannelSuffix.isEmpty() ? "" : "." + messageChannelSuffix; + } + + /** Public interface for sending reply. The codec used by CameraEventApi. */ + static @NonNull MessageCodec getCodec() { + return PigeonCodec.INSTANCE; + } + /** Called when the camera is initialized. */ + public void initialized( + @NonNull PlatformCameraState initialStateArg, @NonNull VoidResult result) { + final String channelName = + "dev.flutter.pigeon.camera_android.CameraEventApi.initialized" + messageChannelSuffix; + BasicMessageChannel channel = + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + channel.send( + new ArrayList<>(Collections.singletonList(initialStateArg)), + channelReply -> { + if (channelReply instanceof List) { + List listReply = (List) channelReply; + if (listReply.size() > 1) { + result.error( + new FlutterError( + (String) listReply.get(0), (String) listReply.get(1), listReply.get(2))); + } else { + result.success(); + } + } else { + result.error(createConnectionError(channelName)); + } + }); + } + /** Called when an error occurs in the camera. */ + public void error(@NonNull String messageArg, @NonNull VoidResult result) { + final String channelName = + "dev.flutter.pigeon.camera_android.CameraEventApi.error" + messageChannelSuffix; + BasicMessageChannel channel = + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + channel.send( + new ArrayList<>(Collections.singletonList(messageArg)), + channelReply -> { + if (channelReply instanceof List) { + List listReply = (List) channelReply; + if (listReply.size() > 1) { + result.error( + new FlutterError( + (String) listReply.get(0), (String) listReply.get(1), listReply.get(2))); + } else { + result.success(); + } + } else { + result.error(createConnectionError(channelName)); + } + }); + } + /** Called when the camera closes. */ + public void closed(@NonNull VoidResult result) { + final String channelName = + "dev.flutter.pigeon.camera_android.CameraEventApi.closed" + messageChannelSuffix; + BasicMessageChannel channel = + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + channel.send( + null, + channelReply -> { + if (channelReply instanceof List) { + List listReply = (List) channelReply; + if (listReply.size() > 1) { + result.error( + new FlutterError( + (String) listReply.get(0), (String) listReply.get(1), listReply.get(2))); + } else { + result.success(); + } + } else { + result.error(createConnectionError(channelName)); + } + }); + } + } +} diff --git a/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/MethodCallHandlerImpl.java b/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/MethodCallHandlerImpl.java deleted file mode 100644 index eae8c650fe60..000000000000 --- a/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/MethodCallHandlerImpl.java +++ /dev/null @@ -1,433 +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. - -package io.flutter.plugins.camera; - -import android.app.Activity; -import android.hardware.camera2.CameraAccessException; -import android.os.Handler; -import android.os.Looper; -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; -import androidx.annotation.VisibleForTesting; -import io.flutter.embedding.engine.systemchannels.PlatformChannel; -import io.flutter.plugin.common.BinaryMessenger; -import io.flutter.plugin.common.EventChannel; -import io.flutter.plugin.common.MethodCall; -import io.flutter.plugin.common.MethodChannel; -import io.flutter.plugin.common.MethodChannel.Result; -import io.flutter.plugins.camera.CameraPermissions.PermissionsRegistry; -import io.flutter.plugins.camera.features.CameraFeatureFactoryImpl; -import io.flutter.plugins.camera.features.Point; -import io.flutter.plugins.camera.features.autofocus.FocusMode; -import io.flutter.plugins.camera.features.exposurelock.ExposureMode; -import io.flutter.plugins.camera.features.flash.FlashMode; -import io.flutter.plugins.camera.features.resolution.ResolutionPreset; -import io.flutter.view.TextureRegistry; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; - -final class MethodCallHandlerImpl implements MethodChannel.MethodCallHandler { - private final Activity activity; - private final BinaryMessenger messenger; - private final CameraPermissions cameraPermissions; - private final PermissionsRegistry permissionsRegistry; - private final TextureRegistry textureRegistry; - private final MethodChannel methodChannel; - private final EventChannel imageStreamChannel; - @VisibleForTesting @Nullable Camera camera; - - MethodCallHandlerImpl( - Activity activity, - BinaryMessenger messenger, - CameraPermissions cameraPermissions, - PermissionsRegistry permissionsAdder, - TextureRegistry textureRegistry) { - this.activity = activity; - this.messenger = messenger; - this.cameraPermissions = cameraPermissions; - this.permissionsRegistry = permissionsAdder; - this.textureRegistry = textureRegistry; - - methodChannel = new MethodChannel(messenger, "plugins.flutter.io/camera_android"); - imageStreamChannel = - new EventChannel(messenger, "plugins.flutter.io/camera_android/imageStream"); - methodChannel.setMethodCallHandler(this); - } - - @Override - public void onMethodCall(@NonNull MethodCall call, @NonNull final Result result) { - switch (call.method) { - case "availableCameras": - try { - result.success(CameraUtils.getAvailableCameras(activity)); - } catch (Exception e) { - handleException(e, result); - } - break; - case "create": - { - if (camera != null) { - camera.close(); - } - - cameraPermissions.requestPermissions( - activity, - permissionsRegistry, - call.argument("enableAudio"), - (String errCode, String errDesc) -> { - if (errCode == null) { - try { - instantiateCamera(call, result); - } catch (Exception e) { - handleException(e, result); - } - } else { - result.error(errCode, errDesc, null); - } - }); - break; - } - case "initialize": - { - if (camera != null) { - try { - camera.open(call.argument("imageFormatGroup")); - result.success(null); - } catch (Exception e) { - handleException(e, result); - } - } else { - result.error( - "cameraNotFound", - "Camera not found. Please call the 'create' method before calling 'initialize'.", - null); - } - break; - } - case "takePicture": - { - camera.takePicture(result); - break; - } - case "prepareForVideoRecording": - { - // This optimization is not required for Android. - result.success(null); - break; - } - case "startVideoRecording": - { - camera.startVideoRecording( - result, - Objects.equals(call.argument("enableStream"), true) ? imageStreamChannel : null); - break; - } - case "stopVideoRecording": - { - camera.stopVideoRecording(result); - break; - } - case "pauseVideoRecording": - { - camera.pauseVideoRecording(result); - break; - } - case "resumeVideoRecording": - { - camera.resumeVideoRecording(result); - break; - } - case "setFlashMode": - { - String modeStr = call.argument("mode"); - FlashMode mode = FlashMode.getValueForString(modeStr); - if (mode == null) { - result.error("setFlashModeFailed", "Unknown flash mode " + modeStr, null); - return; - } - try { - camera.setFlashMode(result, mode); - } catch (Exception e) { - handleException(e, result); - } - break; - } - case "setExposureMode": - { - String modeStr = call.argument("mode"); - ExposureMode mode = ExposureMode.getValueForString(modeStr); - if (mode == null) { - result.error("setExposureModeFailed", "Unknown exposure mode " + modeStr, null); - return; - } - try { - camera.setExposureMode(result, mode); - } catch (Exception e) { - handleException(e, result); - } - break; - } - case "setExposurePoint": - { - Boolean reset = call.argument("reset"); - Double x = null; - Double y = null; - if (reset == null || !reset) { - x = call.argument("x"); - y = call.argument("y"); - } - try { - camera.setExposurePoint(result, new Point(x, y)); - } catch (Exception e) { - handleException(e, result); - } - break; - } - case "getMinExposureOffset": - { - try { - result.success(camera.getMinExposureOffset()); - } catch (Exception e) { - handleException(e, result); - } - break; - } - case "getMaxExposureOffset": - { - try { - result.success(camera.getMaxExposureOffset()); - } catch (Exception e) { - handleException(e, result); - } - break; - } - case "getExposureOffsetStepSize": - { - try { - result.success(camera.getExposureOffsetStepSize()); - } catch (Exception e) { - handleException(e, result); - } - break; - } - case "setExposureOffset": - { - try { - camera.setExposureOffset(result, call.argument("offset")); - } catch (Exception e) { - handleException(e, result); - } - break; - } - case "setFocusMode": - { - String modeStr = call.argument("mode"); - FocusMode mode = FocusMode.getValueForString(modeStr); - if (mode == null) { - result.error("setFocusModeFailed", "Unknown focus mode " + modeStr, null); - return; - } - try { - camera.setFocusMode(result, mode); - } catch (Exception e) { - handleException(e, result); - } - break; - } - case "setFocusPoint": - { - Boolean reset = call.argument("reset"); - Double x = null; - Double y = null; - if (reset == null || !reset) { - x = call.argument("x"); - y = call.argument("y"); - } - try { - camera.setFocusPoint(result, new Point(x, y)); - } catch (Exception e) { - handleException(e, result); - } - break; - } - case "startImageStream": - { - try { - camera.startPreviewWithImageStream(imageStreamChannel); - result.success(null); - } catch (Exception e) { - handleException(e, result); - } - break; - } - case "stopImageStream": - { - try { - camera.startPreview(); - result.success(null); - } catch (Exception e) { - handleException(e, result); - } - break; - } - case "getMaxZoomLevel": - { - assert camera != null; - - try { - float maxZoomLevel = camera.getMaxZoomLevel(); - result.success(maxZoomLevel); - } catch (Exception e) { - handleException(e, result); - } - break; - } - case "getMinZoomLevel": - { - assert camera != null; - - try { - float minZoomLevel = camera.getMinZoomLevel(); - result.success(minZoomLevel); - } catch (Exception e) { - handleException(e, result); - } - break; - } - case "setZoomLevel": - { - assert camera != null; - - Double zoom = call.argument("zoom"); - - if (zoom == null) { - result.error( - "ZOOM_ERROR", "setZoomLevel is called without specifying a zoom level.", null); - return; - } - - try { - camera.setZoomLevel(result, zoom.floatValue()); - } catch (Exception e) { - handleException(e, result); - } - break; - } - case "lockCaptureOrientation": - { - PlatformChannel.DeviceOrientation orientation = - CameraUtils.deserializeDeviceOrientation(call.argument("orientation")); - - try { - camera.lockCaptureOrientation(orientation); - result.success(null); - } catch (Exception e) { - handleException(e, result); - } - break; - } - case "unlockCaptureOrientation": - { - try { - camera.unlockCaptureOrientation(); - result.success(null); - } catch (Exception e) { - handleException(e, result); - } - break; - } - case "pausePreview": - { - try { - camera.pausePreview(); - result.success(null); - } catch (Exception e) { - handleException(e, result); - } - break; - } - case "resumePreview": - { - camera.resumePreview(); - result.success(null); - break; - } - case "setDescriptionWhileRecording": - { - try { - String cameraName = call.argument("cameraName"); - CameraProperties cameraProperties = - new CameraPropertiesImpl(cameraName, CameraUtils.getCameraManager(activity)); - camera.setDescriptionWhileRecording(result, cameraProperties); - } catch (Exception e) { - handleException(e, result); - } - break; - } - case "dispose": - { - if (camera != null) { - camera.dispose(); - } - result.success(null); - break; - } - default: - result.notImplemented(); - break; - } - } - - void stopListening() { - methodChannel.setMethodCallHandler(null); - } - - private void instantiateCamera(MethodCall call, Result result) throws CameraAccessException { - String cameraName = call.argument("cameraName"); - String preset = call.argument("resolutionPreset"); - boolean enableAudio = call.argument("enableAudio"); - Integer fps = call.argument("fps"); - Integer videoBitrate = call.argument("videoBitrate"); - Integer audioBitrate = call.argument("audioBitrate"); - - TextureRegistry.SurfaceTextureEntry flutterSurfaceTexture = - textureRegistry.createSurfaceTexture(); - DartMessenger dartMessenger = - new DartMessenger( - messenger, flutterSurfaceTexture.id(), new Handler(Looper.getMainLooper())); - CameraProperties cameraProperties = - new CameraPropertiesImpl(cameraName, CameraUtils.getCameraManager(activity)); - ResolutionPreset resolutionPreset = ResolutionPreset.valueOf(preset); - - camera = - new Camera( - activity, - flutterSurfaceTexture, - new CameraFeatureFactoryImpl(), - dartMessenger, - cameraProperties, - new Camera.VideoCaptureSettings( - resolutionPreset, enableAudio, fps, videoBitrate, audioBitrate)); - - Map reply = new HashMap<>(); - reply.put("cameraId", flutterSurfaceTexture.id()); - result.success(reply); - } - - // We move catching CameraAccessException out of onMethodCall because it causes a crash - // on plugin registration for sdks incompatible with Camera2 (< 21). We want this plugin to - // to be able to compile with <21 sdks for apps that want the camera and support earlier version. - @SuppressWarnings("ConstantConditions") - private void handleException(Exception exception, Result result) { - if (exception instanceof CameraAccessException) { - result.error("CameraAccess", exception.getMessage(), null); - return; - } - - // CameraAccessException can not be cast to a RuntimeException. - throw (RuntimeException) exception; - } -} diff --git a/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/NoOpVoidResult.java b/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/NoOpVoidResult.java new file mode 100644 index 000000000000..2ce29e95851d --- /dev/null +++ b/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/NoOpVoidResult.java @@ -0,0 +1,20 @@ +// 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. + +package io.flutter.plugins.camera; + +import androidx.annotation.NonNull; + +/** + * A convenience class for results of a Pigeon Flutter API method call that perform no action. + * + *

Longer term, any call using this is likely a good candidate to migrate to event channels. + */ +public class NoOpVoidResult implements Messages.VoidResult { + @Override + public void success() {} + + @Override + public void error(@NonNull Throwable error) {} +} diff --git a/packages/camera/camera_android/android/src/test/java/io/flutter/plugins/camera/MethodCallHandlerImplTest.java b/packages/camera/camera_android/android/src/test/java/io/flutter/plugins/camera/CameraApiImplTest.java similarity index 69% rename from packages/camera/camera_android/android/src/test/java/io/flutter/plugins/camera/MethodCallHandlerImplTest.java rename to packages/camera/camera_android/android/src/test/java/io/flutter/plugins/camera/CameraApiImplTest.java index e4ab82d9eda5..88430530142d 100644 --- a/packages/camera/camera_android/android/src/test/java/io/flutter/plugins/camera/MethodCallHandlerImplTest.java +++ b/packages/camera/camera_android/android/src/test/java/io/flutter/plugins/camera/CameraApiImplTest.java @@ -5,6 +5,7 @@ package io.flutter.plugins.camera; import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertThrows; import static org.mockito.Mockito.doThrow; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.times; @@ -14,35 +15,33 @@ import android.hardware.camera2.CameraAccessException; import androidx.lifecycle.LifecycleObserver; import io.flutter.plugin.common.BinaryMessenger; -import io.flutter.plugin.common.MethodCall; -import io.flutter.plugin.common.MethodChannel; import io.flutter.view.TextureRegistry; import org.junit.Before; import org.junit.Test; -public class MethodCallHandlerImplTest { +public class CameraApiImplTest { - MethodCallHandlerImpl handler; - MethodChannel.Result mockResult; + CameraApiImpl handler; + Messages.VoidResult mockResult; Camera mockCamera; @Before public void setUp() { handler = - new MethodCallHandlerImpl( + new CameraApiImpl( mock(Activity.class), mock(BinaryMessenger.class), mock(CameraPermissions.class), mock(CameraPermissions.PermissionsRegistry.class), mock(TextureRegistry.class)); - mockResult = mock(MethodChannel.Result.class); + mockResult = mock(Messages.VoidResult.class); mockCamera = mock(Camera.class); handler.camera = mockCamera; } @Test public void shouldNotImplementLifecycleObserverInterface() { - Class methodCallHandlerClass = MethodCallHandlerImpl.class; + Class methodCallHandlerClass = CameraApiImpl.class; assertFalse(LifecycleObserver.class.isAssignableFrom(methodCallHandlerClass)); } @@ -50,10 +49,9 @@ public void shouldNotImplementLifecycleObserverInterface() { @Test public void onMethodCall_pausePreview_shouldPausePreviewAndSendSuccessResult() throws CameraAccessException { - handler.onMethodCall(new MethodCall("pausePreview", null), mockResult); + handler.pausePreview(); verify(mockCamera, times(1)).pausePreview(); - verify(mockResult, times(1)).success(null); } @Test @@ -61,16 +59,13 @@ public void onMethodCall_pausePreview_shouldSendErrorResultOnCameraAccessExcepti throws CameraAccessException { doThrow(new CameraAccessException(0)).when(mockCamera).pausePreview(); - handler.onMethodCall(new MethodCall("pausePreview", null), mockResult); - - verify(mockResult, times(1)).error("CameraAccess", null, null); + assertThrows(Messages.FlutterError.class, () -> handler.pausePreview()); } @Test public void onMethodCall_resumePreview_shouldResumePreviewAndSendSuccessResult() { - handler.onMethodCall(new MethodCall("resumePreview", null), mockResult); + handler.resumePreview(); verify(mockCamera, times(1)).resumePreview(); - verify(mockResult, times(1)).success(null); } } 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 d2d90b7beca6..56a3a4562adc 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 @@ -7,6 +7,7 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertThrows; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.*; @@ -30,7 +31,6 @@ import androidx.lifecycle.LifecycleObserver; import io.flutter.embedding.engine.systemchannels.PlatformChannel; import io.flutter.plugin.common.EventChannel; -import io.flutter.plugin.common.MethodChannel; import io.flutter.plugins.camera.features.CameraFeatureFactory; import io.flutter.plugins.camera.features.CameraFeatures; import io.flutter.plugins.camera.features.Point; @@ -59,13 +59,39 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Objects; import org.junit.After; import org.junit.Before; import org.junit.Test; +import org.mockito.ArgumentMatcher; import org.mockito.MockedConstruction; import org.mockito.MockedStatic; import org.mockito.Mockito; +/** + * As Pigeon-generated class, including FlutterError, do not implement equality, this helper class + * simplifies matching arguments passed to Result/VoidResult.error in unit tests. + */ +class FlutterErrorMatcher implements ArgumentMatcher { + + FlutterErrorMatcher(String code, String message, Object details) { + this.code = code; + this.message = message; + this.details = details; + } + + final String code; + final String message; + final Object details; + + @Override + public boolean matches(Messages.FlutterError argument) { + return Objects.equals(code, argument.code) + && Objects.equals(message, argument.getMessage()) + && Objects.equals(details, argument.details); + } +} + class FakeCameraDeviceWrapper implements CameraDeviceWrapper { final List captureRequests; @Nullable final CameraCaptureSession session; @@ -324,21 +350,21 @@ public void getMinZoomLevel() { public void setExposureMode_shouldUpdateExposureLockFeature() { ExposureLockFeature mockExposureLockFeature = mockCameraFeatureFactory.createExposureLockFeature(mockCameraProperties); - MethodChannel.Result mockResult = mock(MethodChannel.Result.class); + Messages.VoidResult mockResult = mock(Messages.VoidResult.class); ExposureMode exposureMode = ExposureMode.locked; camera.setExposureMode(mockResult, exposureMode); verify(mockExposureLockFeature, times(1)).setValue(exposureMode); - verify(mockResult, never()).error(any(), any(), any()); - verify(mockResult, times(1)).success(null); + verify(mockResult, never()).error(any()); + verify(mockResult, times(1)).success(); } @Test public void setExposureMode_shouldUpdateBuilder() { ExposureLockFeature mockExposureLockFeature = mockCameraFeatureFactory.createExposureLockFeature(mockCameraProperties); - MethodChannel.Result mockResult = mock(MethodChannel.Result.class); + Messages.VoidResult mockResult = mock(Messages.VoidResult.class); ExposureMode exposureMode = ExposureMode.locked; camera.setExposureMode(mockResult, exposureMode); @@ -349,16 +375,19 @@ public void setExposureMode_shouldUpdateBuilder() { @Test public void setExposureMode_shouldCallErrorOnResultOnCameraAccessException() throws CameraAccessException { - MethodChannel.Result mockResult = mock(MethodChannel.Result.class); + Messages.VoidResult mockResult = mock(Messages.VoidResult.class); ExposureMode exposureMode = ExposureMode.locked; when(mockCaptureSession.setRepeatingRequest(any(), any(), any())) .thenThrow(new CameraAccessException(0, "")); camera.setExposureMode(mockResult, exposureMode); - verify(mockResult, never()).success(any()); + verify(mockResult, never()).success(); verify(mockResult, times(1)) - .error("setExposureModeFailed", "Could not set exposure mode.", null); + .error( + argThat( + new FlutterErrorMatcher( + "setExposureModeFailed", "Could not set exposure mode.", null))); } @Test @@ -367,14 +396,14 @@ public void setExposurePoint_shouldUpdateExposurePointFeature() { ExposurePointFeature mockExposurePointFeature = mockCameraFeatureFactory.createExposurePointFeature( mockCameraProperties, mockSensorOrientationFeature); - MethodChannel.Result mockResult = mock(MethodChannel.Result.class); + Messages.VoidResult mockResult = mock(Messages.VoidResult.class); Point point = new Point(42d, 42d); camera.setExposurePoint(mockResult, point); verify(mockExposurePointFeature, times(1)).setValue(point); - verify(mockResult, never()).error(any(), any(), any()); - verify(mockResult, times(1)).success(null); + verify(mockResult, never()).error(any()); + verify(mockResult, times(1)).success(); } @Test @@ -383,7 +412,7 @@ public void setExposurePoint_shouldUpdateBuilder() { ExposurePointFeature mockExposurePointFeature = mockCameraFeatureFactory.createExposurePointFeature( mockCameraProperties, mockSensorOrientationFeature); - MethodChannel.Result mockResult = mock(MethodChannel.Result.class); + Messages.VoidResult mockResult = mock(Messages.VoidResult.class); Point point = new Point(42d, 42d); camera.setExposurePoint(mockResult, point); @@ -394,37 +423,40 @@ public void setExposurePoint_shouldUpdateBuilder() { @Test public void setExposurePoint_shouldCallErrorOnResultOnCameraAccessException() throws CameraAccessException { - MethodChannel.Result mockResult = mock(MethodChannel.Result.class); + Messages.VoidResult mockResult = mock(Messages.VoidResult.class); Point point = new Point(42d, 42d); when(mockCaptureSession.setRepeatingRequest(any(), any(), any())) .thenThrow(new CameraAccessException(0, "")); camera.setExposurePoint(mockResult, point); - verify(mockResult, never()).success(any()); + verify(mockResult, never()).success(); verify(mockResult, times(1)) - .error("setExposurePointFailed", "Could not set exposure point.", null); + .error( + argThat( + new FlutterErrorMatcher( + "setExposurePointFailed", "Could not set exposure point.", null))); } @Test public void setFlashMode_shouldUpdateFlashFeature() { FlashFeature mockFlashFeature = mockCameraFeatureFactory.createFlashFeature(mockCameraProperties); - MethodChannel.Result mockResult = mock(MethodChannel.Result.class); + Messages.VoidResult mockResult = mock(Messages.VoidResult.class); FlashMode flashMode = FlashMode.always; camera.setFlashMode(mockResult, flashMode); verify(mockFlashFeature, times(1)).setValue(flashMode); - verify(mockResult, never()).error(any(), any(), any()); - verify(mockResult, times(1)).success(null); + verify(mockResult, never()).error(any()); + verify(mockResult, times(1)).success(); } @Test public void setFlashMode_shouldUpdateBuilder() { FlashFeature mockFlashFeature = mockCameraFeatureFactory.createFlashFeature(mockCameraProperties); - MethodChannel.Result mockResult = mock(MethodChannel.Result.class); + Messages.VoidResult mockResult = mock(Messages.VoidResult.class); FlashMode flashMode = FlashMode.always; camera.setFlashMode(mockResult, flashMode); @@ -435,15 +467,18 @@ public void setFlashMode_shouldUpdateBuilder() { @Test public void setFlashMode_shouldCallErrorOnResultOnCameraAccessException() throws CameraAccessException { - MethodChannel.Result mockResult = mock(MethodChannel.Result.class); + Messages.VoidResult mockResult = mock(Messages.VoidResult.class); FlashMode flashMode = FlashMode.always; when(mockCaptureSession.setRepeatingRequest(any(), any(), any())) .thenThrow(new CameraAccessException(0, "")); camera.setFlashMode(mockResult, flashMode); - verify(mockResult, never()).success(any()); - verify(mockResult, times(1)).error("setFlashModeFailed", "Could not set flash mode.", null); + verify(mockResult, never()).success(); + verify(mockResult, times(1)) + .error( + argThat( + new FlutterErrorMatcher("setFlashModeFailed", "Could not set flash mode.", null))); } @Test @@ -454,15 +489,15 @@ public void setFocusPoint_shouldUpdateFocusPointFeature() { mockCameraProperties, mockSensorOrientationFeature); AutoFocusFeature mockAutoFocusFeature = mockCameraFeatureFactory.createAutoFocusFeature(mockCameraProperties, false); - MethodChannel.Result mockResult = mock(MethodChannel.Result.class); + Messages.VoidResult mockResult = mock(Messages.VoidResult.class); Point point = new Point(42d, 42d); when(mockAutoFocusFeature.getValue()).thenReturn(FocusMode.auto); camera.setFocusPoint(mockResult, point); verify(mockFocusPointFeature, times(1)).setValue(point); - verify(mockResult, never()).error(any(), any(), any()); - verify(mockResult, times(1)).success(null); + verify(mockResult, never()).error(any()); + verify(mockResult, times(1)).success(); } @Test @@ -473,7 +508,7 @@ public void setFocusPoint_shouldUpdateBuilder() { mockCameraProperties, mockSensorOrientationFeature); AutoFocusFeature mockAutoFocusFeature = mockCameraFeatureFactory.createAutoFocusFeature(mockCameraProperties, false); - MethodChannel.Result mockResult = mock(MethodChannel.Result.class); + Messages.VoidResult mockResult = mock(Messages.VoidResult.class); Point point = new Point(42d, 42d); when(mockAutoFocusFeature.getValue()).thenReturn(FocusMode.auto); @@ -487,7 +522,7 @@ public void setFocusPoint_shouldCallErrorOnResultOnCameraAccessException() throws CameraAccessException { AutoFocusFeature mockAutoFocusFeature = mockCameraFeatureFactory.createAutoFocusFeature(mockCameraProperties, false); - MethodChannel.Result mockResult = mock(MethodChannel.Result.class); + Messages.VoidResult mockResult = mock(Messages.VoidResult.class); Point point = new Point(42d, 42d); when(mockAutoFocusFeature.getValue()).thenReturn(FocusMode.auto); when(mockCaptureSession.setRepeatingRequest(any(), any(), any())) @@ -495,15 +530,19 @@ public void setFocusPoint_shouldCallErrorOnResultOnCameraAccessException() camera.setFocusPoint(mockResult, point); - verify(mockResult, never()).success(any()); - verify(mockResult, times(1)).error("setFocusPointFailed", "Could not set focus point.", null); + verify(mockResult, never()).success(); + verify(mockResult, times(1)) + .error( + argThat( + new FlutterErrorMatcher( + "setFocusPointFailed", "Could not set focus point.", null))); } @Test public void setZoomLevel_shouldUpdateZoomLevelFeature() throws CameraAccessException { ZoomLevelFeature mockZoomLevelFeature = mockCameraFeatureFactory.createZoomLevelFeature(mockCameraProperties); - MethodChannel.Result mockResult = mock(MethodChannel.Result.class); + Messages.VoidResult mockResult = mock(Messages.VoidResult.class); float zoomLevel = 1.0f; when(mockZoomLevelFeature.getValue()).thenReturn(zoomLevel); @@ -513,15 +552,15 @@ public void setZoomLevel_shouldUpdateZoomLevelFeature() throws CameraAccessExcep camera.setZoomLevel(mockResult, zoomLevel); verify(mockZoomLevelFeature, times(1)).setValue(zoomLevel); - verify(mockResult, never()).error(any(), any(), any()); - verify(mockResult, times(1)).success(null); + verify(mockResult, never()).error(any()); + verify(mockResult, times(1)).success(); } @Test public void setZoomLevel_shouldUpdateBuilder() throws CameraAccessException { ZoomLevelFeature mockZoomLevelFeature = mockCameraFeatureFactory.createZoomLevelFeature(mockCameraProperties); - MethodChannel.Result mockResult = mock(MethodChannel.Result.class); + Messages.VoidResult mockResult = mock(Messages.VoidResult.class); float zoomLevel = 1.0f; when(mockZoomLevelFeature.getValue()).thenReturn(zoomLevel); @@ -538,7 +577,7 @@ public void setZoomLevel_shouldCallErrorOnResultOnCameraAccessException() throws CameraAccessException { ZoomLevelFeature mockZoomLevelFeature = mockCameraFeatureFactory.createZoomLevelFeature(mockCameraProperties); - MethodChannel.Result mockResult = mock(MethodChannel.Result.class); + Messages.VoidResult mockResult = mock(Messages.VoidResult.class); float zoomLevel = 1.0f; when(mockZoomLevelFeature.getValue()).thenReturn(zoomLevel); @@ -549,47 +588,38 @@ public void setZoomLevel_shouldCallErrorOnResultOnCameraAccessException() camera.setZoomLevel(mockResult, zoomLevel); - verify(mockResult, never()).success(any()); - verify(mockResult, times(1)).error("setZoomLevelFailed", "Could not set zoom level.", null); + verify(mockResult, never()).success(); + verify(mockResult, times(1)) + .error( + argThat( + new FlutterErrorMatcher("setZoomLevelFailed", "Could not set zoom level.", null))); } @Test - public void pauseVideoRecording_shouldSendNullResultWhenNotRecording() { + public void pauseVideoRecording_shouldNotThrowWhenNotRecording() { camera.recordingVideo = false; - MethodChannel.Result mockResult = mock(MethodChannel.Result.class); - - camera.pauseVideoRecording(mockResult); - verify(mockResult, times(1)).success(null); - verify(mockResult, never()).error(any(), any(), any()); + camera.pauseVideoRecording(); } @Test public void pauseVideoRecording_shouldCallPauseWhenRecordingAndOnAPIN() { - MethodChannel.Result mockResult = mock(MethodChannel.Result.class); MediaRecorder mockMediaRecorder = mock(MediaRecorder.class); camera.mediaRecorder = mockMediaRecorder; camera.recordingVideo = true; SdkCapabilityChecker.SDK_VERSION = 24; - camera.pauseVideoRecording(mockResult); + camera.pauseVideoRecording(); verify(mockMediaRecorder, times(1)).pause(); - verify(mockResult, times(1)).success(null); - verify(mockResult, never()).error(any(), any(), any()); } @Test public void pauseVideoRecording_shouldSendVideoRecordingFailedErrorWhenVersionCodeSmallerThenN() { camera.recordingVideo = true; SdkCapabilityChecker.SDK_VERSION = 23; - MethodChannel.Result mockResult = mock(MethodChannel.Result.class); - camera.pauseVideoRecording(mockResult); - - verify(mockResult, times(1)) - .error("videoRecordingFailed", "pauseVideoRecording requires Android API +24.", null); - verify(mockResult, never()).success(any()); + assertThrows(Messages.FlutterError.class, camera::pauseVideoRecording); } @Test @@ -604,43 +634,30 @@ public void pauseVideoRecording_shouldSendVideoRecordingFailedErrorWhenVersionCo doThrow(expectedException).when(mockMediaRecorder).pause(); - MethodChannel.Result mockResult = mock(MethodChannel.Result.class); - - camera.pauseVideoRecording(mockResult); - - verify(mockResult, times(1)).error("videoRecordingFailed", "Test error message", null); - verify(mockResult, never()).success(any()); + assertThrows(Messages.FlutterError.class, camera::pauseVideoRecording); } @Test - public void resumeVideoRecording_shouldSendNullResultWhenNotRecording() { - MethodChannel.Result mockResult = mock(MethodChannel.Result.class); + public void resumeVideoRecording_shouldNotThrowWhenNotRecording() { camera.recordingVideo = false; - camera.resumeVideoRecording(mockResult); - - verify(mockResult, times(1)).success(null); - verify(mockResult, never()).error(any(), any(), any()); + camera.resumeVideoRecording(); } @Test public void resumeVideoRecording_shouldCallPauseWhenRecordingAndOnAPIN() { - MethodChannel.Result mockResult = mock(MethodChannel.Result.class); MediaRecorder mockMediaRecorder = mock(MediaRecorder.class); camera.mediaRecorder = mockMediaRecorder; camera.recordingVideo = true; SdkCapabilityChecker.SDK_VERSION = 24; - camera.resumeVideoRecording(mockResult); + camera.resumeVideoRecording(); verify(mockMediaRecorder, times(1)).resume(); - verify(mockResult, times(1)).success(null); - verify(mockResult, never()).error(any(), any(), any()); } @Test public void setDescriptionWhileRecording_errorsWhenUnsupported() { - MethodChannel.Result mockResult = mock(MethodChannel.Result.class); MediaRecorder mockMediaRecorder = mock(MediaRecorder.class); VideoRenderer mockVideoRenderer = mock(VideoRenderer.class); camera.mediaRecorder = mockMediaRecorder; @@ -649,18 +666,13 @@ public void setDescriptionWhileRecording_errorsWhenUnsupported() { SdkCapabilityChecker.SDK_VERSION = Build.VERSION_CODES.LOLLIPOP; final CameraProperties newCameraProperties = mock(CameraProperties.class); - camera.setDescriptionWhileRecording(mockResult, newCameraProperties); - - verify(mockResult, times(1)) - .error( - eq("setDescriptionWhileRecordingFailed"), - eq("Device does not support switching the camera while recording"), - eq(null)); + assertThrows( + Messages.FlutterError.class, + () -> camera.setDescriptionWhileRecording(newCameraProperties)); } @Test public void setDescriptionWhileRecording_succeedsWhenSupported() { - MethodChannel.Result mockResult = mock(MethodChannel.Result.class); MediaRecorder mockMediaRecorder = mock(MediaRecorder.class); VideoRenderer mockVideoRenderer = mock(VideoRenderer.class); camera.mediaRecorder = mockMediaRecorder; @@ -669,10 +681,7 @@ public void setDescriptionWhileRecording_succeedsWhenSupported() { SdkCapabilityChecker.SDK_VERSION = Build.VERSION_CODES.O; final CameraProperties newCameraProperties = mock(CameraProperties.class); - camera.setDescriptionWhileRecording(mockResult, newCameraProperties); - - verify(mockResult, times(1)).success(null); - verify(mockResult, never()).error(any(), any(), any()); + camera.setDescriptionWhileRecording(newCameraProperties); } @Test @@ -784,14 +793,11 @@ public void startPreviewWithImageStream_shouldPullStreamsFromImageReaders() @Test public void setDescriptionWhileRecording_shouldErrorWhenNotRecording() { - MethodChannel.Result mockResult = mock(MethodChannel.Result.class); camera.recordingVideo = false; final CameraProperties newCameraProperties = mock(CameraProperties.class); - camera.setDescriptionWhileRecording(mockResult, newCameraProperties); - - verify(mockResult, times(1)) - .error("setDescriptionWhileRecordingFailed", "Device was not recording", null); - verify(mockResult, never()).success(any()); + assertThrows( + Messages.FlutterError.class, + () -> camera.setDescriptionWhileRecording(newCameraProperties)); } @Test @@ -800,13 +806,7 @@ public void setDescriptionWhileRecording_shouldErrorWhenNotRecording() { camera.recordingVideo = true; SdkCapabilityChecker.SDK_VERSION = 23; - MethodChannel.Result mockResult = mock(MethodChannel.Result.class); - - camera.resumeVideoRecording(mockResult); - - verify(mockResult, times(1)) - .error("videoRecordingFailed", "resumeVideoRecording requires Android API +24.", null); - verify(mockResult, never()).success(any()); + assertThrows(Messages.FlutterError.class, camera::resumeVideoRecording); } @Test @@ -821,41 +821,32 @@ public void setDescriptionWhileRecording_shouldErrorWhenNotRecording() { doThrow(expectedException).when(mockMediaRecorder).resume(); - MethodChannel.Result mockResult = mock(MethodChannel.Result.class); - - camera.resumeVideoRecording(mockResult); - - verify(mockResult, times(1)).error("videoRecordingFailed", "Test error message", null); - verify(mockResult, never()).success(any()); + assertThrows(Messages.FlutterError.class, camera::resumeVideoRecording); } @Test public void setFocusMode_shouldUpdateAutoFocusFeature() { AutoFocusFeature mockAutoFocusFeature = mockCameraFeatureFactory.createAutoFocusFeature(mockCameraProperties, false); - MethodChannel.Result mockResult = mock(MethodChannel.Result.class); - camera.setFocusMode(mockResult, FocusMode.auto); + camera.setFocusMode(FocusMode.auto); verify(mockAutoFocusFeature, times(1)).setValue(FocusMode.auto); - verify(mockResult, never()).error(any(), any(), any()); - verify(mockResult, times(1)).success(null); } @Test public void setFocusMode_shouldUpdateBuilder() { AutoFocusFeature mockAutoFocusFeature = mockCameraFeatureFactory.createAutoFocusFeature(mockCameraProperties, false); - MethodChannel.Result mockResult = mock(MethodChannel.Result.class); - camera.setFocusMode(mockResult, FocusMode.auto); + camera.setFocusMode(FocusMode.auto); verify(mockAutoFocusFeature, times(1)).updateBuilder(any()); } @Test public void setFocusMode_shouldUnlockAutoFocusForAutoMode() { - camera.setFocusMode(mock(MethodChannel.Result.class), FocusMode.auto); + camera.setFocusMode(FocusMode.auto); verify(mockPreviewRequestBuilder, times(1)) .set(CaptureRequest.CONTROL_AF_TRIGGER, CameraMetadata.CONTROL_AF_TRIGGER_CANCEL); verify(mockPreviewRequestBuilder, times(1)) @@ -865,7 +856,7 @@ public void setFocusMode_shouldUnlockAutoFocusForAutoMode() { @Test public void setFocusMode_shouldSkipUnlockAutoFocusWhenNullCaptureSession() { camera.captureSession = null; - camera.setFocusMode(mock(MethodChannel.Result.class), FocusMode.auto); + camera.setFocusMode(FocusMode.auto); verify(mockPreviewRequestBuilder, never()) .set(CaptureRequest.CONTROL_AF_TRIGGER, CameraMetadata.CONTROL_AF_TRIGGER_CANCEL); verify(mockPreviewRequestBuilder, never()) @@ -877,7 +868,7 @@ public void setFocusMode_shouldSendErrorEventOnUnlockAutoFocusCameraAccessExcept throws CameraAccessException { when(mockCaptureSession.capture(any(), any(), any())) .thenThrow(new CameraAccessException(0, "")); - camera.setFocusMode(mock(MethodChannel.Result.class), FocusMode.auto); + camera.setFocusMode(FocusMode.auto); verify(mockDartMessenger, times(1)).sendCameraErrorEvent(any()); } @@ -896,16 +887,15 @@ public void startVideoRecording_shouldPullStreamsFromMediaRecorderAndImageReader cameraSpy.pictureImageReader = mockPictureImageReader; CameraDeviceWrapper fakeCamera = new FakeCameraDeviceWrapper(mockRequestBuilders); cameraSpy.cameraDevice = fakeCamera; - MethodChannel.Result mockResult = mock(MethodChannel.Result.class); TextureRegistry.SurfaceTextureEntry cameraFlutterTexture = cameraSpy.flutterTexture; ResolutionFeature resolutionFeature = mockCameraFeatureFactory.mockResolutionFeature; when(cameraFlutterTexture.surfaceTexture()).thenReturn(mockSurfaceTexture); when(resolutionFeature.getPreviewSize()).thenReturn(mockSize); - doNothing().when(cameraSpy).prepareRecording(mockResult); + doNothing().when(cameraSpy).prepareRecording(); - cameraSpy.startVideoRecording(mockResult, null); + cameraSpy.startVideoRecording(null); verify(mockMediaRecorder, times(1)) .getSurface(); // stream pulled from media recorder's surface. verify( @@ -916,7 +906,7 @@ public void startVideoRecording_shouldPullStreamsFromMediaRecorderAndImageReader @Test public void setFocusMode_shouldLockAutoFocusForLockedMode() throws CameraAccessException { - camera.setFocusMode(mock(MethodChannel.Result.class), FocusMode.locked); + camera.setFocusMode(FocusMode.locked); verify(mockPreviewRequestBuilder, times(1)) .set(CaptureRequest.CONTROL_AF_TRIGGER, CameraMetadata.CONTROL_AF_TRIGGER_START); verify(mockCaptureSession, times(1)).capture(any(), any(), any()); @@ -926,7 +916,7 @@ public void setFocusMode_shouldLockAutoFocusForLockedMode() throws CameraAccessE @Test public void setFocusMode_shouldSkipLockAutoFocusWhenNullCaptureSession() { camera.captureSession = null; - camera.setFocusMode(mock(MethodChannel.Result.class), FocusMode.locked); + camera.setFocusMode(FocusMode.locked); verify(mockPreviewRequestBuilder, never()) .set(CaptureRequest.CONTROL_AF_TRIGGER, CaptureRequest.CONTROL_AF_TRIGGER_START); } @@ -936,36 +926,32 @@ public void setFocusMode_shouldSendErrorEventOnLockAutoFocusCameraAccessExceptio throws CameraAccessException { when(mockCaptureSession.capture(any(), any(), any())) .thenThrow(new CameraAccessException(0, "")); - camera.setFocusMode(mock(MethodChannel.Result.class), FocusMode.locked); + camera.setFocusMode(FocusMode.locked); verify(mockDartMessenger, times(1)).sendCameraErrorEvent(any()); } @Test public void setFocusMode_shouldCallErrorOnResultOnCameraAccessException() throws CameraAccessException { - MethodChannel.Result mockResult = mock(MethodChannel.Result.class); when(mockCaptureSession.setRepeatingRequest(any(), any(), any())) .thenThrow(new CameraAccessException(0, "")); - camera.setFocusMode(mockResult, FocusMode.locked); - - verify(mockResult, never()).success(any()); - verify(mockResult, times(1)) - .error("setFocusModeFailed", "Error setting focus mode: null", null); + assertThrows(Messages.FlutterError.class, () -> camera.setFocusMode(FocusMode.locked)); } @Test public void setExposureOffset_shouldUpdateExposureOffsetFeature() { ExposureOffsetFeature mockExposureOffsetFeature = mockCameraFeatureFactory.createExposureOffsetFeature(mockCameraProperties); - MethodChannel.Result mockResult = mock(MethodChannel.Result.class); + @SuppressWarnings("unchecked") + Messages.Result mockResult = mock(Messages.Result.class); when(mockExposureOffsetFeature.getValue()).thenReturn(1.0); camera.setExposureOffset(mockResult, 1.0); verify(mockExposureOffsetFeature, times(1)).setValue(1.0); - verify(mockResult, never()).error(any(), any(), any()); + verify(mockResult, never()).error(any()); verify(mockResult, times(1)).success(1.0); } @@ -973,7 +959,8 @@ public void setExposureOffset_shouldUpdateExposureOffsetFeature() { public void setExposureOffset_shouldAndUpdateBuilder() { ExposureOffsetFeature mockExposureOffsetFeature = mockCameraFeatureFactory.createExposureOffsetFeature(mockCameraProperties); - MethodChannel.Result mockResult = mock(MethodChannel.Result.class); + @SuppressWarnings("unchecked") + Messages.Result mockResult = mock(Messages.Result.class); camera.setExposureOffset(mockResult, 1.0); @@ -983,7 +970,8 @@ public void setExposureOffset_shouldAndUpdateBuilder() { @Test public void setExposureOffset_shouldCallErrorOnResultOnCameraAccessException() throws CameraAccessException { - MethodChannel.Result mockResult = mock(MethodChannel.Result.class); + @SuppressWarnings("unchecked") + Messages.Result mockResult = mock(Messages.Result.class); when(mockCaptureSession.setRepeatingRequest(any(), any(), any())) .thenThrow(new CameraAccessException(0, "")); @@ -991,7 +979,10 @@ public void setExposureOffset_shouldCallErrorOnResultOnCameraAccessException() verify(mockResult, never()).success(any()); verify(mockResult, times(1)) - .error("setExposureOffsetFailed", "Could not set exposure offset.", null); + .error( + argThat( + new FlutterErrorMatcher( + "setExposureOffsetFailed", "Could not set exposure offset.", null))); } @Test @@ -1253,7 +1244,6 @@ public void startVideoRecording_shouldApplySettingsToMediaRecorder() new FakeCameraDeviceWrapper(mockRequestBuilders, mockCaptureSession); camera.cameraDevice = fakeCamera; - MethodChannel.Result mockResult = mock(MethodChannel.Result.class); TextureRegistry.SurfaceTextureEntry cameraFlutterTexture = camera.flutterTexture; @@ -1265,7 +1255,7 @@ public void startVideoRecording_shouldApplySettingsToMediaRecorder() assertNotNull(resolutionFeature); when(resolutionFeature.getPreviewSize()).thenReturn(mockSize); - camera.startVideoRecording(mockResult, null); + camera.startVideoRecording(null); //region Check that FPS parameter affects AE range at which the camera captures frames. assertEquals(camera.cameraFeatures.getFpsRange().getValue().getLower(), Integer.valueOf(fps)); diff --git a/packages/camera/camera_android/android/src/test/java/io/flutter/plugins/camera/CameraUtilsTest.java b/packages/camera/camera_android/android/src/test/java/io/flutter/plugins/camera/CameraUtilsTest.java index e59b05bf4fe3..fb3588e45894 100644 --- a/packages/camera/camera_android/android/src/test/java/io/flutter/plugins/camera/CameraUtilsTest.java +++ b/packages/camera/camera_android/android/src/test/java/io/flutter/plugins/camera/CameraUtilsTest.java @@ -12,59 +12,21 @@ import android.app.Activity; import android.content.Context; +import android.graphics.ImageFormat; import android.hardware.camera2.CameraAccessException; import android.hardware.camera2.CameraCharacteristics; import android.hardware.camera2.CameraManager; import android.hardware.camera2.CameraMetadata; import io.flutter.embedding.engine.systemchannels.PlatformChannel; +import io.flutter.plugins.camera.features.autofocus.FocusMode; +import io.flutter.plugins.camera.features.exposurelock.ExposureMode; +import io.flutter.plugins.camera.features.flash.FlashMode; +import io.flutter.plugins.camera.features.resolution.ResolutionPreset; import java.util.List; -import java.util.Map; import org.junit.Test; public class CameraUtilsTest { - @Test - public void serializeDeviceOrientation_serializesCorrectly() { - assertEquals( - "portraitUp", - CameraUtils.serializeDeviceOrientation(PlatformChannel.DeviceOrientation.PORTRAIT_UP)); - assertEquals( - "portraitDown", - CameraUtils.serializeDeviceOrientation(PlatformChannel.DeviceOrientation.PORTRAIT_DOWN)); - assertEquals( - "landscapeLeft", - CameraUtils.serializeDeviceOrientation(PlatformChannel.DeviceOrientation.LANDSCAPE_LEFT)); - assertEquals( - "landscapeRight", - CameraUtils.serializeDeviceOrientation(PlatformChannel.DeviceOrientation.LANDSCAPE_RIGHT)); - } - - @Test(expected = UnsupportedOperationException.class) - public void serializeDeviceOrientation_throws_for_null() { - CameraUtils.serializeDeviceOrientation(null); - } - - @Test - public void deserializeDeviceOrientation_deserializesCorrectly() { - assertEquals( - PlatformChannel.DeviceOrientation.PORTRAIT_UP, - CameraUtils.deserializeDeviceOrientation("portraitUp")); - assertEquals( - PlatformChannel.DeviceOrientation.PORTRAIT_DOWN, - CameraUtils.deserializeDeviceOrientation("portraitDown")); - assertEquals( - PlatformChannel.DeviceOrientation.LANDSCAPE_LEFT, - CameraUtils.deserializeDeviceOrientation("landscapeLeft")); - assertEquals( - PlatformChannel.DeviceOrientation.LANDSCAPE_RIGHT, - CameraUtils.deserializeDeviceOrientation("landscapeRight")); - } - - @Test(expected = UnsupportedOperationException.class) - public void deserializeDeviceOrientation_throwsForNull() { - CameraUtils.deserializeDeviceOrientation(null); - } - @Test public void getAvailableCameras_retrievesValidCameras() throws CameraAccessException, NumberFormatException { @@ -87,14 +49,126 @@ public void getAvailableCameras_retrievesValidCameras() .thenReturn(mockSensorOrientation2) .thenReturn(mockLensFacing2); - List> availableCameras = CameraUtils.getAvailableCameras(mockActivity); + List availableCameras = + CameraUtils.getAvailableCameras(mockActivity); assertEquals(availableCameras.size(), 2); - assertEquals(availableCameras.get(0).get("name"), "1394902"); - assertEquals(availableCameras.get(0).get("sensorOrientation"), mockSensorOrientation0); - assertEquals(availableCameras.get(0).get("lensFacing"), "front"); - assertEquals(availableCameras.get(1).get("name"), "0283835"); - assertEquals(availableCameras.get(1).get("sensorOrientation"), mockSensorOrientation2); - assertEquals(availableCameras.get(1).get("lensFacing"), "external"); + assertEquals(availableCameras.get(0).getName(), "1394902"); + assertEquals(availableCameras.get(0).getSensorOrientation().intValue(), mockSensorOrientation0); + assertEquals( + availableCameras.get(0).getLensDirection(), Messages.PlatformCameraLensDirection.FRONT); + assertEquals(availableCameras.get(1).getName(), "0283835"); + assertEquals(availableCameras.get(1).getSensorOrientation().intValue(), mockSensorOrientation2); + assertEquals( + availableCameras.get(1).getLensDirection(), Messages.PlatformCameraLensDirection.EXTERNAL); + } + + @Test + public void orientationToPigeonTest() { + assertEquals( + CameraUtils.orientationToPigeon(PlatformChannel.DeviceOrientation.PORTRAIT_UP), + Messages.PlatformDeviceOrientation.PORTRAIT_UP); + assertEquals( + CameraUtils.orientationToPigeon(PlatformChannel.DeviceOrientation.PORTRAIT_DOWN), + Messages.PlatformDeviceOrientation.PORTRAIT_DOWN); + assertEquals( + CameraUtils.orientationToPigeon(PlatformChannel.DeviceOrientation.LANDSCAPE_LEFT), + Messages.PlatformDeviceOrientation.LANDSCAPE_LEFT); + assertEquals( + CameraUtils.orientationToPigeon(PlatformChannel.DeviceOrientation.LANDSCAPE_RIGHT), + Messages.PlatformDeviceOrientation.LANDSCAPE_RIGHT); + } + + @Test + public void orientationFromPigeonTest() { + assertEquals( + CameraUtils.orientationFromPigeon(Messages.PlatformDeviceOrientation.PORTRAIT_UP), + PlatformChannel.DeviceOrientation.PORTRAIT_UP); + assertEquals( + CameraUtils.orientationFromPigeon(Messages.PlatformDeviceOrientation.PORTRAIT_DOWN), + PlatformChannel.DeviceOrientation.PORTRAIT_DOWN); + assertEquals( + CameraUtils.orientationFromPigeon(Messages.PlatformDeviceOrientation.LANDSCAPE_LEFT), + PlatformChannel.DeviceOrientation.LANDSCAPE_LEFT); + assertEquals( + CameraUtils.orientationFromPigeon(Messages.PlatformDeviceOrientation.LANDSCAPE_RIGHT), + PlatformChannel.DeviceOrientation.LANDSCAPE_RIGHT); + } + + @Test + public void focusModeToPigeonTest() { + assertEquals(CameraUtils.focusModeToPigeon(FocusMode.auto), Messages.PlatformFocusMode.AUTO); + assertEquals( + CameraUtils.focusModeToPigeon(FocusMode.locked), Messages.PlatformFocusMode.LOCKED); + } + + @Test + public void focusModeFromPigeonTest() { + assertEquals(CameraUtils.focusModeFromPigeon(Messages.PlatformFocusMode.AUTO), FocusMode.auto); + assertEquals( + CameraUtils.focusModeFromPigeon(Messages.PlatformFocusMode.LOCKED), FocusMode.locked); + } + + @Test + public void exposureModeToPigeonTest() { + assertEquals( + CameraUtils.exposureModeToPigeon(ExposureMode.auto), Messages.PlatformExposureMode.AUTO); + assertEquals( + CameraUtils.exposureModeToPigeon(ExposureMode.locked), + Messages.PlatformExposureMode.LOCKED); + } + + @Test + public void exposureModeFromPigeonTest() { + assertEquals( + CameraUtils.exposureModeFromPigeon(Messages.PlatformExposureMode.AUTO), ExposureMode.auto); + assertEquals( + CameraUtils.exposureModeFromPigeon(Messages.PlatformExposureMode.LOCKED), + ExposureMode.locked); + } + + @Test + public void resolutionPresetFromPigeonTest() { + assertEquals( + CameraUtils.resolutionPresetFromPigeon(Messages.PlatformResolutionPreset.LOW), + ResolutionPreset.low); + assertEquals( + CameraUtils.resolutionPresetFromPigeon(Messages.PlatformResolutionPreset.MEDIUM), + ResolutionPreset.medium); + assertEquals( + CameraUtils.resolutionPresetFromPigeon(Messages.PlatformResolutionPreset.HIGH), + ResolutionPreset.high); + assertEquals( + CameraUtils.resolutionPresetFromPigeon(Messages.PlatformResolutionPreset.VERY_HIGH), + ResolutionPreset.veryHigh); + assertEquals( + CameraUtils.resolutionPresetFromPigeon(Messages.PlatformResolutionPreset.ULTRA_HIGH), + ResolutionPreset.ultraHigh); + assertEquals( + CameraUtils.resolutionPresetFromPigeon(Messages.PlatformResolutionPreset.MAX), + ResolutionPreset.max); + } + + @Test + public void imageFormatGroupFromPigeonTest() { + assertEquals( + CameraUtils.imageFormatGroupFromPigeon(Messages.PlatformImageFormatGroup.YUV420).intValue(), + ImageFormat.YUV_420_888); + assertEquals( + CameraUtils.imageFormatGroupFromPigeon(Messages.PlatformImageFormatGroup.JPEG).intValue(), + ImageFormat.JPEG); + assertEquals( + CameraUtils.imageFormatGroupFromPigeon(Messages.PlatformImageFormatGroup.NV21).intValue(), + ImageFormat.NV21); + } + + @Test + public void flashModeFromPigeonTest() { + assertEquals(CameraUtils.flashModeFromPigeon(Messages.PlatformFlashMode.AUTO), FlashMode.auto); + assertEquals( + CameraUtils.flashModeFromPigeon(Messages.PlatformFlashMode.ALWAYS), FlashMode.always); + assertEquals(CameraUtils.flashModeFromPigeon(Messages.PlatformFlashMode.OFF), FlashMode.off); + assertEquals( + CameraUtils.flashModeFromPigeon(Messages.PlatformFlashMode.TORCH), FlashMode.torch); } } diff --git a/packages/camera/camera_android/android/src/test/java/io/flutter/plugins/camera/DartMessengerTest.java b/packages/camera/camera_android/android/src/test/java/io/flutter/plugins/camera/DartMessengerTest.java index 0a2fc43d03cb..a053d937b918 100644 --- a/packages/camera/camera_android/android/src/test/java/io/flutter/plugins/camera/DartMessengerTest.java +++ b/packages/camera/camera_android/android/src/test/java/io/flutter/plugins/camera/DartMessengerTest.java @@ -4,132 +4,116 @@ package io.flutter.plugins.camera; -import static junit.framework.TestCase.assertNull; import static org.junit.Assert.assertEquals; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.doAnswer; import static org.mockito.Mockito.mock; import android.os.Handler; -import androidx.annotation.NonNull; import io.flutter.embedding.engine.systemchannels.PlatformChannel; -import io.flutter.plugin.common.BinaryMessenger; -import io.flutter.plugin.common.MethodCall; -import io.flutter.plugin.common.StandardMethodCodec; import io.flutter.plugins.camera.features.autofocus.FocusMode; import io.flutter.plugins.camera.features.exposurelock.ExposureMode; -import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.List; import org.junit.Before; import org.junit.Test; import org.mockito.invocation.InvocationOnMock; -import org.mockito.stubbing.Answer; public class DartMessengerTest { - /** A {@link BinaryMessenger} implementation that does nothing but save its messages. */ - private static class FakeBinaryMessenger implements BinaryMessenger { - private final List sentMessages = new ArrayList<>(); - @Override - public void send(@NonNull String channel, ByteBuffer message) { - sentMessages.add(message); - } - - @Override - public void send(@NonNull String channel, ByteBuffer message, BinaryReply callback) { - send(channel, message); - } - - @Override - public void setMessageHandler(@NonNull String channel, BinaryMessageHandler handler) {} - - List getMessages() { - return new ArrayList<>(sentMessages); - } - } - - private Handler mockHandler; private DartMessenger dartMessenger; - private FakeBinaryMessenger fakeBinaryMessenger; + private Messages.CameraGlobalEventApi mockGlobalEventApi; + private Messages.CameraEventApi mockEventApi; @Before public void setUp() { - mockHandler = mock(Handler.class); - fakeBinaryMessenger = new FakeBinaryMessenger(); - dartMessenger = new DartMessenger(fakeBinaryMessenger, 0, mockHandler); + Handler mockHandler = mock(Handler.class); + doAnswer( + (InvocationOnMock invocation) -> { + Runnable r = invocation.getArgument(0); + if (r != null) { + r.run(); + } + return true; + }) + .when(mockHandler) + .post(any(Runnable.class)); + mockGlobalEventApi = mock(Messages.CameraGlobalEventApi.class); + mockEventApi = mock(Messages.CameraEventApi.class); + dartMessenger = new DartMessenger(mockHandler, mockGlobalEventApi, mockEventApi); } @Test public void sendCameraErrorEvent_includesErrorDescriptions() { - doAnswer(createPostHandlerAnswer()).when(mockHandler).post(any(Runnable.class)); + final List errorsList = new ArrayList<>(); + doAnswer( + (InvocationOnMock invocation) -> { + String description = invocation.getArgument(0); + errorsList.add(description); + return null; + }) + .when(mockEventApi) + .error(any(), any()); dartMessenger.sendCameraErrorEvent("error description"); - List sentMessages = fakeBinaryMessenger.getMessages(); - assertEquals(1, sentMessages.size()); - MethodCall call = decodeSentMessage(sentMessages.get(0)); - assertEquals("error", call.method); - assertEquals("error description", call.argument("description")); + assertEquals(1, errorsList.size()); + assertEquals("error description", errorsList.get(0)); } @Test public void sendCameraInitializedEvent_includesPreviewSize() { - doAnswer(createPostHandlerAnswer()).when(mockHandler).post(any(Runnable.class)); + final List statesList = new ArrayList<>(); + doAnswer( + (InvocationOnMock invocation) -> { + Messages.PlatformCameraState state = invocation.getArgument(0); + statesList.add(state); + return null; + }) + .when(mockEventApi) + .initialized(any(), any()); dartMessenger.sendCameraInitializedEvent(0, 0, ExposureMode.auto, FocusMode.auto, true, true); - List sentMessages = fakeBinaryMessenger.getMessages(); - assertEquals(1, sentMessages.size()); - MethodCall call = decodeSentMessage(sentMessages.get(0)); - assertEquals("initialized", call.method); - assertEquals(0, (double) call.argument("previewWidth"), 0); - assertEquals(0, (double) call.argument("previewHeight"), 0); - assertEquals("ExposureMode auto", call.argument("exposureMode"), "auto"); - assertEquals("FocusMode continuous", call.argument("focusMode"), "auto"); - assertEquals("exposurePointSupported", call.argument("exposurePointSupported"), true); - assertEquals("focusPointSupported", call.argument("focusPointSupported"), true); + assertEquals(1, statesList.size()); + Messages.PlatformCameraState state = statesList.get(0); + assertEquals(0, state.getPreviewSize().getWidth(), 0); + assertEquals(0, state.getPreviewSize().getHeight(), 0); + assertEquals("ExposureMode auto", Messages.PlatformExposureMode.AUTO, state.getExposureMode()); + assertEquals("FocusMode continuous", Messages.PlatformFocusMode.AUTO, state.getFocusMode()); + assertEquals("exposurePointSupported", true, state.getExposurePointSupported()); + assertEquals("focusPointSupported", true, state.getFocusPointSupported()); } @Test public void sendCameraClosingEvent() { - doAnswer(createPostHandlerAnswer()).when(mockHandler).post(any(Runnable.class)); + final List calls = new ArrayList<>(); + doAnswer( + (InvocationOnMock invocation) -> { + calls.add(1); + return null; + }) + .when(mockEventApi) + .closed(any()); dartMessenger.sendCameraClosingEvent(); - List sentMessages = fakeBinaryMessenger.getMessages(); - assertEquals(1, sentMessages.size()); - MethodCall call = decodeSentMessage(sentMessages.get(0)); - assertEquals("camera_closing", call.method); - assertNull(call.argument("description")); + assertEquals(1, calls.size()); + assertEquals(1, calls.get(0).intValue()); } @Test public void sendDeviceOrientationChangedEvent() { - doAnswer(createPostHandlerAnswer()).when(mockHandler).post(any(Runnable.class)); + final List eventsList = new ArrayList<>(); + doAnswer( + (InvocationOnMock invocation) -> { + Messages.PlatformDeviceOrientation orientation = invocation.getArgument(0); + eventsList.add(orientation); + return null; + }) + .when(mockGlobalEventApi) + .deviceOrientationChanged(any(), any()); dartMessenger.sendDeviceOrientationChangeEvent(PlatformChannel.DeviceOrientation.PORTRAIT_UP); - List sentMessages = fakeBinaryMessenger.getMessages(); - assertEquals(1, sentMessages.size()); - MethodCall call = decodeSentMessage(sentMessages.get(0)); - assertEquals("orientation_changed", call.method); - assertEquals(call.argument("orientation"), "portraitUp"); - } - - private static Answer createPostHandlerAnswer() { - return new Answer() { - @Override - public Boolean answer(InvocationOnMock invocation) throws Throwable { - Runnable runnable = invocation.getArgument(0, Runnable.class); - if (runnable != null) { - runnable.run(); - } - return true; - } - }; - } - - private MethodCall decodeSentMessage(ByteBuffer sentMessage) { - sentMessage.position(0); - - return StandardMethodCodec.INSTANCE.decodeMethodCall(sentMessage); + assertEquals(1, eventsList.size()); + assertEquals(Messages.PlatformDeviceOrientation.PORTRAIT_UP, eventsList.get(0)); } } 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..d951fac2bf31 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-8.7-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/packages/camera/camera_android/example/android/build.gradle b/packages/camera/camera_android/example/android/build.gradle index d38534d066af..f127ef59c24b 100644 --- a/packages/camera/camera_android/example/android/build.gradle +++ b/packages/camera/camera_android/example/android/build.gradle @@ -5,7 +5,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:8.1.1' + classpath 'com.android.tools.build:gradle:8.5.2' } } diff --git a/packages/camera/camera_android/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/camera/camera_android/example/android/gradle/wrapper/gradle-wrapper.properties index cb086a5fcff7..3c85cfe057a1 100644 --- a/packages/camera/camera_android/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/packages/camera/camera_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-8.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip diff --git a/packages/camera/camera_android/example/lib/main.dart b/packages/camera/camera_android/example/lib/main.dart index 830052e351f4..47c40c7d20d1 100644 --- a/packages/camera/camera_android/example/lib/main.dart +++ b/packages/camera/camera_android/example/lib/main.dart @@ -540,7 +540,7 @@ class _CameraExampleHomeState extends State onPressed: cameraController != null && cameraController.value.isInitialized && cameraController.value.isRecordingVideo - ? (cameraController.value.isRecordingPaused) + ? cameraController.value.isRecordingPaused ? onResumeButtonPressed : onPauseButtonPressed : null, @@ -699,7 +699,6 @@ class _CameraExampleHomeState extends State showInSnackBar('Unknown permission error.'); default: _showCameraException(e); - break; } } diff --git a/packages/camera/camera_android/example/pubspec.yaml b/packages/camera/camera_android/example/pubspec.yaml index cd212825d74b..9c8f8476d0b5 100644 --- a/packages/camera/camera_android/example/pubspec.yaml +++ b/packages/camera/camera_android/example/pubspec.yaml @@ -3,8 +3,8 @@ description: Demonstrates how to use the camera plugin. publish_to: none environment: - sdk: ^3.4.0 - flutter: ">=3.22.0" + sdk: ^3.5.0 + flutter: ">=3.24.0" dependencies: camera_android: diff --git a/packages/camera/camera_android/lib/src/android_camera.dart b/packages/camera/camera_android/lib/src/android_camera.dart index 9cd1df45191d..975c6c9be022 100644 --- a/packages/camera/camera_android/lib/src/android_camera.dart +++ b/packages/camera/camera_android/lib/src/android_camera.dart @@ -6,25 +6,26 @@ import 'dart:async'; import 'dart:math'; import 'package:camera_platform_interface/camera_platform_interface.dart'; -import 'package:flutter/foundation.dart'; import 'package:flutter/services.dart'; import 'package:flutter/widgets.dart'; import 'package:stream_transform/stream_transform.dart'; +import 'messages.g.dart'; import 'type_conversion.dart'; import 'utils.dart'; -const MethodChannel _channel = - MethodChannel('plugins.flutter.io/camera_android'); - /// The Android implementation of [CameraPlatform] that uses method channels. class AndroidCamera extends CameraPlatform { + /// Creates a new [CameraPlatform] instance. + AndroidCamera({@visibleForTesting CameraApi? hostApi}) + : _hostApi = hostApi ?? CameraApi(); + /// Registers this class as the default instance of [CameraPlatform]. static void registerWith() { CameraPlatform.instance = AndroidCamera(); } - final Map _channels = {}; + final CameraApi _hostApi; /// The name of the channel that device events from the platform side are /// sent on. @@ -43,20 +44,15 @@ class AndroidCamera extends CameraPlatform { final StreamController cameraEventStreamController = StreamController.broadcast(); - /// The controller we need to broadcast the different events coming - /// from handleMethodCall, specific to general device events. - /// - /// It is a `broadcast` because multiple controllers will connect to - /// different stream views of this Controller. - late final StreamController _deviceEventStreamController = - _createDeviceEventStreamController(); + /// Handler for device-level callbacks from the native side. + @visibleForTesting + late final HostDeviceMessageHandler hostHandler = HostDeviceMessageHandler(); - StreamController _createDeviceEventStreamController() { - // Set up the method handler lazily. - const MethodChannel channel = MethodChannel(deviceEventChannelName); - channel.setMethodCallHandler(_handleDeviceMethodCall); - return StreamController.broadcast(); - } + /// Map of camera IDs to camera-level callback handlers listening to their + /// respective platform channels. + @visibleForTesting + final Map hostCameraHandlers = + {}; // The stream to receive frames from the native code. StreamSubscription? _platformImageStreamSubscription; @@ -71,20 +67,15 @@ class AndroidCamera extends CameraPlatform { @override Future> availableCameras() async { try { - final List>? cameras = await _channel - .invokeListMethod>('availableCameras'); - - if (cameras == null) { - return []; - } - - return cameras.map((Map camera) { + final List cameraDescriptions = + await _hostApi.getAvailableCameras(); + return cameraDescriptions + .map((PlatformCameraDescription cameraDescription) { return CameraDescription( - name: camera['name']! as String, - lensDirection: - parseCameraLensDirection(camera['lensFacing']! as String), - sensorOrientation: camera['sensorOrientation']! as int, - ); + name: cameraDescription.name, + lensDirection: cameraLensDirectionFromPlatform( + cameraDescription.lensDirection), + sensorOrientation: cameraDescription.sensorOrientation); }).toList(); } on PlatformException catch (e) { throw CameraException(e.code, e.message); @@ -110,22 +101,8 @@ class AndroidCamera extends CameraPlatform { MediaSettings? mediaSettings, ) async { try { - final ResolutionPreset? resolutionPreset = - mediaSettings?.resolutionPreset; - - final Map? reply = await _channel - .invokeMapMethod('create', { - 'cameraName': cameraDescription.name, - 'resolutionPreset': resolutionPreset != null - ? _serializeResolutionPreset(resolutionPreset) - : null, - 'fps': mediaSettings?.fps, - 'videoBitrate': mediaSettings?.videoBitrate, - 'audioBitrate': mediaSettings?.audioBitrate, - 'enableAudio': mediaSettings?.enableAudio ?? false, - }); - - return reply!['cameraId']! as int; + return await _hostApi.create( + cameraDescription.name, mediaSettingsToPlatform(mediaSettings)); } on PlatformException catch (e) { throw CameraException(e.code, e.message); } @@ -135,59 +112,34 @@ class AndroidCamera extends CameraPlatform { Future initializeCamera( int cameraId, { ImageFormatGroup imageFormatGroup = ImageFormatGroup.unknown, - }) { - _channels.putIfAbsent(cameraId, () { - final MethodChannel channel = - MethodChannel('plugins.flutter.io/camera_android/camera$cameraId'); - channel.setMethodCallHandler( - (MethodCall call) => handleCameraMethodCall(call, cameraId)); - return channel; - }); + }) async { + hostCameraHandlers.putIfAbsent(cameraId, + () => HostCameraMessageHandler(cameraId, cameraEventStreamController)); final Completer completer = Completer(); - onCameraInitialized(cameraId).first.then((CameraInitializedEvent value) { + unawaited(onCameraInitialized(cameraId) + .first + .then((CameraInitializedEvent value) { completer.complete(); - }); + })); - _channel.invokeMapMethod( - 'initialize', - { - 'cameraId': cameraId, - 'imageFormatGroup': imageFormatGroup.name(), - }, - ).catchError( - // TODO(srawlins): This should return a value of the future's type. This - // will fail upcoming analysis checks with - // https://github.com/flutter/flutter/issues/105750. - // ignore: body_might_complete_normally_catch_error - (Object error, StackTrace stackTrace) { - if (error is! PlatformException) { - // ignore: only_throw_errors - throw error; - } - completer.completeError( - CameraException(error.code, error.message), - stackTrace, - ); - }, - ); + try { + await _hostApi.initialize(imageFormatGroupToPlatform(imageFormatGroup)); + } on PlatformException catch (e, s) { + completer.completeError(CameraException(e.code, e.message), s); + } return completer.future; } @override Future dispose(int cameraId) async { - if (_channels.containsKey(cameraId)) { - final MethodChannel? cameraChannel = _channels[cameraId]; - cameraChannel?.setMethodCallHandler(null); - _channels.remove(cameraId); - } + final HostCameraMessageHandler? handler = + hostCameraHandlers.remove(cameraId); + handler?.dispose(); - await _channel.invokeMethod( - 'dispose', - {'cameraId': cameraId}, - ); + await _hostApi.dispose(); } @override @@ -217,7 +169,7 @@ class AndroidCamera extends CameraPlatform { @override Stream onDeviceOrientationChanged() { - return _deviceEventStreamController.stream + return hostHandler.deviceEventStreamController.stream .whereType(); } @@ -226,43 +178,24 @@ class AndroidCamera extends CameraPlatform { int cameraId, DeviceOrientation orientation, ) async { - await _channel.invokeMethod( - 'lockCaptureOrientation', - { - 'cameraId': cameraId, - 'orientation': serializeDeviceOrientation(orientation) - }, - ); + await _hostApi + .lockCaptureOrientation(deviceOrientationToPlatform(orientation)); } @override Future unlockCaptureOrientation(int cameraId) async { - await _channel.invokeMethod( - 'unlockCaptureOrientation', - {'cameraId': cameraId}, - ); + await _hostApi.unlockCaptureOrientation(); } @override Future takePicture(int cameraId) async { - final String? path = await _channel.invokeMethod( - 'takePicture', - {'cameraId': cameraId}, - ); - - if (path == null) { - throw CameraException( - 'INVALID_PATH', - 'The platform "$defaultTargetPlatform" did not return a path while reporting success. The platform should always return a valid path or report an error.', - ); - } - + final String path = await _hostApi.takePicture(); return XFile(path); } + // This optimization is unnecessary on Android. @override - Future prepareForVideoRecording() => - _channel.invokeMethod('prepareForVideoRecording'); + Future prepareForVideoRecording() async {} @override Future startVideoRecording(int cameraId, @@ -273,13 +206,7 @@ class AndroidCamera extends CameraPlatform { @override Future startVideoCapturing(VideoCaptureOptions options) async { - await _channel.invokeMethod( - 'startVideoRecording', - { - 'cameraId': options.cameraId, - 'enableStream': options.streamCallback != null, - }, - ); + await _hostApi.startVideoRecording(options.streamCallback != null); if (options.streamCallback != null) { _installStreamController().stream.listen(options.streamCallback); @@ -289,33 +216,17 @@ class AndroidCamera extends CameraPlatform { @override Future stopVideoRecording(int cameraId) async { - final String? path = await _channel.invokeMethod( - 'stopVideoRecording', - {'cameraId': cameraId}, - ); - - if (path == null) { - throw CameraException( - 'INVALID_PATH', - 'The platform "$defaultTargetPlatform" did not return a path while reporting success. The platform should always return a valid path or report an error.', - ); - } - + final String path = await _hostApi.stopVideoRecording(); return XFile(path); } @override - Future pauseVideoRecording(int cameraId) => _channel.invokeMethod( - 'pauseVideoRecording', - {'cameraId': cameraId}, - ); + Future pauseVideoRecording(int cameraId) => + _hostApi.pauseVideoRecording(); @override Future resumeVideoRecording(int cameraId) => - _channel.invokeMethod( - 'resumeVideoRecording', - {'cameraId': cameraId}, - ); + _hostApi.resumeVideoRecording(); @override Stream onStreamedFrameAvailable(int cameraId, @@ -340,7 +251,7 @@ class AndroidCamera extends CameraPlatform { } Future _startPlatformStream() async { - await _channel.invokeMethod('startImageStream'); + await _hostApi.startImageStream(); _startStreamListener(); } @@ -355,7 +266,7 @@ class AndroidCamera extends CameraPlatform { } FutureOr _onFrameStreamCancel() async { - await _channel.invokeMethod('stopImageStream'); + await _hostApi.stopImageStream(); await _platformImageStreamSubscription?.cancel(); _platformImageStreamSubscription = null; _frameStreamController = null; @@ -368,139 +279,66 @@ class AndroidCamera extends CameraPlatform { @override Future setFlashMode(int cameraId, FlashMode mode) => - _channel.invokeMethod( - 'setFlashMode', - { - 'cameraId': cameraId, - 'mode': _serializeFlashMode(mode), - }, - ); + _hostApi.setFlashMode(flashModeToPlatform(mode)); @override Future setExposureMode(int cameraId, ExposureMode mode) => - _channel.invokeMethod( - 'setExposureMode', - { - 'cameraId': cameraId, - 'mode': serializeExposureMode(mode), - }, - ); + _hostApi.setExposureMode(exposureModeToPlatform(mode)); @override Future setExposurePoint(int cameraId, Point? point) { assert(point == null || point.x >= 0 && point.x <= 1); assert(point == null || point.y >= 0 && point.y <= 1); - return _channel.invokeMethod( - 'setExposurePoint', - { - 'cameraId': cameraId, - 'reset': point == null, - 'x': point?.x, - 'y': point?.y, - }, - ); + return _hostApi.setExposurePoint(pointToPlatform(point)); } @override Future getMinExposureOffset(int cameraId) async { - final double? minExposureOffset = await _channel.invokeMethod( - 'getMinExposureOffset', - {'cameraId': cameraId}, - ); - - return minExposureOffset!; + return _hostApi.getMinExposureOffset(); } @override Future getMaxExposureOffset(int cameraId) async { - final double? maxExposureOffset = await _channel.invokeMethod( - 'getMaxExposureOffset', - {'cameraId': cameraId}, - ); - - return maxExposureOffset!; + return _hostApi.getMaxExposureOffset(); } @override Future getExposureOffsetStepSize(int cameraId) async { - final double? stepSize = await _channel.invokeMethod( - 'getExposureOffsetStepSize', - {'cameraId': cameraId}, - ); - - return stepSize!; + return _hostApi.getExposureOffsetStepSize(); } @override Future setExposureOffset(int cameraId, double offset) async { - final double? appliedOffset = await _channel.invokeMethod( - 'setExposureOffset', - { - 'cameraId': cameraId, - 'offset': offset, - }, - ); - - return appliedOffset!; + return _hostApi.setExposureOffset(offset); } @override Future setFocusMode(int cameraId, FocusMode mode) => - _channel.invokeMethod( - 'setFocusMode', - { - 'cameraId': cameraId, - 'mode': serializeFocusMode(mode), - }, - ); + _hostApi.setFocusMode(focusModeToPlatform(mode)); @override Future setFocusPoint(int cameraId, Point? point) { assert(point == null || point.x >= 0 && point.x <= 1); assert(point == null || point.y >= 0 && point.y <= 1); - return _channel.invokeMethod( - 'setFocusPoint', - { - 'cameraId': cameraId, - 'reset': point == null, - 'x': point?.x, - 'y': point?.y, - }, - ); + return _hostApi.setFocusPoint(pointToPlatform(point)); } @override Future getMaxZoomLevel(int cameraId) async { - final double? maxZoomLevel = await _channel.invokeMethod( - 'getMaxZoomLevel', - {'cameraId': cameraId}, - ); - - return maxZoomLevel!; + return _hostApi.getMaxZoomLevel(); } @override Future getMinZoomLevel(int cameraId) async { - final double? minZoomLevel = await _channel.invokeMethod( - 'getMinZoomLevel', - {'cameraId': cameraId}, - ); - - return minZoomLevel!; + return _hostApi.getMinZoomLevel(); } @override Future setZoomLevel(int cameraId, double zoom) async { try { - await _channel.invokeMethod( - 'setZoomLevel', - { - 'cameraId': cameraId, - 'zoom': zoom, - }, - ); + await _hostApi.setZoomLevel(zoom); } on PlatformException catch (e) { throw CameraException(e.code, e.message); } @@ -508,139 +346,81 @@ class AndroidCamera extends CameraPlatform { @override Future pausePreview(int cameraId) async { - await _channel.invokeMethod( - 'pausePreview', - {'cameraId': cameraId}, - ); + await _hostApi.pausePreview(); } @override Future resumePreview(int cameraId) async { - await _channel.invokeMethod( - 'resumePreview', - {'cameraId': cameraId}, - ); + await _hostApi.resumePreview(); } @override Future setDescriptionWhileRecording( CameraDescription description) async { - await _channel.invokeMethod( - 'setDescriptionWhileRecording', - { - 'cameraName': description.name, - }, - ); + await _hostApi.setDescriptionWhileRecording(description.name); } @override Widget buildPreview(int cameraId) { return Texture(textureId: cameraId); } +} - /// Returns the flash mode as a String. - String _serializeFlashMode(FlashMode flashMode) { - switch (flashMode) { - case FlashMode.off: - return 'off'; - case FlashMode.auto: - return 'auto'; - case FlashMode.always: - return 'always'; - case FlashMode.torch: - return 'torch'; - } - // The enum comes from a different package, which could get a new value at - // any time, so provide a fallback that ensures this won't break when used - // with a version that contains new values. This is deliberately outside - // the switch rather than a `default` so that the linter will flag the - // switch as needing an update. - // ignore: dead_code - return 'off'; - } - - /// Returns the resolution preset as a String. - String _serializeResolutionPreset(ResolutionPreset resolutionPreset) { - switch (resolutionPreset) { - case ResolutionPreset.max: - return 'max'; - case ResolutionPreset.ultraHigh: - return 'ultraHigh'; - case ResolutionPreset.veryHigh: - return 'veryHigh'; - case ResolutionPreset.high: - return 'high'; - case ResolutionPreset.medium: - return 'medium'; - case ResolutionPreset.low: - return 'low'; - } - // The enum comes from a different package, which could get a new value at - // any time, so provide a fallback that ensures this won't break when used - // with a version that contains new values. This is deliberately outside - // the switch rather than a `default` so that the linter will flag the - // switch as needing an update. - // ignore: dead_code - return 'max'; - } - - /// Converts messages received from the native platform into device events. - Future _handleDeviceMethodCall(MethodCall call) async { - switch (call.method) { - case 'orientation_changed': - final Map arguments = _getArgumentDictionary(call); - _deviceEventStreamController.add(DeviceOrientationChangedEvent( - deserializeDeviceOrientation(arguments['orientation']! as String))); - default: - throw MissingPluginException(); - } +/// Handles callbacks from the platform host that are not camera-specific. +@visibleForTesting +class HostDeviceMessageHandler implements CameraGlobalEventApi { + /// Creates a new handler and registers it to listen to the global event platform channel. + HostDeviceMessageHandler() { + CameraGlobalEventApi.setUp(this); } - /// Converts messages received from the native platform into camera events. - /// - /// This is only exposed for test purposes. It shouldn't be used by clients of - /// the plugin as it may break or change at any time. - @visibleForTesting - Future handleCameraMethodCall(MethodCall call, int cameraId) async { - switch (call.method) { - case 'initialized': - final Map arguments = _getArgumentDictionary(call); - cameraEventStreamController.add(CameraInitializedEvent( - cameraId, - arguments['previewWidth']! as double, - arguments['previewHeight']! as double, - deserializeExposureMode(arguments['exposureMode']! as String), - arguments['exposurePointSupported']! as bool, - deserializeFocusMode(arguments['focusMode']! as String), - arguments['focusPointSupported']! as bool, - )); - case 'resolution_changed': - final Map arguments = _getArgumentDictionary(call); - cameraEventStreamController.add(CameraResolutionChangedEvent( - cameraId, - arguments['captureWidth']! as double, - arguments['captureHeight']! as double, - )); - case 'camera_closing': - cameraEventStreamController.add(CameraClosingEvent( - cameraId, - )); - case 'error': - final Map arguments = _getArgumentDictionary(call); - cameraEventStreamController.add(CameraErrorEvent( - cameraId, - arguments['description']! as String, - )); - default: - throw MissingPluginException(); - } + /// The controller that broadcasts device events coming from the host platform. + final StreamController deviceEventStreamController = + StreamController.broadcast(); + @override + void deviceOrientationChanged(PlatformDeviceOrientation orientation) { + deviceEventStreamController.add(DeviceOrientationChangedEvent( + deviceOrientationFromPlatform(orientation))); } +} - /// Returns the arguments of [call] as typed string-keyed Map. - /// - /// This does not do any type validation, so is only safe to call if the - /// arguments are known to be a map. - Map _getArgumentDictionary(MethodCall call) { - return (call.arguments as Map).cast(); +/// Handles camera-specific callbacks from the platform host. +@visibleForTesting +class HostCameraMessageHandler implements CameraEventApi { + /// Creates a new handler and registers it to listen to its camera's platform channel. + HostCameraMessageHandler(this.cameraId, this.cameraEventStreamController) { + CameraEventApi.setUp(this, messageChannelSuffix: '$cameraId'); + } + + /// Removes this handler from its platform channel. + void dispose() { + CameraEventApi.setUp(null, messageChannelSuffix: '$cameraId'); + } + + /// The ID of the camera for which this handler listens for events. + final int cameraId; + + /// The controller which broadcasts camera events from the host platform. + final StreamController cameraEventStreamController; + @override + void error(String message) { + cameraEventStreamController.add(CameraErrorEvent(cameraId, message)); + } + + @override + void initialized(PlatformCameraState initialState) { + cameraEventStreamController.add(CameraInitializedEvent( + cameraId, + initialState.previewSize.width, + initialState.previewSize.height, + exposureModeFromPlatform(initialState.exposureMode), + initialState.exposurePointSupported, + focusModeFromPlatform(initialState.focusMode), + initialState.focusPointSupported)); + } + + @override + void closed() { + cameraEventStreamController.add(CameraClosingEvent(cameraId)); } } diff --git a/packages/camera/camera_android/lib/src/messages.g.dart b/packages/camera/camera_android/lib/src/messages.g.dart new file mode 100644 index 000000000000..81e21a01da3f --- /dev/null +++ b/packages/camera/camera_android/lib/src/messages.g.dart @@ -0,0 +1,1272 @@ +// 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 (v22.4.1), 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, no_leading_underscores_for_local_identifiers + +import 'dart:async'; +import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List; + +import 'package:flutter/foundation.dart' show ReadBuffer, WriteBuffer; +import 'package:flutter/services.dart'; + +PlatformException _createConnectionError(String channelName) { + return PlatformException( + code: 'channel-error', + message: 'Unable to establish connection on channel: "$channelName".', + ); +} + +List wrapResponse( + {Object? result, PlatformException? error, bool empty = false}) { + if (empty) { + return []; + } + if (error == null) { + return [result]; + } + return [error.code, error.message, error.details]; +} + +/// Pigeon equivalent of [CameraLensDirection]. +enum PlatformCameraLensDirection { + front, + back, + external, +} + +/// Pigeon equivalent of [DeviceOrientation]. +enum PlatformDeviceOrientation { + portraitUp, + portraitDown, + landscapeLeft, + landscapeRight, +} + +/// Pigeon equivalent of [ExposureMode]. +enum PlatformExposureMode { + auto, + locked, +} + +/// Pigeon equivalent of [FocusMode]. +enum PlatformFocusMode { + auto, + locked, +} + +/// Pigeon equivalent of [ResolutionPreset]. +enum PlatformResolutionPreset { + low, + medium, + high, + veryHigh, + ultraHigh, + max, +} + +/// Pigeon equivalent of [ImageFormatGroup]. +enum PlatformImageFormatGroup { + /// The default for Android. + yuv420, + jpeg, + nv21, +} + +/// Pigeon equivalent of [FlashMode]. +enum PlatformFlashMode { + off, + auto, + always, + torch, +} + +/// Pigeon equivalent of [CameraDescription]. +class PlatformCameraDescription { + PlatformCameraDescription({ + required this.name, + required this.lensDirection, + required this.sensorOrientation, + }); + + String name; + + PlatformCameraLensDirection lensDirection; + + int sensorOrientation; + + Object encode() { + return [ + name, + lensDirection, + sensorOrientation, + ]; + } + + static PlatformCameraDescription decode(Object result) { + result as List; + return PlatformCameraDescription( + name: result[0]! as String, + lensDirection: result[1]! as PlatformCameraLensDirection, + sensorOrientation: result[2]! as int, + ); + } +} + +/// Data needed for [CameraInitializedEvent]. +class PlatformCameraState { + PlatformCameraState({ + required this.previewSize, + required this.exposureMode, + required this.focusMode, + required this.exposurePointSupported, + required this.focusPointSupported, + }); + + PlatformSize previewSize; + + PlatformExposureMode exposureMode; + + PlatformFocusMode focusMode; + + bool exposurePointSupported; + + bool focusPointSupported; + + Object encode() { + return [ + previewSize, + exposureMode, + focusMode, + exposurePointSupported, + focusPointSupported, + ]; + } + + static PlatformCameraState decode(Object result) { + result as List; + return PlatformCameraState( + previewSize: result[0]! as PlatformSize, + exposureMode: result[1]! as PlatformExposureMode, + focusMode: result[2]! as PlatformFocusMode, + exposurePointSupported: result[3]! as bool, + focusPointSupported: result[4]! as bool, + ); + } +} + +/// Pigeon equivalent of [Size]. +class PlatformSize { + PlatformSize({ + required this.width, + required this.height, + }); + + double width; + + double height; + + Object encode() { + return [ + width, + height, + ]; + } + + static PlatformSize decode(Object result) { + result as List; + return PlatformSize( + width: result[0]! as double, + height: result[1]! as double, + ); + } +} + +/// Pigeon equivalent of [Point]. +class PlatformPoint { + PlatformPoint({ + required this.x, + required this.y, + }); + + double x; + + double y; + + Object encode() { + return [ + x, + y, + ]; + } + + static PlatformPoint decode(Object result) { + result as List; + return PlatformPoint( + x: result[0]! as double, + y: result[1]! as double, + ); + } +} + +/// Pigeon equivalent of [MediaSettings]. +class PlatformMediaSettings { + PlatformMediaSettings({ + required this.resolutionPreset, + this.fps, + this.videoBitrate, + this.audioBitrate, + required this.enableAudio, + }); + + PlatformResolutionPreset resolutionPreset; + + int? fps; + + int? videoBitrate; + + int? audioBitrate; + + bool enableAudio; + + Object encode() { + return [ + resolutionPreset, + fps, + videoBitrate, + audioBitrate, + enableAudio, + ]; + } + + static PlatformMediaSettings decode(Object result) { + result as List; + return PlatformMediaSettings( + resolutionPreset: result[0]! as PlatformResolutionPreset, + fps: result[1] as int?, + videoBitrate: result[2] as int?, + audioBitrate: result[3] as int?, + enableAudio: result[4]! as bool, + ); + } +} + +class _PigeonCodec extends StandardMessageCodec { + const _PigeonCodec(); + @override + void writeValue(WriteBuffer buffer, Object? value) { + if (value is int) { + buffer.putUint8(4); + buffer.putInt64(value); + } else if (value is PlatformCameraLensDirection) { + buffer.putUint8(129); + writeValue(buffer, value.index); + } else if (value is PlatformDeviceOrientation) { + buffer.putUint8(130); + writeValue(buffer, value.index); + } else if (value is PlatformExposureMode) { + buffer.putUint8(131); + writeValue(buffer, value.index); + } else if (value is PlatformFocusMode) { + buffer.putUint8(132); + writeValue(buffer, value.index); + } else if (value is PlatformResolutionPreset) { + buffer.putUint8(133); + writeValue(buffer, value.index); + } else if (value is PlatformImageFormatGroup) { + buffer.putUint8(134); + writeValue(buffer, value.index); + } else if (value is PlatformFlashMode) { + buffer.putUint8(135); + writeValue(buffer, value.index); + } else if (value is PlatformCameraDescription) { + buffer.putUint8(136); + writeValue(buffer, value.encode()); + } else if (value is PlatformCameraState) { + buffer.putUint8(137); + writeValue(buffer, value.encode()); + } else if (value is PlatformSize) { + buffer.putUint8(138); + writeValue(buffer, value.encode()); + } else if (value is PlatformPoint) { + buffer.putUint8(139); + writeValue(buffer, value.encode()); + } else if (value is PlatformMediaSettings) { + buffer.putUint8(140); + writeValue(buffer, value.encode()); + } else { + super.writeValue(buffer, value); + } + } + + @override + Object? readValueOfType(int type, ReadBuffer buffer) { + switch (type) { + case 129: + final int? value = readValue(buffer) as int?; + return value == null ? null : PlatformCameraLensDirection.values[value]; + case 130: + final int? value = readValue(buffer) as int?; + return value == null ? null : PlatformDeviceOrientation.values[value]; + case 131: + final int? value = readValue(buffer) as int?; + return value == null ? null : PlatformExposureMode.values[value]; + case 132: + final int? value = readValue(buffer) as int?; + return value == null ? null : PlatformFocusMode.values[value]; + case 133: + final int? value = readValue(buffer) as int?; + return value == null ? null : PlatformResolutionPreset.values[value]; + case 134: + final int? value = readValue(buffer) as int?; + return value == null ? null : PlatformImageFormatGroup.values[value]; + case 135: + final int? value = readValue(buffer) as int?; + return value == null ? null : PlatformFlashMode.values[value]; + case 136: + return PlatformCameraDescription.decode(readValue(buffer)!); + case 137: + return PlatformCameraState.decode(readValue(buffer)!); + case 138: + return PlatformSize.decode(readValue(buffer)!); + case 139: + return PlatformPoint.decode(readValue(buffer)!); + case 140: + return PlatformMediaSettings.decode(readValue(buffer)!); + default: + return super.readValueOfType(type, buffer); + } + } +} + +/// Handles calls from Dart to the native side. +class CameraApi { + /// Constructor for [CameraApi]. The [binaryMessenger] named argument is + /// available for dependency injection. If it is left null, the default + /// BinaryMessenger will be used which routes to the host platform. + CameraApi( + {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) + : pigeonVar_binaryMessenger = binaryMessenger, + pigeonVar_messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + final BinaryMessenger? pigeonVar_binaryMessenger; + + static const MessageCodec pigeonChannelCodec = _PigeonCodec(); + + final String pigeonVar_messageChannelSuffix; + + /// Returns the list of available cameras. + Future> getAvailableCameras() async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_android.CameraApi.getAvailableCameras$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } else { + return (pigeonVar_replyList[0] as List?)! + .cast(); + } + } + + /// Creates a new camera with the given name and settings and returns its ID. + Future create( + String cameraName, PlatformMediaSettings mediaSettings) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_android.CameraApi.create$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = await pigeonVar_channel + .send([cameraName, mediaSettings]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } else { + return (pigeonVar_replyList[0] as int?)!; + } + } + + /// Initializes the camera with the given ID for the given image format. + Future initialize(PlatformImageFormatGroup imageFormat) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_android.CameraApi.initialize$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([imageFormat]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return; + } + } + + /// Disposes of the camera with the given ID. + Future dispose() async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_android.CameraApi.dispose$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return; + } + } + + /// Locks the camera with the given ID to the given orientation. + Future lockCaptureOrientation( + PlatformDeviceOrientation orientation) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_android.CameraApi.lockCaptureOrientation$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([orientation]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return; + } + } + + /// Unlocks the orientation for the camera with the given ID. + Future unlockCaptureOrientation() async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_android.CameraApi.unlockCaptureOrientation$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return; + } + } + + /// Takes a picture on the camera with the given ID and returns a path to the + /// resulting file. + Future takePicture() async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_android.CameraApi.takePicture$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } else { + return (pigeonVar_replyList[0] as String?)!; + } + } + + /// Starts recording a video on the camera with the given ID. + Future startVideoRecording(bool enableStream) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_android.CameraApi.startVideoRecording$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([enableStream]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return; + } + } + + /// Ends video recording on the camera with the given ID and returns the path + /// to the resulting file. + Future stopVideoRecording() async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_android.CameraApi.stopVideoRecording$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } else { + return (pigeonVar_replyList[0] as String?)!; + } + } + + /// Pauses video recording on the camera with the given ID. + Future pauseVideoRecording() async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_android.CameraApi.pauseVideoRecording$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return; + } + } + + /// Resumes previously paused video recording on the camera with the given ID. + Future resumeVideoRecording() async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_android.CameraApi.resumeVideoRecording$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return; + } + } + + /// Begins streaming frames from the camera. + Future startImageStream() async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_android.CameraApi.startImageStream$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return; + } + } + + /// Stops streaming frames from the camera. + Future stopImageStream() async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_android.CameraApi.stopImageStream$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return; + } + } + + /// Sets the flash mode of the camera with the given ID. + Future setFlashMode(PlatformFlashMode flashMode) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_android.CameraApi.setFlashMode$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([flashMode]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return; + } + } + + /// Sets the exposure mode of the camera with the given ID. + Future setExposureMode(PlatformExposureMode exposureMode) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_android.CameraApi.setExposureMode$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([exposureMode]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return; + } + } + + /// Sets the exposure point of the camera with the given ID. + /// + /// A null value resets to the default exposure point. + Future setExposurePoint(PlatformPoint? point) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_android.CameraApi.setExposurePoint$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([point]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return; + } + } + + /// Returns the minimum exposure offset of the camera with the given ID. + Future getMinExposureOffset() async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_android.CameraApi.getMinExposureOffset$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } else { + return (pigeonVar_replyList[0] as double?)!; + } + } + + /// Returns the maximum exposure offset of the camera with the given ID. + Future getMaxExposureOffset() async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_android.CameraApi.getMaxExposureOffset$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } else { + return (pigeonVar_replyList[0] as double?)!; + } + } + + /// Returns the exposure step size of the camera with the given ID. + Future getExposureOffsetStepSize() async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_android.CameraApi.getExposureOffsetStepSize$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } else { + return (pigeonVar_replyList[0] as double?)!; + } + } + + /// Sets the exposure offset of the camera with the given ID and returns the + /// actual exposure offset. + Future setExposureOffset(double offset) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_android.CameraApi.setExposureOffset$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([offset]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } else { + return (pigeonVar_replyList[0] as double?)!; + } + } + + /// Sets the focus mode of the camera with the given ID. + Future setFocusMode(PlatformFocusMode focusMode) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_android.CameraApi.setFocusMode$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([focusMode]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return; + } + } + + /// Sets the focus point of the camera with the given ID. + /// + /// A null value resets to the default focus point. + Future setFocusPoint(PlatformPoint? point) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_android.CameraApi.setFocusPoint$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([point]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return; + } + } + + /// Returns the maximum zoom level of the camera with the given ID. + Future getMaxZoomLevel() async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_android.CameraApi.getMaxZoomLevel$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } else { + return (pigeonVar_replyList[0] as double?)!; + } + } + + /// Returns the minimum zoom level of the camera with the given ID. + Future getMinZoomLevel() async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_android.CameraApi.getMinZoomLevel$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } else { + return (pigeonVar_replyList[0] as double?)!; + } + } + + /// Sets the zoom level of the camera with the given ID. + Future setZoomLevel(double zoom) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_android.CameraApi.setZoomLevel$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([zoom]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return; + } + } + + /// Pauses streaming of preview frames. + Future pausePreview() async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_android.CameraApi.pausePreview$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return; + } + } + + /// Resumes previously paused streaming of preview frames. + Future resumePreview() async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_android.CameraApi.resumePreview$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return; + } + } + + /// Changes the camera while recording video. + /// + /// This should be called only while video recording is active. + Future setDescriptionWhileRecording(String description) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_android.CameraApi.setDescriptionWhileRecording$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([description]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return; + } + } +} + +/// Handles calls from native side to Dart that are not camera-specific. +abstract class CameraGlobalEventApi { + static const MessageCodec pigeonChannelCodec = _PigeonCodec(); + + /// Called when the device's physical orientation changes. + void deviceOrientationChanged(PlatformDeviceOrientation orientation); + + static void setUp( + CameraGlobalEventApi? api, { + BinaryMessenger? binaryMessenger, + String messageChannelSuffix = '', + }) { + messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + { + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.camera_android.CameraGlobalEventApi.deviceOrientationChanged$messageChannelSuffix', + pigeonChannelCodec, + binaryMessenger: binaryMessenger); + if (api == null) { + pigeonVar_channel.setMessageHandler(null); + } else { + pigeonVar_channel.setMessageHandler((Object? message) async { + assert(message != null, + 'Argument for dev.flutter.pigeon.camera_android.CameraGlobalEventApi.deviceOrientationChanged was null.'); + final List args = (message as List?)!; + final PlatformDeviceOrientation? arg_orientation = + (args[0] as PlatformDeviceOrientation?); + assert(arg_orientation != null, + 'Argument for dev.flutter.pigeon.camera_android.CameraGlobalEventApi.deviceOrientationChanged was null, expected non-null PlatformDeviceOrientation.'); + try { + api.deviceOrientationChanged(arg_orientation!); + return wrapResponse(empty: true); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } + }); + } + } + } +} + +/// Handles device-specific calls from native side to Dart. +abstract class CameraEventApi { + static const MessageCodec pigeonChannelCodec = _PigeonCodec(); + + /// Called when the camera is initialized. + void initialized(PlatformCameraState initialState); + + /// Called when an error occurs in the camera. + void error(String message); + + /// Called when the camera closes. + void closed(); + + static void setUp( + CameraEventApi? api, { + BinaryMessenger? binaryMessenger, + String messageChannelSuffix = '', + }) { + messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + { + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.camera_android.CameraEventApi.initialized$messageChannelSuffix', + pigeonChannelCodec, + binaryMessenger: binaryMessenger); + if (api == null) { + pigeonVar_channel.setMessageHandler(null); + } else { + pigeonVar_channel.setMessageHandler((Object? message) async { + assert(message != null, + 'Argument for dev.flutter.pigeon.camera_android.CameraEventApi.initialized was null.'); + final List args = (message as List?)!; + final PlatformCameraState? arg_initialState = + (args[0] as PlatformCameraState?); + assert(arg_initialState != null, + 'Argument for dev.flutter.pigeon.camera_android.CameraEventApi.initialized was null, expected non-null PlatformCameraState.'); + try { + api.initialized(arg_initialState!); + return wrapResponse(empty: true); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } + }); + } + } + { + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.camera_android.CameraEventApi.error$messageChannelSuffix', + pigeonChannelCodec, + binaryMessenger: binaryMessenger); + if (api == null) { + pigeonVar_channel.setMessageHandler(null); + } else { + pigeonVar_channel.setMessageHandler((Object? message) async { + assert(message != null, + 'Argument for dev.flutter.pigeon.camera_android.CameraEventApi.error was null.'); + final List args = (message as List?)!; + final String? arg_message = (args[0] as String?); + assert(arg_message != null, + 'Argument for dev.flutter.pigeon.camera_android.CameraEventApi.error was null, expected non-null String.'); + try { + api.error(arg_message!); + return wrapResponse(empty: true); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } + }); + } + } + { + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.camera_android.CameraEventApi.closed$messageChannelSuffix', + pigeonChannelCodec, + binaryMessenger: binaryMessenger); + if (api == null) { + pigeonVar_channel.setMessageHandler(null); + } else { + pigeonVar_channel.setMessageHandler((Object? message) async { + try { + api.closed(); + return wrapResponse(empty: true); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } + }); + } + } + } +} diff --git a/packages/camera/camera_android/lib/src/utils.dart b/packages/camera/camera_android/lib/src/utils.dart index 8d58f7fe1297..1b3d2809e2c8 100644 --- a/packages/camera/camera_android/lib/src/utils.dart +++ b/packages/camera/camera_android/lib/src/utils.dart @@ -2,55 +2,160 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'dart:math'; + import 'package:camera_platform_interface/camera_platform_interface.dart'; import 'package:flutter/services.dart'; -/// Parses a string into a corresponding CameraLensDirection. -CameraLensDirection parseCameraLensDirection(String string) { - switch (string) { - case 'front': - return CameraLensDirection.front; - case 'back': - return CameraLensDirection.back; - case 'external': - return CameraLensDirection.external; - } - throw ArgumentError('Unknown CameraLensDirection value'); -} +import 'messages.g.dart'; + +/// Converts a [PlatformCameraLensDirection] to [CameraLensDirection]. +CameraLensDirection cameraLensDirectionFromPlatform( + PlatformCameraLensDirection direction) => + switch (direction) { + PlatformCameraLensDirection.front => CameraLensDirection.front, + PlatformCameraLensDirection.back => CameraLensDirection.back, + PlatformCameraLensDirection.external => CameraLensDirection.external, + }; -/// Returns the device orientation as a String. -String serializeDeviceOrientation(DeviceOrientation orientation) { +/// Converts a [PlatformDeviceOrientation] to [DeviceOrientation]. +DeviceOrientation deviceOrientationFromPlatform( + PlatformDeviceOrientation orientation) => + switch (orientation) { + PlatformDeviceOrientation.portraitUp => DeviceOrientation.portraitUp, + PlatformDeviceOrientation.portraitDown => DeviceOrientation.portraitDown, + PlatformDeviceOrientation.landscapeLeft => + DeviceOrientation.landscapeLeft, + PlatformDeviceOrientation.landscapeRight => + DeviceOrientation.landscapeRight, + }; + +/// Converts a [DeviceOrientation] to [PlatformDeviceOrientation]. +PlatformDeviceOrientation deviceOrientationToPlatform( + DeviceOrientation orientation) { switch (orientation) { case DeviceOrientation.portraitUp: - return 'portraitUp'; + return PlatformDeviceOrientation.portraitUp; case DeviceOrientation.portraitDown: - return 'portraitDown'; - case DeviceOrientation.landscapeRight: - return 'landscapeRight'; + return PlatformDeviceOrientation.portraitDown; case DeviceOrientation.landscapeLeft: - return 'landscapeLeft'; + return PlatformDeviceOrientation.landscapeLeft; + case DeviceOrientation.landscapeRight: + return PlatformDeviceOrientation.landscapeRight; } - // The enum comes from a different package, which could get a new value at - // any time, so provide a fallback that ensures this won't break when used - // with a version that contains new values. This is deliberately outside - // the switch rather than a `default` so that the linter will flag the - // switch as needing an update. + // This enum is defined outside of this package. This fall-through case + // ensures that the code does not break if a new value is ever added. // ignore: dead_code - return 'portraitUp'; + return PlatformDeviceOrientation.portraitUp; } -/// Returns the device orientation for a given String. -DeviceOrientation deserializeDeviceOrientation(String str) { - switch (str) { - case 'portraitUp': - return DeviceOrientation.portraitUp; - case 'portraitDown': - return DeviceOrientation.portraitDown; - case 'landscapeRight': - return DeviceOrientation.landscapeRight; - case 'landscapeLeft': - return DeviceOrientation.landscapeLeft; - default: - throw ArgumentError('"$str" is not a valid DeviceOrientation value'); +/// Converts a [PlatformExposureMode] to [ExposureMode]. +ExposureMode exposureModeFromPlatform(PlatformExposureMode exposureMode) => + switch (exposureMode) { + PlatformExposureMode.auto => ExposureMode.auto, + PlatformExposureMode.locked => ExposureMode.locked, + }; + +/// Converts a [ExposureMode] to [PlatformExposureMode]. +PlatformExposureMode exposureModeToPlatform(ExposureMode exposureMode) { + switch (exposureMode) { + case ExposureMode.auto: + return PlatformExposureMode.auto; + case ExposureMode.locked: + return PlatformExposureMode.locked; } + // This enum is defined outside of this package. This fall-through case + // ensures that the code does not break if a new value is ever added. + // ignore: dead_code + return PlatformExposureMode.auto; } + +/// Converts a [PlatformFocusMode] to [FocusMode]. +FocusMode focusModeFromPlatform(PlatformFocusMode focusMode) => + switch (focusMode) { + PlatformFocusMode.auto => FocusMode.auto, + PlatformFocusMode.locked => FocusMode.locked, + }; + +/// Converts a [FocusMode] to [PlatformFocusMode]. +PlatformFocusMode focusModeToPlatform(FocusMode focusMode) { + switch (focusMode) { + case FocusMode.auto: + return PlatformFocusMode.auto; + case FocusMode.locked: + return PlatformFocusMode.locked; + } + // This enum is defined outside of this package. This fall-through case + // ensures that the code does not break if a new value is ever added. + // ignore: dead_code + return PlatformFocusMode.auto; +} + +/// Converts a [ResolutionPreset] to [PlatformResolutionPreset]. +PlatformResolutionPreset resolutionPresetToPlatform(ResolutionPreset? preset) => + switch (preset) { + ResolutionPreset.low => PlatformResolutionPreset.low, + ResolutionPreset.medium => PlatformResolutionPreset.medium, + ResolutionPreset.high => PlatformResolutionPreset.high, + ResolutionPreset.veryHigh => PlatformResolutionPreset.veryHigh, + ResolutionPreset.ultraHigh => PlatformResolutionPreset.ultraHigh, + ResolutionPreset.max => PlatformResolutionPreset.max, + _ => PlatformResolutionPreset.high, + }; + +/// Converts a [MediaSettings] to [PlatformMediaSettings]. +PlatformMediaSettings mediaSettingsToPlatform(MediaSettings? settings) => + PlatformMediaSettings( + resolutionPreset: + resolutionPresetToPlatform(settings?.resolutionPreset), + enableAudio: settings?.enableAudio ?? false, + videoBitrate: settings?.videoBitrate, + audioBitrate: settings?.audioBitrate, + fps: settings?.fps); + +/// Converts an [ImageFormatGroup] to [PlatformImageFormatGroup]. +/// +/// [ImageFormatGroup.unknown] and [ImageFormatGroup.bgra8888] default to +/// [PlatformImageFormatGroup.yuv420], which is the default on Android. +PlatformImageFormatGroup imageFormatGroupToPlatform(ImageFormatGroup format) { + switch (format) { + case ImageFormatGroup.unknown: + return PlatformImageFormatGroup.yuv420; + case ImageFormatGroup.yuv420: + return PlatformImageFormatGroup.yuv420; + case ImageFormatGroup.bgra8888: + return PlatformImageFormatGroup.yuv420; + case ImageFormatGroup.jpeg: + return PlatformImageFormatGroup.jpeg; + case ImageFormatGroup.nv21: + return PlatformImageFormatGroup.nv21; + } + // This enum is defined outside of this package. This fall-through case + // ensures that the code does not break if a new value is ever added. + // ignore: dead_code + return PlatformImageFormatGroup.yuv420; +} + +/// Converts a [FlashMode] to [PlatformFlashMode]. +PlatformFlashMode flashModeToPlatform(FlashMode mode) { + switch (mode) { + case FlashMode.auto: + return PlatformFlashMode.auto; + case FlashMode.off: + return PlatformFlashMode.off; + case FlashMode.always: + return PlatformFlashMode.always; + case FlashMode.torch: + return PlatformFlashMode.torch; + } + // This enum is defined outside of this package. This fall-through case + // ensures that the code does not break if a new value is ever added. + // ignore: dead_code + return PlatformFlashMode.auto; +} + +/// Converts a [Point] to [PlatformPoint]. +/// +/// Null becomes null. +PlatformPoint? pointToPlatform(Point? point) => + (point != null) ? PlatformPoint(x: point.x, y: point.y) : null; diff --git a/packages/camera/camera_android/pigeons/copyright.txt b/packages/camera/camera_android/pigeons/copyright.txt new file mode 100644 index 000000000000..fb682b1ab965 --- /dev/null +++ b/packages/camera/camera_android/pigeons/copyright.txt @@ -0,0 +1,3 @@ +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. \ No newline at end of file diff --git a/packages/camera/camera_android/pigeons/messages.dart b/packages/camera/camera_android/pigeons/messages.dart new file mode 100644 index 000000000000..6031ac3d5a3d --- /dev/null +++ b/packages/camera/camera_android/pigeons/messages.dart @@ -0,0 +1,248 @@ +// 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:pigeon/pigeon.dart'; + +@ConfigurePigeon(PigeonOptions( + dartOut: 'lib/src/messages.g.dart', + javaOptions: JavaOptions(package: 'io.flutter.plugins.camera'), + javaOut: 'android/src/main/java/io/flutter/plugins/camera/Messages.java', + copyrightHeader: 'pigeons/copyright.txt', +)) + +/// Pigeon equivalent of [CameraLensDirection]. +enum PlatformCameraLensDirection { + front, + back, + external, +} + +/// Pigeon equivalent of [CameraDescription]. +class PlatformCameraDescription { + PlatformCameraDescription( + {required this.name, + required this.lensDirection, + required this.sensorOrientation}); + + final String name; + final PlatformCameraLensDirection lensDirection; + final int sensorOrientation; +} + +/// Pigeon equivalent of [DeviceOrientation]. +enum PlatformDeviceOrientation { + portraitUp, + portraitDown, + landscapeLeft, + landscapeRight, +} + +/// Pigeon equivalent of [ExposureMode]. +enum PlatformExposureMode { + auto, + locked, +} + +/// Pigeon equivalent of [FocusMode]. +enum PlatformFocusMode { + auto, + locked, +} + +/// Data needed for [CameraInitializedEvent]. +class PlatformCameraState { + PlatformCameraState( + {required this.previewSize, + required this.exposureMode, + required this.focusMode, + required this.exposurePointSupported, + required this.focusPointSupported}); + + final PlatformSize previewSize; + final PlatformExposureMode exposureMode; + final PlatformFocusMode focusMode; + final bool exposurePointSupported; + final bool focusPointSupported; +} + +/// Pigeon equivalent of [Size]. +class PlatformSize { + PlatformSize({required this.width, required this.height}); + + final double width; + final double height; +} + +/// Pigeon equivalent of [Point]. +class PlatformPoint { + PlatformPoint({required this.x, required this.y}); + + final double x; + final double y; +} + +/// Pigeon equivalent of [ResolutionPreset]. +enum PlatformResolutionPreset { + low, + medium, + high, + veryHigh, + ultraHigh, + max, +} + +/// Pigeon equivalent of [MediaSettings]. +class PlatformMediaSettings { + PlatformMediaSettings( + {required this.resolutionPreset, + required this.enableAudio, + this.fps, + this.videoBitrate, + this.audioBitrate}); + final PlatformResolutionPreset resolutionPreset; + final int? fps; + final int? videoBitrate; + final int? audioBitrate; + final bool enableAudio; +} + +/// Pigeon equivalent of [ImageFormatGroup]. +enum PlatformImageFormatGroup { + /// The default for Android. + yuv420, + jpeg, + nv21, +} + +/// Pigeon equivalent of [FlashMode]. +enum PlatformFlashMode { + off, + auto, + always, + torch, +} + +/// Handles calls from Dart to the native side. +@HostApi() +abstract class CameraApi { + /// Returns the list of available cameras. + List getAvailableCameras(); + + /// Creates a new camera with the given name and settings and returns its ID. + @async + int create(String cameraName, PlatformMediaSettings mediaSettings); + + /// Initializes the camera with the given ID for the given image format. + void initialize(PlatformImageFormatGroup imageFormat); + + /// Disposes of the camera with the given ID. + void dispose(); + + /// Locks the camera with the given ID to the given orientation. + void lockCaptureOrientation(PlatformDeviceOrientation orientation); + + /// Unlocks the orientation for the camera with the given ID. + void unlockCaptureOrientation(); + + /// Takes a picture on the camera with the given ID and returns a path to the + /// resulting file. + @async + String takePicture(); + + /// Starts recording a video on the camera with the given ID. + void startVideoRecording(bool enableStream); + + /// Ends video recording on the camera with the given ID and returns the path + /// to the resulting file. + String stopVideoRecording(); + + /// Pauses video recording on the camera with the given ID. + void pauseVideoRecording(); + + /// Resumes previously paused video recording on the camera with the given ID. + void resumeVideoRecording(); + + /// Begins streaming frames from the camera. + void startImageStream(); + + /// Stops streaming frames from the camera. + void stopImageStream(); + + /// Sets the flash mode of the camera with the given ID. + @async + void setFlashMode(PlatformFlashMode flashMode); + + /// Sets the exposure mode of the camera with the given ID. + @async + void setExposureMode(PlatformExposureMode exposureMode); + + /// Sets the exposure point of the camera with the given ID. + /// + /// A null value resets to the default exposure point. + @async + void setExposurePoint(PlatformPoint? point); + + /// Returns the minimum exposure offset of the camera with the given ID. + double getMinExposureOffset(); + + /// Returns the maximum exposure offset of the camera with the given ID. + double getMaxExposureOffset(); + + /// Returns the exposure step size of the camera with the given ID. + double getExposureOffsetStepSize(); + + /// Sets the exposure offset of the camera with the given ID and returns the + /// actual exposure offset. + @async + double setExposureOffset(double offset); + + /// Sets the focus mode of the camera with the given ID. + void setFocusMode(PlatformFocusMode focusMode); + + /// Sets the focus point of the camera with the given ID. + /// + /// A null value resets to the default focus point. + @async + void setFocusPoint(PlatformPoint? point); + + /// Returns the maximum zoom level of the camera with the given ID. + double getMaxZoomLevel(); + + /// Returns the minimum zoom level of the camera with the given ID. + double getMinZoomLevel(); + + /// Sets the zoom level of the camera with the given ID. + @async + void setZoomLevel(double zoom); + + /// Pauses streaming of preview frames. + void pausePreview(); + + /// Resumes previously paused streaming of preview frames. + void resumePreview(); + + /// Changes the camera while recording video. + /// + /// This should be called only while video recording is active. + void setDescriptionWhileRecording(String description); +} + +/// Handles calls from native side to Dart that are not camera-specific. +@FlutterApi() +abstract class CameraGlobalEventApi { + /// Called when the device's physical orientation changes. + void deviceOrientationChanged(PlatformDeviceOrientation orientation); +} + +/// Handles device-specific calls from native side to Dart. +@FlutterApi() +abstract class CameraEventApi { + /// Called when the camera is initialized. + void initialized(PlatformCameraState initialState); + + /// Called when an error occurs in the camera. + void error(String message); + + /// Called when the camera closes. + void closed(); +} diff --git a/packages/camera/camera_android/pubspec.yaml b/packages/camera/camera_android/pubspec.yaml index 4ddd429c519f..6bc18c3c7c63 100644 --- a/packages/camera/camera_android/pubspec.yaml +++ b/packages/camera/camera_android/pubspec.yaml @@ -3,11 +3,11 @@ 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.9+11 +version: 0.10.9+16 environment: - sdk: ^3.4.0 - flutter: ">=3.22.0" + sdk: ^3.5.0 + flutter: ">=3.24.0" flutter: plugin: @@ -27,8 +27,11 @@ dependencies: dev_dependencies: async: ^2.5.0 + build_runner: ^2.4.11 flutter_test: sdk: flutter + mockito: ^5.4.4 + pigeon: ^22.4.1 topics: - camera diff --git a/packages/camera/camera_android/test/android_camera_test.dart b/packages/camera/camera_android/test/android_camera_test.dart index 04e2e256837c..7c6d55c485b8 100644 --- a/packages/camera/camera_android/test/android_camera_test.dart +++ b/packages/camera/camera_android/test/android_camera_test.dart @@ -7,16 +7,18 @@ import 'dart:math'; import 'package:async/async.dart'; import 'package:camera_android/src/android_camera.dart'; +import 'package:camera_android/src/messages.g.dart'; import 'package:camera_android/src/utils.dart'; import 'package:camera_platform_interface/camera_platform_interface.dart'; import 'package:flutter/services.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; +import 'package:mockito/annotations.dart'; +import 'package:mockito/mockito.dart'; -import 'method_channel_mock.dart'; - -const String _channelName = 'plugins.flutter.io/camera_android'; +import 'android_camera_test.mocks.dart'; +@GenerateNiceMocks(>[MockSpec()]) void main() { TestWidgetsFlutterBinding.ensureInitialized(); @@ -44,17 +46,19 @@ void main() { }); group('Creation, Initialization & Disposal Tests', () { + late MockCameraApi mockCameraApi; + setUp(() { + mockCameraApi = MockCameraApi(); + }); + test('Should send creation data and receive back a camera id', () async { // Arrange - final MethodChannelMock cameraMockChannel = MethodChannelMock( - channelName: _channelName, - methods: { - 'create': { - 'cameraId': 1, - 'imageFormatGroup': 'unknown', - } - }); - final AndroidCamera camera = AndroidCamera(); + final AndroidCamera camera = AndroidCamera(hostApi: mockCameraApi); + when(mockCameraApi.create( + 'Test', + argThat(predicate((PlatformMediaSettings settings) => + settings.resolutionPreset == PlatformResolutionPreset.high && + !settings.enableAudio)))).thenAnswer((_) async => 1); // Act final int cameraId = await camera.createCamera( @@ -66,19 +70,6 @@ void main() { ); // Assert - expect(cameraMockChannel.log, [ - isMethodCall( - 'create', - arguments: { - 'cameraName': 'Test', - 'resolutionPreset': 'high', - 'enableAudio': false, - 'fps': null, - 'videoBitrate': null, - 'audioBitrate': null, - }, - ), - ]); expect(cameraId, 1); }); @@ -86,15 +77,15 @@ void main() { 'Should send creation data and receive back a camera id using createCameraWithSettings', () async { // Arrange - final MethodChannelMock cameraMockChannel = MethodChannelMock( - channelName: _channelName, - methods: { - 'create': { - 'cameraId': 1, - 'imageFormatGroup': 'unknown', - } - }); - final AndroidCamera camera = AndroidCamera(); + final AndroidCamera camera = AndroidCamera(hostApi: mockCameraApi); + when(mockCameraApi.create( + 'Test', + argThat(predicate((PlatformMediaSettings settings) => + settings.resolutionPreset == PlatformResolutionPreset.low && + !settings.enableAudio && + settings.fps == 15 && + settings.videoBitrate == 200000 && + settings.audioBitrate == 32000)))).thenAnswer((_) async => 1); // Act final int cameraId = await camera.createCameraWithSettings( @@ -111,63 +102,19 @@ void main() { ); // Assert - expect(cameraMockChannel.log, [ - isMethodCall( - 'create', - arguments: { - 'cameraName': 'Test', - 'resolutionPreset': 'low', - 'fps': 15, - 'videoBitrate': 200000, - 'audioBitrate': 32000, - 'enableAudio': false - }, - ), - ]); expect(cameraId, 1); }); test('Should throw CameraException when create throws a PlatformException', () { // Arrange - MethodChannelMock(channelName: _channelName, methods: { - 'create': PlatformException( - code: 'TESTING_ERROR_CODE', - message: 'Mock error message used during testing.', - ) - }); - final AndroidCamera camera = AndroidCamera(); - - // Act - expect( - () => camera.createCamera( - const CameraDescription( - name: 'Test', - lensDirection: CameraLensDirection.back, - sensorOrientation: 0, - ), - ResolutionPreset.high, - ), - throwsA( - isA() - .having( - (CameraException e) => e.code, 'code', 'TESTING_ERROR_CODE') - .having((CameraException e) => e.description, 'description', - 'Mock error message used during testing.'), - ), - ); - }); - - test('Should throw CameraException when create throws a PlatformException', - () { - // Arrange - MethodChannelMock(channelName: _channelName, methods: { - 'create': PlatformException( - code: 'TESTING_ERROR_CODE', - message: 'Mock error message used during testing.', - ) - }); - final AndroidCamera camera = AndroidCamera(); + final AndroidCamera camera = AndroidCamera(hostApi: mockCameraApi); + when(mockCameraApi.create( + 'Test', + argThat(predicate((PlatformMediaSettings settings) => + settings.resolutionPreset == PlatformResolutionPreset.high && + !settings.enableAudio)))).thenThrow(CameraException( + 'TESTING_ERROR_CODE', 'Mock error message used during testing.')); // Act expect( @@ -193,16 +140,10 @@ void main() { 'Should throw CameraException when initialize throws a PlatformException', () { // Arrange - MethodChannelMock( - channelName: _channelName, - methods: { - 'initialize': PlatformException( - code: 'TESTING_ERROR_CODE', - message: 'Mock error message used during testing.', - ) - }, - ); - final AndroidCamera camera = AndroidCamera(); + final AndroidCamera camera = AndroidCamera(hostApi: mockCameraApi); + when(mockCameraApi.initialize(PlatformImageFormatGroup.yuv420)) + .thenThrow(CameraException('TESTING_ERROR_CODE', + 'Mock error message used during testing.')); // Act expect( @@ -223,16 +164,13 @@ void main() { test('Should send initialization data', () async { // Arrange - final MethodChannelMock cameraMockChannel = MethodChannelMock( - channelName: _channelName, - methods: { - 'create': { - 'cameraId': 1, - 'imageFormatGroup': 'unknown', - }, - 'initialize': null - }); - final AndroidCamera camera = AndroidCamera(); + final AndroidCamera camera = AndroidCamera(hostApi: mockCameraApi); + when(mockCameraApi.create( + 'Test', + argThat(predicate((PlatformMediaSettings settings) => + settings.resolutionPreset == PlatformResolutionPreset.high && + !settings.enableAudio)))).thenAnswer((_) async => 1); + final int cameraId = await camera.createCamera( const CameraDescription( name: 'Test', @@ -257,29 +195,18 @@ void main() { // Assert expect(cameraId, 1); - expect(cameraMockChannel.log, [ - anything, - isMethodCall( - 'initialize', - arguments: { - 'cameraId': 1, - 'imageFormatGroup': 'unknown', - }, - ), - ]); + verify(mockCameraApi.initialize(PlatformImageFormatGroup.yuv420)) + .called(1); }); test('Should send a disposal call on dispose', () async { // Arrange - final MethodChannelMock cameraMockChannel = MethodChannelMock( - channelName: _channelName, - methods: { - 'create': {'cameraId': 1}, - 'initialize': null, - 'dispose': {'cameraId': 1} - }); - - final AndroidCamera camera = AndroidCamera(); + final AndroidCamera camera = AndroidCamera(hostApi: mockCameraApi); + when(mockCameraApi.create( + 'Test', + argThat(predicate((PlatformMediaSettings settings) => + settings.resolutionPreset == PlatformResolutionPreset.high && + !settings.enableAudio)))).thenAnswer((_) async => 1); final int cameraId = await camera.createCamera( const CameraDescription( name: 'Test', @@ -305,29 +232,17 @@ void main() { // Assert expect(cameraId, 1); - expect(cameraMockChannel.log, [ - anything, - anything, - isMethodCall( - 'dispose', - arguments: {'cameraId': 1}, - ), - ]); + verify(mockCameraApi.dispose()).called(1); }); }); group('Event Tests', () { late AndroidCamera camera; late int cameraId; + late MockCameraApi mockCameraApi; setUp(() async { - MethodChannelMock( - channelName: _channelName, - methods: { - 'create': {'cameraId': 1}, - 'initialize': null - }, - ); - camera = AndroidCamera(); + mockCameraApi = MockCameraApi(); + camera = AndroidCamera(hostApi: mockCameraApi); cameraId = await camera.createCamera( const CameraDescription( name: 'Test', @@ -357,17 +272,22 @@ void main() { StreamQueue(eventStream); // Emit test events + final PlatformSize previewSize = PlatformSize(width: 3840, height: 2160); final CameraInitializedEvent event = CameraInitializedEvent( cameraId, - 3840, - 2160, + previewSize.width, + previewSize.height, ExposureMode.auto, true, FocusMode.auto, true, ); - await camera.handleCameraMethodCall( - MethodCall('initialized', event.toJson()), cameraId); + camera.hostCameraHandlers[cameraId]!.initialized(PlatformCameraState( + previewSize: previewSize, + exposureMode: PlatformExposureMode.auto, + focusMode: PlatformFocusMode.auto, + exposurePointSupported: true, + focusPointSupported: true)); // Assert expect(await streamQueue.next, event); @@ -376,37 +296,6 @@ void main() { await streamQueue.cancel(); }); - test('Should receive resolution changes', () async { - // Act - final Stream resolutionStream = - camera.onCameraResolutionChanged(cameraId); - final StreamQueue streamQueue = - StreamQueue(resolutionStream); - - // Emit test events - final CameraResolutionChangedEvent fhdEvent = - CameraResolutionChangedEvent(cameraId, 1920, 1080); - final CameraResolutionChangedEvent uhdEvent = - CameraResolutionChangedEvent(cameraId, 3840, 2160); - await camera.handleCameraMethodCall( - MethodCall('resolution_changed', fhdEvent.toJson()), cameraId); - await camera.handleCameraMethodCall( - MethodCall('resolution_changed', uhdEvent.toJson()), cameraId); - await camera.handleCameraMethodCall( - MethodCall('resolution_changed', fhdEvent.toJson()), cameraId); - await camera.handleCameraMethodCall( - MethodCall('resolution_changed', uhdEvent.toJson()), cameraId); - - // Assert - expect(await streamQueue.next, fhdEvent); - expect(await streamQueue.next, uhdEvent); - expect(await streamQueue.next, fhdEvent); - expect(await streamQueue.next, uhdEvent); - - // Clean up - await streamQueue.cancel(); - }); - test('Should receive camera closing events', () async { // Act final Stream eventStream = @@ -416,12 +305,9 @@ void main() { // Emit test events final CameraClosingEvent event = CameraClosingEvent(cameraId); - await camera.handleCameraMethodCall( - MethodCall('camera_closing', event.toJson()), cameraId); - await camera.handleCameraMethodCall( - MethodCall('camera_closing', event.toJson()), cameraId); - await camera.handleCameraMethodCall( - MethodCall('camera_closing', event.toJson()), cameraId); + for (int i = 0; i < 3; i++) { + camera.hostCameraHandlers[cameraId]!.closed(); + } // Assert expect(await streamQueue.next, event); @@ -442,12 +328,9 @@ void main() { // Emit test events final CameraErrorEvent event = CameraErrorEvent(cameraId, 'Error Description'); - await camera.handleCameraMethodCall( - MethodCall('error', event.toJson()), cameraId); - await camera.handleCameraMethodCall( - MethodCall('error', event.toJson()), cameraId); - await camera.handleCameraMethodCall( - MethodCall('error', event.toJson()), cameraId); + for (int i = 0; i < 3; i++) { + camera.hostCameraHandlers[cameraId]!.error('Error Description'); + } // Assert expect(await streamQueue.next, event); @@ -469,12 +352,8 @@ void main() { const DeviceOrientationChangedEvent event = DeviceOrientationChangedEvent(DeviceOrientation.portraitUp); for (int i = 0; i < 3; i++) { - await TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger - .handlePlatformMessage( - AndroidCamera.deviceEventChannelName, - const StandardMethodCodec().encodeMethodCall( - MethodCall('orientation_changed', event.toJson())), - null); + camera.hostHandler + .deviceOrientationChanged(PlatformDeviceOrientation.portraitUp); } // Assert @@ -490,16 +369,11 @@ void main() { group('Function Tests', () { late AndroidCamera camera; late int cameraId; + late MockCameraApi mockCameraApi; setUp(() async { - MethodChannelMock( - channelName: _channelName, - methods: { - 'create': {'cameraId': 1}, - 'initialize': null - }, - ); - camera = AndroidCamera(); + mockCameraApi = MockCameraApi(); + camera = AndroidCamera(hostApi: mockCameraApi); cameraId = await camera.createCamera( const CameraDescription( name: 'Test', @@ -526,40 +400,33 @@ void main() { test('Should fetch CameraDescription instances for available cameras', () async { // Arrange - final List returnData = [ - { - 'name': 'Test 1', - 'lensFacing': 'front', - 'sensorOrientation': 1 - }, - { - 'name': 'Test 2', - 'lensFacing': 'back', - 'sensorOrientation': 2 - } + final List returnData = + [ + PlatformCameraDescription( + name: 'Test 1', + lensDirection: PlatformCameraLensDirection.front, + sensorOrientation: 1), + PlatformCameraDescription( + name: 'Test 2', + lensDirection: PlatformCameraLensDirection.back, + sensorOrientation: 2), ]; - final MethodChannelMock channel = MethodChannelMock( - channelName: _channelName, - methods: {'availableCameras': returnData}, - ); + when(mockCameraApi.getAvailableCameras()) + .thenAnswer((_) async => returnData); // Act final List cameras = await camera.availableCameras(); // Assert - expect(channel.log, [ - isMethodCall('availableCameras', arguments: null), - ]); expect(cameras.length, returnData.length); for (int i = 0; i < returnData.length; i++) { - final Map typedData = - (returnData[i] as Map).cast(); + final PlatformCameraDescription platformCameraDescription = + returnData[i]; final CameraDescription cameraDescription = CameraDescription( - name: typedData['name']! as String, - lensDirection: - parseCameraLensDirection(typedData['lensFacing']! as String), - sensorOrientation: typedData['sensorOrientation']! as int, - ); + name: platformCameraDescription.name, + lensDirection: cameraLensDirectionFromPlatform( + platformCameraDescription.lensDirection), + sensorOrientation: platformCameraDescription.sensorOrientation); expect(cameras[i], cameraDescription); } }); @@ -568,12 +435,9 @@ void main() { 'Should throw CameraException when availableCameras throws a PlatformException', () { // Arrange - MethodChannelMock(channelName: _channelName, methods: { - 'availableCameras': PlatformException( + when(mockCameraApi.getAvailableCameras()).thenThrow(PlatformException( code: 'TESTING_ERROR_CODE', - message: 'Mock error message used during testing.', - ) - }); + message: 'Mock error message used during testing.')); // Act expect( @@ -590,66 +454,29 @@ void main() { test('Should take a picture and return an XFile instance', () async { // Arrange - final MethodChannelMock channel = MethodChannelMock( - channelName: _channelName, - methods: {'takePicture': '/test/path.jpg'}); + when(mockCameraApi.takePicture()) + .thenAnswer((_) async => '/test/path.jpg'); // Act final XFile file = await camera.takePicture(cameraId); // Assert - expect(channel.log, [ - isMethodCall('takePicture', arguments: { - 'cameraId': cameraId, - }), - ]); expect(file.path, '/test/path.jpg'); }); - test('Should prepare for video recording', () async { - // Arrange - final MethodChannelMock channel = MethodChannelMock( - channelName: _channelName, - methods: {'prepareForVideoRecording': null}, - ); - - // Act - await camera.prepareForVideoRecording(); - - // Assert - expect(channel.log, [ - isMethodCall('prepareForVideoRecording', arguments: null), - ]); - }); - test('Should start recording a video', () async { // Arrange - final MethodChannelMock channel = MethodChannelMock( - channelName: _channelName, - methods: {'startVideoRecording': null}, - ); - // Act await camera.startVideoRecording(cameraId); // Assert - expect(channel.log, [ - isMethodCall('startVideoRecording', arguments: { - 'cameraId': cameraId, - 'enableStream': false, - }), - ]); + verify(mockCameraApi.startVideoRecording(false)).called(1); }); test( 'Should pass enableStream if callback is passed when starting recording a video', () async { // Arrange - final MethodChannelMock channel = MethodChannelMock( - channelName: _channelName, - methods: {'startVideoRecording': null}, - ); - // Act await camera.startVideoCapturing( VideoCaptureOptions(cameraId, @@ -657,75 +484,41 @@ void main() { ); // Assert - expect(channel.log, [ - isMethodCall('startVideoRecording', arguments: { - 'cameraId': cameraId, - 'enableStream': true, - }), - ]); + verify(mockCameraApi.startVideoRecording(true)).called(1); }); test('Should stop a video recording and return the file', () async { // Arrange - final MethodChannelMock channel = MethodChannelMock( - channelName: _channelName, - methods: {'stopVideoRecording': '/test/path.mp4'}, - ); + when(mockCameraApi.stopVideoRecording()) + .thenAnswer((_) async => '/test/path.mp4'); // Act final XFile file = await camera.stopVideoRecording(cameraId); // Assert - expect(channel.log, [ - isMethodCall('stopVideoRecording', arguments: { - 'cameraId': cameraId, - }), - ]); expect(file.path, '/test/path.mp4'); }); test('Should pause a video recording', () async { // Arrange - final MethodChannelMock channel = MethodChannelMock( - channelName: _channelName, - methods: {'pauseVideoRecording': null}, - ); - // Act await camera.pauseVideoRecording(cameraId); // Assert - expect(channel.log, [ - isMethodCall('pauseVideoRecording', arguments: { - 'cameraId': cameraId, - }), - ]); + verify(mockCameraApi.pauseVideoRecording()).called(1); }); test('Should resume a video recording', () async { // Arrange - final MethodChannelMock channel = MethodChannelMock( - channelName: _channelName, - methods: {'resumeVideoRecording': null}, - ); - // Act await camera.resumeVideoRecording(cameraId); // Assert - expect(channel.log, [ - isMethodCall('resumeVideoRecording', arguments: { - 'cameraId': cameraId, - }), - ]); + verify(mockCameraApi.resumeVideoRecording()).called(1); }); test('Should set the description while recording', () async { // Arrange - final MethodChannelMock channel = MethodChannelMock( - channelName: _channelName, - methods: {'setDescriptionWhileRecording': null}, - ); const CameraDescription camera2Description = CameraDescription( name: 'Test2', lensDirection: CameraLensDirection.front, @@ -735,21 +528,13 @@ void main() { await camera.setDescriptionWhileRecording(camera2Description); // Assert - expect(channel.log, [ - isMethodCall('setDescriptionWhileRecording', - arguments: { - 'cameraName': camera2Description.name, - }), - ]); + verify(mockCameraApi + .setDescriptionWhileRecording(camera2Description.name)) + .called(1); }); test('Should set the flash mode', () async { // Arrange - final MethodChannelMock channel = MethodChannelMock( - channelName: _channelName, - methods: {'setFlashMode': null}, - ); - // Act await camera.setFlashMode(cameraId, FlashMode.torch); await camera.setFlashMode(cameraId, FlashMode.always); @@ -757,78 +542,41 @@ void main() { await camera.setFlashMode(cameraId, FlashMode.off); // Assert - expect(channel.log, [ - isMethodCall('setFlashMode', arguments: { - 'cameraId': cameraId, - 'mode': 'torch' - }), - isMethodCall('setFlashMode', arguments: { - 'cameraId': cameraId, - 'mode': 'always' - }), - isMethodCall('setFlashMode', - arguments: {'cameraId': cameraId, 'mode': 'auto'}), - isMethodCall('setFlashMode', - arguments: {'cameraId': cameraId, 'mode': 'off'}), - ]); + verify(mockCameraApi.setFlashMode(PlatformFlashMode.torch)).called(1); + verify(mockCameraApi.setFlashMode(PlatformFlashMode.always)).called(1); + verify(mockCameraApi.setFlashMode(PlatformFlashMode.auto)).called(1); + verify(mockCameraApi.setFlashMode(PlatformFlashMode.off)).called(1); }); test('Should set the exposure mode', () async { // Arrange - final MethodChannelMock channel = MethodChannelMock( - channelName: _channelName, - methods: {'setExposureMode': null}, - ); - // Act await camera.setExposureMode(cameraId, ExposureMode.auto); await camera.setExposureMode(cameraId, ExposureMode.locked); // Assert - expect(channel.log, [ - isMethodCall('setExposureMode', - arguments: {'cameraId': cameraId, 'mode': 'auto'}), - isMethodCall('setExposureMode', arguments: { - 'cameraId': cameraId, - 'mode': 'locked' - }), - ]); + verify(mockCameraApi.setExposureMode(PlatformExposureMode.auto)) + .called(1); + verify(mockCameraApi.setExposureMode(PlatformExposureMode.locked)) + .called(1); }); test('Should set the exposure point', () async { // Arrange - final MethodChannelMock channel = MethodChannelMock( - channelName: _channelName, - methods: {'setExposurePoint': null}, - ); - // Act - await camera.setExposurePoint(cameraId, const Point(0.5, 0.5)); + await camera.setExposurePoint(cameraId, const Point(0.4, 0.5)); await camera.setExposurePoint(cameraId, null); // Assert - expect(channel.log, [ - isMethodCall('setExposurePoint', arguments: { - 'cameraId': cameraId, - 'x': 0.5, - 'y': 0.5, - 'reset': false - }), - isMethodCall('setExposurePoint', arguments: { - 'cameraId': cameraId, - 'x': null, - 'y': null, - 'reset': true - }), - ]); + verify(mockCameraApi.setExposurePoint(argThat(predicate( + (PlatformPoint point) => point.x == 0.4 && point.y == 0.5)))) + .called(1); + verify(mockCameraApi.setExposurePoint(null)).called(1); }); test('Should get the min exposure offset', () async { // Arrange - final MethodChannelMock channel = MethodChannelMock( - channelName: _channelName, - methods: {'getMinExposureOffset': 2.0}, - ); + when(mockCameraApi.getMinExposureOffset()).thenAnswer((_) async => 2.0); // Act final double minExposureOffset = @@ -836,19 +584,11 @@ void main() { // Assert expect(minExposureOffset, 2.0); - expect(channel.log, [ - isMethodCall('getMinExposureOffset', arguments: { - 'cameraId': cameraId, - }), - ]); }); test('Should get the max exposure offset', () async { // Arrange - final MethodChannelMock channel = MethodChannelMock( - channelName: _channelName, - methods: {'getMaxExposureOffset': 2.0}, - ); + when(mockCameraApi.getMaxExposureOffset()).thenAnswer((_) async => 2.0); // Act final double maxExposureOffset = @@ -856,100 +596,40 @@ void main() { // Assert expect(maxExposureOffset, 2.0); - expect(channel.log, [ - isMethodCall('getMaxExposureOffset', arguments: { - 'cameraId': cameraId, - }), - ]); }); test('Should get the exposure offset step size', () async { // Arrange - final MethodChannelMock channel = MethodChannelMock( - channelName: _channelName, - methods: {'getExposureOffsetStepSize': 0.25}, - ); + when(mockCameraApi.getExposureOffsetStepSize()) + .thenAnswer((_) async => 0.25); // Act final double stepSize = await camera.getExposureOffsetStepSize(cameraId); // Assert expect(stepSize, 0.25); - expect(channel.log, [ - isMethodCall('getExposureOffsetStepSize', arguments: { - 'cameraId': cameraId, - }), - ]); }); test('Should set the exposure offset', () async { // Arrange - final MethodChannelMock channel = MethodChannelMock( - channelName: _channelName, - methods: {'setExposureOffset': 0.6}, - ); + when(mockCameraApi.setExposureOffset(0.5)).thenAnswer((_) async => 0.6); // Act final double actualOffset = await camera.setExposureOffset(cameraId, 0.5); // Assert expect(actualOffset, 0.6); - expect(channel.log, [ - isMethodCall('setExposureOffset', arguments: { - 'cameraId': cameraId, - 'offset': 0.5, - }), - ]); }); test('Should set the focus mode', () async { // Arrange - final MethodChannelMock channel = MethodChannelMock( - channelName: _channelName, - methods: {'setFocusMode': null}, - ); - // Act await camera.setFocusMode(cameraId, FocusMode.auto); await camera.setFocusMode(cameraId, FocusMode.locked); // Assert - expect(channel.log, [ - isMethodCall('setFocusMode', - arguments: {'cameraId': cameraId, 'mode': 'auto'}), - isMethodCall('setFocusMode', arguments: { - 'cameraId': cameraId, - 'mode': 'locked' - }), - ]); - }); - - test('Should set the exposure point', () async { - // Arrange - final MethodChannelMock channel = MethodChannelMock( - channelName: _channelName, - methods: {'setFocusPoint': null}, - ); - - // Act - await camera.setFocusPoint(cameraId, const Point(0.5, 0.5)); - await camera.setFocusPoint(cameraId, null); - - // Assert - expect(channel.log, [ - isMethodCall('setFocusPoint', arguments: { - 'cameraId': cameraId, - 'x': 0.5, - 'y': 0.5, - 'reset': false - }), - isMethodCall('setFocusPoint', arguments: { - 'cameraId': cameraId, - 'x': null, - 'y': null, - 'reset': true - }), - ]); + verify(mockCameraApi.setFocusMode(PlatformFocusMode.auto)).called(1); + verify(mockCameraApi.setFocusMode(PlatformFocusMode.locked)).called(1); }); test('Should build a texture widget as preview widget', () async { @@ -961,83 +641,42 @@ void main() { expect((widget as Texture).textureId, cameraId); }); - test('Should throw MissingPluginException when handling unknown method', - () { - final AndroidCamera camera = AndroidCamera(); - - expect( - () => camera.handleCameraMethodCall( - const MethodCall('unknown_method'), 1), - throwsA(isA())); - }); - test('Should get the max zoom level', () async { // Arrange - final MethodChannelMock channel = MethodChannelMock( - channelName: _channelName, - methods: {'getMaxZoomLevel': 10.0}, - ); + when(mockCameraApi.getMaxZoomLevel()).thenAnswer((_) async => 10.0); // Act final double maxZoomLevel = await camera.getMaxZoomLevel(cameraId); // Assert expect(maxZoomLevel, 10.0); - expect(channel.log, [ - isMethodCall('getMaxZoomLevel', arguments: { - 'cameraId': cameraId, - }), - ]); }); test('Should get the min zoom level', () async { // Arrange - final MethodChannelMock channel = MethodChannelMock( - channelName: _channelName, - methods: {'getMinZoomLevel': 1.0}, - ); + when(mockCameraApi.getMinZoomLevel()).thenAnswer((_) async => 1.0); // Act final double maxZoomLevel = await camera.getMinZoomLevel(cameraId); // Assert expect(maxZoomLevel, 1.0); - expect(channel.log, [ - isMethodCall('getMinZoomLevel', arguments: { - 'cameraId': cameraId, - }), - ]); }); test('Should set the zoom level', () async { // Arrange - final MethodChannelMock channel = MethodChannelMock( - channelName: _channelName, - methods: {'setZoomLevel': null}, - ); - // Act await camera.setZoomLevel(cameraId, 2.0); // Assert - expect(channel.log, [ - isMethodCall('setZoomLevel', - arguments: {'cameraId': cameraId, 'zoom': 2.0}), - ]); + verify(mockCameraApi.setZoomLevel(2.0)).called(1); }); test('Should throw CameraException when illegal zoom level is supplied', () async { // Arrange - MethodChannelMock( - channelName: _channelName, - methods: { - 'setZoomLevel': PlatformException( - code: 'ZOOM_ERROR', - message: 'Illegal zoom error', - ) - }, - ); + when(mockCameraApi.setZoomLevel(-1.0)).thenThrow( + PlatformException(code: 'ZOOM_ERROR', message: 'Illegal zoom error')); // Act & assert expect( @@ -1050,108 +689,58 @@ void main() { test('Should lock the capture orientation', () async { // Arrange - final MethodChannelMock channel = MethodChannelMock( - channelName: _channelName, - methods: {'lockCaptureOrientation': null}, - ); - // Act await camera.lockCaptureOrientation( cameraId, DeviceOrientation.portraitUp); // Assert - expect(channel.log, [ - isMethodCall('lockCaptureOrientation', arguments: { - 'cameraId': cameraId, - 'orientation': 'portraitUp' - }), - ]); + verify(mockCameraApi + .lockCaptureOrientation(PlatformDeviceOrientation.portraitUp)) + .called(1); }); test('Should unlock the capture orientation', () async { // Arrange - final MethodChannelMock channel = MethodChannelMock( - channelName: _channelName, - methods: {'unlockCaptureOrientation': null}, - ); - // Act await camera.unlockCaptureOrientation(cameraId); // Assert - expect(channel.log, [ - isMethodCall('unlockCaptureOrientation', - arguments: {'cameraId': cameraId}), - ]); + verify(mockCameraApi.unlockCaptureOrientation()).called(1); }); test('Should pause the camera preview', () async { // Arrange - final MethodChannelMock channel = MethodChannelMock( - channelName: _channelName, - methods: {'pausePreview': null}, - ); - // Act await camera.pausePreview(cameraId); // Assert - expect(channel.log, [ - isMethodCall('pausePreview', - arguments: {'cameraId': cameraId}), - ]); + verify(mockCameraApi.pausePreview()).called(1); }); test('Should resume the camera preview', () async { // Arrange - final MethodChannelMock channel = MethodChannelMock( - channelName: _channelName, - methods: {'resumePreview': null}, - ); - // Act await camera.resumePreview(cameraId); // Assert - expect(channel.log, [ - isMethodCall('resumePreview', - arguments: {'cameraId': cameraId}), - ]); + verify(mockCameraApi.resumePreview()).called(1); }); test('Should start streaming', () async { // Arrange - final MethodChannelMock channel = MethodChannelMock( - channelName: _channelName, - methods: { - 'startImageStream': null, - 'stopImageStream': null, - }, - ); - // Act final StreamSubscription subscription = camera .onStreamedFrameAvailable(cameraId) .listen((CameraImageData imageData) {}); // Assert - expect(channel.log, [ - isMethodCall('startImageStream', arguments: null), - ]); + verify(mockCameraApi.startImageStream()).called(1); await subscription.cancel(); }); test('Should stop streaming', () async { // Arrange - final MethodChannelMock channel = MethodChannelMock( - channelName: _channelName, - methods: { - 'startImageStream': null, - 'stopImageStream': null, - }, - ); - // Act final StreamSubscription subscription = camera .onStreamedFrameAvailable(cameraId) @@ -1159,10 +748,8 @@ void main() { await subscription.cancel(); // Assert - expect(channel.log, [ - isMethodCall('startImageStream', arguments: null), - isMethodCall('stopImageStream', arguments: null), - ]); + verify(mockCameraApi.startImageStream()).called(1); + verify(mockCameraApi.stopImageStream()).called(1); }); }); } diff --git a/packages/camera/camera_android/test/android_camera_test.mocks.dart b/packages/camera/camera_android/test/android_camera_test.mocks.dart new file mode 100644 index 000000000000..6be1c98ad573 --- /dev/null +++ b/packages/camera/camera_android/test/android_camera_test.mocks.dart @@ -0,0 +1,368 @@ +// Mocks generated by Mockito 5.4.4 from annotations +// in camera_android/test/android_camera_test.dart. +// Do not manually edit this file. + +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:async' as _i4; + +import 'package:camera_android/src/messages.g.dart' as _i2; +import 'package:mockito/mockito.dart' as _i1; +import 'package:mockito/src/dummies.dart' as _i3; + +// 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 + +/// A class which mocks [CameraApi]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockCameraApi extends _i1.Mock implements _i2.CameraApi { + @override + String get pigeonVar_messageChannelSuffix => (super.noSuchMethod( + Invocation.getter(#pigeonVar_messageChannelSuffix), + returnValue: _i3.dummyValue( + this, + Invocation.getter(#pigeonVar_messageChannelSuffix), + ), + returnValueForMissingStub: _i3.dummyValue( + this, + Invocation.getter(#pigeonVar_messageChannelSuffix), + ), + ) as String); + + @override + _i4.Future> getAvailableCameras() => + (super.noSuchMethod( + Invocation.method( + #getAvailableCameras, + [], + ), + returnValue: _i4.Future>.value( + <_i2.PlatformCameraDescription>[]), + returnValueForMissingStub: + _i4.Future>.value( + <_i2.PlatformCameraDescription>[]), + ) as _i4.Future>); + + @override + _i4.Future create( + String? cameraName, + _i2.PlatformMediaSettings? mediaSettings, + ) => + (super.noSuchMethod( + Invocation.method( + #create, + [ + cameraName, + mediaSettings, + ], + ), + returnValue: _i4.Future.value(0), + returnValueForMissingStub: _i4.Future.value(0), + ) as _i4.Future); + + @override + _i4.Future initialize(_i2.PlatformImageFormatGroup? imageFormat) => + (super.noSuchMethod( + Invocation.method( + #initialize, + [imageFormat], + ), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); + + @override + _i4.Future dispose() => (super.noSuchMethod( + Invocation.method( + #dispose, + [], + ), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); + + @override + _i4.Future lockCaptureOrientation( + _i2.PlatformDeviceOrientation? orientation) => + (super.noSuchMethod( + Invocation.method( + #lockCaptureOrientation, + [orientation], + ), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); + + @override + _i4.Future unlockCaptureOrientation() => (super.noSuchMethod( + Invocation.method( + #unlockCaptureOrientation, + [], + ), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); + + @override + _i4.Future takePicture() => (super.noSuchMethod( + Invocation.method( + #takePicture, + [], + ), + returnValue: _i4.Future.value(_i3.dummyValue( + this, + Invocation.method( + #takePicture, + [], + ), + )), + returnValueForMissingStub: + _i4.Future.value(_i3.dummyValue( + this, + Invocation.method( + #takePicture, + [], + ), + )), + ) as _i4.Future); + + @override + _i4.Future startVideoRecording(bool? enableStream) => + (super.noSuchMethod( + Invocation.method( + #startVideoRecording, + [enableStream], + ), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); + + @override + _i4.Future stopVideoRecording() => (super.noSuchMethod( + Invocation.method( + #stopVideoRecording, + [], + ), + returnValue: _i4.Future.value(_i3.dummyValue( + this, + Invocation.method( + #stopVideoRecording, + [], + ), + )), + returnValueForMissingStub: + _i4.Future.value(_i3.dummyValue( + this, + Invocation.method( + #stopVideoRecording, + [], + ), + )), + ) as _i4.Future); + + @override + _i4.Future pauseVideoRecording() => (super.noSuchMethod( + Invocation.method( + #pauseVideoRecording, + [], + ), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); + + @override + _i4.Future resumeVideoRecording() => (super.noSuchMethod( + Invocation.method( + #resumeVideoRecording, + [], + ), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); + + @override + _i4.Future startImageStream() => (super.noSuchMethod( + Invocation.method( + #startImageStream, + [], + ), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); + + @override + _i4.Future stopImageStream() => (super.noSuchMethod( + Invocation.method( + #stopImageStream, + [], + ), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); + + @override + _i4.Future setFlashMode(_i2.PlatformFlashMode? flashMode) => + (super.noSuchMethod( + Invocation.method( + #setFlashMode, + [flashMode], + ), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); + + @override + _i4.Future setExposureMode(_i2.PlatformExposureMode? exposureMode) => + (super.noSuchMethod( + Invocation.method( + #setExposureMode, + [exposureMode], + ), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); + + @override + _i4.Future setExposurePoint(_i2.PlatformPoint? point) => + (super.noSuchMethod( + Invocation.method( + #setExposurePoint, + [point], + ), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); + + @override + _i4.Future getMinExposureOffset() => (super.noSuchMethod( + Invocation.method( + #getMinExposureOffset, + [], + ), + returnValue: _i4.Future.value(0.0), + returnValueForMissingStub: _i4.Future.value(0.0), + ) as _i4.Future); + + @override + _i4.Future getMaxExposureOffset() => (super.noSuchMethod( + Invocation.method( + #getMaxExposureOffset, + [], + ), + returnValue: _i4.Future.value(0.0), + returnValueForMissingStub: _i4.Future.value(0.0), + ) as _i4.Future); + + @override + _i4.Future getExposureOffsetStepSize() => (super.noSuchMethod( + Invocation.method( + #getExposureOffsetStepSize, + [], + ), + returnValue: _i4.Future.value(0.0), + returnValueForMissingStub: _i4.Future.value(0.0), + ) as _i4.Future); + + @override + _i4.Future setExposureOffset(double? offset) => (super.noSuchMethod( + Invocation.method( + #setExposureOffset, + [offset], + ), + returnValue: _i4.Future.value(0.0), + returnValueForMissingStub: _i4.Future.value(0.0), + ) as _i4.Future); + + @override + _i4.Future setFocusMode(_i2.PlatformFocusMode? focusMode) => + (super.noSuchMethod( + Invocation.method( + #setFocusMode, + [focusMode], + ), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); + + @override + _i4.Future setFocusPoint(_i2.PlatformPoint? point) => + (super.noSuchMethod( + Invocation.method( + #setFocusPoint, + [point], + ), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); + + @override + _i4.Future getMaxZoomLevel() => (super.noSuchMethod( + Invocation.method( + #getMaxZoomLevel, + [], + ), + returnValue: _i4.Future.value(0.0), + returnValueForMissingStub: _i4.Future.value(0.0), + ) as _i4.Future); + + @override + _i4.Future getMinZoomLevel() => (super.noSuchMethod( + Invocation.method( + #getMinZoomLevel, + [], + ), + returnValue: _i4.Future.value(0.0), + returnValueForMissingStub: _i4.Future.value(0.0), + ) as _i4.Future); + + @override + _i4.Future setZoomLevel(double? zoom) => (super.noSuchMethod( + Invocation.method( + #setZoomLevel, + [zoom], + ), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); + + @override + _i4.Future pausePreview() => (super.noSuchMethod( + Invocation.method( + #pausePreview, + [], + ), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); + + @override + _i4.Future resumePreview() => (super.noSuchMethod( + Invocation.method( + #resumePreview, + [], + ), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); + + @override + _i4.Future setDescriptionWhileRecording(String? description) => + (super.noSuchMethod( + Invocation.method( + #setDescriptionWhileRecording, + [description], + ), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); +} diff --git a/packages/camera/camera_android/test/utils_test.dart b/packages/camera/camera_android/test/utils_test.dart index 6f426bc90f6f..ebcac58d2c69 100644 --- a/packages/camera/camera_android/test/utils_test.dart +++ b/packages/camera/camera_android/test/utils_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 'package:camera_android/src/messages.g.dart'; import 'package:camera_android/src/utils.dart'; import 'package:camera_platform_interface/camera_platform_interface.dart'; import 'package:flutter/services.dart'; @@ -13,48 +14,46 @@ void main() { 'Should return CameraLensDirection when valid value is supplied when parsing camera lens direction', () { expect( - parseCameraLensDirection('back'), + cameraLensDirectionFromPlatform(PlatformCameraLensDirection.back), CameraLensDirection.back, ); expect( - parseCameraLensDirection('front'), + cameraLensDirectionFromPlatform(PlatformCameraLensDirection.front), CameraLensDirection.front, ); expect( - parseCameraLensDirection('external'), + cameraLensDirectionFromPlatform(PlatformCameraLensDirection.external), CameraLensDirection.external, ); }); - test( - 'Should throw ArgumentException when invalid value is supplied when parsing camera lens direction', - () { + test('deviceOrientationFromPlatform() should convert correctly', () { expect( - () => parseCameraLensDirection('test'), - throwsA(isArgumentError), - ); - }); - - test('serializeDeviceOrientation() should serialize correctly', () { - expect(serializeDeviceOrientation(DeviceOrientation.portraitUp), - 'portraitUp'); - expect(serializeDeviceOrientation(DeviceOrientation.portraitDown), - 'portraitDown'); - expect(serializeDeviceOrientation(DeviceOrientation.landscapeRight), - 'landscapeRight'); - expect(serializeDeviceOrientation(DeviceOrientation.landscapeLeft), - 'landscapeLeft'); - }); - - test('deserializeDeviceOrientation() should deserialize correctly', () { - expect(deserializeDeviceOrientation('portraitUp'), + deviceOrientationFromPlatform(PlatformDeviceOrientation.portraitUp), DeviceOrientation.portraitUp); - expect(deserializeDeviceOrientation('portraitDown'), + expect( + deviceOrientationFromPlatform(PlatformDeviceOrientation.portraitDown), DeviceOrientation.portraitDown); - expect(deserializeDeviceOrientation('landscapeRight'), + expect( + deviceOrientationFromPlatform( + PlatformDeviceOrientation.landscapeRight), DeviceOrientation.landscapeRight); - expect(deserializeDeviceOrientation('landscapeLeft'), + expect( + deviceOrientationFromPlatform( + PlatformDeviceOrientation.landscapeLeft), DeviceOrientation.landscapeLeft); }); + + test('exposureModeFromPlatform() should convert correctly', () { + expect(exposureModeFromPlatform(PlatformExposureMode.auto), + ExposureMode.auto); + expect(exposureModeFromPlatform(PlatformExposureMode.locked), + ExposureMode.locked); + }); + + test('focusModeFromPlatform() should convert correctly', () { + expect(focusModeFromPlatform(PlatformFocusMode.auto), FocusMode.auto); + expect(focusModeFromPlatform(PlatformFocusMode.locked), FocusMode.locked); + }); }); } diff --git a/packages/camera/camera_android_camerax/CHANGELOG.md b/packages/camera/camera_android_camerax/CHANGELOG.md index a80233b37544..18218256feea 100644 --- a/packages/camera/camera_android_camerax/CHANGELOG.md +++ b/packages/camera/camera_android_camerax/CHANGELOG.md @@ -1,3 +1,40 @@ +## 0.6.10 + +* Removes logic that explicitly removes `READ_EXTERNAL_STORAGE` permission that may be implied + from `WRITE_EXTERNAL_STORAGE` and updates the README to tell users how to manually + remove it from their app's merged manifest if they wish. + +## 0.6.9+2 + +* Updates Java compatibility version to 11. + +## 0.6.9+1 + +* Bumps `com.google.guava:guava` from `33.3.0` to `33.3.1`. + +## 0.6.9 + +* Corrects assumption about automatic preview correction happening on API >= 29 to API > 29, + based on the fact that the `ImageReader` Impeller backend is not used for the most part on + devices running API 29+. + +## 0.6.8+3 + +* Removes dependency on org.jetbrains.kotlin:kotlin-bom. +* Updates minimum supported SDK version to Flutter 3.24/Dart 3.5. + +## 0.6.8+2 + +* Marks uses of `Camera2Interop` with `@OptIn` annotation. + +## 0.6.8+1 + +* Re-lands support for Impeller. + +## 0.6.8 + +* Updates Guava version to 33.3.0. + ## 0.6.7+2 * Updates lint checks to ignore NewerVersionAvailable. diff --git a/packages/camera/camera_android_camerax/README.md b/packages/camera/camera_android_camerax/README.md index bc929109cadb..d6eb0cc36c08 100644 --- a/packages/camera/camera_android_camerax/README.md +++ b/packages/camera/camera_android_camerax/README.md @@ -4,7 +4,7 @@ The Android implementation of [`camera`][1] built with the [CameraX library][2]. *Note*: If any of [the limitations](#limitations) prevent you from using using `camera_android_camerax` or if you run into any problems, please report -report these issues under [`flutter/flutter`][5] with `[camerax]` in the title. +these issues under [`flutter/flutter`][5] with `[camerax]` in the title. You may also opt back into the [`camera_android`][9] implementation if you need. ## Usage @@ -57,8 +57,21 @@ and thus that parameter will silently be ignored. In order to save captured images and videos to files on Android 10 and below, CameraX requires specifying the `WRITE_EXTERNAL_STORAGE` permission (see [the CameraX documentation][10]). -This is already done in the plugin, so no further action is required on your end. To understand -the implications of specificying this permission, see [the `WRITE_EXTERNAL_STORAGE` documentation][11]. +This is already done in the plugin, so no further action is required on your end. + +To understand the privacy impact of specifying the `WRITE_EXTERNAL_STORAGE` permission, see the +[`WRITE_EXTERNAL_STORAGE` documentation][11]. We have seen apps also have the [`READ_EXTERNAL_STORAGE`][13] +permission automatically added to the merged Android manifest; it appears to be implied from +`WRITE_EXTERNAL_STORAGE`. If you do not want the `READ_EXTERNAL_STORAGE` permission to be included +in the merged Android manifest of your app, then take the following steps to remove it: + +1. Ensure that your app nor any of the plugins that it depends on require the `READ_EXTERNAL_STORAGE` permission. +2. Add the following to your app's `your_app/android/app/src/main/AndroidManifest.xml`: + +```xml + +``` ### Allowing image streaming in the background @@ -91,4 +104,5 @@ For more information on contributing to this plugin, see [`CONTRIBUTING.md`](CON [10]: https://developer.android.com/media/camera/camerax/architecture#permissions [11]: https://developer.android.com/reference/android/Manifest.permission#WRITE_EXTERNAL_STORAGE [12]: https://developer.android.com/reference/android/Manifest.permission#FOREGROUND_SERVICE_CAMERA +[13]: https://developer.android.com/reference/android/Manifest.permission#READ_EXTERNAL_STORAGE [148013]: https://github.com/flutter/flutter/issues/148013 diff --git a/packages/camera/camera_android_camerax/android/build.gradle b/packages/camera/camera_android_camerax/android/build.gradle index 3624e0617ed2..55a89f610715 100644 --- a/packages/camera/camera_android_camerax/android/build.gradle +++ b/packages/camera/camera_android_camerax/android/build.gradle @@ -22,16 +22,13 @@ rootProject.allprojects { apply plugin: 'com.android.library' android { - // Conditional for compatibility with AGP <4.2. - if (project.android.hasProperty("namespace")) { - namespace 'io.flutter.plugins.camerax' - } + namespace 'io.flutter.plugins.camerax' // CameraX dependencies require compilation against version 33 or later. compileSdk 34 compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_11 + targetCompatibility JavaVersion.VERSION_11 } defaultConfig { @@ -66,13 +63,9 @@ dependencies { implementation "androidx.camera:camera-camera2:${camerax_version}" implementation "androidx.camera:camera-lifecycle:${camerax_version}" implementation "androidx.camera:camera-video:${camerax_version}" - implementation 'com.google.guava:guava:33.2.1-android' + implementation 'com.google.guava:guava:33.3.1-android' testImplementation 'junit:junit:4.13.2' testImplementation 'org.mockito:mockito-inline:5.0.0' testImplementation 'androidx.test:core:1.4.0' testImplementation 'org.robolectric:robolectric:4.10.3' - - // org.jetbrains.kotlin:kotlin-bom artifact purpose is to align kotlin stdlib and related code versions. - // See: https://youtrack.jetbrains.com/issue/KT-55297/kotlin-stdlib-should-declare-constraints-on-kotlin-stdlib-jdk8-and-kotlin-stdlib-jdk7 - implementation(platform("org.jetbrains.kotlin:kotlin-bom:1.8.10")) } diff --git a/packages/camera/camera_android_camerax/android/src/main/AndroidManifest.xml b/packages/camera/camera_android_camerax/android/src/main/AndroidManifest.xml index e1629a607c3a..52012aaa6915 100644 --- a/packages/camera/camera_android_camerax/android/src/main/AndroidManifest.xml +++ b/packages/camera/camera_android_camerax/android/src/main/AndroidManifest.xml @@ -1,11 +1,8 @@ - diff --git a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/Camera2CameraControlHostApiImpl.java b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/Camera2CameraControlHostApiImpl.java index 8d10005f7d75..300310d6c9d4 100644 --- a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/Camera2CameraControlHostApiImpl.java +++ b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/Camera2CameraControlHostApiImpl.java @@ -10,6 +10,7 @@ import androidx.annotation.VisibleForTesting; import androidx.camera.camera2.interop.Camera2CameraControl; import androidx.camera.camera2.interop.CaptureRequestOptions; +import androidx.camera.camera2.interop.ExperimentalCamera2Interop; import androidx.camera.core.CameraControl; import androidx.core.content.ContextCompat; import com.google.common.util.concurrent.FutureCallback; @@ -134,6 +135,7 @@ public void addCaptureRequestOptions( * Retrieves the {@link Camera2CameraControl} instance associated with the specified {@code * identifier}. */ + @OptIn(markerClass = ExperimentalCamera2Interop.class) private Camera2CameraControl getCamera2CameraControlInstance(@NonNull Long identifier) { return Objects.requireNonNull(instanceManager.getInstance(identifier)); } diff --git a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/Camera2CameraInfoFlutterApiImpl.java b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/Camera2CameraInfoFlutterApiImpl.java index 398fc38049a4..58769ab400fa 100644 --- a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/Camera2CameraInfoFlutterApiImpl.java +++ b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/Camera2CameraInfoFlutterApiImpl.java @@ -6,7 +6,9 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; +import androidx.annotation.OptIn; import androidx.camera.camera2.interop.Camera2CameraInfo; +import androidx.camera.camera2.interop.ExperimentalCamera2Interop; import io.flutter.plugin.common.BinaryMessenger; import io.flutter.plugins.camerax.GeneratedCameraXLibrary.Camera2CameraInfoFlutterApi; @@ -19,6 +21,7 @@ public Camera2CameraInfoFlutterApiImpl( this.instanceManager = instanceManager; } + @OptIn(markerClass = ExperimentalCamera2Interop.class) void create(@NonNull Camera2CameraInfo camera2CameraInfo, @Nullable Reply reply) { if (!instanceManager.containsInstance(camera2CameraInfo)) { create(instanceManager.addHostCreatedInstance(camera2CameraInfo), reply); diff --git a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/Camera2CameraInfoHostApiImpl.java b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/Camera2CameraInfoHostApiImpl.java index 76606b43efc0..983e9e0c674c 100644 --- a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/Camera2CameraInfoHostApiImpl.java +++ b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/Camera2CameraInfoHostApiImpl.java @@ -84,6 +84,7 @@ public Camera2CameraInfoHostApiImpl( this.proxy = proxy; } + @OptIn(markerClass = ExperimentalCamera2Interop.class) @Override @NonNull public Long createFrom(@NonNull Long cameraInfoIdentifier) { @@ -115,6 +116,7 @@ public Long getSensorOrientation(@NonNull Long identifier) { return proxy.getSensorOrientation(getCamera2CameraInfoInstance(identifier)); } + @OptIn(markerClass = ExperimentalCamera2Interop.class) private Camera2CameraInfo getCamera2CameraInfoInstance(@NonNull Long identifier) { return Objects.requireNonNull(instanceManager.getInstance(identifier)); } diff --git a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/CameraXProxy.java b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/CameraXProxy.java index af7fdc36a721..e749940200a6 100644 --- a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/CameraXProxy.java +++ b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/CameraXProxy.java @@ -5,9 +5,7 @@ package io.flutter.plugins.camerax; import android.app.Activity; -import android.graphics.SurfaceTexture; import android.util.Size; -import android.view.Surface; import androidx.annotation.NonNull; import androidx.camera.core.CameraSelector; import androidx.camera.core.ImageAnalysis; @@ -51,11 +49,6 @@ public class CameraXProxy { return new Preview.Builder(); } - /** Creates a {@link Surface} instance from the specified {@link SurfaceTexture}. */ - public @NonNull Surface createSurface(@NonNull SurfaceTexture surfaceTexture) { - return new Surface(surfaceTexture); - } - /** * Creates an instance of the {@link SystemServicesFlutterApiImpl}. * diff --git a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/PreviewHostApiImpl.java b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/PreviewHostApiImpl.java index 7b1ba1214cdb..e9b7b0d89ac6 100644 --- a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/PreviewHostApiImpl.java +++ b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/PreviewHostApiImpl.java @@ -4,7 +4,6 @@ package io.flutter.plugins.camerax; -import android.graphics.SurfaceTexture; import android.util.Size; import android.view.Surface; import androidx.annotation.NonNull; @@ -25,7 +24,7 @@ public class PreviewHostApiImpl implements PreviewHostApi { private final TextureRegistry textureRegistry; @VisibleForTesting public @NonNull CameraXProxy cameraXProxy = new CameraXProxy(); - @VisibleForTesting public @Nullable TextureRegistry.SurfaceTextureEntry flutterSurfaceTexture; + @VisibleForTesting public @Nullable TextureRegistry.SurfaceProducer flutterSurfaceProducer; public PreviewHostApiImpl( @NonNull BinaryMessenger binaryMessenger, @@ -62,12 +61,11 @@ public void create( @Override public @NonNull Long setSurfaceProvider(@NonNull Long identifier) { Preview preview = getPreviewInstance(identifier); - flutterSurfaceTexture = textureRegistry.createSurfaceTexture(); - SurfaceTexture surfaceTexture = flutterSurfaceTexture.surfaceTexture(); - Preview.SurfaceProvider surfaceProvider = createSurfaceProvider(surfaceTexture); + flutterSurfaceProducer = textureRegistry.createSurfaceProducer(); + Preview.SurfaceProvider surfaceProvider = createSurfaceProvider(flutterSurfaceProducer); preview.setSurfaceProvider(surfaceProvider); - return flutterSurfaceTexture.id(); + return flutterSurfaceProducer.id(); } /** @@ -76,13 +74,35 @@ public void create( */ @VisibleForTesting public @NonNull Preview.SurfaceProvider createSurfaceProvider( - @NonNull SurfaceTexture surfaceTexture) { + @NonNull TextureRegistry.SurfaceProducer surfaceProducer) { return new Preview.SurfaceProvider() { @Override public void onSurfaceRequested(@NonNull SurfaceRequest request) { - surfaceTexture.setDefaultBufferSize( + // Set callback for surfaceProducer to invalidate Surfaces that it produces when they + // get destroyed. + surfaceProducer.setCallback( + new TextureRegistry.SurfaceProducer.Callback() { + @Override + // TODO(matanlurey): Replace with onSurfaceAvailable once available on stable; + // https://github.com/flutter/flutter/issues/155131. + @SuppressWarnings({"deprecation", "removal"}) + public void onSurfaceCreated() { + // Do nothing. The Preview.SurfaceProvider will handle this whenever a new + // Surface is needed. + } + + @Override + public void onSurfaceDestroyed() { + // Invalidate the SurfaceRequest so that CameraX knows to to make a new request + // for a surface. + request.invalidate(); + } + }); + + // Provide surface. + surfaceProducer.setSize( request.getResolution().getWidth(), request.getResolution().getHeight()); - Surface flutterSurface = cameraXProxy.createSurface(surfaceTexture); + Surface flutterSurface = surfaceProducer.getSurface(); request.provideSurface( flutterSurface, Executors.newSingleThreadExecutor(), @@ -133,8 +153,8 @@ String getProvideSurfaceErrorDescription(int resultCode) { */ @Override public void releaseFlutterSurfaceTexture() { - if (flutterSurfaceTexture != null) { - flutterSurfaceTexture.release(); + if (flutterSurfaceProducer != null) { + flutterSurfaceProducer.release(); } } diff --git a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/SystemServicesHostApiImpl.java b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/SystemServicesHostApiImpl.java index cd048238ca9c..138e9259e025 100644 --- a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/SystemServicesHostApiImpl.java +++ b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/SystemServicesHostApiImpl.java @@ -106,16 +106,16 @@ public String getTempFilePath(@NonNull String prefix, @NonNull String suffix) { } /** - * Returns whether or not a {@code SurfaceTexture} backs the {@code Surface} provided to CameraX - * to build the camera preview. If it is backed by a {@code Surface}, then the transformation - * needed to correctly rotate the preview has already been applied. + * Returns whether or not Impeller uses an {@code ImageReader} backend to provide a {@code + * Surface} to CameraX to build the preview. If it is backed by an {@code ImageReader}, then + * CameraX will not automatically apply the transformation needed to correct the preview. * - *

This is determined by the engine, who uses {@code SurfaceTexture}s on Android SDKs 29 and - * below. + *

This is determined by the engine, which approximately uses {@code SurfaceTexture}s on + * Android SDKs below 29. */ @Override @NonNull public Boolean isPreviewPreTransformed() { - return Build.VERSION.SDK_INT <= 29; + return Build.VERSION.SDK_INT < 29; } } diff --git a/packages/camera/camera_android_camerax/android/src/test/java/io/flutter/plugins/camerax/PreviewTest.java b/packages/camera/camera_android_camerax/android/src/test/java/io/flutter/plugins/camerax/PreviewTest.java index 81b455d7a867..83ccb1edd9c5 100644 --- a/packages/camera/camera_android_camerax/android/src/test/java/io/flutter/plugins/camerax/PreviewTest.java +++ b/packages/camera/camera_android_camerax/android/src/test/java/io/flutter/plugins/camerax/PreviewTest.java @@ -11,9 +11,9 @@ import static org.mockito.Mockito.reset; import static org.mockito.Mockito.spy; import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.verifyNoMoreInteractions; import static org.mockito.Mockito.when; -import android.graphics.SurfaceTexture; import android.util.Size; import android.view.Surface; import androidx.camera.core.Preview; @@ -83,37 +83,67 @@ public void create_createsPreviewWithCorrectConfiguration() { } @Test - public void setSurfaceProviderTest_createsSurfaceProviderAndReturnsTextureEntryId() { + public void setSurfaceProvider_createsSurfaceProviderAndReturnsTextureEntryId() { final PreviewHostApiImpl previewHostApi = spy(new PreviewHostApiImpl(mockBinaryMessenger, testInstanceManager, mockTextureRegistry)); - final TextureRegistry.SurfaceTextureEntry mockSurfaceTextureEntry = - mock(TextureRegistry.SurfaceTextureEntry.class); - final SurfaceTexture mockSurfaceTexture = mock(SurfaceTexture.class); + final TextureRegistry.SurfaceProducer mockSurfaceProducer = + mock(TextureRegistry.SurfaceProducer.class); final Long previewIdentifier = 5L; - final Long surfaceTextureEntryId = 120L; + final Long surfaceProducerEntryId = 120L; previewHostApi.cameraXProxy = mockCameraXProxy; testInstanceManager.addDartCreatedInstance(mockPreview, previewIdentifier); - when(mockTextureRegistry.createSurfaceTexture()).thenReturn(mockSurfaceTextureEntry); - when(mockSurfaceTextureEntry.surfaceTexture()).thenReturn(mockSurfaceTexture); - when(mockSurfaceTextureEntry.id()).thenReturn(surfaceTextureEntryId); + when(mockTextureRegistry.createSurfaceProducer()).thenReturn(mockSurfaceProducer); + when(mockSurfaceProducer.id()).thenReturn(surfaceProducerEntryId); final ArgumentCaptor surfaceProviderCaptor = ArgumentCaptor.forClass(Preview.SurfaceProvider.class); - final ArgumentCaptor surfaceCaptor = ArgumentCaptor.forClass(Surface.class); // Test that surface provider was set and the surface texture ID was returned. - assertEquals(previewHostApi.setSurfaceProvider(previewIdentifier), surfaceTextureEntryId); + assertEquals(previewHostApi.setSurfaceProvider(previewIdentifier), surfaceProducerEntryId); verify(mockPreview).setSurfaceProvider(surfaceProviderCaptor.capture()); - verify(previewHostApi).createSurfaceProvider(mockSurfaceTexture); + verify(previewHostApi).createSurfaceProvider(mockSurfaceProducer); + } + + @Test + public void createSurfaceProducer_setsExpectedSurfaceProducerCallback() { + final PreviewHostApiImpl previewHostApi = + new PreviewHostApiImpl(mockBinaryMessenger, testInstanceManager, mockTextureRegistry); + final TextureRegistry.SurfaceProducer mockSurfaceProducer = + mock(TextureRegistry.SurfaceProducer.class); + final SurfaceRequest mockSurfaceRequest = mock(SurfaceRequest.class); + final ArgumentCaptor callbackCaptor = + ArgumentCaptor.forClass(TextureRegistry.SurfaceProducer.Callback.class); + + when(mockSurfaceRequest.getResolution()).thenReturn(new Size(5, 6)); + when(mockSurfaceProducer.getSurface()).thenReturn(mock(Surface.class)); + + Preview.SurfaceProvider previewSurfaceProvider = + previewHostApi.createSurfaceProvider(mockSurfaceProducer); + previewSurfaceProvider.onSurfaceRequested(mockSurfaceRequest); + + verify(mockSurfaceProducer).setCallback(callbackCaptor.capture()); + + TextureRegistry.SurfaceProducer.Callback callback = callbackCaptor.getValue(); + + // Verify callback's onSurfaceDestroyed invalidates SurfaceRequest. + callback.onSurfaceDestroyed(); + verify(mockSurfaceRequest).invalidate(); + + reset(mockSurfaceRequest); + + // Verify callback's onSurfaceCreated does not interact with the SurfaceRequest. + simulateSurfaceCreation(callback); + verifyNoMoreInteractions(mockSurfaceRequest); } @Test public void createSurfaceProvider_createsExpectedPreviewSurfaceProvider() { final PreviewHostApiImpl previewHostApi = new PreviewHostApiImpl(mockBinaryMessenger, testInstanceManager, mockTextureRegistry); - final SurfaceTexture mockSurfaceTexture = mock(SurfaceTexture.class); + final TextureRegistry.SurfaceProducer mockSurfaceProducer = + mock(TextureRegistry.SurfaceProducer.class); final Surface mockSurface = mock(Surface.class); final SurfaceRequest mockSurfaceRequest = mock(SurfaceRequest.class); final SurfaceRequest.Result mockSurfaceRequestResult = mock(SurfaceRequest.Result.class); @@ -121,13 +151,14 @@ public void createSurfaceProvider_createsExpectedPreviewSurfaceProvider() { mock(SystemServicesFlutterApiImpl.class); final int resolutionWidth = 200; final int resolutionHeight = 500; + final Long surfaceProducerEntryId = 120L; previewHostApi.cameraXProxy = mockCameraXProxy; - when(mockCameraXProxy.createSurface(mockSurfaceTexture)).thenReturn(mockSurface); when(mockSurfaceRequest.getResolution()) .thenReturn(new Size(resolutionWidth, resolutionHeight)); when(mockCameraXProxy.createSystemServicesFlutterApiImpl(mockBinaryMessenger)) .thenReturn(mockSystemServicesFlutterApi); + when(mockSurfaceProducer.getSurface()).thenReturn(mockSurface); final ArgumentCaptor surfaceCaptor = ArgumentCaptor.forClass(Surface.class); @SuppressWarnings("unchecked") @@ -135,10 +166,10 @@ public void createSurfaceProvider_createsExpectedPreviewSurfaceProvider() { ArgumentCaptor.forClass(Consumer.class); Preview.SurfaceProvider previewSurfaceProvider = - previewHostApi.createSurfaceProvider(mockSurfaceTexture); + previewHostApi.createSurfaceProvider(mockSurfaceProducer); previewSurfaceProvider.onSurfaceRequested(mockSurfaceRequest); - verify(mockSurfaceTexture).setDefaultBufferSize(resolutionWidth, resolutionHeight); + verify(mockSurfaceProducer).setSize(resolutionWidth, resolutionHeight); verify(mockSurfaceRequest) .provideSurface(surfaceCaptor.capture(), any(Executor.class), consumerCaptor.capture()); @@ -189,13 +220,13 @@ public void createSurfaceProvider_createsExpectedPreviewSurfaceProvider() { public void releaseFlutterSurfaceTexture_makesCallToReleaseFlutterSurfaceTexture() { final PreviewHostApiImpl previewHostApi = new PreviewHostApiImpl(mockBinaryMessenger, testInstanceManager, mockTextureRegistry); - final TextureRegistry.SurfaceTextureEntry mockSurfaceTextureEntry = - mock(TextureRegistry.SurfaceTextureEntry.class); + final TextureRegistry.SurfaceProducer mockSurfaceProducer = + mock(TextureRegistry.SurfaceProducer.class); - previewHostApi.flutterSurfaceTexture = mockSurfaceTextureEntry; + previewHostApi.flutterSurfaceProducer = mockSurfaceProducer; previewHostApi.releaseFlutterSurfaceTexture(); - verify(mockSurfaceTextureEntry).release(); + verify(mockSurfaceProducer).release(); } @Test @@ -231,4 +262,12 @@ public void setTargetRotation_makesCallToSetTargetRotation() { verify(mockPreview).setTargetRotation(targetRotation); } + + // TODO(matanlurey): Replace with inline calls to onSurfaceAvailable once + // available on stable; see https://github.com/flutter/flutter/issues/155131. + // This seperate method only exists to scope the suppression. + @SuppressWarnings({"deprecation", "removal"}) + void simulateSurfaceCreation(TextureRegistry.SurfaceProducer.Callback producerLifecycle) { + producerLifecycle.onSurfaceCreated(); + } } diff --git a/packages/camera/camera_android_camerax/android/src/test/java/io/flutter/plugins/camerax/SystemServicesTest.java b/packages/camera/camera_android_camerax/android/src/test/java/io/flutter/plugins/camerax/SystemServicesTest.java index 252d3a0a776e..52d02e67f653 100644 --- a/packages/camera/camera_android_camerax/android/src/test/java/io/flutter/plugins/camerax/SystemServicesTest.java +++ b/packages/camera/camera_android_camerax/android/src/test/java/io/flutter/plugins/camerax/SystemServicesTest.java @@ -146,16 +146,16 @@ public void isPreviewPreTransformed_returnsTrueWhenRunningBelowSdk29() { } @Test - @Config(sdk = 29) - public void isPreviewPreTransformed_returnsTrueWhenRunningSdk29() { + @Config(sdk = 28) + public void isPreviewPreTransformed_returnsTrueWhenRunningSdk28() { final SystemServicesHostApiImpl systemServicesHostApi = new SystemServicesHostApiImpl(mockBinaryMessenger, mockInstanceManager, mockContext); assertTrue(systemServicesHostApi.isPreviewPreTransformed()); } @Test - @Config(sdk = 30) - public void isPreviewPreTransformed_returnsFalseWhenRunningAboveSdk29() { + @Config(sdk = 29) + public void isPreviewPreTransformed_returnsFalseWhenRunningAboveSdk28() { final SystemServicesHostApiImpl systemServicesHostApi = new SystemServicesHostApiImpl(mockBinaryMessenger, mockInstanceManager, mockContext); assertFalse(systemServicesHostApi.isPreviewPreTransformed()); diff --git a/packages/camera/camera_android_camerax/example/android/app/build.gradle b/packages/camera/camera_android_camerax/example/android/app/build.gradle index c9117991074d..9da443c271b3 100644 --- a/packages/camera/camera_android_camerax/example/android/app/build.gradle +++ b/packages/camera/camera_android_camerax/example/android/app/build.gradle @@ -31,8 +31,8 @@ android { ndkVersion flutter.ndkVersion compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_11 + targetCompatibility JavaVersion.VERSION_11 } defaultConfig { diff --git a/packages/camera/camera_android_camerax/example/android/app/src/androidTest/java/io/flutter/plugins/cameraxexample/InstanceManagerTest.java b/packages/camera/camera_android_camerax/example/android/app/src/androidTest/java/io/flutter/plugins/cameraxexample/InstanceManagerTest.java index 5e4454de80d3..fe15629b6d72 100644 --- a/packages/camera/camera_android_camerax/example/android/app/src/androidTest/java/io/flutter/plugins/cameraxexample/InstanceManagerTest.java +++ b/packages/camera/camera_android_camerax/example/android/app/src/androidTest/java/io/flutter/plugins/cameraxexample/InstanceManagerTest.java @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -package io.flutter.plugins.cameraexample; +package io.flutter.plugins.cameraxexample; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; diff --git a/packages/camera/camera_android_camerax/example/android/app/src/main/AndroidManifest.xml b/packages/camera/camera_android_camerax/example/android/app/src/main/AndroidManifest.xml index 2a0066ccab4e..1a0da4432332 100644 --- a/packages/camera/camera_android_camerax/example/android/app/src/main/AndroidManifest.xml +++ b/packages/camera/camera_android_camerax/example/android/app/src/main/AndroidManifest.xml @@ -1,5 +1,4 @@ - + showInSnackBar('Audio access is restricted.'); default: _showCameraException(e); - break; } } diff --git a/packages/camera/camera_android_camerax/example/pubspec.yaml b/packages/camera/camera_android_camerax/example/pubspec.yaml index c47771b1a12a..627360153368 100644 --- a/packages/camera/camera_android_camerax/example/pubspec.yaml +++ b/packages/camera/camera_android_camerax/example/pubspec.yaml @@ -3,8 +3,8 @@ description: Demonstrates how to use the camera_android_camerax plugin. publish_to: 'none' environment: - sdk: ^3.4.0 - flutter: ">=3.22.0" + sdk: ^3.5.0 + flutter: ">=3.24.0" dependencies: camera_android_camerax: @@ -20,7 +20,7 @@ dependencies: video_player: ^2.7.0 dev_dependencies: - espresso: ^0.2.0 + espresso: ^0.4.0 flutter_test: sdk: flutter integration_test: diff --git a/packages/camera/camera_android_camerax/lib/src/camera_state_error.dart b/packages/camera/camera_android_camerax/lib/src/camera_state_error.dart index 2f33d513aa02..fedb85c9e8ad 100644 --- a/packages/camera/camera_android_camerax/lib/src/camera_state_error.dart +++ b/packages/camera/camera_android_camerax/lib/src/camera_state_error.dart @@ -59,7 +59,6 @@ class CameraStateError extends JavaObject { default: description = 'There was an unspecified issue with the current camera state.'; - break; } return '$code : $description'; diff --git a/packages/camera/camera_android_camerax/lib/src/capture_request_options.dart b/packages/camera/camera_android_camerax/lib/src/capture_request_options.dart index 777d4a43370f..8c3de00845ed 100644 --- a/packages/camera/camera_android_camerax/lib/src/capture_request_options.dart +++ b/packages/camera/camera_android_camerax/lib/src/capture_request_options.dart @@ -115,7 +115,7 @@ class _CaptureRequestOptionsHostApiImpl extends CaptureRequestOptionsHostApi { // This ignore statement is safe beause this error will be useful when // a new CaptureRequestKeySupportedType is being added, but the logic in // this method has not yet been updated. - // ignore: no_default_cases + // ignore: no_default_cases, unreachable_switch_default default: throw ArgumentError(CaptureRequestOptions .getUnsupportedCaptureRequestKeyTypeErrorMessage(key)); diff --git a/packages/camera/camera_android_camerax/lib/src/live_data.dart b/packages/camera/camera_android_camerax/lib/src/live_data.dart index 9659a2068eee..1931e8169ca1 100644 --- a/packages/camera/camera_android_camerax/lib/src/live_data.dart +++ b/packages/camera/camera_android_camerax/lib/src/live_data.dart @@ -185,7 +185,7 @@ class LiveDataFlutterApiImpl implements LiveDataFlutterApi { // This ignore statement is safe beause this error will be useful when // a new LiveDataSupportedType is being added, but the logic in this method // has not yet been updated. - // ignore: no_default_cases + // ignore: no_default_cases, unreachable_switch_default default: throw ArgumentError(LiveData.unsupportedLiveDataTypeErrorMessage); } diff --git a/packages/camera/camera_android_camerax/lib/src/system_services.dart b/packages/camera/camera_android_camerax/lib/src/system_services.dart index a55981213266..5f59bd2f4c60 100644 --- a/packages/camera/camera_android_camerax/lib/src/system_services.dart +++ b/packages/camera/camera_android_camerax/lib/src/system_services.dart @@ -59,10 +59,9 @@ class SystemServices { /// be corrected by the plugin. static Future isPreviewPreTransformed( {BinaryMessenger? binaryMessenger}) { - // TODO(camsim99): Make call to Java host to determine true value when - // Impeller support is re-landed. - // https://github.com/flutter/flutter/issues/149294 - return Future.value(true); + final SystemServicesHostApi api = + SystemServicesHostApi(binaryMessenger: binaryMessenger); + return api.isPreviewPreTransformed(); } } diff --git a/packages/camera/camera_android_camerax/pubspec.yaml b/packages/camera/camera_android_camerax/pubspec.yaml index f3e2175f029a..51d18c6aaa07 100644 --- a/packages/camera/camera_android_camerax/pubspec.yaml +++ b/packages/camera/camera_android_camerax/pubspec.yaml @@ -2,11 +2,11 @@ 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.6.7+2 +version: 0.6.10 environment: - sdk: ^3.4.0 - flutter: ">=3.22.0" + sdk: ^3.5.0 + flutter: ">=3.24.0" flutter: plugin: @@ -31,7 +31,7 @@ dev_dependencies: sdk: flutter integration_test: sdk: flutter - mockito: 5.4.4 + mockito: ^5.4.4 pigeon: ^9.1.0 topics: diff --git a/packages/camera/camera_android_camerax/test/capture_request_options_test.dart b/packages/camera/camera_android_camerax/test/capture_request_options_test.dart index 3649369c934b..5649151af92b 100644 --- a/packages/camera/camera_android_camerax/test/capture_request_options_test.dart +++ b/packages/camera/camera_android_camerax/test/capture_request_options_test.dart @@ -132,7 +132,7 @@ void main() { // This ignore statement is safe beause this will test when // a new CaptureRequestKeySupportedType is being added, but the logic in // in the CaptureRequestOptions class has not yet been updated. - // ignore: no_default_cases + // ignore: no_default_cases, unreachable_switch_default default: fail( 'Option $option contains unrecognized CaptureRequestKeySupportedType key ${option.$1}'); diff --git a/packages/camera/camera_android_camerax/test/system_services_test.dart b/packages/camera/camera_android_camerax/test/system_services_test.dart index 1d5d00ee7169..d1725515e2f8 100644 --- a/packages/camera/camera_android_camerax/test/system_services_test.dart +++ b/packages/camera/camera_android_camerax/test/system_services_test.dart @@ -87,6 +87,14 @@ void main() { }); test('isPreviewPreTransformed returns expected answer', () async { + final MockTestSystemServicesHostApi mockApi = + MockTestSystemServicesHostApi(); + TestSystemServicesHostApi.setup(mockApi); + const bool isPreviewPreTransformed = true; + + when(mockApi.isPreviewPreTransformed()).thenReturn(isPreviewPreTransformed); + expect(await SystemServices.isPreviewPreTransformed(), isTrue); + verify(mockApi.isPreviewPreTransformed()); }); } diff --git a/packages/camera/camera_avfoundation/CHANGELOG.md b/packages/camera/camera_avfoundation/CHANGELOG.md index b21271da150e..28882e058282 100644 --- a/packages/camera/camera_avfoundation/CHANGELOG.md +++ b/packages/camera/camera_avfoundation/CHANGELOG.md @@ -1,5 +1,6 @@ -## NEXT +## 0.9.17+4 +* Updates Pigeon for non-nullable collection type support. * Updates minimum supported SDK version to Flutter 3.19/Dart 3.3. ## 0.9.17+3 diff --git a/packages/camera/camera_avfoundation/example/lib/main.dart b/packages/camera/camera_avfoundation/example/lib/main.dart index 9b8b9759f320..f0ebf7b7865f 100644 --- a/packages/camera/camera_avfoundation/example/lib/main.dart +++ b/packages/camera/camera_avfoundation/example/lib/main.dart @@ -540,7 +540,7 @@ class _CameraExampleHomeState extends State onPressed: cameraController != null && cameraController.value.isInitialized && cameraController.value.isRecordingVideo - ? (cameraController.value.isRecordingPaused) + ? cameraController.value.isRecordingPaused ? onResumeButtonPressed : onPauseButtonPressed : null, @@ -698,7 +698,6 @@ class _CameraExampleHomeState extends State showInSnackBar('Unknown permission error.'); default: _showCameraException(e); - break; } } diff --git a/packages/camera/camera_avfoundation/ios/camera_avfoundation/Sources/camera_avfoundation/include/camera_avfoundation/messages.g.h b/packages/camera/camera_avfoundation/ios/camera_avfoundation/Sources/camera_avfoundation/include/camera_avfoundation/messages.g.h index 8e3dd431443a..2f1d8646afac 100644 --- a/packages/camera/camera_avfoundation/ios/camera_avfoundation/Sources/camera_avfoundation/include/camera_avfoundation/messages.g.h +++ b/packages/camera/camera_avfoundation/ios/camera_avfoundation/Sources/camera_avfoundation/include/camera_avfoundation/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 (v18.0.0), do not edit directly. +// Autogenerated from Pigeon (v22.4.2), do not edit directly. // See also: https://pub.dev/packages/pigeon #import @@ -182,8 +182,8 @@ typedef NS_ENUM(NSUInteger, FCPPlatformResolutionPreset) { @property(nonatomic, assign) double height; @end -/// The codec used by FCPCameraApi. -NSObject *FCPCameraApiGetCodec(void); +/// The codec used by all APIs. +NSObject *FCPGetMessagesCodec(void); @protocol FCPCameraApi /// Returns the list of available cameras. @@ -284,9 +284,6 @@ extern void SetUpFCPCameraApiWithSuffix(id binaryMesseng NSObject *_Nullable api, NSString *messageChannelSuffix); -/// The codec used by FCPCameraGlobalEventApi. -NSObject *FCPCameraGlobalEventApiGetCodec(void); - /// Handler for native callbacks that are not tied to a specific camera ID. @interface FCPCameraGlobalEventApi : NSObject - (instancetype)initWithBinaryMessenger:(id)binaryMessenger; @@ -297,9 +294,6 @@ NSObject *FCPCameraGlobalEventApiGetCodec(void); completion:(void (^)(FlutterError *_Nullable))completion; @end -/// The codec used by FCPCameraEventApi. -NSObject *FCPCameraEventApiGetCodec(void); - /// Handler for native callbacks that are tied to a specific camera ID. /// /// This is intended to be initialized with the camera ID as a suffix. diff --git a/packages/camera/camera_avfoundation/ios/camera_avfoundation/Sources/camera_avfoundation/messages.g.m b/packages/camera/camera_avfoundation/ios/camera_avfoundation/Sources/camera_avfoundation/messages.g.m index 3b4355f0709d..0164b4d6c6cc 100644 --- a/packages/camera/camera_avfoundation/ios/camera_avfoundation/Sources/camera_avfoundation/messages.g.m +++ b/packages/camera/camera_avfoundation/ios/camera_avfoundation/Sources/camera_avfoundation/messages.g.m @@ -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 (v18.0.0), do not edit directly. +// Autogenerated from Pigeon (v22.4.2), do not edit directly. // See also: https://pub.dev/packages/pigeon #import "./include/camera_avfoundation/messages.g.h" @@ -16,7 +16,7 @@ #error File requires ARC to be enabled. #endif -static NSArray *wrapResult(id result, FlutterError *error) { +static NSArray *wrapResult(id result, FlutterError *error) { if (error) { return @[ error.code ?: [NSNull null], error.message ?: [NSNull null], error.details ?: [NSNull null] @@ -34,7 +34,7 @@ details:@""]; } -static id GetNullableObjectAtIndex(NSArray *array, NSInteger key) { +static id GetNullableObjectAtIndex(NSArray *array, NSInteger key) { id result = array[key]; return (result == [NSNull null]) ? nil : result; } @@ -121,33 +121,33 @@ - (instancetype)initWithValue:(FCPPlatformResolutionPreset)value { @end @interface FCPPlatformCameraDescription () -+ (FCPPlatformCameraDescription *)fromList:(NSArray *)list; -+ (nullable FCPPlatformCameraDescription *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; ++ (FCPPlatformCameraDescription *)fromList:(NSArray *)list; ++ (nullable FCPPlatformCameraDescription *)nullableFromList:(NSArray *)list; +- (NSArray *)toList; @end @interface FCPPlatformCameraState () -+ (FCPPlatformCameraState *)fromList:(NSArray *)list; -+ (nullable FCPPlatformCameraState *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; ++ (FCPPlatformCameraState *)fromList:(NSArray *)list; ++ (nullable FCPPlatformCameraState *)nullableFromList:(NSArray *)list; +- (NSArray *)toList; @end @interface FCPPlatformMediaSettings () -+ (FCPPlatformMediaSettings *)fromList:(NSArray *)list; -+ (nullable FCPPlatformMediaSettings *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; ++ (FCPPlatformMediaSettings *)fromList:(NSArray *)list; ++ (nullable FCPPlatformMediaSettings *)nullableFromList:(NSArray *)list; +- (NSArray *)toList; @end @interface FCPPlatformPoint () -+ (FCPPlatformPoint *)fromList:(NSArray *)list; -+ (nullable FCPPlatformPoint *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; ++ (FCPPlatformPoint *)fromList:(NSArray *)list; ++ (nullable FCPPlatformPoint *)nullableFromList:(NSArray *)list; +- (NSArray *)toList; @end @interface FCPPlatformSize () -+ (FCPPlatformSize *)fromList:(NSArray *)list; -+ (nullable FCPPlatformSize *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; ++ (FCPPlatformSize *)fromList:(NSArray *)list; ++ (nullable FCPPlatformSize *)nullableFromList:(NSArray *)list; +- (NSArray *)toList; @end @implementation FCPPlatformCameraDescription @@ -158,19 +158,21 @@ + (instancetype)makeWithName:(NSString *)name pigeonResult.lensDirection = lensDirection; return pigeonResult; } -+ (FCPPlatformCameraDescription *)fromList:(NSArray *)list { ++ (FCPPlatformCameraDescription *)fromList:(NSArray *)list { FCPPlatformCameraDescription *pigeonResult = [[FCPPlatformCameraDescription alloc] init]; pigeonResult.name = GetNullableObjectAtIndex(list, 0); - pigeonResult.lensDirection = [GetNullableObjectAtIndex(list, 1) integerValue]; + FCPPlatformCameraLensDirectionBox *boxedFCPPlatformCameraLensDirection = + GetNullableObjectAtIndex(list, 1); + pigeonResult.lensDirection = boxedFCPPlatformCameraLensDirection.value; return pigeonResult; } -+ (nullable FCPPlatformCameraDescription *)nullableFromList:(NSArray *)list { ++ (nullable FCPPlatformCameraDescription *)nullableFromList:(NSArray *)list { return (list) ? [FCPPlatformCameraDescription fromList:list] : nil; } -- (NSArray *)toList { +- (NSArray *)toList { return @[ self.name ?: [NSNull null], - @(self.lensDirection), + [[FCPPlatformCameraLensDirectionBox alloc] initWithValue:self.lensDirection], ]; } @end @@ -189,23 +191,25 @@ + (instancetype)makeWithPreviewSize:(FCPPlatformSize *)previewSize pigeonResult.focusPointSupported = focusPointSupported; return pigeonResult; } -+ (FCPPlatformCameraState *)fromList:(NSArray *)list { ++ (FCPPlatformCameraState *)fromList:(NSArray *)list { FCPPlatformCameraState *pigeonResult = [[FCPPlatformCameraState alloc] init]; - pigeonResult.previewSize = [FCPPlatformSize nullableFromList:(GetNullableObjectAtIndex(list, 0))]; - pigeonResult.exposureMode = [GetNullableObjectAtIndex(list, 1) integerValue]; - pigeonResult.focusMode = [GetNullableObjectAtIndex(list, 2) integerValue]; + pigeonResult.previewSize = GetNullableObjectAtIndex(list, 0); + FCPPlatformExposureModeBox *boxedFCPPlatformExposureMode = GetNullableObjectAtIndex(list, 1); + pigeonResult.exposureMode = boxedFCPPlatformExposureMode.value; + FCPPlatformFocusModeBox *boxedFCPPlatformFocusMode = GetNullableObjectAtIndex(list, 2); + pigeonResult.focusMode = boxedFCPPlatformFocusMode.value; pigeonResult.exposurePointSupported = [GetNullableObjectAtIndex(list, 3) boolValue]; pigeonResult.focusPointSupported = [GetNullableObjectAtIndex(list, 4) boolValue]; return pigeonResult; } -+ (nullable FCPPlatformCameraState *)nullableFromList:(NSArray *)list { ++ (nullable FCPPlatformCameraState *)nullableFromList:(NSArray *)list { return (list) ? [FCPPlatformCameraState fromList:list] : nil; } -- (NSArray *)toList { +- (NSArray *)toList { return @[ - (self.previewSize ? [self.previewSize toList] : [NSNull null]), - @(self.exposureMode), - @(self.focusMode), + self.previewSize ?: [NSNull null], + [[FCPPlatformExposureModeBox alloc] initWithValue:self.exposureMode], + [[FCPPlatformFocusModeBox alloc] initWithValue:self.focusMode], @(self.exposurePointSupported), @(self.focusPointSupported), ]; @@ -226,21 +230,23 @@ + (instancetype)makeWithResolutionPreset:(FCPPlatformResolutionPreset)resolution pigeonResult.enableAudio = enableAudio; return pigeonResult; } -+ (FCPPlatformMediaSettings *)fromList:(NSArray *)list { ++ (FCPPlatformMediaSettings *)fromList:(NSArray *)list { FCPPlatformMediaSettings *pigeonResult = [[FCPPlatformMediaSettings alloc] init]; - pigeonResult.resolutionPreset = [GetNullableObjectAtIndex(list, 0) integerValue]; + FCPPlatformResolutionPresetBox *boxedFCPPlatformResolutionPreset = + GetNullableObjectAtIndex(list, 0); + pigeonResult.resolutionPreset = boxedFCPPlatformResolutionPreset.value; pigeonResult.framesPerSecond = GetNullableObjectAtIndex(list, 1); pigeonResult.videoBitrate = GetNullableObjectAtIndex(list, 2); pigeonResult.audioBitrate = GetNullableObjectAtIndex(list, 3); pigeonResult.enableAudio = [GetNullableObjectAtIndex(list, 4) boolValue]; return pigeonResult; } -+ (nullable FCPPlatformMediaSettings *)nullableFromList:(NSArray *)list { ++ (nullable FCPPlatformMediaSettings *)nullableFromList:(NSArray *)list { return (list) ? [FCPPlatformMediaSettings fromList:list] : nil; } -- (NSArray *)toList { +- (NSArray *)toList { return @[ - @(self.resolutionPreset), + [[FCPPlatformResolutionPresetBox alloc] initWithValue:self.resolutionPreset], self.framesPerSecond ?: [NSNull null], self.videoBitrate ?: [NSNull null], self.audioBitrate ?: [NSNull null], @@ -256,16 +262,16 @@ + (instancetype)makeWithX:(double)x y:(double)y { pigeonResult.y = y; return pigeonResult; } -+ (FCPPlatformPoint *)fromList:(NSArray *)list { ++ (FCPPlatformPoint *)fromList:(NSArray *)list { FCPPlatformPoint *pigeonResult = [[FCPPlatformPoint alloc] init]; pigeonResult.x = [GetNullableObjectAtIndex(list, 0) doubleValue]; pigeonResult.y = [GetNullableObjectAtIndex(list, 1) doubleValue]; return pigeonResult; } -+ (nullable FCPPlatformPoint *)nullableFromList:(NSArray *)list { ++ (nullable FCPPlatformPoint *)nullableFromList:(NSArray *)list { return (list) ? [FCPPlatformPoint fromList:list] : nil; } -- (NSArray *)toList { +- (NSArray *)toList { return @[ @(self.x), @(self.y), @@ -280,16 +286,16 @@ + (instancetype)makeWithWidth:(double)width height:(double)height { pigeonResult.height = height; return pigeonResult; } -+ (FCPPlatformSize *)fromList:(NSArray *)list { ++ (FCPPlatformSize *)fromList:(NSArray *)list { FCPPlatformSize *pigeonResult = [[FCPPlatformSize alloc] init]; pigeonResult.width = [GetNullableObjectAtIndex(list, 0) doubleValue]; pigeonResult.height = [GetNullableObjectAtIndex(list, 1) doubleValue]; return pigeonResult; } -+ (nullable FCPPlatformSize *)nullableFromList:(NSArray *)list { ++ (nullable FCPPlatformSize *)nullableFromList:(NSArray *)list { return (list) ? [FCPPlatformSize fromList:list] : nil; } -- (NSArray *)toList { +- (NSArray *)toList { return @[ @(self.width), @(self.height), @@ -297,35 +303,125 @@ - (NSArray *)toList { } @end -@interface FCPCameraApiCodecReader : FlutterStandardReader +@interface FCPMessagesPigeonCodecReader : FlutterStandardReader @end -@implementation FCPCameraApiCodecReader +@implementation FCPMessagesPigeonCodecReader - (nullable id)readValueOfType:(UInt8)type { switch (type) { - case 128: + case 129: { + NSNumber *enumAsNumber = [self readValue]; + return enumAsNumber == nil ? nil + : [[FCPPlatformCameraLensDirectionBox alloc] + initWithValue:[enumAsNumber integerValue]]; + } + case 130: { + NSNumber *enumAsNumber = [self readValue]; + return enumAsNumber == nil ? nil + : [[FCPPlatformDeviceOrientationBox alloc] + initWithValue:[enumAsNumber integerValue]]; + } + case 131: { + NSNumber *enumAsNumber = [self readValue]; + return enumAsNumber == nil + ? nil + : [[FCPPlatformExposureModeBox alloc] initWithValue:[enumAsNumber integerValue]]; + } + case 132: { + NSNumber *enumAsNumber = [self readValue]; + return enumAsNumber == nil + ? nil + : [[FCPPlatformFlashModeBox alloc] initWithValue:[enumAsNumber integerValue]]; + } + case 133: { + NSNumber *enumAsNumber = [self readValue]; + return enumAsNumber == nil + ? nil + : [[FCPPlatformFocusModeBox alloc] initWithValue:[enumAsNumber integerValue]]; + } + case 134: { + NSNumber *enumAsNumber = [self readValue]; + return enumAsNumber == nil ? nil + : [[FCPPlatformImageFileFormatBox alloc] + initWithValue:[enumAsNumber integerValue]]; + } + case 135: { + NSNumber *enumAsNumber = [self readValue]; + return enumAsNumber == nil ? nil + : [[FCPPlatformImageFormatGroupBox alloc] + initWithValue:[enumAsNumber integerValue]]; + } + case 136: { + NSNumber *enumAsNumber = [self readValue]; + return enumAsNumber == nil ? nil + : [[FCPPlatformResolutionPresetBox alloc] + initWithValue:[enumAsNumber integerValue]]; + } + case 137: return [FCPPlatformCameraDescription fromList:[self readValue]]; - case 129: + case 138: + return [FCPPlatformCameraState fromList:[self readValue]]; + case 139: return [FCPPlatformMediaSettings fromList:[self readValue]]; - case 130: + case 140: return [FCPPlatformPoint fromList:[self readValue]]; + case 141: + return [FCPPlatformSize fromList:[self readValue]]; default: return [super readValueOfType:type]; } } @end -@interface FCPCameraApiCodecWriter : FlutterStandardWriter +@interface FCPMessagesPigeonCodecWriter : FlutterStandardWriter @end -@implementation FCPCameraApiCodecWriter +@implementation FCPMessagesPigeonCodecWriter - (void)writeValue:(id)value { - if ([value isKindOfClass:[FCPPlatformCameraDescription class]]) { - [self writeByte:128]; + if ([value isKindOfClass:[FCPPlatformCameraLensDirectionBox class]]) { + FCPPlatformCameraLensDirectionBox *box = (FCPPlatformCameraLensDirectionBox *)value; + [self writeByte:129]; + [self writeValue:(value == nil ? [NSNull null] : [NSNumber numberWithInteger:box.value])]; + } else if ([value isKindOfClass:[FCPPlatformDeviceOrientationBox class]]) { + FCPPlatformDeviceOrientationBox *box = (FCPPlatformDeviceOrientationBox *)value; + [self writeByte:130]; + [self writeValue:(value == nil ? [NSNull null] : [NSNumber numberWithInteger:box.value])]; + } else if ([value isKindOfClass:[FCPPlatformExposureModeBox class]]) { + FCPPlatformExposureModeBox *box = (FCPPlatformExposureModeBox *)value; + [self writeByte:131]; + [self writeValue:(value == nil ? [NSNull null] : [NSNumber numberWithInteger:box.value])]; + } else if ([value isKindOfClass:[FCPPlatformFlashModeBox class]]) { + FCPPlatformFlashModeBox *box = (FCPPlatformFlashModeBox *)value; + [self writeByte:132]; + [self writeValue:(value == nil ? [NSNull null] : [NSNumber numberWithInteger:box.value])]; + } else if ([value isKindOfClass:[FCPPlatformFocusModeBox class]]) { + FCPPlatformFocusModeBox *box = (FCPPlatformFocusModeBox *)value; + [self writeByte:133]; + [self writeValue:(value == nil ? [NSNull null] : [NSNumber numberWithInteger:box.value])]; + } else if ([value isKindOfClass:[FCPPlatformImageFileFormatBox class]]) { + FCPPlatformImageFileFormatBox *box = (FCPPlatformImageFileFormatBox *)value; + [self writeByte:134]; + [self writeValue:(value == nil ? [NSNull null] : [NSNumber numberWithInteger:box.value])]; + } else if ([value isKindOfClass:[FCPPlatformImageFormatGroupBox class]]) { + FCPPlatformImageFormatGroupBox *box = (FCPPlatformImageFormatGroupBox *)value; + [self writeByte:135]; + [self writeValue:(value == nil ? [NSNull null] : [NSNumber numberWithInteger:box.value])]; + } else if ([value isKindOfClass:[FCPPlatformResolutionPresetBox class]]) { + FCPPlatformResolutionPresetBox *box = (FCPPlatformResolutionPresetBox *)value; + [self writeByte:136]; + [self writeValue:(value == nil ? [NSNull null] : [NSNumber numberWithInteger:box.value])]; + } else if ([value isKindOfClass:[FCPPlatformCameraDescription class]]) { + [self writeByte:137]; + [self writeValue:[value toList]]; + } else if ([value isKindOfClass:[FCPPlatformCameraState class]]) { + [self writeByte:138]; [self writeValue:[value toList]]; } else if ([value isKindOfClass:[FCPPlatformMediaSettings class]]) { - [self writeByte:129]; + [self writeByte:139]; [self writeValue:[value toList]]; } else if ([value isKindOfClass:[FCPPlatformPoint class]]) { - [self writeByte:130]; + [self writeByte:140]; + [self writeValue:[value toList]]; + } else if ([value isKindOfClass:[FCPPlatformSize class]]) { + [self writeByte:141]; [self writeValue:[value toList]]; } else { [super writeValue:value]; @@ -333,27 +429,27 @@ - (void)writeValue:(id)value { } @end -@interface FCPCameraApiCodecReaderWriter : FlutterStandardReaderWriter +@interface FCPMessagesPigeonCodecReaderWriter : FlutterStandardReaderWriter @end -@implementation FCPCameraApiCodecReaderWriter +@implementation FCPMessagesPigeonCodecReaderWriter - (FlutterStandardWriter *)writerWithData:(NSMutableData *)data { - return [[FCPCameraApiCodecWriter alloc] initWithData:data]; + return [[FCPMessagesPigeonCodecWriter alloc] initWithData:data]; } - (FlutterStandardReader *)readerWithData:(NSData *)data { - return [[FCPCameraApiCodecReader alloc] initWithData:data]; + return [[FCPMessagesPigeonCodecReader alloc] initWithData:data]; } @end -NSObject *FCPCameraApiGetCodec(void) { +NSObject *FCPGetMessagesCodec(void) { static FlutterStandardMessageCodec *sSharedObject = nil; static dispatch_once_t sPred = 0; dispatch_once(&sPred, ^{ - FCPCameraApiCodecReaderWriter *readerWriter = [[FCPCameraApiCodecReaderWriter alloc] init]; + FCPMessagesPigeonCodecReaderWriter *readerWriter = + [[FCPMessagesPigeonCodecReaderWriter alloc] init]; sSharedObject = [FlutterStandardMessageCodec codecWithReaderWriter:readerWriter]; }); return sSharedObject; } - void SetUpFCPCameraApi(id binaryMessenger, NSObject *api) { SetUpFCPCameraApiWithSuffix(binaryMessenger, api, @""); } @@ -371,7 +467,7 @@ void SetUpFCPCameraApiWithSuffix(id binaryMessenger, @"CameraApi.getAvailableCameras", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FCPCameraApiGetCodec()]; + codec:FCPGetMessagesCodec()]; if (api) { NSCAssert( [api respondsToSelector:@selector(availableCamerasWithCompletion:)], @@ -396,14 +492,14 @@ void SetUpFCPCameraApiWithSuffix(id binaryMessenger, @"dev.flutter.pigeon.camera_avfoundation.CameraApi.create", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FCPCameraApiGetCodec()]; + codec:FCPGetMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(createCameraWithName:settings:completion:)], @"FCPCameraApi api (%@) doesn't respond to " @"@selector(createCameraWithName:settings:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; NSString *arg_cameraName = GetNullableObjectAtIndex(args, 0); FCPPlatformMediaSettings *arg_settings = GetNullableObjectAtIndex(args, 1); [api createCameraWithName:arg_cameraName @@ -425,17 +521,18 @@ void SetUpFCPCameraApiWithSuffix(id binaryMessenger, @"dev.flutter.pigeon.camera_avfoundation.CameraApi.initialize", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FCPCameraApiGetCodec()]; + codec:FCPGetMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(initializeCamera:withImageFormat:completion:)], @"FCPCameraApi api (%@) doesn't respond to " @"@selector(initializeCamera:withImageFormat:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; NSInteger arg_cameraId = [GetNullableObjectAtIndex(args, 0) integerValue]; - FCPPlatformImageFormatGroup arg_imageFormat = - [GetNullableObjectAtIndex(args, 1) integerValue]; + FCPPlatformImageFormatGroupBox *boxedFCPPlatformImageFormatGroup = + GetNullableObjectAtIndex(args, 1); + FCPPlatformImageFormatGroup arg_imageFormat = boxedFCPPlatformImageFormatGroup.value; [api initializeCamera:arg_cameraId withImageFormat:arg_imageFormat completion:^(FlutterError *_Nullable error) { @@ -454,7 +551,7 @@ void SetUpFCPCameraApiWithSuffix(id binaryMessenger, @"CameraApi.startImageStream", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FCPCameraApiGetCodec()]; + codec:FCPGetMessagesCodec()]; if (api) { NSCAssert( [api respondsToSelector:@selector(startImageStreamWithCompletion:)], @@ -478,7 +575,7 @@ void SetUpFCPCameraApiWithSuffix(id binaryMessenger, @"dev.flutter.pigeon.camera_avfoundation.CameraApi.stopImageStream", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FCPCameraApiGetCodec()]; + codec:FCPGetMessagesCodec()]; if (api) { NSCAssert( [api respondsToSelector:@selector(stopImageStreamWithCompletion:)], @@ -504,7 +601,7 @@ void SetUpFCPCameraApiWithSuffix(id binaryMessenger, @"CameraApi.receivedImageStreamData", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FCPCameraApiGetCodec()]; + codec:FCPGetMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(receivedImageStreamDataWithCompletion:)], @"FCPCameraApi api (%@) doesn't respond to " @@ -528,13 +625,13 @@ void SetUpFCPCameraApiWithSuffix(id binaryMessenger, @"dev.flutter.pigeon.camera_avfoundation.CameraApi.dispose", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FCPCameraApiGetCodec()]; + codec:FCPGetMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(disposeCamera:completion:)], @"FCPCameraApi api (%@) doesn't respond to @selector(disposeCamera:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; NSInteger arg_cameraId = [GetNullableObjectAtIndex(args, 0) integerValue]; [api disposeCamera:arg_cameraId completion:^(FlutterError *_Nullable error) { @@ -553,16 +650,17 @@ void SetUpFCPCameraApiWithSuffix(id binaryMessenger, @"CameraApi.lockCaptureOrientation", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FCPCameraApiGetCodec()]; + codec:FCPGetMessagesCodec()]; if (api) { NSCAssert( [api respondsToSelector:@selector(lockCaptureOrientation:completion:)], @"FCPCameraApi api (%@) doesn't respond to @selector(lockCaptureOrientation:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - FCPPlatformDeviceOrientation arg_orientation = - [GetNullableObjectAtIndex(args, 0) integerValue]; + NSArray *args = message; + FCPPlatformDeviceOrientationBox *boxedFCPPlatformDeviceOrientation = + GetNullableObjectAtIndex(args, 0); + FCPPlatformDeviceOrientation arg_orientation = boxedFCPPlatformDeviceOrientation.value; [api lockCaptureOrientation:arg_orientation completion:^(FlutterError *_Nullable error) { callback(wrapResult(nil, error)); @@ -581,7 +679,7 @@ void SetUpFCPCameraApiWithSuffix(id binaryMessenger, @"CameraApi.unlockCaptureOrientation", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FCPCameraApiGetCodec()]; + codec:FCPGetMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(unlockCaptureOrientationWithCompletion:)], @"FCPCameraApi api (%@) doesn't respond to " @@ -606,7 +704,7 @@ void SetUpFCPCameraApiWithSuffix(id binaryMessenger, @"dev.flutter.pigeon.camera_avfoundation.CameraApi.takePicture", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FCPCameraApiGetCodec()]; + codec:FCPGetMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(takePictureWithCompletion:)], @"FCPCameraApi api (%@) doesn't respond to @selector(takePictureWithCompletion:)", @@ -629,7 +727,7 @@ void SetUpFCPCameraApiWithSuffix(id binaryMessenger, @"CameraApi.prepareForVideoRecording", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FCPCameraApiGetCodec()]; + codec:FCPGetMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(prepareForVideoRecordingWithCompletion:)], @"FCPCameraApi api (%@) doesn't respond to " @@ -653,14 +751,14 @@ void SetUpFCPCameraApiWithSuffix(id binaryMessenger, @"CameraApi.startVideoRecording", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FCPCameraApiGetCodec()]; + codec:FCPGetMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(startVideoRecordingWithStreaming:completion:)], @"FCPCameraApi api (%@) doesn't respond to " @"@selector(startVideoRecordingWithStreaming:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; BOOL arg_enableStream = [GetNullableObjectAtIndex(args, 0) boolValue]; [api startVideoRecordingWithStreaming:arg_enableStream completion:^(FlutterError *_Nullable error) { @@ -679,7 +777,7 @@ void SetUpFCPCameraApiWithSuffix(id binaryMessenger, @"CameraApi.stopVideoRecording", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FCPCameraApiGetCodec()]; + codec:FCPGetMessagesCodec()]; if (api) { NSCAssert( [api respondsToSelector:@selector(stopVideoRecordingWithCompletion:)], @@ -703,7 +801,7 @@ void SetUpFCPCameraApiWithSuffix(id binaryMessenger, @"CameraApi.pauseVideoRecording", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FCPCameraApiGetCodec()]; + codec:FCPGetMessagesCodec()]; if (api) { NSCAssert( [api respondsToSelector:@selector(pauseVideoRecordingWithCompletion:)], @@ -726,7 +824,7 @@ void SetUpFCPCameraApiWithSuffix(id binaryMessenger, @"CameraApi.resumeVideoRecording", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FCPCameraApiGetCodec()]; + codec:FCPGetMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(resumeVideoRecordingWithCompletion:)], @"FCPCameraApi api (%@) doesn't respond to " @@ -750,14 +848,15 @@ void SetUpFCPCameraApiWithSuffix(id binaryMessenger, @"dev.flutter.pigeon.camera_avfoundation.CameraApi.setFlashMode", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FCPCameraApiGetCodec()]; + codec:FCPGetMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(setFlashMode:completion:)], @"FCPCameraApi api (%@) doesn't respond to @selector(setFlashMode:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - FCPPlatformFlashMode arg_mode = [GetNullableObjectAtIndex(args, 0) integerValue]; + NSArray *args = message; + FCPPlatformFlashModeBox *boxedFCPPlatformFlashMode = GetNullableObjectAtIndex(args, 0); + FCPPlatformFlashMode arg_mode = boxedFCPPlatformFlashMode.value; [api setFlashMode:arg_mode completion:^(FlutterError *_Nullable error) { callback(wrapResult(nil, error)); @@ -776,14 +875,16 @@ void SetUpFCPCameraApiWithSuffix(id binaryMessenger, @"dev.flutter.pigeon.camera_avfoundation.CameraApi.setExposureMode", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FCPCameraApiGetCodec()]; + codec:FCPGetMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(setExposureMode:completion:)], @"FCPCameraApi api (%@) doesn't respond to @selector(setExposureMode:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - FCPPlatformExposureMode arg_mode = [GetNullableObjectAtIndex(args, 0) integerValue]; + NSArray *args = message; + FCPPlatformExposureModeBox *boxedFCPPlatformExposureMode = + GetNullableObjectAtIndex(args, 0); + FCPPlatformExposureMode arg_mode = boxedFCPPlatformExposureMode.value; [api setExposureMode:arg_mode completion:^(FlutterError *_Nullable error) { callback(wrapResult(nil, error)); @@ -803,13 +904,13 @@ void SetUpFCPCameraApiWithSuffix(id binaryMessenger, @"CameraApi.setExposurePoint", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FCPCameraApiGetCodec()]; + codec:FCPGetMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(setExposurePoint:completion:)], @"FCPCameraApi api (%@) doesn't respond to @selector(setExposurePoint:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; FCPPlatformPoint *arg_point = GetNullableObjectAtIndex(args, 0); [api setExposurePoint:arg_point completion:^(FlutterError *_Nullable error) { @@ -828,7 +929,7 @@ void SetUpFCPCameraApiWithSuffix(id binaryMessenger, @"CameraApi.getMinExposureOffset", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FCPCameraApiGetCodec()]; + codec:FCPGetMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(getMinimumExposureOffset:)], @"FCPCameraApi api (%@) doesn't respond to @selector(getMinimumExposureOffset:)", @@ -850,7 +951,7 @@ void SetUpFCPCameraApiWithSuffix(id binaryMessenger, @"CameraApi.getMaxExposureOffset", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FCPCameraApiGetCodec()]; + codec:FCPGetMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(getMaximumExposureOffset:)], @"FCPCameraApi api (%@) doesn't respond to @selector(getMaximumExposureOffset:)", @@ -872,14 +973,14 @@ void SetUpFCPCameraApiWithSuffix(id binaryMessenger, @"CameraApi.setExposureOffset", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FCPCameraApiGetCodec()]; + codec:FCPGetMessagesCodec()]; if (api) { NSCAssert( [api respondsToSelector:@selector(setExposureOffset:completion:)], @"FCPCameraApi api (%@) doesn't respond to @selector(setExposureOffset:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; double arg_offset = [GetNullableObjectAtIndex(args, 0) doubleValue]; [api setExposureOffset:arg_offset completion:^(FlutterError *_Nullable error) { @@ -899,14 +1000,15 @@ void SetUpFCPCameraApiWithSuffix(id binaryMessenger, @"dev.flutter.pigeon.camera_avfoundation.CameraApi.setFocusMode", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FCPCameraApiGetCodec()]; + codec:FCPGetMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(setFocusMode:completion:)], @"FCPCameraApi api (%@) doesn't respond to @selector(setFocusMode:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - FCPPlatformFocusMode arg_mode = [GetNullableObjectAtIndex(args, 0) integerValue]; + NSArray *args = message; + FCPPlatformFocusModeBox *boxedFCPPlatformFocusMode = GetNullableObjectAtIndex(args, 0); + FCPPlatformFocusMode arg_mode = boxedFCPPlatformFocusMode.value; [api setFocusMode:arg_mode completion:^(FlutterError *_Nullable error) { callback(wrapResult(nil, error)); @@ -927,13 +1029,13 @@ void SetUpFCPCameraApiWithSuffix(id binaryMessenger, @"dev.flutter.pigeon.camera_avfoundation.CameraApi.setFocusPoint", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FCPCameraApiGetCodec()]; + codec:FCPGetMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(setFocusPoint:completion:)], @"FCPCameraApi api (%@) doesn't respond to @selector(setFocusPoint:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; FCPPlatformPoint *arg_point = GetNullableObjectAtIndex(args, 0); [api setFocusPoint:arg_point completion:^(FlutterError *_Nullable error) { @@ -953,7 +1055,7 @@ void SetUpFCPCameraApiWithSuffix(id binaryMessenger, @"dev.flutter.pigeon.camera_avfoundation.CameraApi.getMinZoomLevel", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FCPCameraApiGetCodec()]; + codec:FCPGetMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(getMinimumZoomLevel:)], @"FCPCameraApi api (%@) doesn't respond to @selector(getMinimumZoomLevel:)", api); @@ -975,7 +1077,7 @@ void SetUpFCPCameraApiWithSuffix(id binaryMessenger, @"dev.flutter.pigeon.camera_avfoundation.CameraApi.getMaxZoomLevel", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FCPCameraApiGetCodec()]; + codec:FCPGetMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(getMaximumZoomLevel:)], @"FCPCameraApi api (%@) doesn't respond to @selector(getMaximumZoomLevel:)", api); @@ -997,13 +1099,13 @@ void SetUpFCPCameraApiWithSuffix(id binaryMessenger, @"dev.flutter.pigeon.camera_avfoundation.CameraApi.setZoomLevel", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FCPCameraApiGetCodec()]; + codec:FCPGetMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(setZoomLevel:completion:)], @"FCPCameraApi api (%@) doesn't respond to @selector(setZoomLevel:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; double arg_zoom = [GetNullableObjectAtIndex(args, 0) doubleValue]; [api setZoomLevel:arg_zoom completion:^(FlutterError *_Nullable error) { @@ -1023,7 +1125,7 @@ void SetUpFCPCameraApiWithSuffix(id binaryMessenger, @"dev.flutter.pigeon.camera_avfoundation.CameraApi.pausePreview", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FCPCameraApiGetCodec()]; + codec:FCPGetMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(pausePreviewWithCompletion:)], @"FCPCameraApi api (%@) doesn't respond to @selector(pausePreviewWithCompletion:)", @@ -1046,7 +1148,7 @@ void SetUpFCPCameraApiWithSuffix(id binaryMessenger, @"dev.flutter.pigeon.camera_avfoundation.CameraApi.resumePreview", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FCPCameraApiGetCodec()]; + codec:FCPGetMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(resumePreviewWithCompletion:)], @"FCPCameraApi api (%@) doesn't respond to @selector(resumePreviewWithCompletion:)", @@ -1070,7 +1172,7 @@ void SetUpFCPCameraApiWithSuffix(id binaryMessenger, @"CameraApi.updateDescriptionWhileRecording", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FCPCameraApiGetCodec()]; + codec:FCPGetMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(updateDescriptionWhileRecordingCameraName: completion:)], @@ -1078,7 +1180,7 @@ void SetUpFCPCameraApiWithSuffix(id binaryMessenger, @"@selector(updateDescriptionWhileRecordingCameraName:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; NSString *arg_cameraName = GetNullableObjectAtIndex(args, 0); [api updateDescriptionWhileRecordingCameraName:arg_cameraName completion:^(FlutterError *_Nullable error) { @@ -1097,15 +1199,17 @@ void SetUpFCPCameraApiWithSuffix(id binaryMessenger, @"CameraApi.setImageFileFormat", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FCPCameraApiGetCodec()]; + codec:FCPGetMessagesCodec()]; if (api) { NSCAssert( [api respondsToSelector:@selector(setImageFileFormat:completion:)], @"FCPCameraApi api (%@) doesn't respond to @selector(setImageFileFormat:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - FCPPlatformImageFileFormat arg_format = [GetNullableObjectAtIndex(args, 0) integerValue]; + NSArray *args = message; + FCPPlatformImageFileFormatBox *boxedFCPPlatformImageFileFormat = + GetNullableObjectAtIndex(args, 0); + FCPPlatformImageFileFormat arg_format = boxedFCPPlatformImageFileFormat.value; [api setImageFileFormat:arg_format completion:^(FlutterError *_Nullable error) { callback(wrapResult(nil, error)); @@ -1116,12 +1220,6 @@ void SetUpFCPCameraApiWithSuffix(id binaryMessenger, } } } -NSObject *FCPCameraGlobalEventApiGetCodec(void) { - static FlutterStandardMessageCodec *sSharedObject = nil; - sSharedObject = [FlutterStandardMessageCodec sharedInstance]; - return sSharedObject; -} - @interface FCPCameraGlobalEventApi () @property(nonatomic, strong) NSObject *binaryMessenger; @property(nonatomic, strong) NSString *messageChannelSuffix; @@ -1153,8 +1251,8 @@ - (void)deviceOrientationChangedOrientation:(FCPPlatformDeviceOrientation)arg_or FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel messageChannelWithName:channelName binaryMessenger:self.binaryMessenger - codec:FCPCameraGlobalEventApiGetCodec()]; - [channel sendMessage:@[ [NSNumber numberWithInteger:arg_orientation] ] + codec:FCPGetMessagesCodec()]; + [channel sendMessage:@[ [[FCPPlatformDeviceOrientationBox alloc] initWithValue:arg_orientation] ] reply:^(NSArray *reply) { if (reply != nil) { if (reply.count > 1) { @@ -1171,59 +1269,6 @@ - (void)deviceOrientationChangedOrientation:(FCPPlatformDeviceOrientation)arg_or } @end -@interface FCPCameraEventApiCodecReader : FlutterStandardReader -@end -@implementation FCPCameraEventApiCodecReader -- (nullable id)readValueOfType:(UInt8)type { - switch (type) { - case 128: - return [FCPPlatformCameraState fromList:[self readValue]]; - case 129: - return [FCPPlatformSize fromList:[self readValue]]; - default: - return [super readValueOfType:type]; - } -} -@end - -@interface FCPCameraEventApiCodecWriter : FlutterStandardWriter -@end -@implementation FCPCameraEventApiCodecWriter -- (void)writeValue:(id)value { - if ([value isKindOfClass:[FCPPlatformCameraState class]]) { - [self writeByte:128]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FCPPlatformSize class]]) { - [self writeByte:129]; - [self writeValue:[value toList]]; - } else { - [super writeValue:value]; - } -} -@end - -@interface FCPCameraEventApiCodecReaderWriter : FlutterStandardReaderWriter -@end -@implementation FCPCameraEventApiCodecReaderWriter -- (FlutterStandardWriter *)writerWithData:(NSMutableData *)data { - return [[FCPCameraEventApiCodecWriter alloc] initWithData:data]; -} -- (FlutterStandardReader *)readerWithData:(NSData *)data { - return [[FCPCameraEventApiCodecReader alloc] initWithData:data]; -} -@end - -NSObject *FCPCameraEventApiGetCodec(void) { - static FlutterStandardMessageCodec *sSharedObject = nil; - static dispatch_once_t sPred = 0; - dispatch_once(&sPred, ^{ - FCPCameraEventApiCodecReaderWriter *readerWriter = - [[FCPCameraEventApiCodecReaderWriter alloc] init]; - sSharedObject = [FlutterStandardMessageCodec codecWithReaderWriter:readerWriter]; - }); - return sSharedObject; -} - @interface FCPCameraEventApi () @property(nonatomic, strong) NSObject *binaryMessenger; @property(nonatomic, strong) NSString *messageChannelSuffix; @@ -1254,7 +1299,7 @@ - (void)initializedWithState:(FCPPlatformCameraState *)arg_initialState FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel messageChannelWithName:channelName binaryMessenger:self.binaryMessenger - codec:FCPCameraEventApiGetCodec()]; + codec:FCPGetMessagesCodec()]; [channel sendMessage:@[ arg_initialState ?: [NSNull null] ] reply:^(NSArray *reply) { if (reply != nil) { @@ -1278,7 +1323,7 @@ - (void)reportError:(NSString *)arg_message FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel messageChannelWithName:channelName binaryMessenger:self.binaryMessenger - codec:FCPCameraEventApiGetCodec()]; + codec:FCPGetMessagesCodec()]; [channel sendMessage:@[ arg_message ?: [NSNull null] ] reply:^(NSArray *reply) { if (reply != nil) { diff --git a/packages/camera/camera_avfoundation/lib/src/avfoundation_camera.dart b/packages/camera/camera_avfoundation/lib/src/avfoundation_camera.dart index d3d5bd8fe4f3..286e01940bfa 100644 --- a/packages/camera/camera_avfoundation/lib/src/avfoundation_camera.dart +++ b/packages/camera/camera_avfoundation/lib/src/avfoundation_camera.dart @@ -68,8 +68,6 @@ class AVFoundationCamera extends CameraPlatform { Future> availableCameras() async { try { return (await _hostApi.getAvailableCameras()) - // See comment in messages.dart for why this is safe. - .map((PlatformCameraDescription? c) => c!) .map(cameraDescriptionFromPlatform) .toList(); } on PlatformException catch (e) { diff --git a/packages/camera/camera_avfoundation/lib/src/messages.g.dart b/packages/camera/camera_avfoundation/lib/src/messages.g.dart index 4290eb02ed2e..535f03e34c2e 100644 --- a/packages/camera/camera_avfoundation/lib/src/messages.g.dart +++ b/packages/camera/camera_avfoundation/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 (v18.0.0), do not edit directly. +// Autogenerated from Pigeon (v22.4.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, no_leading_underscores_for_local_identifiers @@ -99,7 +99,7 @@ class PlatformCameraDescription { Object encode() { return [ name, - lensDirection.index, + lensDirection, ]; } @@ -107,7 +107,7 @@ class PlatformCameraDescription { result as List; return PlatformCameraDescription( name: result[0]! as String, - lensDirection: PlatformCameraLensDirection.values[result[1]! as int], + lensDirection: result[1]! as PlatformCameraLensDirection, ); } } @@ -138,9 +138,9 @@ class PlatformCameraState { Object encode() { return [ - previewSize.encode(), - exposureMode.index, - focusMode.index, + previewSize, + exposureMode, + focusMode, exposurePointSupported, focusPointSupported, ]; @@ -149,9 +149,9 @@ class PlatformCameraState { static PlatformCameraState decode(Object result) { result as List; return PlatformCameraState( - previewSize: PlatformSize.decode(result[0]! as List), - exposureMode: PlatformExposureMode.values[result[1]! as int], - focusMode: PlatformFocusMode.values[result[2]! as int], + previewSize: result[0]! as PlatformSize, + exposureMode: result[1]! as PlatformExposureMode, + focusMode: result[2]! as PlatformFocusMode, exposurePointSupported: result[3]! as bool, focusPointSupported: result[4]! as bool, ); @@ -179,7 +179,7 @@ class PlatformMediaSettings { Object encode() { return [ - resolutionPreset.index, + resolutionPreset, framesPerSecond, videoBitrate, audioBitrate, @@ -190,7 +190,7 @@ class PlatformMediaSettings { static PlatformMediaSettings decode(Object result) { result as List; return PlatformMediaSettings( - resolutionPreset: PlatformResolutionPreset.values[result[0]! as int], + resolutionPreset: result[0]! as PlatformResolutionPreset, framesPerSecond: result[1] as int?, videoBitrate: result[2] as int?, audioBitrate: result[3] as int?, @@ -251,18 +251,51 @@ class PlatformSize { } } -class _CameraApiCodec extends StandardMessageCodec { - const _CameraApiCodec(); +class _PigeonCodec extends StandardMessageCodec { + const _PigeonCodec(); @override void writeValue(WriteBuffer buffer, Object? value) { - if (value is PlatformCameraDescription) { - buffer.putUint8(128); + if (value is int) { + buffer.putUint8(4); + buffer.putInt64(value); + } else if (value is PlatformCameraLensDirection) { + buffer.putUint8(129); + writeValue(buffer, value.index); + } else if (value is PlatformDeviceOrientation) { + buffer.putUint8(130); + writeValue(buffer, value.index); + } else if (value is PlatformExposureMode) { + buffer.putUint8(131); + writeValue(buffer, value.index); + } else if (value is PlatformFlashMode) { + buffer.putUint8(132); + writeValue(buffer, value.index); + } else if (value is PlatformFocusMode) { + buffer.putUint8(133); + writeValue(buffer, value.index); + } else if (value is PlatformImageFileFormat) { + buffer.putUint8(134); + writeValue(buffer, value.index); + } else if (value is PlatformImageFormatGroup) { + buffer.putUint8(135); + writeValue(buffer, value.index); + } else if (value is PlatformResolutionPreset) { + buffer.putUint8(136); + writeValue(buffer, value.index); + } else if (value is PlatformCameraDescription) { + buffer.putUint8(137); + writeValue(buffer, value.encode()); + } else if (value is PlatformCameraState) { + buffer.putUint8(138); writeValue(buffer, value.encode()); } else if (value is PlatformMediaSettings) { - buffer.putUint8(129); + buffer.putUint8(139); writeValue(buffer, value.encode()); } else if (value is PlatformPoint) { - buffer.putUint8(130); + buffer.putUint8(140); + writeValue(buffer, value.encode()); + } else if (value is PlatformSize) { + buffer.putUint8(141); writeValue(buffer, value.encode()); } else { super.writeValue(buffer, value); @@ -272,12 +305,40 @@ class _CameraApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: - return PlatformCameraDescription.decode(readValue(buffer)!); case 129: - return PlatformMediaSettings.decode(readValue(buffer)!); + final int? value = readValue(buffer) as int?; + return value == null ? null : PlatformCameraLensDirection.values[value]; case 130: + final int? value = readValue(buffer) as int?; + return value == null ? null : PlatformDeviceOrientation.values[value]; + case 131: + final int? value = readValue(buffer) as int?; + return value == null ? null : PlatformExposureMode.values[value]; + case 132: + final int? value = readValue(buffer) as int?; + return value == null ? null : PlatformFlashMode.values[value]; + case 133: + final int? value = readValue(buffer) as int?; + return value == null ? null : PlatformFocusMode.values[value]; + case 134: + final int? value = readValue(buffer) as int?; + return value == null ? null : PlatformImageFileFormat.values[value]; + case 135: + final int? value = readValue(buffer) as int?; + return value == null ? null : PlatformImageFormatGroup.values[value]; + case 136: + final int? value = readValue(buffer) as int?; + return value == null ? null : PlatformResolutionPreset.values[value]; + case 137: + return PlatformCameraDescription.decode(readValue(buffer)!); + case 138: + return PlatformCameraState.decode(readValue(buffer)!); + case 139: + return PlatformMediaSettings.decode(readValue(buffer)!); + case 140: return PlatformPoint.decode(readValue(buffer)!); + case 141: + return PlatformSize.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); } @@ -290,96 +351,96 @@ class CameraApi { /// BinaryMessenger will be used which routes to the host platform. CameraApi( {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) - : __pigeon_binaryMessenger = binaryMessenger, - __pigeon_messageChannelSuffix = + : pigeonVar_binaryMessenger = binaryMessenger, + pigeonVar_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; - final BinaryMessenger? __pigeon_binaryMessenger; + final BinaryMessenger? pigeonVar_binaryMessenger; - static const MessageCodec pigeonChannelCodec = _CameraApiCodec(); + static const MessageCodec pigeonChannelCodec = _PigeonCodec(); - final String __pigeon_messageChannelSuffix; + final String pigeonVar_messageChannelSuffix; /// Returns the list of available cameras. - Future> getAvailableCameras() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.camera_avfoundation.CameraApi.getAvailableCameras$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + Future> getAvailableCameras() async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_avfoundation.CameraApi.getAvailableCameras$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as List?)! - .cast(); + return (pigeonVar_replyList[0] as List?)! + .cast(); } } /// Create a new camera with the given settings, and returns its ID. Future create(String cameraName, PlatformMediaSettings settings) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.camera_avfoundation.CameraApi.create$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_avfoundation.CameraApi.create$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel + final List? pigeonVar_replyList = await pigeonVar_channel .send([cameraName, settings]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as int?)!; + return (pigeonVar_replyList[0] as int?)!; } } /// Initializes the camera with the given ID. Future initialize( int cameraId, PlatformImageFormatGroup imageFormat) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.camera_avfoundation.CameraApi.initialize$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_avfoundation.CameraApi.initialize$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([cameraId, imageFormat.index]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = await pigeonVar_channel + .send([cameraId, imageFormat]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -388,23 +449,23 @@ class CameraApi { /// Begins streaming frames from the camera. Future startImageStream() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.camera_avfoundation.CameraApi.startImageStream$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_avfoundation.CameraApi.startImageStream$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -413,23 +474,23 @@ class CameraApi { /// Stops streaming frames from the camera. Future stopImageStream() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.camera_avfoundation.CameraApi.stopImageStream$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_avfoundation.CameraApi.stopImageStream$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -441,23 +502,23 @@ class CameraApi { /// /// This is used to throttle sending frames across the channel. Future receivedImageStreamData() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.camera_avfoundation.CameraApi.receivedImageStreamData$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_avfoundation.CameraApi.receivedImageStreamData$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -467,23 +528,23 @@ class CameraApi { /// Indicates that the given camera is no longer being used on the Dart side, /// and any associated resources can be cleaned up. Future dispose(int cameraId) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.camera_avfoundation.CameraApi.dispose$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_avfoundation.CameraApi.dispose$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([cameraId]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([cameraId]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -493,23 +554,23 @@ class CameraApi { /// Locks the camera capture to the current device orientation. Future lockCaptureOrientation( PlatformDeviceOrientation orientation) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.camera_avfoundation.CameraApi.lockCaptureOrientation$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_avfoundation.CameraApi.lockCaptureOrientation$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([orientation.index]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([orientation]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -519,23 +580,23 @@ class CameraApi { /// Unlocks camera capture orientation, allowing it to automatically adapt to /// device orientation. Future unlockCaptureOrientation() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.camera_avfoundation.CameraApi.unlockCaptureOrientation$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_avfoundation.CameraApi.unlockCaptureOrientation$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -545,53 +606,53 @@ class CameraApi { /// Takes a picture with the current settings, and returns the path to the /// resulting file. Future takePicture() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.camera_avfoundation.CameraApi.takePicture$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_avfoundation.CameraApi.takePicture$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as String?)!; + return (pigeonVar_replyList[0] as String?)!; } } /// Does any preprocessing necessary before beginning to record video. Future prepareForVideoRecording() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.camera_avfoundation.CameraApi.prepareForVideoRecording$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_avfoundation.CameraApi.prepareForVideoRecording$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -601,23 +662,23 @@ class CameraApi { /// Begins recording video, optionally enabling streaming to Dart at the same /// time. Future startVideoRecording(bool enableStream) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.camera_avfoundation.CameraApi.startVideoRecording$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_avfoundation.CameraApi.startVideoRecording$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([enableStream]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([enableStream]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -626,53 +687,53 @@ class CameraApi { /// Stops recording video, and results the path to the resulting file. Future stopVideoRecording() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.camera_avfoundation.CameraApi.stopVideoRecording$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_avfoundation.CameraApi.stopVideoRecording$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as String?)!; + return (pigeonVar_replyList[0] as String?)!; } } /// Pauses video recording. Future pauseVideoRecording() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.camera_avfoundation.CameraApi.pauseVideoRecording$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_avfoundation.CameraApi.pauseVideoRecording$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -681,23 +742,23 @@ class CameraApi { /// Resumes a previously paused video recording. Future resumeVideoRecording() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.camera_avfoundation.CameraApi.resumeVideoRecording$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_avfoundation.CameraApi.resumeVideoRecording$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -706,23 +767,23 @@ class CameraApi { /// Switches the camera to the given flash mode. Future setFlashMode(PlatformFlashMode mode) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.camera_avfoundation.CameraApi.setFlashMode$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_avfoundation.CameraApi.setFlashMode$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([mode.index]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([mode]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -731,23 +792,23 @@ class CameraApi { /// Switches the camera to the given exposure mode. Future setExposureMode(PlatformExposureMode mode) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.camera_avfoundation.CameraApi.setExposureMode$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_avfoundation.CameraApi.setExposureMode$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([mode.index]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([mode]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -758,23 +819,23 @@ class CameraApi { /// /// A null value resets to the default exposure point. Future setExposurePoint(PlatformPoint? point) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.camera_avfoundation.CameraApi.setExposurePoint$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_avfoundation.CameraApi.setExposurePoint$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([point]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([point]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -783,83 +844,83 @@ class CameraApi { /// Returns the minimum exposure offset supported by the camera. Future getMinExposureOffset() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.camera_avfoundation.CameraApi.getMinExposureOffset$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_avfoundation.CameraApi.getMinExposureOffset$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as double?)!; + return (pigeonVar_replyList[0] as double?)!; } } /// Returns the maximum exposure offset supported by the camera. Future getMaxExposureOffset() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.camera_avfoundation.CameraApi.getMaxExposureOffset$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_avfoundation.CameraApi.getMaxExposureOffset$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as double?)!; + return (pigeonVar_replyList[0] as double?)!; } } /// Sets the exposure offset manually to the given value. Future setExposureOffset(double offset) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.camera_avfoundation.CameraApi.setExposureOffset$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_avfoundation.CameraApi.setExposureOffset$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([offset]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([offset]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -868,23 +929,23 @@ class CameraApi { /// Switches the camera to the given focus mode. Future setFocusMode(PlatformFocusMode mode) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.camera_avfoundation.CameraApi.setFocusMode$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_avfoundation.CameraApi.setFocusMode$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([mode.index]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([mode]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -895,23 +956,23 @@ class CameraApi { /// /// A null value resets to the default focus point. Future setFocusPoint(PlatformPoint? point) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.camera_avfoundation.CameraApi.setFocusPoint$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_avfoundation.CameraApi.setFocusPoint$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([point]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([point]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -920,83 +981,83 @@ class CameraApi { /// Returns the minimum zoom level supported by the camera. Future getMinZoomLevel() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.camera_avfoundation.CameraApi.getMinZoomLevel$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_avfoundation.CameraApi.getMinZoomLevel$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as double?)!; + return (pigeonVar_replyList[0] as double?)!; } } /// Returns the maximum zoom level supported by the camera. Future getMaxZoomLevel() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.camera_avfoundation.CameraApi.getMaxZoomLevel$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_avfoundation.CameraApi.getMaxZoomLevel$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as double?)!; + return (pigeonVar_replyList[0] as double?)!; } } /// Sets the zoom factor. Future setZoomLevel(double zoom) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.camera_avfoundation.CameraApi.setZoomLevel$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_avfoundation.CameraApi.setZoomLevel$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([zoom]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([zoom]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -1005,23 +1066,23 @@ class CameraApi { /// Pauses streaming of preview frames. Future pausePreview() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.camera_avfoundation.CameraApi.pausePreview$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_avfoundation.CameraApi.pausePreview$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -1030,23 +1091,23 @@ class CameraApi { /// Resumes a previously paused preview stream. Future resumePreview() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.camera_avfoundation.CameraApi.resumePreview$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_avfoundation.CameraApi.resumePreview$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -1057,23 +1118,23 @@ class CameraApi { /// /// This should only be called while video recording is active. Future updateDescriptionWhileRecording(String cameraName) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.camera_avfoundation.CameraApi.updateDescriptionWhileRecording$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_avfoundation.CameraApi.updateDescriptionWhileRecording$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([cameraName]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([cameraName]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -1082,23 +1143,23 @@ class CameraApi { /// Sets the file format used for taking pictures. Future setImageFileFormat(PlatformImageFileFormat format) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.camera_avfoundation.CameraApi.setImageFileFormat$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.camera_avfoundation.CameraApi.setImageFileFormat$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([format.index]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([format]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -1108,8 +1169,7 @@ class CameraApi { /// Handler for native callbacks that are not tied to a specific camera ID. abstract class CameraGlobalEventApi { - static const MessageCodec pigeonChannelCodec = - StandardMessageCodec(); + static const MessageCodec pigeonChannelCodec = _PigeonCodec(); /// Called when the device's physical orientation changes. void deviceOrientationChanged(PlatformDeviceOrientation orientation); @@ -1122,21 +1182,21 @@ abstract class CameraGlobalEventApi { messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.camera_avfoundation.CameraGlobalEventApi.deviceOrientationChanged$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.camera_avfoundation.CameraGlobalEventApi.deviceOrientationChanged was null.'); final List args = (message as List?)!; - final PlatformDeviceOrientation? arg_orientation = args[0] == null - ? null - : PlatformDeviceOrientation.values[args[0]! as int]; + final PlatformDeviceOrientation? arg_orientation = + (args[0] as PlatformDeviceOrientation?); assert(arg_orientation != null, 'Argument for dev.flutter.pigeon.camera_avfoundation.CameraGlobalEventApi.deviceOrientationChanged was null, expected non-null PlatformDeviceOrientation.'); try { @@ -1154,40 +1214,11 @@ abstract class CameraGlobalEventApi { } } -class _CameraEventApiCodec extends StandardMessageCodec { - const _CameraEventApiCodec(); - @override - void writeValue(WriteBuffer buffer, Object? value) { - if (value is PlatformCameraState) { - buffer.putUint8(128); - writeValue(buffer, value.encode()); - } else if (value is PlatformSize) { - buffer.putUint8(129); - writeValue(buffer, value.encode()); - } else { - super.writeValue(buffer, value); - } - } - - @override - Object? readValueOfType(int type, ReadBuffer buffer) { - switch (type) { - case 128: - return PlatformCameraState.decode(readValue(buffer)!); - case 129: - return PlatformSize.decode(readValue(buffer)!); - default: - return super.readValueOfType(type, buffer); - } - } -} - /// Handler for native callbacks that are tied to a specific camera ID. /// /// This is intended to be initialized with the camera ID as a suffix. abstract class CameraEventApi { - static const MessageCodec pigeonChannelCodec = - _CameraEventApiCodec(); + static const MessageCodec pigeonChannelCodec = _PigeonCodec(); /// Called when the camera is inialitized for use. void initialized(PlatformCameraState initialState); @@ -1206,15 +1237,16 @@ abstract class CameraEventApi { messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.camera_avfoundation.CameraEventApi.initialized$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.camera_avfoundation.CameraEventApi.initialized was null.'); final List args = (message as List?)!; @@ -1235,15 +1267,16 @@ abstract class CameraEventApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.camera_avfoundation.CameraEventApi.error$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.camera_avfoundation.CameraEventApi.error was null.'); final List args = (message as List?)!; diff --git a/packages/camera/camera_avfoundation/pigeons/messages.dart b/packages/camera/camera_avfoundation/pigeons/messages.dart index c50ecc33e408..272ea288960d 100644 --- a/packages/camera/camera_avfoundation/pigeons/messages.dart +++ b/packages/camera/camera_avfoundation/pigeons/messages.dart @@ -160,7 +160,7 @@ abstract class CameraApi { // The consuming code treats it as non-nullable. @async @ObjCSelector('availableCamerasWithCompletion') - List getAvailableCameras(); + List getAvailableCameras(); /// Create a new camera with the given settings, and returns its ID. @async diff --git a/packages/camera/camera_avfoundation/pubspec.yaml b/packages/camera/camera_avfoundation/pubspec.yaml index 229e44a63221..2fbbddb34c88 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.17+3 +version: 0.9.17+4 environment: sdk: ^3.3.0 @@ -27,8 +27,8 @@ dev_dependencies: build_runner: ^2.4.9 flutter_test: sdk: flutter - mockito: 5.4.4 - pigeon: ^18.0.0 + mockito: ^5.4.4 + pigeon: ^22.4.2 topics: - camera diff --git a/packages/camera/camera_avfoundation/test/avfoundation_camera_test.mocks.dart b/packages/camera/camera_avfoundation/test/avfoundation_camera_test.mocks.dart index 729b39f7f283..b1118578a169 100644 --- a/packages/camera/camera_avfoundation/test/avfoundation_camera_test.mocks.dart +++ b/packages/camera/camera_avfoundation/test/avfoundation_camera_test.mocks.dart @@ -3,11 +3,11 @@ // Do not manually edit this file. // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:async' as _i3; +import 'dart:async' as _i4; import 'package:camera_avfoundation/src/messages.g.dart' as _i2; import 'package:mockito/mockito.dart' as _i1; -import 'package:mockito/src/dummies.dart' as _i4; +import 'package:mockito/src/dummies.dart' as _i3; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values @@ -27,21 +27,34 @@ import 'package:mockito/src/dummies.dart' as _i4; /// See the documentation for Mockito's code generation for more information. class MockCameraApi extends _i1.Mock implements _i2.CameraApi { @override - _i3.Future> getAvailableCameras() => + String get pigeonVar_messageChannelSuffix => (super.noSuchMethod( + Invocation.getter(#pigeonVar_messageChannelSuffix), + returnValue: _i3.dummyValue( + this, + Invocation.getter(#pigeonVar_messageChannelSuffix), + ), + returnValueForMissingStub: _i3.dummyValue( + this, + Invocation.getter(#pigeonVar_messageChannelSuffix), + ), + ) as String); + + @override + _i4.Future> getAvailableCameras() => (super.noSuchMethod( Invocation.method( #getAvailableCameras, [], ), - returnValue: _i3.Future>.value( - <_i2.PlatformCameraDescription?>[]), + returnValue: _i4.Future>.value( + <_i2.PlatformCameraDescription>[]), returnValueForMissingStub: - _i3.Future>.value( - <_i2.PlatformCameraDescription?>[]), - ) as _i3.Future>); + _i4.Future>.value( + <_i2.PlatformCameraDescription>[]), + ) as _i4.Future>); @override - _i3.Future create( + _i4.Future create( String? cameraName, _i2.PlatformMediaSettings? settings, ) => @@ -53,12 +66,12 @@ class MockCameraApi extends _i1.Mock implements _i2.CameraApi { settings, ], ), - returnValue: _i3.Future.value(0), - returnValueForMissingStub: _i3.Future.value(0), - ) as _i3.Future); + returnValue: _i4.Future.value(0), + returnValueForMissingStub: _i4.Future.value(0), + ) as _i4.Future); @override - _i3.Future initialize( + _i4.Future initialize( int? cameraId, _i2.PlatformImageFormatGroup? imageFormat, ) => @@ -70,79 +83,79 @@ class MockCameraApi extends _i1.Mock implements _i2.CameraApi { imageFormat, ], ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i3.Future startImageStream() => (super.noSuchMethod( + _i4.Future startImageStream() => (super.noSuchMethod( Invocation.method( #startImageStream, [], ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i3.Future stopImageStream() => (super.noSuchMethod( + _i4.Future stopImageStream() => (super.noSuchMethod( Invocation.method( #stopImageStream, [], ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i3.Future receivedImageStreamData() => (super.noSuchMethod( + _i4.Future receivedImageStreamData() => (super.noSuchMethod( Invocation.method( #receivedImageStreamData, [], ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i3.Future dispose(int? cameraId) => (super.noSuchMethod( + _i4.Future dispose(int? cameraId) => (super.noSuchMethod( Invocation.method( #dispose, [cameraId], ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i3.Future lockCaptureOrientation( + _i4.Future lockCaptureOrientation( _i2.PlatformDeviceOrientation? orientation) => (super.noSuchMethod( Invocation.method( #lockCaptureOrientation, [orientation], ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i3.Future unlockCaptureOrientation() => (super.noSuchMethod( + _i4.Future unlockCaptureOrientation() => (super.noSuchMethod( Invocation.method( #unlockCaptureOrientation, [], ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i3.Future takePicture() => (super.noSuchMethod( + _i4.Future takePicture() => (super.noSuchMethod( Invocation.method( #takePicture, [], ), - returnValue: _i3.Future.value(_i4.dummyValue( + returnValue: _i4.Future.value(_i3.dummyValue( this, Invocation.method( #takePicture, @@ -150,43 +163,43 @@ class MockCameraApi extends _i1.Mock implements _i2.CameraApi { ), )), returnValueForMissingStub: - _i3.Future.value(_i4.dummyValue( + _i4.Future.value(_i3.dummyValue( this, Invocation.method( #takePicture, [], ), )), - ) as _i3.Future); + ) as _i4.Future); @override - _i3.Future prepareForVideoRecording() => (super.noSuchMethod( + _i4.Future prepareForVideoRecording() => (super.noSuchMethod( Invocation.method( #prepareForVideoRecording, [], ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i3.Future startVideoRecording(bool? enableStream) => + _i4.Future startVideoRecording(bool? enableStream) => (super.noSuchMethod( Invocation.method( #startVideoRecording, [enableStream], ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i3.Future stopVideoRecording() => (super.noSuchMethod( + _i4.Future stopVideoRecording() => (super.noSuchMethod( Invocation.method( #stopVideoRecording, [], ), - returnValue: _i3.Future.value(_i4.dummyValue( + returnValue: _i4.Future.value(_i3.dummyValue( this, Invocation.method( #stopVideoRecording, @@ -194,189 +207,189 @@ class MockCameraApi extends _i1.Mock implements _i2.CameraApi { ), )), returnValueForMissingStub: - _i3.Future.value(_i4.dummyValue( + _i4.Future.value(_i3.dummyValue( this, Invocation.method( #stopVideoRecording, [], ), )), - ) as _i3.Future); + ) as _i4.Future); @override - _i3.Future pauseVideoRecording() => (super.noSuchMethod( + _i4.Future pauseVideoRecording() => (super.noSuchMethod( Invocation.method( #pauseVideoRecording, [], ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i3.Future resumeVideoRecording() => (super.noSuchMethod( + _i4.Future resumeVideoRecording() => (super.noSuchMethod( Invocation.method( #resumeVideoRecording, [], ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i3.Future setFlashMode(_i2.PlatformFlashMode? mode) => + _i4.Future setFlashMode(_i2.PlatformFlashMode? mode) => (super.noSuchMethod( Invocation.method( #setFlashMode, [mode], ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i3.Future setExposureMode(_i2.PlatformExposureMode? mode) => + _i4.Future setExposureMode(_i2.PlatformExposureMode? mode) => (super.noSuchMethod( Invocation.method( #setExposureMode, [mode], ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i3.Future setExposurePoint(_i2.PlatformPoint? point) => + _i4.Future setExposurePoint(_i2.PlatformPoint? point) => (super.noSuchMethod( Invocation.method( #setExposurePoint, [point], ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i3.Future getMinExposureOffset() => (super.noSuchMethod( + _i4.Future getMinExposureOffset() => (super.noSuchMethod( Invocation.method( #getMinExposureOffset, [], ), - returnValue: _i3.Future.value(0.0), - returnValueForMissingStub: _i3.Future.value(0.0), - ) as _i3.Future); + returnValue: _i4.Future.value(0.0), + returnValueForMissingStub: _i4.Future.value(0.0), + ) as _i4.Future); @override - _i3.Future getMaxExposureOffset() => (super.noSuchMethod( + _i4.Future getMaxExposureOffset() => (super.noSuchMethod( Invocation.method( #getMaxExposureOffset, [], ), - returnValue: _i3.Future.value(0.0), - returnValueForMissingStub: _i3.Future.value(0.0), - ) as _i3.Future); + returnValue: _i4.Future.value(0.0), + returnValueForMissingStub: _i4.Future.value(0.0), + ) as _i4.Future); @override - _i3.Future setExposureOffset(double? offset) => (super.noSuchMethod( + _i4.Future setExposureOffset(double? offset) => (super.noSuchMethod( Invocation.method( #setExposureOffset, [offset], ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i3.Future setFocusMode(_i2.PlatformFocusMode? mode) => + _i4.Future setFocusMode(_i2.PlatformFocusMode? mode) => (super.noSuchMethod( Invocation.method( #setFocusMode, [mode], ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i3.Future setFocusPoint(_i2.PlatformPoint? point) => + _i4.Future setFocusPoint(_i2.PlatformPoint? point) => (super.noSuchMethod( Invocation.method( #setFocusPoint, [point], ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i3.Future getMinZoomLevel() => (super.noSuchMethod( + _i4.Future getMinZoomLevel() => (super.noSuchMethod( Invocation.method( #getMinZoomLevel, [], ), - returnValue: _i3.Future.value(0.0), - returnValueForMissingStub: _i3.Future.value(0.0), - ) as _i3.Future); + returnValue: _i4.Future.value(0.0), + returnValueForMissingStub: _i4.Future.value(0.0), + ) as _i4.Future); @override - _i3.Future getMaxZoomLevel() => (super.noSuchMethod( + _i4.Future getMaxZoomLevel() => (super.noSuchMethod( Invocation.method( #getMaxZoomLevel, [], ), - returnValue: _i3.Future.value(0.0), - returnValueForMissingStub: _i3.Future.value(0.0), - ) as _i3.Future); + returnValue: _i4.Future.value(0.0), + returnValueForMissingStub: _i4.Future.value(0.0), + ) as _i4.Future); @override - _i3.Future setZoomLevel(double? zoom) => (super.noSuchMethod( + _i4.Future setZoomLevel(double? zoom) => (super.noSuchMethod( Invocation.method( #setZoomLevel, [zoom], ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i3.Future pausePreview() => (super.noSuchMethod( + _i4.Future pausePreview() => (super.noSuchMethod( Invocation.method( #pausePreview, [], ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i3.Future resumePreview() => (super.noSuchMethod( + _i4.Future resumePreview() => (super.noSuchMethod( Invocation.method( #resumePreview, [], ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i3.Future updateDescriptionWhileRecording(String? cameraName) => + _i4.Future updateDescriptionWhileRecording(String? cameraName) => (super.noSuchMethod( Invocation.method( #updateDescriptionWhileRecording, [cameraName], ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i3.Future setImageFileFormat(_i2.PlatformImageFileFormat? format) => + _i4.Future setImageFileFormat(_i2.PlatformImageFileFormat? format) => (super.noSuchMethod( Invocation.method( #setImageFileFormat, [format], ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); } diff --git a/packages/camera/camera_windows/pubspec.yaml b/packages/camera/camera_windows/pubspec.yaml index 60dd0d24ac23..4ad68786edf3 100644 --- a/packages/camera/camera_windows/pubspec.yaml +++ b/packages/camera/camera_windows/pubspec.yaml @@ -28,7 +28,7 @@ dev_dependencies: build_runner: ^2.4.9 flutter_test: sdk: flutter - mockito: 5.4.4 + mockito: ^5.4.4 pigeon: ^21.0.0 topics: diff --git a/packages/espresso/CHANGELOG.md b/packages/espresso/CHANGELOG.md index ea65202eda5c..aedffb8547c1 100644 --- a/packages/espresso/CHANGELOG.md +++ b/packages/espresso/CHANGELOG.md @@ -1,3 +1,12 @@ +## 0.4.0+3 + +* Updates Java compatibility version to 11. +* Updates minimum supported SDK version to Flutter 3.24/Dart 3.5. + +## 0.4.0+2 + +* Bumps `com.google.guava:guava` from `31.1` to `33.3.1`. + ## 0.4.0+1 * Updates lint checks to ignore NewerVersionAvailable. diff --git a/packages/espresso/android/build.gradle b/packages/espresso/android/build.gradle index c430c39873b5..9f54c535f0af 100644 --- a/packages/espresso/android/build.gradle +++ b/packages/espresso/android/build.gradle @@ -22,10 +22,7 @@ rootProject.allprojects { apply plugin: 'com.android.library' android { - // Conditional for compatibility with AGP <4.2. - if (project.android.hasProperty("namespace")) { - namespace 'com.example.espresso' - } + namespace 'com.example.espresso' compileSdk 34 defaultConfig { @@ -34,8 +31,8 @@ android { } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_11 + targetCompatibility JavaVersion.VERSION_11 } lintOptions { @@ -60,7 +57,7 @@ android { } dependencies { - implementation 'com.google.guava:guava:31.1-android' + implementation 'com.google.guava:guava:33.3.1-android' implementation 'com.squareup.okhttp3:okhttp:4.11.0' implementation 'com.google.code.gson:gson:2.10.1' androidTestImplementation 'org.hamcrest:hamcrest:2.2' diff --git a/packages/espresso/example/android/build.gradle b/packages/espresso/example/android/build.gradle index 3b4e5d087a42..1365397dabbf 100644 --- a/packages/espresso/example/android/build.gradle +++ b/packages/espresso/example/android/build.gradle @@ -5,7 +5,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:7.4.2' + classpath 'com.android.tools.build:gradle:8.5.1' } } diff --git a/packages/espresso/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/espresso/example/android/gradle/wrapper/gradle-wrapper.properties index aeaff6f869f3..7aeeb11c6ee5 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-8.7-all.zip diff --git a/packages/espresso/example/pubspec.yaml b/packages/espresso/example/pubspec.yaml index 1cafae5d3e18..c39450e9ed83 100644 --- a/packages/espresso/example/pubspec.yaml +++ b/packages/espresso/example/pubspec.yaml @@ -3,8 +3,8 @@ description: Demonstrates how to use the espresso plugin. publish_to: none environment: - sdk: ^3.4.0 - flutter: ">=3.22.0" + sdk: ^3.5.0 + flutter: ">=3.24.0" dependencies: flutter: diff --git a/packages/espresso/pubspec.yaml b/packages/espresso/pubspec.yaml index b68b22e4f60a..57e25352ea96 100644 --- a/packages/espresso/pubspec.yaml +++ b/packages/espresso/pubspec.yaml @@ -3,11 +3,11 @@ description: Java classes for testing Flutter apps using Espresso. Allows driving Flutter widgets from a native Espresso test. repository: https://github.com/flutter/packages/tree/main/packages/espresso issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+espresso%22 -version: 0.4.0+1 +version: 0.4.0+3 environment: - sdk: ^3.4.0 - flutter: ">=3.22.0" + sdk: ^3.5.0 + flutter: ">=3.24.0" flutter: plugin: diff --git a/packages/extension_google_sign_in_as_googleapis_auth/example/android/app/build.gradle b/packages/extension_google_sign_in_as_googleapis_auth/example/android/app/build.gradle index 497c231a3aba..03fe48c2210b 100644 --- a/packages/extension_google_sign_in_as_googleapis_auth/example/android/app/build.gradle +++ b/packages/extension_google_sign_in_as_googleapis_auth/example/android/app/build.gradle @@ -29,8 +29,8 @@ android { compileSdk flutter.compileSdkVersion compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_11 + targetCompatibility JavaVersion.VERSION_11 } defaultConfig { diff --git a/packages/extension_google_sign_in_as_googleapis_auth/example/android/build.gradle b/packages/extension_google_sign_in_as_googleapis_auth/example/android/build.gradle index adcf25704467..92088245cb0e 100644 --- a/packages/extension_google_sign_in_as_googleapis_auth/example/android/build.gradle +++ b/packages/extension_google_sign_in_as_googleapis_auth/example/android/build.gradle @@ -5,7 +5,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:7.4.2' + classpath 'com.android.tools.build:gradle:8.5.2' classpath 'com.google.gms:google-services:4.3.15' } } diff --git a/packages/extension_google_sign_in_as_googleapis_auth/example/android/gradle.properties b/packages/extension_google_sign_in_as_googleapis_auth/example/android/gradle.properties index 94adc3a3f97a..598d13fee446 100644 --- a/packages/extension_google_sign_in_as_googleapis_auth/example/android/gradle.properties +++ b/packages/extension_google_sign_in_as_googleapis_auth/example/android/gradle.properties @@ -1,3 +1,3 @@ -org.gradle.jvmargs=-Xmx1536M +org.gradle.jvmargs=-Xmx4G android.useAndroidX=true android.enableJetifier=true 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..7aeeb11c6ee5 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-8.7-all.zip diff --git a/packages/extension_google_sign_in_as_googleapis_auth/example/pubspec.yaml b/packages/extension_google_sign_in_as_googleapis_auth/example/pubspec.yaml index 8fd7c35a390b..c8de67d9e71b 100644 --- a/packages/extension_google_sign_in_as_googleapis_auth/example/pubspec.yaml +++ b/packages/extension_google_sign_in_as_googleapis_auth/example/pubspec.yaml @@ -17,7 +17,7 @@ dependencies: flutter: sdk: flutter google_sign_in: ^6.0.0 - googleapis: ^10.1.0 + googleapis: ">=10.1.0 <14.0.0" googleapis_auth: ^1.1.0 dev_dependencies: diff --git a/packages/file_selector/file_selector/example/android/app/build.gradle b/packages/file_selector/file_selector/example/android/app/build.gradle index 4728b6c2863a..94926c2cedb8 100644 --- a/packages/file_selector/file_selector/example/android/app/build.gradle +++ b/packages/file_selector/file_selector/example/android/app/build.gradle @@ -31,12 +31,12 @@ android { ndkVersion flutter.ndkVersion compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_11 + targetCompatibility JavaVersion.VERSION_11 } kotlinOptions { - jvmTarget = '1.8' + jvmTarget = '11' } sourceSets { @@ -47,7 +47,7 @@ android { applicationId "dev.flutter.plugins.file_selector_example" // You can update the following values to match your application needs. // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. - minSdkVersion 19 + minSdkVersion flutter.minSdkVersion targetSdkVersion flutter.targetSdkVersion versionCode flutterVersionCode.toInteger() versionName flutterVersionName diff --git a/packages/file_selector/file_selector/example/android/build.gradle b/packages/file_selector/file_selector/example/android/build.gradle index fdf447f8a7e6..491936f2fbef 100644 --- a/packages/file_selector/file_selector/example/android/build.gradle +++ b/packages/file_selector/file_selector/example/android/build.gradle @@ -6,7 +6,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:7.3.0' + classpath 'com.android.tools.build:gradle:8.5.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } 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..3c85cfe057a1 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-8.7-all.zip diff --git a/packages/file_selector/file_selector_android/CHANGELOG.md b/packages/file_selector/file_selector_android/CHANGELOG.md index b0e3b0388a80..8c1f93d36d32 100644 --- a/packages/file_selector/file_selector_android/CHANGELOG.md +++ b/packages/file_selector/file_selector_android/CHANGELOG.md @@ -1,3 +1,20 @@ +## 0.5.1+10 + +* Bumps androidx.annotation:annotation from 1.8.2 to 1.9.0. + +## 0.5.1+9 + +* Updates Java compatibility version to 11. + +## 0.5.1+8 + +* Updates Pigeon for non-nullable collection type support. + +## 0.5.1+7 + +* Removes dependency on org.jetbrains.kotlin:kotlin-bom. +* Updates minimum supported SDK version to Flutter 3.24/Dart 3.5. + ## 0.5.1+6 * Bumps androidx.annotation:annotation from 1.8.1 to 1.8.2. diff --git a/packages/file_selector/file_selector_android/android/build.gradle b/packages/file_selector/file_selector_android/android/build.gradle index 51d11dcd327d..144e667a2d63 100644 --- a/packages/file_selector/file_selector_android/android/build.gradle +++ b/packages/file_selector/file_selector_android/android/build.gradle @@ -22,15 +22,12 @@ rootProject.allprojects { apply plugin: 'com.android.library' android { - // Conditional for compatibility with AGP <4.2. - if (project.android.hasProperty("namespace")) { - namespace 'dev.flutter.packages.file_selector_android' - } + namespace 'dev.flutter.packages.file_selector_android' compileSdk 34 compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_11 + targetCompatibility JavaVersion.VERSION_11 } defaultConfig { @@ -38,15 +35,11 @@ android { } dependencies { - implementation 'androidx.annotation:annotation:1.8.2' + implementation 'androidx.annotation:annotation:1.9.0' testImplementation 'junit:junit:4.13.2' testImplementation 'org.mockito:mockito-inline:5.1.0' testImplementation 'androidx.test:core:1.3.0' testImplementation "org.robolectric:robolectric:4.12.1" - - // org.jetbrains.kotlin:kotlin-bom artifact purpose is to align kotlin stdlib and related code versions. - // See: https://youtrack.jetbrains.com/issue/KT-55297/kotlin-stdlib-should-declare-constraints-on-kotlin-stdlib-jdk8-and-kotlin-stdlib-jdk7 - implementation(platform("org.jetbrains.kotlin:kotlin-bom:1.8.10")) } lintOptions { diff --git a/packages/file_selector/file_selector_android/android/src/main/java/dev/flutter/packages/file_selector_android/FileSelectorAndroidPlugin.java b/packages/file_selector/file_selector_android/android/src/main/java/dev/flutter/packages/file_selector_android/FileSelectorAndroidPlugin.java index 27b79068ea12..f7fce0fdd95b 100644 --- a/packages/file_selector/file_selector_android/android/src/main/java/dev/flutter/packages/file_selector_android/FileSelectorAndroidPlugin.java +++ b/packages/file_selector/file_selector_android/android/src/main/java/dev/flutter/packages/file_selector_android/FileSelectorAndroidPlugin.java @@ -28,7 +28,7 @@ public void onDetachedFromEngine(@NonNull FlutterPluginBinding binding) { @Override public void onAttachedToActivity(@NonNull ActivityPluginBinding binding) { fileSelectorApi = new FileSelectorApiImpl(binding); - GeneratedFileSelectorApi.FileSelectorApi.setup( + GeneratedFileSelectorApi.FileSelectorApi.setUp( pluginBinding.getBinaryMessenger(), fileSelectorApi); } @@ -45,7 +45,7 @@ public void onReattachedToActivityForConfigChanges(@NonNull ActivityPluginBindin fileSelectorApi.setActivityPluginBinding(binding); } else { fileSelectorApi = new FileSelectorApiImpl(binding); - GeneratedFileSelectorApi.FileSelectorApi.setup( + GeneratedFileSelectorApi.FileSelectorApi.setUp( pluginBinding.getBinaryMessenger(), fileSelectorApi); } } diff --git a/packages/file_selector/file_selector_android/android/src/main/java/dev/flutter/packages/file_selector_android/FileSelectorApiImpl.java b/packages/file_selector/file_selector_android/android/src/main/java/dev/flutter/packages/file_selector_android/FileSelectorApiImpl.java index a20ab00e58eb..555318b29959 100644 --- a/packages/file_selector/file_selector_android/android/src/main/java/dev/flutter/packages/file_selector_android/FileSelectorApiImpl.java +++ b/packages/file_selector/file_selector_android/android/src/main/java/dev/flutter/packages/file_selector_android/FileSelectorApiImpl.java @@ -91,7 +91,8 @@ public FileSelectorApiImpl(@NonNull ActivityPluginBinding activityPluginBinding) public void openFile( @Nullable String initialDirectory, @NonNull GeneratedFileSelectorApi.FileTypes allowedTypes, - @NonNull GeneratedFileSelectorApi.Result result) { + @NonNull + GeneratedFileSelectorApi.NullableResult result) { final Intent intent = objectFactory.newIntent(Intent.ACTION_OPEN_DOCUMENT); intent.addCategory(Intent.CATEGORY_OPENABLE); @@ -192,7 +193,8 @@ public void onResult(int resultCode, @Nullable Intent data) { @Override @TargetApi(21) public void getDirectoryPath( - @Nullable String initialDirectory, @NonNull GeneratedFileSelectorApi.Result result) { + @Nullable String initialDirectory, + @NonNull GeneratedFileSelectorApi.NullableResult result) { if (!sdkChecker.sdkIsAtLeast(android.os.Build.VERSION_CODES.LOLLIPOP)) { result.error( new UnsupportedOperationException( diff --git a/packages/file_selector/file_selector_android/android/src/main/java/dev/flutter/packages/file_selector_android/GeneratedFileSelectorApi.java b/packages/file_selector/file_selector_android/android/src/main/java/dev/flutter/packages/file_selector_android/GeneratedFileSelectorApi.java index 5f4261563bb5..de595ef85847 100644 --- a/packages/file_selector/file_selector_android/android/src/main/java/dev/flutter/packages/file_selector_android/GeneratedFileSelectorApi.java +++ b/packages/file_selector/file_selector_android/android/src/main/java/dev/flutter/packages/file_selector_android/GeneratedFileSelectorApi.java @@ -1,11 +1,14 @@ // 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 (v9.2.5), do not edit directly. +// Autogenerated from Pigeon (v22.4.2), do not edit directly. // See also: https://pub.dev/packages/pigeon package dev.flutter.packages.file_selector_android; +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; @@ -14,9 +17,13 @@ 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; import java.util.List; +import java.util.Objects; /** Generated class from Pigeon. */ @SuppressWarnings({"unused", "unchecked", "CodeBlock2Expr", "RedundantSuppression", "serial"}) @@ -40,7 +47,7 @@ public FlutterError(@NonNull String code, @Nullable String message, @Nullable Ob @NonNull protected static ArrayList wrapError(@NonNull Throwable exception) { - ArrayList errorList = new ArrayList(3); + ArrayList errorList = new ArrayList<>(3); if (exception instanceof FlutterError) { FlutterError error = (FlutterError) exception; errorList.add(error.code); @@ -55,6 +62,10 @@ protected static ArrayList wrapError(@NonNull Throwable exception) { return errorList; } + @Target(METHOD) + @Retention(CLASS) + @interface CanIgnoreReturnValue {} + /** Generated class from Pigeon that represents data sent in messages. */ public static final class FileResponse { private @NonNull String path; @@ -119,10 +130,34 @@ public void setBytes(@NonNull byte[] setterArg) { /** Constructor is non-public to enforce null safety; use Builder. */ FileResponse() {} + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FileResponse that = (FileResponse) o; + return path.equals(that.path) + && Objects.equals(mimeType, that.mimeType) + && Objects.equals(name, that.name) + && size.equals(that.size) + && Arrays.equals(bytes, that.bytes); + } + + @Override + public int hashCode() { + int pigeonVar_result = Objects.hash(path, mimeType, name, size); + pigeonVar_result = 31 * pigeonVar_result + Arrays.hashCode(bytes); + return pigeonVar_result; + } + public static final class Builder { private @Nullable String path; + @CanIgnoreReturnValue public @NonNull Builder setPath(@NonNull String setterArg) { this.path = setterArg; return this; @@ -130,6 +165,7 @@ public static final class Builder { private @Nullable String mimeType; + @CanIgnoreReturnValue public @NonNull Builder setMimeType(@Nullable String setterArg) { this.mimeType = setterArg; return this; @@ -137,6 +173,7 @@ public static final class Builder { private @Nullable String name; + @CanIgnoreReturnValue public @NonNull Builder setName(@Nullable String setterArg) { this.name = setterArg; return this; @@ -144,6 +181,7 @@ public static final class Builder { private @Nullable Long size; + @CanIgnoreReturnValue public @NonNull Builder setSize(@NonNull Long setterArg) { this.size = setterArg; return this; @@ -151,6 +189,7 @@ public static final class Builder { private @Nullable byte[] bytes; + @CanIgnoreReturnValue public @NonNull Builder setBytes(@NonNull byte[] setterArg) { this.bytes = setterArg; return this; @@ -169,7 +208,7 @@ public static final class Builder { @NonNull ArrayList toList() { - ArrayList toListResult = new ArrayList(5); + ArrayList toListResult = new ArrayList<>(5); toListResult.add(path); toListResult.add(mimeType); toListResult.add(name); @@ -178,18 +217,17 @@ ArrayList toList() { return toListResult; } - static @NonNull FileResponse fromList(@NonNull ArrayList list) { + static @NonNull FileResponse fromList(@NonNull ArrayList pigeonVar_list) { FileResponse pigeonResult = new FileResponse(); - Object path = list.get(0); + Object path = pigeonVar_list.get(0); pigeonResult.setPath((String) path); - Object mimeType = list.get(1); + Object mimeType = pigeonVar_list.get(1); pigeonResult.setMimeType((String) mimeType); - Object name = list.get(2); + Object name = pigeonVar_list.get(2); pigeonResult.setName((String) name); - Object size = list.get(3); - pigeonResult.setSize( - (size == null) ? null : ((size instanceof Integer) ? (Integer) size : (Long) size)); - Object bytes = list.get(4); + Object size = pigeonVar_list.get(3); + pigeonResult.setSize((Long) size); + Object bytes = pigeonVar_list.get(4); pigeonResult.setBytes((byte[]) bytes); return pigeonResult; } @@ -226,10 +264,28 @@ public void setExtensions(@NonNull List setterArg) { /** Constructor is non-public to enforce null safety; use Builder. */ FileTypes() {} + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FileTypes that = (FileTypes) o; + return mimeTypes.equals(that.mimeTypes) && extensions.equals(that.extensions); + } + + @Override + public int hashCode() { + return Objects.hash(mimeTypes, extensions); + } + public static final class Builder { private @Nullable List mimeTypes; + @CanIgnoreReturnValue public @NonNull Builder setMimeTypes(@NonNull List setterArg) { this.mimeTypes = setterArg; return this; @@ -237,6 +293,7 @@ public static final class Builder { private @Nullable List extensions; + @CanIgnoreReturnValue public @NonNull Builder setExtensions(@NonNull List setterArg) { this.extensions = setterArg; return this; @@ -252,40 +309,33 @@ public static final class Builder { @NonNull ArrayList toList() { - ArrayList toListResult = new ArrayList(2); + ArrayList toListResult = new ArrayList<>(2); toListResult.add(mimeTypes); toListResult.add(extensions); return toListResult; } - static @NonNull FileTypes fromList(@NonNull ArrayList list) { + static @NonNull FileTypes fromList(@NonNull ArrayList pigeonVar_list) { FileTypes pigeonResult = new FileTypes(); - Object mimeTypes = list.get(0); + Object mimeTypes = pigeonVar_list.get(0); pigeonResult.setMimeTypes((List) mimeTypes); - Object extensions = list.get(1); + Object extensions = pigeonVar_list.get(1); pigeonResult.setExtensions((List) extensions); return pigeonResult; } } - public interface Result { - @SuppressWarnings("UnknownNullness") - void success(T result); + private static class PigeonCodec extends StandardMessageCodec { + public static final PigeonCodec INSTANCE = new PigeonCodec(); - void error(@NonNull Throwable error); - } - - private static class FileSelectorApiCodec extends StandardMessageCodec { - public static final FileSelectorApiCodec INSTANCE = new FileSelectorApiCodec(); - - private FileSelectorApiCodec() {} + private PigeonCodec() {} @Override protected Object readValueOfType(byte type, @NonNull ByteBuffer buffer) { switch (type) { - case (byte) 128: - return FileResponse.fromList((ArrayList) readValue(buffer)); case (byte) 129: + return FileResponse.fromList((ArrayList) readValue(buffer)); + case (byte) 130: return FileTypes.fromList((ArrayList) readValue(buffer)); default: return super.readValueOfType(type, buffer); @@ -295,10 +345,10 @@ protected Object readValueOfType(byte type, @NonNull ByteBuffer buffer) { @Override protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { if (value instanceof FileResponse) { - stream.write(128); + stream.write(129); writeValue(stream, ((FileResponse) value).toList()); } else if (value instanceof FileTypes) { - stream.write(129); + stream.write(130); writeValue(stream, ((FileTypes) value).toList()); } else { super.writeValue(stream, value); @@ -306,6 +356,30 @@ protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { } } + /** Asynchronous error handling return type for non-nullable API method returns. */ + public interface Result { + /** Success case callback method for handling returns. */ + void success(@NonNull T result); + + /** Failure case callback method for handling errors. */ + void error(@NonNull Throwable error); + } + /** Asynchronous error handling return type for nullable API method returns. */ + public interface NullableResult { + /** Success case callback method for handling returns. */ + void success(@Nullable T result); + + /** Failure case callback method for handling errors. */ + void error(@NonNull Throwable error); + } + /** Asynchronous error handling return type for void API method returns. */ + public interface VoidResult { + /** Success case callback method for handling returns. */ + void success(); + + /** Failure case callback method for handling errors. */ + void error(@NonNull Throwable error); + } /** * An API to call to native code to select files or directories. * @@ -320,7 +394,7 @@ public interface FileSelectorApi { void openFile( @Nullable String initialDirectory, @NonNull FileTypes allowedTypes, - @NonNull Result result); + @NonNull NullableResult result); /** * Opens a file dialog for loading files and returns a list of file responses chosen by the * user. @@ -334,29 +408,41 @@ void openFiles( * *

Returns `null` if user cancels the operation. */ - void getDirectoryPath(@Nullable String initialDirectory, @NonNull Result result); + void getDirectoryPath( + @Nullable String initialDirectory, @NonNull NullableResult result); /** The codec used by FileSelectorApi. */ static @NonNull MessageCodec getCodec() { - return FileSelectorApiCodec.INSTANCE; + return PigeonCodec.INSTANCE; } /** * Sets up an instance of `FileSelectorApi` to handle messages through the `binaryMessenger`. */ - static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable FileSelectorApi api) { + static void setUp(@NonNull BinaryMessenger binaryMessenger, @Nullable FileSelectorApi api) { + setUp(binaryMessenger, "", api); + } + + static void setUp( + @NonNull BinaryMessenger binaryMessenger, + @NonNull String messageChannelSuffix, + @Nullable FileSelectorApi api) { + messageChannelSuffix = messageChannelSuffix.isEmpty() ? "" : "." + messageChannelSuffix; { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.FileSelectorApi.openFile", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.file_selector_android.FileSelectorApi.openFile" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; String initialDirectoryArg = (String) args.get(0); FileTypes allowedTypesArg = (FileTypes) args.get(1); - Result resultCallback = - new Result() { + NullableResult resultCallback = + new NullableResult() { public void success(FileResponse result) { wrapped.add(0, result); reply.reply(wrapped); @@ -377,11 +463,14 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.FileSelectorApi.openFiles", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.file_selector_android.FileSelectorApi.openFiles" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; String initialDirectoryArg = (String) args.get(0); FileTypes allowedTypesArg = (FileTypes) args.get(1); @@ -407,15 +496,18 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.FileSelectorApi.getDirectoryPath", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.file_selector_android.FileSelectorApi.getDirectoryPath" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; String initialDirectoryArg = (String) args.get(0); - Result resultCallback = - new Result() { + NullableResult resultCallback = + new NullableResult() { public void success(String result) { wrapped.add(0, result); reply.reply(wrapped); diff --git a/packages/file_selector/file_selector_android/android/src/test/java/dev/flutter/packages/file_selector_android/FileSelectorAndroidPluginTest.java b/packages/file_selector/file_selector_android/android/src/test/java/dev/flutter/packages/file_selector_android/FileSelectorAndroidPluginTest.java index dd4f74e0a287..00533c282640 100644 --- a/packages/file_selector/file_selector_android/android/src/test/java/dev/flutter/packages/file_selector_android/FileSelectorAndroidPluginTest.java +++ b/packages/file_selector/file_selector_android/android/src/test/java/dev/flutter/packages/file_selector_android/FileSelectorAndroidPluginTest.java @@ -95,8 +95,8 @@ public void openFileReturnsSuccessfully() throws FileNotFoundException { mockObjectFactory, (version) -> Build.VERSION.SDK_INT >= version); - final GeneratedFileSelectorApi.Result mockResult = - mock(GeneratedFileSelectorApi.Result.class); + final GeneratedFileSelectorApi.NullableResult mockResult = + mock(GeneratedFileSelectorApi.NullableResult.class); fileSelectorApi.openFile( null, new GeneratedFileSelectorApi.FileTypes.Builder() @@ -243,8 +243,8 @@ public void getDirectoryPathReturnsSuccessfully() { mockObjectFactory, (version) -> Build.VERSION_CODES.LOLLIPOP >= version); - final GeneratedFileSelectorApi.Result mockResult = - mock(GeneratedFileSelectorApi.Result.class); + final GeneratedFileSelectorApi.NullableResult mockResult = + mock(GeneratedFileSelectorApi.NullableResult.class); fileSelectorApi.getDirectoryPath(null, mockResult); verify(mockActivity).startActivityForResult(mockIntent, 223); @@ -273,8 +273,8 @@ public void getDirectoryPath_errorsForUnsupportedVersion() { (version) -> Build.VERSION_CODES.KITKAT >= version); @SuppressWarnings("unchecked") - final GeneratedFileSelectorApi.Result mockResult = - mock(GeneratedFileSelectorApi.Result.class); + final GeneratedFileSelectorApi.NullableResult mockResult = + mock(GeneratedFileSelectorApi.NullableResult.class); fileSelectorApi.getDirectoryPath(null, mockResult); verify(mockResult).error(any()); diff --git a/packages/file_selector/file_selector_android/example/android/app/build.gradle b/packages/file_selector/file_selector_android/example/android/app/build.gradle index a0a7ccb1e244..c6e428a2de13 100644 --- a/packages/file_selector/file_selector_android/example/android/app/build.gradle +++ b/packages/file_selector/file_selector_android/example/android/app/build.gradle @@ -31,8 +31,8 @@ android { ndkVersion flutter.ndkVersion compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_11 + targetCompatibility JavaVersion.VERSION_11 } defaultConfig { @@ -41,7 +41,7 @@ android { // You can update the following values to match your application needs. // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. minSdkVersion 21 - targetSdkVersion 33 + targetSdkVersion 34 versionCode flutterVersionCode.toInteger() versionName flutterVersionName testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" diff --git a/packages/file_selector/file_selector_android/example/android/build.gradle b/packages/file_selector/file_selector_android/example/android/build.gradle index 6e01a69f49a2..ade31dc936a8 100644 --- a/packages/file_selector/file_selector_android/example/android/build.gradle +++ b/packages/file_selector/file_selector_android/example/android/build.gradle @@ -6,7 +6,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:7.3.0' + classpath 'com.android.tools.build:gradle:8.5.2' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } 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..3c85cfe057a1 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-8.7-all.zip diff --git a/packages/file_selector/file_selector_android/example/pubspec.yaml b/packages/file_selector/file_selector_android/example/pubspec.yaml index ab441b989a2c..c003ee1fc493 100644 --- a/packages/file_selector/file_selector_android/example/pubspec.yaml +++ b/packages/file_selector/file_selector_android/example/pubspec.yaml @@ -3,8 +3,8 @@ description: Demonstrates how to use the file_selector_android plugin. publish_to: 'none' environment: - sdk: ^3.3.0 - flutter: ">=3.19.0" + sdk: ^3.5.0 + flutter: ">=3.24.0" dependencies: file_selector_android: diff --git a/packages/file_selector/file_selector_android/lib/src/file_selector_android.dart b/packages/file_selector/file_selector_android/lib/src/file_selector_android.dart index a4ff20323615..bc11695265c2 100644 --- a/packages/file_selector/file_selector_android/lib/src/file_selector_android.dart +++ b/packages/file_selector/file_selector_android/lib/src/file_selector_android.dart @@ -40,14 +40,11 @@ class FileSelectorAndroid extends FileSelectorPlatform { String? initialDirectory, String? confirmButtonText, }) async { - final List files = await _api.openFiles( + final List files = await _api.openFiles( initialDirectory, _fileTypesFromTypeGroups(acceptedTypeGroups), ); - return files - .cast() - .map(_xFileFromFileResponse) - .toList(); + return files.map(_xFileFromFileResponse).toList(); } @override diff --git a/packages/file_selector/file_selector_android/lib/src/file_selector_api.g.dart b/packages/file_selector/file_selector_android/lib/src/file_selector_api.g.dart index 2f3611ecdd4a..558ab5f557f4 100644 --- a/packages/file_selector/file_selector_android/lib/src/file_selector_api.g.dart +++ b/packages/file_selector/file_selector_android/lib/src/file_selector_api.g.dart @@ -1,9 +1,9 @@ // 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 (v9.2.5), do not edit directly. +// Autogenerated from Pigeon (v22.4.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 +// 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, no_leading_underscores_for_local_identifiers import 'dart:async'; import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List; @@ -11,6 +11,13 @@ import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List; import 'package:flutter/foundation.dart' show ReadBuffer, WriteBuffer; import 'package:flutter/services.dart'; +PlatformException _createConnectionError(String channelName) { + return PlatformException( + code: 'channel-error', + message: 'Unable to establish connection on channel: "$channelName".', + ); +} + class FileResponse { FileResponse({ required this.path, @@ -58,9 +65,9 @@ class FileTypes { required this.extensions, }); - List mimeTypes; + List mimeTypes; - List extensions; + List extensions; Object encode() { return [ @@ -72,21 +79,24 @@ class FileTypes { static FileTypes decode(Object result) { result as List; return FileTypes( - mimeTypes: (result[0] as List?)!.cast(), - extensions: (result[1] as List?)!.cast(), + mimeTypes: (result[0] as List?)!.cast(), + extensions: (result[1] as List?)!.cast(), ); } } -class _FileSelectorApiCodec extends StandardMessageCodec { - const _FileSelectorApiCodec(); +class _PigeonCodec extends StandardMessageCodec { + const _PigeonCodec(); @override void writeValue(WriteBuffer buffer, Object? value) { - if (value is FileResponse) { - buffer.putUint8(128); + if (value is int) { + buffer.putUint8(4); + buffer.putInt64(value); + } else if (value is FileResponse) { + buffer.putUint8(129); writeValue(buffer, value.encode()); } else if (value is FileTypes) { - buffer.putUint8(129); + buffer.putUint8(130); writeValue(buffer, value.encode()); } else { super.writeValue(buffer, value); @@ -96,9 +106,9 @@ class _FileSelectorApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: - return FileResponse.decode(readValue(buffer)!); case 129: + return FileResponse.decode(readValue(buffer)!); + case 130: return FileTypes.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -111,92 +121,101 @@ class FileSelectorApi { /// Constructor for [FileSelectorApi]. The [binaryMessenger] named argument is /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. - FileSelectorApi({BinaryMessenger? binaryMessenger}) - : _binaryMessenger = binaryMessenger; - final BinaryMessenger? _binaryMessenger; + FileSelectorApi( + {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) + : pigeonVar_binaryMessenger = binaryMessenger, + pigeonVar_messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + final BinaryMessenger? pigeonVar_binaryMessenger; - static const MessageCodec codec = _FileSelectorApiCodec(); + static const MessageCodec pigeonChannelCodec = _PigeonCodec(); + + final String pigeonVar_messageChannelSuffix; /// Opens a file dialog for loading files and returns a file path. /// /// Returns `null` if user cancels the operation. Future openFile( - String? arg_initialDirectory, FileTypes arg_allowedTypes) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.FileSelectorApi.openFile', codec, - binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_initialDirectory, arg_allowedTypes]) - as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + String? initialDirectory, FileTypes allowedTypes) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.file_selector_android.FileSelectorApi.openFile$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = await pigeonVar_channel + .send([initialDirectory, allowedTypes]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { - return (replyList[0] as FileResponse?); + return (pigeonVar_replyList[0] as FileResponse?); } } /// Opens a file dialog for loading files and returns a list of file responses /// chosen by the user. - Future> openFiles( - String? arg_initialDirectory, FileTypes arg_allowedTypes) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.FileSelectorApi.openFiles', codec, - binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_initialDirectory, arg_allowedTypes]) - as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + Future> openFiles( + String? initialDirectory, FileTypes allowedTypes) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.file_selector_android.FileSelectorApi.openFiles$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = await pigeonVar_channel + .send([initialDirectory, allowedTypes]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (replyList[0] as List?)!.cast(); + return (pigeonVar_replyList[0] as List?)!.cast(); } } /// Opens a file dialog for loading directories and returns a directory path. /// /// Returns `null` if user cancels the operation. - Future getDirectoryPath(String? arg_initialDirectory) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.FileSelectorApi.getDirectoryPath', codec, - binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_initialDirectory]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + Future getDirectoryPath(String? initialDirectory) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.file_selector_android.FileSelectorApi.getDirectoryPath$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = await pigeonVar_channel + .send([initialDirectory]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { - return (replyList[0] as String?); + return (pigeonVar_replyList[0] as String?); } } } diff --git a/packages/file_selector/file_selector_android/pigeons/file_selector_api.dart b/packages/file_selector/file_selector_android/pigeons/file_selector_api.dart index 440805019a77..3a6c5228a4b4 100644 --- a/packages/file_selector/file_selector_android/pigeons/file_selector_api.dart +++ b/packages/file_selector/file_selector_android/pigeons/file_selector_api.dart @@ -25,8 +25,8 @@ class FileResponse { } class FileTypes { - late List mimeTypes; - late List extensions; + late List mimeTypes; + late List extensions; } /// An API to call to native code to select files or directories. @@ -41,7 +41,7 @@ abstract class FileSelectorApi { /// Opens a file dialog for loading files and returns a list of file responses /// chosen by the user. @async - List openFiles( + List openFiles( String? initialDirectory, FileTypes allowedTypes, ); diff --git a/packages/file_selector/file_selector_android/pubspec.yaml b/packages/file_selector/file_selector_android/pubspec.yaml index 3d13f23bbcf8..389fa903eb0b 100644 --- a/packages/file_selector/file_selector_android/pubspec.yaml +++ b/packages/file_selector/file_selector_android/pubspec.yaml @@ -2,11 +2,11 @@ name: file_selector_android description: Android implementation of the file_selector package. repository: https://github.com/flutter/packages/tree/main/packages/file_selector/file_selector_android issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+file_selector%22 -version: 0.5.1+6 +version: 0.5.1+10 environment: - sdk: ^3.4.0 - flutter: ">=3.22.0" + sdk: ^3.5.0 + flutter: ">=3.24.0" flutter: plugin: @@ -27,8 +27,8 @@ dev_dependencies: build_runner: ^2.1.4 flutter_test: sdk: flutter - mockito: 5.4.4 - pigeon: ^9.2.4 + mockito: ^5.4.4 + pigeon: ^22.4.2 topics: - files 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 1e7d9745ebe5..8f465c9a79ac 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 @@ -3,10 +3,11 @@ // Do not manually edit this file. // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:async' as _i3; +import 'dart:async' as _i4; import 'package:file_selector_android/src/file_selector_api.g.dart' as _i2; import 'package:mockito/mockito.dart' as _i1; +import 'package:mockito/src/dummies.dart' as _i3; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values @@ -30,45 +31,54 @@ class MockFileSelectorApi extends _i1.Mock implements _i2.FileSelectorApi { } @override - _i3.Future<_i2.FileResponse?> openFile( - String? arg_initialDirectory, - _i2.FileTypes? arg_allowedTypes, + String get pigeonVar_messageChannelSuffix => (super.noSuchMethod( + Invocation.getter(#pigeonVar_messageChannelSuffix), + returnValue: _i3.dummyValue( + this, + Invocation.getter(#pigeonVar_messageChannelSuffix), + ), + ) as String); + + @override + _i4.Future<_i2.FileResponse?> openFile( + String? initialDirectory, + _i2.FileTypes? allowedTypes, ) => (super.noSuchMethod( Invocation.method( #openFile, [ - arg_initialDirectory, - arg_allowedTypes, + initialDirectory, + allowedTypes, ], ), - returnValue: _i3.Future<_i2.FileResponse?>.value(), - ) as _i3.Future<_i2.FileResponse?>); + returnValue: _i4.Future<_i2.FileResponse?>.value(), + ) as _i4.Future<_i2.FileResponse?>); @override - _i3.Future> openFiles( - String? arg_initialDirectory, - _i2.FileTypes? arg_allowedTypes, + _i4.Future> openFiles( + String? initialDirectory, + _i2.FileTypes? allowedTypes, ) => (super.noSuchMethod( Invocation.method( #openFiles, [ - arg_initialDirectory, - arg_allowedTypes, + initialDirectory, + allowedTypes, ], ), returnValue: - _i3.Future>.value(<_i2.FileResponse?>[]), - ) as _i3.Future>); + _i4.Future>.value(<_i2.FileResponse>[]), + ) as _i4.Future>); @override - _i3.Future getDirectoryPath(String? arg_initialDirectory) => + _i4.Future getDirectoryPath(String? initialDirectory) => (super.noSuchMethod( Invocation.method( #getDirectoryPath, - [arg_initialDirectory], + [initialDirectory], ), - returnValue: _i3.Future.value(), - ) as _i3.Future); + returnValue: _i4.Future.value(), + ) as _i4.Future); } diff --git a/packages/file_selector/file_selector_ios/CHANGELOG.md b/packages/file_selector/file_selector_ios/CHANGELOG.md index 360fe7782ea0..ea488f88a0b0 100644 --- a/packages/file_selector/file_selector_ios/CHANGELOG.md +++ b/packages/file_selector/file_selector_ios/CHANGELOG.md @@ -1,5 +1,6 @@ -## NEXT +## 0.5.3+1 +* Updates Pigeon for non-nullable collection type support. * Updates minimum supported SDK version to Flutter 3.19/Dart 3.3. ## 0.5.3 diff --git a/packages/file_selector/file_selector_ios/ios/file_selector_ios/Sources/file_selector_ios/FileSelectorPlugin.swift b/packages/file_selector/file_selector_ios/ios/file_selector_ios/Sources/file_selector_ios/FileSelectorPlugin.swift index f1f72cc2e281..35135ddc824e 100644 --- a/packages/file_selector/file_selector_ios/ios/file_selector_ios/Sources/file_selector_ios/FileSelectorPlugin.swift +++ b/packages/file_selector/file_selector_ios/ios/file_selector_ios/Sources/file_selector_ios/FileSelectorPlugin.swift @@ -59,8 +59,7 @@ public class FileSelectorPlugin: NSObject, FlutterPlugin, FileSelectorApi { let documentPicker = documentPickerViewControllerOverride ?? UIDocumentPickerViewController( - // See comment in messages.dart for why this is safe. - documentTypes: config.utis as! [String], + documentTypes: config.utis, in: .import) documentPicker.allowsMultipleSelection = config.allowMultiSelection documentPicker.delegate = completionBridge diff --git a/packages/file_selector/file_selector_ios/ios/file_selector_ios/Sources/file_selector_ios/messages.g.swift b/packages/file_selector/file_selector_ios/ios/file_selector_ios/Sources/file_selector_ios/messages.g.swift index 43f1bffeac8c..3d20e5a697b2 100644 --- a/packages/file_selector/file_selector_ios/ios/file_selector_ios/Sources/file_selector_ios/messages.g.swift +++ b/packages/file_selector/file_selector_ios/ios/file_selector_ios/Sources/file_selector_ios/messages.g.swift @@ -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 (v19.0.0), do not edit directly. +// Autogenerated from Pigeon (v22.4.1), do not edit directly. // See also: https://pub.dev/packages/pigeon import Foundation @@ -69,13 +69,13 @@ private func nilOrValue(_ value: Any?) -> T? { /// Generated class from Pigeon that represents data sent in messages. struct FileSelectorConfig { - var utis: [String?] + var utis: [String] var allowMultiSelection: Bool // swift-format-ignore: AlwaysUseLowerCamelCase - static func fromList(_ __pigeon_list: [Any?]) -> FileSelectorConfig? { - let utis = __pigeon_list[0] as! [String?] - let allowMultiSelection = __pigeon_list[1] as! Bool + static func fromList(_ pigeonVar_list: [Any?]) -> FileSelectorConfig? { + let utis = pigeonVar_list[0] as! [String] + let allowMultiSelection = pigeonVar_list[1] as! Bool return FileSelectorConfig( utis: utis, @@ -90,10 +90,10 @@ struct FileSelectorConfig { } } -private class FileSelectorApiCodecReader: FlutterStandardReader { +private class messagesPigeonCodecReader: FlutterStandardReader { override func readValue(ofType type: UInt8) -> Any? { switch type { - case 128: + case 129: return FileSelectorConfig.fromList(self.readValue() as! [Any?]) default: return super.readValue(ofType: type) @@ -101,10 +101,10 @@ private class FileSelectorApiCodecReader: FlutterStandardReader { } } -private class FileSelectorApiCodecWriter: FlutterStandardWriter { +private class messagesPigeonCodecWriter: FlutterStandardWriter { override func writeValue(_ value: Any) { if let value = value as? FileSelectorConfig { - super.writeByte(128) + super.writeByte(129) super.writeValue(value.toList()) } else { super.writeValue(value) @@ -112,18 +112,18 @@ private class FileSelectorApiCodecWriter: FlutterStandardWriter { } } -private class FileSelectorApiCodecReaderWriter: FlutterStandardReaderWriter { +private class messagesPigeonCodecReaderWriter: FlutterStandardReaderWriter { override func reader(with data: Data) -> FlutterStandardReader { - return FileSelectorApiCodecReader(data: data) + return messagesPigeonCodecReader(data: data) } override func writer(with data: NSMutableData) -> FlutterStandardWriter { - return FileSelectorApiCodecWriter(data: data) + return messagesPigeonCodecWriter(data: data) } } -class FileSelectorApiCodec: FlutterStandardMessageCodec { - static let shared = FileSelectorApiCodec(readerWriter: FileSelectorApiCodecReaderWriter()) +class messagesPigeonCodec: FlutterStandardMessageCodec, @unchecked Sendable { + static let shared = messagesPigeonCodec(readerWriter: messagesPigeonCodecReaderWriter()) } /// Generated protocol from Pigeon that represents a handler of messages from Flutter. @@ -133,8 +133,7 @@ protocol FileSelectorApi { /// Generated setup class from Pigeon to handle messages through the `binaryMessenger`. class FileSelectorApiSetup { - /// The codec used by FileSelectorApi. - static var codec: FlutterStandardMessageCodec { FileSelectorApiCodec.shared } + static var codec: FlutterStandardMessageCodec { messagesPigeonCodec.shared } /// Sets up an instance of `FileSelectorApi` to handle messages through the `binaryMessenger`. static func setUp( binaryMessenger: FlutterBinaryMessenger, api: FileSelectorApi?, diff --git a/packages/file_selector/file_selector_ios/lib/file_selector_ios.dart b/packages/file_selector/file_selector_ios/lib/file_selector_ios.dart index d0eb22762bc9..a1ee201937ad 100644 --- a/packages/file_selector/file_selector_ios/lib/file_selector_ios.dart +++ b/packages/file_selector/file_selector_ios/lib/file_selector_ios.dart @@ -21,9 +21,8 @@ class FileSelectorIOS extends FileSelectorPlatform { String? initialDirectory, String? confirmButtonText, }) async { - final List path = (await _hostApi.openFile(FileSelectorConfig( - utis: _allowedUtiListFromTypeGroups(acceptedTypeGroups)))) - .cast(); + final List path = await _hostApi.openFile(FileSelectorConfig( + utis: _allowedUtiListFromTypeGroups(acceptedTypeGroups))); return path.isEmpty ? null : XFile(path.first); } @@ -33,10 +32,9 @@ class FileSelectorIOS extends FileSelectorPlatform { String? initialDirectory, String? confirmButtonText, }) async { - final List pathList = (await _hostApi.openFile(FileSelectorConfig( - utis: _allowedUtiListFromTypeGroups(acceptedTypeGroups), - allowMultiSelection: true))) - .cast(); + final List pathList = await _hostApi.openFile(FileSelectorConfig( + utis: _allowedUtiListFromTypeGroups(acceptedTypeGroups), + allowMultiSelection: true)); return pathList.map((String path) => XFile(path)).toList(); } diff --git a/packages/file_selector/file_selector_ios/lib/src/messages.g.dart b/packages/file_selector/file_selector_ios/lib/src/messages.g.dart index e86dd9c90572..c9c8d6cdbc4d 100644 --- a/packages/file_selector/file_selector_ios/lib/src/messages.g.dart +++ b/packages/file_selector/file_selector_ios/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 (v19.0.0), do not edit directly. +// Autogenerated from Pigeon (v22.4.1), 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, no_leading_underscores_for_local_identifiers @@ -31,11 +31,11 @@ List wrapResponse( class FileSelectorConfig { FileSelectorConfig({ - this.utis = const [], + this.utis = const [], this.allowMultiSelection = false, }); - List utis; + List utis; bool allowMultiSelection; @@ -49,18 +49,21 @@ class FileSelectorConfig { static FileSelectorConfig decode(Object result) { result as List; return FileSelectorConfig( - utis: (result[0] as List?)!.cast(), + utis: (result[0] as List?)!.cast(), allowMultiSelection: result[1]! as bool, ); } } -class _FileSelectorApiCodec extends StandardMessageCodec { - const _FileSelectorApiCodec(); +class _PigeonCodec extends StandardMessageCodec { + const _PigeonCodec(); @override void writeValue(WriteBuffer buffer, Object? value) { - if (value is FileSelectorConfig) { - buffer.putUint8(128); + if (value is int) { + buffer.putUint8(4); + buffer.putInt64(value); + } else if (value is FileSelectorConfig) { + buffer.putUint8(129); writeValue(buffer, value.encode()); } else { super.writeValue(buffer, value); @@ -70,7 +73,7 @@ class _FileSelectorApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 129: return FileSelectorConfig.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -84,42 +87,41 @@ class FileSelectorApi { /// BinaryMessenger will be used which routes to the host platform. FileSelectorApi( {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) - : __pigeon_binaryMessenger = binaryMessenger, - __pigeon_messageChannelSuffix = + : pigeonVar_binaryMessenger = binaryMessenger, + pigeonVar_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; - final BinaryMessenger? __pigeon_binaryMessenger; + final BinaryMessenger? pigeonVar_binaryMessenger; - static const MessageCodec pigeonChannelCodec = - _FileSelectorApiCodec(); + static const MessageCodec pigeonChannelCodec = _PigeonCodec(); - final String __pigeon_messageChannelSuffix; + final String pigeonVar_messageChannelSuffix; - Future> openFile(FileSelectorConfig config) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.file_selector_ios.FileSelectorApi.openFile$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + Future> openFile(FileSelectorConfig config) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.file_selector_ios.FileSelectorApi.openFile$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([config]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([config]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as List?)!.cast(); + return (pigeonVar_replyList[0] as List?)!.cast(); } } } diff --git a/packages/file_selector/file_selector_ios/pigeons/messages.dart b/packages/file_selector/file_selector_ios/pigeons/messages.dart index a793a2af5a98..ade4b17835c4 100644 --- a/packages/file_selector/file_selector_ios/pigeons/messages.dart +++ b/packages/file_selector/file_selector_ios/pigeons/messages.dart @@ -12,11 +12,8 @@ import 'package:pigeon/pigeon.dart'; )) class FileSelectorConfig { FileSelectorConfig( - {this.utis = const [], this.allowMultiSelection = false}); - // TODO(stuartmorgan): Declare these as non-nullable generics once - // https://github.com/flutter/flutter/issues/97848 is fixed. In practice, - // the values will never be null, and the native implementation assumes that. - List utis; + {this.utis = const [], this.allowMultiSelection = false}); + List utis; bool allowMultiSelection; } diff --git a/packages/file_selector/file_selector_ios/pubspec.yaml b/packages/file_selector/file_selector_ios/pubspec.yaml index 63af5b576459..d86a09d9d7fd 100644 --- a/packages/file_selector/file_selector_ios/pubspec.yaml +++ b/packages/file_selector/file_selector_ios/pubspec.yaml @@ -2,7 +2,7 @@ name: file_selector_ios description: iOS implementation of the file_selector plugin. repository: https://github.com/flutter/packages/tree/main/packages/file_selector/file_selector_ios issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+file_selector%22 -version: 0.5.3 +version: 0.5.3+1 environment: sdk: ^3.3.0 @@ -25,8 +25,8 @@ dev_dependencies: build_runner: ^2.3.0 flutter_test: sdk: flutter - mockito: 5.4.4 - pigeon: ^19.0.0 + mockito: ^5.4.4 + pigeon: ^22.4.1 topics: - files 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 f39e0ff4b618..713bd3f29ba5 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 @@ -33,12 +33,12 @@ class MockTestFileSelectorApi extends _i1.Mock } @override - _i3.Future> openFile(_i4.FileSelectorConfig? config) => + _i3.Future> openFile(_i4.FileSelectorConfig? config) => (super.noSuchMethod( Invocation.method( #openFile, [config], ), - returnValue: _i3.Future>.value([]), - ) as _i3.Future>); + returnValue: _i3.Future>.value([]), + ) as _i3.Future>); } diff --git a/packages/file_selector/file_selector_ios/test/test_api.g.dart b/packages/file_selector/file_selector_ios/test/test_api.g.dart index db24932f71a3..fbe4e1acd920 100644 --- a/packages/file_selector/file_selector_ios/test/test_api.g.dart +++ b/packages/file_selector/file_selector_ios/test/test_api.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 (v19.0.0), do not edit directly. +// Autogenerated from Pigeon (v22.4.1), 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, unnecessary_import, no_leading_underscores_for_local_identifiers // ignore_for_file: avoid_relative_lib_imports @@ -13,12 +13,15 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:file_selector_ios/src/messages.g.dart'; -class _TestFileSelectorApiCodec extends StandardMessageCodec { - const _TestFileSelectorApiCodec(); +class _PigeonCodec extends StandardMessageCodec { + const _PigeonCodec(); @override void writeValue(WriteBuffer buffer, Object? value) { - if (value is FileSelectorConfig) { - buffer.putUint8(128); + if (value is int) { + buffer.putUint8(4); + buffer.putInt64(value); + } else if (value is FileSelectorConfig) { + buffer.putUint8(129); writeValue(buffer, value.encode()); } else { super.writeValue(buffer, value); @@ -28,7 +31,7 @@ class _TestFileSelectorApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 129: return FileSelectorConfig.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -39,10 +42,9 @@ class _TestFileSelectorApiCodec extends StandardMessageCodec { abstract class TestFileSelectorApi { static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; - static const MessageCodec pigeonChannelCodec = - _TestFileSelectorApiCodec(); + static const MessageCodec pigeonChannelCodec = _PigeonCodec(); - Future> openFile(FileSelectorConfig config); + Future> openFile(FileSelectorConfig config); static void setUp( TestFileSelectorApi? api, { @@ -52,17 +54,18 @@ abstract class TestFileSelectorApi { messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.file_selector_ios.FileSelectorApi.openFile$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.file_selector_ios.FileSelectorApi.openFile was null.'); @@ -72,7 +75,7 @@ abstract class TestFileSelectorApi { assert(arg_config != null, 'Argument for dev.flutter.pigeon.file_selector_ios.FileSelectorApi.openFile was null, expected non-null FileSelectorConfig.'); try { - final List output = await api.openFile(arg_config!); + final List output = await api.openFile(arg_config!); return [output]; } on PlatformException catch (e) { return wrapResponse(error: e); diff --git a/packages/file_selector/file_selector_linux/CHANGELOG.md b/packages/file_selector/file_selector_linux/CHANGELOG.md index 9934d46c0575..74a5f6edc7d2 100644 --- a/packages/file_selector/file_selector_linux/CHANGELOG.md +++ b/packages/file_selector/file_selector_linux/CHANGELOG.md @@ -1,5 +1,6 @@ -## NEXT +## 0.9.3 +* Updates method channel implementation to use Pigeon. * Updates minimum supported SDK version to Flutter 3.19/Dart 3.3. ## 0.9.2+1 diff --git a/packages/file_selector/file_selector_linux/lib/file_selector_linux.dart b/packages/file_selector/file_selector_linux/lib/file_selector_linux.dart index b06523b27d32..3a05243c3110 100644 --- a/packages/file_selector/file_selector_linux/lib/file_selector_linux.dart +++ b/packages/file_selector/file_selector_linux/lib/file_selector_linux.dart @@ -4,30 +4,17 @@ import 'package:file_selector_platform_interface/file_selector_platform_interface.dart'; import 'package:flutter/foundation.dart' show visibleForTesting; -import 'package:flutter/services.dart'; -const MethodChannel _channel = - MethodChannel('plugins.flutter.dev/file_selector_linux'); - -const String _typeGroupLabelKey = 'label'; -const String _typeGroupExtensionsKey = 'extensions'; -const String _typeGroupMimeTypesKey = 'mimeTypes'; - -const String _openFileMethod = 'openFile'; -const String _getSavePathMethod = 'getSavePath'; -const String _getDirectoryPathMethod = 'getDirectoryPath'; - -const String _acceptedTypeGroupsKey = 'acceptedTypeGroups'; -const String _confirmButtonTextKey = 'confirmButtonText'; -const String _initialDirectoryKey = 'initialDirectory'; -const String _multipleKey = 'multiple'; -const String _suggestedNameKey = 'suggestedName'; +import 'src/messages.g.dart'; /// An implementation of [FileSelectorPlatform] for Linux. class FileSelectorLinux extends FileSelectorPlatform { - /// The MethodChannel that is being used by this implementation of the plugin. - @visibleForTesting - MethodChannel get channel => _channel; + /// Creates a new plugin implementation instance. + FileSelectorLinux({ + @visibleForTesting FileSelectorApi? api, + }) : _hostApi = api ?? FileSelectorApi(); + + final FileSelectorApi _hostApi; /// Registers the Linux implementation. static void registerWith() { @@ -40,19 +27,16 @@ class FileSelectorLinux extends FileSelectorPlatform { String? initialDirectory, String? confirmButtonText, }) async { - final List> serializedTypeGroups = - _serializeTypeGroups(acceptedTypeGroups); - final List? path = await _channel.invokeListMethod( - _openFileMethod, - { - if (serializedTypeGroups.isNotEmpty) - _acceptedTypeGroupsKey: serializedTypeGroups, - 'initialDirectory': initialDirectory, - _confirmButtonTextKey: confirmButtonText, - _multipleKey: false, - }, - ); - return path == null ? null : XFile(path.first); + final List paths = await _hostApi.showFileChooser( + PlatformFileChooserActionType.open, + PlatformFileChooserOptions( + allowedFileTypes: + _platformTypeGroupsFromXTypeGroups(acceptedTypeGroups), + currentFolderPath: initialDirectory, + acceptButtonLabel: confirmButtonText, + selectMultiple: false, + )); + return paths.isEmpty ? null : XFile(paths.first); } @override @@ -61,19 +45,16 @@ class FileSelectorLinux extends FileSelectorPlatform { String? initialDirectory, String? confirmButtonText, }) async { - final List> serializedTypeGroups = - _serializeTypeGroups(acceptedTypeGroups); - final List? pathList = await _channel.invokeListMethod( - _openFileMethod, - { - if (serializedTypeGroups.isNotEmpty) - _acceptedTypeGroupsKey: serializedTypeGroups, - _initialDirectoryKey: initialDirectory, - _confirmButtonTextKey: confirmButtonText, - _multipleKey: true, - }, - ); - return pathList?.map((String path) => XFile(path)).toList() ?? []; + final List paths = await _hostApi.showFileChooser( + PlatformFileChooserActionType.open, + PlatformFileChooserOptions( + allowedFileTypes: + _platformTypeGroupsFromXTypeGroups(acceptedTypeGroups), + currentFolderPath: initialDirectory, + acceptButtonLabel: confirmButtonText, + selectMultiple: true, + )); + return paths.map((String path) => XFile(path)).toList(); } @override @@ -98,21 +79,18 @@ class FileSelectorLinux extends FileSelectorPlatform { List? acceptedTypeGroups, SaveDialogOptions options = const SaveDialogOptions(), }) async { - final List> serializedTypeGroups = - _serializeTypeGroups(acceptedTypeGroups); // TODO(stuartmorgan): Add the selected type group here and return it. See // https://github.com/flutter/flutter/issues/107093 - final String? path = await _channel.invokeMethod( - _getSavePathMethod, - { - if (serializedTypeGroups.isNotEmpty) - _acceptedTypeGroupsKey: serializedTypeGroups, - _initialDirectoryKey: options.initialDirectory, - _suggestedNameKey: options.suggestedName, - _confirmButtonTextKey: options.confirmButtonText, - }, - ); - return path == null ? null : FileSaveLocation(path); + final List paths = await _hostApi.showFileChooser( + PlatformFileChooserActionType.save, + PlatformFileChooserOptions( + allowedFileTypes: + _platformTypeGroupsFromXTypeGroups(acceptedTypeGroups), + currentFolderPath: options.initialDirectory, + currentName: options.suggestedName, + acceptButtonLabel: options.confirmButtonText, + )); + return paths.isEmpty ? null : FileSaveLocation(paths.first); } @override @@ -120,12 +98,14 @@ class FileSelectorLinux extends FileSelectorPlatform { String? initialDirectory, String? confirmButtonText, }) async { - final List? path = await _channel - .invokeListMethod(_getDirectoryPathMethod, { - _initialDirectoryKey: initialDirectory, - _confirmButtonTextKey: confirmButtonText, - }); - return path?.first; + final List paths = await _hostApi.showFileChooser( + PlatformFileChooserActionType.chooseDirectory, + PlatformFileChooserOptions( + currentFolderPath: initialDirectory, + acceptButtonLabel: confirmButtonText, + selectMultiple: false, + )); + return paths.isEmpty ? null : paths.first; } @override @@ -133,43 +113,42 @@ class FileSelectorLinux extends FileSelectorPlatform { String? initialDirectory, String? confirmButtonText, }) async { - final List? pathList = await _channel - .invokeListMethod(_getDirectoryPathMethod, { - _initialDirectoryKey: initialDirectory, - _confirmButtonTextKey: confirmButtonText, - _multipleKey: true, - }); - return pathList ?? []; + return _hostApi.showFileChooser( + PlatformFileChooserActionType.chooseDirectory, + PlatformFileChooserOptions( + currentFolderPath: initialDirectory, + acceptButtonLabel: confirmButtonText, + selectMultiple: true, + )); } } -List> _serializeTypeGroups(List? groups) { - return (groups ?? []).map(_serializeTypeGroup).toList(); +List? _platformTypeGroupsFromXTypeGroups( + List? groups) { + return groups?.map(_platformTypeGroupFromXTypeGroup).toList(); } -Map _serializeTypeGroup(XTypeGroup group) { - final Map serialization = { - _typeGroupLabelKey: group.label ?? '', - }; +PlatformTypeGroup _platformTypeGroupFromXTypeGroup(XTypeGroup group) { + final String label = group.label ?? ''; if (group.allowsAny) { - serialization[_typeGroupExtensionsKey] = ['*']; - } else { - if ((group.extensions?.isEmpty ?? true) && - (group.mimeTypes?.isEmpty ?? true)) { - throw ArgumentError('Provided type group $group does not allow ' - 'all files, but does not set any of the Linux-supported filter ' - 'categories. "extensions" or "mimeTypes" must be non-empty for Linux ' - 'if anything is non-empty.'); - } - if (group.extensions?.isNotEmpty ?? false) { - serialization[_typeGroupExtensionsKey] = group.extensions + return PlatformTypeGroup( + label: label, + extensions: ['*'], + ); + } + if ((group.extensions?.isEmpty ?? true) && + (group.mimeTypes?.isEmpty ?? true)) { + throw ArgumentError('Provided type group $group does not allow ' + 'all files, but does not set any of the Linux-supported filter ' + 'categories. "extensions" or "mimeTypes" must be non-empty for Linux ' + 'if anything is non-empty.'); + } + return PlatformTypeGroup( + label: label, + // Covert to GtkFileFilter's *. format. + extensions: group.extensions ?.map((String extension) => '*.$extension') .toList() ?? - []; - } - if (group.mimeTypes?.isNotEmpty ?? false) { - serialization[_typeGroupMimeTypesKey] = group.mimeTypes ?? []; - } - } - return serialization; + [], + mimeTypes: group.mimeTypes ?? []); } diff --git a/packages/file_selector/file_selector_linux/lib/src/messages.g.dart b/packages/file_selector/file_selector_linux/lib/src/messages.g.dart new file mode 100644 index 000000000000..7a91c769716b --- /dev/null +++ b/packages/file_selector/file_selector_linux/lib/src/messages.g.dart @@ -0,0 +1,195 @@ +// 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 (v22.4.1), 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, no_leading_underscores_for_local_identifiers + +import 'dart:async'; +import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List; + +import 'package:flutter/foundation.dart' show ReadBuffer, WriteBuffer; +import 'package:flutter/services.dart'; + +PlatformException _createConnectionError(String channelName) { + return PlatformException( + code: 'channel-error', + message: 'Unable to establish connection on channel: "$channelName".', + ); +} + +/// A Pigeon representation of the GTK_FILE_CHOOSER_ACTION_* options. +enum PlatformFileChooserActionType { + open, + chooseDirectory, + save, +} + +/// A Pigeon representation of the Linux portion of an `XTypeGroup`. +class PlatformTypeGroup { + PlatformTypeGroup({ + this.label = '', + this.extensions = const [], + this.mimeTypes = const [], + }); + + String label; + + List extensions; + + List mimeTypes; + + Object encode() { + return [ + label, + extensions, + mimeTypes, + ]; + } + + static PlatformTypeGroup decode(Object result) { + result as List; + return PlatformTypeGroup( + label: result[0]! as String, + extensions: (result[1] as List?)!.cast(), + mimeTypes: (result[2] as List?)!.cast(), + ); + } +} + +/// Options for GKT file chooser. +/// +/// These correspond to gtk_file_chooser_set_* options. +class PlatformFileChooserOptions { + PlatformFileChooserOptions({ + this.allowedFileTypes, + this.currentFolderPath, + this.currentName, + this.acceptButtonLabel, + this.selectMultiple, + }); + + List? allowedFileTypes; + + String? currentFolderPath; + + String? currentName; + + String? acceptButtonLabel; + + /// Whether to allow multiple file selection. + /// + /// Nullable because it does not apply to the "save" action. + bool? selectMultiple; + + Object encode() { + return [ + allowedFileTypes, + currentFolderPath, + currentName, + acceptButtonLabel, + selectMultiple, + ]; + } + + static PlatformFileChooserOptions decode(Object result) { + result as List; + return PlatformFileChooserOptions( + allowedFileTypes: + (result[0] as List?)?.cast(), + currentFolderPath: result[1] as String?, + currentName: result[2] as String?, + acceptButtonLabel: result[3] as String?, + selectMultiple: result[4] as bool?, + ); + } +} + +class _PigeonCodec extends StandardMessageCodec { + const _PigeonCodec(); + @override + void writeValue(WriteBuffer buffer, Object? value) { + if (value is int) { + buffer.putUint8(4); + buffer.putInt64(value); + } else if (value is PlatformFileChooserActionType) { + buffer.putUint8(129); + writeValue(buffer, value.index); + } else if (value is PlatformTypeGroup) { + buffer.putUint8(130); + writeValue(buffer, value.encode()); + } else if (value is PlatformFileChooserOptions) { + buffer.putUint8(131); + writeValue(buffer, value.encode()); + } else { + super.writeValue(buffer, value); + } + } + + @override + Object? readValueOfType(int type, ReadBuffer buffer) { + switch (type) { + case 129: + final int? value = readValue(buffer) as int?; + return value == null + ? null + : PlatformFileChooserActionType.values[value]; + case 130: + return PlatformTypeGroup.decode(readValue(buffer)!); + case 131: + return PlatformFileChooserOptions.decode(readValue(buffer)!); + default: + return super.readValueOfType(type, buffer); + } + } +} + +class FileSelectorApi { + /// Constructor for [FileSelectorApi]. The [binaryMessenger] named argument is + /// available for dependency injection. If it is left null, the default + /// BinaryMessenger will be used which routes to the host platform. + FileSelectorApi( + {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) + : pigeonVar_binaryMessenger = binaryMessenger, + pigeonVar_messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + final BinaryMessenger? pigeonVar_binaryMessenger; + + static const MessageCodec pigeonChannelCodec = _PigeonCodec(); + + final String pigeonVar_messageChannelSuffix; + + /// Shows an file chooser with the given [type] and [options], returning the + /// list of selected paths. + /// + /// An empty list corresponds to a cancelled selection. + Future> showFileChooser(PlatformFileChooserActionType type, + PlatformFileChooserOptions options) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.file_selector_linux.FileSelectorApi.showFileChooser$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = await pigeonVar_channel + .send([type, options]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } else { + return (pigeonVar_replyList[0] as List?)!.cast(); + } + } +} diff --git a/packages/file_selector/file_selector_linux/linux/CMakeLists.txt b/packages/file_selector/file_selector_linux/linux/CMakeLists.txt index 1b1af0790de7..148819dc3c5d 100644 --- a/packages/file_selector/file_selector_linux/linux/CMakeLists.txt +++ b/packages/file_selector/file_selector_linux/linux/CMakeLists.txt @@ -8,10 +8,11 @@ set(PLUGIN_NAME "${PROJECT_NAME}_plugin") list(APPEND PLUGIN_SOURCES "file_selector_plugin.cc" + "messages.g.cc" ) add_library(${PLUGIN_NAME} SHARED - "file_selector_plugin.cc" + ${PLUGIN_SOURCES} ) apply_standard_settings(${PLUGIN_NAME}) set_target_properties(${PLUGIN_NAME} PROPERTIES diff --git a/packages/file_selector/file_selector_linux/linux/file_selector_plugin.cc b/packages/file_selector/file_selector_linux/linux/file_selector_plugin.cc index 5a8cc2132595..db27d38c80c2 100644 --- a/packages/file_selector/file_selector_linux/linux/file_selector_plugin.cc +++ b/packages/file_selector/file_selector_linux/linux/file_selector_plugin.cc @@ -8,25 +8,9 @@ #include #include "file_selector_plugin_private.h" +#include "messages.g.h" -// From file_selector_linux.dart -const char kChannelName[] = "plugins.flutter.dev/file_selector_linux"; - -const char kOpenFileMethod[] = "openFile"; -const char kGetSavePathMethod[] = "getSavePath"; -const char kGetDirectoryPathMethod[] = "getDirectoryPath"; - -const char kAcceptedTypeGroupsKey[] = "acceptedTypeGroups"; -const char kConfirmButtonTextKey[] = "confirmButtonText"; -const char kInitialDirectoryKey[] = "initialDirectory"; -const char kMultipleKey[] = "multiple"; -const char kSuggestedNameKey[] = "suggestedName"; - -const char kTypeGroupLabelKey[] = "label"; -const char kTypeGroupExtensionsKey[] = "extensions"; -const char kTypeGroupMimeTypesKey[] = "mimeTypes"; - -// Errors +// Error codes. const char kBadArgumentsError[] = "Bad Arguments"; const char kNoScreenError[] = "No Screen"; @@ -34,39 +18,28 @@ struct _FlFileSelectorPlugin { GObject parent_instance; FlPluginRegistrar* registrar; - - // Connection to Flutter engine. - FlMethodChannel* channel; }; G_DEFINE_TYPE(FlFileSelectorPlugin, fl_file_selector_plugin, G_TYPE_OBJECT) // Converts a type group received from Flutter into a GTK file filter. -static GtkFileFilter* type_group_to_filter(FlValue* value) { +static GtkFileFilter* type_group_to_filter(FfsPlatformTypeGroup* group) { g_autoptr(GtkFileFilter) filter = gtk_file_filter_new(); - FlValue* label = fl_value_lookup_string(value, kTypeGroupLabelKey); - if (label != nullptr && fl_value_get_type(label) == FL_VALUE_TYPE_STRING) { - gtk_file_filter_set_name(filter, fl_value_get_string(label)); - } + const gchar* label = ffs_platform_type_group_get_label(group); + gtk_file_filter_set_name(filter, label); - FlValue* extensions = fl_value_lookup_string(value, kTypeGroupExtensionsKey); - if (extensions != nullptr && - fl_value_get_type(extensions) == FL_VALUE_TYPE_LIST) { - for (size_t i = 0; i < fl_value_get_length(extensions); i++) { - FlValue* v = fl_value_get_list_value(extensions, i); - const gchar* pattern = fl_value_get_string(v); - gtk_file_filter_add_pattern(filter, pattern); - } + FlValue* extensions = ffs_platform_type_group_get_extensions(group); + for (size_t i = 0; i < fl_value_get_length(extensions); i++) { + FlValue* v = fl_value_get_list_value(extensions, i); + const gchar* pattern = fl_value_get_string(v); + gtk_file_filter_add_pattern(filter, pattern); } - FlValue* mime_types = fl_value_lookup_string(value, kTypeGroupMimeTypesKey); - if (mime_types != nullptr && - fl_value_get_type(mime_types) == FL_VALUE_TYPE_LIST) { - for (size_t i = 0; i < fl_value_get_length(mime_types); i++) { - FlValue* v = fl_value_get_list_value(mime_types, i); - const gchar* pattern = fl_value_get_string(v); - gtk_file_filter_add_mime_type(filter, pattern); - } + FlValue* mime_types = ffs_platform_type_group_get_mime_types(group); + for (size_t i = 0; i < fl_value_get_length(mime_types); i++) { + FlValue* v = fl_value_get_list_value(mime_types, i); + const gchar* pattern = fl_value_get_string(v); + gtk_file_filter_add_mime_type(filter, pattern); } return GTK_FILE_FILTER(g_object_ref(filter)); @@ -75,39 +48,45 @@ static GtkFileFilter* type_group_to_filter(FlValue* value) { // Creates a GtkFileChooserNative for the given method call details. static GtkFileChooserNative* create_dialog( GtkWindow* window, GtkFileChooserAction action, const gchar* title, - const gchar* default_confirm_button_text, FlValue* properties) { - const gchar* confirm_button_text = default_confirm_button_text; - FlValue* value = fl_value_lookup_string(properties, kConfirmButtonTextKey); - if (value != nullptr && fl_value_get_type(value) == FL_VALUE_TYPE_STRING) - confirm_button_text = fl_value_get_string(value); + const gchar* default_confirm_button_text, + FfsPlatformFileChooserOptions* options) { + const gchar* confirm_button_text = + ffs_platform_file_chooser_options_get_accept_button_label(options); + if (confirm_button_text == nullptr) { + confirm_button_text = default_confirm_button_text; + } g_autoptr(GtkFileChooserNative) dialog = GTK_FILE_CHOOSER_NATIVE(gtk_file_chooser_native_new( title, window, action, confirm_button_text, "_Cancel")); - value = fl_value_lookup_string(properties, kMultipleKey); - if (value != nullptr && fl_value_get_type(value) == FL_VALUE_TYPE_BOOL) { + const gboolean* select_multiple = + ffs_platform_file_chooser_options_get_select_multiple(options); + if (select_multiple != nullptr) { gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dialog), - fl_value_get_bool(value)); + *select_multiple); } - value = fl_value_lookup_string(properties, kInitialDirectoryKey); - if (value != nullptr && fl_value_get_type(value) == FL_VALUE_TYPE_STRING) { + const gchar* current_folder = + ffs_platform_file_chooser_options_get_current_folder_path(options); + if (current_folder != nullptr) { gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(dialog), - fl_value_get_string(value)); + current_folder); } - value = fl_value_lookup_string(properties, kSuggestedNameKey); - if (value != nullptr && fl_value_get_type(value) == FL_VALUE_TYPE_STRING) { - gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(dialog), - fl_value_get_string(value)); + const gchar* current_name = + ffs_platform_file_chooser_options_get_current_name(options); + if (current_name != nullptr) { + gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(dialog), current_name); } - value = fl_value_lookup_string(properties, kAcceptedTypeGroupsKey); - if (value != nullptr && fl_value_get_type(value) == FL_VALUE_TYPE_LIST) { - for (size_t i = 0; i < fl_value_get_length(value); i++) { - FlValue* type_group = fl_value_get_list_value(value, i); - GtkFileFilter* filter = type_group_to_filter(type_group); + FlValue* type_groups = + ffs_platform_file_chooser_options_get_allowed_file_types(options); + if (type_groups != nullptr) { + for (size_t i = 0; i < fl_value_get_length(type_groups); i++) { + FlValue* type_group = fl_value_get_list_value(type_groups, i); + GtkFileFilter* filter = type_group_to_filter(FFS_PLATFORM_TYPE_GROUP( + fl_value_get_custom_value_object(type_group))); if (filter == nullptr) { return nullptr; } @@ -118,99 +97,65 @@ static GtkFileChooserNative* create_dialog( return GTK_FILE_CHOOSER_NATIVE(g_object_ref(dialog)); } -// TODO(stuartmorgan): Move this logic back into method_call_cb once -// https://github.com/flutter/flutter/issues/88724 is fixed, and test -// through the public API instead. This only exists to move as much -// logic as possible behind the private entry point used by unit tests. -GtkFileChooserNative* create_dialog_for_method(GtkWindow* window, - const gchar* method, - FlValue* properties) { - if (strcmp(method, kOpenFileMethod) == 0) { - return create_dialog(window, GTK_FILE_CHOOSER_ACTION_OPEN, "Open File", - "_Open", properties); - } else if (strcmp(method, kGetDirectoryPathMethod) == 0) { - return create_dialog(window, GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER, - "Choose Directory", "_Open", properties); - } else if (strcmp(method, kGetSavePathMethod) == 0) { - return create_dialog(window, GTK_FILE_CHOOSER_ACTION_SAVE, "Save File", - "_Save", properties); +GtkFileChooserNative* create_dialog_of_type( + GtkWindow* window, FfsPlatformFileChooserActionType type, + FfsPlatformFileChooserOptions* options) { + switch (type) { + case FILE_SELECTOR_LINUX_PLATFORM_FILE_CHOOSER_ACTION_TYPE_OPEN: + return create_dialog(window, GTK_FILE_CHOOSER_ACTION_OPEN, "Open File", + "_Open", options); + case FILE_SELECTOR_LINUX_PLATFORM_FILE_CHOOSER_ACTION_TYPE_CHOOSE_DIRECTORY: + return create_dialog(window, GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER, + "Choose Directory", "_Open", options); + case FILE_SELECTOR_LINUX_PLATFORM_FILE_CHOOSER_ACTION_TYPE_SAVE: + return create_dialog(window, GTK_FILE_CHOOSER_ACTION_SAVE, "Save File", + "_Save", options); } return nullptr; } // Shows the requested dialog type. -static FlMethodResponse* show_dialog(FlFileSelectorPlugin* self, - const gchar* method, FlValue* properties, - bool return_list) { - if (fl_value_get_type(properties) != FL_VALUE_TYPE_MAP) { - return FL_METHOD_RESPONSE(fl_method_error_response_new( - kBadArgumentsError, "Argument map missing or malformed", nullptr)); - } +static FfsFileSelectorApiShowFileChooserResponse* handle_show_file_chooser( + FfsPlatformFileChooserActionType type, + FfsPlatformFileChooserOptions* options, gpointer user_data) { + FlFileSelectorPlugin* self = FL_FILE_SELECTOR_PLUGIN(user_data); FlView* view = fl_plugin_registrar_get_view(self->registrar); if (view == nullptr) { - return FL_METHOD_RESPONSE( - fl_method_error_response_new(kNoScreenError, nullptr, nullptr)); + return ffs_file_selector_api_show_file_chooser_response_new_error( + kNoScreenError, nullptr, nullptr); } GtkWindow* window = GTK_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(view))); g_autoptr(GtkFileChooserNative) dialog = - create_dialog_for_method(window, method, properties); + create_dialog_of_type(window, type, options); if (dialog == nullptr) { - return FL_METHOD_RESPONSE(fl_method_error_response_new( - kBadArgumentsError, "Unable to create dialog from arguments", nullptr)); + return ffs_file_selector_api_show_file_chooser_response_new_error( + kBadArgumentsError, "Unable to create dialog from arguments", nullptr); } gint response = gtk_native_dialog_run(GTK_NATIVE_DIALOG(dialog)); g_autoptr(FlValue) result = nullptr; if (response == GTK_RESPONSE_ACCEPT) { - if (return_list) { - result = fl_value_new_list(); - g_autoptr(GSList) filenames = - gtk_file_chooser_get_filenames(GTK_FILE_CHOOSER(dialog)); - for (GSList* link = filenames; link != nullptr; link = link->next) { - g_autofree gchar* filename = static_cast(link->data); - fl_value_append_take(result, fl_value_new_string(filename)); - } - } else { - g_autofree gchar* filename = - gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog)); - result = fl_value_new_string(filename); + result = fl_value_new_list(); + g_autoptr(GSList) filenames = + gtk_file_chooser_get_filenames(GTK_FILE_CHOOSER(dialog)); + for (GSList* link = filenames; link != nullptr; link = link->next) { + g_autofree gchar* filename = static_cast(link->data); + fl_value_append_take(result, fl_value_new_string(filename)); } } - return FL_METHOD_RESPONSE(fl_method_success_response_new(result)); -} - -// Called when a method call is received from Flutter. -static void method_call_cb(FlMethodChannel* channel, FlMethodCall* method_call, - gpointer user_data) { - FlFileSelectorPlugin* self = FL_FILE_SELECTOR_PLUGIN(user_data); - - const gchar* method = fl_method_call_get_name(method_call); - FlValue* args = fl_method_call_get_args(method_call); - - g_autoptr(FlMethodResponse) response = nullptr; - if (strcmp(method, kOpenFileMethod) == 0 || - strcmp(method, kGetDirectoryPathMethod) == 0) { - response = show_dialog(self, method, args, true); - } else if (strcmp(method, kGetSavePathMethod) == 0) { - response = show_dialog(self, method, args, false); - } else { - response = FL_METHOD_RESPONSE(fl_method_not_implemented_response_new()); - } - - g_autoptr(GError) error = nullptr; - if (!fl_method_call_respond(method_call, response, &error)) - g_warning("Failed to send method call response: %s", error->message); + return ffs_file_selector_api_show_file_chooser_response_new(result); } static void fl_file_selector_plugin_dispose(GObject* object) { FlFileSelectorPlugin* self = FL_FILE_SELECTOR_PLUGIN(object); + ffs_file_selector_api_clear_method_handlers( + fl_plugin_registrar_get_messenger(self->registrar), nullptr); g_clear_object(&self->registrar); - g_clear_object(&self->channel); G_OBJECT_CLASS(fl_file_selector_plugin_parent_class)->dispose(object); } @@ -229,12 +174,12 @@ FlFileSelectorPlugin* fl_file_selector_plugin_new( self->registrar = FL_PLUGIN_REGISTRAR(g_object_ref(registrar)); - g_autoptr(FlStandardMethodCodec) codec = fl_standard_method_codec_new(); - self->channel = - fl_method_channel_new(fl_plugin_registrar_get_messenger(registrar), - kChannelName, FL_METHOD_CODEC(codec)); - fl_method_channel_set_method_call_handler(self->channel, method_call_cb, - g_object_ref(self), g_object_unref); + static FfsFileSelectorApiVTable api_vtable = { + .show_file_chooser = handle_show_file_chooser, + }; + ffs_file_selector_api_set_method_handlers( + fl_plugin_registrar_get_messenger(registrar), nullptr, &api_vtable, + g_object_ref(self), g_object_unref); return self; } diff --git a/packages/file_selector/file_selector_linux/linux/file_selector_plugin_private.h b/packages/file_selector/file_selector_linux/linux/file_selector_plugin_private.h index e58a78ccda37..d8ee91bdd8a7 100644 --- a/packages/file_selector/file_selector_linux/linux/file_selector_plugin_private.h +++ b/packages/file_selector/file_selector_linux/linux/file_selector_plugin_private.h @@ -5,8 +5,15 @@ #include #include "include/file_selector_linux/file_selector_plugin.h" +#include "messages.g.h" // Creates a GtkFileChooserNative for the given method call. -GtkFileChooserNative* create_dialog_for_method(GtkWindow* window, - const gchar* method, - FlValue* properties); +// +// TODO(stuartmorgan): Make this private/static once the tests are restructured +// as descibed in the file_selector_plugin_test.cc TODOs, and then test through +// the Pigeon API handler instead (making that non-static). This only exists to +// move as much logic as possible behind an entry point currently callable by +// unit tests. +GtkFileChooserNative* create_dialog_of_type( + GtkWindow* window, FfsPlatformFileChooserActionType type, + FfsPlatformFileChooserOptions* options); diff --git a/packages/file_selector/file_selector_linux/linux/messages.g.cc b/packages/file_selector/file_selector_linux/linux/messages.g.cc new file mode 100644 index 000000000000..cdcc18b27a26 --- /dev/null +++ b/packages/file_selector/file_selector_linux/linux/messages.g.cc @@ -0,0 +1,545 @@ +// 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 (v22.4.1), do not edit directly. +// See also: https://pub.dev/packages/pigeon + +#include "messages.g.h" + +struct _FfsPlatformTypeGroup { + GObject parent_instance; + + gchar* label; + FlValue* extensions; + FlValue* mime_types; +}; + +G_DEFINE_TYPE(FfsPlatformTypeGroup, ffs_platform_type_group, G_TYPE_OBJECT) + +static void ffs_platform_type_group_dispose(GObject* object) { + FfsPlatformTypeGroup* self = FFS_PLATFORM_TYPE_GROUP(object); + g_clear_pointer(&self->label, g_free); + g_clear_pointer(&self->extensions, fl_value_unref); + g_clear_pointer(&self->mime_types, fl_value_unref); + G_OBJECT_CLASS(ffs_platform_type_group_parent_class)->dispose(object); +} + +static void ffs_platform_type_group_init(FfsPlatformTypeGroup* self) {} + +static void ffs_platform_type_group_class_init( + FfsPlatformTypeGroupClass* klass) { + G_OBJECT_CLASS(klass)->dispose = ffs_platform_type_group_dispose; +} + +FfsPlatformTypeGroup* ffs_platform_type_group_new(const gchar* label, + FlValue* extensions, + FlValue* mime_types) { + FfsPlatformTypeGroup* self = FFS_PLATFORM_TYPE_GROUP( + g_object_new(ffs_platform_type_group_get_type(), nullptr)); + self->label = g_strdup(label); + self->extensions = fl_value_ref(extensions); + self->mime_types = fl_value_ref(mime_types); + return self; +} + +const gchar* ffs_platform_type_group_get_label(FfsPlatformTypeGroup* self) { + g_return_val_if_fail(FFS_IS_PLATFORM_TYPE_GROUP(self), nullptr); + return self->label; +} + +FlValue* ffs_platform_type_group_get_extensions(FfsPlatformTypeGroup* self) { + g_return_val_if_fail(FFS_IS_PLATFORM_TYPE_GROUP(self), nullptr); + return self->extensions; +} + +FlValue* ffs_platform_type_group_get_mime_types(FfsPlatformTypeGroup* self) { + g_return_val_if_fail(FFS_IS_PLATFORM_TYPE_GROUP(self), nullptr); + return self->mime_types; +} + +static FlValue* ffs_platform_type_group_to_list(FfsPlatformTypeGroup* self) { + FlValue* values = fl_value_new_list(); + fl_value_append_take(values, fl_value_new_string(self->label)); + fl_value_append_take(values, fl_value_ref(self->extensions)); + fl_value_append_take(values, fl_value_ref(self->mime_types)); + return values; +} + +static FfsPlatformTypeGroup* ffs_platform_type_group_new_from_list( + FlValue* values) { + FlValue* value0 = fl_value_get_list_value(values, 0); + const gchar* label = fl_value_get_string(value0); + FlValue* value1 = fl_value_get_list_value(values, 1); + FlValue* extensions = value1; + FlValue* value2 = fl_value_get_list_value(values, 2); + FlValue* mime_types = value2; + return ffs_platform_type_group_new(label, extensions, mime_types); +} + +struct _FfsPlatformFileChooserOptions { + GObject parent_instance; + + FlValue* allowed_file_types; + gchar* current_folder_path; + gchar* current_name; + gchar* accept_button_label; + gboolean* select_multiple; +}; + +G_DEFINE_TYPE(FfsPlatformFileChooserOptions, ffs_platform_file_chooser_options, + G_TYPE_OBJECT) + +static void ffs_platform_file_chooser_options_dispose(GObject* object) { + FfsPlatformFileChooserOptions* self = + FFS_PLATFORM_FILE_CHOOSER_OPTIONS(object); + g_clear_pointer(&self->allowed_file_types, fl_value_unref); + g_clear_pointer(&self->current_folder_path, g_free); + g_clear_pointer(&self->current_name, g_free); + g_clear_pointer(&self->accept_button_label, g_free); + g_clear_pointer(&self->select_multiple, g_free); + G_OBJECT_CLASS(ffs_platform_file_chooser_options_parent_class) + ->dispose(object); +} + +static void ffs_platform_file_chooser_options_init( + FfsPlatformFileChooserOptions* self) {} + +static void ffs_platform_file_chooser_options_class_init( + FfsPlatformFileChooserOptionsClass* klass) { + G_OBJECT_CLASS(klass)->dispose = ffs_platform_file_chooser_options_dispose; +} + +FfsPlatformFileChooserOptions* ffs_platform_file_chooser_options_new( + FlValue* allowed_file_types, const gchar* current_folder_path, + const gchar* current_name, const gchar* accept_button_label, + gboolean* select_multiple) { + FfsPlatformFileChooserOptions* self = FFS_PLATFORM_FILE_CHOOSER_OPTIONS( + g_object_new(ffs_platform_file_chooser_options_get_type(), nullptr)); + if (allowed_file_types != nullptr) { + self->allowed_file_types = fl_value_ref(allowed_file_types); + } else { + self->allowed_file_types = nullptr; + } + if (current_folder_path != nullptr) { + self->current_folder_path = g_strdup(current_folder_path); + } else { + self->current_folder_path = nullptr; + } + if (current_name != nullptr) { + self->current_name = g_strdup(current_name); + } else { + self->current_name = nullptr; + } + if (accept_button_label != nullptr) { + self->accept_button_label = g_strdup(accept_button_label); + } else { + self->accept_button_label = nullptr; + } + if (select_multiple != nullptr) { + self->select_multiple = static_cast(malloc(sizeof(gboolean))); + *self->select_multiple = *select_multiple; + } else { + self->select_multiple = nullptr; + } + return self; +} + +FlValue* ffs_platform_file_chooser_options_get_allowed_file_types( + FfsPlatformFileChooserOptions* self) { + g_return_val_if_fail(FFS_IS_PLATFORM_FILE_CHOOSER_OPTIONS(self), nullptr); + return self->allowed_file_types; +} + +const gchar* ffs_platform_file_chooser_options_get_current_folder_path( + FfsPlatformFileChooserOptions* self) { + g_return_val_if_fail(FFS_IS_PLATFORM_FILE_CHOOSER_OPTIONS(self), nullptr); + return self->current_folder_path; +} + +const gchar* ffs_platform_file_chooser_options_get_current_name( + FfsPlatformFileChooserOptions* self) { + g_return_val_if_fail(FFS_IS_PLATFORM_FILE_CHOOSER_OPTIONS(self), nullptr); + return self->current_name; +} + +const gchar* ffs_platform_file_chooser_options_get_accept_button_label( + FfsPlatformFileChooserOptions* self) { + g_return_val_if_fail(FFS_IS_PLATFORM_FILE_CHOOSER_OPTIONS(self), nullptr); + return self->accept_button_label; +} + +gboolean* ffs_platform_file_chooser_options_get_select_multiple( + FfsPlatformFileChooserOptions* self) { + g_return_val_if_fail(FFS_IS_PLATFORM_FILE_CHOOSER_OPTIONS(self), nullptr); + return self->select_multiple; +} + +static FlValue* ffs_platform_file_chooser_options_to_list( + FfsPlatformFileChooserOptions* self) { + FlValue* values = fl_value_new_list(); + fl_value_append_take(values, self->allowed_file_types != nullptr + ? fl_value_ref(self->allowed_file_types) + : fl_value_new_null()); + fl_value_append_take(values, + self->current_folder_path != nullptr + ? fl_value_new_string(self->current_folder_path) + : fl_value_new_null()); + fl_value_append_take(values, self->current_name != nullptr + ? fl_value_new_string(self->current_name) + : fl_value_new_null()); + fl_value_append_take(values, + self->accept_button_label != nullptr + ? fl_value_new_string(self->accept_button_label) + : fl_value_new_null()); + fl_value_append_take(values, self->select_multiple != nullptr + ? fl_value_new_bool(*self->select_multiple) + : fl_value_new_null()); + return values; +} + +static FfsPlatformFileChooserOptions* +ffs_platform_file_chooser_options_new_from_list(FlValue* values) { + FlValue* value0 = fl_value_get_list_value(values, 0); + FlValue* allowed_file_types = nullptr; + if (fl_value_get_type(value0) != FL_VALUE_TYPE_NULL) { + allowed_file_types = value0; + } + FlValue* value1 = fl_value_get_list_value(values, 1); + const gchar* current_folder_path = nullptr; + if (fl_value_get_type(value1) != FL_VALUE_TYPE_NULL) { + current_folder_path = fl_value_get_string(value1); + } + FlValue* value2 = fl_value_get_list_value(values, 2); + const gchar* current_name = nullptr; + if (fl_value_get_type(value2) != FL_VALUE_TYPE_NULL) { + current_name = fl_value_get_string(value2); + } + FlValue* value3 = fl_value_get_list_value(values, 3); + const gchar* accept_button_label = nullptr; + if (fl_value_get_type(value3) != FL_VALUE_TYPE_NULL) { + accept_button_label = fl_value_get_string(value3); + } + FlValue* value4 = fl_value_get_list_value(values, 4); + gboolean* select_multiple = nullptr; + gboolean select_multiple_value; + if (fl_value_get_type(value4) != FL_VALUE_TYPE_NULL) { + select_multiple_value = fl_value_get_bool(value4); + select_multiple = &select_multiple_value; + } + return ffs_platform_file_chooser_options_new( + allowed_file_types, current_folder_path, current_name, + accept_button_label, select_multiple); +} + +G_DECLARE_FINAL_TYPE(FfsMessageCodec, ffs_message_codec, FFS, MESSAGE_CODEC, + FlStandardMessageCodec) + +struct _FfsMessageCodec { + FlStandardMessageCodec parent_instance; +}; + +G_DEFINE_TYPE(FfsMessageCodec, ffs_message_codec, + fl_standard_message_codec_get_type()) + +static gboolean ffs_message_codec_write_ffs_platform_file_chooser_action_type( + FlStandardMessageCodec* codec, GByteArray* buffer, FlValue* value, + GError** error) { + uint8_t type = 129; + g_byte_array_append(buffer, &type, sizeof(uint8_t)); + return fl_standard_message_codec_write_value(codec, buffer, value, error); +} + +static gboolean ffs_message_codec_write_ffs_platform_type_group( + FlStandardMessageCodec* codec, GByteArray* buffer, + FfsPlatformTypeGroup* value, GError** error) { + uint8_t type = 130; + g_byte_array_append(buffer, &type, sizeof(uint8_t)); + g_autoptr(FlValue) values = ffs_platform_type_group_to_list(value); + return fl_standard_message_codec_write_value(codec, buffer, values, error); +} + +static gboolean ffs_message_codec_write_ffs_platform_file_chooser_options( + FlStandardMessageCodec* codec, GByteArray* buffer, + FfsPlatformFileChooserOptions* value, GError** error) { + uint8_t type = 131; + g_byte_array_append(buffer, &type, sizeof(uint8_t)); + g_autoptr(FlValue) values = ffs_platform_file_chooser_options_to_list(value); + return fl_standard_message_codec_write_value(codec, buffer, values, error); +} + +static gboolean ffs_message_codec_write_value(FlStandardMessageCodec* codec, + GByteArray* buffer, + FlValue* value, GError** error) { + if (fl_value_get_type(value) == FL_VALUE_TYPE_CUSTOM) { + switch (fl_value_get_custom_type(value)) { + case 129: + return ffs_message_codec_write_ffs_platform_file_chooser_action_type( + codec, buffer, + reinterpret_cast( + const_cast(fl_value_get_custom_value(value))), + error); + case 130: + return ffs_message_codec_write_ffs_platform_type_group( + codec, buffer, + FFS_PLATFORM_TYPE_GROUP(fl_value_get_custom_value_object(value)), + error); + case 131: + return ffs_message_codec_write_ffs_platform_file_chooser_options( + codec, buffer, + FFS_PLATFORM_FILE_CHOOSER_OPTIONS( + fl_value_get_custom_value_object(value)), + error); + } + } + + return FL_STANDARD_MESSAGE_CODEC_CLASS(ffs_message_codec_parent_class) + ->write_value(codec, buffer, value, error); +} + +static FlValue* ffs_message_codec_read_ffs_platform_file_chooser_action_type( + FlStandardMessageCodec* codec, GBytes* buffer, size_t* offset, + GError** error) { + return fl_value_new_custom( + 129, fl_standard_message_codec_read_value(codec, buffer, offset, error), + (GDestroyNotify)fl_value_unref); +} + +static FlValue* ffs_message_codec_read_ffs_platform_type_group( + FlStandardMessageCodec* codec, GBytes* buffer, size_t* offset, + GError** error) { + g_autoptr(FlValue) values = + fl_standard_message_codec_read_value(codec, buffer, offset, error); + if (values == nullptr) { + return nullptr; + } + + g_autoptr(FfsPlatformTypeGroup) value = + ffs_platform_type_group_new_from_list(values); + if (value == nullptr) { + g_set_error(error, FL_MESSAGE_CODEC_ERROR, FL_MESSAGE_CODEC_ERROR_FAILED, + "Invalid data received for MessageData"); + return nullptr; + } + + return fl_value_new_custom_object(130, G_OBJECT(value)); +} + +static FlValue* ffs_message_codec_read_ffs_platform_file_chooser_options( + FlStandardMessageCodec* codec, GBytes* buffer, size_t* offset, + GError** error) { + g_autoptr(FlValue) values = + fl_standard_message_codec_read_value(codec, buffer, offset, error); + if (values == nullptr) { + return nullptr; + } + + g_autoptr(FfsPlatformFileChooserOptions) value = + ffs_platform_file_chooser_options_new_from_list(values); + if (value == nullptr) { + g_set_error(error, FL_MESSAGE_CODEC_ERROR, FL_MESSAGE_CODEC_ERROR_FAILED, + "Invalid data received for MessageData"); + return nullptr; + } + + return fl_value_new_custom_object(131, G_OBJECT(value)); +} + +static FlValue* ffs_message_codec_read_value_of_type( + FlStandardMessageCodec* codec, GBytes* buffer, size_t* offset, int type, + GError** error) { + switch (type) { + case 129: + return ffs_message_codec_read_ffs_platform_file_chooser_action_type( + codec, buffer, offset, error); + case 130: + return ffs_message_codec_read_ffs_platform_type_group(codec, buffer, + offset, error); + case 131: + return ffs_message_codec_read_ffs_platform_file_chooser_options( + codec, buffer, offset, error); + default: + return FL_STANDARD_MESSAGE_CODEC_CLASS(ffs_message_codec_parent_class) + ->read_value_of_type(codec, buffer, offset, type, error); + } +} + +static void ffs_message_codec_init(FfsMessageCodec* self) {} + +static void ffs_message_codec_class_init(FfsMessageCodecClass* klass) { + FL_STANDARD_MESSAGE_CODEC_CLASS(klass)->write_value = + ffs_message_codec_write_value; + FL_STANDARD_MESSAGE_CODEC_CLASS(klass)->read_value_of_type = + ffs_message_codec_read_value_of_type; +} + +static FfsMessageCodec* ffs_message_codec_new() { + FfsMessageCodec* self = + FFS_MESSAGE_CODEC(g_object_new(ffs_message_codec_get_type(), nullptr)); + return self; +} + +struct _FfsFileSelectorApiShowFileChooserResponse { + GObject parent_instance; + + FlValue* value; +}; + +G_DEFINE_TYPE(FfsFileSelectorApiShowFileChooserResponse, + ffs_file_selector_api_show_file_chooser_response, G_TYPE_OBJECT) + +static void ffs_file_selector_api_show_file_chooser_response_dispose( + GObject* object) { + FfsFileSelectorApiShowFileChooserResponse* self = + FFS_FILE_SELECTOR_API_SHOW_FILE_CHOOSER_RESPONSE(object); + g_clear_pointer(&self->value, fl_value_unref); + G_OBJECT_CLASS(ffs_file_selector_api_show_file_chooser_response_parent_class) + ->dispose(object); +} + +static void ffs_file_selector_api_show_file_chooser_response_init( + FfsFileSelectorApiShowFileChooserResponse* self) {} + +static void ffs_file_selector_api_show_file_chooser_response_class_init( + FfsFileSelectorApiShowFileChooserResponseClass* klass) { + G_OBJECT_CLASS(klass)->dispose = + ffs_file_selector_api_show_file_chooser_response_dispose; +} + +FfsFileSelectorApiShowFileChooserResponse* +ffs_file_selector_api_show_file_chooser_response_new(FlValue* return_value) { + FfsFileSelectorApiShowFileChooserResponse* self = + FFS_FILE_SELECTOR_API_SHOW_FILE_CHOOSER_RESPONSE(g_object_new( + ffs_file_selector_api_show_file_chooser_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_ref(return_value)); + return self; +} + +FfsFileSelectorApiShowFileChooserResponse* +ffs_file_selector_api_show_file_chooser_response_new_error(const gchar* code, + const gchar* message, + FlValue* details) { + FfsFileSelectorApiShowFileChooserResponse* self = + FFS_FILE_SELECTOR_API_SHOW_FILE_CHOOSER_RESPONSE(g_object_new( + ffs_file_selector_api_show_file_chooser_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_string(code)); + fl_value_append_take(self->value, + fl_value_new_string(message != nullptr ? message : "")); + fl_value_append_take(self->value, details != nullptr ? fl_value_ref(details) + : fl_value_new_null()); + return self; +} + +G_DECLARE_FINAL_TYPE(FfsFileSelectorApi, ffs_file_selector_api, FFS, + FILE_SELECTOR_API, GObject) + +struct _FfsFileSelectorApi { + GObject parent_instance; + + const FfsFileSelectorApiVTable* vtable; + gpointer user_data; + GDestroyNotify user_data_free_func; +}; + +G_DEFINE_TYPE(FfsFileSelectorApi, ffs_file_selector_api, G_TYPE_OBJECT) + +static void ffs_file_selector_api_dispose(GObject* object) { + FfsFileSelectorApi* self = FFS_FILE_SELECTOR_API(object); + if (self->user_data != nullptr) { + self->user_data_free_func(self->user_data); + } + self->user_data = nullptr; + G_OBJECT_CLASS(ffs_file_selector_api_parent_class)->dispose(object); +} + +static void ffs_file_selector_api_init(FfsFileSelectorApi* self) {} + +static void ffs_file_selector_api_class_init(FfsFileSelectorApiClass* klass) { + G_OBJECT_CLASS(klass)->dispose = ffs_file_selector_api_dispose; +} + +static FfsFileSelectorApi* ffs_file_selector_api_new( + const FfsFileSelectorApiVTable* vtable, gpointer user_data, + GDestroyNotify user_data_free_func) { + FfsFileSelectorApi* self = FFS_FILE_SELECTOR_API( + g_object_new(ffs_file_selector_api_get_type(), nullptr)); + self->vtable = vtable; + self->user_data = user_data; + self->user_data_free_func = user_data_free_func; + return self; +} + +static void ffs_file_selector_api_show_file_chooser_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + FfsFileSelectorApi* self = FFS_FILE_SELECTOR_API(user_data); + + if (self->vtable == nullptr || self->vtable->show_file_chooser == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FfsPlatformFileChooserActionType type = + static_cast( + fl_value_get_int(reinterpret_cast( + const_cast(fl_value_get_custom_value(value0))))); + FlValue* value1 = fl_value_get_list_value(message_, 1); + FfsPlatformFileChooserOptions* options = FFS_PLATFORM_FILE_CHOOSER_OPTIONS( + fl_value_get_custom_value_object(value1)); + g_autoptr(FfsFileSelectorApiShowFileChooserResponse) response = + self->vtable->show_file_chooser(type, options, self->user_data); + if (response == nullptr) { + g_warning("No response returned to %s.%s", "FileSelectorApi", + "showFileChooser"); + return; + } + + g_autoptr(GError) error = NULL; + if (!fl_basic_message_channel_respond(channel, response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "FileSelectorApi", + "showFileChooser", error->message); + } +} + +void ffs_file_selector_api_set_method_handlers( + FlBinaryMessenger* messenger, const gchar* suffix, + const FfsFileSelectorApiVTable* vtable, gpointer user_data, + GDestroyNotify user_data_free_func) { + g_autofree gchar* dot_suffix = + suffix != nullptr ? g_strdup_printf(".%s", suffix) : g_strdup(""); + g_autoptr(FfsFileSelectorApi) api_data = + ffs_file_selector_api_new(vtable, user_data, user_data_free_func); + + g_autoptr(FfsMessageCodec) codec = ffs_message_codec_new(); + g_autofree gchar* show_file_chooser_channel_name = g_strdup_printf( + "dev.flutter.pigeon.file_selector_linux.FileSelectorApi.showFileChooser%" + "s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) show_file_chooser_channel = + fl_basic_message_channel_new(messenger, show_file_chooser_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + show_file_chooser_channel, ffs_file_selector_api_show_file_chooser_cb, + g_object_ref(api_data), g_object_unref); +} + +void ffs_file_selector_api_clear_method_handlers(FlBinaryMessenger* messenger, + const gchar* suffix) { + g_autofree gchar* dot_suffix = + suffix != nullptr ? g_strdup_printf(".%s", suffix) : g_strdup(""); + + g_autoptr(FfsMessageCodec) codec = ffs_message_codec_new(); + g_autofree gchar* show_file_chooser_channel_name = g_strdup_printf( + "dev.flutter.pigeon.file_selector_linux.FileSelectorApi.showFileChooser%" + "s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) show_file_chooser_channel = + fl_basic_message_channel_new(messenger, show_file_chooser_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler(show_file_chooser_channel, + nullptr, nullptr, nullptr); +} diff --git a/packages/file_selector/file_selector_linux/linux/messages.g.h b/packages/file_selector/file_selector_linux/linux/messages.g.h new file mode 100644 index 000000000000..2f6251987132 --- /dev/null +++ b/packages/file_selector/file_selector_linux/linux/messages.g.h @@ -0,0 +1,238 @@ +// 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 (v22.4.1), do not edit directly. +// See also: https://pub.dev/packages/pigeon + +#ifndef PIGEON_MESSAGES_G_H_ +#define PIGEON_MESSAGES_G_H_ + +#include + +G_BEGIN_DECLS + +/** + * FfsPlatformFileChooserActionType: + * FILE_SELECTOR_LINUX_PLATFORM_FILE_CHOOSER_ACTION_TYPE_OPEN: + * FILE_SELECTOR_LINUX_PLATFORM_FILE_CHOOSER_ACTION_TYPE_CHOOSE_DIRECTORY: + * FILE_SELECTOR_LINUX_PLATFORM_FILE_CHOOSER_ACTION_TYPE_SAVE: + * + * A Pigeon representation of the GTK_FILE_CHOOSER_ACTION_* options. + */ +typedef enum { + FILE_SELECTOR_LINUX_PLATFORM_FILE_CHOOSER_ACTION_TYPE_OPEN = 0, + FILE_SELECTOR_LINUX_PLATFORM_FILE_CHOOSER_ACTION_TYPE_CHOOSE_DIRECTORY = 1, + FILE_SELECTOR_LINUX_PLATFORM_FILE_CHOOSER_ACTION_TYPE_SAVE = 2 +} FfsPlatformFileChooserActionType; + +/** + * FfsPlatformTypeGroup: + * + * A Pigeon representation of the Linux portion of an `XTypeGroup`. + */ + +G_DECLARE_FINAL_TYPE(FfsPlatformTypeGroup, ffs_platform_type_group, FFS, + PLATFORM_TYPE_GROUP, GObject) + +/** + * ffs_platform_type_group_new: + * label: field in this object. + * extensions: field in this object. + * mime_types: field in this object. + * + * Creates a new #PlatformTypeGroup object. + * + * Returns: a new #FfsPlatformTypeGroup + */ +FfsPlatformTypeGroup* ffs_platform_type_group_new(const gchar* label, + FlValue* extensions, + FlValue* mime_types); + +/** + * ffs_platform_type_group_get_label + * @object: a #FfsPlatformTypeGroup. + * + * Gets the value of the label field of @object. + * + * Returns: the field value. + */ +const gchar* ffs_platform_type_group_get_label(FfsPlatformTypeGroup* object); + +/** + * ffs_platform_type_group_get_extensions + * @object: a #FfsPlatformTypeGroup. + * + * Gets the value of the extensions field of @object. + * + * Returns: the field value. + */ +FlValue* ffs_platform_type_group_get_extensions(FfsPlatformTypeGroup* object); + +/** + * ffs_platform_type_group_get_mime_types + * @object: a #FfsPlatformTypeGroup. + * + * Gets the value of the mimeTypes field of @object. + * + * Returns: the field value. + */ +FlValue* ffs_platform_type_group_get_mime_types(FfsPlatformTypeGroup* object); + +/** + * FfsPlatformFileChooserOptions: + * + * Options for GKT file chooser. + * + * These correspond to gtk_file_chooser_set_* options. + */ + +G_DECLARE_FINAL_TYPE(FfsPlatformFileChooserOptions, + ffs_platform_file_chooser_options, FFS, + PLATFORM_FILE_CHOOSER_OPTIONS, GObject) + +/** + * ffs_platform_file_chooser_options_new: + * allowed_file_types: field in this object. + * current_folder_path: field in this object. + * current_name: field in this object. + * accept_button_label: field in this object. + * select_multiple: field in this object. + * + * Creates a new #PlatformFileChooserOptions object. + * + * Returns: a new #FfsPlatformFileChooserOptions + */ +FfsPlatformFileChooserOptions* ffs_platform_file_chooser_options_new( + FlValue* allowed_file_types, const gchar* current_folder_path, + const gchar* current_name, const gchar* accept_button_label, + gboolean* select_multiple); + +/** + * ffs_platform_file_chooser_options_get_allowed_file_types + * @object: a #FfsPlatformFileChooserOptions. + * + * Gets the value of the allowedFileTypes field of @object. + * + * Returns: the field value. + */ +FlValue* ffs_platform_file_chooser_options_get_allowed_file_types( + FfsPlatformFileChooserOptions* object); + +/** + * ffs_platform_file_chooser_options_get_current_folder_path + * @object: a #FfsPlatformFileChooserOptions. + * + * Gets the value of the currentFolderPath field of @object. + * + * Returns: the field value. + */ +const gchar* ffs_platform_file_chooser_options_get_current_folder_path( + FfsPlatformFileChooserOptions* object); + +/** + * ffs_platform_file_chooser_options_get_current_name + * @object: a #FfsPlatformFileChooserOptions. + * + * Gets the value of the currentName field of @object. + * + * Returns: the field value. + */ +const gchar* ffs_platform_file_chooser_options_get_current_name( + FfsPlatformFileChooserOptions* object); + +/** + * ffs_platform_file_chooser_options_get_accept_button_label + * @object: a #FfsPlatformFileChooserOptions. + * + * Gets the value of the acceptButtonLabel field of @object. + * + * Returns: the field value. + */ +const gchar* ffs_platform_file_chooser_options_get_accept_button_label( + FfsPlatformFileChooserOptions* object); + +/** + * ffs_platform_file_chooser_options_get_select_multiple + * @object: a #FfsPlatformFileChooserOptions. + * + * Whether to allow multiple file selection. + * + * Nullable because it does not apply to the "save" action. + * + * Returns: the field value. + */ +gboolean* ffs_platform_file_chooser_options_get_select_multiple( + FfsPlatformFileChooserOptions* object); + +G_DECLARE_FINAL_TYPE(FfsFileSelectorApiShowFileChooserResponse, + ffs_file_selector_api_show_file_chooser_response, FFS, + FILE_SELECTOR_API_SHOW_FILE_CHOOSER_RESPONSE, GObject) + +/** + * ffs_file_selector_api_show_file_chooser_response_new: + * + * Creates a new response to FileSelectorApi.showFileChooser. + * + * Returns: a new #FfsFileSelectorApiShowFileChooserResponse + */ +FfsFileSelectorApiShowFileChooserResponse* +ffs_file_selector_api_show_file_chooser_response_new(FlValue* return_value); + +/** + * ffs_file_selector_api_show_file_chooser_response_new_error: + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Creates a new error response to FileSelectorApi.showFileChooser. + * + * Returns: a new #FfsFileSelectorApiShowFileChooserResponse + */ +FfsFileSelectorApiShowFileChooserResponse* +ffs_file_selector_api_show_file_chooser_response_new_error(const gchar* code, + const gchar* message, + FlValue* details); + +/** + * FfsFileSelectorApiVTable: + * + * Table of functions exposed by FileSelectorApi to be implemented by the API + * provider. + */ +typedef struct { + FfsFileSelectorApiShowFileChooserResponse* (*show_file_chooser)( + FfsPlatformFileChooserActionType type, + FfsPlatformFileChooserOptions* options, gpointer user_data); +} FfsFileSelectorApiVTable; + +/** + * ffs_file_selector_api_set_method_handlers: + * + * @messenger: an #FlBinaryMessenger. + * @suffix: (allow-none): a suffix to add to the API or %NULL for none. + * @vtable: implementations of the methods in this API. + * @user_data: (closure): user data to pass to the functions in @vtable. + * @user_data_free_func: (allow-none): a function which gets called to free + * @user_data, or %NULL. + * + * Connects the method handlers in the FileSelectorApi API. + */ +void ffs_file_selector_api_set_method_handlers( + FlBinaryMessenger* messenger, const gchar* suffix, + const FfsFileSelectorApiVTable* vtable, gpointer user_data, + GDestroyNotify user_data_free_func); + +/** + * ffs_file_selector_api_clear_method_handlers: + * + * @messenger: an #FlBinaryMessenger. + * @suffix: (allow-none): a suffix to add to the API or %NULL for none. + * + * Clears the method handlers in the FileSelectorApi API. + */ +void ffs_file_selector_api_clear_method_handlers(FlBinaryMessenger* messenger, + const gchar* suffix); + +G_END_DECLS + +#endif // PIGEON_MESSAGES_G_H_ diff --git a/packages/file_selector/file_selector_linux/linux/test/file_selector_plugin_test.cc b/packages/file_selector/file_selector_linux/linux/test/file_selector_plugin_test.cc index 8762b4a5f9f6..bbd285a7ca12 100644 --- a/packages/file_selector/file_selector_linux/linux/test/file_selector_plugin_test.cc +++ b/packages/file_selector/file_selector_linux/linux/test/file_selector_plugin_test.cc @@ -9,6 +9,7 @@ #include #include "file_selector_plugin_private.h" +#include "messages.g.h" // TODO(stuartmorgan): Restructure the helper to take a callback for showing // the dialog, so that the tests can mock out that callback with something @@ -18,11 +19,20 @@ // gtk_file_chooser_native_new to allow for testing values that are given as // construction paramaters and can't be queried later. +// TODO(stuartmorgan): Remove this once +// https://github.com/flutter/flutter/issues/156100 is fixed. For now, this may +// need to be updated to make unit tests pass again any time the +// Pigeon-generated files are updated. +static const int platform_type_group_object_id = 130; + TEST(FileSelectorPlugin, TestOpenSimple) { - g_autoptr(FlValue) args = fl_value_new_map(); + g_autoptr(FfsPlatformFileChooserOptions) options = + ffs_platform_file_chooser_options_new(nullptr, nullptr, nullptr, nullptr, + nullptr); - g_autoptr(GtkFileChooserNative) dialog = - create_dialog_for_method(nullptr, "openFile", args); + g_autoptr(GtkFileChooserNative) dialog = create_dialog_of_type( + nullptr, FILE_SELECTOR_LINUX_PLATFORM_FILE_CHOOSER_ACTION_TYPE_OPEN, + options); ASSERT_NE(dialog, nullptr); EXPECT_EQ(gtk_file_chooser_get_action(GTK_FILE_CHOOSER(dialog)), @@ -32,11 +42,14 @@ TEST(FileSelectorPlugin, TestOpenSimple) { } TEST(FileSelectorPlugin, TestOpenMultiple) { - g_autoptr(FlValue) args = fl_value_new_map(); - fl_value_set_string_take(args, "multiple", fl_value_new_bool(true)); + gboolean select_multiple = true; + g_autoptr(FfsPlatformFileChooserOptions) options = + ffs_platform_file_chooser_options_new(nullptr, nullptr, nullptr, nullptr, + &select_multiple); - g_autoptr(GtkFileChooserNative) dialog = - create_dialog_for_method(nullptr, "openFile", args); + g_autoptr(GtkFileChooserNative) dialog = create_dialog_of_type( + nullptr, FILE_SELECTOR_LINUX_PLATFORM_FILE_CHOOSER_ACTION_TYPE_OPEN, + options); ASSERT_NE(dialog, nullptr); EXPECT_EQ(gtk_file_chooser_get_action(GTK_FILE_CHOOSER(dialog)), @@ -49,42 +62,54 @@ TEST(FileSelectorPlugin, TestOpenWithFilter) { g_autoptr(FlValue) type_groups = fl_value_new_list(); { + g_autoptr(FlValue) text_group_extensions = fl_value_new_list(); + g_autoptr(FlValue) text_group_mime_types = fl_value_new_list(); fl_value_append_take(text_group_mime_types, fl_value_new_string("text/plain")); - g_autoptr(FlValue) text_group = fl_value_new_map(); - fl_value_set_string_take(text_group, "label", fl_value_new_string("Text")); - fl_value_set_string(text_group, "mimeTypes", text_group_mime_types); - fl_value_append(type_groups, text_group); + + g_autoptr(FfsPlatformTypeGroup) text_group = ffs_platform_type_group_new( + "Text", text_group_extensions, text_group_mime_types); + fl_value_append_take( + type_groups, fl_value_new_custom_object(platform_type_group_object_id, + G_OBJECT(text_group))); } { g_autoptr(FlValue) image_group_extensions = fl_value_new_list(); fl_value_append_take(image_group_extensions, fl_value_new_string("*.png")); fl_value_append_take(image_group_extensions, fl_value_new_string("*.gif")); - fl_value_append_take(image_group_extensions, - fl_value_new_string("*.jgpeg")); - g_autoptr(FlValue) image_group = fl_value_new_map(); - fl_value_set_string_take(image_group, "label", - fl_value_new_string("Images")); - fl_value_set_string(image_group, "extensions", image_group_extensions); - fl_value_append(type_groups, image_group); + fl_value_append_take(image_group_extensions, fl_value_new_string("*.jpeg")); + + g_autoptr(FlValue) image_group_mime_types = fl_value_new_list(); + + g_autoptr(FfsPlatformTypeGroup) image_group = ffs_platform_type_group_new( + "Images", image_group_extensions, image_group_mime_types); + fl_value_append_take( + type_groups, fl_value_new_custom_object(platform_type_group_object_id, + G_OBJECT(image_group))); } { g_autoptr(FlValue) any_group_extensions = fl_value_new_list(); fl_value_append_take(any_group_extensions, fl_value_new_string("*")); - g_autoptr(FlValue) any_group = fl_value_new_map(); - fl_value_set_string_take(any_group, "label", fl_value_new_string("Any")); - fl_value_set_string(any_group, "extensions", any_group_extensions); - fl_value_append(type_groups, any_group); + + g_autoptr(FlValue) any_group_mime_types = fl_value_new_list(); + + g_autoptr(FfsPlatformTypeGroup) any_group = ffs_platform_type_group_new( + "Any", any_group_extensions, any_group_mime_types); + fl_value_append_take( + type_groups, fl_value_new_custom_object(platform_type_group_object_id, + G_OBJECT(any_group))); } - g_autoptr(FlValue) args = fl_value_new_map(); - fl_value_set_string(args, "acceptedTypeGroups", type_groups); + g_autoptr(FfsPlatformFileChooserOptions) options = + ffs_platform_file_chooser_options_new(type_groups, nullptr, nullptr, + nullptr, nullptr); - g_autoptr(GtkFileChooserNative) dialog = - create_dialog_for_method(nullptr, "openFile", args); + g_autoptr(GtkFileChooserNative) dialog = create_dialog_of_type( + nullptr, FILE_SELECTOR_LINUX_PLATFORM_FILE_CHOOSER_ACTION_TYPE_OPEN, + options); ASSERT_NE(dialog, nullptr); EXPECT_EQ(gtk_file_chooser_get_action(GTK_FILE_CHOOSER(dialog)), @@ -122,10 +147,13 @@ TEST(FileSelectorPlugin, TestOpenWithFilter) { } TEST(FileSelectorPlugin, TestSaveSimple) { - g_autoptr(FlValue) args = fl_value_new_map(); + g_autoptr(FfsPlatformFileChooserOptions) options = + ffs_platform_file_chooser_options_new(nullptr, nullptr, nullptr, nullptr, + nullptr); - g_autoptr(GtkFileChooserNative) dialog = - create_dialog_for_method(nullptr, "getSavePath", args); + g_autoptr(GtkFileChooserNative) dialog = create_dialog_of_type( + nullptr, FILE_SELECTOR_LINUX_PLATFORM_FILE_CHOOSER_ACTION_TYPE_SAVE, + options); ASSERT_NE(dialog, nullptr); EXPECT_EQ(gtk_file_chooser_get_action(GTK_FILE_CHOOSER(dialog)), @@ -135,14 +163,13 @@ TEST(FileSelectorPlugin, TestSaveSimple) { } TEST(FileSelectorPlugin, TestSaveWithArguments) { - g_autoptr(FlValue) args = fl_value_new_map(); - fl_value_set_string_take(args, "initialDirectory", - fl_value_new_string("/tmp")); - fl_value_set_string_take(args, "suggestedName", - fl_value_new_string("foo.txt")); + g_autoptr(FfsPlatformFileChooserOptions) options = + ffs_platform_file_chooser_options_new(nullptr, "/tmp", "foo.txt", nullptr, + nullptr); - g_autoptr(GtkFileChooserNative) dialog = - create_dialog_for_method(nullptr, "getSavePath", args); + g_autoptr(GtkFileChooserNative) dialog = create_dialog_of_type( + nullptr, FILE_SELECTOR_LINUX_PLATFORM_FILE_CHOOSER_ACTION_TYPE_SAVE, + options); ASSERT_NE(dialog, nullptr); EXPECT_EQ(gtk_file_chooser_get_action(GTK_FILE_CHOOSER(dialog)), @@ -158,10 +185,14 @@ TEST(FileSelectorPlugin, TestSaveWithArguments) { } TEST(FileSelectorPlugin, TestGetDirectory) { - g_autoptr(FlValue) args = fl_value_new_map(); + g_autoptr(FfsPlatformFileChooserOptions) options = + ffs_platform_file_chooser_options_new(nullptr, nullptr, nullptr, nullptr, + nullptr); - g_autoptr(GtkFileChooserNative) dialog = - create_dialog_for_method(nullptr, "getDirectoryPath", args); + g_autoptr(GtkFileChooserNative) dialog = create_dialog_of_type( + nullptr, + FILE_SELECTOR_LINUX_PLATFORM_FILE_CHOOSER_ACTION_TYPE_CHOOSE_DIRECTORY, + options); ASSERT_NE(dialog, nullptr); EXPECT_EQ(gtk_file_chooser_get_action(GTK_FILE_CHOOSER(dialog)), @@ -171,11 +202,15 @@ TEST(FileSelectorPlugin, TestGetDirectory) { } TEST(FileSelectorPlugin, TestGetMultipleDirectories) { - g_autoptr(FlValue) args = fl_value_new_map(); - fl_value_set_string_take(args, "multiple", fl_value_new_bool(true)); - - g_autoptr(GtkFileChooserNative) dialog = - create_dialog_for_method(nullptr, "getDirectoryPath", args); + gboolean select_multiple = true; + g_autoptr(FfsPlatformFileChooserOptions) options = + ffs_platform_file_chooser_options_new(nullptr, nullptr, nullptr, nullptr, + &select_multiple); + + g_autoptr(GtkFileChooserNative) dialog = create_dialog_of_type( + nullptr, + FILE_SELECTOR_LINUX_PLATFORM_FILE_CHOOSER_ACTION_TYPE_CHOOSE_DIRECTORY, + options); ASSERT_NE(dialog, nullptr); EXPECT_EQ(gtk_file_chooser_get_action(GTK_FILE_CHOOSER(dialog)), diff --git a/packages/file_selector/file_selector_linux/pigeons/copyright.txt b/packages/file_selector/file_selector_linux/pigeons/copyright.txt new file mode 100644 index 000000000000..1236b63caf3a --- /dev/null +++ b/packages/file_selector/file_selector_linux/pigeons/copyright.txt @@ -0,0 +1,3 @@ +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. diff --git a/packages/file_selector/file_selector_linux/pigeons/messages.dart b/packages/file_selector/file_selector_linux/pigeons/messages.dart new file mode 100644 index 000000000000..f10d67cd515e --- /dev/null +++ b/packages/file_selector/file_selector_linux/pigeons/messages.dart @@ -0,0 +1,62 @@ +// 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:pigeon/pigeon.dart'; + +@ConfigurePigeon(PigeonOptions( + input: 'pigeons/messages.dart', + gobjectHeaderOut: 'linux/messages.g.h', + gobjectSourceOut: 'linux/messages.g.cc', + gobjectOptions: GObjectOptions(module: 'Ffs'), + dartOut: 'lib/src/messages.g.dart', + copyrightHeader: 'pigeons/copyright.txt', +)) + +/// A Pigeon representation of the GTK_FILE_CHOOSER_ACTION_* options. +enum PlatformFileChooserActionType { open, chooseDirectory, save } + +/// A Pigeon representation of the Linux portion of an `XTypeGroup`. +class PlatformTypeGroup { + const PlatformTypeGroup({ + this.label = '', + this.extensions = const [], + this.mimeTypes = const [], + }); + + final String label; + final List extensions; + final List mimeTypes; +} + +/// Options for GKT file chooser. +/// +/// These correspond to gtk_file_chooser_set_* options. +class PlatformFileChooserOptions { + PlatformFileChooserOptions({ + required this.allowedFileTypes, + required this.currentFolderPath, + required this.currentName, + required this.acceptButtonLabel, + this.selectMultiple, + }); + + final List? allowedFileTypes; + final String? currentFolderPath; + final String? currentName; + final String? acceptButtonLabel; + + /// Whether to allow multiple file selection. + /// + /// Nullable because it does not apply to the "save" action. + final bool? selectMultiple; +} + +@HostApi(dartHostTestHandler: 'TestFileSelectorApi') +abstract class FileSelectorApi { + /// Shows an file chooser with the given [type] and [options], returning the + /// list of selected paths. + /// + /// An empty list corresponds to a cancelled selection. + List showFileChooser( + PlatformFileChooserActionType type, PlatformFileChooserOptions options); +} diff --git a/packages/file_selector/file_selector_linux/pubspec.yaml b/packages/file_selector/file_selector_linux/pubspec.yaml index 06a1fa4c3b3a..8a9d48b9ad0f 100644 --- a/packages/file_selector/file_selector_linux/pubspec.yaml +++ b/packages/file_selector/file_selector_linux/pubspec.yaml @@ -2,7 +2,7 @@ name: file_selector_linux description: Liunx implementation of the file_selector plugin. repository: https://github.com/flutter/packages/tree/main/packages/file_selector/file_selector_linux issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+file_selector%22 -version: 0.9.2+1 +version: 0.9.3 environment: sdk: ^3.3.0 @@ -25,6 +25,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter + pigeon: ^22.4.1 topics: - files diff --git a/packages/file_selector/file_selector_linux/test/file_selector_linux_test.dart b/packages/file_selector/file_selector_linux/test/file_selector_linux_test.dart index 8370a3820a84..dbf4bcf4bc3b 100644 --- a/packages/file_selector/file_selector_linux/test/file_selector_linux_test.dart +++ b/packages/file_selector/file_selector_linux/test/file_selector_linux_test.dart @@ -3,6 +3,7 @@ // found in the LICENSE file. import 'package:file_selector_linux/file_selector_linux.dart'; +import 'package:file_selector_linux/src/messages.g.dart'; import 'package:file_selector_platform_interface/file_selector_platform_interface.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; @@ -10,20 +11,12 @@ import 'package:flutter_test/flutter_test.dart'; void main() { TestWidgetsFlutterBinding.ensureInitialized(); + late FakeFileSelectorApi api; late FileSelectorLinux plugin; - late List log; setUp(() { - plugin = FileSelectorLinux(); - log = []; - TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger - .setMockMethodCallHandler( - plugin.channel, - (MethodCall methodCall) async { - log.add(methodCall); - return null; - }, - ); + api = FakeFileSelectorApi(); + plugin = FileSelectorLinux(api: api); }); test('registers instance', () { @@ -32,6 +25,22 @@ void main() { }); group('openFile', () { + test('passes the core flags correctly', () async { + const String path = '/foo/bar'; + api.result = [path]; + + expect((await plugin.openFile())?.path, path); + + expect(api.passedType, PlatformFileChooserActionType.open); + expect(api.passedOptions?.selectMultiple, false); + }); + + test('handles empty return for cancel', () async { + api.result = []; + + expect(await plugin.openFile(), null); + }); + test('passes the accepted type groups correctly', () async { const XTypeGroup group = XTypeGroup( label: 'text', @@ -47,55 +56,31 @@ void main() { await plugin.openFile(acceptedTypeGroups: [group, groupTwo]); - expectMethodCall( - log, - 'openFile', - arguments: { - 'acceptedTypeGroups': >[ - { - 'label': 'text', - 'extensions': ['*.txt'], - 'mimeTypes': ['text/plain'], - }, - { - 'label': 'image', - 'extensions': ['*.jpg'], - 'mimeTypes': ['image/jpg'], - }, - ], - 'initialDirectory': null, - 'confirmButtonText': null, - 'multiple': false, - }, - ); + expect(api.passedOptions?.allowedFileTypes?[0].label, group.label); + // Extensions should be converted to *. format. + expect(api.passedOptions?.allowedFileTypes?[0].extensions, + ['*.txt']); + expect( + api.passedOptions?.allowedFileTypes?[0].mimeTypes, group.mimeTypes); + expect(api.passedOptions?.allowedFileTypes?[1].label, groupTwo.label); + expect(api.passedOptions?.allowedFileTypes?[1].extensions, + ['*.jpg']); + expect(api.passedOptions?.allowedFileTypes?[1].mimeTypes, + groupTwo.mimeTypes); }); test('passes initialDirectory correctly', () async { - await plugin.openFile(initialDirectory: '/example/directory'); - - expectMethodCall( - log, - 'openFile', - arguments: { - 'initialDirectory': '/example/directory', - 'confirmButtonText': null, - 'multiple': false, - }, - ); + const String path = '/example/directory'; + await plugin.openFile(initialDirectory: path); + + expect(api.passedOptions?.currentFolderPath, path); }); test('passes confirmButtonText correctly', () async { - await plugin.openFile(confirmButtonText: 'Open File'); - - expectMethodCall( - log, - 'openFile', - arguments: { - 'initialDirectory': null, - 'confirmButtonText': 'Open File', - 'multiple': false, - }, - ); + const String button = 'Open File'; + await plugin.openFile(confirmButtonText: button); + + expect(api.passedOptions?.acceptButtonLabel, button); }); test('throws for a type group that does not support Linux', () async { @@ -116,25 +101,24 @@ void main() { await plugin.openFile(acceptedTypeGroups: [group]); - expectMethodCall( - log, - 'openFile', - arguments: { - 'acceptedTypeGroups': >[ - { - 'label': 'any', - 'extensions': ['*'], - }, - ], - 'initialDirectory': null, - 'confirmButtonText': null, - 'multiple': false, - }, - ); + expect(api.passedOptions?.allowedFileTypes?[0].extensions, ['*']); }); }); group('openFiles', () { + test('passes the core flags correctly', () async { + api.result = ['/foo/bar', 'baz']; + + final List files = await plugin.openFiles(); + + expect(files.length, 2); + expect(files[0].path, api.result[0]); + expect(files[1].path, api.result[1]); + + expect(api.passedType, PlatformFileChooserActionType.open); + expect(api.passedOptions?.selectMultiple, true); + }); + test('passes the accepted type groups correctly', () async { const XTypeGroup group = XTypeGroup( label: 'text', @@ -150,55 +134,31 @@ void main() { await plugin.openFiles(acceptedTypeGroups: [group, groupTwo]); - expectMethodCall( - log, - 'openFile', - arguments: { - 'acceptedTypeGroups': >[ - { - 'label': 'text', - 'extensions': ['*.txt'], - 'mimeTypes': ['text/plain'], - }, - { - 'label': 'image', - 'extensions': ['*.jpg'], - 'mimeTypes': ['image/jpg'], - }, - ], - 'initialDirectory': null, - 'confirmButtonText': null, - 'multiple': true, - }, - ); + expect(api.passedOptions?.allowedFileTypes?[0].label, group.label); + // Extensions should be converted to *. format. + expect(api.passedOptions?.allowedFileTypes?[0].extensions, + ['*.txt']); + expect( + api.passedOptions?.allowedFileTypes?[0].mimeTypes, group.mimeTypes); + expect(api.passedOptions?.allowedFileTypes?[1].label, groupTwo.label); + expect(api.passedOptions?.allowedFileTypes?[1].extensions, + ['*.jpg']); + expect(api.passedOptions?.allowedFileTypes?[1].mimeTypes, + groupTwo.mimeTypes); }); test('passes initialDirectory correctly', () async { - await plugin.openFiles(initialDirectory: '/example/directory'); - - expectMethodCall( - log, - 'openFile', - arguments: { - 'initialDirectory': '/example/directory', - 'confirmButtonText': null, - 'multiple': true, - }, - ); + const String path = '/example/directory'; + await plugin.openFiles(initialDirectory: path); + + expect(api.passedOptions?.currentFolderPath, path); }); test('passes confirmButtonText correctly', () async { - await plugin.openFiles(confirmButtonText: 'Open File'); - - expectMethodCall( - log, - 'openFile', - arguments: { - 'initialDirectory': null, - 'confirmButtonText': 'Open File', - 'multiple': true, - }, - ); + const String button = 'Open File'; + await plugin.openFiles(confirmButtonText: button); + + expect(api.passedOptions?.acceptButtonLabel, button); }); test('throws for a type group that does not support Linux', () async { @@ -219,25 +179,20 @@ void main() { await plugin.openFiles(acceptedTypeGroups: [group]); - expectMethodCall( - log, - 'openFile', - arguments: { - 'acceptedTypeGroups': >[ - { - 'label': 'any', - 'extensions': ['*'], - }, - ], - 'initialDirectory': null, - 'confirmButtonText': null, - 'multiple': true, - }, - ); + expect(api.passedOptions?.allowedFileTypes?[0].extensions, ['*']); }); }); group('getSaveLocation', () { + test('passes the core flags correctly', () async { + const String path = '/foo/bar'; + api.result = [path]; + + expect((await plugin.getSaveLocation())?.path, path); + + expect(api.passedType, PlatformFileChooserActionType.save); + }); + test('passes the accepted type groups correctly', () async { const XTypeGroup group = XTypeGroup( label: 'text', @@ -254,58 +209,33 @@ void main() { await plugin .getSaveLocation(acceptedTypeGroups: [group, groupTwo]); - expectMethodCall( - log, - 'getSavePath', - arguments: { - 'acceptedTypeGroups': >[ - { - 'label': 'text', - 'extensions': ['*.txt'], - 'mimeTypes': ['text/plain'], - }, - { - 'label': 'image', - 'extensions': ['*.jpg'], - 'mimeTypes': ['image/jpg'], - }, - ], - 'initialDirectory': null, - 'suggestedName': null, - 'confirmButtonText': null, - }, - ); + expect(api.passedOptions?.allowedFileTypes?[0].label, group.label); + // Extensions should be converted to *. format. + expect(api.passedOptions?.allowedFileTypes?[0].extensions, + ['*.txt']); + expect( + api.passedOptions?.allowedFileTypes?[0].mimeTypes, group.mimeTypes); + expect(api.passedOptions?.allowedFileTypes?[1].label, groupTwo.label); + expect(api.passedOptions?.allowedFileTypes?[1].extensions, + ['*.jpg']); + expect(api.passedOptions?.allowedFileTypes?[1].mimeTypes, + groupTwo.mimeTypes); }); test('passes initialDirectory correctly', () async { + const String path = '/example/directory'; await plugin.getSaveLocation( - options: - const SaveDialogOptions(initialDirectory: '/example/directory')); - - expectMethodCall( - log, - 'getSavePath', - arguments: { - 'initialDirectory': '/example/directory', - 'suggestedName': null, - 'confirmButtonText': null, - }, - ); + options: const SaveDialogOptions(initialDirectory: path)); + + expect(api.passedOptions?.currentFolderPath, path); }); test('passes confirmButtonText correctly', () async { + const String button = 'Open File'; await plugin.getSaveLocation( - options: const SaveDialogOptions(confirmButtonText: 'Open File')); - - expectMethodCall( - log, - 'getSavePath', - arguments: { - 'initialDirectory': null, - 'suggestedName': null, - 'confirmButtonText': 'Open File', - }, - ); + options: const SaveDialogOptions(confirmButtonText: button)); + + expect(api.passedOptions?.acceptButtonLabel, button); }); test('throws for a type group that does not support Linux', () async { @@ -326,25 +256,20 @@ void main() { await plugin.getSaveLocation(acceptedTypeGroups: [group]); - expectMethodCall( - log, - 'getSavePath', - arguments: { - 'acceptedTypeGroups': >[ - { - 'label': 'any', - 'extensions': ['*'], - }, - ], - 'initialDirectory': null, - 'suggestedName': null, - 'confirmButtonText': null, - }, - ); + expect(api.passedOptions?.allowedFileTypes?[0].extensions, ['*']); }); }); group('getSavePath (deprecated)', () { + test('passes the core flags correctly', () async { + const String path = '/foo/bar'; + api.result = [path]; + + expect(await plugin.getSavePath(), path); + + expect(api.passedType, PlatformFileChooserActionType.save); + }); + test('passes the accepted type groups correctly', () async { const XTypeGroup group = XTypeGroup( label: 'text', @@ -361,55 +286,31 @@ void main() { await plugin .getSavePath(acceptedTypeGroups: [group, groupTwo]); - expectMethodCall( - log, - 'getSavePath', - arguments: { - 'acceptedTypeGroups': >[ - { - 'label': 'text', - 'extensions': ['*.txt'], - 'mimeTypes': ['text/plain'], - }, - { - 'label': 'image', - 'extensions': ['*.jpg'], - 'mimeTypes': ['image/jpg'], - }, - ], - 'initialDirectory': null, - 'suggestedName': null, - 'confirmButtonText': null, - }, - ); + expect(api.passedOptions?.allowedFileTypes?[0].label, group.label); + // Extensions should be converted to *. format. + expect(api.passedOptions?.allowedFileTypes?[0].extensions, + ['*.txt']); + expect( + api.passedOptions?.allowedFileTypes?[0].mimeTypes, group.mimeTypes); + expect(api.passedOptions?.allowedFileTypes?[1].label, groupTwo.label); + expect(api.passedOptions?.allowedFileTypes?[1].extensions, + ['*.jpg']); + expect(api.passedOptions?.allowedFileTypes?[1].mimeTypes, + groupTwo.mimeTypes); }); test('passes initialDirectory correctly', () async { - await plugin.getSavePath(initialDirectory: '/example/directory'); - - expectMethodCall( - log, - 'getSavePath', - arguments: { - 'initialDirectory': '/example/directory', - 'suggestedName': null, - 'confirmButtonText': null, - }, - ); + const String path = '/example/directory'; + await plugin.getSavePath(initialDirectory: path); + + expect(api.passedOptions?.currentFolderPath, path); }); test('passes confirmButtonText correctly', () async { - await plugin.getSavePath(confirmButtonText: 'Open File'); - - expectMethodCall( - log, - 'getSavePath', - arguments: { - 'initialDirectory': null, - 'suggestedName': null, - 'confirmButtonText': 'Open File', - }, - ); + const String button = 'Open File'; + await plugin.getSavePath(confirmButtonText: button); + + expect(api.passedOptions?.acceptButtonLabel, button); }); test('throws for a type group that does not support Linux', () async { @@ -430,99 +331,87 @@ void main() { await plugin.getSavePath(acceptedTypeGroups: [group]); - expectMethodCall( - log, - 'getSavePath', - arguments: { - 'acceptedTypeGroups': >[ - { - 'label': 'any', - 'extensions': ['*'], - }, - ], - 'initialDirectory': null, - 'suggestedName': null, - 'confirmButtonText': null, - }, - ); + expect(api.passedOptions?.allowedFileTypes?[0].extensions, ['*']); }); }); group('getDirectoryPath', () { + test('passes the core flags correctly', () async { + const String path = '/foo/bar'; + api.result = [path]; + + expect(await plugin.getDirectoryPath(), path); + + expect(api.passedType, PlatformFileChooserActionType.chooseDirectory); + expect(api.passedOptions?.selectMultiple, false); + }); + test('passes initialDirectory correctly', () async { - await plugin.getDirectoryPath(initialDirectory: '/example/directory'); - - expectMethodCall( - log, - 'getDirectoryPath', - arguments: { - 'initialDirectory': '/example/directory', - 'confirmButtonText': null, - }, - ); + const String path = '/example/directory'; + await plugin.getDirectoryPath(initialDirectory: path); + + expect(api.passedOptions?.currentFolderPath, path); }); + test('passes confirmButtonText correctly', () async { - await plugin.getDirectoryPath(confirmButtonText: 'Select Folder'); - - expectMethodCall( - log, - 'getDirectoryPath', - arguments: { - 'initialDirectory': null, - 'confirmButtonText': 'Select Folder', - }, - ); + const String button = 'Select Folder'; + await plugin.getDirectoryPath(confirmButtonText: button); + + expect(api.passedOptions?.acceptButtonLabel, button); }); }); group('getDirectoryPaths', () { + test('passes the core flags correctly', () async { + api.result = ['/foo/bar', 'baz']; + + expect(await plugin.getDirectoryPaths(), api.result); + + expect(api.passedType, PlatformFileChooserActionType.chooseDirectory); + expect(api.passedOptions?.selectMultiple, true); + }); + test('passes initialDirectory correctly', () async { - await plugin.getDirectoryPaths(initialDirectory: '/example/directory'); - - expectMethodCall( - log, - 'getDirectoryPath', - arguments: { - 'initialDirectory': '/example/directory', - 'confirmButtonText': null, - 'multiple': true, - }, - ); + const String path = '/example/directory'; + await plugin.getDirectoryPaths(initialDirectory: path); + + expect(api.passedOptions?.currentFolderPath, path); }); + test('passes confirmButtonText correctly', () async { - await plugin.getDirectoryPaths( - confirmButtonText: 'Select one or mode folders'); - - expectMethodCall( - log, - 'getDirectoryPath', - arguments: { - 'initialDirectory': null, - 'confirmButtonText': 'Select one or mode folders', - 'multiple': true, - }, - ); + const String button = 'Select one or mode folders'; + await plugin.getDirectoryPaths(confirmButtonText: button); + + expect(api.passedOptions?.acceptButtonLabel, button); }); + test('passes multiple flag correctly', () async { await plugin.getDirectoryPaths(); - expectMethodCall( - log, - 'getDirectoryPath', - arguments: { - 'initialDirectory': null, - 'confirmButtonText': null, - 'multiple': true, - }, - ); + expect(api.passedOptions?.selectMultiple, true); }); }); } -void expectMethodCall( - List log, - String methodName, { - Map? arguments, -}) { - expect(log, [isMethodCall(methodName, arguments: arguments)]); +/// Fake implementation that stores arguments and provides a canned response. +class FakeFileSelectorApi implements FileSelectorApi { + List result = []; + PlatformFileChooserActionType? passedType; + PlatformFileChooserOptions? passedOptions; + + @override + Future> showFileChooser(PlatformFileChooserActionType type, + PlatformFileChooserOptions options) async { + passedType = type; + passedOptions = options; + return result; + } + + @override + // ignore: non_constant_identifier_names + BinaryMessenger? get pigeonVar_binaryMessenger => null; + + @override + // ignore: non_constant_identifier_names + String get pigeonVar_messageChannelSuffix => ''; } diff --git a/packages/file_selector/file_selector_macos/CHANGELOG.md b/packages/file_selector/file_selector_macos/CHANGELOG.md index e63c60bef003..c2c48c5f8485 100644 --- a/packages/file_selector/file_selector_macos/CHANGELOG.md +++ b/packages/file_selector/file_selector_macos/CHANGELOG.md @@ -1,5 +1,10 @@ -## NEXT +## 0.9.4+2 +* Updates Pigeon for non-nullable collection type support. + +## 0.9.4+1 + +* Adds privacy manifest. * Updates minimum supported SDK version to Flutter 3.19/Dart 3.3. ## 0.9.4 diff --git a/packages/file_selector/file_selector_macos/lib/src/messages.g.dart b/packages/file_selector/file_selector_macos/lib/src/messages.g.dart index cbf8dd10007a..d1d45a2777e5 100644 --- a/packages/file_selector/file_selector_macos/lib/src/messages.g.dart +++ b/packages/file_selector/file_selector_macos/lib/src/messages.g.dart @@ -1,9 +1,9 @@ // 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 (v10.1.3), do not edit directly. +// Autogenerated from Pigeon (v22.4.1), 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 +// 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, no_leading_underscores_for_local_identifiers import 'dart:async'; import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List; @@ -11,19 +11,37 @@ import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List; import 'package:flutter/foundation.dart' show ReadBuffer, WriteBuffer; import 'package:flutter/services.dart'; +PlatformException _createConnectionError(String channelName) { + return PlatformException( + code: 'channel-error', + message: 'Unable to establish connection on channel: "$channelName".', + ); +} + +List wrapResponse( + {Object? result, PlatformException? error, bool empty = false}) { + if (empty) { + return []; + } + if (error == null) { + return [result]; + } + return [error.code, error.message, error.details]; +} + /// A Pigeon representation of the macOS portion of an `XTypeGroup`. class AllowedTypes { AllowedTypes({ - required this.extensions, - required this.mimeTypes, - required this.utis, + this.extensions = const [], + this.mimeTypes = const [], + this.utis = const [], }); - List extensions; + List extensions; - List mimeTypes; + List mimeTypes; - List utis; + List utis; Object encode() { return [ @@ -36,9 +54,9 @@ class AllowedTypes { static AllowedTypes decode(Object result) { result as List; return AllowedTypes( - extensions: (result[0] as List?)!.cast(), - mimeTypes: (result[1] as List?)!.cast(), - utis: (result[2] as List?)!.cast(), + extensions: (result[0] as List?)!.cast(), + mimeTypes: (result[1] as List?)!.cast(), + utis: (result[2] as List?)!.cast(), ); } } @@ -65,7 +83,7 @@ class SavePanelOptions { Object encode() { return [ - allowedFileTypes?.encode(), + allowedFileTypes, directoryPath, nameFieldStringValue, prompt, @@ -75,9 +93,7 @@ class SavePanelOptions { static SavePanelOptions decode(Object result) { result as List; return SavePanelOptions( - allowedFileTypes: result[0] != null - ? AllowedTypes.decode(result[0]! as List) - : null, + allowedFileTypes: result[0] as AllowedTypes?, directoryPath: result[1] as String?, nameFieldStringValue: result[2] as String?, prompt: result[3] as String?, @@ -109,7 +125,7 @@ class OpenPanelOptions { allowsMultipleSelection, canChooseDirectories, canChooseFiles, - baseOptions.encode(), + baseOptions, ]; } @@ -119,24 +135,27 @@ class OpenPanelOptions { allowsMultipleSelection: result[0]! as bool, canChooseDirectories: result[1]! as bool, canChooseFiles: result[2]! as bool, - baseOptions: SavePanelOptions.decode(result[3]! as List), + baseOptions: result[3]! as SavePanelOptions, ); } } -class _FileSelectorApiCodec extends StandardMessageCodec { - const _FileSelectorApiCodec(); +class _PigeonCodec extends StandardMessageCodec { + const _PigeonCodec(); @override void writeValue(WriteBuffer buffer, Object? value) { - if (value is AllowedTypes) { - buffer.putUint8(128); - writeValue(buffer, value.encode()); - } else if (value is OpenPanelOptions) { + if (value is int) { + buffer.putUint8(4); + buffer.putInt64(value); + } else if (value is AllowedTypes) { buffer.putUint8(129); writeValue(buffer, value.encode()); } else if (value is SavePanelOptions) { buffer.putUint8(130); writeValue(buffer, value.encode()); + } else if (value is OpenPanelOptions) { + buffer.putUint8(131); + writeValue(buffer, value.encode()); } else { super.writeValue(buffer, value); } @@ -145,12 +164,12 @@ class _FileSelectorApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: - return AllowedTypes.decode(readValue(buffer)!); case 129: - return OpenPanelOptions.decode(readValue(buffer)!); + return AllowedTypes.decode(readValue(buffer)!); case 130: return SavePanelOptions.decode(readValue(buffer)!); + case 131: + return OpenPanelOptions.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); } @@ -161,65 +180,74 @@ class FileSelectorApi { /// Constructor for [FileSelectorApi]. The [binaryMessenger] named argument is /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. - FileSelectorApi({BinaryMessenger? binaryMessenger}) - : _binaryMessenger = binaryMessenger; - final BinaryMessenger? _binaryMessenger; + FileSelectorApi( + {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) + : pigeonVar_binaryMessenger = binaryMessenger, + pigeonVar_messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + final BinaryMessenger? pigeonVar_binaryMessenger; - static const MessageCodec codec = _FileSelectorApiCodec(); + static const MessageCodec pigeonChannelCodec = _PigeonCodec(); + + final String pigeonVar_messageChannelSuffix; /// Shows an open panel with the given [options], returning the list of /// selected paths. /// /// An empty list corresponds to a cancelled selection. - Future> displayOpenPanel(OpenPanelOptions arg_options) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.FileSelectorApi.displayOpenPanel', codec, - binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_options]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + Future> displayOpenPanel(OpenPanelOptions options) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.file_selector_macos.FileSelectorApi.displayOpenPanel$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([options]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (replyList[0] as List?)!.cast(); + return (pigeonVar_replyList[0] as List?)!.cast(); } } /// Shows a save panel with the given [options], returning the selected path. /// /// A null return corresponds to a cancelled save. - Future displaySavePanel(SavePanelOptions arg_options) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.FileSelectorApi.displaySavePanel', codec, - binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_options]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + Future displaySavePanel(SavePanelOptions options) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.file_selector_macos.FileSelectorApi.displaySavePanel$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([options]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { - return (replyList[0] as String?); + return (pigeonVar_replyList[0] as String?); } } } diff --git a/packages/file_selector/file_selector_macos/macos/file_selector_macos.podspec b/packages/file_selector/file_selector_macos/macos/file_selector_macos.podspec index bb4bffee9e00..e4b8a622d6aa 100644 --- a/packages/file_selector/file_selector_macos/macos/file_selector_macos.podspec +++ b/packages/file_selector/file_selector_macos/macos/file_selector_macos.podspec @@ -13,6 +13,7 @@ Displays native macOS open and save panels. s.author = { 'Flutter Dev Team' => 'flutter-dev@googlegroups.com' } s.source = { :http => 'https://github.com/flutter/packages/tree/main/packages/file_selector/file_selector_macos' } s.source_files = 'file_selector_macos/Sources/file_selector_macos/**/*.swift' + s.resource_bundles = {'file_selector_macos_privacy' => ['file_selector_macos/Sources/file_selector_macos/Resources/PrivacyInfo.xcprivacy']} s.dependency 'FlutterMacOS' s.platform = :osx, '10.14' diff --git a/packages/file_selector/file_selector_macos/macos/file_selector_macos/Package.swift b/packages/file_selector/file_selector_macos/macos/file_selector_macos/Package.swift index 97bd0cd8d5dc..d4bc3e313df1 100644 --- a/packages/file_selector/file_selector_macos/macos/file_selector_macos/Package.swift +++ b/packages/file_selector/file_selector_macos/macos/file_selector_macos/Package.swift @@ -19,7 +19,10 @@ let package = Package( targets: [ .target( name: "file_selector_macos", - dependencies: [] + dependencies: [], + resources: [ + .process("Resources") + ] ) ] ) diff --git a/packages/file_selector/file_selector_macos/macos/file_selector_macos/Sources/file_selector_macos/FileSelectorPlugin.swift b/packages/file_selector/file_selector_macos/macos/file_selector_macos/Sources/file_selector_macos/FileSelectorPlugin.swift index c90d69d4609c..e54e91203975 100644 --- a/packages/file_selector/file_selector_macos/macos/file_selector_macos/Sources/file_selector_macos/FileSelectorPlugin.swift +++ b/packages/file_selector/file_selector_macos/macos/file_selector_macos/Sources/file_selector_macos/FileSelectorPlugin.swift @@ -64,7 +64,7 @@ public class FileSelectorPlugin: NSObject, FlutterPlugin, FileSelectorApi { } func displayOpenPanel( - options: OpenPanelOptions, completion: @escaping (Result<[String?], Error>) -> Void + options: OpenPanelOptions, completion: @escaping (Result<[String], Error>) -> Void ) { let panel = NSOpenPanel() configure(openPanel: panel, with: options) @@ -101,26 +101,22 @@ public class FileSelectorPlugin: NSObject, FlutterPlugin, FileSelectorApi { if let acceptedTypes = options.allowedFileTypes { if #available(macOS 11, *), !forceLegacyTypes { var allowedTypes: [UTType] = [] - // The array values are non-null by convention even though Pigeon can't currently express - // that via the types; see messages.dart and https://github.com/flutter/flutter/issues/97848 - allowedTypes.append(contentsOf: acceptedTypes.utis.compactMap({ UTType($0!) })) + allowedTypes.append(contentsOf: acceptedTypes.utis.compactMap({ UTType($0) })) allowedTypes.append( contentsOf: acceptedTypes.extensions.compactMap({ - UTType.init(filenameExtension: $0!) + UTType.init(filenameExtension: $0) })) allowedTypes.append( contentsOf: acceptedTypes.mimeTypes.compactMap({ - UTType.init(mimeType: $0!) + UTType.init(mimeType: $0) })) if !allowedTypes.isEmpty { panel.allowedContentTypes = allowedTypes } } else { var allowedTypes: [String] = [] - // The array values are non-null by convention even though Pigeon can't currently express - // that via the types; see messages.dart and https://github.com/flutter/flutter/issues/97848 - allowedTypes.append(contentsOf: acceptedTypes.extensions.map({ $0! })) - allowedTypes.append(contentsOf: acceptedTypes.utis.map({ $0! })) + allowedTypes.append(contentsOf: acceptedTypes.extensions.map({ $0 })) + allowedTypes.append(contentsOf: acceptedTypes.utis.map({ $0 })) if !allowedTypes.isEmpty { panel.allowedFileTypes = allowedTypes } diff --git a/packages/file_selector/file_selector_macos/macos/file_selector_macos/Sources/file_selector_macos/Resources/PrivacyInfo.xcprivacy b/packages/file_selector/file_selector_macos/macos/file_selector_macos/Sources/file_selector_macos/Resources/PrivacyInfo.xcprivacy new file mode 100644 index 000000000000..918d80be4306 --- /dev/null +++ b/packages/file_selector/file_selector_macos/macos/file_selector_macos/Sources/file_selector_macos/Resources/PrivacyInfo.xcprivacy @@ -0,0 +1,12 @@ + + + + + NSPrivacyTrackingDomains + + NSPrivacyCollectedDataTypes + + NSPrivacyTracking + + + diff --git a/packages/file_selector/file_selector_macos/macos/file_selector_macos/Sources/file_selector_macos/messages.g.swift b/packages/file_selector/file_selector_macos/macos/file_selector_macos/Sources/file_selector_macos/messages.g.swift index 7cff0d721df8..62590d1a46e2 100644 --- a/packages/file_selector/file_selector_macos/macos/file_selector_macos/Sources/file_selector_macos/messages.g.swift +++ b/packages/file_selector/file_selector_macos/macos/file_selector_macos/Sources/file_selector_macos/messages.g.swift @@ -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 (v10.1.3), do not edit directly. +// Autogenerated from Pigeon (v22.4.1), do not edit directly. // See also: https://pub.dev/packages/pigeon import Foundation @@ -14,11 +14,36 @@ import Foundation #error("Unsupported platform.") #endif +/// Error class for passing custom error details to Dart side. +final class PigeonError: Error { + let code: String + let message: String? + let details: Any? + + init(code: String, message: String?, details: Any?) { + self.code = code + self.message = message + self.details = details + } + + var localizedDescription: String { + return + "PigeonError(code: \(code), message: \(message ?? ""), details: \(details ?? "")" + } +} + private func wrapResult(_ result: Any?) -> [Any?] { return [result] } private func wrapError(_ error: Any) -> [Any?] { + if let pigeonError = error as? PigeonError { + return [ + pigeonError.code, + pigeonError.message, + pigeonError.details, + ] + } if let flutterError = error as? FlutterError { return [ flutterError.code, @@ -33,6 +58,10 @@ private func wrapError(_ error: Any) -> [Any?] { ] } +private func isNullish(_ value: Any?) -> Bool { + return value is NSNull || value == nil +} + private func nilOrValue(_ value: Any?) -> T? { if value is NSNull { return nil } return value as! T? @@ -42,14 +71,15 @@ private func nilOrValue(_ value: Any?) -> T? { /// /// Generated class from Pigeon that represents data sent in messages. struct AllowedTypes { - var extensions: [String?] - var mimeTypes: [String?] - var utis: [String?] + var extensions: [String] + var mimeTypes: [String] + var utis: [String] - static func fromList(_ list: [Any?]) -> AllowedTypes? { - let extensions = list[0] as! [String?] - let mimeTypes = list[1] as! [String?] - let utis = list[2] as! [String?] + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> AllowedTypes? { + let extensions = pigeonVar_list[0] as! [String] + let mimeTypes = pigeonVar_list[1] as! [String] + let utis = pigeonVar_list[2] as! [String] return AllowedTypes( extensions: extensions, @@ -78,14 +108,12 @@ struct SavePanelOptions { var nameFieldStringValue: String? = nil var prompt: String? = nil - static func fromList(_ list: [Any?]) -> SavePanelOptions? { - var allowedFileTypes: AllowedTypes? = nil - if let allowedFileTypesList: [Any?] = nilOrValue(list[0]) { - allowedFileTypes = AllowedTypes.fromList(allowedFileTypesList) - } - let directoryPath: String? = nilOrValue(list[1]) - let nameFieldStringValue: String? = nilOrValue(list[2]) - let prompt: String? = nilOrValue(list[3]) + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> SavePanelOptions? { + let allowedFileTypes: AllowedTypes? = nilOrValue(pigeonVar_list[0]) + let directoryPath: String? = nilOrValue(pigeonVar_list[1]) + let nameFieldStringValue: String? = nilOrValue(pigeonVar_list[2]) + let prompt: String? = nilOrValue(pigeonVar_list[3]) return SavePanelOptions( allowedFileTypes: allowedFileTypes, @@ -96,7 +124,7 @@ struct SavePanelOptions { } func toList() -> [Any?] { return [ - allowedFileTypes?.toList(), + allowedFileTypes, directoryPath, nameFieldStringValue, prompt, @@ -115,11 +143,12 @@ struct OpenPanelOptions { var canChooseFiles: Bool var baseOptions: SavePanelOptions - static func fromList(_ list: [Any?]) -> OpenPanelOptions? { - let allowsMultipleSelection = list[0] as! Bool - let canChooseDirectories = list[1] as! Bool - let canChooseFiles = list[2] as! Bool - let baseOptions = SavePanelOptions.fromList(list[3] as! [Any?])! + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> OpenPanelOptions? { + let allowsMultipleSelection = pigeonVar_list[0] as! Bool + let canChooseDirectories = pigeonVar_list[1] as! Bool + let canChooseFiles = pigeonVar_list[2] as! Bool + let baseOptions = pigeonVar_list[3] as! SavePanelOptions return OpenPanelOptions( allowsMultipleSelection: allowsMultipleSelection, @@ -133,55 +162,55 @@ struct OpenPanelOptions { allowsMultipleSelection, canChooseDirectories, canChooseFiles, - baseOptions.toList(), + baseOptions, ] } } -private class FileSelectorApiCodecReader: FlutterStandardReader { +private class messagesPigeonCodecReader: FlutterStandardReader { override func readValue(ofType type: UInt8) -> Any? { switch type { - case 128: - return AllowedTypes.fromList(self.readValue() as! [Any?]) case 129: - return OpenPanelOptions.fromList(self.readValue() as! [Any?]) + return AllowedTypes.fromList(self.readValue() as! [Any?]) case 130: return SavePanelOptions.fromList(self.readValue() as! [Any?]) + case 131: + return OpenPanelOptions.fromList(self.readValue() as! [Any?]) default: return super.readValue(ofType: type) } } } -private class FileSelectorApiCodecWriter: FlutterStandardWriter { +private class messagesPigeonCodecWriter: FlutterStandardWriter { override func writeValue(_ value: Any) { if let value = value as? AllowedTypes { - super.writeByte(128) - super.writeValue(value.toList()) - } else if let value = value as? OpenPanelOptions { super.writeByte(129) super.writeValue(value.toList()) } else if let value = value as? SavePanelOptions { super.writeByte(130) super.writeValue(value.toList()) + } else if let value = value as? OpenPanelOptions { + super.writeByte(131) + super.writeValue(value.toList()) } else { super.writeValue(value) } } } -private class FileSelectorApiCodecReaderWriter: FlutterStandardReaderWriter { +private class messagesPigeonCodecReaderWriter: FlutterStandardReaderWriter { override func reader(with data: Data) -> FlutterStandardReader { - return FileSelectorApiCodecReader(data: data) + return messagesPigeonCodecReader(data: data) } override func writer(with data: NSMutableData) -> FlutterStandardWriter { - return FileSelectorApiCodecWriter(data: data) + return messagesPigeonCodecWriter(data: data) } } -class FileSelectorApiCodec: FlutterStandardMessageCodec { - static let shared = FileSelectorApiCodec(readerWriter: FileSelectorApiCodecReaderWriter()) +class messagesPigeonCodec: FlutterStandardMessageCodec, @unchecked Sendable { + static let shared = messagesPigeonCodec(readerWriter: messagesPigeonCodecReaderWriter()) } /// Generated protocol from Pigeon that represents a handler of messages from Flutter. @@ -191,7 +220,7 @@ protocol FileSelectorApi { /// /// An empty list corresponds to a cancelled selection. func displayOpenPanel( - options: OpenPanelOptions, completion: @escaping (Result<[String?], Error>) -> Void) + options: OpenPanelOptions, completion: @escaping (Result<[String], Error>) -> Void) /// Shows a save panel with the given [options], returning the selected path. /// /// A null return corresponds to a cancelled save. @@ -201,17 +230,21 @@ protocol FileSelectorApi { /// Generated setup class from Pigeon to handle messages through the `binaryMessenger`. class FileSelectorApiSetup { - /// The codec used by FileSelectorApi. - static var codec: FlutterStandardMessageCodec { FileSelectorApiCodec.shared } + static var codec: FlutterStandardMessageCodec { messagesPigeonCodec.shared } /// Sets up an instance of `FileSelectorApi` to handle messages through the `binaryMessenger`. - static func setUp(binaryMessenger: FlutterBinaryMessenger, api: FileSelectorApi?) { + static func setUp( + binaryMessenger: FlutterBinaryMessenger, api: FileSelectorApi?, + messageChannelSuffix: String = "" + ) { + let channelSuffix = messageChannelSuffix.count > 0 ? ".\(messageChannelSuffix)" : "" /// Shows an open panel with the given [options], returning the list of /// selected paths. /// /// An empty list corresponds to a cancelled selection. let displayOpenPanelChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.FileSelectorApi.displayOpenPanel", binaryMessenger: binaryMessenger, - codec: codec) + name: + "dev.flutter.pigeon.file_selector_macos.FileSelectorApi.displayOpenPanel\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { displayOpenPanelChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -232,8 +265,9 @@ class FileSelectorApiSetup { /// /// A null return corresponds to a cancelled save. let displaySavePanelChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.FileSelectorApi.displaySavePanel", binaryMessenger: binaryMessenger, - codec: codec) + name: + "dev.flutter.pigeon.file_selector_macos.FileSelectorApi.displaySavePanel\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { displaySavePanelChannel.setMessageHandler { message, reply in let args = message as! [Any?] diff --git a/packages/file_selector/file_selector_macos/pigeons/messages.dart b/packages/file_selector/file_selector_macos/pigeons/messages.dart index 698ebcfc1002..6b80c3d29c48 100644 --- a/packages/file_selector/file_selector_macos/pigeons/messages.dart +++ b/packages/file_selector/file_selector_macos/pigeons/messages.dart @@ -20,12 +20,9 @@ class AllowedTypes { this.utis = const [], }); - // TODO(stuartmorgan): Declare these as non-nullable generics once - // https://github.com/flutter/flutter/issues/97848 is fixed. In practice, - // the values will never be null, and the native implementation assumes that. - final List extensions; - final List mimeTypes; - final List utis; + final List extensions; + final List mimeTypes; + final List utis; } /// Options for save panels. @@ -50,10 +47,10 @@ class SavePanelOptions { /// These correspond to NSOpenPanel properties. class OpenPanelOptions extends SavePanelOptions { const OpenPanelOptions({ - this.allowsMultipleSelection = false, - this.canChooseDirectories = false, - this.canChooseFiles = true, - this.baseOptions = const SavePanelOptions(), + required this.allowsMultipleSelection, + required this.canChooseDirectories, + required this.canChooseFiles, + required this.baseOptions, }); final bool allowsMultipleSelection; final bool canChooseDirectories; @@ -71,11 +68,8 @@ abstract class FileSelectorApi { /// selected paths. /// /// An empty list corresponds to a cancelled selection. - // TODO(stuartmorgan): Declare this return as a non-nullable generic once - // https://github.com/flutter/flutter/issues/97848 is fixed. In practice, - // the values will never be null, and the calling code assumes that. @async - List displayOpenPanel(OpenPanelOptions options); + List displayOpenPanel(OpenPanelOptions options); /// Shows a save panel with the given [options], returning the selected path. /// diff --git a/packages/file_selector/file_selector_macos/pubspec.yaml b/packages/file_selector/file_selector_macos/pubspec.yaml index eede201e8d92..580eca085ee7 100644 --- a/packages/file_selector/file_selector_macos/pubspec.yaml +++ b/packages/file_selector/file_selector_macos/pubspec.yaml @@ -2,7 +2,7 @@ name: file_selector_macos description: macOS implementation of the file_selector plugin. repository: https://github.com/flutter/packages/tree/main/packages/file_selector/file_selector_macos issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+file_selector%22 -version: 0.9.4 +version: 0.9.4+2 environment: sdk: ^3.3.0 @@ -26,8 +26,8 @@ dev_dependencies: build_runner: ^2.3.2 flutter_test: sdk: flutter - mockito: 5.4.4 - pigeon: ^10.1.3 + mockito: ^5.4.4 + pigeon: ^22.4.1 topics: - files diff --git a/packages/file_selector/file_selector_macos/test/file_selector_macos_test.dart b/packages/file_selector/file_selector_macos/test/file_selector_macos_test.dart index c7268a6be891..39534230f010 100644 --- a/packages/file_selector/file_selector_macos/test/file_selector_macos_test.dart +++ b/packages/file_selector/file_selector_macos/test/file_selector_macos_test.dart @@ -22,12 +22,12 @@ void main() { setUp(() { plugin = FileSelectorMacOS(); mockApi = MockTestFileSelectorApi(); - TestFileSelectorApi.setup(mockApi); + TestFileSelectorApi.setUp(mockApi); // Set default stubs for tests that don't expect a specific return value, // so calls don't throw. Tests that `expect` return values should override // these locally. - when(mockApi.displayOpenPanel(any)).thenAnswer((_) async => []); + when(mockApi.displayOpenPanel(any)).thenAnswer((_) async => []); when(mockApi.displaySavePanel(any)).thenAnswer((_) async => null); }); @@ -39,7 +39,7 @@ void main() { group('openFile', () { test('works as expected with no arguments', () async { when(mockApi.displayOpenPanel(any)) - .thenAnswer((_) async => ['foo']); + .thenAnswer((_) async => ['foo']); final XFile? file = await plugin.openFile(); @@ -57,7 +57,7 @@ void main() { }); test('handles cancel', () async { - when(mockApi.displayOpenPanel(any)).thenAnswer((_) async => []); + when(mockApi.displayOpenPanel(any)).thenAnswer((_) async => []); final XFile? file = await plugin.openFile(); @@ -134,7 +134,7 @@ void main() { group('openFiles', () { test('works as expected with no arguments', () async { when(mockApi.displayOpenPanel(any)) - .thenAnswer((_) async => ['foo', 'bar']); + .thenAnswer((_) async => ['foo', 'bar']); final List files = await plugin.openFiles(); @@ -153,7 +153,7 @@ void main() { }); test('handles cancel', () async { - when(mockApi.displayOpenPanel(any)).thenAnswer((_) async => []); + when(mockApi.displayOpenPanel(any)).thenAnswer((_) async => []); final List files = await plugin.openFiles(); @@ -467,7 +467,7 @@ void main() { group('getDirectoryPath', () { test('works as expected with no arguments', () async { when(mockApi.displayOpenPanel(any)) - .thenAnswer((_) async => ['foo']); + .thenAnswer((_) async => ['foo']); final String? path = await plugin.getDirectoryPath(); @@ -485,7 +485,7 @@ void main() { }); test('handles cancel', () async { - when(mockApi.displayOpenPanel(any)).thenAnswer((_) async => []); + when(mockApi.displayOpenPanel(any)).thenAnswer((_) async => []); final String? path = await plugin.getDirectoryPath(); @@ -533,7 +533,7 @@ void main() { }); test('handles cancel', () async { - when(mockApi.displayOpenPanel(any)).thenAnswer((_) async => []); + when(mockApi.displayOpenPanel(any)).thenAnswer((_) async => []); final List paths = await plugin.getDirectoryPaths(); 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 6743cfa138ea..63ade67d21a3 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 @@ -33,14 +33,14 @@ class MockTestFileSelectorApi extends _i1.Mock } @override - _i3.Future> displayOpenPanel(_i4.OpenPanelOptions? options) => + _i3.Future> displayOpenPanel(_i4.OpenPanelOptions? options) => (super.noSuchMethod( Invocation.method( #displayOpenPanel, [options], ), - returnValue: _i3.Future>.value([]), - ) as _i3.Future>); + returnValue: _i3.Future>.value([]), + ) as _i3.Future>); @override _i3.Future displaySavePanel(_i4.SavePanelOptions? options) => diff --git a/packages/file_selector/file_selector_macos/test/messages_test.g.dart b/packages/file_selector/file_selector_macos/test/messages_test.g.dart index 893161f8e811..98f1e560b9e0 100644 --- a/packages/file_selector/file_selector_macos/test/messages_test.g.dart +++ b/packages/file_selector/file_selector_macos/test/messages_test.g.dart @@ -1,9 +1,9 @@ // 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 (v10.1.3), do not edit directly. +// Autogenerated from Pigeon (v22.4.1), 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, unnecessary_import +// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, unnecessary_import, no_leading_underscores_for_local_identifiers // ignore_for_file: avoid_relative_lib_imports import 'dart:async'; import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List; @@ -13,19 +13,22 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:file_selector_macos/src/messages.g.dart'; -class _TestFileSelectorApiCodec extends StandardMessageCodec { - const _TestFileSelectorApiCodec(); +class _PigeonCodec extends StandardMessageCodec { + const _PigeonCodec(); @override void writeValue(WriteBuffer buffer, Object? value) { - if (value is AllowedTypes) { - buffer.putUint8(128); - writeValue(buffer, value.encode()); - } else if (value is OpenPanelOptions) { + if (value is int) { + buffer.putUint8(4); + buffer.putInt64(value); + } else if (value is AllowedTypes) { buffer.putUint8(129); writeValue(buffer, value.encode()); } else if (value is SavePanelOptions) { buffer.putUint8(130); writeValue(buffer, value.encode()); + } else if (value is OpenPanelOptions) { + buffer.putUint8(131); + writeValue(buffer, value.encode()); } else { super.writeValue(buffer, value); } @@ -34,12 +37,12 @@ class _TestFileSelectorApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: - return AllowedTypes.decode(readValue(buffer)!); case 129: - return OpenPanelOptions.decode(readValue(buffer)!); + return AllowedTypes.decode(readValue(buffer)!); case 130: return SavePanelOptions.decode(readValue(buffer)!); + case 131: + return OpenPanelOptions.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); } @@ -49,62 +52,88 @@ class _TestFileSelectorApiCodec extends StandardMessageCodec { abstract class TestFileSelectorApi { static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; - static const MessageCodec codec = _TestFileSelectorApiCodec(); + static const MessageCodec pigeonChannelCodec = _PigeonCodec(); /// Shows an open panel with the given [options], returning the list of /// selected paths. /// /// An empty list corresponds to a cancelled selection. - Future> displayOpenPanel(OpenPanelOptions options); + Future> displayOpenPanel(OpenPanelOptions options); /// Shows a save panel with the given [options], returning the selected path. /// /// A null return corresponds to a cancelled save. Future displaySavePanel(SavePanelOptions options); - static void setup(TestFileSelectorApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setUp( + TestFileSelectorApi? api, { + BinaryMessenger? binaryMessenger, + String messageChannelSuffix = '', + }) { + messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.FileSelectorApi.displayOpenPanel', codec, + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.file_selector_macos.FileSelectorApi.displayOpenPanel$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.FileSelectorApi.displayOpenPanel was null.'); + 'Argument for dev.flutter.pigeon.file_selector_macos.FileSelectorApi.displayOpenPanel was null.'); final List args = (message as List?)!; final OpenPanelOptions? arg_options = (args[0] as OpenPanelOptions?); assert(arg_options != null, - 'Argument for dev.flutter.pigeon.FileSelectorApi.displayOpenPanel was null, expected non-null OpenPanelOptions.'); - final List output = await api.displayOpenPanel(arg_options!); - return [output]; + 'Argument for dev.flutter.pigeon.file_selector_macos.FileSelectorApi.displayOpenPanel was null, expected non-null OpenPanelOptions.'); + try { + final List output = + await api.displayOpenPanel(arg_options!); + return [output]; + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } }); } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.FileSelectorApi.displaySavePanel', codec, + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.file_selector_macos.FileSelectorApi.displaySavePanel$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.FileSelectorApi.displaySavePanel was null.'); + 'Argument for dev.flutter.pigeon.file_selector_macos.FileSelectorApi.displaySavePanel was null.'); final List args = (message as List?)!; final SavePanelOptions? arg_options = (args[0] as SavePanelOptions?); assert(arg_options != null, - 'Argument for dev.flutter.pigeon.FileSelectorApi.displaySavePanel was null, expected non-null SavePanelOptions.'); - final String? output = await api.displaySavePanel(arg_options!); - return [output]; + 'Argument for dev.flutter.pigeon.file_selector_macos.FileSelectorApi.displaySavePanel was null, expected non-null SavePanelOptions.'); + try { + final String? output = await api.displaySavePanel(arg_options!); + return [output]; + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } }); } } diff --git a/packages/file_selector/file_selector_windows/CHANGELOG.md b/packages/file_selector/file_selector_windows/CHANGELOG.md index b321feacbc65..77b5c11c4754 100644 --- a/packages/file_selector/file_selector_windows/CHANGELOG.md +++ b/packages/file_selector/file_selector_windows/CHANGELOG.md @@ -1,5 +1,6 @@ -## NEXT +## 0.9.3+3 +* Updates Pigeon for non-nullable collection type support. * Updates minimum supported SDK version to Flutter 3.19/Dart 3.3. ## 0.9.3+2 diff --git a/packages/file_selector/file_selector_windows/lib/file_selector_windows.dart b/packages/file_selector/file_selector_windows/lib/file_selector_windows.dart index 96f53b6ca0f7..150e165fd215 100644 --- a/packages/file_selector/file_selector_windows/lib/file_selector_windows.dart +++ b/packages/file_selector/file_selector_windows/lib/file_selector_windows.dart @@ -27,7 +27,7 @@ class FileSelectorWindows extends FileSelectorPlatform { ), initialDirectory, confirmButtonText); - return result.paths.isEmpty ? null : XFile(result.paths.first!); + return result.paths.isEmpty ? null : XFile(result.paths.first); } @override @@ -78,7 +78,7 @@ class FileSelectorWindows extends FileSelectorPlatform { final int? groupIndex = result.typeGroupIndex; return result.paths.isEmpty ? null - : FileSaveLocation(result.paths.first!, + : FileSaveLocation(result.paths.first, activeFilter: groupIndex == null ? null : acceptedTypeGroups?[groupIndex]); } @@ -95,7 +95,7 @@ class FileSelectorWindows extends FileSelectorPlatform { ), initialDirectory, confirmButtonText); - return result.paths.isEmpty ? null : result.paths.first!; + return result.paths.isEmpty ? null : result.paths.first; } @override diff --git a/packages/file_selector/file_selector_windows/lib/src/messages.g.dart b/packages/file_selector/file_selector_windows/lib/src/messages.g.dart index 12f57b1969e4..6ec5eee613cd 100644 --- a/packages/file_selector/file_selector_windows/lib/src/messages.g.dart +++ b/packages/file_selector/file_selector_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 (v21.0.0), do not edit directly. +// Autogenerated from Pigeon (v22.4.1), 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, no_leading_underscores_for_local_identifiers @@ -37,7 +37,7 @@ class TypeGroup { String label; - List extensions; + List extensions; Object encode() { return [ @@ -50,7 +50,7 @@ class TypeGroup { result as List; return TypeGroup( label: result[0]! as String, - extensions: (result[1] as List?)!.cast(), + extensions: (result[1] as List?)!.cast(), ); } } @@ -59,14 +59,14 @@ class SelectionOptions { SelectionOptions({ this.allowMultiple = false, this.selectFolders = false, - this.allowedTypes = const [], + this.allowedTypes = const [], }); bool allowMultiple; bool selectFolders; - List allowedTypes; + List allowedTypes; Object encode() { return [ @@ -81,7 +81,7 @@ class SelectionOptions { return SelectionOptions( allowMultiple: result[0]! as bool, selectFolders: result[1]! as bool, - allowedTypes: (result[2] as List?)!.cast(), + allowedTypes: (result[2] as List?)!.cast(), ); } } @@ -96,7 +96,7 @@ class FileDialogResult { /// The selected paths. /// /// Empty if the dialog was canceled. - List paths; + List paths; /// The type group index (into the list provided in [SelectionOptions]) of /// the group that was selected when the dialog was confirmed. @@ -114,7 +114,7 @@ class FileDialogResult { static FileDialogResult decode(Object result) { result as List; return FileDialogResult( - paths: (result[0] as List?)!.cast(), + paths: (result[0] as List?)!.cast(), typeGroupIndex: result[1] as int?, ); } @@ -124,7 +124,10 @@ class _PigeonCodec extends StandardMessageCodec { const _PigeonCodec(); @override void writeValue(WriteBuffer buffer, Object? value) { - if (value is TypeGroup) { + if (value is int) { + buffer.putUint8(4); + buffer.putInt64(value); + } else if (value is TypeGroup) { buffer.putUint8(129); writeValue(buffer, value.encode()); } else if (value is SelectionOptions) { @@ -159,43 +162,43 @@ class FileSelectorApi { /// BinaryMessenger will be used which routes to the host platform. FileSelectorApi( {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) - : __pigeon_binaryMessenger = binaryMessenger, - __pigeon_messageChannelSuffix = + : pigeonVar_binaryMessenger = binaryMessenger, + pigeonVar_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; - final BinaryMessenger? __pigeon_binaryMessenger; + final BinaryMessenger? pigeonVar_binaryMessenger; static const MessageCodec pigeonChannelCodec = _PigeonCodec(); - final String __pigeon_messageChannelSuffix; + final String pigeonVar_messageChannelSuffix; Future showOpenDialog(SelectionOptions options, String? initialDirectory, String? confirmButtonText) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.file_selector_windows.FileSelectorApi.showOpenDialog$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.file_selector_windows.FileSelectorApi.showOpenDialog$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel + final List? pigeonVar_replyList = await pigeonVar_channel .send([options, initialDirectory, confirmButtonText]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as FileDialogResult?)!; + return (pigeonVar_replyList[0] as FileDialogResult?)!; } } @@ -204,36 +207,36 @@ class FileSelectorApi { String? initialDirectory, String? suggestedName, String? confirmButtonText) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.file_selector_windows.FileSelectorApi.showSaveDialog$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.file_selector_windows.FileSelectorApi.showSaveDialog$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel + final List? pigeonVar_replyList = await pigeonVar_channel .send([ options, initialDirectory, suggestedName, confirmButtonText ]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as FileDialogResult?)!; + return (pigeonVar_replyList[0] as FileDialogResult?)!; } } } diff --git a/packages/file_selector/file_selector_windows/pigeons/messages.dart b/packages/file_selector/file_selector_windows/pigeons/messages.dart index 8f82aec0b838..75ba308dc14e 100644 --- a/packages/file_selector/file_selector_windows/pigeons/messages.dart +++ b/packages/file_selector/file_selector_windows/pigeons/messages.dart @@ -16,25 +16,18 @@ class TypeGroup { TypeGroup(this.label, {required this.extensions}); String label; - // TODO(stuartmorgan): Make the generic type non-nullable once supported. - // https://github.com/flutter/flutter/issues/97848 - // The C++ code treats all of it as non-nullable. - List extensions; + List extensions; } class SelectionOptions { SelectionOptions({ this.allowMultiple = false, this.selectFolders = false, - this.allowedTypes = const [], + this.allowedTypes = const [], }); bool allowMultiple; bool selectFolders; - - // TODO(stuartmorgan): Make the generic type non-nullable once supported. - // https://github.com/flutter/flutter/issues/97848 - // The C++ code treats the values as non-nullable. - List allowedTypes; + List allowedTypes; } /// The result from an open or save dialog. @@ -44,10 +37,7 @@ class FileDialogResult { /// The selected paths. /// /// Empty if the dialog was canceled. - // TODO(stuartmorgan): Make the generic type non-nullable once supported. - // https://github.com/flutter/flutter/issues/97848 - // The Dart code treats the values as non-nullable. - List paths; + List paths; /// The type group index (into the list provided in [SelectionOptions]) of /// the group that was selected when the dialog was confirmed. diff --git a/packages/file_selector/file_selector_windows/pubspec.yaml b/packages/file_selector/file_selector_windows/pubspec.yaml index 26c111c40d8e..f2631787d6fe 100644 --- a/packages/file_selector/file_selector_windows/pubspec.yaml +++ b/packages/file_selector/file_selector_windows/pubspec.yaml @@ -2,7 +2,7 @@ name: file_selector_windows description: Windows implementation of the file_selector plugin. repository: https://github.com/flutter/packages/tree/main/packages/file_selector/file_selector_windows issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+file_selector%22 -version: 0.9.3+2 +version: 0.9.3+3 environment: sdk: ^3.3.0 @@ -26,8 +26,8 @@ dev_dependencies: build_runner: ^2.3.0 flutter_test: sdk: flutter - mockito: 5.4.4 - pigeon: ^21.0.0 + mockito: ^5.4.4 + pigeon: ^22.4.1 topics: - files diff --git a/packages/file_selector/file_selector_windows/test/file_selector_windows_test.dart b/packages/file_selector/file_selector_windows/test/file_selector_windows_test.dart index 4d67562f03cd..3a4510672f29 100644 --- a/packages/file_selector/file_selector_windows/test/file_selector_windows_test.dart +++ b/packages/file_selector/file_selector_windows/test/file_selector_windows_test.dart @@ -33,7 +33,7 @@ void main() { group('openFile', () { setUp(() { when(mockApi.showOpenDialog(any, any, any)) - .thenReturn(FileDialogResult(paths: ['foo'])); + .thenReturn(FileDialogResult(paths: ['foo'])); }); test('simple call works', () async { @@ -109,7 +109,7 @@ void main() { group('openFiles', () { setUp(() { when(mockApi.showOpenDialog(any, any, any)) - .thenReturn(FileDialogResult(paths: ['foo', 'bar'])); + .thenReturn(FileDialogResult(paths: ['foo', 'bar'])); }); test('simple call works', () async { @@ -186,7 +186,7 @@ void main() { group('getDirectoryPath', () { setUp(() { when(mockApi.showOpenDialog(any, any, any)) - .thenReturn(FileDialogResult(paths: ['foo'])); + .thenReturn(FileDialogResult(paths: ['foo'])); }); test('simple call works', () async { @@ -216,11 +216,11 @@ void main() { group('getDirectoryPaths', () { setUp(() { when(mockApi.showOpenDialog(any, any, any)) - .thenReturn(FileDialogResult(paths: ['foo', 'bar'])); + .thenReturn(FileDialogResult(paths: ['foo', 'bar'])); }); test('simple call works', () async { - final List paths = await plugin.getDirectoryPaths(); + final List paths = await plugin.getDirectoryPaths(); expect(paths[0], 'foo'); expect(paths[1], 'bar'); @@ -247,7 +247,7 @@ void main() { group('getSaveLocation', () { setUp(() { when(mockApi.showSaveDialog(any, any, any, any)) - .thenReturn(FileDialogResult(paths: ['foo'])); + .thenReturn(FileDialogResult(paths: ['foo'])); }); test('simple call works', () async { @@ -291,7 +291,7 @@ void main() { test('returns the selected type group correctly', () async { when(mockApi.showSaveDialog(any, any, any, any)).thenReturn( - FileDialogResult(paths: ['foo'], typeGroupIndex: 1)); + FileDialogResult(paths: ['foo'], typeGroupIndex: 1)); const XTypeGroup group = XTypeGroup( label: 'text', extensions: ['txt'], @@ -359,7 +359,7 @@ void main() { group('getSavePath (deprecated)', () { setUp(() { when(mockApi.showSaveDialog(any, any, any, any)) - .thenReturn(FileDialogResult(paths: ['foo'])); + .thenReturn(FileDialogResult(paths: ['foo'])); }); test('simple call works', () async { diff --git a/packages/file_selector/file_selector_windows/test/test_api.g.dart b/packages/file_selector/file_selector_windows/test/test_api.g.dart index 2f9cabdef2df..018f425bf1d8 100644 --- a/packages/file_selector/file_selector_windows/test/test_api.g.dart +++ b/packages/file_selector/file_selector_windows/test/test_api.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 (v21.0.0), do not edit directly. +// Autogenerated from Pigeon (v22.4.1), 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, unnecessary_import, no_leading_underscores_for_local_identifiers // ignore_for_file: avoid_relative_lib_imports @@ -17,7 +17,10 @@ class _PigeonCodec extends StandardMessageCodec { const _PigeonCodec(); @override void writeValue(WriteBuffer buffer, Object? value) { - if (value is TypeGroup) { + if (value is int) { + buffer.putUint8(4); + buffer.putInt64(value); + } else if (value is TypeGroup) { buffer.putUint8(129); writeValue(buffer, value.encode()); } else if (value is SelectionOptions) { @@ -68,17 +71,18 @@ abstract class TestFileSelectorApi { messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.file_selector_windows.FileSelectorApi.showOpenDialog$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.file_selector_windows.FileSelectorApi.showOpenDialog was null.'); @@ -102,17 +106,18 @@ abstract class TestFileSelectorApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.file_selector_windows.FileSelectorApi.showSaveDialog$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.file_selector_windows.FileSelectorApi.showSaveDialog was null.'); diff --git a/packages/file_selector/file_selector_windows/windows/messages.g.cpp b/packages/file_selector/file_selector_windows/windows/messages.g.cpp index fc145c6740f1..f831e50ead39 100644 --- a/packages/file_selector/file_selector_windows/windows/messages.g.cpp +++ b/packages/file_selector/file_selector_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 (v21.0.0), do not edit directly. +// Autogenerated from Pigeon (v22.4.1), do not edit directly. // See also: https://pub.dev/packages/pigeon #undef _HAS_EXCEPTIONS @@ -149,31 +149,34 @@ FileDialogResult FileDialogResult::FromEncodableList( FileDialogResult decoded(std::get(list[0])); auto& encodable_type_group_index = list[1]; if (!encodable_type_group_index.IsNull()) { - decoded.set_type_group_index(encodable_type_group_index.LongValue()); + decoded.set_type_group_index(std::get(encodable_type_group_index)); } return decoded; } -PigeonCodecSerializer::PigeonCodecSerializer() {} +PigeonInternalCodecSerializer::PigeonInternalCodecSerializer() {} -EncodableValue PigeonCodecSerializer::ReadValueOfType( +EncodableValue PigeonInternalCodecSerializer::ReadValueOfType( uint8_t type, flutter::ByteStreamReader* stream) const { switch (type) { - case 129: + case 129: { return CustomEncodableValue(TypeGroup::FromEncodableList( std::get(ReadValue(stream)))); - case 130: + } + case 130: { return CustomEncodableValue(SelectionOptions::FromEncodableList( std::get(ReadValue(stream)))); - case 131: + } + case 131: { return CustomEncodableValue(FileDialogResult::FromEncodableList( std::get(ReadValue(stream)))); + } default: return flutter::StandardCodecSerializer::ReadValueOfType(type, stream); } } -void PigeonCodecSerializer::WriteValue( +void PigeonInternalCodecSerializer::WriteValue( const EncodableValue& value, flutter::ByteStreamWriter* stream) const { if (const CustomEncodableValue* custom_value = std::get_if(&value)) { @@ -207,7 +210,7 @@ void PigeonCodecSerializer::WriteValue( /// The codec used by FileSelectorApi. const flutter::StandardMessageCodec& FileSelectorApi::GetCodec() { return flutter::StandardMessageCodec::GetInstance( - &PigeonCodecSerializer::GetInstance()); + &PigeonInternalCodecSerializer::GetInstance()); } // Sets up an instance of `FileSelectorApi` to handle messages through the diff --git a/packages/file_selector/file_selector_windows/windows/messages.g.h b/packages/file_selector/file_selector_windows/windows/messages.g.h index 43f671480501..edd0865d78c3 100644 --- a/packages/file_selector/file_selector_windows/windows/messages.g.h +++ b/packages/file_selector/file_selector_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 (v21.0.0), do not edit directly. +// Autogenerated from Pigeon (v22.4.1), do not edit directly. // See also: https://pub.dev/packages/pigeon #ifndef PIGEON_MESSAGES_G_H_ @@ -75,7 +75,7 @@ class TypeGroup { static TypeGroup FromEncodableList(const flutter::EncodableList& list); flutter::EncodableList ToEncodableList() const; friend class FileSelectorApi; - friend class PigeonCodecSerializer; + friend class PigeonInternalCodecSerializer; std::string label_; flutter::EncodableList extensions_; }; @@ -100,7 +100,7 @@ class SelectionOptions { static SelectionOptions FromEncodableList(const flutter::EncodableList& list); flutter::EncodableList ToEncodableList() const; friend class FileSelectorApi; - friend class PigeonCodecSerializer; + friend class PigeonInternalCodecSerializer; bool allow_multiple_; bool select_folders_; flutter::EncodableList allowed_types_; @@ -136,16 +136,16 @@ class FileDialogResult { static FileDialogResult FromEncodableList(const flutter::EncodableList& list); flutter::EncodableList ToEncodableList() const; friend class FileSelectorApi; - friend class PigeonCodecSerializer; + friend class PigeonInternalCodecSerializer; flutter::EncodableList paths_; std::optional type_group_index_; }; -class PigeonCodecSerializer : public flutter::StandardCodecSerializer { +class PigeonInternalCodecSerializer : public flutter::StandardCodecSerializer { public: - PigeonCodecSerializer(); - inline static PigeonCodecSerializer& GetInstance() { - static PigeonCodecSerializer sInstance; + PigeonInternalCodecSerializer(); + inline static PigeonInternalCodecSerializer& GetInstance() { + static PigeonInternalCodecSerializer sInstance; return sInstance; } diff --git a/packages/flutter_adaptive_scaffold/CHANGELOG.md b/packages/flutter_adaptive_scaffold/CHANGELOG.md index 5d65f72a5efe..69ffdcd0a516 100644 --- a/packages/flutter_adaptive_scaffold/CHANGELOG.md +++ b/packages/flutter_adaptive_scaffold/CHANGELOG.md @@ -1,3 +1,40 @@ +## 0.3.1 + +* Use improved MediaQuery methods. + +## 0.3.0 + +* Adds `inDuration`, `outDuration`, `inCurve`, and `outCurve` parameters for +configuring additional `SlotLayoutConfig` animation behavior. +* **BREAKING CHANGES**: + * Removes `duration` parameter from `SlotLayoutConfig`. + +## 0.2.6 + +* Add new sample for using AdaptiveScaffold with GoRouter. + +## 0.2.5 + +* Fix breakpoint not being active in certain cases like foldables. + +## 0.2.4 + +* Compare breakpoints to each other using operators. + +## 0.2.3 + +* Update the spacing and margins to the latest material m3 specs. +* Add `margin`, `spacing`, `padding`, `recommendedPanes` and `maxPanes` with their Material value to `Breakpoint`. + +## 0.2.2 + +* Fix a bug where landscape would not show body when using `andUp`. + +## 0.2.1 + +* Add `Breakpoint.activeBreakpointOf(context)` to find the currently active breakpoint. +* Don't check for height on Desktop platforms. + ## 0.2.0 * Add breakpoints for mediumLarge and extraLarge. diff --git a/packages/flutter_adaptive_scaffold/README.md b/packages/flutter_adaptive_scaffold/README.md index 77b0a11c480d..45fa01a241c8 100644 --- a/packages/flutter_adaptive_scaffold/README.md +++ b/packages/flutter_adaptive_scaffold/README.md @@ -1,5 +1,3 @@ - - # Adaptive Scaffold `AdaptiveScaffold` reacts to input from users, devices and screen elements and @@ -33,7 +31,7 @@ animation should use `AdaptiveLayout`. ### Example Usage - + ```dart @override Widget build(BuildContext context) { @@ -128,6 +126,126 @@ Widget build(BuildContext context) { These are the set of widgets that are used on a lower level and offer more customizability at a cost of more lines of code. +### Breakpoint + +A `Breakpoint` controls the responsive behavior at different screens and configurations. + +You can either use a predefined Material3 breakpoint or create your own. + + +```dart +/// Returns a const [Breakpoint] with the given constraints. +const Breakpoint({ + this.beginWidth, + this.endWidth, + this.beginHeight, + this.endHeight, + this.andUp = false, + this.platform, + this.spacing = kMaterialMediumAndUpSpacing, + this.margin = kMaterialMediumAndUpMargin, + this.padding = kMaterialPadding, + this.recommendedPanes = 1, + this.maxPanes = 1, +}); + +/// Returns a [Breakpoint] that can be used as a fallthrough in the +/// case that no other breakpoint is active. +const Breakpoint.standard({this.platform}) + : beginWidth = -1, + endWidth = null, + beginHeight = null, + endHeight = null, + spacing = kMaterialMediumAndUpSpacing, + margin = kMaterialMediumAndUpMargin, + padding = kMaterialPadding, + recommendedPanes = 1, + maxPanes = 1, + andUp = true; + +/// Returns a [Breakpoint] with the given constraints for a small screen. +const Breakpoint.small({this.andUp = false, this.platform}) + : beginWidth = 0, + endWidth = 600, + beginHeight = null, + endHeight = 480, + spacing = kMaterialCompactSpacing, + margin = kMaterialCompactMargin, + padding = kMaterialPadding, + recommendedPanes = 1, + maxPanes = 1; + +/// Returns a [Breakpoint] with the given constraints for a medium screen. +const Breakpoint.medium({this.andUp = false, this.platform}) + : beginWidth = 600, + endWidth = 840, + beginHeight = 480, + endHeight = 900, + spacing = kMaterialMediumAndUpSpacing, + margin = kMaterialMediumAndUpMargin, + padding = kMaterialPadding * 2, + recommendedPanes = 1, + maxPanes = 2; + +/// Returns a [Breakpoint] with the given constraints for a mediumLarge screen. +const Breakpoint.mediumLarge({this.andUp = false, this.platform}) + : beginWidth = 840, + endWidth = 1200, + beginHeight = 900, + endHeight = null, + spacing = kMaterialMediumAndUpSpacing, + margin = kMaterialMediumAndUpMargin, + padding = kMaterialPadding * 3, + recommendedPanes = 2, + maxPanes = 2; + +/// Returns a [Breakpoint] with the given constraints for a large screen. +const Breakpoint.large({this.andUp = false, this.platform}) + : beginWidth = 1200, + endWidth = 1600, + beginHeight = 900, + endHeight = null, + spacing = kMaterialMediumAndUpSpacing, + margin = kMaterialMediumAndUpMargin, + padding = kMaterialPadding * 4, + recommendedPanes = 2, + maxPanes = 2; + +/// Returns a [Breakpoint] with the given constraints for an extraLarge screen. +const Breakpoint.extraLarge({this.andUp = false, this.platform}) + : beginWidth = 1600, + endWidth = null, + beginHeight = 900, + endHeight = null, + spacing = kMaterialMediumAndUpSpacing, + margin = kMaterialMediumAndUpMargin, + padding = kMaterialPadding * 5, + recommendedPanes = 2, + maxPanes = 3; +``` + +It is possible to compare Breakpoints: + + +```dart +/// Returns true if this [Breakpoint] is greater than the given [Breakpoint]. +bool operator >(Breakpoint breakpoint) +// ··· +/// Returns true if this [Breakpoint] is less than the given [Breakpoint]. +bool operator <(Breakpoint breakpoint) +// ··· +/// Returns true if this [Breakpoint] is greater than or equal to the +/// given [Breakpoint]. +bool operator >=(Breakpoint breakpoint) +// ··· +/// Returns true if this [Breakpoint] is less than or equal to the +/// given [Breakpoint]. +bool operator <=(Breakpoint breakpoint) +// ··· +/// Returns true if this [Breakpoint] is between the given [Breakpoint]s. +bool between(Breakpoint lower, Breakpoint upper) +``` + ### AdaptiveLayout !["AdaptiveLayout's Assigned Slots Displayed on Screen"](example/demo_files/screenSlots.png) @@ -151,7 +269,7 @@ displayed and the entrance animation and exit animation. ### Example Usage - + ```dart // AdaptiveLayout has a number of slots that take SlotLayouts and these // SlotLayouts' configs take maps of Breakpoints to SlotLayoutConfigs. diff --git a/packages/flutter_adaptive_scaffold/example/README.md b/packages/flutter_adaptive_scaffold/example/README.md index 035288f0155e..a0ab2f7aad58 100644 --- a/packages/flutter_adaptive_scaffold/example/README.md +++ b/packages/flutter_adaptive_scaffold/example/README.md @@ -1,4 +1,5 @@ # Examples + There are several examples listed in this directory: You can run the following commands in the example directory to see the appropriate demos: @@ -7,3 +8,5 @@ You can run the following commands in the example directory to see the appropria `flutter run lib/adaptive_layout_demo.dart` to see a simple usage of AdaptiveLayout. `flutter run lib/adaptive_scaffold_demo.dart` to see a simple usage of AdaptiveScaffold. + +`flutter run lib/go_router_demo.dart` to see usage of AdaptiveScaffold with GoRouter and some advanced scenarios like auth handling and branches. diff --git a/packages/flutter_adaptive_scaffold/example/android/app/build.gradle b/packages/flutter_adaptive_scaffold/example/android/app/build.gradle index 9d27f54fdcb2..ac4a5d1ca358 100644 --- a/packages/flutter_adaptive_scaffold/example/android/app/build.gradle +++ b/packages/flutter_adaptive_scaffold/example/android/app/build.gradle @@ -30,12 +30,12 @@ android { ndkVersion flutter.ndkVersion compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_11 + targetCompatibility JavaVersion.VERSION_11 } kotlinOptions { - jvmTarget = '1.8' + jvmTarget = '11' } sourceSets { diff --git a/packages/flutter_adaptive_scaffold/example/android/build.gradle b/packages/flutter_adaptive_scaffold/example/android/build.gradle index d13ef556e261..5cf1eb221426 100644 --- a/packages/flutter_adaptive_scaffold/example/android/build.gradle +++ b/packages/flutter_adaptive_scaffold/example/android/build.gradle @@ -6,7 +6,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:7.4.2' + classpath 'com.android.tools.build:gradle:8.5.2' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } 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..3c85cfe057a1 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-8.7-all.zip diff --git a/packages/flutter_adaptive_scaffold/example/lib/go_router_demo.dart b/packages/flutter_adaptive_scaffold/example/lib/go_router_demo.dart new file mode 100644 index 000000000000..5918197d3765 --- /dev/null +++ b/packages/flutter_adaptive_scaffold/example/lib/go_router_demo.dart @@ -0,0 +1,33 @@ +// 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 'go_router_demo/app_router.dart'; + +void main() { + runApp(const MyApp()); +} + +/// The main application widget for this example. +class MyApp extends StatelessWidget { + /// Creates a const main application widget. + const MyApp({super.key}); + + @override + Widget build(BuildContext context) { + return MaterialApp.router( + restorationScopeId: 'demo', + routerConfig: AppRouter.router, + theme: ThemeData( + colorScheme: ColorScheme.fromSeed( + seedColor: Colors.blue, + dynamicSchemeVariant: DynamicSchemeVariant.vibrant, + primary: Colors.blue, + ), + useMaterial3: true, + ), + ); + } +} diff --git a/packages/flutter_adaptive_scaffold/example/lib/go_router_demo/app_router.dart b/packages/flutter_adaptive_scaffold/example/lib/go_router_demo/app_router.dart new file mode 100644 index 000000000000..ddb36662370c --- /dev/null +++ b/packages/flutter_adaptive_scaffold/example/lib/go_router_demo/app_router.dart @@ -0,0 +1,197 @@ +// 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:go_router/go_router.dart'; + +import 'pages/pages.dart'; +import 'scaffold_shell.dart'; + +/// The root navigator key for the main router of the app. +final GlobalKey rootNavigatorKey = + GlobalKey(debugLabel: 'root'); + +final GlobalKey _homeNavigatorKey = + GlobalKey(debugLabel: 'home'); +final GlobalKey _counterNavigatorKey = + GlobalKey(debugLabel: 'counter'); +final GlobalKey _moreNavigatorKey = + GlobalKey(debugLabel: 'more'); + +/// The [AppRouter] maintains the main route configuration for the app. +/// +/// Routes that are `fullScreenDialogs` should also set `_rootNavigatorKey` as +/// the `parentNavigatorKey` to ensure that the dialog is displayed correctly. +class AppRouter { + /// The authentication status of the user. + static ValueNotifier authenticatedNotifier = ValueNotifier(false); + + /// The router with the routes of pages that should be displayed. + static final GoRouter router = GoRouter( + navigatorKey: rootNavigatorKey, + debugLogDiagnostics: true, + errorPageBuilder: (BuildContext context, GoRouterState state) { + return const MaterialPage(child: NavigationErrorPage()); + }, + redirect: (BuildContext context, GoRouterState state) { + if (state.uri.path == '/') { + return HomePage.path; + } + return null; + }, + refreshListenable: authenticatedNotifier, + routes: [ + _unauthenticatedRoutes, + _authenticatedRoutes, + ..._openRoutes, + ], + ); + + static final GoRoute _unauthenticatedRoutes = GoRoute( + name: LoginPage.name, + path: LoginPage.path, + pageBuilder: (BuildContext context, GoRouterState state) { + return const MaterialPage(child: LoginPage()); + }, + redirect: (BuildContext context, GoRouterState state) { + if (authenticatedNotifier.value) { + return HomePage.path; + } + return null; + }, + routes: [ + GoRoute( + name: ForgotPasswordPage.name, + path: ForgotPasswordPage.path, + pageBuilder: (BuildContext context, GoRouterState state) { + return const MaterialPage( + child: ForgotPasswordPage(), + ); + }, + ), + ], + ); + + static final StatefulShellRoute _authenticatedRoutes = + StatefulShellRoute.indexedStack( + parentNavigatorKey: rootNavigatorKey, + builder: ( + BuildContext context, + GoRouterState state, + StatefulNavigationShell navigationShell, + ) { + return ScaffoldShell(navigationShell: navigationShell); + }, + redirect: (BuildContext context, GoRouterState state) { + if (!authenticatedNotifier.value) { + return LoginPage.path; + } + return null; + }, + branches: [ + StatefulShellBranch( + navigatorKey: _homeNavigatorKey, + routes: [ + GoRoute( + name: HomePage.name, + path: HomePage.path, + pageBuilder: (BuildContext context, GoRouterState state) { + return const NoTransitionPage( + child: HomePage(), + ); + }, + routes: [ + GoRoute( + name: DetailOverviewPage.name, + path: DetailOverviewPage.path, + pageBuilder: (BuildContext context, GoRouterState state) { + return const MaterialPage( + child: DetailOverviewPage(), + ); + }, + routes: [ + GoRoute( + name: DetailPage.name, + path: DetailPage.path, + pageBuilder: (BuildContext context, GoRouterState state) { + return MaterialPage( + child: DetailPage( + itemName: state.uri.queryParameters['itemName']!), + ); + }, + ), + ]), + GoRoute( + name: DetailModalPage.name, + path: DetailModalPage.path, + parentNavigatorKey: rootNavigatorKey, + pageBuilder: (BuildContext context, GoRouterState state) { + return const MaterialPage( + fullscreenDialog: true, + child: DetailModalPage(), + ); + }, + ), + ], + ), + ], + ), + StatefulShellBranch( + navigatorKey: _counterNavigatorKey, + routes: [ + GoRoute( + name: CounterPage.name, + path: CounterPage.path, + pageBuilder: (BuildContext context, GoRouterState state) { + return const NoTransitionPage(child: CounterPage()); + }, + ), + ], + ), + StatefulShellBranch( + navigatorKey: _moreNavigatorKey, + routes: [ + GoRoute( + name: MorePage.name, + path: MorePage.path, + pageBuilder: (BuildContext context, GoRouterState state) { + return const NoTransitionPage( + key: ValueKey(MorePage.name), + child: MorePage(), + ); + }, + routes: [ + GoRoute( + path: ProfilePage.path, + name: ProfilePage.name, + pageBuilder: (BuildContext context, GoRouterState state) { + return const MaterialPage(child: ProfilePage()); + }, + ), + GoRoute( + name: SettingsPage.name, + path: SettingsPage.path, + pageBuilder: (BuildContext context, GoRouterState state) { + return const MaterialPage(child: SettingsPage()); + }, + ), + ], + ), + ], + ), + ], + ); + + static final List _openRoutes = [ + GoRoute( + name: LanguagePage.name, + path: LanguagePage.path, + pageBuilder: (BuildContext context, GoRouterState state) { + return const MaterialPage( + child: LanguagePage(), + ); + }, + ), + ]; +} diff --git a/packages/flutter_adaptive_scaffold/example/lib/go_router_demo/pages/counter_page.dart b/packages/flutter_adaptive_scaffold/example/lib/go_router_demo/pages/counter_page.dart new file mode 100644 index 000000000000..59b5400a1459 --- /dev/null +++ b/packages/flutter_adaptive_scaffold/example/lib/go_router_demo/pages/counter_page.dart @@ -0,0 +1,29 @@ +// 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'; + +/// The counter page. +class CounterPage extends StatelessWidget { + /// Construct the counter page. + const CounterPage({super.key}); + + /// The path for the counter page. + static const String path = '/counter'; + + /// The name for the counter page. + static const String name = 'Counter'; + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: const Text('Counter Page'), + ), + body: const Center( + child: Text('Counter Page'), + ), + ); + } +} diff --git a/packages/flutter_adaptive_scaffold/example/lib/go_router_demo/pages/detail_modal_page.dart b/packages/flutter_adaptive_scaffold/example/lib/go_router_demo/pages/detail_modal_page.dart new file mode 100644 index 000000000000..6ce2d75a64ba --- /dev/null +++ b/packages/flutter_adaptive_scaffold/example/lib/go_router_demo/pages/detail_modal_page.dart @@ -0,0 +1,29 @@ +// 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'; + +/// The detail modal page. +class DetailModalPage extends StatelessWidget { + /// Construct the detail modal page. + const DetailModalPage({super.key}); + + /// The path for the detail modal page. + static const String path = 'detail-modal'; + + /// The name for the detail modal page. + static const String name = 'DetailModal'; + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: const Text('Detail Modal Page'), + ), + body: const Center( + child: Text('Detail modal Page'), + ), + ); + } +} diff --git a/packages/flutter_adaptive_scaffold/example/lib/go_router_demo/pages/detail_overview_page.dart b/packages/flutter_adaptive_scaffold/example/lib/go_router_demo/pages/detail_overview_page.dart new file mode 100644 index 000000000000..941338e4f128 --- /dev/null +++ b/packages/flutter_adaptive_scaffold/example/lib/go_router_demo/pages/detail_overview_page.dart @@ -0,0 +1,43 @@ +// 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:go_router/go_router.dart'; + +import 'detail_page.dart'; + +/// The detail overview page. +class DetailOverviewPage extends StatelessWidget { + /// Construct the detail overview page. + const DetailOverviewPage({super.key}); + + /// The path for the detail page. + static const String path = 'detail-overview'; + + /// The name for the detail page. + static const String name = 'DetailOverview'; + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: const Text('Detail Overview Page'), + ), + body: ListView.builder( + itemCount: 10, + itemBuilder: (BuildContext context, int index) { + return ListTile( + title: Text('Item $index'), + onTap: () { + context.goNamed( + DetailPage.name, + queryParameters: {'itemName': '$index'}, + ); + }, + ); + }, + ), + ); + } +} diff --git a/packages/flutter_adaptive_scaffold/example/lib/go_router_demo/pages/detail_page.dart b/packages/flutter_adaptive_scaffold/example/lib/go_router_demo/pages/detail_page.dart new file mode 100644 index 000000000000..0abc77f0ee61 --- /dev/null +++ b/packages/flutter_adaptive_scaffold/example/lib/go_router_demo/pages/detail_page.dart @@ -0,0 +1,32 @@ +// 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'; + +/// The detail page. +class DetailPage extends StatelessWidget { + /// Construct the detail page. + const DetailPage({super.key, required this.itemName}); + + /// The path for the detail page. + static const String path = 'detail'; + + /// The name for the detail page. + static const String name = 'Detail'; + + /// The item name for the detail page. + final String itemName; + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: const Text('Detail Page'), + ), + body: Center( + child: Text('Detail Page: $itemName'), + ), + ); + } +} diff --git a/packages/flutter_adaptive_scaffold/example/lib/go_router_demo/pages/forgot_password_page.dart b/packages/flutter_adaptive_scaffold/example/lib/go_router_demo/pages/forgot_password_page.dart new file mode 100644 index 000000000000..a680f5c55b24 --- /dev/null +++ b/packages/flutter_adaptive_scaffold/example/lib/go_router_demo/pages/forgot_password_page.dart @@ -0,0 +1,29 @@ +// 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'; + +/// The forgot password page. +class ForgotPasswordPage extends StatelessWidget { + /// Construct the forgot password page. + const ForgotPasswordPage({super.key}); + + /// The path for the forgot password page. + static const String path = 'forgot_password'; + + /// The name for the forgot password page. + static const String name = 'ForgotPassword'; + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: const Text('Forgot Password'), + ), + body: const Center( + child: Text('ForgotPassword Page'), + ), + ); + } +} diff --git a/packages/flutter_adaptive_scaffold/example/lib/go_router_demo/pages/home_page.dart b/packages/flutter_adaptive_scaffold/example/lib/go_router_demo/pages/home_page.dart new file mode 100644 index 000000000000..05dbbad56f6c --- /dev/null +++ b/packages/flutter_adaptive_scaffold/example/lib/go_router_demo/pages/home_page.dart @@ -0,0 +1,50 @@ +// 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_adaptive_scaffold/flutter_adaptive_scaffold.dart'; +import 'package:go_router/go_router.dart'; + +import 'pages.dart'; + +/// The home page. +class HomePage extends StatelessWidget { + /// Construct the home page. + const HomePage({super.key}); + + /// The path for the home page. + static const String path = '/home'; + + /// The name for the home page. + static const String name = 'Home'; + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: const Text('Home Page'), + ), + body: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + ElevatedButton( + onPressed: () => { + context.goNamed(DetailOverviewPage.name), + }, + child: const Text('Detail page'), + ), + const SizedBox(height: kMaterialMediumAndUpMargin), + ElevatedButton( + onPressed: () => { + context.goNamed(DetailModalPage.name), + }, + child: const Text('Detail modal page'), + ), + ], + ), + ), + ); + } +} diff --git a/packages/flutter_adaptive_scaffold/example/lib/go_router_demo/pages/language_page.dart b/packages/flutter_adaptive_scaffold/example/lib/go_router_demo/pages/language_page.dart new file mode 100644 index 000000000000..ee160726199e --- /dev/null +++ b/packages/flutter_adaptive_scaffold/example/lib/go_router_demo/pages/language_page.dart @@ -0,0 +1,29 @@ +// 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'; + +/// The language page. +class LanguagePage extends StatelessWidget { + /// Construct the language page. + const LanguagePage({super.key}); + + /// The path for the language page. + static const String path = '/language'; + + /// The name for the language page. + static const String name = 'Language'; + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: const Text('Language'), + ), + body: const Center( + child: Text('Language Page'), + ), + ); + } +} diff --git a/packages/flutter_adaptive_scaffold/example/lib/go_router_demo/pages/login_page.dart b/packages/flutter_adaptive_scaffold/example/lib/go_router_demo/pages/login_page.dart new file mode 100644 index 000000000000..32084550c618 --- /dev/null +++ b/packages/flutter_adaptive_scaffold/example/lib/go_router_demo/pages/login_page.dart @@ -0,0 +1,40 @@ +// 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 '../app_router.dart'; + +/// The login page. +class LoginPage extends StatelessWidget { + /// Construct the login page. + const LoginPage({super.key}); + + /// The path for the login page. + static const String path = '/login'; + + /// The name for the login page. + static const String name = 'Login'; + + @override + Widget build(BuildContext context) { + return Scaffold( + body: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + const Text('Login Page'), + const SizedBox(height: 16), + ElevatedButton( + onPressed: () => { + AppRouter.authenticatedNotifier.value = true, + }, + child: const Text('Login'), + ), + ], + ), + ), + ); + } +} diff --git a/packages/flutter_adaptive_scaffold/example/lib/go_router_demo/pages/more_page.dart b/packages/flutter_adaptive_scaffold/example/lib/go_router_demo/pages/more_page.dart new file mode 100644 index 000000000000..3eca08c7f2af --- /dev/null +++ b/packages/flutter_adaptive_scaffold/example/lib/go_router_demo/pages/more_page.dart @@ -0,0 +1,46 @@ +// 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_adaptive_scaffold/flutter_adaptive_scaffold.dart'; +import 'package:go_router/go_router.dart'; + +import 'pages.dart'; + +/// The more page. +class MorePage extends StatelessWidget { + /// Construct the more page. + const MorePage({super.key}); + + /// The path for the more page. + static const String path = '/more'; + + /// The name for the more page. + static const String name = 'More'; + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: const Text('More Page'), + ), + body: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + ElevatedButton( + onPressed: () => context.goNamed(ProfilePage.name), + child: const Text('Profile'), + ), + const SizedBox(height: kMaterialMediumAndUpMargin), + ElevatedButton( + onPressed: () => context.goNamed(SettingsPage.name), + child: const Text('Settings'), + ), + ], + ), + ), + ); + } +} diff --git a/packages/flutter_adaptive_scaffold/example/lib/go_router_demo/pages/navigation_error_page.dart b/packages/flutter_adaptive_scaffold/example/lib/go_router_demo/pages/navigation_error_page.dart new file mode 100644 index 000000000000..c50a61e6ac9c --- /dev/null +++ b/packages/flutter_adaptive_scaffold/example/lib/go_router_demo/pages/navigation_error_page.dart @@ -0,0 +1,26 @@ +// 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'; + +/// The error page for navigation errors. +class NavigationErrorPage extends StatelessWidget { + /// Creates a new instance of the [NavigationErrorPage]. + const NavigationErrorPage({super.key}); + + /// The path for the error page. + static const String path = '/error'; + + /// The name for the error page. + static const String name = 'Error'; + + @override + Widget build(BuildContext context) { + return const Scaffold( + body: Center( + child: Text('Error Page'), + ), + ); + } +} diff --git a/packages/flutter_adaptive_scaffold/example/lib/go_router_demo/pages/pages.dart b/packages/flutter_adaptive_scaffold/example/lib/go_router_demo/pages/pages.dart new file mode 100644 index 000000000000..e7d498f9652f --- /dev/null +++ b/packages/flutter_adaptive_scaffold/example/lib/go_router_demo/pages/pages.dart @@ -0,0 +1,16 @@ +// 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 'counter_page.dart'; +export 'detail_modal_page.dart'; +export 'detail_overview_page.dart'; +export 'detail_page.dart'; +export 'forgot_password_page.dart'; +export 'home_page.dart'; +export 'language_page.dart'; +export 'login_page.dart'; +export 'more_page.dart'; +export 'navigation_error_page.dart'; +export 'profile_page.dart'; +export 'settings_page.dart'; diff --git a/packages/flutter_adaptive_scaffold/example/lib/go_router_demo/pages/profile_page.dart b/packages/flutter_adaptive_scaffold/example/lib/go_router_demo/pages/profile_page.dart new file mode 100644 index 000000000000..a5d2ee69e699 --- /dev/null +++ b/packages/flutter_adaptive_scaffold/example/lib/go_router_demo/pages/profile_page.dart @@ -0,0 +1,41 @@ +// 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 '../app_router.dart'; + +/// The profile page. +class ProfilePage extends StatelessWidget { + /// Construct the profile page. + const ProfilePage({super.key}); + + /// The path for the profile page. + static const String path = 'profile'; + + /// The name for the profile page. + static const String name = 'Profile'; + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: const Text('Profile Page'), + ), + body: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + ElevatedButton( + onPressed: () => { + AppRouter.authenticatedNotifier.value = false, + }, + child: const Text('Sign Out'), + ), + ], + ), + ), + ); + } +} diff --git a/packages/flutter_adaptive_scaffold/example/lib/go_router_demo/pages/settings_page.dart b/packages/flutter_adaptive_scaffold/example/lib/go_router_demo/pages/settings_page.dart new file mode 100644 index 000000000000..8357e3cdebd3 --- /dev/null +++ b/packages/flutter_adaptive_scaffold/example/lib/go_router_demo/pages/settings_page.dart @@ -0,0 +1,29 @@ +// 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'; + +/// The settings page. +class SettingsPage extends StatelessWidget { + /// Construct the settings page. + const SettingsPage({super.key}); + + /// The path for the settings page. + static const String path = 'settings'; + + /// The name for the settings page. + static const String name = 'Settings'; + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: const Text('Settings Page'), + ), + body: const Center( + child: Text('Settings Page'), + ), + ); + } +} diff --git a/packages/flutter_adaptive_scaffold/example/lib/go_router_demo/scaffold_shell.dart b/packages/flutter_adaptive_scaffold/example/lib/go_router_demo/scaffold_shell.dart new file mode 100644 index 000000000000..aa070a82c4a0 --- /dev/null +++ b/packages/flutter_adaptive_scaffold/example/lib/go_router_demo/scaffold_shell.dart @@ -0,0 +1,52 @@ +// 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_adaptive_scaffold/flutter_adaptive_scaffold.dart'; +import 'package:go_router/go_router.dart'; + +import 'pages/pages.dart'; + +/// The [ScaffoldShell] is a [StatelessWidget] that uses the [AdaptiveScaffold] +/// to create a shell for the application. +class ScaffoldShell extends StatelessWidget { + /// Create a new instance of [AppScaffoldShell] + const ScaffoldShell({ + required this.navigationShell, + super.key, + }); + + /// The navigation shell to use with the navigation. + final StatefulNavigationShell navigationShell; + + @override + Widget build(BuildContext context) { + return AdaptiveScaffold( + useDrawer: false, + body: (BuildContext context) => navigationShell, + selectedIndex: navigationShell.currentIndex, + onSelectedIndexChange: (int index) { + navigationShell.goBranch( + index, + initialLocation: index == navigationShell.currentIndex, + ); + }, + destinations: navigationShell.route.branches.map( + (StatefulShellBranch e) { + return switch (e.defaultRoute?.name) { + HomePage.name => const NavigationDestination( + icon: Icon(Icons.home), label: 'Home'), + CounterPage.name => const NavigationDestination( + icon: Icon(Icons.add), label: 'Counter'), + MorePage.name => const NavigationDestination( + icon: Icon(Icons.account_circle), label: 'More'), + _ => throw UnimplementedError( + 'The route ${e.defaultRoute?.name} is not implemented.', + ), + }; + }, + ).toList(), + ); + } +} diff --git a/packages/flutter_adaptive_scaffold/example/lib/main.dart b/packages/flutter_adaptive_scaffold/example/lib/main.dart index 2afffb773b7f..7793e32335df 100644 --- a/packages/flutter_adaptive_scaffold/example/lib/main.dart +++ b/packages/flutter_adaptive_scaffold/example/lib/main.dart @@ -693,7 +693,7 @@ class _ItemListTile extends StatelessWidget { style: Theme.of(context).textTheme.bodyLarge), const SizedBox(height: 9), SizedBox( - width: MediaQuery.of(context).size.width, + width: MediaQuery.sizeOf(context).width, child: (email.bodyImage != '') ? Image.asset(email.bodyImage) : Container(), @@ -717,7 +717,7 @@ class _DetailTile extends StatelessWidget { return Padding( padding: const EdgeInsets.all(8.0), child: SizedBox( - height: MediaQuery.of(context).size.height, + height: MediaQuery.sizeOf(context).height, child: Container( decoration: const BoxDecoration( color: Color.fromARGB(255, 245, 241, 248), @@ -891,7 +891,7 @@ class _EmailTile extends StatelessWidget { color: Colors.grey[700], height: 1.35, fontSize: 14.5)), const SizedBox(height: 9), SizedBox( - width: MediaQuery.of(context).size.width, + width: MediaQuery.sizeOf(context).width, child: (bodyImage != '') ? Image.asset(bodyImage) : Container()), const SizedBox(height: 10), diff --git a/packages/flutter_adaptive_scaffold/example/pubspec.yaml b/packages/flutter_adaptive_scaffold/example/pubspec.yaml index f73ddc3ccbcb..3f82e2ca20e4 100644 --- a/packages/flutter_adaptive_scaffold/example/pubspec.yaml +++ b/packages/flutter_adaptive_scaffold/example/pubspec.yaml @@ -12,9 +12,10 @@ dependencies: sdk: flutter flutter_adaptive_scaffold: path: .. + go_router: ^14.2.7 dev_dependencies: - build_runner: ^2.1.10 + build_runner: ^2.4.12 flutter_test: sdk: flutter diff --git a/packages/flutter_adaptive_scaffold/example/test/main_test.dart b/packages/flutter_adaptive_scaffold/example/test/main_test.dart index e7b11ec00fb5..26e03899e1b6 100644 --- a/packages/flutter_adaptive_scaffold/example/test/main_test.dart +++ b/packages/flutter_adaptive_scaffold/example/test/main_test.dart @@ -38,11 +38,11 @@ void main() { await tester.pumpAndSettle(); } - testWidgets('dislays correct item of config based on screen width', + testWidgets('displays correct item of config based on screen width', (WidgetTester tester) async { await updateScreen(300, tester); expect(smallBody, findsOneWidget); - expect(sBody, findsNothing); + expect(body, findsNothing); expect(mediumLargeBody, findsNothing); expect(largeBody, findsNothing); expect(extraLargeBody, findsNothing); @@ -60,7 +60,7 @@ void main() { await updateScreen(800, tester); expect(smallBody, findsNothing); - expect(sBody, findsOneWidget); + expect(body, findsOneWidget); expect(mediumLargeBody, findsNothing); expect(largeBody, findsNothing); expect(extraLargeBody, findsNothing); @@ -78,7 +78,7 @@ void main() { await updateScreen(1100, tester); expect(smallBody, findsNothing); - expect(sBody, findsNothing); + expect(body, findsNothing); expect(mediumLargeBody, findsOneWidget); expect(largeBody, findsNothing); expect(extraLargeBody, findsNothing); @@ -96,7 +96,7 @@ void main() { await updateScreen(1400, tester); expect(smallBody, findsNothing); - expect(sBody, findsNothing); + expect(body, findsNothing); expect(mediumLargeBody, findsNothing); expect(largeBody, findsOneWidget); expect(extraLargeBody, findsNothing); @@ -114,7 +114,7 @@ void main() { await updateScreen(1800, tester); expect(smallBody, findsNothing); - expect(sBody, findsNothing); + expect(body, findsNothing); expect(mediumLargeBody, findsNothing); expect(largeBody, findsNothing); expect(extraLargeBody, findsOneWidget); diff --git a/packages/flutter_adaptive_scaffold/lib/src/adaptive_layout.dart b/packages/flutter_adaptive_scaffold/lib/src/adaptive_layout.dart index f32a8e759bb5..50fd625917c0 100644 --- a/packages/flutter_adaptive_scaffold/lib/src/adaptive_layout.dart +++ b/packages/flutter_adaptive_scaffold/lib/src/adaptive_layout.dart @@ -293,7 +293,7 @@ class _AdaptiveLayoutState extends State }); Rect? hinge; - for (final DisplayFeature e in MediaQuery.of(context).displayFeatures) { + for (final DisplayFeature e in MediaQuery.displayFeaturesOf(context)) { if (e.type == DisplayFeatureType.hinge || e.type == DisplayFeatureType.fold) { if (e.bounds.left != 0) { diff --git a/packages/flutter_adaptive_scaffold/lib/src/adaptive_scaffold.dart b/packages/flutter_adaptive_scaffold/lib/src/adaptive_scaffold.dart index fc8db67bb046..e8b8832054a8 100644 --- a/packages/flutter_adaptive_scaffold/lib/src/adaptive_scaffold.dart +++ b/packages/flutter_adaptive_scaffold/lib/src/adaptive_scaffold.dart @@ -8,21 +8,25 @@ import 'adaptive_layout.dart'; import 'breakpoints.dart'; import 'slot_layout.dart'; -/// Gutter value between different parts of the body slot depending on -/// material 3 design spec. -const double kMaterialGutterValue = 8; +/// Spacing value of the compact breakpoint according to +/// the material 3 design spec. +const double kMaterialCompactSpacing = 0; -/// Margin value of the compact breakpoint layout according to the material +/// Spacing value of the medium and up breakpoint according to +/// the material 3 design spec. +const double kMaterialMediumAndUpSpacing = 24; + +/// Margin value of the compact breakpoint according to the material /// design 3 spec. -const double kMaterialCompactMinMargin = 8; +const double kMaterialCompactMargin = 16; -/// Margin value of the medium breakpoint layout according to the material +/// Margin value of the medium breakpoint according to the material /// design 3 spec. -const double kMaterialMediumMinMargin = 12; +const double kMaterialMediumAndUpMargin = 24; -//// Margin value of the expanded breakpoint layout according to the material +/// Padding value of the compact breakpoint according to the material /// design 3 spec. -const double kMaterialExpandedMinMargin = 32; +const double kMaterialPadding = 4; /// Signature for a builder used by [AdaptiveScaffold.navigationRailDestinationBuilder] that converts a /// [NavigationDestination] to a [NavigationRailDestination]. @@ -358,7 +362,7 @@ class AdaptiveScaffold extends StatefulWidget { padding: padding, child: SizedBox( width: width, - height: MediaQuery.of(context).size.height, + height: MediaQuery.sizeOf(context).height, child: LayoutBuilder( builder: (BuildContext context, BoxConstraints constraints) { return SingleChildScrollView( @@ -429,40 +433,19 @@ class AdaptiveScaffold extends StatefulWidget { /// Public helper method to be used for creating a staggered grid following m3 /// specs from a list of [Widget]s static Builder toMaterialGrid({ - List thisWidgets = const [], - List breakpoints = const [ - Breakpoints.small, - Breakpoints.medium, - Breakpoints.mediumLarge, - Breakpoints.large, - Breakpoints.extraLarge, - ], - double margin = 8, - int itemColumns = 1, - required BuildContext context, + List widgets = const [], + List breakpoints = Breakpoints.all, + double? margin, + int? itemColumns, }) { return Builder(builder: (BuildContext context) { - Breakpoint? currentBreakpoint; - for (final Breakpoint breakpoint in breakpoints) { - if (breakpoint.isActive(context)) { - currentBreakpoint = breakpoint; - } - } - double? thisMargin = margin; + final Breakpoint? currentBreakpoint = + Breakpoint.activeBreakpointIn(context, breakpoints); + final double thisMargin = + margin ?? currentBreakpoint?.margin ?? kMaterialCompactMargin; + final int thisColumns = + itemColumns ?? currentBreakpoint?.recommendedPanes ?? 1; - if (currentBreakpoint == Breakpoints.small) { - if (thisMargin < kMaterialCompactMinMargin) { - thisMargin = kMaterialCompactMinMargin; - } - } else if (currentBreakpoint == Breakpoints.medium) { - if (thisMargin < kMaterialMediumMinMargin) { - thisMargin = kMaterialMediumMinMargin; - } - } else if (currentBreakpoint == Breakpoints.mediumLarge) { - if (thisMargin < kMaterialExpandedMinMargin) { - thisMargin = kMaterialExpandedMinMargin; - } - } return CustomScrollView( primary: false, controller: ScrollController(), @@ -473,11 +456,10 @@ class AdaptiveScaffold extends StatefulWidget { child: Padding( padding: EdgeInsets.all(thisMargin), child: _BrickLayout( - columns: itemColumns, - columnSpacing: kMaterialGutterValue, - itemPadding: - const EdgeInsets.only(bottom: kMaterialGutterValue), - children: thisWidgets, + columns: thisColumns, + columnSpacing: thisMargin, + itemPadding: EdgeInsets.only(bottom: thisMargin), + children: widgets, ), ), ), diff --git a/packages/flutter_adaptive_scaffold/lib/src/breakpoints.dart b/packages/flutter_adaptive_scaffold/lib/src/breakpoints.dart index aa8e744b344d..91568cedeac8 100644 --- a/packages/flutter_adaptive_scaffold/lib/src/breakpoints.dart +++ b/packages/flutter_adaptive_scaffold/lib/src/breakpoints.dart @@ -4,6 +4,8 @@ import 'package:flutter/material.dart'; +import '../flutter_adaptive_scaffold.dart'; + /// A group of standard breakpoints built according to the material /// specifications for screen width size. /// @@ -15,7 +17,7 @@ class Breakpoints { /// case that no other breakpoint is active. /// /// It is active from a width of -1 dp to infinity. - static const Breakpoint standard = Breakpoint(beginWidth: -1); + static const Breakpoint standard = Breakpoint.standard(); /// A window whose width is less than 600 dp and greater than 0 dp. static const Breakpoint small = Breakpoint.small(); @@ -84,6 +86,30 @@ class Breakpoints { /// A mobile window whose width is greater than 1600 dp. static const Breakpoint extraLargeMobile = Breakpoint.extraLarge(platform: Breakpoint.mobile); + + /// A list of all the standard breakpoints. + static const List all = [ + smallDesktop, + smallMobile, + small, + mediumDesktop, + mediumMobile, + medium, + mediumLargeDesktop, + mediumLargeMobile, + mediumLarge, + largeDesktop, + largeMobile, + large, + extraLargeDesktop, + extraLargeMobile, + extraLarge, + smallAndUp, + mediumAndUp, + mediumLargeAndUp, + largeAndUp, + standard, + ]; } /// A class to define the conditions that distinguish between types of @@ -105,50 +131,96 @@ class Breakpoints { /// * [SlotLayout.config], which uses breakpoints to dictate the layout of the /// screen. class Breakpoint { + // #docregion Breakpoints /// Returns a const [Breakpoint] with the given constraints. const Breakpoint({ this.beginWidth, this.endWidth, this.beginHeight, this.endHeight, - this.platform, this.andUp = false, + this.platform, + this.spacing = kMaterialMediumAndUpSpacing, + this.margin = kMaterialMediumAndUpMargin, + this.padding = kMaterialPadding, + this.recommendedPanes = 1, + this.maxPanes = 1, }); + /// Returns a [Breakpoint] that can be used as a fallthrough in the + /// case that no other breakpoint is active. + const Breakpoint.standard({this.platform}) + : beginWidth = -1, + endWidth = null, + beginHeight = null, + endHeight = null, + spacing = kMaterialMediumAndUpSpacing, + margin = kMaterialMediumAndUpMargin, + padding = kMaterialPadding, + recommendedPanes = 1, + maxPanes = 1, + andUp = true; + /// Returns a [Breakpoint] with the given constraints for a small screen. const Breakpoint.small({this.andUp = false, this.platform}) : beginWidth = 0, endWidth = 600, beginHeight = null, - endHeight = 480; + endHeight = 480, + spacing = kMaterialCompactSpacing, + margin = kMaterialCompactMargin, + padding = kMaterialPadding, + recommendedPanes = 1, + maxPanes = 1; /// Returns a [Breakpoint] with the given constraints for a medium screen. const Breakpoint.medium({this.andUp = false, this.platform}) : beginWidth = 600, endWidth = 840, beginHeight = 480, - endHeight = 900; + endHeight = 900, + spacing = kMaterialMediumAndUpSpacing, + margin = kMaterialMediumAndUpMargin, + padding = kMaterialPadding * 2, + recommendedPanes = 1, + maxPanes = 2; /// Returns a [Breakpoint] with the given constraints for a mediumLarge screen. const Breakpoint.mediumLarge({this.andUp = false, this.platform}) : beginWidth = 840, endWidth = 1200, beginHeight = 900, - endHeight = null; + endHeight = null, + spacing = kMaterialMediumAndUpSpacing, + margin = kMaterialMediumAndUpMargin, + padding = kMaterialPadding * 3, + recommendedPanes = 2, + maxPanes = 2; /// Returns a [Breakpoint] with the given constraints for a large screen. const Breakpoint.large({this.andUp = false, this.platform}) : beginWidth = 1200, endWidth = 1600, beginHeight = 900, - endHeight = null; + endHeight = null, + spacing = kMaterialMediumAndUpSpacing, + margin = kMaterialMediumAndUpMargin, + padding = kMaterialPadding * 4, + recommendedPanes = 2, + maxPanes = 2; /// Returns a [Breakpoint] with the given constraints for an extraLarge screen. const Breakpoint.extraLarge({this.andUp = false, this.platform}) : beginWidth = 1600, endWidth = null, beginHeight = 900, - endHeight = null; + endHeight = null, + spacing = kMaterialMediumAndUpSpacing, + margin = kMaterialMediumAndUpMargin, + padding = kMaterialPadding * 5, + recommendedPanes = 2, + maxPanes = 3; + // #enddocregion Breakpoints /// A set of [TargetPlatform]s that the [Breakpoint] will be active on desktop. static const Set desktop = { @@ -164,7 +236,7 @@ class Breakpoint { TargetPlatform.iOS, }; - /// When set to true, it will include any size above the set width. + /// When set to true, it will include any size above the set width and set height. final bool andUp; /// The beginning width dp value. If left null then the [Breakpoint] will have @@ -187,6 +259,21 @@ class Breakpoint { /// left null then it will be active on all platforms. final Set? platform; + /// The default material spacing for the [Breakpoint]. + final double spacing; + + /// The default material margin for the [Breakpoint]. + final double margin; + + /// The default material padding for the [Breakpoint]. + final double padding; + + /// The material recommended number of panes for the [Breakpoint]. + final int recommendedPanes; + + /// The material maximum number of panes that can be displayed on the [Breakpoint]. + final int maxPanes; + /// A method that returns true based on conditions related to the context of /// the screen such as MediaQuery.sizeOf(context).width, MediaQuery.sizeOf(context).height /// and MediaQuery.orientationOf(context). @@ -197,6 +284,7 @@ class Breakpoint { final double width = MediaQuery.sizeOf(context).width; final double height = MediaQuery.sizeOf(context).height; final Orientation orientation = MediaQuery.orientationOf(context); + final bool isPortrait = orientation == Orientation.portrait; final double lowerBoundWidth = beginWidth ?? double.negativeInfinity; final double upperBoundWidth = endWidth ?? double.infinity; @@ -208,11 +296,132 @@ class Breakpoint { ? width >= lowerBoundWidth : width >= lowerBoundWidth && width < upperBoundWidth; - final bool isHeightActive = (orientation == Orientation.landscape && - height >= lowerBoundHeight && - height < upperBoundHeight) || - orientation == Orientation.portrait; + final bool isHeightActive = isPortrait || isWidthActive || andUp + ? isWidthActive || height >= lowerBoundHeight + : height >= lowerBoundHeight && height < upperBoundHeight; return isWidthActive && isHeightActive && isRightPlatform; } + + /// Returns the currently active [Breakpoint] based on the [SlotLayout] in the + /// context. + static Breakpoint? maybeActiveBreakpointFromSlotLayout(BuildContext context) { + final SlotLayout? slotLayout = + context.findAncestorWidgetOfExactType(); + + return slotLayout != null + ? activeBreakpointIn(context, slotLayout.config.keys.toList()) + : null; + } + + /// Returns the default [Breakpoint] based on the [BuildContext]. + static Breakpoint defaultBreakpointOf(BuildContext context) { + return activeBreakpointIn(context, Breakpoints.all) ?? Breakpoints.standard; + } + + /// Returns the currently active [Breakpoint]. + static Breakpoint activeBreakpointOf(BuildContext context) { + return maybeActiveBreakpointFromSlotLayout(context) ?? + defaultBreakpointOf(context); + } + + /// Returns the currently active [Breakpoint] based on the [BuildContext] and + /// a list of [Breakpoint]s. + static Breakpoint? activeBreakpointIn( + BuildContext context, List breakpoints) { + Breakpoint? currentBreakpoint; + + for (final Breakpoint breakpoint in breakpoints) { + if (breakpoint.isActive(context)) { + if (breakpoint.platform != null) { + // Prioritize platform-specific breakpoints. + return breakpoint; + } else { + // Fallback to non-platform-specific. + currentBreakpoint = breakpoint; + } + } + } + return currentBreakpoint; + } + + /// Returns true if the current platform is Desktop. + static bool isDesktop(BuildContext context) { + return Breakpoint.desktop.contains(Theme.of(context).platform); + } + + /// Returns true if the current platform is Mobile. + static bool isMobile(BuildContext context) { + return Breakpoint.mobile.contains(Theme.of(context).platform); + } + + // #docregion Breakpoint operators + /// Returns true if this [Breakpoint] is greater than the given [Breakpoint]. + bool operator >(Breakpoint breakpoint) + // #enddocregion Breakpoint operators + { + return (beginWidth ?? double.negativeInfinity) > + (breakpoint.beginWidth ?? double.negativeInfinity) && + (endWidth ?? double.infinity) > + (breakpoint.endWidth ?? double.infinity) && + (beginHeight ?? double.negativeInfinity) > + (breakpoint.beginHeight ?? double.negativeInfinity) && + (endHeight ?? double.infinity) > + (breakpoint.endHeight ?? double.infinity); + } + + // #docregion Breakpoint operators + /// Returns true if this [Breakpoint] is less than the given [Breakpoint]. + bool operator <(Breakpoint breakpoint) + // #enddocregion Breakpoint operators + { + return (endWidth ?? double.infinity) < + (breakpoint.endWidth ?? double.infinity) && + (beginWidth ?? double.negativeInfinity) < + (breakpoint.beginWidth ?? double.negativeInfinity) && + (endHeight ?? double.infinity) < + (breakpoint.endHeight ?? double.infinity) && + (beginHeight ?? double.negativeInfinity) < + (breakpoint.beginHeight ?? double.negativeInfinity); + } + + // #docregion Breakpoint operators + /// Returns true if this [Breakpoint] is greater than or equal to the + /// given [Breakpoint]. + bool operator >=(Breakpoint breakpoint) + // #enddocregion Breakpoint operators + { + return (beginWidth ?? double.negativeInfinity) >= + (breakpoint.beginWidth ?? double.negativeInfinity) && + (endWidth ?? double.infinity) >= + (breakpoint.endWidth ?? double.infinity) && + (beginHeight ?? double.negativeInfinity) >= + (breakpoint.beginHeight ?? double.negativeInfinity) && + (endHeight ?? double.infinity) >= + (breakpoint.endHeight ?? double.infinity); + } + + // #docregion Breakpoint operators + /// Returns true if this [Breakpoint] is less than or equal to the + /// given [Breakpoint]. + bool operator <=(Breakpoint breakpoint) + // #enddocregion Breakpoint operators + { + return (endWidth ?? double.infinity) <= + (breakpoint.endWidth ?? double.infinity) && + (beginWidth ?? double.negativeInfinity) <= + (breakpoint.beginWidth ?? double.negativeInfinity) && + (endHeight ?? double.infinity) <= + (breakpoint.endHeight ?? double.infinity) && + (beginHeight ?? double.negativeInfinity) <= + (breakpoint.beginHeight ?? double.negativeInfinity); + } + + // #docregion Breakpoint operators + /// Returns true if this [Breakpoint] is between the given [Breakpoint]s. + bool between(Breakpoint lower, Breakpoint upper) + // #enddocregion Breakpoint operators + { + return this >= lower && this < upper; + } } diff --git a/packages/flutter_adaptive_scaffold/lib/src/slot_layout.dart b/packages/flutter_adaptive_scaffold/lib/src/slot_layout.dart index 38789fb86603..0bb8ef4dc95a 100644 --- a/packages/flutter_adaptive_scaffold/lib/src/slot_layout.dart +++ b/packages/flutter_adaptive_scaffold/lib/src/slot_layout.dart @@ -15,17 +15,15 @@ class SlotLayout extends StatefulWidget { /// Creates a [SlotLayout] widget. const SlotLayout({required this.config, super.key}); - /// Given a context and a config, it returns the [SlotLayoutConfig] that will g + /// Given a context and a config, it returns the [SlotLayoutConfig] that will /// be chosen from the config under the context's conditions. static SlotLayoutConfig? pickWidget( BuildContext context, Map config) { - SlotLayoutConfig? chosenWidget; - config.forEach((Breakpoint breakpoint, SlotLayoutConfig? pickedWidget) { - if (breakpoint.isActive(context)) { - chosenWidget = pickedWidget; - } - }); - return chosenWidget; + final Breakpoint? breakpoint = + Breakpoint.activeBreakpointIn(context, config.keys.toList()); + return breakpoint != null && config.containsKey(breakpoint) + ? config[breakpoint] + : null; } /// Maps [Breakpoint]s to [SlotLayoutConfig]s to determine what Widget to @@ -74,14 +72,20 @@ class SlotLayout extends StatefulWidget { WidgetBuilder? builder, Widget Function(Widget, Animation)? inAnimation, Widget Function(Widget, Animation)? outAnimation, - Duration? duration, + Duration? inDuration, + Duration? outDuration, + Curve? inCurve, + Curve? outCurve, required Key key, }) => SlotLayoutConfig._( builder: builder, inAnimation: inAnimation, outAnimation: outAnimation, - duration: duration, + inDuration: inDuration, + outDuration: outDuration, + inCurve: inCurve, + outCurve: outCurve, key: key, ); @@ -98,7 +102,11 @@ class _SlotLayoutState extends State chosenWidget = SlotLayout.pickWidget(context, widget.config); bool hasAnimation = false; return AnimatedSwitcher( - duration: chosenWidget?.duration ?? const Duration(milliseconds: 1000), + duration: + chosenWidget?.inDuration ?? const Duration(milliseconds: 1000), + reverseDuration: chosenWidget?.outDuration, + switchInCurve: chosenWidget?.inCurve ?? Curves.linear, + switchOutCurve: chosenWidget?.outCurve ?? Curves.linear, layoutBuilder: (Widget? currentChild, List previousChildren) { final Stack elements = Stack( children: [ @@ -139,7 +147,10 @@ class SlotLayoutConfig extends StatelessWidget { required this.builder, this.inAnimation, this.outAnimation, - this.duration, + this.inDuration, + this.outDuration, + this.inCurve, + this.outCurve, }); /// The child Widget that [SlotLayout] eventually returns with an animation. @@ -163,8 +174,21 @@ class SlotLayoutConfig extends StatelessWidget { /// as the returned widget. final Widget Function(Widget, Animation)? outAnimation; - /// The amount of time taken by the execution of the in and out animations. - final Duration? duration; + /// The duration of the transition from the old child to the new one during + /// a switch in [SlotLayout]. + final Duration? inDuration; + + /// The duration of the transition from the new child to the old one during + /// a switch in [SlotLayout]. + final Duration? outDuration; + + /// The animation curve to use when transitioning in a new child during a + /// switch in [SlotLayout]. + final Curve? inCurve; + + /// The animation curve to use when transitioning a previous slot out during + /// a switch in [SlotLayout]. + final Curve? outCurve; /// An empty [SlotLayoutConfig] to be placed in a slot to indicate that the slot /// should show nothing. diff --git a/packages/flutter_adaptive_scaffold/pubspec.yaml b/packages/flutter_adaptive_scaffold/pubspec.yaml index 504f5257c9a0..258d9bcc6a7d 100644 --- a/packages/flutter_adaptive_scaffold/pubspec.yaml +++ b/packages/flutter_adaptive_scaffold/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_adaptive_scaffold description: Widgets to easily build adaptive layouts, including navigation elements. -version: 0.2.0 +version: 0.3.1 issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+flutter_adaptive_scaffold%22 repository: https://github.com/flutter/packages/tree/main/packages/flutter_adaptive_scaffold @@ -20,3 +20,4 @@ topics: - layout - ui - adaptive + - responsive diff --git a/packages/flutter_adaptive_scaffold/test/adaptive_layout_test.dart b/packages/flutter_adaptive_scaffold/test/adaptive_layout_test.dart index 7a7ab6f1300c..d2104e3640f0 100644 --- a/packages/flutter_adaptive_scaffold/test/adaptive_layout_test.dart +++ b/packages/flutter_adaptive_scaffold/test/adaptive_layout_test.dart @@ -443,35 +443,35 @@ void main() { class TestBreakpoint0 extends Breakpoint { @override bool isActive(BuildContext context) { - return MediaQuery.of(context).size.width >= 0; + return MediaQuery.sizeOf(context).width >= 0; } } class TestBreakpoint400 extends Breakpoint { @override bool isActive(BuildContext context) { - return MediaQuery.of(context).size.width > 400; + return MediaQuery.sizeOf(context).width > 400; } } class TestBreakpoint800 extends Breakpoint { @override bool isActive(BuildContext context) { - return MediaQuery.of(context).size.width > 800; + return MediaQuery.sizeOf(context).width > 800; } } class TestBreakpoint1200 extends Breakpoint { @override bool isActive(BuildContext context) { - return MediaQuery.of(context).size.width > 1200; + return MediaQuery.sizeOf(context).width > 1200; } } class TestBreakpoint1600 extends Breakpoint { @override bool isActive(BuildContext context) { - return MediaQuery.of(context).size.width > 1600; + return MediaQuery.sizeOf(context).width > 1600; } } @@ -664,35 +664,35 @@ MediaQuery slot(double width, Duration duration, WidgetTester tester) { TestBreakpoint0(): SlotLayout.from( inAnimation: leftOutIn, outAnimation: leftInOut, - duration: duration, + inDuration: duration, key: const Key('0'), builder: (_) => const SizedBox(width: 10, height: 10), ), TestBreakpoint400(): SlotLayout.from( inAnimation: leftOutIn, outAnimation: leftInOut, - duration: duration, + inDuration: duration, key: const Key('400'), builder: (_) => const SizedBox(width: 10, height: 10), ), TestBreakpoint800(): SlotLayout.from( inAnimation: leftOutIn, outAnimation: leftInOut, - duration: duration, + inDuration: duration, key: const Key('800'), builder: (_) => const SizedBox(width: 10, height: 10), ), TestBreakpoint1200(): SlotLayout.from( inAnimation: leftOutIn, outAnimation: leftInOut, - duration: duration, + inDuration: duration, key: const Key('1200'), builder: (_) => const SizedBox(width: 10, height: 10), ), TestBreakpoint1600(): SlotLayout.from( inAnimation: leftOutIn, outAnimation: leftInOut, - duration: duration, + inDuration: duration, key: const Key('1600'), builder: (_) => const SizedBox(width: 10, height: 10), ), diff --git a/packages/flutter_adaptive_scaffold/test/adaptive_scaffold_test.dart b/packages/flutter_adaptive_scaffold/test/adaptive_scaffold_test.dart index 45afcddce871..b7864392d690 100644 --- a/packages/flutter_adaptive_scaffold/test/adaptive_scaffold_test.dart +++ b/packages/flutter_adaptive_scaffold/test/adaptive_scaffold_test.dart @@ -31,7 +31,7 @@ void main() { final Finder primaryNav3 = find.byKey(const Key('primaryNavigation3')); await tester.binding.setSurfaceSize(SimulatedLayout.small.size); - await tester.pumpWidget(SimulatedLayout.small.app()); + await tester.pumpWidget(SimulatedLayout.small.scaffold(tester)); await tester.pumpAndSettle(); expect(smallBody, findsOneWidget); @@ -44,7 +44,7 @@ void main() { expect(tester.getTopLeft(bottomNav), const Offset(0, 1920)); await tester.binding.setSurfaceSize(SimulatedLayout.medium.size); - await tester.pumpWidget(SimulatedLayout.medium.app()); + await tester.pumpWidget(SimulatedLayout.medium.scaffold(tester)); await tester.pumpAndSettle(); expect(smallBody, findsNothing); @@ -60,7 +60,7 @@ void main() { expect(tester.getBottomRight(primaryNav), const Offset(88, 2000)); await tester.binding.setSurfaceSize(SimulatedLayout.mediumLarge.size); - await tester.pumpWidget(SimulatedLayout.mediumLarge.app()); + await tester.pumpWidget(SimulatedLayout.mediumLarge.scaffold(tester)); await tester.pumpAndSettle(); expect(body, findsNothing); @@ -76,7 +76,7 @@ void main() { expect(tester.getBottomRight(primaryNav1), const Offset(208, 2000)); await tester.binding.setSurfaceSize(SimulatedLayout.large.size); - await tester.pumpWidget(SimulatedLayout.large.app()); + await tester.pumpWidget(SimulatedLayout.large.scaffold(tester)); await tester.pumpAndSettle(); expect(mediumLargeBody, findsNothing); @@ -92,7 +92,7 @@ void main() { expect(tester.getBottomRight(primaryNav2), const Offset(208, 2000)); await tester.binding.setSurfaceSize(SimulatedLayout.extraLarge.size); - await tester.pumpWidget(SimulatedLayout.extraLarge.app()); + await tester.pumpWidget(SimulatedLayout.extraLarge.scaffold(tester)); await tester.pumpAndSettle(); expect(largeBody, findsNothing); @@ -114,9 +114,9 @@ void main() { final Finder sBody = find.byKey(const Key('sBody')); await tester.binding.setSurfaceSize(SimulatedLayout.small.size); - await tester.pumpWidget(SimulatedLayout.small.app()); + await tester.pumpWidget(SimulatedLayout.small.scaffold(tester)); await tester.binding.setSurfaceSize(SimulatedLayout.medium.size); - await tester.pumpWidget(SimulatedLayout.medium.app()); + await tester.pumpWidget(SimulatedLayout.medium.scaffold(tester)); await tester.pump(); await tester.pump(const Duration(milliseconds: 200)); @@ -155,10 +155,12 @@ void main() { final Finder sBody = find.byKey(const Key('sBody')); await tester.binding.setSurfaceSize(SimulatedLayout.small.size); - await tester.pumpWidget(SimulatedLayout.small.app(animations: false)); + await tester + .pumpWidget(SimulatedLayout.small.scaffold(tester, animations: false)); await tester.binding.setSurfaceSize(SimulatedLayout.medium.size); - await tester.pumpWidget(SimulatedLayout.medium.app(animations: false)); + await tester + .pumpWidget(SimulatedLayout.medium.scaffold(tester, animations: false)); await tester.pump(); await tester.pump(const Duration(milliseconds: 200)); @@ -179,7 +181,8 @@ void main() { await Future.forEach(SimulatedLayout.values, (SimulatedLayout region) async { int selectedIndex = 0; - final MaterialApp app = region.app(initialIndex: selectedIndex); + final MaterialApp app = + region.scaffold(tester, initialIndex: selectedIndex); await tester.binding.setSurfaceSize(region.size); await tester.pumpWidget(app); await tester.pumpAndSettle(); @@ -242,7 +245,7 @@ void main() { (WidgetTester tester) async { await Future.forEach(SimulatedLayout.values, (SimulatedLayout region) async { - final MaterialApp app = region.app(); + final MaterialApp app = region.scaffold(tester); await tester.binding.setSurfaceSize(region.size); await tester.pumpWidget(app); await tester.pumpAndSettle(); @@ -272,7 +275,8 @@ void main() { await Future.forEach(SimulatedLayout.values, (SimulatedLayout region) async { int? selectedIndex; - final MaterialApp app = region.app(initialIndex: selectedIndex); + final MaterialApp app = + region.scaffold(tester, initialIndex: selectedIndex); await tester.binding.setSurfaceSize(region.size); await tester.pumpWidget(app); await tester.pumpAndSettle(); @@ -453,7 +457,7 @@ void main() { 'when view in medium screen, navigation rail must be visible as per theme data values.', (WidgetTester tester) async { await tester.binding.setSurfaceSize(SimulatedLayout.medium.size); - await tester.pumpWidget(SimulatedLayout.medium.app()); + await tester.pumpWidget(SimulatedLayout.medium.scaffold(tester)); await tester.pumpAndSettle(); final Finder primaryNavigationMedium = find.byKey( @@ -499,7 +503,7 @@ void main() { 'when view in mediumLarge screen, navigation rail must be visible as per theme data values.', (WidgetTester tester) async { await tester.binding.setSurfaceSize(SimulatedLayout.mediumLarge.size); - await tester.pumpWidget(SimulatedLayout.mediumLarge.app()); + await tester.pumpWidget(SimulatedLayout.mediumLarge.scaffold(tester)); await tester.pumpAndSettle(); final Finder primaryNavigationMediumLarge = find.byKey( @@ -740,7 +744,7 @@ void main() { (WidgetTester tester) async { await tester.binding.setSurfaceSize(SimulatedLayout.medium.size); await tester.pumpWidget(SimulatedLayout.medium - .app(appBarBreakpoint: AppBarAlwaysOnBreakpoint())); + .scaffold(tester, appBarBreakpoint: AppBarAlwaysOnBreakpoint())); await tester.pumpAndSettle(); final Finder appBar = find.byType(AppBar); @@ -750,7 +754,7 @@ void main() { await tester.binding.setSurfaceSize(SimulatedLayout.mediumLarge.size); await tester.pumpWidget(SimulatedLayout.mediumLarge - .app(appBarBreakpoint: AppBarAlwaysOnBreakpoint())); + .scaffold(tester, appBarBreakpoint: AppBarAlwaysOnBreakpoint())); expect(drawer, findsNothing); await tester.pumpAndSettle(); diff --git a/packages/flutter_adaptive_scaffold/test/breakpoint_test.dart b/packages/flutter_adaptive_scaffold/test/breakpoint_test.dart index e990b3a7f911..978582a32075 100644 --- a/packages/flutter_adaptive_scaffold/test/breakpoint_test.dart +++ b/packages/flutter_adaptive_scaffold/test/breakpoint_test.dart @@ -3,7 +3,7 @@ // found in the LICENSE file. import 'package:flutter/material.dart'; -import 'package:flutter_adaptive_scaffold/src/breakpoints.dart'; +import 'package:flutter_adaptive_scaffold/flutter_adaptive_scaffold.dart'; import 'package:flutter_test/flutter_test.dart'; import 'simulated_layout.dart'; @@ -99,6 +99,1027 @@ void main() { await tester.pumpAndSettle(); expect(DummyWidget.built, isFalse); }); + +// Test the `maybeActiveBreakpointFromSlotLayout` method. + group('maybeActiveBreakpointFromSlotLayout', () { + testWidgets('returns correct breakpoint from SlotLayout on mobile devices', + (WidgetTester tester) async { + // Small layout on mobile. + await tester.pumpWidget(SimulatedLayout.small.slot(tester)); + await tester.pumpAndSettle(); + expect( + Breakpoint.maybeActiveBreakpointFromSlotLayout( + tester.element(find.byKey(const Key('Breakpoints.smallMobile')))), + Breakpoints.smallMobile); + + // Medium layout on mobile. + await tester.pumpWidget(SimulatedLayout.medium.slot(tester)); + await tester.pumpAndSettle(); + expect( + Breakpoint.maybeActiveBreakpointFromSlotLayout(tester + .element(find.byKey(const Key('Breakpoints.mediumMobile')))), + Breakpoints.mediumMobile); + + // Large layout on mobile. + await tester.pumpWidget(SimulatedLayout.large.slot(tester)); + await tester.pumpAndSettle(); + expect( + Breakpoint.maybeActiveBreakpointFromSlotLayout( + tester.element(find.byKey(const Key('Breakpoints.largeMobile')))), + Breakpoints.largeMobile); + }, variant: TargetPlatformVariant.mobile()); + + testWidgets('returns correct breakpoint from SlotLayout on desktop devices', + (WidgetTester tester) async { + // Small layout on desktop. + await tester.pumpWidget(SimulatedLayout.small.slot(tester)); + await tester.pumpAndSettle(); + expect( + Breakpoint.maybeActiveBreakpointFromSlotLayout(tester + .element(find.byKey(const Key('Breakpoints.smallDesktop')))), + Breakpoints.smallDesktop); + + // Medium layout on desktop. + await tester.pumpWidget(SimulatedLayout.medium.slot(tester)); + await tester.pumpAndSettle(); + expect( + Breakpoint.maybeActiveBreakpointFromSlotLayout(tester + .element(find.byKey(const Key('Breakpoints.mediumDesktop')))), + Breakpoints.mediumDesktop); + + // Large layout on desktop. + await tester.pumpWidget(SimulatedLayout.large.slot(tester)); + await tester.pumpAndSettle(); + expect( + Breakpoint.maybeActiveBreakpointFromSlotLayout(tester + .element(find.byKey(const Key('Breakpoints.largeDesktop')))), + Breakpoints.largeDesktop); + }, variant: TargetPlatformVariant.desktop()); + }); + + // Test the `defaultBreakpointOf` method. + group('defaultBreakpointOf', () { + testWidgets('returns correct default breakpoint on mobile devices', + (WidgetTester tester) async { + // Small layout on mobile. + await tester.pumpWidget(SimulatedLayout.small.slot(tester)); + await tester.pumpAndSettle(); + expect(Breakpoint.defaultBreakpointOf(tester.element(find.byType(Theme))), + Breakpoints.smallMobile); + + // Medium layout on mobile. + await tester.pumpWidget(SimulatedLayout.medium.slot(tester)); + await tester.pumpAndSettle(); + expect(Breakpoint.defaultBreakpointOf(tester.element(find.byType(Theme))), + Breakpoints.mediumMobile); + + // Large layout on mobile. + await tester.pumpWidget(SimulatedLayout.large.slot(tester)); + await tester.pumpAndSettle(); + expect(Breakpoint.defaultBreakpointOf(tester.element(find.byType(Theme))), + Breakpoints.largeMobile); + }, variant: TargetPlatformVariant.mobile()); + + testWidgets('returns correct default breakpoint on desktop devices', + (WidgetTester tester) async { + // Small layout on desktop. + await tester.pumpWidget(SimulatedLayout.small.slot(tester)); + await tester.pumpAndSettle(); + expect( + Breakpoint.defaultBreakpointOf( + tester.element(find.byType(Directionality))), + Breakpoints.smallDesktop); + + // Medium layout on desktop. + await tester.pumpWidget(SimulatedLayout.medium.slot(tester)); + await tester.pumpAndSettle(); + expect( + Breakpoint.defaultBreakpointOf( + tester.element(find.byType(Directionality))), + Breakpoints.mediumDesktop); + + // Large layout on desktop. + await tester.pumpWidget(SimulatedLayout.large.slot(tester)); + await tester.pumpAndSettle(); + expect( + Breakpoint.defaultBreakpointOf( + tester.element(find.byType(Directionality))), + Breakpoints.largeDesktop); + }, variant: TargetPlatformVariant.desktop()); + }); + + // Test the `activeBreakpointOf` method. + group('activeBreakpointOf', () { + testWidgets('returns correct active breakpoint on mobile devices', + (WidgetTester tester) async { + // Small layout on mobile. + await tester.pumpWidget(SimulatedLayout.small.slot(tester)); + await tester.pumpAndSettle(); + expect( + Breakpoint.activeBreakpointOf( + tester.element(find.byKey(const Key('Breakpoints.smallMobile')))), + Breakpoints.smallMobile); + + // Medium layout on mobile. + await tester.pumpWidget(SimulatedLayout.medium.slot(tester)); + await tester.pumpAndSettle(); + expect( + Breakpoint.activeBreakpointOf(tester + .element(find.byKey(const Key('Breakpoints.mediumMobile')))), + Breakpoints.mediumMobile); + + // Large layout on mobile. + await tester.pumpWidget(SimulatedLayout.large.slot(tester)); + await tester.pumpAndSettle(); + expect( + Breakpoint.activeBreakpointOf( + tester.element(find.byKey(const Key('Breakpoints.largeMobile')))), + Breakpoints.largeMobile); + }, variant: TargetPlatformVariant.mobile()); + + testWidgets('returns correct active breakpoint on desktop devices', + (WidgetTester tester) async { + // Small layout on desktop. + await tester.pumpWidget(SimulatedLayout.small.slot(tester)); + await tester.pumpAndSettle(); + expect( + Breakpoint.activeBreakpointOf(tester + .element(find.byKey(const Key('Breakpoints.smallDesktop')))), + Breakpoints.smallDesktop); + + // Medium layout on desktop. + await tester.pumpWidget(SimulatedLayout.medium.slot(tester)); + await tester.pumpAndSettle(); + expect( + Breakpoint.activeBreakpointOf(tester + .element(find.byKey(const Key('Breakpoints.mediumDesktop')))), + Breakpoints.mediumDesktop); + + // Large layout on desktop. + await tester.pumpWidget(SimulatedLayout.large.slot(tester)); + await tester.pumpAndSettle(); + expect( + Breakpoint.activeBreakpointOf(tester + .element(find.byKey(const Key('Breakpoints.largeDesktop')))), + Breakpoints.largeDesktop); + }, variant: TargetPlatformVariant.desktop()); + }); + + group('Landscape Layout Tests', () { + testWidgets('Desktop breakpoints do not show on mobile device (landscape)', + (WidgetTester tester) async { + // Small landscape layout on a mobile device. + await tester.pumpWidget(SimulatedLayout.smallLandscape.slot(tester)); + await tester.pumpAndSettle(); + expect(find.byKey(const Key('Breakpoints.smallMobile')), findsOneWidget); + expect(find.byKey(const Key('Breakpoints.smallDesktop')), findsNothing); + + // Medium landscape layout on a mobile. + await tester.pumpWidget(SimulatedLayout.mediumLandscape.slot(tester)); + await tester.pumpAndSettle(); + expect(find.byKey(const Key('Breakpoints.mediumMobile')), findsOneWidget); + expect(find.byKey(const Key('Breakpoints.mediumDesktop')), findsNothing); + + // MediumLarge landscape layout on a mobile. + await tester + .pumpWidget(SimulatedLayout.mediumLargeLandscape.slot(tester)); + await tester.pumpAndSettle(); + expect(find.byKey(const Key('Breakpoints.mediumLargeMobile')), + findsOneWidget); + expect(find.byKey(const Key('Breakpoints.mediumLargeDesktop')), + findsNothing); + + // Large landscape layout on a mobile. + await tester.pumpWidget(SimulatedLayout.largeLandscape.slot(tester)); + await tester.pumpAndSettle(); + expect(find.byKey(const Key('Breakpoints.largeMobile')), findsOneWidget); + expect(find.byKey(const Key('Breakpoints.largeDesktop')), findsNothing); + + // ExtraLarge landscape layout on a mobile. + await tester.pumpWidget(SimulatedLayout.extraLargeLandscape.slot(tester)); + await tester.pumpAndSettle(); + expect(find.byKey(const Key('Breakpoints.extraLargeMobile')), + findsOneWidget); + expect( + find.byKey(const Key('Breakpoints.extraLargeDesktop')), findsNothing); + }, variant: TargetPlatformVariant.mobile()); + + testWidgets('Mobile breakpoints do not show on desktop device (landscape)', + (WidgetTester tester) async { + // Small landscape layout on a desktop device. + await tester.pumpWidget(SimulatedLayout.smallLandscape.slot(tester)); + await tester.pumpAndSettle(); + expect(find.byKey(const Key('Breakpoints.smallDesktop')), findsOneWidget); + expect(find.byKey(const Key('Breakpoints.smallMobile')), findsNothing); + + // Medium landscape layout on a desktop. + await tester.pumpWidget(SimulatedLayout.mediumLandscape.slot(tester)); + await tester.pumpAndSettle(); + expect( + find.byKey(const Key('Breakpoints.mediumDesktop')), findsOneWidget); + expect(find.byKey(const Key('Breakpoints.mediumMobile')), findsNothing); + + // MediumLarge landscape layout on a desktop. + await tester + .pumpWidget(SimulatedLayout.mediumLargeLandscape.slot(tester)); + await tester.pumpAndSettle(); + expect(find.byKey(const Key('Breakpoints.mediumLargeDesktop')), + findsOneWidget); + expect( + find.byKey(const Key('Breakpoints.mediumLargeMobile')), findsNothing); + + // Large landscape layout on a desktop. + await tester.pumpWidget(SimulatedLayout.largeLandscape.slot(tester)); + await tester.pumpAndSettle(); + expect(find.byKey(const Key('Breakpoints.largeDesktop')), findsOneWidget); + expect(find.byKey(const Key('Breakpoints.largeMobile')), findsNothing); + + await tester.pumpWidget(SimulatedLayout.extraLargeLandscape.slot(tester)); + await tester.pumpAndSettle(); + expect(find.byKey(const Key('Breakpoints.extraLargeDesktop')), + findsOneWidget); + expect( + find.byKey(const Key('Breakpoints.extraLargeMobile')), findsNothing); + }, variant: TargetPlatformVariant.desktop()); + + // Additional landscape tests for `maybeActiveBreakpointFromSlotLayout`. + testWidgets( + 'maybeActiveBreakpointFromSlotLayout returns correct breakpoint on mobile (landscape)', + (WidgetTester tester) async { + // Small landscape layout on mobile. + await tester.pumpWidget(SimulatedLayout.smallLandscape.slot(tester)); + await tester.pumpAndSettle(); + expect( + Breakpoint.maybeActiveBreakpointFromSlotLayout( + tester.element(find.byKey(const Key('Breakpoints.smallMobile')))), + Breakpoints.smallMobile); + + // Medium landscape layout on mobile. + await tester.pumpWidget(SimulatedLayout.mediumLandscape.slot(tester)); + await tester.pumpAndSettle(); + expect( + Breakpoint.maybeActiveBreakpointFromSlotLayout(tester + .element(find.byKey(const Key('Breakpoints.mediumMobile')))), + Breakpoints.mediumMobile); + + // Large landscape layout on mobile. + await tester.pumpWidget(SimulatedLayout.largeLandscape.slot(tester)); + await tester.pumpAndSettle(); + expect( + Breakpoint.maybeActiveBreakpointFromSlotLayout( + tester.element(find.byKey(const Key('Breakpoints.largeMobile')))), + Breakpoints.largeMobile); + }, variant: TargetPlatformVariant.mobile()); + + testWidgets( + 'maybeActiveBreakpointFromSlotLayout returns correct breakpoint on desktop (landscape)', + (WidgetTester tester) async { + // Small landscape layout on desktop. + await tester.pumpWidget(SimulatedLayout.smallLandscape.slot(tester)); + await tester.pumpAndSettle(); + expect( + Breakpoint.maybeActiveBreakpointFromSlotLayout(tester + .element(find.byKey(const Key('Breakpoints.smallDesktop')))), + Breakpoints.smallDesktop); + + // Medium landscape layout on desktop. + await tester.pumpWidget(SimulatedLayout.mediumLandscape.slot(tester)); + await tester.pumpAndSettle(); + expect( + Breakpoint.maybeActiveBreakpointFromSlotLayout(tester + .element(find.byKey(const Key('Breakpoints.mediumDesktop')))), + Breakpoints.mediumDesktop); + + // Large landscape layout on desktop. + await tester.pumpWidget(SimulatedLayout.largeLandscape.slot(tester)); + await tester.pumpAndSettle(); + expect( + Breakpoint.maybeActiveBreakpointFromSlotLayout(tester + .element(find.byKey(const Key('Breakpoints.largeDesktop')))), + Breakpoints.largeDesktop); + }, variant: TargetPlatformVariant.desktop()); + + // Additional landscape tests for `defaultBreakpointOf`. + testWidgets( + 'defaultBreakpointOf returns correct default breakpoint on mobile (landscape)', + (WidgetTester tester) async { + // Small landscape layout on mobile. + await tester.pumpWidget(SimulatedLayout.smallLandscape.slot(tester)); + await tester.pumpAndSettle(); + expect(Breakpoint.defaultBreakpointOf(tester.element(find.byType(Theme))), + Breakpoints.smallMobile); + + // Medium landscape layout on mobile. + await tester.pumpWidget(SimulatedLayout.mediumLandscape.slot(tester)); + await tester.pumpAndSettle(); + expect(Breakpoint.defaultBreakpointOf(tester.element(find.byType(Theme))), + Breakpoints.mediumMobile); + + // Large landscape layout on mobile. + await tester.pumpWidget(SimulatedLayout.largeLandscape.slot(tester)); + await tester.pumpAndSettle(); + expect(Breakpoint.defaultBreakpointOf(tester.element(find.byType(Theme))), + Breakpoints.largeMobile); + }, variant: TargetPlatformVariant.mobile()); + + testWidgets( + 'defaultBreakpointOf returns correct default breakpoint on desktop (landscape)', + (WidgetTester tester) async { + // Small landscape layout on desktop. + await tester.pumpWidget(SimulatedLayout.smallLandscape.slot(tester)); + await tester.pumpAndSettle(); + expect( + Breakpoint.defaultBreakpointOf( + tester.element(find.byType(Directionality))), + Breakpoints.smallDesktop); + + // Medium landscape layout on desktop. + await tester.pumpWidget(SimulatedLayout.mediumLandscape.slot(tester)); + await tester.pumpAndSettle(); + expect( + Breakpoint.defaultBreakpointOf( + tester.element(find.byType(Directionality))), + Breakpoints.mediumDesktop); + + // Large landscape layout on desktop. + await tester.pumpWidget(SimulatedLayout.largeLandscape.slot(tester)); + await tester.pumpAndSettle(); + expect( + Breakpoint.defaultBreakpointOf( + tester.element(find.byType(Directionality))), + Breakpoints.largeDesktop); + }, variant: TargetPlatformVariant.desktop()); + + // Additional landscape tests for `activeBreakpointOf`. + testWidgets( + 'activeBreakpointOf returns correct active breakpoint on mobile (landscape)', + (WidgetTester tester) async { + // Small landscape layout on mobile. + await tester.pumpWidget(SimulatedLayout.smallLandscape.slot(tester)); + await tester.pumpAndSettle(); + expect( + Breakpoint.activeBreakpointOf( + tester.element(find.byKey(const Key('Breakpoints.smallMobile')))), + Breakpoints.smallMobile); + + // Medium landscape layout on mobile. + await tester.pumpWidget(SimulatedLayout.mediumLandscape.slot(tester)); + await tester.pumpAndSettle(); + expect( + Breakpoint.activeBreakpointOf(tester + .element(find.byKey(const Key('Breakpoints.mediumMobile')))), + Breakpoints.mediumMobile); + + // Large landscape layout on mobile. + await tester.pumpWidget(SimulatedLayout.largeLandscape.slot(tester)); + await tester.pumpAndSettle(); + expect( + Breakpoint.activeBreakpointOf( + tester.element(find.byKey(const Key('Breakpoints.largeMobile')))), + Breakpoints.largeMobile); + }, variant: TargetPlatformVariant.mobile()); + + testWidgets( + 'activeBreakpointOf returns correct active breakpoint on desktop (landscape)', + (WidgetTester tester) async { + // Small landscape layout on desktop. + await tester.pumpWidget(SimulatedLayout.smallLandscape.slot(tester)); + await tester.pumpAndSettle(); + expect( + Breakpoint.activeBreakpointOf(tester + .element(find.byKey(const Key('Breakpoints.smallDesktop')))), + Breakpoints.smallDesktop); + + // Medium landscape layout on desktop. + await tester.pumpWidget(SimulatedLayout.mediumLandscape.slot(tester)); + await tester.pumpAndSettle(); + expect( + Breakpoint.activeBreakpointOf(tester + .element(find.byKey(const Key('Breakpoints.mediumDesktop')))), + Breakpoints.mediumDesktop); + + // Large landscape layout on desktop. + await tester.pumpWidget(SimulatedLayout.largeLandscape.slot(tester)); + await tester.pumpAndSettle(); + expect( + Breakpoint.activeBreakpointOf(tester + .element(find.byKey(const Key('Breakpoints.largeDesktop')))), + Breakpoints.largeDesktop); + }, variant: TargetPlatformVariant.desktop()); + }); + + group('Portrait and Landscape Mixed Layout Tests', () { + testWidgets( + 'Layout for smallPortraitMediumLandscape shows correct slot configuration', + (WidgetTester tester) async { + await tester.pumpWidget( + SimulatedLayout.smallPortraitMediumLandscape.slot(tester)); + await tester.pumpAndSettle(); + expect(find.byKey(const Key('Breakpoints.smallMobile')), findsOneWidget); + expect(find.byKey(const Key('Breakpoints.mediumMobile')), findsNothing); + expect(find.byKey(const Key('Breakpoints.small')), findsNothing); + expect(find.byKey(const Key('Breakpoints.smallDesktop')), findsNothing); + expect(find.byKey(const Key('Breakpoints.medium')), findsNothing); + expect(find.byKey(const Key('Breakpoints.mediumDesktop')), findsNothing); + expect(find.byKey(const Key('Breakpoints.mediumLarge')), findsNothing); + expect( + find.byKey(const Key('Breakpoints.mediumLargeMobile')), findsNothing); + expect(find.byKey(const Key('Breakpoints.mediumLargeDesktop')), + findsNothing); + expect(find.byKey(const Key('Breakpoints.large')), findsNothing); + expect(find.byKey(const Key('Breakpoints.largeMobile')), findsNothing); + expect(find.byKey(const Key('Breakpoints.largeDesktop')), findsNothing); + expect(find.byKey(const Key('Breakpoints.extraLarge')), findsNothing); + expect( + find.byKey(const Key('Breakpoints.extraLargeMobile')), findsNothing); + expect( + find.byKey(const Key('Breakpoints.extraLargeDesktop')), findsNothing); + }); + + testWidgets( + 'Layout for smallLandscapeMediumPortrait shows correct slot configuration', + (WidgetTester tester) async { + await tester.pumpWidget( + SimulatedLayout.smallLandscapeMediumPortrait.slot(tester)); + await tester.pumpAndSettle(); + expect(find.byKey(const Key('Breakpoints.smallMobile')), findsNothing); + expect(find.byKey(const Key('Breakpoints.mediumMobile')), findsOneWidget); + expect(find.byKey(const Key('Breakpoints.small')), findsNothing); + expect(find.byKey(const Key('Breakpoints.smallDesktop')), findsNothing); + expect(find.byKey(const Key('Breakpoints.medium')), findsNothing); + expect(find.byKey(const Key('Breakpoints.mediumDesktop')), findsNothing); + expect(find.byKey(const Key('Breakpoints.mediumLarge')), findsNothing); + expect( + find.byKey(const Key('Breakpoints.mediumLargeMobile')), findsNothing); + expect(find.byKey(const Key('Breakpoints.mediumLargeDesktop')), + findsNothing); + expect(find.byKey(const Key('Breakpoints.large')), findsNothing); + expect(find.byKey(const Key('Breakpoints.largeMobile')), findsNothing); + expect(find.byKey(const Key('Breakpoints.largeDesktop')), findsNothing); + expect(find.byKey(const Key('Breakpoints.extraLarge')), findsNothing); + expect( + find.byKey(const Key('Breakpoints.extraLargeMobile')), findsNothing); + expect( + find.byKey(const Key('Breakpoints.extraLargeDesktop')), findsNothing); + }); + + testWidgets( + 'Layout for smallPortraitMediumLargeLandscape shows correct slot configuration', + (WidgetTester tester) async { + await tester.pumpWidget( + SimulatedLayout.smallPortraitMediumLargeLandscape.slot(tester)); + await tester.pumpAndSettle(); + expect(find.byKey(const Key('Breakpoints.smallMobile')), findsOneWidget); + expect(find.byKey(const Key('Breakpoints.largeMobile')), findsNothing); + expect(find.byKey(const Key('Breakpoints.small')), findsNothing); + expect(find.byKey(const Key('Breakpoints.smallDesktop')), findsNothing); + expect(find.byKey(const Key('Breakpoints.medium')), findsNothing); + expect(find.byKey(const Key('Breakpoints.mediumDesktop')), findsNothing); + expect(find.byKey(const Key('Breakpoints.mediumLarge')), findsNothing); + expect( + find.byKey(const Key('Breakpoints.mediumLargeMobile')), findsNothing); + expect(find.byKey(const Key('Breakpoints.mediumLargeDesktop')), + findsNothing); + expect(find.byKey(const Key('Breakpoints.large')), findsNothing); + expect(find.byKey(const Key('Breakpoints.largeDesktop')), findsNothing); + expect(find.byKey(const Key('Breakpoints.extraLarge')), findsNothing); + expect( + find.byKey(const Key('Breakpoints.extraLargeMobile')), findsNothing); + expect( + find.byKey(const Key('Breakpoints.extraLargeDesktop')), findsNothing); + }); + + testWidgets( + 'Layout for smallLandscapeMediumLargePortrait shows correct slot configuration', + (WidgetTester tester) async { + await tester.pumpWidget( + SimulatedLayout.smallLandscapeMediumLargePortrait.slot(tester)); + await tester.pumpAndSettle(); + expect(find.byKey(const Key('Breakpoints.smallMobile')), findsNothing); + expect(find.byKey(const Key('Breakpoints.largeMobile')), findsNothing); + expect(find.byKey(const Key('Breakpoints.small')), findsNothing); + expect(find.byKey(const Key('Breakpoints.smallDesktop')), findsNothing); + expect(find.byKey(const Key('Breakpoints.medium')), findsNothing); + expect(find.byKey(const Key('Breakpoints.mediumDesktop')), findsNothing); + expect(find.byKey(const Key('Breakpoints.mediumLarge')), findsNothing); + expect(find.byKey(const Key('Breakpoints.mediumLargeMobile')), + findsOneWidget); + expect(find.byKey(const Key('Breakpoints.mediumLargeDesktop')), + findsNothing); + expect(find.byKey(const Key('Breakpoints.large')), findsNothing); + expect(find.byKey(const Key('Breakpoints.largeDesktop')), findsNothing); + expect(find.byKey(const Key('Breakpoints.extraLarge')), findsNothing); + expect( + find.byKey(const Key('Breakpoints.extraLargeMobile')), findsNothing); + expect( + find.byKey(const Key('Breakpoints.extraLargeDesktop')), findsNothing); + }); + + testWidgets( + 'Layout for mediumLargeLandscapeMediumPortrait shows correct slot configuration', + (WidgetTester tester) async { + await tester.pumpWidget( + SimulatedLayout.mediumLargeLandscapeMediumPortrait.slot(tester)); + await tester.pumpAndSettle(); + expect(find.byKey(const Key('Breakpoints.smallMobile')), findsNothing); + expect(find.byKey(const Key('Breakpoints.largeMobile')), findsNothing); + expect(find.byKey(const Key('Breakpoints.small')), findsNothing); + expect(find.byKey(const Key('Breakpoints.smallDesktop')), findsNothing); + expect(find.byKey(const Key('Breakpoints.medium')), findsNothing); + expect(find.byKey(const Key('Breakpoints.mediumDesktop')), findsNothing); + expect(find.byKey(const Key('Breakpoints.mediumLarge')), findsNothing); + expect(find.byKey(const Key('Breakpoints.mediumLargeMobile')), + findsOneWidget); + expect(find.byKey(const Key('Breakpoints.mediumLargeDesktop')), + findsNothing); + expect(find.byKey(const Key('Breakpoints.large')), findsNothing); + expect(find.byKey(const Key('Breakpoints.largeDesktop')), findsNothing); + expect(find.byKey(const Key('Breakpoints.extraLarge')), findsNothing); + expect( + find.byKey(const Key('Breakpoints.extraLargeMobile')), findsNothing); + expect( + find.byKey(const Key('Breakpoints.extraLargeDesktop')), findsNothing); + }); + }); + + group('Slot And Up Layout Tests', () { + testWidgets('slotAndUp shows correct slot for small layout', + (WidgetTester tester) async { + // Small layout should only show the small slot. + await tester.pumpWidget(SimulatedLayout.small.slotAndUp(tester)); + await tester.pumpAndSettle(); + expect(find.byKey(const Key('Breakpoints.small')), findsOneWidget); + expect(find.byKey(const Key('Breakpoints.mediumAndUp')), findsNothing); + }); + + testWidgets('slotAndUp shows correct slot for medium layout and up', + (WidgetTester tester) async { + // Medium layout should show the mediumAndUp slot. + await tester.pumpWidget(SimulatedLayout.medium.slotAndUp(tester)); + await tester.pumpAndSettle(); + expect(find.byKey(const Key('Breakpoints.mediumAndUp')), findsOneWidget); + expect(find.byKey(const Key('Breakpoints.small')), findsNothing); + + // MediumLarge layout should also show the mediumAndUp slot. + await tester.pumpWidget(SimulatedLayout.mediumLarge.slotAndUp(tester)); + await tester.pumpAndSettle(); + expect(find.byKey(const Key('Breakpoints.mediumAndUp')), findsOneWidget); + expect(find.byKey(const Key('Breakpoints.small')), findsNothing); + + // Large layout should also show the mediumAndUp slot. + await tester.pumpWidget(SimulatedLayout.large.slotAndUp(tester)); + await tester.pumpAndSettle(); + expect(find.byKey(const Key('Breakpoints.mediumAndUp')), findsOneWidget); + expect(find.byKey(const Key('Breakpoints.small')), findsNothing); + + // ExtraLarge layout should also show the mediumAndUp slot. + await tester.pumpWidget(SimulatedLayout.extraLarge.slotAndUp(tester)); + await tester.pumpAndSettle(); + expect(find.byKey(const Key('Breakpoints.mediumAndUp')), findsOneWidget); + expect(find.byKey(const Key('Breakpoints.small')), findsNothing); + }); + + testWidgets('slotAndUp shows correct slot for small landscape layout', + (WidgetTester tester) async { + // Small landscape layout should only show the small slot. + await tester.pumpWidget(SimulatedLayout.smallLandscape.slotAndUp(tester)); + await tester.pumpAndSettle(); + expect(find.byKey(const Key('Breakpoints.small')), findsOneWidget); + expect(find.byKey(const Key('Breakpoints.mediumAndUp')), findsNothing); + }); + + testWidgets( + 'slotAndUp shows correct slot for medium and larger landscape layouts', + (WidgetTester tester) async { + // Medium landscape layout should show the mediumAndUp slot. + await tester + .pumpWidget(SimulatedLayout.mediumLandscape.slotAndUp(tester)); + await tester.pumpAndSettle(); + expect(find.byKey(const Key('Breakpoints.mediumAndUp')), findsOneWidget); + expect(find.byKey(const Key('Breakpoints.small')), findsNothing); + + // MediumLarge landscape layout should also show the mediumAndUp slot. + await tester + .pumpWidget(SimulatedLayout.mediumLargeLandscape.slotAndUp(tester)); + await tester.pumpAndSettle(); + expect(find.byKey(const Key('Breakpoints.mediumAndUp')), findsOneWidget); + expect(find.byKey(const Key('Breakpoints.small')), findsNothing); + + // Large landscape layout should also show the mediumAndUp slot. + await tester.pumpWidget(SimulatedLayout.largeLandscape.slotAndUp(tester)); + await tester.pumpAndSettle(); + expect(find.byKey(const Key('Breakpoints.mediumAndUp')), findsOneWidget); + expect(find.byKey(const Key('Breakpoints.small')), findsNothing); + + // ExtraLarge landscape layout should also show the mediumAndUp slot. + await tester + .pumpWidget(SimulatedLayout.extraLargeLandscape.slotAndUp(tester)); + await tester.pumpAndSettle(); + expect(find.byKey(const Key('Breakpoints.mediumAndUp')), findsOneWidget); + expect(find.byKey(const Key('Breakpoints.small')), findsNothing); + }); + }); + + group('Slot And Up Layout Tests with Portrait and Landscape Mixed Layout', + () { + testWidgets( + 'slotAndUp shows correct slot for smallPortraitMediumLandscape layout', + (WidgetTester tester) async { + // smallPortraitMediumLandscape layout should only show the small slot. + await tester.pumpWidget( + SimulatedLayout.smallPortraitMediumLandscape.slotAndUp(tester)); + await tester.pumpAndSettle(); + expect(find.byKey(const Key('Breakpoints.small')), findsOneWidget); + expect(find.byKey(const Key('Breakpoints.mediumAndUp')), findsNothing); + }); + + testWidgets( + 'slotAndUp shows correct slot for smallLandscapeMediumPortrait layout', + (WidgetTester tester) async { + // smallLandscapeMediumPortrait layout should show the small slot. + await tester.pumpWidget( + SimulatedLayout.smallLandscapeMediumPortrait.slotAndUp(tester)); + await tester.pumpAndSettle(); + expect(find.byKey(const Key('Breakpoints.small')), findsNothing); + expect(find.byKey(const Key('Breakpoints.mediumAndUp')), findsOneWidget); + }); + + testWidgets( + 'slotAndUp shows correct slot for smallPortraitMediumLargeLandscape layout', + (WidgetTester tester) async { + // smallPortraitMediumLargeLandscape layout should show the small slot. + await tester.pumpWidget( + SimulatedLayout.smallPortraitMediumLargeLandscape.slotAndUp(tester)); + await tester.pumpAndSettle(); + expect(find.byKey(const Key('Breakpoints.small')), findsOneWidget); + expect(find.byKey(const Key('Breakpoints.mediumAndUp')), findsNothing); + }); + + testWidgets( + 'slotAndUp shows correct slot for smallLandscapeMediumLargePortrait layout', + (WidgetTester tester) async { + // smallLandscapeMediumLargePortrait layout should show the small slot. + await tester.pumpWidget( + SimulatedLayout.smallLandscapeMediumLargePortrait.slotAndUp(tester)); + await tester.pumpAndSettle(); + expect(find.byKey(const Key('Breakpoints.small')), findsNothing); + expect(find.byKey(const Key('Breakpoints.mediumAndUp')), findsOneWidget); + }); + + testWidgets( + 'slotAndUp shows correct slot for mediumLargeLandscapeMediumPortrait layout', + (WidgetTester tester) async { + // mediumLargeLandscapeMediumPortrait layout should show the mediumAndUp slot. + await tester.pumpWidget( + SimulatedLayout.mediumLargeLandscapeMediumPortrait.slotAndUp(tester)); + await tester.pumpAndSettle(); + expect(find.byKey(const Key('Breakpoints.small')), findsNothing); + expect(find.byKey(const Key('Breakpoints.mediumAndUp')), findsOneWidget); + }); + }); + + // Test for `spacing`. + group('spacing property', () { + testWidgets('returns kMaterialCompactSpacing for small breakpoint', + (WidgetTester tester) async { + await tester.pumpWidget(SimulatedLayout.small.slot(tester)); + await tester.pumpAndSettle(); + expect( + Breakpoint.activeBreakpointOf(tester + .element(find.byKey(const Key('Breakpoints.smallMobile')))) + .spacing, + kMaterialCompactSpacing); + }); + + testWidgets('returns kMaterialMediumAndUpSpacing for medium breakpoint', + (WidgetTester tester) async { + await tester.pumpWidget(SimulatedLayout.medium.slot(tester)); + await tester.pumpAndSettle(); + expect( + Breakpoint.activeBreakpointOf(tester + .element(find.byKey(const Key('Breakpoints.mediumMobile')))) + .spacing, + kMaterialMediumAndUpSpacing); + }, variant: TargetPlatformVariant.mobile()); + + testWidgets( + 'returns kMaterialMediumAndUpSpacing for mediumLarge breakpoint', + (WidgetTester tester) async { + await tester.pumpWidget(SimulatedLayout.mediumLarge.slot(tester)); + await tester.pumpAndSettle(); + expect( + Breakpoint.activeBreakpointOf(tester.element( + find.byKey(const Key('Breakpoints.mediumLargeMobile')))) + .spacing, + kMaterialMediumAndUpSpacing); + }, variant: TargetPlatformVariant.mobile()); + + testWidgets('returns kMaterialMediumAndUpSpacing for large breakpoint', + (WidgetTester tester) async { + await tester.pumpWidget(SimulatedLayout.large.slot(tester)); + await tester.pumpAndSettle(); + expect( + Breakpoint.activeBreakpointOf(tester + .element(find.byKey(const Key('Breakpoints.largeMobile')))) + .spacing, + kMaterialMediumAndUpSpacing); + }, variant: TargetPlatformVariant.mobile()); + + testWidgets('returns kMaterialMediumAndUpSpacing for extraLarge breakpoint', + (WidgetTester tester) async { + await tester.pumpWidget(SimulatedLayout.extraLarge.slot(tester)); + await tester.pumpAndSettle(); + expect( + Breakpoint.activeBreakpointOf(tester.element( + find.byKey(const Key('Breakpoints.extraLargeMobile')))) + .spacing, + kMaterialMediumAndUpSpacing); + }, variant: TargetPlatformVariant.mobile()); + }); + + // Test for `margin`. + group('margin property', () { + testWidgets('returns kMaterialCompactMargin for small breakpoint', + (WidgetTester tester) async { + await tester.pumpWidget(SimulatedLayout.small.slot(tester)); + await tester.pumpAndSettle(); + expect( + Breakpoint.activeBreakpointOf(tester + .element(find.byKey(const Key('Breakpoints.smallMobile')))) + .margin, + kMaterialCompactMargin); + }, variant: TargetPlatformVariant.mobile()); + + testWidgets('returns kMaterialMediumAndUpMargin for medium breakpoint', + (WidgetTester tester) async { + await tester.pumpWidget(SimulatedLayout.medium.slot(tester)); + await tester.pumpAndSettle(); + expect( + Breakpoint.activeBreakpointOf(tester + .element(find.byKey(const Key('Breakpoints.mediumMobile')))) + .margin, + kMaterialMediumAndUpMargin); + }, variant: TargetPlatformVariant.mobile()); + + testWidgets('returns kMaterialMediumAndUpMargin for mediumLarge breakpoint', + (WidgetTester tester) async { + await tester.pumpWidget(SimulatedLayout.mediumLarge.slot(tester)); + await tester.pumpAndSettle(); + expect( + Breakpoint.activeBreakpointOf(tester.element( + find.byKey(const Key('Breakpoints.mediumLargeMobile')))) + .margin, + kMaterialMediumAndUpMargin); + }, variant: TargetPlatformVariant.mobile()); + + testWidgets('returns kMaterialMediumAndUpMargin for large breakpoint', + (WidgetTester tester) async { + await tester.pumpWidget(SimulatedLayout.large.slot(tester)); + await tester.pumpAndSettle(); + expect( + Breakpoint.activeBreakpointOf(tester + .element(find.byKey(const Key('Breakpoints.largeMobile')))) + .margin, + kMaterialMediumAndUpMargin); + }, variant: TargetPlatformVariant.mobile()); + + testWidgets('returns kMaterialMediumAndUpMargin for extraLarge breakpoint', + (WidgetTester tester) async { + await tester.pumpWidget(SimulatedLayout.extraLarge.slot(tester)); + await tester.pumpAndSettle(); + expect( + Breakpoint.activeBreakpointOf(tester.element( + find.byKey(const Key('Breakpoints.extraLargeMobile')))) + .margin, + kMaterialMediumAndUpMargin); + }, variant: TargetPlatformVariant.mobile()); + }); + + // Test for `padding`. + group('padding property', () { + testWidgets('returns kMaterialPadding for small breakpoint', + (WidgetTester tester) async { + await tester.pumpWidget(SimulatedLayout.small.slot(tester)); + await tester.pumpAndSettle(); + expect( + Breakpoint.activeBreakpointOf(tester + .element(find.byKey(const Key('Breakpoints.smallMobile')))) + .padding, + kMaterialPadding); + }, variant: TargetPlatformVariant.mobile()); + + testWidgets('returns kMaterialPadding * 2 for medium breakpoint', + (WidgetTester tester) async { + await tester.pumpWidget(SimulatedLayout.medium.slot(tester)); + await tester.pumpAndSettle(); + expect( + Breakpoint.activeBreakpointOf(tester + .element(find.byKey(const Key('Breakpoints.mediumMobile')))) + .padding, + kMaterialPadding * 2); + }, variant: TargetPlatformVariant.mobile()); + + testWidgets('returns kMaterialPadding * 3 for mediumLarge breakpoint', + (WidgetTester tester) async { + await tester.pumpWidget(SimulatedLayout.mediumLarge.slot(tester)); + await tester.pumpAndSettle(); + expect( + Breakpoint.activeBreakpointOf(tester.element( + find.byKey(const Key('Breakpoints.mediumLargeMobile')))) + .padding, + kMaterialPadding * 3); + }, variant: TargetPlatformVariant.mobile()); + + testWidgets('returns kMaterialPadding * 4 for large breakpoint', + (WidgetTester tester) async { + await tester.pumpWidget(SimulatedLayout.large.slot(tester)); + await tester.pumpAndSettle(); + expect( + Breakpoint.activeBreakpointOf(tester + .element(find.byKey(const Key('Breakpoints.largeMobile')))) + .padding, + kMaterialPadding * 4); + }, variant: TargetPlatformVariant.mobile()); + + testWidgets('returns kMaterialPadding * 5 for extraLarge breakpoint', + (WidgetTester tester) async { + await tester.pumpWidget(SimulatedLayout.extraLarge.slot(tester)); + await tester.pumpAndSettle(); + expect( + Breakpoint.activeBreakpointOf(tester.element( + find.byKey(const Key('Breakpoints.extraLargeMobile')))) + .padding, + kMaterialPadding * 5); + }, variant: TargetPlatformVariant.mobile()); + }); + + // Test for `recommendedPanes`. + group('recommendedPanes property', () { + testWidgets('returns 1 for small breakpoint', (WidgetTester tester) async { + await tester.pumpWidget(SimulatedLayout.small.slot(tester)); + await tester.pumpAndSettle(); + expect( + Breakpoint.activeBreakpointOf(tester + .element(find.byKey(const Key('Breakpoints.smallMobile')))) + .recommendedPanes, + 1); + }, variant: TargetPlatformVariant.mobile()); + + testWidgets('returns 1 for medium breakpoint', (WidgetTester tester) async { + await tester.pumpWidget(SimulatedLayout.medium.slot(tester)); + await tester.pumpAndSettle(); + expect( + Breakpoint.activeBreakpointOf(tester + .element(find.byKey(const Key('Breakpoints.mediumMobile')))) + .recommendedPanes, + 1); + }, variant: TargetPlatformVariant.mobile()); + + testWidgets('returns 2 for mediumLarge breakpoint', + (WidgetTester tester) async { + await tester.pumpWidget(SimulatedLayout.mediumLarge.slot(tester)); + await tester.pumpAndSettle(); + expect( + Breakpoint.activeBreakpointOf(tester.element( + find.byKey(const Key('Breakpoints.mediumLargeMobile')))) + .recommendedPanes, + 2); + }, variant: TargetPlatformVariant.mobile()); + + testWidgets('returns 2 for large breakpoint', (WidgetTester tester) async { + await tester.pumpWidget(SimulatedLayout.large.slot(tester)); + await tester.pumpAndSettle(); + expect( + Breakpoint.activeBreakpointOf(tester + .element(find.byKey(const Key('Breakpoints.largeMobile')))) + .recommendedPanes, + 2); + }, variant: TargetPlatformVariant.mobile()); + + testWidgets('returns 2 for extraLarge breakpoint', + (WidgetTester tester) async { + await tester.pumpWidget(SimulatedLayout.extraLarge.slot(tester)); + await tester.pumpAndSettle(); + expect( + Breakpoint.activeBreakpointOf(tester.element( + find.byKey(const Key('Breakpoints.extraLargeMobile')))) + .recommendedPanes, + 2); + }, variant: TargetPlatformVariant.mobile()); + }); + + // Test for `maxPanes`. + group('maxPanes property', () { + testWidgets('returns 1 for small breakpoint', (WidgetTester tester) async { + await tester.pumpWidget(SimulatedLayout.small.slot(tester)); + await tester.pumpAndSettle(); + expect( + Breakpoint.activeBreakpointOf(tester + .element(find.byKey(const Key('Breakpoints.smallMobile')))) + .maxPanes, + 1); + }, variant: TargetPlatformVariant.mobile()); + + testWidgets('returns 2 for medium breakpoint', (WidgetTester tester) async { + await tester.pumpWidget(SimulatedLayout.medium.slot(tester)); + await tester.pumpAndSettle(); + expect( + Breakpoint.activeBreakpointOf(tester + .element(find.byKey(const Key('Breakpoints.mediumMobile')))) + .maxPanes, + 2); + }, variant: TargetPlatformVariant.mobile()); + + testWidgets('returns 2 for mediumLarge breakpoint', + (WidgetTester tester) async { + await tester.pumpWidget(SimulatedLayout.mediumLarge.slot(tester)); + await tester.pumpAndSettle(); + expect( + Breakpoint.activeBreakpointOf(tester.element( + find.byKey(const Key('Breakpoints.mediumLargeMobile')))) + .maxPanes, + 2); + }, variant: TargetPlatformVariant.mobile()); + + testWidgets('returns 2 for large breakpoint', (WidgetTester tester) async { + await tester.pumpWidget(SimulatedLayout.large.slot(tester)); + await tester.pumpAndSettle(); + expect( + Breakpoint.activeBreakpointOf(tester + .element(find.byKey(const Key('Breakpoints.largeMobile')))) + .maxPanes, + 2); + }, variant: TargetPlatformVariant.mobile()); + + testWidgets('returns 3 for extraLarge breakpoint', + (WidgetTester tester) async { + await tester.pumpWidget(SimulatedLayout.extraLarge.slot(tester)); + await tester.pumpAndSettle(); + expect( + Breakpoint.activeBreakpointOf(tester.element( + find.byKey(const Key('Breakpoints.extraLargeMobile')))) + .maxPanes, + 3); + }, variant: TargetPlatformVariant.mobile()); + }); + + group('Breakpoint method tests', () { + testWidgets('isMobile returns true on mobile platforms', + (WidgetTester tester) async { + await tester.pumpWidget(SimulatedLayout.medium.scaffold(tester)); + await tester.pumpAndSettle(); + + expect(Breakpoint.isMobile(tester.element(find.byType(TestScaffold))), + isTrue); + + expect(Breakpoint.isDesktop(tester.element(find.byType(TestScaffold))), + isFalse); + }, variant: TargetPlatformVariant.mobile()); + + testWidgets('isDesktop returns true on desktop platforms', + (WidgetTester tester) async { + await tester.pumpWidget(SimulatedLayout.medium.scaffold(tester)); + await tester.pumpAndSettle(); + + expect(Breakpoint.isDesktop(tester.element(find.byType(TestScaffold))), + isTrue); + + expect(Breakpoint.isMobile(tester.element(find.byType(TestScaffold))), + isFalse); + }, variant: TargetPlatformVariant.desktop()); + + test('Breakpoint comparison operators work correctly', () { + const Breakpoint small = Breakpoints.small; + const Breakpoint medium = Breakpoints.medium; + const Breakpoint large = Breakpoints.large; + + expect(small < medium, isTrue); + expect(large > medium, isTrue); + expect(small <= Breakpoints.small, isTrue); + expect(large >= medium, isTrue); + }); + + test('Breakpoint equality and hashCode', () { + const Breakpoint small1 = Breakpoints.small; + const Breakpoint small2 = Breakpoints.small; + const Breakpoint medium = Breakpoints.medium; + + expect(small1 == small2, isTrue); + expect(small1 == medium, isFalse); + expect(small1.hashCode == small2.hashCode, isTrue); + expect(small1.hashCode == medium.hashCode, isFalse); + }); + + test('Breakpoint between method works correctly', () { + const Breakpoint small = Breakpoints.small; + const Breakpoint medium = Breakpoints.medium; + const Breakpoint large = Breakpoints.large; + + expect(medium.between(small, large), isTrue); + expect(small.between(medium, large), isFalse); + expect(large.between(small, medium), isFalse); + }); + }); } class DummyWidget extends StatelessWidget { diff --git a/packages/flutter_adaptive_scaffold/test/simulated_layout.dart b/packages/flutter_adaptive_scaffold/test/simulated_layout.dart index 8c8b6ce52518..01fba796b6c5 100644 --- a/packages/flutter_adaptive_scaffold/test/simulated_layout.dart +++ b/packages/flutter_adaptive_scaffold/test/simulated_layout.dart @@ -108,15 +108,34 @@ enum SimulatedLayout { medium(width: 800, navSlotKey: 'primaryNavigation'), mediumLarge(width: 1000, navSlotKey: 'primaryNavigation1'), large(width: 1200, navSlotKey: 'primaryNavigation2'), - extraLarge(width: 1600, navSlotKey: 'primaryNavigation3'); + extraLarge(width: 1600, navSlotKey: 'primaryNavigation3'), + smallLandscape(width: 500, height: 400, navSlotKey: 'bottomNavigation'), + mediumLandscape(width: 800, height: 600, navSlotKey: 'primaryNavigation'), + mediumLargeLandscape( + width: 1100, height: 900, navSlotKey: 'primaryNavigation1'), + largeLandscape(width: 1400, height: 1000, navSlotKey: 'primaryNavigation2'), + extraLargeLandscape( + width: 1700, height: 1000, navSlotKey: 'primaryNavigation3'), + smallPortraitMediumLandscape( + width: 360, height: 650, navSlotKey: 'bottomNavigation'), + smallLandscapeMediumPortrait( + width: 650, height: 360, navSlotKey: 'bottomNavigation'), + smallPortraitMediumLargeLandscape( + width: 360, height: 900, navSlotKey: 'bottomNavigation'), + smallLandscapeMediumLargePortrait( + width: 900, height: 360, navSlotKey: 'primaryNavigation'), + mediumLargeLandscapeMediumPortrait( + width: 841, height: 668, navSlotKey: 'primaryNavigation'); const SimulatedLayout({ required double width, + double height = 2000, required this.navSlotKey, - }) : _width = width; + }) : _width = width, + _height = height; final double _width; - final double _height = 2000; + final double _height; final String navSlotKey; static const Color navigationRailThemeBgColor = Colors.white; @@ -131,11 +150,7 @@ enum SimulatedLayout { Size get size => Size(_width, _height); - MaterialApp app({ - int? initialIndex, - bool animations = true, - Breakpoint? appBarBreakpoint, - }) { + MaterialApp app(WidgetTester tester, {required Widget child}) { return MaterialApp( theme: ThemeData.light().copyWith( navigationRailTheme: const NavigationRailThemeData( @@ -145,15 +160,27 @@ enum SimulatedLayout { ), ), home: MediaQuery( - data: MediaQueryData( - size: size, + data: MediaQueryData.fromView(tester.view).copyWith( + size: Size(_width, _height), padding: const EdgeInsets.only(top: 30), ), - child: TestScaffold( - initialIndex: initialIndex, - isAnimated: animations, - appBarBreakpoint: appBarBreakpoint, - ), + child: child, + ), + ); + } + + MaterialApp scaffold( + WidgetTester tester, { + int? initialIndex, + bool animations = true, + Breakpoint? appBarBreakpoint, + }) { + return app( + tester, + child: TestScaffold( + initialIndex: initialIndex, + isAnimated: animations, + appBarBreakpoint: appBarBreakpoint, ), ); } @@ -234,4 +261,29 @@ enum SimulatedLayout { ), ); } + + MediaQuery slotAndUp(WidgetTester tester) { + return MediaQuery( + data: MediaQueryData.fromView(tester.view) + .copyWith(size: Size(_width, _height)), + child: Theme( + data: ThemeData(), + child: Directionality( + textDirection: TextDirection.ltr, + child: SlotLayout( + config: { + Breakpoints.small: SlotLayout.from( + key: const Key('Breakpoints.small'), + builder: (BuildContext context) => Container(), + ), + Breakpoints.mediumAndUp: SlotLayout.from( + key: const Key('Breakpoints.mediumAndUp'), + builder: (BuildContext context) => Container(), + ), + }, + ), + ), + ), + ); + } } diff --git a/packages/flutter_adaptive_scaffold/test/slot_layout_test.dart b/packages/flutter_adaptive_scaffold/test/slot_layout_test.dart new file mode 100644 index 000000000000..f2a8005a3618 --- /dev/null +++ b/packages/flutter_adaptive_scaffold/test/slot_layout_test.dart @@ -0,0 +1,185 @@ +// 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/widgets.dart'; +import 'package:flutter_adaptive_scaffold/src/breakpoints.dart'; +import 'package:flutter_adaptive_scaffold/src/slot_layout.dart'; +import 'package:flutter_test/flutter_test.dart'; + +void main() { + testWidgets( + 'SlotLayout displays correct widget based on screen width', + (WidgetTester tester) async { + MediaQuery slot(double width) { + return MediaQuery( + data: MediaQueryData(size: Size(width, 2000)), + child: Directionality( + textDirection: TextDirection.ltr, + child: SlotLayout( + config: { + Breakpoints.smallAndUp: SlotLayout.from( + key: const Key('0'), builder: (_) => const Text('Small')), + Breakpoints.mediumAndUp: SlotLayout.from( + key: const Key('400'), + builder: (_) => const Text('Medium')), + Breakpoints.largeAndUp: SlotLayout.from( + key: const Key('800'), builder: (_) => const Text('Large')), + }, + ), + ), + ); + } + + await tester.pumpWidget(slot(300)); + expect(find.text('Small'), findsOneWidget); + expect(find.text('Medium'), findsNothing); + expect(find.text('Large'), findsNothing); + + await tester.pumpWidget(slot(600)); + expect(find.text('Small'), findsNothing); + expect(find.text('Medium'), findsOneWidget); + expect(find.text('Large'), findsNothing); + + await tester.pumpWidget(slot(1200)); + expect(find.text('Small'), findsNothing); + expect(find.text('Medium'), findsNothing); + expect(find.text('Large'), findsOneWidget); + }, + ); + + testWidgets( + 'SlotLayout handles null configurations gracefully', + (WidgetTester tester) async { + await tester.pumpWidget( + MediaQuery( + data: MediaQueryData.fromView(tester.view) + .copyWith(size: const Size(500, 2000)), + child: Directionality( + textDirection: TextDirection.ltr, + child: SlotLayout( + config: { + Breakpoints.smallAndUp: SlotLayout.from( + key: const Key('0'), + builder: (BuildContext context) => Container(), + ), + Breakpoints.mediumAndUp: null, + Breakpoints.largeAndUp: SlotLayout.from( + key: const Key('800'), + builder: (BuildContext context) => Container(), + ), + }, + ), + ), + ), + ); + + expect(find.byKey(const Key('0')), findsOneWidget); + expect(find.byKey(const Key('400')), findsNothing); + expect(find.byKey(const Key('800')), findsNothing); + }, + ); + + testWidgets( + 'SlotLayout builder generates widgets correctly', + (WidgetTester tester) async { + await tester.pumpWidget( + MediaQuery( + data: const MediaQueryData(size: Size(600, 2000)), + child: Directionality( + textDirection: TextDirection.ltr, + child: SlotLayout( + config: { + Breakpoints.mediumAndUp: SlotLayout.from( + key: const Key('0'), + builder: (_) => const Text('Builder Test')), + }, + ), + ), + ), + ); + + expect(find.text('Builder Test'), findsOneWidget); + }, + ); + + testWidgets( + 'SlotLayout applies inAnimation and outAnimation correctly when changing breakpoints', + (WidgetTester tester) async { + // Define a SlotLayout with custom animations. + Widget buildSlotLayout(double width) { + return MediaQuery( + data: MediaQueryData(size: Size(width, 2000)), + child: Directionality( + textDirection: TextDirection.ltr, + child: SlotLayout( + config: { + Breakpoints.smallAndUp: SlotLayout.from( + key: const Key('small'), + builder: (_) => const SizedBox( + key: Key('smallBox'), width: 100, height: 100), + inAnimation: (Widget widget, Animation animation) => + ScaleTransition( + scale: animation, + child: widget, + ), + outAnimation: (Widget widget, Animation animation) => + FadeTransition( + opacity: animation, + child: widget, + ), + inDuration: const Duration(seconds: 1), + outDuration: const Duration(seconds: 2), + inCurve: Curves.easeIn, + outCurve: Curves.easeOut, + ), + Breakpoints.mediumAndUp: SlotLayout.from( + key: const Key('medium'), + builder: (_) => const SizedBox( + key: Key('mediumBox'), width: 200, height: 200), + inAnimation: (Widget widget, Animation animation) => + ScaleTransition( + scale: animation, + child: widget, + ), + outAnimation: (Widget widget, Animation animation) => + FadeTransition( + opacity: animation, + child: widget, + ), + inDuration: const Duration(seconds: 1), + outDuration: const Duration(seconds: 2), + inCurve: Curves.easeIn, + outCurve: Curves.easeOut, + ), + }, + ), + ), + ); + } + + // Pump the widget with the SlotLayout at small breakpoint. + await tester.pumpWidget(buildSlotLayout(300)); + expect(find.byKey(const Key('smallBox')), findsOneWidget); + expect(find.byKey(const Key('mediumBox')), findsNothing); + + // Change to medium breakpoint to trigger outAnimation for small and inAnimation for medium. + await tester.pumpWidget(buildSlotLayout(600)); + await tester.pump(); // Start the animation. + await tester.pump(const Duration( + milliseconds: 1000)); // Halfway through the outDuration. + + // Verify that the outAnimation is in progress for smallBox. + final FadeTransition fadeTransitionMid = + tester.widget(find.byType(FadeTransition)); + expect(fadeTransitionMid.opacity.value, lessThan(1.0)); + expect(fadeTransitionMid.opacity.value, greaterThan(0.0)); + + // Complete the animation. + await tester.pumpAndSettle(); + expect(find.byKey(const Key('smallBox')), findsNothing); + expect(find.byKey(const Key('mediumBox')), findsOneWidget); + }, + ); +} diff --git a/packages/flutter_adaptive_scaffold/test/test_breakpoints.dart b/packages/flutter_adaptive_scaffold/test/test_breakpoints.dart index ef94b2f2aa23..ea51ca637e8d 100644 --- a/packages/flutter_adaptive_scaffold/test/test_breakpoints.dart +++ b/packages/flutter_adaptive_scaffold/test/test_breakpoints.dart @@ -8,46 +8,46 @@ import 'package:flutter_adaptive_scaffold/src/breakpoints.dart'; class TestBreakpoint0 extends Breakpoint { @override bool isActive(BuildContext context) { - return MediaQuery.of(context).size.width >= 0 && - MediaQuery.of(context).size.width < 800; + return MediaQuery.sizeOf(context).width >= 0 && + MediaQuery.sizeOf(context).width < 800; } } class TestBreakpoint400 extends Breakpoint { @override bool isActive(BuildContext context) { - return MediaQuery.of(context).size.width > 400; + return MediaQuery.sizeOf(context).width > 400; } } class TestBreakpoint800 extends Breakpoint { @override bool isActive(BuildContext context) { - return MediaQuery.of(context).size.width >= 800 && - MediaQuery.of(context).size.width < 1000; + return MediaQuery.sizeOf(context).width >= 800 && + MediaQuery.sizeOf(context).width < 1000; } } class TestBreakpoint1000 extends Breakpoint { @override bool isActive(BuildContext context) { - return MediaQuery.of(context).size.width >= 1000 && - MediaQuery.of(context).size.width < 1200; + return MediaQuery.sizeOf(context).width >= 1000 && + MediaQuery.sizeOf(context).width < 1200; } } class TestBreakpoint1200 extends Breakpoint { @override bool isActive(BuildContext context) { - return MediaQuery.of(context).size.width >= 1200 && - MediaQuery.of(context).size.width < 1600; + return MediaQuery.sizeOf(context).width >= 1200 && + MediaQuery.sizeOf(context).width < 1600; } } class TestBreakpoint1600 extends Breakpoint { @override bool isActive(BuildContext context) { - return MediaQuery.of(context).size.width >= 1600; + return MediaQuery.sizeOf(context).width >= 1600; } } diff --git a/packages/flutter_image/example/android/app/build.gradle b/packages/flutter_image/example/android/app/build.gradle index dc2df2c455ef..c6be519fd577 100644 --- a/packages/flutter_image/example/android/app/build.gradle +++ b/packages/flutter_image/example/android/app/build.gradle @@ -31,12 +31,12 @@ android { ndkVersion flutter.ndkVersion compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_11 + targetCompatibility JavaVersion.VERSION_11 } kotlinOptions { - jvmTarget = '1.8' + jvmTarget = '11' } sourceSets { diff --git a/packages/flutter_image/example/android/build.gradle b/packages/flutter_image/example/android/build.gradle index fdf447f8a7e6..491936f2fbef 100644 --- a/packages/flutter_image/example/android/build.gradle +++ b/packages/flutter_image/example/android/build.gradle @@ -6,7 +6,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:7.3.0' + classpath 'com.android.tools.build:gradle:8.5.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } 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..3c85cfe057a1 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-8.7-all.zip diff --git a/packages/flutter_image/example/pubspec.yaml b/packages/flutter_image/example/pubspec.yaml index 09a4891f0987..a7a03cb89c89 100644 --- a/packages/flutter_image/example/pubspec.yaml +++ b/packages/flutter_image/example/pubspec.yaml @@ -17,7 +17,6 @@ dependencies: path: "../" dev_dependencies: - flutter_lints: ^2.0.0 flutter_test: sdk: flutter integration_test: diff --git a/packages/flutter_lints/CHANGELOG.md b/packages/flutter_lints/CHANGELOG.md index 27b4f0088b9e..a65e7e221228 100644 --- a/packages/flutter_lints/CHANGELOG.md +++ b/packages/flutter_lints/CHANGELOG.md @@ -1,6 +1,14 @@ -## NEXT - -* Updates minimum supported SDK version to Flutter 3.19/Dart 3.3. +## 5.0.0 + +* Updates `package:lints` dependency to version 5.0.0, with the following changes: + * adds `invalid_runtime_check_with_js_interop_types` + * adds `unnecessary_library_name` + * removes `avoid_null_checks_in_equality_operators` +* Removes the following lints (see https://github.com/dart-lang/lints/issues/205): + * `prefer_const_constructors` + * `prefer_const_declarations` + * `prefer_const_literals_to_create_immutables` +* Updates minimum supported SDK version to Flutter 3.24/Dart 3.5. ## 4.0.0 diff --git a/packages/flutter_lints/example/pubspec.yaml b/packages/flutter_lints/example/pubspec.yaml index be7138b0391d..472307f440dd 100644 --- a/packages/flutter_lints/example/pubspec.yaml +++ b/packages/flutter_lints/example/pubspec.yaml @@ -10,4 +10,4 @@ environment: # lint set provided by this package is activated in the `analysis_options.yaml` # file located next to this `pubspec.yaml` file. dev_dependencies: - flutter_lints: ^1.0.0 # Check https://pub.dev/packages/flutter_lints for latest version number. + flutter_lints: ^4.0.0 # Check https://pub.dev/packages/flutter_lints for latest version number. diff --git a/packages/flutter_lints/lib/flutter.yaml b/packages/flutter_lints/lib/flutter.yaml index bcad70fc1087..8c108e2b5b44 100644 --- a/packages/flutter_lints/lib/flutter.yaml +++ b/packages/flutter_lints/lib/flutter.yaml @@ -8,10 +8,7 @@ linter: - avoid_unnecessary_containers - avoid_web_libraries_in_flutter - no_logic_in_create_state - - prefer_const_constructors - prefer_const_constructors_in_immutables - - prefer_const_declarations - - prefer_const_literals_to_create_immutables - sized_box_for_whitespace - sort_child_properties_last - use_build_context_synchronously diff --git a/packages/flutter_lints/pubspec.yaml b/packages/flutter_lints/pubspec.yaml index b4eae22b9c61..3aa9f13622ac 100644 --- a/packages/flutter_lints/pubspec.yaml +++ b/packages/flutter_lints/pubspec.yaml @@ -2,13 +2,13 @@ name: flutter_lints description: Recommended lints for Flutter apps, packages, and plugins to encourage good coding practices. repository: https://github.com/flutter/packages/tree/main/packages/flutter_lints issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+flutter_lints%22 -version: 4.0.0 +version: 5.0.0 environment: - sdk: ^3.3.0 + sdk: ^3.5.0 dependencies: - lints: ^4.0.0 + lints: ^5.0.0 # Code is not allowed in this package. Do not add any dependencies or dev_dependencies. topics: diff --git a/packages/flutter_markdown/CHANGELOG.md b/packages/flutter_markdown/CHANGELOG.md index ee577fa82098..002d6d150abd 100644 --- a/packages/flutter_markdown/CHANGELOG.md +++ b/packages/flutter_markdown/CHANGELOG.md @@ -1,3 +1,16 @@ +## 0.7.4+1 + +* Makes it so that custom blocks are not limited to being a Column or + SizedBox. + +## 0.7.4 + +* Makes paragraphs in blockquotes soft-wrap like a normal `
` instead of hard-wrapping like a `
` block.
+
+## 0.7.3+2
+
+* Resolves an issue where code blocks in markdown were not highlighted during selection.
+
 ## 0.7.3+1
 
 * Fixes issue with table column alignments not being respected.
diff --git a/packages/flutter_markdown/example/android/build.gradle b/packages/flutter_markdown/example/android/build.gradle
index d13ef556e261..0501e9227a37 100644
--- a/packages/flutter_markdown/example/android/build.gradle
+++ b/packages/flutter_markdown/example/android/build.gradle
@@ -6,7 +6,7 @@ buildscript {
     }
 
     dependencies {
-        classpath 'com.android.tools.build:gradle:7.4.2'
+        classpath 'com.android.tools.build:gradle:8.1.0'
         classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
     }
 }
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..7aeeb11c6ee5 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-8.7-all.zip
diff --git a/packages/flutter_markdown/lib/src/builder.dart b/packages/flutter_markdown/lib/src/builder.dart
index 0ec8833c42c0..ea9af16acfbe 100644
--- a/packages/flutter_markdown/lib/src/builder.dart
+++ b/packages/flutter_markdown/lib/src/builder.dart
@@ -362,7 +362,7 @@ class MarkdownBuilder implements md.NodeVisitor {
           style: _isInBlockquote
               ? styleSheet.blockquote!.merge(_inlines.last.style)
               : _inlines.last.style,
-          text: _isInBlockquote ? text.text : trimText(text.text),
+          text: trimText(text.text),
           recognizer: _linkHandlers.isNotEmpty ? _linkHandlers.last : null,
         ),
         textAlign: _textAlignForBlockTag(_currentBlockTag),
@@ -383,20 +383,29 @@ class MarkdownBuilder implements md.NodeVisitor {
       _addAnonymousBlockIfNeeded();
 
       final _BlockElement current = _blocks.removeLast();
-      Widget child;
 
-      if (current.children.isNotEmpty) {
-        child = Column(
-          mainAxisSize: MainAxisSize.min,
-          crossAxisAlignment: fitContent
-              ? CrossAxisAlignment.start
-              : CrossAxisAlignment.stretch,
-          children: current.children,
-        );
-      } else {
-        child = const SizedBox();
+      Widget defaultChild() {
+        if (current.children.isNotEmpty) {
+          return Column(
+            mainAxisSize: MainAxisSize.min,
+            crossAxisAlignment: fitContent
+                ? CrossAxisAlignment.start
+                : CrossAxisAlignment.stretch,
+            children: current.children,
+          );
+        } else {
+          return const SizedBox();
+        }
       }
 
+      Widget child = builders[tag]?.visitElementAfterWithContext(
+            delegate.context,
+            element,
+            styleSheet.styles[tag],
+            _inlines.isNotEmpty ? _inlines.last.style : null,
+          ) ??
+          defaultChild();
+
       if (_isListTag(tag)) {
         assert(_listIndents.isNotEmpty);
         _listIndents.removeLast();
diff --git a/packages/flutter_markdown/lib/src/style_sheet.dart b/packages/flutter_markdown/lib/src/style_sheet.dart
index 3923e618ff36..0a6b1b430e72 100644
--- a/packages/flutter_markdown/lib/src/style_sheet.dart
+++ b/packages/flutter_markdown/lib/src/style_sheet.dart
@@ -104,7 +104,7 @@ class MarkdownStyleSheet {
       p: theme.textTheme.bodyMedium,
       pPadding: EdgeInsets.zero,
       code: theme.textTheme.bodyMedium!.copyWith(
-        backgroundColor: theme.cardTheme.color ?? theme.cardColor,
+        backgroundColor: theme.cardTheme.color,
         fontFamily: 'monospace',
         fontSize: theme.textTheme.bodyMedium!.fontSize! * 0.85,
       ),
@@ -175,9 +175,6 @@ class MarkdownStyleSheet {
       p: theme.textTheme.textStyle,
       pPadding: EdgeInsets.zero,
       code: theme.textTheme.textStyle.copyWith(
-        backgroundColor: theme.brightness == Brightness.dark
-            ? CupertinoColors.systemGrey6.darkColor
-            : CupertinoColors.systemGrey6.color,
         fontFamily: 'monospace',
         fontSize: theme.textTheme.textStyle.fontSize! * 0.85,
       ),
@@ -284,7 +281,7 @@ class MarkdownStyleSheet {
       p: theme.textTheme.bodyMedium,
       pPadding: EdgeInsets.zero,
       code: theme.textTheme.bodyMedium!.copyWith(
-        backgroundColor: theme.cardTheme.color ?? theme.cardColor,
+        backgroundColor: theme.cardTheme.color,
         fontFamily: 'monospace',
         fontSize: theme.textTheme.bodyMedium!.fontSize! * 0.85,
       ),
diff --git a/packages/flutter_markdown/pubspec.yaml b/packages/flutter_markdown/pubspec.yaml
index 78a0ac36cfb4..5f743a8b032a 100644
--- a/packages/flutter_markdown/pubspec.yaml
+++ b/packages/flutter_markdown/pubspec.yaml
@@ -4,7 +4,7 @@ description: A Markdown renderer for Flutter. Create rich text output,
   formatted with simple Markdown tags.
 repository: https://github.com/flutter/packages/tree/main/packages/flutter_markdown
 issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+flutter_markdown%22
-version: 0.7.3+1
+version: 0.7.4+1
 
 environment:
   sdk: ^3.3.0
@@ -20,7 +20,7 @@ dependencies:
 dev_dependencies:
   flutter_test:
     sdk: flutter
-  mockito: 5.4.4
+  mockito: ^5.4.4
   standard_message_codec: ^0.0.1+3
 
 topics:
diff --git a/packages/flutter_markdown/test/blockquote_test.dart b/packages/flutter_markdown/test/blockquote_test.dart
index 2d1fa3e30a4c..07e88f4c9e09 100644
--- a/packages/flutter_markdown/test/blockquote_test.dart
+++ b/packages/flutter_markdown/test/blockquote_test.dart
@@ -25,6 +25,20 @@ void defineTests() {
       },
     );
 
+    testWidgets(
+      'soft wrapping in blockquote',
+      (WidgetTester tester) async {
+        await tester.pumpWidget(
+          boilerplate(
+            const MarkdownBody(data: '> soft\n> wrap'),
+          ),
+        );
+
+        final Iterable widgets = tester.allWidgets;
+        expectTextStrings(widgets, ['soft wrap']);
+      },
+    );
+
     testWidgets(
       'should work with styling',
       (WidgetTester tester) async {
diff --git a/packages/flutter_markdown/test/custom_syntax_test.dart b/packages/flutter_markdown/test/custom_syntax_test.dart
index 28d55cdfd0b5..8dc0c806e51f 100644
--- a/packages/flutter_markdown/test/custom_syntax_test.dart
+++ b/packages/flutter_markdown/test/custom_syntax_test.dart
@@ -59,6 +59,35 @@ void defineTests() {
       },
     );
 
+    testWidgets(
+      'Block with custom tag',
+      (WidgetTester tester) async {
+        const String textBefore = 'Before ';
+        const String textAfter = ' After';
+        const String blockContent = 'Custom content rendered in a ColoredBox';
+
+        await tester.pumpWidget(
+          boilerplate(
+            Markdown(
+              data:
+                  '$textBefore\n{{custom}}\n$blockContent\n{{/custom}}\n$textAfter',
+              extensionSet: md.ExtensionSet.none,
+              blockSyntaxes: [CustomTagBlockSyntax()],
+              builders: {
+                'custom': CustomTagBlockBuilder(),
+              },
+            ),
+          ),
+        );
+
+        final ColoredBox container =
+            tester.widgetList(find.byType(ColoredBox)).first as ColoredBox;
+        expect(container.color, Colors.red);
+        expect(container.child, isInstanceOf());
+        expect((container.child! as Text).data, blockContent);
+      },
+    );
+
     testWidgets(
       'link for wikistyle',
       (WidgetTester tester) async {
@@ -380,3 +409,54 @@ class NoteSyntax extends md.BlockSyntax {
   @override
   RegExp get pattern => RegExp(r'^\[!NOTE] ');
 }
+
+class CustomTagBlockBuilder extends MarkdownElementBuilder {
+  @override
+  bool isBlockElement() => true;
+
+  @override
+  Widget visitElementAfterWithContext(
+    BuildContext context,
+    md.Element element,
+    TextStyle? preferredStyle,
+    TextStyle? parentStyle,
+  ) {
+    if (element.tag == 'custom') {
+      final String content = element.attributes['content']!;
+      return ColoredBox(
+          color: Colors.red, child: Text(content, style: preferredStyle));
+    }
+    return const SizedBox.shrink();
+  }
+}
+
+class CustomTagBlockSyntax extends md.BlockSyntax {
+  @override
+  bool canParse(md.BlockParser parser) {
+    return parser.current.content.startsWith('{{custom}}');
+  }
+
+  @override
+  RegExp get pattern => RegExp(r'\{\{custom\}\}([\s\S]*?)\{\{/custom\}\}');
+
+  @override
+  md.Node parse(md.BlockParser parser) {
+    parser.advance();
+
+    final StringBuffer buffer = StringBuffer();
+    while (
+        !parser.current.content.startsWith('{{/custom}}') && !parser.isDone) {
+      buffer.writeln(parser.current.content);
+      parser.advance();
+    }
+
+    if (!parser.isDone) {
+      parser.advance();
+    }
+
+    final String content = buffer.toString().trim();
+    final md.Element element = md.Element.empty('custom');
+    element.attributes['content'] = content;
+    return element;
+  }
+}
diff --git a/packages/flutter_markdown/test/style_sheet_test.dart b/packages/flutter_markdown/test/style_sheet_test.dart
index b48465a415a0..30f071a15940 100644
--- a/packages/flutter_markdown/test/style_sheet_test.dart
+++ b/packages/flutter_markdown/test/style_sheet_test.dart
@@ -62,8 +62,6 @@ void defineTests() {
         expect(
             style.code!.fontSize, cTheme.textTheme.textStyle.fontSize! * 0.85);
         expect(style.code!.fontFamily, 'monospace');
-        expect(
-            style.code!.backgroundColor, CupertinoColors.systemGrey6.darkColor);
 
         // H1
         expect(style.h1!.color, cTheme.textTheme.textStyle.color);
@@ -152,7 +150,7 @@ void defineTests() {
         expect(
             style.code!.fontSize, theme.textTheme.bodyMedium!.fontSize! * 0.85);
         expect(style.code!.fontFamily, 'monospace');
-        expect(style.code!.backgroundColor, theme.cardColor);
+        expect(style.code!.backgroundColor, theme.cardTheme.color);
 
         // H1
         expect(style.h1, theme.textTheme.headlineSmall);
diff --git a/packages/flutter_migrate/pubspec.yaml b/packages/flutter_migrate/pubspec.yaml
index 7947cf18d9de..5eae9bd21ba8 100644
--- a/packages/flutter_migrate/pubspec.yaml
+++ b/packages/flutter_migrate/pubspec.yaml
@@ -21,6 +21,6 @@ dependencies:
 
 dev_dependencies:
   collection: ^1.16.0
-  file_testing: 3.0.0
+  file_testing: ^3.0.0
   lints: ^2.0.0
   test: ^1.16.0
diff --git a/packages/flutter_plugin_android_lifecycle/CHANGELOG.md b/packages/flutter_plugin_android_lifecycle/CHANGELOG.md
index 3d464723ee69..f9c8ebd2d9c8 100644
--- a/packages/flutter_plugin_android_lifecycle/CHANGELOG.md
+++ b/packages/flutter_plugin_android_lifecycle/CHANGELOG.md
@@ -1,3 +1,12 @@
+## 2.0.23
+
+* Updates Java compatibility version to 11.
+* Updates minimum supported SDK version to Flutter 3.24/Dart 3.5.
+
+## 2.0.22
+
+* Bumps `com.android.tools.build:gradle` from 7.2.1 to 8.5.1.
+
 ## 2.0.21
 
 * Updates lint checks to ignore NewerVersionAvailable.
diff --git a/packages/flutter_plugin_android_lifecycle/android/build.gradle b/packages/flutter_plugin_android_lifecycle/android/build.gradle
index 1c72879d8e8a..6f897eed0f51 100644
--- a/packages/flutter_plugin_android_lifecycle/android/build.gradle
+++ b/packages/flutter_plugin_android_lifecycle/android/build.gradle
@@ -8,7 +8,7 @@ buildscript {
     }
 
     dependencies {
-        classpath 'com.android.tools.build:gradle:7.2.1'
+        classpath 'com.android.tools.build:gradle:8.5.1'
     }
 }
 
@@ -22,10 +22,7 @@ rootProject.allprojects {
 apply plugin: 'com.android.library'
 
 android {
-    // Conditional for compatibility with AGP <4.2.
-    if (project.android.hasProperty("namespace")) {
-        namespace 'io.flutter.plugins.flutter_plugin_android_lifecycle'
-    }
+    namespace 'io.flutter.plugins.flutter_plugin_android_lifecycle'
     compileSdk 34
 
     defaultConfig {
@@ -35,8 +32,8 @@ android {
     }
 
     compileOptions {
-        sourceCompatibility JavaVersion.VERSION_1_8
-        targetCompatibility JavaVersion.VERSION_1_8
+        sourceCompatibility JavaVersion.VERSION_11
+        targetCompatibility JavaVersion.VERSION_11
     }
 
     lintOptions {
diff --git a/packages/flutter_plugin_android_lifecycle/example/android/app/build.gradle b/packages/flutter_plugin_android_lifecycle/example/android/app/build.gradle
index 19689e74b474..e1180336ff03 100644
--- a/packages/flutter_plugin_android_lifecycle/example/android/app/build.gradle
+++ b/packages/flutter_plugin_android_lifecycle/example/android/app/build.gradle
@@ -1,3 +1,9 @@
+plugins {
+    id "com.android.application"
+    id "dev.flutter.flutter-gradle-plugin"
+    id "com.google.cloud.artifactregistry.gradle-plugin"
+}
+
 def localProperties = new Properties()
 def localPropertiesFile = rootProject.file('local.properties')
 if (localPropertiesFile.exists()) {
@@ -6,11 +12,6 @@ if (localPropertiesFile.exists()) {
     }
 }
 
-def flutterRoot = localProperties.getProperty('flutter.sdk')
-if (flutterRoot == null) {
-    throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
-}
-
 def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
 if (flutterVersionCode == null) {
     flutterVersionCode = '1'
@@ -21,8 +22,6 @@ if (flutterVersionName == null) {
     flutterVersionName = '1.0'
 }
 
-apply plugin: 'com.android.application'
-apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
 
 android {
     compileSdk flutter.compileSdkVersion
@@ -32,7 +31,7 @@ android {
         // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
         applicationId "io.flutter.plugins.flutter_plugin_android_lifecycle_example"
         minSdkVersion flutter.minSdkVersion
-        targetSdkVersion 28
+        targetSdkVersion 34
         versionCode flutterVersionCode.toInteger()
         versionName flutterVersionName
         testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
diff --git a/packages/flutter_plugin_android_lifecycle/example/android/app/src/main/AndroidManifest.xml b/packages/flutter_plugin_android_lifecycle/example/android/app/src/main/AndroidManifest.xml
index b203b2d8e214..64dfbc097ffd 100644
--- a/packages/flutter_plugin_android_lifecycle/example/android/app/src/main/AndroidManifest.xml
+++ b/packages/flutter_plugin_android_lifecycle/example/android/app/src/main/AndroidManifest.xml
@@ -4,6 +4,7 @@
         android:icon="@mipmap/ic_launcher">
          plugins.load(reader) }
-}
-
-plugins.each { name, path ->
-    def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
-    include ":$name"
-    project(":$name").projectDir = pluginDirectory
+    repositories {
+        google()
+        mavenCentral()
+        gradlePluginPortal()
+    }
 }
 
 // See https://github.com/flutter/flutter/blob/master/docs/ecosystem/Plugins-and-Packages-repository-structure.md#gradle-structure for more info.
 buildscript {
-  repositories {
-    maven {
-      url "https://plugins.gradle.org/m2/"
+    repositories {
+        maven {
+            url "https://plugins.gradle.org/m2/"
+        }
+    }
+    dependencies {
+        classpath "gradle.plugin.com.google.cloud.artifactregistry:artifactregistry-gradle-plugin:2.2.1"
     }
-  }
-  dependencies {
-    classpath "gradle.plugin.com.google.cloud.artifactregistry:artifactregistry-gradle-plugin:2.2.1"
-  }
+}
+
+plugins {
+    id "dev.flutter.flutter-plugin-loader" version "1.0.0"
+    id "com.android.application" version "8.1.0" apply false
 }
 apply plugin: "com.google.cloud.artifactregistry.gradle-plugin"
+
+include ":app"
diff --git a/packages/flutter_plugin_android_lifecycle/example/pubspec.yaml b/packages/flutter_plugin_android_lifecycle/example/pubspec.yaml
index 98ca0aebd4dc..82c37c6e77c1 100644
--- a/packages/flutter_plugin_android_lifecycle/example/pubspec.yaml
+++ b/packages/flutter_plugin_android_lifecycle/example/pubspec.yaml
@@ -3,8 +3,8 @@ description: Demonstrates how to use the flutter_plugin_android_lifecycle plugin
 publish_to: none
 
 environment:
-  sdk: ^3.4.0
-  flutter: ">=3.22.0"
+  sdk: ^3.5.0
+  flutter: ">=3.24.0"
 
 dependencies:
   flutter:
diff --git a/packages/flutter_plugin_android_lifecycle/pubspec.yaml b/packages/flutter_plugin_android_lifecycle/pubspec.yaml
index 958a482e60b5..0e8bb6653a43 100644
--- a/packages/flutter_plugin_android_lifecycle/pubspec.yaml
+++ b/packages/flutter_plugin_android_lifecycle/pubspec.yaml
@@ -2,11 +2,11 @@ name: flutter_plugin_android_lifecycle
 description: Flutter plugin for accessing an Android Lifecycle within other plugins.
 repository: https://github.com/flutter/packages/tree/main/packages/flutter_plugin_android_lifecycle
 issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+flutter_plugin_android_lifecycle%22
-version: 2.0.21
+version: 2.0.23
 
 environment:
-  sdk: ^3.4.0
-  flutter: ">=3.22.0"
+  sdk: ^3.5.0
+  flutter: ">=3.24.0"
 
 flutter:
   plugin:
diff --git a/packages/go_router/CHANGELOG.md b/packages/go_router/CHANGELOG.md
index 80b1a17e2845..969415b10d55 100644
--- a/packages/go_router/CHANGELOG.md
+++ b/packages/go_router/CHANGELOG.md
@@ -1,6 +1,31 @@
-## NEXT
+## 14.3.0
 
-* Updates minimum supported SDK version to Flutter 3.19/Dart 3.3.
+- Added missing implementation for the routerNeglect parameter in GoRouter.
+
+## 14.2.9
+
+- Relaxes route path requirements. Both root and child routes can now start with or without '/'.
+
+## 14.2.8
+
+- Updated custom_stateful_shell_route example to better support swiping in TabView as well as demonstration of the use of PageView. 
+
+## 14.2.7
+
+- Fixes issue so that the parseRouteInformationWithContext can handle non-http Uris.
+
+## 14.2.6
+
+- Fixes replace and pushReplacement uri when only one route match in current route match list.
+
+## 14.2.5
+
+- Fixes an issue where android back button pops pages in the wrong order.
+
+## 14.2.4
+
+- Updates minimum supported SDK version to Flutter 3.19/Dart 3.3.
+- Fix GoRouter configuration in `upgrading.md`
 
 ## 14.2.3
 
diff --git a/packages/go_router/doc/navigation.md b/packages/go_router/doc/navigation.md
index af7d1b3bb1ae..efe667f706d1 100644
--- a/packages/go_router/doc/navigation.md
+++ b/packages/go_router/doc/navigation.md
@@ -49,6 +49,32 @@ widget.
 See [issue #102408](https://github.com/flutter/flutter/issues/102408)
 for details on what such an API might look like in go_router.
 
+## Disable browser history tracking when navigating 
+
+To disable browser history tracking when navigating, use the `neglect` method 
+of the `Router` class:
+
+```dart
+ElevatedButton(
+  onPressed: () => Router.neglect(
+    context,
+    () => context.go('/destination'),
+  ),
+  child: ...
+),
+```
+
+To disable browser history tracking for the **entire** application, set the 
+`routerNeglect` property of the `GoRouter` widget to `true`:
+```dart
+final _router = GoRouter(
+  routerNeglect: true,
+  routes: [
+    ...
+  ],
+);
+```
+
 ## Imperative navigation with Navigator
 You can continue using the Navigator to push and pop pages. Pages displayed in
 this way are not deep-linkable and will be replaced if any parent page that is
diff --git a/packages/go_router/doc/upgrading.md b/packages/go_router/doc/upgrading.md
index 72af6b91137f..418c994e412b 100644
--- a/packages/go_router/doc/upgrading.md
+++ b/packages/go_router/doc/upgrading.md
@@ -3,6 +3,7 @@ home screen and creating a GoRoute for each screen you would like to be
 deep-linkable.
 
 # Upgrade an app that uses Navigator
+
 To upgrade an app that is already using the Navigator for routing, start with
 a single route for the home screen:
 
@@ -37,6 +38,7 @@ aren't deep-linkable. You can gradually add more routes to the GoRouter
 configuration.
 
 # Upgrade an app that uses named routes
+
 An app that uses named routes can be migrated to go_router by changing each
 entry in the map to a GoRoute object and changing any calls to
 `Navigator.of(context).pushNamed` to `context.go()`.
@@ -57,7 +59,7 @@ Then the GoRouter configuration would look like this:
 
 ```dart
 GoRouter(
-  initialRoute: '/details',
+  initialLocation: '/details',
   routes: [
     GoRoute(
       path: '/',
diff --git a/packages/go_router/example/android/app/build.gradle b/packages/go_router/example/android/app/build.gradle
index 5ea125183af6..6453592dd8ba 100644
--- a/packages/go_router/example/android/app/build.gradle
+++ b/packages/go_router/example/android/app/build.gradle
@@ -29,12 +29,12 @@ android {
     compileSdk flutter.compileSdkVersion
 
     compileOptions {
-        sourceCompatibility JavaVersion.VERSION_1_8
-        targetCompatibility JavaVersion.VERSION_1_8
+        sourceCompatibility JavaVersion.VERSION_11
+        targetCompatibility JavaVersion.VERSION_11
     }
 
     kotlinOptions {
-        jvmTarget = '1.8'
+        jvmTarget = '11'
     }
 
     sourceSets {
diff --git a/packages/go_router/example/android/build.gradle b/packages/go_router/example/android/build.gradle
index 8a2e9e183dd7..cd70ddd54b1e 100644
--- a/packages/go_router/example/android/build.gradle
+++ b/packages/go_router/example/android/build.gradle
@@ -6,7 +6,7 @@ buildscript {
     }
 
     dependencies {
-        classpath 'com.android.tools.build:gradle:7.4.2'
+        classpath 'com.android.tools.build:gradle:8.1.0'
         classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
     }
 }
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..7aeeb11c6ee5 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-8.7-all.zip
diff --git a/packages/go_router/example/lib/books/src/screens/books.dart b/packages/go_router/example/lib/books/src/screens/books.dart
index c3d8dc8083b3..57fb60f645e3 100644
--- a/packages/go_router/example/lib/books/src/screens/books.dart
+++ b/packages/go_router/example/lib/books/src/screens/books.dart
@@ -107,7 +107,6 @@ class _BooksScreenState extends State
       case 0:
       default:
         context.go('/books/popular');
-        break;
     }
   }
 }
diff --git a/packages/go_router/example/lib/others/custom_stateful_shell_route.dart b/packages/go_router/example/lib/others/custom_stateful_shell_route.dart
index 5af1504234ac..49c040cf2a63 100644
--- a/packages/go_router/example/lib/others/custom_stateful_shell_route.dart
+++ b/packages/go_router/example/lib/others/custom_stateful_shell_route.dart
@@ -3,6 +3,7 @@
 // found in the LICENSE file.
 
 import 'package:collection/collection.dart';
+import 'package:flutter/cupertino.dart';
 import 'package:flutter/material.dart';
 import 'package:go_router/go_router.dart';
 
@@ -10,6 +11,10 @@ final GlobalKey _rootNavigatorKey =
     GlobalKey(debugLabel: 'root');
 final GlobalKey _tabANavigatorKey =
     GlobalKey(debugLabel: 'tabANav');
+@visibleForTesting
+// ignore: public_member_api_docs
+final GlobalKey tabbedRootScreenKey =
+    GlobalKey(debugLabel: 'TabbedRootScreen');
 
 // This example demonstrates how to setup nested navigation using a
 // BottomNavigationBar, where each bar item uses its own persistent navigator,
@@ -52,6 +57,8 @@ class NestedTabNavigationExampleApp extends StatelessWidget {
           // are managed (using AnimatedBranchContainer).
           return ScaffoldWithNavBar(
               navigationShell: navigationShell, children: children);
+          // NOTE: To use a Cupertino version of ScaffoldWithNavBar, replace
+          // ScaffoldWithNavBar above with CupertinoScaffoldWithNavBar.
         },
         branches: [
           // The route branch for the first tab of the bottom navigation bar.
@@ -78,13 +85,13 @@ class NestedTabNavigationExampleApp extends StatelessWidget {
             ],
           ),
 
-          // The route branch for the third tab of the bottom navigation bar.
+          // The route branch for the second tab of the bottom navigation bar.
           StatefulShellBranch(
             // StatefulShellBranch will automatically use the first descendant
             // GoRoute as the initial location of the branch. If another route
             // is desired, specify the location of it using the defaultLocation
             // parameter.
-            // defaultLocation: '/c2',
+            // defaultLocation: '/b2',
             routes: [
               StatefulShellRoute(
                 builder: (BuildContext context, GoRouterState state,
@@ -102,7 +109,12 @@ class NestedTabNavigationExampleApp extends StatelessWidget {
                   // See TabbedRootScreen for more details on how the children
                   // are managed (in a TabBarView).
                   return TabbedRootScreen(
-                      navigationShell: navigationShell, children: children);
+                    navigationShell: navigationShell,
+                    key: tabbedRootScreenKey,
+                    children: children,
+                  );
+                  // NOTE: To use a PageView version of TabbedRootScreen,
+                  // replace TabbedRootScreen above with PagedRootScreen.
                 },
                 // This bottom tab uses a nested shell, wrapping sub routes in a
                 // top TabBar.
@@ -222,6 +234,70 @@ class ScaffoldWithNavBar extends StatelessWidget {
   }
 }
 
+/// Alternative version of [ScaffoldWithNavBar], using a [CupertinoTabScaffold].
+// ignore: unused_element, unreachable_from_main
+class CupertinoScaffoldWithNavBar extends StatefulWidget {
+  /// Constructs an [ScaffoldWithNavBar].
+  // ignore: unreachable_from_main
+  const CupertinoScaffoldWithNavBar({
+    required this.navigationShell,
+    required this.children,
+    Key? key,
+  }) : super(key: key ?? const ValueKey('ScaffoldWithNavBar'));
+
+  /// The navigation shell and container for the branch Navigators.
+  // ignore: unreachable_from_main
+  final StatefulNavigationShell navigationShell;
+
+  /// The children (branch Navigators) to display in a custom container
+  /// ([AnimatedBranchContainer]).
+  // ignore: unreachable_from_main
+  final List children;
+
+  @override
+  State createState() => _CupertinoScaffoldWithNavBarState();
+}
+
+class _CupertinoScaffoldWithNavBarState
+    extends State {
+  late final CupertinoTabController tabController =
+      CupertinoTabController(initialIndex: widget.navigationShell.currentIndex);
+
+  @override
+  void dispose() {
+    tabController.dispose();
+    super.dispose();
+  }
+
+  @override
+  Widget build(BuildContext context) {
+    return CupertinoTabScaffold(
+      controller: tabController,
+      tabBar: CupertinoTabBar(
+        items: const [
+          BottomNavigationBarItem(icon: Icon(Icons.home), label: 'Section A'),
+          BottomNavigationBarItem(icon: Icon(Icons.work), label: 'Section B'),
+        ],
+        currentIndex: widget.navigationShell.currentIndex,
+        onTap: (int index) => _onTap(context, index),
+      ),
+      // Note: It is common to use CupertinoTabView for the tabBuilder when
+      // using CupertinoTabScaffold and CupertinoTabBar. This would however be
+      // redundant when using StatefulShellRoute, since a separate Navigator is
+      // already created for each branch, meaning we can simply use the branch
+      // Navigator Widgets (i.e. widget.children) directly.
+      tabBuilder: (BuildContext context, int index) => widget.children[index],
+    );
+  }
+
+  void _onTap(BuildContext context, int index) {
+    widget.navigationShell.goBranch(
+      index,
+      initialLocation: index == widget.navigationShell.currentIndex,
+    );
+  }
+}
+
 /// Custom branch Navigator container that provides animated transitions
 /// when switching branches.
 class AnimatedBranchContainer extends StatelessWidget {
@@ -271,7 +347,7 @@ class RootScreenA extends StatelessWidget {
   Widget build(BuildContext context) {
     return Scaffold(
       appBar: AppBar(
-        title: const Text('Root of section A'),
+        title: const Text('Section A root'),
       ),
       body: Center(
         child: Column(
@@ -386,20 +462,43 @@ class TabbedRootScreen extends StatefulWidget {
   final List children;
 
   @override
-  State createState() => _TabbedRootScreenState();
+  State createState() => TabbedRootScreenState();
 }
 
-class _TabbedRootScreenState extends State
+@visibleForTesting
+// ignore: public_member_api_docs
+class TabbedRootScreenState extends State
     with SingleTickerProviderStateMixin {
-  late final TabController _tabController = TabController(
+  @visibleForTesting
+  // ignore: public_member_api_docs
+  late final TabController tabController = TabController(
       length: widget.children.length,
       vsync: this,
       initialIndex: widget.navigationShell.currentIndex);
 
+  void _switchedTab() {
+    if (tabController.index != widget.navigationShell.currentIndex) {
+      widget.navigationShell.goBranch(tabController.index);
+    }
+  }
+
+  @override
+  void initState() {
+    super.initState();
+    tabController.addListener(_switchedTab);
+  }
+
+  @override
+  void dispose() {
+    tabController.removeListener(_switchedTab);
+    tabController.dispose();
+    super.dispose();
+  }
+
   @override
   void didUpdateWidget(covariant TabbedRootScreen oldWidget) {
     super.didUpdateWidget(oldWidget);
-    _tabController.index = widget.navigationShell.currentIndex;
+    tabController.index = widget.navigationShell.currentIndex;
   }
 
   @override
@@ -410,14 +509,15 @@ class _TabbedRootScreenState extends State
 
     return Scaffold(
       appBar: AppBar(
-          title: const Text('Root of Section B (nested TabBar shell)'),
+          title: Text(
+              'Section B root (tab: ${widget.navigationShell.currentIndex + 1})'),
           bottom: TabBar(
-            controller: _tabController,
+            controller: tabController,
             tabs: tabs,
             onTap: (int tappedIndex) => _onTabTap(context, tappedIndex),
           )),
       body: TabBarView(
-        controller: _tabController,
+        controller: tabController,
         children: widget.children,
       ),
     );
@@ -428,6 +528,84 @@ class _TabbedRootScreenState extends State
   }
 }
 
+/// Alternative implementation of TabbedRootScreen, demonstrating the use of
+/// a [PageView].
+// ignore: unreachable_from_main
+class PagedRootScreen extends StatefulWidget {
+  /// Constructs a PagedRootScreen
+  // ignore: unreachable_from_main
+  const PagedRootScreen(
+      {required this.navigationShell, required this.children, super.key});
+
+  /// The current state of the parent StatefulShellRoute.
+  // ignore: unreachable_from_main
+  final StatefulNavigationShell navigationShell;
+
+  /// The children (branch Navigators) to display in the [TabBarView].
+  // ignore: unreachable_from_main
+  final List children;
+
+  @override
+  State createState() => _PagedRootScreenState();
+}
+
+/// Alternative implementation _TabbedRootScreenState, demonstrating the use of
+/// a PageView.
+class _PagedRootScreenState extends State {
+  late final PageController _pageController = PageController(
+    initialPage: widget.navigationShell.currentIndex,
+  );
+
+  @override
+  void dispose() {
+    _pageController.dispose();
+    super.dispose();
+  }
+
+  @override
+  Widget build(BuildContext context) {
+    return Scaffold(
+      appBar: AppBar(
+        title: Text(
+            'Section B root (tab ${widget.navigationShell.currentIndex + 1})'),
+      ),
+      body: Column(
+        children: [
+          Row(
+              mainAxisAlignment: MainAxisAlignment.spaceEvenly,
+              children: [
+                ElevatedButton(
+                  onPressed: () => _animateToPage(0),
+                  child: const Text('Tab 1'),
+                ),
+                ElevatedButton(
+                  onPressed: () => _animateToPage(1),
+                  child: const Text('Tab 2'),
+                ),
+              ]),
+          Expanded(
+            child: PageView(
+              onPageChanged: (int i) => widget.navigationShell.goBranch(i),
+              controller: _pageController,
+              children: widget.children,
+            ),
+          ),
+        ],
+      ),
+    );
+  }
+
+  void _animateToPage(int index) {
+    if (_pageController.hasClients) {
+      _pageController.animateToPage(
+        index,
+        duration: const Duration(milliseconds: 500),
+        curve: Curves.bounceOut,
+      );
+    }
+  }
+}
+
 /// Widget for the pages in the top tab bar.
 class TabScreen extends StatelessWidget {
   /// Creates a RootScreen
diff --git a/packages/go_router/example/lib/others/router_neglect.dart b/packages/go_router/example/lib/others/router_neglect.dart
index 75686a1df594..6660f0ee2708 100644
--- a/packages/go_router/example/lib/others/router_neglect.dart
+++ b/packages/go_router/example/lib/others/router_neglect.dart
@@ -22,8 +22,9 @@ class App extends StatelessWidget {
       );
 
   final GoRouter _router = GoRouter(
-    // turn off history tracking in the browser for this navigation
-    routerNeglect: true,
+    // To turn off history tracking in the browser for the entire application,
+    // set routerNeglect to true:
+    // routerNeglect: true,
     routes: [
       GoRoute(
         path: '/',
diff --git a/packages/go_router/example/test/custom_stateful_shell_route_test.dart b/packages/go_router/example/test/custom_stateful_shell_route_test.dart
new file mode 100644
index 000000000000..4a001a9dc562
--- /dev/null
+++ b/packages/go_router/example/test/custom_stateful_shell_route_test.dart
@@ -0,0 +1,32 @@
+// 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:go_router_examples/others/custom_stateful_shell_route.dart';
+
+void main() {
+  testWidgets(
+      'Changing active tab in TabController of TabbedRootScreen (root screen '
+      'of branch/section B) correctly navigates to appropriate screen',
+      (WidgetTester tester) async {
+    await tester.pumpWidget(NestedTabNavigationExampleApp());
+    expect(find.text('Screen A'), findsOneWidget);
+
+    // navigate to ScreenB
+    await tester.tap(find.text('Section B'));
+    await tester.pumpAndSettle();
+    expect(find.text('Screen B1'), findsOneWidget);
+
+    // Get TabController from TabbedRootScreen (root screen of branch/section B)
+    final TabController? tabController =
+        tabbedRootScreenKey.currentState?.tabController;
+    expect(tabController, isNotNull);
+
+    // Simulate swiping TabView to change active tab in TabController
+    tabbedRootScreenKey.currentState?.tabController.index = 1;
+    await tester.pumpAndSettle();
+    expect(find.text('Screen B2'), findsOneWidget);
+  });
+}
diff --git a/packages/go_router/lib/src/builder.dart b/packages/go_router/lib/src/builder.dart
index 49b6372c6933..01c9b8c21977 100644
--- a/packages/go_router/lib/src/builder.dart
+++ b/packages/go_router/lib/src/builder.dart
@@ -98,7 +98,8 @@ class RouteBuilder {
   Widget build(
     BuildContext context,
     RouteMatchList matchList,
-    bool routerNeglect,
+    bool routerNeglect, // TODO(tolo): This parameter is not used and should be
+    // removed in the next major version.
   ) {
     if (matchList.isEmpty && !matchList.isError) {
       // The build method can be called before async redirect finishes. Build a
diff --git a/packages/go_router/lib/src/configuration.dart b/packages/go_router/lib/src/configuration.dart
index d1cca5ce61f4..cc671066218d 100644
--- a/packages/go_router/lib/src/configuration.dart
+++ b/packages/go_router/lib/src/configuration.dart
@@ -36,12 +36,9 @@ class RouteConfiguration {
     for (final RouteBase route in routes) {
       late bool subRouteIsTopLevel;
       if (route is GoRoute) {
-        if (isTopLevel) {
-          assert(route.path.startsWith('/'),
-              'top-level path must start with "/": $route');
-        } else {
-          assert(!route.path.startsWith('/') && !route.path.endsWith('/'),
-              'sub-route path may not start or end with "/": $route');
+        if (route.path != '/') {
+          assert(!route.path.endsWith('/'),
+              'route path may not end with "/" except for the top "/" route. Found: $route');
         }
         subRouteIsTopLevel = false;
       } else if (route is ShellRouteBase) {
@@ -150,7 +147,8 @@ class RouteConfiguration {
                 'The default location of a StatefulShellBranch cannot be '
                 'a parameterized route');
           } else {
-            final RouteMatchList matchList = findMatch(branch.initialLocation!);
+            final RouteMatchList matchList =
+                findMatch(Uri.parse(branch.initialLocation!));
             assert(
                 !matchList.isError,
                 'initialLocation (${matchList.uri}) of StatefulShellBranch must '
@@ -292,9 +290,7 @@ class RouteConfiguration {
   }
 
   /// Finds the routes that matched the given URL.
-  RouteMatchList findMatch(String location, {Object? extra}) {
-    final Uri uri = Uri.parse(canonicalUri(location));
-
+  RouteMatchList findMatch(Uri uri, {Object? extra}) {
     final Map pathParameters = {};
     final List matches =
         _getLocRouteMatches(uri, pathParameters);
@@ -315,14 +311,13 @@ class RouteConfiguration {
 
   /// Reparse the input RouteMatchList
   RouteMatchList reparse(RouteMatchList matchList) {
-    RouteMatchList result =
-        findMatch(matchList.uri.toString(), extra: matchList.extra);
+    RouteMatchList result = findMatch(matchList.uri, extra: matchList.extra);
 
     for (final ImperativeRouteMatch imperativeMatch
         in matchList.matches.whereType()) {
       final ImperativeRouteMatch match = ImperativeRouteMatch(
           pageKey: imperativeMatch.pageKey,
-          matches: findMatch(imperativeMatch.matches.uri.toString(),
+          matches: findMatch(imperativeMatch.matches.uri,
               extra: imperativeMatch.matches.extra),
           completer: imperativeMatch.completer);
       result = result.push(match);
@@ -461,7 +456,7 @@ class RouteConfiguration {
     List redirectHistory,
   ) {
     try {
-      final RouteMatchList newMatch = findMatch(newLocation);
+      final RouteMatchList newMatch = findMatch(Uri.parse(newLocation));
       _addRedirect(redirectHistory, newMatch, previousLocation);
       return newMatch;
     } on GoException catch (e) {
diff --git a/packages/go_router/lib/src/delegate.dart b/packages/go_router/lib/src/delegate.dart
index eba3ef0c8011..b28f70149119 100644
--- a/packages/go_router/lib/src/delegate.dart
+++ b/packages/go_router/lib/src/delegate.dart
@@ -46,27 +46,15 @@ class GoRouterDelegate extends RouterDelegate
   late final RouteBuilder builder;
 
   /// Set to true to disable creating history entries on the web.
+  // TODO(tolo): This field is obsolete and should be removed in the next major
+  // version.
   final bool routerNeglect;
 
   final RouteConfiguration _configuration;
 
   @override
   Future popRoute() async {
-    NavigatorState? state = navigatorKey.currentState;
-    if (state == null) {
-      return false;
-    }
-    if (!state.canPop()) {
-      state = null;
-    }
-    RouteMatchBase walker = currentConfiguration.matches.last;
-    while (walker is ShellRouteMatch) {
-      if (walker.navigatorKey.currentState?.canPop() ?? false) {
-        state = walker.navigatorKey.currentState;
-      }
-      walker = walker.matches.last;
-    }
-    assert(walker is RouteMatch);
+    final NavigatorState? state = _findCurrentNavigator();
     if (state != null) {
       return state.maybePop();
     }
@@ -75,7 +63,8 @@ class GoRouterDelegate extends RouterDelegate
     if (lastRoute.onExit != null && navigatorKey.currentContext != null) {
       return !(await lastRoute.onExit!(
         navigatorKey.currentContext!,
-        walker.buildState(_configuration, currentConfiguration),
+        currentConfiguration.last
+            .buildState(_configuration, currentConfiguration),
       ));
     }
     return false;
@@ -98,21 +87,33 @@ class GoRouterDelegate extends RouterDelegate
 
   /// Pops the top-most route.
   void pop([T? result]) {
+    final NavigatorState? state = _findCurrentNavigator();
+    if (state == null) {
+      throw GoError('There is nothing to pop');
+    }
+    state.pop(result);
+  }
+
+  NavigatorState? _findCurrentNavigator() {
     NavigatorState? state;
     if (navigatorKey.currentState?.canPop() ?? false) {
       state = navigatorKey.currentState;
     }
     RouteMatchBase walker = currentConfiguration.matches.last;
     while (walker is ShellRouteMatch) {
-      if (walker.navigatorKey.currentState?.canPop() ?? false) {
+      final NavigatorState potentialCandidate =
+          walker.navigatorKey.currentState!;
+      if (!ModalRoute.of(potentialCandidate.context)!.isCurrent) {
+        // There is a pageless route on top of the shell route. it needs to be
+        // popped first.
+        break;
+      }
+      if (potentialCandidate.canPop()) {
         state = walker.navigatorKey.currentState;
       }
       walker = walker.matches.last;
     }
-    if (state == null) {
-      throw GoError('There is nothing to pop');
-    }
-    state.pop(result);
+    return state;
   }
 
   void _debugAssertMatchListNotEmpty() {
diff --git a/packages/go_router/lib/src/information_provider.dart b/packages/go_router/lib/src/information_provider.dart
index dc979193b325..75d9dec01137 100644
--- a/packages/go_router/lib/src/information_provider.dart
+++ b/packages/go_router/lib/src/information_provider.dart
@@ -79,18 +79,22 @@ class GoRouteInformationProvider extends RouteInformationProvider
     required String initialLocation,
     required Object? initialExtra,
     Listenable? refreshListenable,
+    bool routerNeglect = false,
   })  : _refreshListenable = refreshListenable,
         _value = RouteInformation(
           uri: Uri.parse(initialLocation),
           state: RouteInformationState(
               extra: initialExtra, type: NavigatingType.go),
         ),
-        _valueInEngine = _kEmptyRouteInformation {
+        _valueInEngine = _kEmptyRouteInformation,
+        _routerNeglect = routerNeglect {
     _refreshListenable?.addListener(notifyListeners);
   }
 
   final Listenable? _refreshListenable;
 
+  final bool _routerNeglect;
+
   static WidgetsBinding get _binding => WidgetsBinding.instance;
   static final RouteInformation _kEmptyRouteInformation =
       RouteInformation(uri: Uri.parse(''));
@@ -120,7 +124,7 @@ class GoRouteInformationProvider extends RouteInformationProvider
     SystemNavigator.routeInformationUpdated(
       uri: routeInformation.uri,
       state: routeInformation.state,
-      replace: replace,
+      replace: _routerNeglect || replace,
     );
     _value = _valueInEngine = routeInformation;
   }
diff --git a/packages/go_router/lib/src/match.dart b/packages/go_router/lib/src/match.dart
index fba08f838656..696f9d4c50d9 100644
--- a/packages/go_router/lib/src/match.dart
+++ b/packages/go_router/lib/src/match.dart
@@ -203,6 +203,7 @@ abstract class RouteMatchBase with Diagnosticable {
 
     final RegExpMatch? regExpMatch =
         route.matchPatternAsPrefix(remainingLocation);
+
     if (regExpMatch == null) {
       return _empty;
     }
@@ -555,13 +556,9 @@ class RouteMatchList with Diagnosticable {
   /// [RouteMatchA(), RouteMatchB(), RouteMatchC()]
   /// ```
   static String _generateFullPath(Iterable matches) {
-    final StringBuffer buffer = StringBuffer();
-    bool addsSlash = false;
+    String fullPath = '';
     for (final RouteMatchBase match in matches
         .where((RouteMatchBase match) => match is! ImperativeRouteMatch)) {
-      if (addsSlash) {
-        buffer.write('/');
-      }
       final String pathSegment;
       if (match is RouteMatch) {
         pathSegment = match.route.path;
@@ -571,10 +568,9 @@ class RouteMatchList with Diagnosticable {
         assert(false, 'Unexpected match type: $match');
         continue;
       }
-      buffer.write(pathSegment);
-      addsSlash = pathSegment.isNotEmpty && (addsSlash || pathSegment != '/');
+      fullPath = concatenatePaths(fullPath, pathSegment);
     }
-    return buffer.toString();
+    return fullPath;
   }
 
   /// Returns true if there are no matches.
@@ -944,7 +940,7 @@ class _RouteMatchListDecoder
           ?.decode(encodedExtra[RouteMatchListCodec._encodedKey]);
     }
     RouteMatchList matchList =
-        configuration.findMatch(rootLocation, extra: extra);
+        configuration.findMatch(Uri.parse(rootLocation), extra: extra);
 
     final List? imperativeMatches =
         input[RouteMatchListCodec._imperativeMatchesKey] as List?;
diff --git a/packages/go_router/lib/src/parser.dart b/packages/go_router/lib/src/parser.dart
index b4115a1fca19..d1981898a8bb 100644
--- a/packages/go_router/lib/src/parser.dart
+++ b/packages/go_router/lib/src/parser.dart
@@ -80,25 +80,17 @@ class GoRouteInformationParser extends RouteInformationParser {
       });
     }
 
-    late final RouteMatchList initialMatches;
-    if (routeInformation.uri.hasEmptyPath) {
-      String newUri = '${routeInformation.uri.origin}/';
-      if (routeInformation.uri.hasQuery) {
-        newUri += '?${routeInformation.uri.query}';
-      }
-      if (routeInformation.uri.hasFragment) {
-        newUri += '#${routeInformation.uri.fragment}';
-      }
-      initialMatches = configuration.findMatch(
-        newUri,
-        extra: state.extra,
-      );
-    } else {
-      initialMatches = configuration.findMatch(
-        routeInformation.uri.toString(),
-        extra: state.extra,
-      );
+    Uri uri = routeInformation.uri;
+    if (uri.hasEmptyPath) {
+      uri = uri.replace(path: '/');
+    } else if (uri.path.length > 1 && uri.path.endsWith('/')) {
+      // Remove trailing `/`.
+      uri = uri.replace(path: uri.path.substring(0, uri.path.length - 1));
     }
+    final RouteMatchList initialMatches = configuration.findMatch(
+      uri,
+      extra: state.extra,
+    );
     if (initialMatches.isError) {
       log('No initial matches: ${routeInformation.uri.path}');
     }
@@ -160,7 +152,6 @@ class GoRouteInformationParser extends RouteInformationParser {
         location = safeRoute.matches.uri.toString();
       }
     }
-
     return RouteInformation(
       uri: Uri.parse(location ?? configuration.uri.toString()),
       state: _routeMatchListCodec.encode(configuration),
@@ -194,22 +185,30 @@ class GoRouteInformationParser extends RouteInformationParser {
         );
       case NavigatingType.pushReplacement:
         final RouteMatch routeMatch = baseRouteMatchList!.last;
-        return baseRouteMatchList.remove(routeMatch).push(
-              ImperativeRouteMatch(
-                pageKey: _getUniqueValueKey(),
-                completer: completer!,
-                matches: newMatchList,
-              ),
-            );
+        baseRouteMatchList = baseRouteMatchList.remove(routeMatch);
+        if (baseRouteMatchList.isEmpty) {
+          return newMatchList;
+        }
+        return baseRouteMatchList.push(
+          ImperativeRouteMatch(
+            pageKey: _getUniqueValueKey(),
+            completer: completer!,
+            matches: newMatchList,
+          ),
+        );
       case NavigatingType.replace:
         final RouteMatch routeMatch = baseRouteMatchList!.last;
-        return baseRouteMatchList.remove(routeMatch).push(
-              ImperativeRouteMatch(
-                pageKey: routeMatch.pageKey,
-                completer: completer!,
-                matches: newMatchList,
-              ),
-            );
+        baseRouteMatchList = baseRouteMatchList.remove(routeMatch);
+        if (baseRouteMatchList.isEmpty) {
+          return newMatchList;
+        }
+        return baseRouteMatchList.push(
+          ImperativeRouteMatch(
+            pageKey: routeMatch.pageKey,
+            completer: completer!,
+            matches: newMatchList,
+          ),
+        );
       case NavigatingType.go:
         return newMatchList;
       case NavigatingType.restore:
diff --git a/packages/go_router/lib/src/path_utils.dart b/packages/go_router/lib/src/path_utils.dart
index 49a7b33b3ebc..4684c75badc4 100644
--- a/packages/go_router/lib/src/path_utils.dart
+++ b/packages/go_router/lib/src/path_utils.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.
 
-import 'misc/errors.dart';
 import 'route.dart';
 
 final RegExp _parameterRegExp = RegExp(r':(\w+)(\((?:\\.|[^\\()])+\))?');
@@ -103,55 +102,14 @@ Map extractPathParameters(
 
 /// Concatenates two paths.
 ///
-/// e.g: pathA = /a, pathB = c/d,  concatenatePaths(pathA, pathB) = /a/c/d.
+/// e.g: pathA = /a, pathB = /c/d, concatenatePaths(pathA, pathB) = /a/c/d.
+/// or: pathA = a, pathB = c/d, concatenatePaths(pathA, pathB) = /a/c/d.
 String concatenatePaths(String parentPath, String childPath) {
-  // at the root, just return the path
-  if (parentPath.isEmpty) {
-    assert(childPath.startsWith('/'));
-    assert(childPath == '/' || !childPath.endsWith('/'));
-    return childPath;
-  }
-
-  // not at the root, so append the parent path
-  assert(childPath.isNotEmpty);
-  assert(!childPath.startsWith('/'));
-  assert(!childPath.endsWith('/'));
-  return '${parentPath == '/' ? '' : parentPath}/$childPath';
-}
-
-/// Normalizes the location string.
-String canonicalUri(String loc) {
-  if (loc.isEmpty) {
-    throw GoException('Location cannot be empty.');
-  }
-  String canon = Uri.parse(loc).toString();
-  canon = canon.endsWith('?') ? canon.substring(0, canon.length - 1) : canon;
-  final Uri uri = Uri.parse(canon);
-
-  // remove trailing slash except for when you shouldn't, e.g.
-  // /profile/ => /profile
-  // / => /
-  // /login?from=/ => /login?from=/
-  canon = uri.path.endsWith('/') &&
-          uri.path != '/' &&
-          !uri.hasQuery &&
-          !uri.hasFragment
-      ? canon.substring(0, canon.length - 1)
-      : canon;
-
-  // replace '/?', except for first occurrence, from path only
-  // /login/?from=/ => /login?from=/
-  // /?from=/ => /?from=/
-  final int pathStartIndex = uri.host.isNotEmpty
-      ? uri.toString().indexOf(uri.host) + uri.host.length
-      : uri.hasScheme
-          ? uri.toString().indexOf(uri.scheme) + uri.scheme.length
-          : 0;
-  if (pathStartIndex < canon.length) {
-    canon = canon.replaceFirst('/?', '?', pathStartIndex + 1);
-  }
-
-  return canon;
+  final Iterable segments = [
+    ...parentPath.split('/'),
+    ...childPath.split('/')
+  ].where((String segment) => segment.isNotEmpty);
+  return '/${segments.join('/')}';
 }
 
 /// Builds an absolute path for the provided route.
diff --git a/packages/go_router/lib/src/route.dart b/packages/go_router/lib/src/route.dart
index 15e1ca4fb3fb..a5dcc734d054 100644
--- a/packages/go_router/lib/src/route.dart
+++ b/packages/go_router/lib/src/route.dart
@@ -435,8 +435,10 @@ class GoRoute extends RouteBase {
 
   // TODO(chunhtai): move all regex related help methods to path_utils.dart.
   /// Match this route against a location.
-  RegExpMatch? matchPatternAsPrefix(String loc) =>
-      _pathRE.matchAsPrefix(loc) as RegExpMatch?;
+  RegExpMatch? matchPatternAsPrefix(String loc) {
+    return _pathRE.matchAsPrefix('/$loc') as RegExpMatch? ??
+        _pathRE.matchAsPrefix(loc) as RegExpMatch?;
+  }
 
   /// Extract the path parameters from a match.
   Map extractPathParams(RegExpMatch match) =>
diff --git a/packages/go_router/lib/src/router.dart b/packages/go_router/lib/src/router.dart
index dc6d88057eb0..f8afff38cb14 100644
--- a/packages/go_router/lib/src/router.dart
+++ b/packages/go_router/lib/src/router.dart
@@ -199,7 +199,7 @@ class GoRouter implements RouterConfig {
     setLogging(enabled: debugLogDiagnostics);
     WidgetsFlutterBinding.ensureInitialized();
 
-    navigatorKey ??= GlobalKey();
+    navigatorKey ??= GlobalKey(debugLabel: 'root');
 
     _routingConfig.addListener(_handleRoutingConfigChanged);
     configuration = RouteConfiguration(
@@ -230,6 +230,7 @@ class GoRouter implements RouterConfig {
       initialLocation: _effectiveInitialLocation(initialLocation),
       initialExtra: initialExtra,
       refreshListenable: refreshListenable,
+      routerNeglect: routerNeglect,
     );
 
     routerDelegate = GoRouterDelegate(
diff --git a/packages/go_router/pubspec.yaml b/packages/go_router/pubspec.yaml
index 3209ed782ec7..4e086f245594 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: 14.2.3
+version: 14.3.0
 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/test/extension_test.dart b/packages/go_router/test/extension_test.dart
index 0f314edbf66e..c13a47de002f 100644
--- a/packages/go_router/test/extension_test.dart
+++ b/packages/go_router/test/extension_test.dart
@@ -38,9 +38,7 @@ void main() {
       final GoRouter router = await createGoRouter(tester);
       await tester.tap(find.text('Settings'));
       await tester.pumpAndSettle();
-      final ImperativeRouteMatch routeMatch = router
-          .routerDelegate.currentConfiguration.last as ImperativeRouteMatch;
-      expect(routeMatch.matches.uri.toString(),
+      expect(router.routerDelegate.currentConfiguration.uri.toString(),
           '/page-0/settings?search=notification');
     });
   });
diff --git a/packages/go_router/test/go_router_test.dart b/packages/go_router/test/go_router_test.dart
index f395faf906fd..e2c2d1b5cfc1 100644
--- a/packages/go_router/test/go_router_test.dart
+++ b/packages/go_router/test/go_router_test.dart
@@ -68,28 +68,31 @@ void main() {
       expect(find.byType(DummyScreen), findsOneWidget);
     });
 
-    test('empty path', () {
-      expect(() {
-        GoRoute(path: '');
-      }, throwsA(isAssertionError));
+    testWidgets('pushReplacement and replace when only one matches',
+        (WidgetTester tester) async {
+      final List routes = [
+        GoRoute(name: '1', path: '/', builder: dummy),
+        GoRoute(name: '2', path: '/a', builder: dummy),
+        GoRoute(name: '3', path: '/b', builder: dummy),
+      ];
+
+      final GoRouter router = await createRouter(routes, tester);
+      expect(router.routerDelegate.currentConfiguration.uri.path, '/');
+
+      router.replace('/a');
+      await tester.pumpAndSettle();
+      // When the imperative match is the only match in the route match list,
+      // it should update the uri.
+      expect(router.routerDelegate.currentConfiguration.uri.path, '/a');
+
+      router.pushReplacement('/b');
+      await tester.pumpAndSettle();
+      expect(router.routerDelegate.currentConfiguration.uri.path, '/b');
     });
 
-    test('leading / on sub-route', () {
+    test('empty path', () {
       expect(() {
-        GoRouter(
-          routes: [
-            GoRoute(
-              path: '/',
-              builder: dummy,
-              routes: [
-                GoRoute(
-                  path: '/foo',
-                  builder: dummy,
-                ),
-              ],
-            ),
-          ],
-        );
+        GoRoute(path: '');
       }, throwsA(isAssertionError));
     });
 
@@ -112,16 +115,6 @@ void main() {
       }, throwsA(isAssertionError));
     });
 
-    testWidgets('lack of leading / on top-level route',
-        (WidgetTester tester) async {
-      await expectLater(() async {
-        final List routes = [
-          GoRoute(path: 'foo', builder: dummy),
-        ];
-        await createRouter(routes, tester);
-      }, throwsA(isAssertionError));
-    });
-
     testWidgets('match no routes', (WidgetTester tester) async {
       final List routes = [
         GoRoute(path: '/', builder: dummy),
@@ -398,6 +391,67 @@ void main() {
       expect(find.byKey(settings), findsOneWidget);
     });
 
+    testWidgets('android back button pop in correct order',
+        (WidgetTester tester) async {
+      // Regression test for https://github.com/flutter/flutter/issues/141906.
+      final List routes = [
+        GoRoute(
+            path: '/',
+            builder: (_, __) => const Text('home'),
+            routes: [
+              ShellRoute(
+                builder: (
+                  BuildContext context,
+                  GoRouterState state,
+                  Widget child,
+                ) {
+                  return Column(
+                    children: [
+                      const Text('shell'),
+                      child,
+                    ],
+                  );
+                },
+                routes: [
+                  GoRoute(
+                    path: 'page',
+                    builder: (BuildContext context, __) {
+                      return TextButton(
+                        onPressed: () {
+                          Navigator.of(context, rootNavigator: true).push(
+                            MaterialPageRoute(
+                                builder: (BuildContext context) {
+                              return const Text('pageless');
+                            }),
+                          );
+                        },
+                        child: const Text('page'),
+                      );
+                    },
+                  ),
+                ],
+              ),
+            ]),
+      ];
+      final GoRouter router =
+          await createRouter(routes, tester, initialLocation: '/page');
+      expect(find.text('shell'), findsOneWidget);
+      expect(find.text('page'), findsOneWidget);
+
+      await tester.tap(find.text('page'));
+      await tester.pumpAndSettle();
+      expect(find.text('shell'), findsNothing);
+      expect(find.text('page'), findsNothing);
+      expect(find.text('pageless'), findsOneWidget);
+
+      final bool result = await router.routerDelegate.popRoute();
+      expect(result, isTrue);
+      await tester.pumpAndSettle();
+      expect(find.text('shell'), findsOneWidget);
+      expect(find.text('page'), findsOneWidget);
+      expect(find.text('pageless'), findsNothing);
+    });
+
     testWidgets('can correctly pop stacks of repeated pages',
         (WidgetTester tester) async {
       // Regression test for https://github.com/flutter/flutter/issues/#132229.
@@ -5419,6 +5473,94 @@ void main() {
       ),
     );
   });
+
+  testWidgets('should allow route paths without leading /',
+      (WidgetTester tester) async {
+    final List routes = [
+      GoRoute(
+        path: '/', // root cannot be empty (existing assert)
+        builder: (BuildContext context, GoRouterState state) =>
+            const HomeScreen(),
+        routes: [
+          GoRoute(
+            path: 'child-route',
+            builder: (BuildContext context, GoRouterState state) =>
+                const Text('/child-route'),
+            routes: [
+              GoRoute(
+                path: 'grand-child-route',
+                builder: (BuildContext context, GoRouterState state) =>
+                    const Text('/grand-child-route'),
+              ),
+              GoRoute(
+                path: 'redirected-grand-child-route',
+                redirect: (BuildContext context, GoRouterState state) =>
+                    '/child-route',
+              ),
+            ],
+          )
+        ],
+      ),
+    ];
+
+    final GoRouter router = await createRouter(routes, tester,
+        initialLocation: '/child-route/grand-child-route');
+    RouteMatchList matches = router.routerDelegate.currentConfiguration;
+    expect(matches.matches, hasLength(3));
+    expect(matches.uri.toString(), '/child-route/grand-child-route');
+    expect(find.text('/grand-child-route'), findsOneWidget);
+
+    router.go('/child-route/redirected-grand-child-route');
+    await tester.pumpAndSettle();
+    matches = router.routerDelegate.currentConfiguration;
+    expect(matches.matches, hasLength(2));
+    expect(matches.uri.toString(), '/child-route');
+    expect(find.text('/child-route'), findsOneWidget);
+  });
+
+  testWidgets('should allow route paths with leading /',
+      (WidgetTester tester) async {
+    final List routes = [
+      GoRoute(
+        path: '/',
+        builder: (BuildContext context, GoRouterState state) =>
+            const HomeScreen(),
+        routes: [
+          GoRoute(
+            path: '/child-route',
+            builder: (BuildContext context, GoRouterState state) =>
+                const Text('/child-route'),
+            routes: [
+              GoRoute(
+                path: '/grand-child-route',
+                builder: (BuildContext context, GoRouterState state) =>
+                    const Text('/grand-child-route'),
+              ),
+              GoRoute(
+                path: '/redirected-grand-child-route',
+                redirect: (BuildContext context, GoRouterState state) =>
+                    '/child-route',
+              ),
+            ],
+          )
+        ],
+      ),
+    ];
+
+    final GoRouter router = await createRouter(routes, tester,
+        initialLocation: '/child-route/grand-child-route');
+    RouteMatchList matches = router.routerDelegate.currentConfiguration;
+    expect(matches.matches, hasLength(3));
+    expect(matches.uri.toString(), '/child-route/grand-child-route');
+    expect(find.text('/grand-child-route'), findsOneWidget);
+
+    router.go('/child-route/redirected-grand-child-route');
+    await tester.pumpAndSettle();
+    matches = router.routerDelegate.currentConfiguration;
+    expect(matches.matches, hasLength(2));
+    expect(matches.uri.toString(), '/child-route');
+    expect(find.text('/child-route'), findsOneWidget);
+  });
 }
 
 class TestInheritedNotifier extends InheritedNotifier> {
diff --git a/packages/go_router/test/information_provider_test.dart b/packages/go_router/test/information_provider_test.dart
index 52629587bac0..591360366663 100644
--- a/packages/go_router/test/information_provider_test.dart
+++ b/packages/go_router/test/information_provider_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 'package:flutter/services.dart';
 import 'package:flutter/widgets.dart';
 import 'package:flutter_test/flutter_test.dart';
 import 'package:go_router/go_router.dart';
@@ -67,5 +68,59 @@ void main() {
       expect(provider.value.uri.path, '/some/path');
       expect(provider.value.uri.toString(), expectedUriString);
     });
+
+    testWidgets('Route is correctly neglected when routerNeglect is true',
+        (WidgetTester tester) async {
+      final _SystemChannelsNavigationMock systemChannelsMock =
+          _SystemChannelsNavigationMock();
+      late final GoRouteInformationProvider provider =
+          GoRouteInformationProvider(
+              initialLocation: initialRoute,
+              initialExtra: null,
+              routerNeglect: true);
+      provider.addListener(expectAsync0(() {}));
+      provider.go(newRoute);
+      provider.routerReportsNewRouteInformation(
+          RouteInformation(
+              uri: Uri.parse(newRoute), state: {}),
+          type: RouteInformationReportingType.navigate);
+      expect(systemChannelsMock.uriIsNeglected[newRoute], true);
+    });
+
+    testWidgets('Route is NOT neglected when routerNeglect is false',
+        (WidgetTester tester) async {
+      final _SystemChannelsNavigationMock systemChannelsMock =
+          _SystemChannelsNavigationMock();
+      late final GoRouteInformationProvider provider =
+          GoRouteInformationProvider(
+              initialLocation: initialRoute, initialExtra: null);
+      provider.addListener(expectAsync0(() {}));
+      provider.go(newRoute);
+      provider.routerReportsNewRouteInformation(
+          RouteInformation(
+              uri: Uri.parse(newRoute), state: {}),
+          type: RouteInformationReportingType.navigate);
+      expect(systemChannelsMock.uriIsNeglected[newRoute], false);
+    });
   });
 }
+
+class _SystemChannelsNavigationMock {
+  _SystemChannelsNavigationMock() {
+    TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger
+        .setMockMethodCallHandler(SystemChannels.navigation,
+            (MethodCall methodCall) async {
+      if (methodCall.method == 'routeInformationUpdated' &&
+          methodCall.arguments is Map) {
+        final Map args =
+            methodCall.arguments as Map;
+        final String? uri =
+            args['location'] as String? ?? args['uri'] as String?;
+        uriIsNeglected[uri ?? ''] = args['replace'] as bool;
+      }
+      return null;
+    });
+  }
+
+  Map uriIsNeglected = {};
+}
diff --git a/packages/go_router/test/matching_test.dart b/packages/go_router/test/matching_test.dart
index 89cbccb8a5ee..f2dffbd3de1c 100644
--- a/packages/go_router/test/matching_test.dart
+++ b/packages/go_router/test/matching_test.dart
@@ -92,8 +92,8 @@ void main() {
     );
     final RouteMatchListCodec codec = RouteMatchListCodec(configuration);
 
-    final RouteMatchList list1 = configuration.findMatch('/a');
-    final RouteMatchList list2 = configuration.findMatch('/b');
+    final RouteMatchList list1 = configuration.findMatch(Uri.parse('/a'));
+    final RouteMatchList list2 = configuration.findMatch(Uri.parse('/b'));
     list1.push(ImperativeRouteMatch(
         pageKey: const ValueKey('/b-p0'),
         matches: list2,
diff --git a/packages/go_router/test/parser_test.dart b/packages/go_router/test/parser_test.dart
index 31b8a50e5699..9cb4aa2a071f 100644
--- a/packages/go_router/test/parser_test.dart
+++ b/packages/go_router/test/parser_test.dart
@@ -81,6 +81,68 @@ void main() {
     expect(matches[1].route, routes[0].routes[0]);
   });
 
+  testWidgets('GoRouteInformationParser can handle empty path for non http uri',
+      (WidgetTester tester) async {
+    final List routes = [
+      GoRoute(
+        path: '/',
+        builder: (_, __) => const Placeholder(),
+        routes: [
+          GoRoute(
+            path: 'abc',
+            builder: (_, __) => const Placeholder(),
+          ),
+        ],
+      ),
+    ];
+    final GoRouteInformationParser parser = await createParser(
+      tester,
+      routes: routes,
+      redirectLimit: 100,
+      redirect: (_, __) => null,
+    );
+
+    final BuildContext context = tester.element(find.byType(Router));
+
+    final RouteMatchList matchesObj =
+        await parser.parseRouteInformationWithDependencies(
+            createRouteInformation('elbaapp://domain'), context);
+    final List matches = matchesObj.matches;
+    expect(matches.length, 1);
+    expect(matchesObj.uri.toString(), 'elbaapp://domain/');
+  });
+
+  testWidgets('GoRouteInformationParser cleans up uri',
+      (WidgetTester tester) async {
+    final List routes = [
+      GoRoute(
+        path: '/',
+        builder: (_, __) => const Placeholder(),
+        routes: [
+          GoRoute(
+            path: 'abc',
+            builder: (_, __) => const Placeholder(),
+          ),
+        ],
+      ),
+    ];
+    final GoRouteInformationParser parser = await createParser(
+      tester,
+      routes: routes,
+      redirectLimit: 100,
+      redirect: (_, __) => null,
+    );
+
+    final BuildContext context = tester.element(find.byType(Router));
+
+    final RouteMatchList matchesObj =
+        await parser.parseRouteInformationWithDependencies(
+            createRouteInformation('http://domain/abc/?query=bde'), context);
+    final List matches = matchesObj.matches;
+    expect(matches.length, 2);
+    expect(matchesObj.uri.toString(), 'http://domain/abc?query=bde');
+  });
+
   testWidgets(
       "GoRouteInformationParser can parse deeplink root route and maintain uri's scheme, host, query and fragment",
       (WidgetTester tester) async {
diff --git a/packages/go_router/test/path_utils_test.dart b/packages/go_router/test/path_utils_test.dart
index 5a656df135eb..5b0b1234329b 100644
--- a/packages/go_router/test/path_utils_test.dart
+++ b/packages/go_router/test/path_utils_test.dart
@@ -79,38 +79,11 @@ void main() {
       expect(result, expected);
     }
 
-    void verifyThrows(String pathA, String pathB) {
-      expect(
-          () => concatenatePaths(pathA, pathB), throwsA(isA()));
-    }
-
     verify('/a', 'b/c', '/a/b/c');
     verify('/', 'b', '/b');
-    verifyThrows('/a', '/b');
-    verifyThrows('/a', '/');
-    verifyThrows('/', '/');
-    verifyThrows('/', '');
-    verifyThrows('', '');
-  });
-
-  test('canonicalUri', () {
-    void verify(String path, String expected) =>
-        expect(canonicalUri(path), expected);
-    verify('/a', '/a');
-    verify('/a/', '/a');
-    verify('/', '/');
-    verify('/a/b/', '/a/b');
-    verify('https://www.example.com/', 'https://www.example.com/');
-    verify('https://www.example.com/a', 'https://www.example.com/a');
-    verify('https://www.example.com/a/', 'https://www.example.com/a');
-    verify('https://www.example.com/a/b/', 'https://www.example.com/a/b');
-    verify('https://www.example.com/?', 'https://www.example.com/');
-    verify('https://www.example.com/?a=b', 'https://www.example.com/?a=b');
-    verify('https://www.example.com/?a=/', 'https://www.example.com/?a=/');
-    verify('https://www.example.com/a/?b=c', 'https://www.example.com/a?b=c');
-    verify('https://www.example.com/#a/', 'https://www.example.com/#a/');
-
-    expect(() => canonicalUri('::::'), throwsA(isA()));
-    expect(() => canonicalUri(''), throwsA(anything));
+    verify('/a', '/b/c/', '/a/b/c');
+    verify('/a', 'b/c', '/a/b/c');
+    verify('/', '/', '/');
+    verify('', '', '/');
   });
 }
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..d951fac2bf31 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-8.7-all.zip
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists
diff --git a/packages/google_maps_flutter/google_maps_flutter/example/android/build.gradle b/packages/google_maps_flutter/google_maps_flutter/example/android/build.gradle
index cec92de922cf..0bed8906c094 100644
--- a/packages/google_maps_flutter/google_maps_flutter/example/android/build.gradle
+++ b/packages/google_maps_flutter/google_maps_flutter/example/android/build.gradle
@@ -5,7 +5,7 @@ buildscript {
     }
 
     dependencies {
-        classpath 'com.android.tools.build:gradle:7.4.2'
+        classpath 'com.android.tools.build:gradle:8.5.2'
     }
 }
 
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..48c0a02ca419 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-8.7-bin.zip
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists
diff --git a/packages/google_maps_flutter/google_maps_flutter/example/ios/Runner.xcodeproj/project.pbxproj b/packages/google_maps_flutter/google_maps_flutter/example/ios/Runner.xcodeproj/project.pbxproj
index b25dee2203e3..6271f61d4504 100644
--- a/packages/google_maps_flutter/google_maps_flutter/example/ios/Runner.xcodeproj/project.pbxproj
+++ b/packages/google_maps_flutter/google_maps_flutter/example/ios/Runner.xcodeproj/project.pbxproj
@@ -34,7 +34,6 @@
 		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; };
 		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 = ""; };
@@ -66,7 +65,6 @@
 		1E7CF0857EFC88FC263CF3B2 /* Frameworks */ = {
 			isa = PBXGroup;
 			children = (
-				68E472692836FF0C00BDDDAC /* MapKit.framework */,
 				7755F8F4BABC3D6A0BD4048B /* libPods-Runner.a */,
 			);
 			name = Frameworks;
diff --git a/packages/google_maps_flutter/google_maps_flutter/example/lib/place_polygon.dart b/packages/google_maps_flutter/google_maps_flutter/example/lib/place_polygon.dart
index e18d088ed313..11b3ed6e0bb5 100644
--- a/packages/google_maps_flutter/google_maps_flutter/example/lib/place_polygon.dart
+++ b/packages/google_maps_flutter/google_maps_flutter/example/lib/place_polygon.dart
@@ -225,7 +225,7 @@ class PlacePolygonBodyState extends State {
                         TextButton(
                           onPressed: (selectedId == null)
                               ? null
-                              : ((polygons[selectedId]!.holes.isNotEmpty)
+                              : (polygons[selectedId]!.holes.isNotEmpty
                                   ? null
                                   : () => _addHoles(selectedId)),
                           child: const Text('add holes'),
@@ -233,7 +233,7 @@ class PlacePolygonBodyState extends State {
                         TextButton(
                           onPressed: (selectedId == null)
                               ? null
-                              : ((polygons[selectedId]!.holes.isEmpty)
+                              : (polygons[selectedId]!.holes.isEmpty
                                   ? null
                                   : () => _removeHoles(selectedId)),
                           child: const Text('remove holes'),
diff --git a/packages/google_maps_flutter/google_maps_flutter/example/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter/example/pubspec.yaml
index a0bcdad52439..3326cbae3e5e 100644
--- a/packages/google_maps_flutter/google_maps_flutter/example/pubspec.yaml
+++ b/packages/google_maps_flutter/google_maps_flutter/example/pubspec.yaml
@@ -23,7 +23,7 @@ dependencies:
 
 dev_dependencies:
   build_runner: ^2.1.10
-  espresso: ^0.2.0
+  espresso: ^0.4.0
   flutter_test:
     sdk: flutter
   integration_test:
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 d9649c412566..1b2a6366ab78 100644
--- a/packages/google_maps_flutter/google_maps_flutter_android/CHANGELOG.md
+++ b/packages/google_maps_flutter/google_maps_flutter_android/CHANGELOG.md
@@ -1,3 +1,41 @@
+## 2.14.10
+
+* Adds 'PlatformBitmap' type.
+* Updates type unsafe implementations.
+
+## 2.14.9
+
+* Adds `PlatformCap` for `PlatformPolyline.startCap` and `endCap`.
+
+## 2.14.8
+
+* Updates Java compatibility version to 11.
+* Updates minimum supported SDK version to Flutter 3.24/Dart 3.5.
+
+## 2.14.7
+
+* Adds `PlatformPatternItem` pigeon class to convert `PlatformPolyline.pattern`.
+
+## 2.14.6
+
+* Converts 'PlatformCameraUpdate' to pigeon.
+
+## 2.14.5
+
+* Converts `JointType` to enum.
+
+## 2.14.4
+
+* Converts 'PlatformTileOverlay' to pigeon.
+
+## 2.14.3
+
+* Converts `PlatformPolygon` and `PlatformPolyline` to pigeon.
+
+## 2.14.2
+
+* Bumps `com.android.tools.build:gradle` from 7.3.1 to 8.5.1.
+
 ## 2.14.1
 
 * Converts `PlatformCircle` and `PlatformMarker` to pigeon.
diff --git a/packages/google_maps_flutter/google_maps_flutter_android/android/build.gradle b/packages/google_maps_flutter/google_maps_flutter_android/android/build.gradle
index 1577558d0c6e..4a1dc709b445 100644
--- a/packages/google_maps_flutter/google_maps_flutter_android/android/build.gradle
+++ b/packages/google_maps_flutter/google_maps_flutter_android/android/build.gradle
@@ -8,7 +8,7 @@ buildscript {
     }
 
     dependencies {
-        classpath 'com.android.tools.build:gradle:7.3.1'
+        classpath 'com.android.tools.build:gradle:8.5.1'
     }
 }
 
@@ -22,10 +22,7 @@ rootProject.allprojects {
 apply plugin: 'com.android.library'
 
 android {
-    // Conditional for compatibility with AGP <4.2.
-    if (project.android.hasProperty("namespace")) {
-        namespace 'io.flutter.plugins.googlemaps'
-    }
+    namespace 'io.flutter.plugins.googlemaps'
     compileSdk 34
 
     defaultConfig {
@@ -44,7 +41,7 @@ android {
         implementation 'com.google.maps.android:android-maps-utils:3.6.0'
         androidTestImplementation 'androidx.test:runner:1.2.0'
         androidTestImplementation 'androidx.test:rules:1.4.0'
-        androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
+        androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
         testImplementation 'junit:junit:4.13.2'
         testImplementation 'org.mockito:mockito-core:5.1.1'
         testImplementation 'androidx.test:core:1.2.0'
@@ -52,8 +49,8 @@ android {
     }
 
     compileOptions {
-        sourceCompatibility JavaVersion.VERSION_1_8
-        targetCompatibility JavaVersion.VERSION_1_8
+        sourceCompatibility JavaVersion.VERSION_11
+        targetCompatibility JavaVersion.VERSION_11
     }
 
     testOptions {
@@ -65,6 +62,11 @@ android {
                outputs.upToDateWhen {false}
                showStandardStreams = true
             }
+            // The org.gradle.jvmargs property that may be set in gradle.properties does not impact
+            // the Java heap size when running the Android unit tests. The following property here
+            // sets the heap size to a size large enough to run the robolectric tests across
+            // multiple SDK levels.
+            jvmArgs "-Xmx1g"
         }
     }
 }
diff --git a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Convert.java b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Convert.java
index 91c039e25373..5701825f12d9 100644
--- a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Convert.java
+++ b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Convert.java
@@ -29,6 +29,7 @@
 import com.google.android.gms.maps.model.Dash;
 import com.google.android.gms.maps.model.Dot;
 import com.google.android.gms.maps.model.Gap;
+import com.google.android.gms.maps.model.JointType;
 import com.google.android.gms.maps.model.LatLng;
 import com.google.android.gms.maps.model.LatLngBounds;
 import com.google.android.gms.maps.model.PatternItem;
@@ -43,7 +44,6 @@
 import java.io.InputStream;
 import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
@@ -61,94 +61,82 @@ class Convert {
   public static final String HEATMAP_GRADIENT_COLOR_MAP_SIZE_KEY = "colorMapSize";
 
   private static BitmapDescriptor toBitmapDescriptor(
-      Object o, AssetManager assetManager, float density) {
-    return toBitmapDescriptor(o, assetManager, density, new BitmapDescriptorFactoryWrapper());
+      Messages.PlatformBitmap platformBitmap, AssetManager assetManager, float density) {
+    return toBitmapDescriptor(
+        platformBitmap, assetManager, density, new BitmapDescriptorFactoryWrapper());
   }
 
   private static BitmapDescriptor toBitmapDescriptor(
-      Object o, AssetManager assetManager, float density, BitmapDescriptorFactoryWrapper wrapper) {
-    final List data = toList(o);
-    final String descriptorType = toString(data.get(0));
-    switch (descriptorType) {
-      case "defaultMarker":
-        if (data.size() == 1) {
-          return BitmapDescriptorFactory.defaultMarker();
-        } else {
-          final float hue = toFloat(data.get(1));
-          return BitmapDescriptorFactory.defaultMarker(hue);
-        }
-      case "fromAsset":
-        final String assetPath = toString(data.get(1));
-        if (data.size() == 2) {
-          return BitmapDescriptorFactory.fromAsset(
-              FlutterInjector.instance().flutterLoader().getLookupKeyForAsset(assetPath));
-        } else {
-          final String assetPackage = toString(data.get(2));
-          return BitmapDescriptorFactory.fromAsset(
-              FlutterInjector.instance()
-                  .flutterLoader()
-                  .getLookupKeyForAsset(assetPath, assetPackage));
-        }
-      case "fromAssetImage":
-        final String assetImagePath = toString(data.get(1));
-        if (data.size() == 3) {
-          return BitmapDescriptorFactory.fromAsset(
-              FlutterInjector.instance().flutterLoader().getLookupKeyForAsset(assetImagePath));
-        } else {
-          throw new IllegalArgumentException(
-              "'fromAssetImage' Expected exactly 3 arguments, got: " + data.size());
-        }
-      case "fromBytes":
-        return getBitmapFromBytesLegacy(data);
-      case "asset":
-        if (!(data.get(1) instanceof Map)) {
-          throw new IllegalArgumentException("'asset' expected a map as the second parameter");
-        }
-        final Map assetData = toMap(data.get(1));
-        return getBitmapFromAsset(
-            assetData, assetManager, density, wrapper, new FlutterInjectorWrapper());
-      case "bytes":
-        if (!(data.get(1) instanceof Map)) {
-          throw new IllegalArgumentException("'bytes' expected a map as the second parameter");
-        }
-        final Map byteData = toMap(data.get(1));
-        return getBitmapFromBytes(byteData, density, wrapper);
-      default:
-        throw new IllegalArgumentException("Cannot interpret " + o + " as BitmapDescriptor");
+      Messages.PlatformBitmap platformBitmap,
+      AssetManager assetManager,
+      float density,
+      BitmapDescriptorFactoryWrapper wrapper) {
+    Object bitmap = platformBitmap.getBitmap();
+    if (bitmap instanceof Messages.PlatformBitmapDefaultMarker) {
+      Messages.PlatformBitmapDefaultMarker typedBitmap =
+          (Messages.PlatformBitmapDefaultMarker) bitmap;
+      if (typedBitmap.getHue() == null) {
+        return BitmapDescriptorFactory.defaultMarker();
+      } else {
+        final float hue = typedBitmap.getHue().floatValue();
+        return BitmapDescriptorFactory.defaultMarker(hue);
+      }
+    }
+    if (bitmap instanceof Messages.PlatformBitmapAsset) {
+      Messages.PlatformBitmapAsset typedBitmap = (Messages.PlatformBitmapAsset) bitmap;
+      final String assetPath = typedBitmap.getName();
+      final String assetPackage = typedBitmap.getPkg();
+      if (assetPackage == null) {
+        return BitmapDescriptorFactory.fromAsset(
+            FlutterInjector.instance().flutterLoader().getLookupKeyForAsset(assetPath));
+      } else {
+        return BitmapDescriptorFactory.fromAsset(
+            FlutterInjector.instance()
+                .flutterLoader()
+                .getLookupKeyForAsset(assetPath, assetPackage));
+      }
+    }
+    if (bitmap instanceof Messages.PlatformBitmapAssetImage) {
+      Messages.PlatformBitmapAssetImage typedBitmap = (Messages.PlatformBitmapAssetImage) bitmap;
+      final String assetImagePath = typedBitmap.getName();
+      return BitmapDescriptorFactory.fromAsset(
+          FlutterInjector.instance().flutterLoader().getLookupKeyForAsset(assetImagePath));
+    }
+    if (bitmap instanceof Messages.PlatformBitmapBytes) {
+      Messages.PlatformBitmapBytes typedBitmap = (Messages.PlatformBitmapBytes) bitmap;
+      return getBitmapFromBytesLegacy(typedBitmap);
     }
+    if (bitmap instanceof Messages.PlatformBitmapAssetMap) {
+      Messages.PlatformBitmapAssetMap typedBitmap = (Messages.PlatformBitmapAssetMap) bitmap;
+      return getBitmapFromAsset(
+          typedBitmap, assetManager, density, wrapper, new FlutterInjectorWrapper());
+    }
+    if (bitmap instanceof Messages.PlatformBitmapBytesMap) {
+      Messages.PlatformBitmapBytesMap typedBitmap = (Messages.PlatformBitmapBytesMap) bitmap;
+      return getBitmapFromBytes(typedBitmap, density, wrapper);
+    }
+    throw new IllegalArgumentException("PlatformBitmap did not contain a supported subtype.");
   }
 
   // Used for deprecated fromBytes bitmap descriptor.
   // Can be removed after support for "fromBytes" bitmap descriptor type is
   // removed.
-  private static BitmapDescriptor getBitmapFromBytesLegacy(List data) {
-    if (data.size() == 2) {
-      try {
-        Bitmap bitmap = toBitmap(data.get(1));
-        return BitmapDescriptorFactory.fromBitmap(bitmap);
-      } catch (Exception e) {
-        throw new IllegalArgumentException("Unable to interpret bytes as a valid image.", e);
-      }
-    } else {
-      throw new IllegalArgumentException(
-          "fromBytes should have exactly one argument, interpretTileOverlayOptions the bytes. Got: "
-              + data.size());
+  private static BitmapDescriptor getBitmapFromBytesLegacy(
+      Messages.PlatformBitmapBytes bitmapBytes) {
+    try {
+      Bitmap bitmap = toBitmap(bitmapBytes.getByteData());
+      return BitmapDescriptorFactory.fromBitmap(bitmap);
+    } catch (Exception e) {
+      throw new IllegalArgumentException("Unable to interpret bytes as a valid image.", e);
     }
   }
 
   /**
    * Creates a BitmapDescriptor object from bytes data.
    *
-   * 

This method requires the `byteData` map to contain specific keys: 'byteData' for image - * bytes, 'bitmapScaling' for scaling mode, and 'imagePixelRatio' for scale ratio. It may - * optionally include 'width' and/or 'height' for explicit image dimensions. - * - * @param byteData a map containing the byte data and scaling instructions. Expected keys are: - * 'byteData': the actual bytes of the image, 'bitmapScaling': the scaling mode, either 'auto' - * or 'none', 'imagePixelRatio': used with 'auto' bitmapScaling if width or height are not - * provided, 'width' (optional): the desired width, which affects scaling if 'height' is not - * provided, 'height' (optional): the desired height, which affects scaling if 'width' is not - * provided + * @param bytesMap a [PlatformBitmapBytesMap] containing the byte data from which to construct a + * [BitmapDescriptor] and a bitmap scaling mode. The optional `width` affects scaling when + * `height` is `null`, and the optional `height` affects scaling when `width` is `null. * @param density the density of the display, used to calculate pixel dimensions. * @param bitmapDescriptorFactory is an instance of the BitmapDescriptorFactoryWrapper. * @return BitmapDescriptor object from bytes data. @@ -157,34 +145,16 @@ private static BitmapDescriptor getBitmapFromBytesLegacy(List data) { */ @VisibleForTesting public static BitmapDescriptor getBitmapFromBytes( - Map byteData, float density, BitmapDescriptorFactoryWrapper bitmapDescriptorFactory) { - - final String byteDataKey = "byteData"; - final String bitmapScalingKey = "bitmapScaling"; - final String imagePixelRatioKey = "imagePixelRatio"; - - if (!byteData.containsKey(byteDataKey)) { - throw new IllegalArgumentException("'bytes' requires '" + byteDataKey + "' key."); - } - if (!byteData.containsKey(bitmapScalingKey)) { - throw new IllegalArgumentException("'bytes' requires '" + bitmapScalingKey + "' key."); - } - if (!byteData.containsKey(imagePixelRatioKey)) { - throw new IllegalArgumentException("'bytes' requires '" + imagePixelRatioKey + "' key."); - } - + Messages.PlatformBitmapBytesMap bytesMap, + float density, + BitmapDescriptorFactoryWrapper bitmapDescriptorFactory) { try { - Bitmap bitmap = toBitmap(byteData.get(byteDataKey)); - String scalingMode = toString(byteData.get(bitmapScalingKey)); + Bitmap bitmap = toBitmap(bytesMap.getByteData()); + Messages.PlatformMapBitmapScaling scalingMode = bytesMap.getBitmapScaling(); switch (scalingMode) { - case "auto": - final String widthKey = "width"; - final String heightKey = "height"; - - final Double width = - byteData.containsKey(widthKey) ? toDouble(byteData.get(widthKey)) : null; - final Double height = - byteData.containsKey(heightKey) ? toDouble(byteData.get(heightKey)) : null; + case AUTO: + final Double width = bytesMap.getWidth(); + final Double height = bytesMap.getHeight(); if (width != null || height != null) { int targetWidth = width != null ? toInt(width * density) : bitmap.getWidth(); @@ -203,10 +173,10 @@ public static BitmapDescriptor getBitmapFromBytes( toScaledBitmap(bitmap, targetWidth, targetHeight)); } else { // Scale image using given scale ratio - final float scale = density / toFloat(byteData.get(imagePixelRatioKey)); + final float scale = density / bytesMap.getImagePixelRatio().floatValue(); return bitmapDescriptorFactory.fromBitmap(toScaledBitmap(bitmap, scale)); } - case "none": + case NONE: break; } return bitmapDescriptorFactory.fromBitmap(bitmap); @@ -219,15 +189,13 @@ public static BitmapDescriptor getBitmapFromBytes( * Creates a BitmapDescriptor object from asset, using given details and density. * *

This method processes an asset specified by name and applies scaling based on the provided - * parameters. The `assetDetails` map must contain the keys 'assetName', 'bitmapScaling', and - * 'imagePixelRatio', and may optionally include 'width' and/or 'height' to explicitly set the - * dimensions of the output image. + * parameters. The `assetMap` object provides the asset name, bitmap scaling mode, and image pixel + * ratio, and may optionally include 'width' and/or 'height' to explicitly set the dimensions of + * the output image. * - * @param assetDetails a map containing the asset details and scaling instructions, with keys - * 'assetName': the name of the asset file, 'bitmapScaling': the scaling mode, either 'auto' - * or 'none', 'imagePixelRatio': used with 'auto' scaling to compute the scale ratio, 'width' - * (optional): the desired width, which affects scaling if 'height' is not provided, 'height' - * (optional): the desired height, which affects scaling if 'width' is not provided + * @param assetMap a [PlatformBitmapAssetMap] containing the asset name from which to construct a + * [BitmapDescriptor] and a bitmap scaling mode. The optional `width` affects scaling when + * `height` is `null`, and the optional `height` affects scaling when `width` is `null. * @param assetManager assetManager An instance of Android's AssetManager, which provides access * to any raw asset files stored in the application's assets directory. * @param density density the density of the display, used to calculate pixel dimensions. @@ -239,39 +207,19 @@ public static BitmapDescriptor getBitmapFromBytes( */ @VisibleForTesting public static BitmapDescriptor getBitmapFromAsset( - Map assetDetails, + Messages.PlatformBitmapAssetMap assetMap, AssetManager assetManager, float density, BitmapDescriptorFactoryWrapper bitmapDescriptorFactory, FlutterInjectorWrapper flutterInjector) { - - final String assetNameKey = "assetName"; - final String bitmapScalingKey = "bitmapScaling"; - final String imagePixelRatioKey = "imagePixelRatio"; - - if (!assetDetails.containsKey(assetNameKey)) { - throw new IllegalArgumentException("'asset' requires '" + assetNameKey + "' key."); - } - if (!assetDetails.containsKey(bitmapScalingKey)) { - throw new IllegalArgumentException("'asset' requires '" + bitmapScalingKey + "' key."); - } - if (!assetDetails.containsKey(imagePixelRatioKey)) { - throw new IllegalArgumentException("'asset' requires '" + imagePixelRatioKey + "' key."); - } - - final String assetName = toString(assetDetails.get(assetNameKey)); + final String assetName = assetMap.getAssetName(); final String assetKey = flutterInjector.getLookupKeyForAsset(assetName); - String scalingMode = toString(assetDetails.get(bitmapScalingKey)); + Messages.PlatformMapBitmapScaling scalingMode = assetMap.getBitmapScaling(); switch (scalingMode) { - case "auto": - final String widthKey = "width"; - final String heightKey = "height"; - - final Double width = - assetDetails.containsKey(widthKey) ? toDouble(assetDetails.get(widthKey)) : null; - final Double height = - assetDetails.containsKey(heightKey) ? toDouble(assetDetails.get(heightKey)) : null; + case AUTO: + final Double width = assetMap.getWidth(); + final Double height = assetMap.getHeight(); InputStream inputStream = null; try { inputStream = assetManager.open(assetKey); @@ -294,7 +242,7 @@ public static BitmapDescriptor getBitmapFromAsset( toScaledBitmap(bitmap, targetWidth, targetHeight)); } else { // Scale image using given scale. - final float scale = density / toFloat(assetDetails.get(imagePixelRatioKey)); + final float scale = density / assetMap.getImagePixelRatio().floatValue(); return bitmapDescriptorFactory.fromBitmap(toScaledBitmap(bitmap, scale)); } } catch (Exception e) { @@ -308,17 +256,13 @@ public static BitmapDescriptor getBitmapFromAsset( } } } - case "none": + case NONE: break; } return bitmapDescriptorFactory.fromAsset(assetKey); } - private static boolean toBoolean(Object o) { - return (Boolean) o; - } - static @NonNull CameraPosition cameraPositionFromPigeon( @NonNull Messages.PlatformCameraPosition position) { final CameraPosition.Builder builder = CameraPosition.builder(); @@ -329,47 +273,57 @@ private static boolean toBoolean(Object o) { return builder.build(); } - static CameraPosition toCameraPosition(Object o) { - final Map data = toMap(o); - final CameraPosition.Builder builder = CameraPosition.builder(); - builder.bearing(toFloat(data.get("bearing"))); - builder.target(toLatLng(data.get("target"))); - builder.tilt(toFloat(data.get("tilt"))); - builder.zoom(toFloat(data.get("zoom"))); - return builder.build(); - } - - static CameraUpdate toCameraUpdate(Object o, float density) { - final List data = toList(o); - switch (toString(data.get(0))) { - case "newCameraPosition": - return CameraUpdateFactory.newCameraPosition(toCameraPosition(data.get(1))); - case "newLatLng": - return CameraUpdateFactory.newLatLng(toLatLng(data.get(1))); - case "newLatLngBounds": - return CameraUpdateFactory.newLatLngBounds( - toLatLngBounds(data.get(1)), toPixels(data.get(2), density)); - case "newLatLngZoom": - return CameraUpdateFactory.newLatLngZoom(toLatLng(data.get(1)), toFloat(data.get(2))); - case "scrollBy": - return CameraUpdateFactory.scrollBy( // - toFractionalPixels(data.get(1), density), // - toFractionalPixels(data.get(2), density)); - case "zoomBy": - if (data.size() == 2) { - return CameraUpdateFactory.zoomBy(toFloat(data.get(1))); - } else { - return CameraUpdateFactory.zoomBy(toFloat(data.get(1)), toPoint(data.get(2), density)); - } - case "zoomIn": - return CameraUpdateFactory.zoomIn(); - case "zoomOut": - return CameraUpdateFactory.zoomOut(); - case "zoomTo": - return CameraUpdateFactory.zoomTo(toFloat(data.get(1))); - default: - throw new IllegalArgumentException("Cannot interpret " + o + " as CameraUpdate"); - } + static CameraUpdate cameraUpdateFromPigeon(Messages.PlatformCameraUpdate update, float density) { + Object cameraUpdate = update.getCameraUpdate(); + if (cameraUpdate instanceof Messages.PlatformCameraUpdateNewCameraPosition) { + Messages.PlatformCameraUpdateNewCameraPosition newCameraPosition = + (Messages.PlatformCameraUpdateNewCameraPosition) cameraUpdate; + return CameraUpdateFactory.newCameraPosition( + cameraPositionFromPigeon(newCameraPosition.getCameraPosition())); + } + if (cameraUpdate instanceof Messages.PlatformCameraUpdateNewLatLng) { + Messages.PlatformCameraUpdateNewLatLng newLatLng = + (Messages.PlatformCameraUpdateNewLatLng) cameraUpdate; + return CameraUpdateFactory.newLatLng(latLngFromPigeon(newLatLng.getLatLng())); + } + if (cameraUpdate instanceof Messages.PlatformCameraUpdateNewLatLngZoom) { + Messages.PlatformCameraUpdateNewLatLngZoom newLatLngZoom = + (Messages.PlatformCameraUpdateNewLatLngZoom) cameraUpdate; + return CameraUpdateFactory.newLatLngZoom( + latLngFromPigeon(newLatLngZoom.getLatLng()), newLatLngZoom.getZoom().floatValue()); + } + if (cameraUpdate instanceof Messages.PlatformCameraUpdateNewLatLngBounds) { + Messages.PlatformCameraUpdateNewLatLngBounds newLatLngBounds = + (Messages.PlatformCameraUpdateNewLatLngBounds) cameraUpdate; + return CameraUpdateFactory.newLatLngBounds( + latLngBoundsFromPigeon(newLatLngBounds.getBounds()), + (int) (newLatLngBounds.getPadding() * density)); + } + if (cameraUpdate instanceof Messages.PlatformCameraUpdateScrollBy) { + Messages.PlatformCameraUpdateScrollBy scrollBy = + (Messages.PlatformCameraUpdateScrollBy) cameraUpdate; + return CameraUpdateFactory.scrollBy( + scrollBy.getDx().floatValue() * density, scrollBy.getDy().floatValue() * density); + } + if (cameraUpdate instanceof Messages.PlatformCameraUpdateZoomBy) { + Messages.PlatformCameraUpdateZoomBy zoomBy = + (Messages.PlatformCameraUpdateZoomBy) cameraUpdate; + final Point focus = pointFromPigeon(zoomBy.getFocus(), density); + return (focus != null) + ? CameraUpdateFactory.zoomBy(zoomBy.getAmount().floatValue(), focus) + : CameraUpdateFactory.zoomBy(zoomBy.getAmount().floatValue()); + } + if (cameraUpdate instanceof Messages.PlatformCameraUpdateZoomTo) { + Messages.PlatformCameraUpdateZoomTo zoomTo = + (Messages.PlatformCameraUpdateZoomTo) cameraUpdate; + return CameraUpdateFactory.zoomTo(zoomTo.getZoom().floatValue()); + } + if (cameraUpdate instanceof Messages.PlatformCameraUpdateZoom) { + Messages.PlatformCameraUpdateZoom zoom = (Messages.PlatformCameraUpdateZoom) cameraUpdate; + return (zoom.getOut()) ? CameraUpdateFactory.zoomOut() : CameraUpdateFactory.zoomIn(); + } + throw new IllegalArgumentException( + "PlatformCameraUpdate's cameraUpdate field must be one of the PlatformCameraUpdate... case classes."); } private static double toDouble(Object o) { @@ -493,16 +447,16 @@ static Point pointFromPigeon(Messages.PlatformPoint point) { return new Point(point.getX().intValue(), point.getY().intValue()); } - static Messages.PlatformPoint pointToPigeon(Point point) { - return new Messages.PlatformPoint.Builder().setX((long) point.x).setY((long) point.y).build(); - } - - private static LatLngBounds toLatLngBounds(Object o) { - if (o == null) { + @Nullable + static Point pointFromPigeon(@Nullable Messages.PlatformDoublePair point, float density) { + if (point == null) { return null; } - final List data = toList(o); - return new LatLngBounds(toLatLng(data.get(0)), toLatLng(data.get(1))); + return new Point((int) (point.getX() * density), (int) (point.getY() * density)); + } + + static Messages.PlatformPoint pointToPigeon(Point point) { + return new Messages.PlatformPoint.Builder().setX((long) point.x).setY((long) point.y).build(); } private static List toList(Object o) { @@ -513,28 +467,7 @@ private static List toList(Object o) { return (Map) o; } - private static Map toObjectMap(Object o) { - Map hashMap = new HashMap<>(); - Map map = (Map) o; - for (Object key : map.keySet()) { - Object object = map.get(key); - if (object != null) { - hashMap.put((String) key, object); - } - } - return hashMap; - } - - private static float toFractionalPixels(Object o, float density) { - return toFloat(o) * density; - } - - private static int toPixels(Object o, float density) { - return (int) toFractionalPixels(o, density); - } - - private static Bitmap toBitmap(Object o) { - byte[] bmpData = (byte[]) o; + private static Bitmap toBitmap(byte[] bmpData) { Bitmap bitmap = BitmapFactory.decodeByteArray(bmpData, 0, bmpData.length); if (bitmap == null) { throw new IllegalArgumentException("Unable to decode bytes as a valid bitmap."); @@ -562,15 +495,6 @@ private static Bitmap toScaledBitmap(Bitmap bitmap, int width, int height) { return bitmap; } - private static Point toPoint(Object o, float density) { - final List data = toList(o); - return new Point(toPixels(data.get(0), density), toPixels(data.get(1), density)); - } - - private static String toString(Object o) { - return (String) o; - } - static void interpretMapConfiguration( @NonNull Messages.PlatformMapConfiguration config, @NonNull GoogleMapOptionsSink sink) { final Messages.PlatformCameraTargetBounds cameraTargetBounds = config.getCameraTargetBounds(); @@ -666,8 +590,7 @@ static void interpretMarkerOptions( float density, BitmapDescriptorFactoryWrapper wrapper) { sink.setAlpha(marker.getAlpha().floatValue()); - sink.setAnchor( - marker.getAnchor().getDx().floatValue(), marker.getAnchor().getDy().floatValue()); + sink.setAnchor(marker.getAnchor().getX().floatValue(), marker.getAnchor().getY().floatValue()); sink.setConsumeTapEvents(marker.getConsumeTapEvents()); sink.setDraggable(marker.getDraggable()); sink.setFlat(marker.getFlat()); @@ -685,108 +608,53 @@ private static void interpretInfoWindowOptions( if (title != null) { sink.setInfoWindowText(title, infoWindow.getSnippet()); } - Messages.PlatformOffset infoWindowAnchor = infoWindow.getAnchor(); + Messages.PlatformDoublePair infoWindowAnchor = infoWindow.getAnchor(); sink.setInfoWindowAnchor( - infoWindowAnchor.getDx().floatValue(), infoWindowAnchor.getDy().floatValue()); + infoWindowAnchor.getX().floatValue(), infoWindowAnchor.getY().floatValue()); } - static String interpretPolygonOptions(Map data, PolygonOptionsSink sink) { - final Object consumeTapEvents = data.get("consumeTapEvents"); - if (consumeTapEvents != null) { - sink.setConsumeTapEvents(toBoolean(consumeTapEvents)); - } - final Object geodesic = data.get("geodesic"); - if (geodesic != null) { - sink.setGeodesic(toBoolean(geodesic)); - } - final Object visible = data.get("visible"); - if (visible != null) { - sink.setVisible(toBoolean(visible)); - } - final Object fillColor = data.get("fillColor"); - if (fillColor != null) { - sink.setFillColor(toInt(fillColor)); - } - final Object strokeColor = data.get("strokeColor"); - if (strokeColor != null) { - sink.setStrokeColor(toInt(strokeColor)); - } - final Object strokeWidth = data.get("strokeWidth"); - if (strokeWidth != null) { - sink.setStrokeWidth(toInt(strokeWidth)); - } - final Object zIndex = data.get("zIndex"); - if (zIndex != null) { - sink.setZIndex(toFloat(zIndex)); - } - final Object points = data.get("points"); - if (points != null) { - sink.setPoints(toPoints(points)); - } - final Object holes = data.get("holes"); - if (holes != null) { - sink.setHoles(toHoles(holes)); - } - final String polygonId = (String) data.get("polygonId"); - if (polygonId == null) { - throw new IllegalArgumentException("polygonId was null"); - } else { - return polygonId; + static String interpretPolygonOptions(Messages.PlatformPolygon polygon, PolygonOptionsSink sink) { + sink.setConsumeTapEvents(polygon.getConsumesTapEvents()); + sink.setGeodesic(polygon.getGeodesic()); + sink.setVisible(polygon.getVisible()); + sink.setFillColor(polygon.getFillColor().intValue()); + sink.setStrokeColor(polygon.getStrokeColor().intValue()); + sink.setStrokeWidth(polygon.getStrokeWidth()); + sink.setZIndex(polygon.getZIndex()); + sink.setPoints(pointsFromPigeon(polygon.getPoints())); + sink.setHoles(toHoles(polygon.getHoles())); + return polygon.getPolygonId(); + } + + static int jointTypeFromPigeon(Messages.PlatformJointType jointType) { + switch (jointType) { + case MITERED: + return JointType.DEFAULT; + case BEVEL: + return JointType.BEVEL; + case ROUND: + return JointType.ROUND; } + return JointType.DEFAULT; } static String interpretPolylineOptions( - Map data, PolylineOptionsSink sink, AssetManager assetManager, float density) { - final Object consumeTapEvents = data.get("consumeTapEvents"); - if (consumeTapEvents != null) { - sink.setConsumeTapEvents(toBoolean(consumeTapEvents)); - } - final Object color = data.get("color"); - if (color != null) { - sink.setColor(toInt(color)); - } - final Object endCap = data.get("endCap"); - if (endCap != null) { - sink.setEndCap(toCap(endCap, assetManager, density)); - } - final Object geodesic = data.get("geodesic"); - if (geodesic != null) { - sink.setGeodesic(toBoolean(geodesic)); - } - final Object jointType = data.get("jointType"); - if (jointType != null) { - sink.setJointType(toInt(jointType)); - } - final Object startCap = data.get("startCap"); - if (startCap != null) { - sink.setStartCap(toCap(startCap, assetManager, density)); - } - final Object visible = data.get("visible"); - if (visible != null) { - sink.setVisible(toBoolean(visible)); - } - final Object width = data.get("width"); - if (width != null) { - sink.setWidth(toInt(width)); - } - final Object zIndex = data.get("zIndex"); - if (zIndex != null) { - sink.setZIndex(toFloat(zIndex)); - } - final Object points = data.get("points"); - if (points != null) { - sink.setPoints(toPoints(points)); - } - final Object pattern = data.get("pattern"); - if (pattern != null) { - sink.setPattern(toPattern(pattern)); - } - final String polylineId = (String) data.get("polylineId"); - if (polylineId == null) { - throw new IllegalArgumentException("polylineId was null"); - } else { - return polylineId; - } + Messages.PlatformPolyline polyline, + PolylineOptionsSink sink, + AssetManager assetManager, + float density) { + sink.setConsumeTapEvents(polyline.getConsumesTapEvents()); + sink.setColor(polyline.getColor().intValue()); + sink.setEndCap(capFromPigeon(polyline.getEndCap(), assetManager, density)); + sink.setStartCap(capFromPigeon(polyline.getStartCap(), assetManager, density)); + sink.setGeodesic(polyline.getGeodesic()); + sink.setJointType(jointTypeFromPigeon(polyline.getJointType())); + sink.setVisible(polyline.getVisible()); + sink.setWidth(polyline.getWidth()); + sink.setZIndex(polyline.getZIndex()); + sink.setPoints(pointsFromPigeon(polyline.getPoints())); + sink.setPattern(patternFromPigeon(polyline.getPatterns())); + return polyline.getPolylineId(); } static String interpretCircleOptions(Messages.PlatformCircle circle, CircleOptionsSink sink) { @@ -850,14 +718,11 @@ static String interpretHeatmapOptions(Map data, HeatmapOptionsSink si } } - @VisibleForTesting - static List toPoints(Object o) { - final List data = toList(o); + static List pointsFromPigeon(List data) { final List points = new ArrayList<>(data.size()); - for (Object rawPoint : data) { - final List point = toList(rawPoint); - points.add(new LatLng(toDouble(point.get(0)), toDouble(point.get(1)))); + for (Messages.PlatformLatLng rawPoint : data) { + points.add(new LatLng(rawPoint.getLatitude(), rawPoint.getLongitude())); } return points; } @@ -918,89 +783,66 @@ static Gradient toGradient(Object o) { return new Gradient(colors, startPoints, colorMapSize); } - private static List> toHoles(Object o) { - final List data = toList(o); + private static List> toHoles(List> data) { final List> holes = new ArrayList<>(data.size()); - for (Object rawHole : data) { - holes.add(toPoints(rawHole)); + for (List hole : data) { + holes.add(pointsFromPigeon(hole)); } return holes; } - private static List toPattern(Object o) { - final List data = toList(o); - - if (data.isEmpty()) { + private static List patternFromPigeon( + List patternItems) { + if (patternItems.isEmpty()) { return null; } - - final List pattern = new ArrayList<>(data.size()); - - for (Object ob : data) { - final List patternItem = toList(ob); - switch (toString(patternItem.get(0))) { - case "dot": + final List pattern = new ArrayList<>(); + for (Messages.PlatformPatternItem patternItem : patternItems) { + switch (patternItem.getType()) { + case DOT: pattern.add(new Dot()); break; - case "dash": - pattern.add(new Dash(toFloat(patternItem.get(1)))); + case DASH: + assert patternItem.getLength() != null; + pattern.add(new Dash(patternItem.getLength().floatValue())); break; - case "gap": - pattern.add(new Gap(toFloat(patternItem.get(1)))); + case GAP: + assert patternItem.getLength() != null; + pattern.add(new Gap(patternItem.getLength().floatValue())); break; - default: - throw new IllegalArgumentException("Cannot interpret " + pattern + " as PatternItem"); } } - return pattern; } - private static Cap toCap(Object o, AssetManager assetManager, float density) { - final List data = toList(o); - switch (toString(data.get(0))) { - case "buttCap": + private static Cap capFromPigeon( + Messages.PlatformCap cap, AssetManager assetManager, float density) { + switch (cap.getType()) { + case BUTT_CAP: return new ButtCap(); - case "roundCap": + case ROUND_CAP: return new RoundCap(); - case "squareCap": + case SQUARE_CAP: return new SquareCap(); - case "customCap": - if (data.size() == 2) { - return new CustomCap(toBitmapDescriptor(data.get(1), assetManager, density)); - } else { - return new CustomCap( - toBitmapDescriptor(data.get(1), assetManager, density), toFloat(data.get(2))); + case CUSTOM_CAP: + if (cap.getRefWidth() == null) { + throw new IllegalArgumentException("A Custom Cap must specify a refWidth value."); } - default: - throw new IllegalArgumentException("Cannot interpret " + o + " as Cap"); + return new CustomCap( + toBitmapDescriptor(cap.getBitmapDescriptor(), assetManager, density), + cap.getRefWidth().floatValue()); } + throw new IllegalArgumentException("Unrecognized PlatformCap type: " + cap.getType()); } - static String interpretTileOverlayOptions(Map data, TileOverlaySink sink) { - final Object fadeIn = data.get("fadeIn"); - if (fadeIn != null) { - sink.setFadeIn(toBoolean(fadeIn)); - } - final Object transparency = data.get("transparency"); - if (transparency != null) { - sink.setTransparency(toFloat(transparency)); - } - final Object zIndex = data.get("zIndex"); - if (zIndex != null) { - sink.setZIndex(toFloat(zIndex)); - } - final Object visible = data.get("visible"); - if (visible != null) { - sink.setVisible(toBoolean(visible)); - } - final String tileOverlayId = (String) data.get("tileOverlayId"); - if (tileOverlayId == null) { - throw new IllegalArgumentException("tileOverlayId was null"); - } else { - return tileOverlayId; - } + static String interpretTileOverlayOptions( + Messages.PlatformTileOverlay tileOverlay, TileOverlaySink sink) { + sink.setFadeIn(tileOverlay.getFadeIn()); + sink.setTransparency(tileOverlay.getTransparency().floatValue()); + sink.setZIndex(tileOverlay.getZIndex()); + sink.setVisible(tileOverlay.getVisible()); + return tileOverlay.getTileOverlayId(); } static Tile tileFromPigeon(Messages.PlatformTile tile) { 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 561206717860..140938ea047c 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 @@ -933,7 +933,7 @@ public void moveCamera(@NonNull Messages.PlatformCameraUpdate cameraUpdate) { throw new FlutterError( "GoogleMap uninitialized", "moveCamera called prior to map initialization", null); } - googleMap.moveCamera(Convert.toCameraUpdate(cameraUpdate.getJson(), density)); + googleMap.moveCamera(Convert.cameraUpdateFromPigeon(cameraUpdate, density)); } @Override @@ -942,7 +942,7 @@ public void animateCamera(@NonNull Messages.PlatformCameraUpdate cameraUpdate) { throw new FlutterError( "GoogleMap uninitialized", "animateCamera called prior to map initialization", null); } - googleMap.animateCamera(Convert.toCameraUpdate(cameraUpdate.getJson(), density)); + googleMap.animateCamera(Convert.cameraUpdateFromPigeon(cameraUpdate, density)); } @Override diff --git a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Messages.java b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Messages.java index 18a3b0e5452d..d2e29fab127c 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Messages.java +++ b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Messages.java @@ -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 (v20.0.2), do not edit directly. +// Autogenerated from Pigeon (v22.4.0), do not edit directly. // See also: https://pub.dev/packages/pigeon package io.flutter.plugins.googlemaps; @@ -49,7 +49,7 @@ public FlutterError(@NonNull String code, @Nullable String message, @Nullable Ob @NonNull protected static ArrayList wrapError(@NonNull Throwable exception) { - ArrayList errorList = new ArrayList(3); + ArrayList errorList = new ArrayList<>(3); if (exception instanceof FlutterError) { FlutterError error = (FlutterError) exception; errorList.add(error.code); @@ -84,7 +84,7 @@ public enum PlatformMapType { final int index; - private PlatformMapType(final int index) { + PlatformMapType(final int index) { this.index = index; } } @@ -95,7 +95,63 @@ public enum PlatformRendererType { final int index; - private PlatformRendererType(final int index) { + PlatformRendererType(final int index) { + this.index = index; + } + } + + /** Join types for polyline joints. */ + public enum PlatformJointType { + MITERED(0), + BEVEL(1), + ROUND(2); + + final int index; + + PlatformJointType(final int index) { + this.index = index; + } + } + + /** + * Enumeration of possible types of PlatformCap, corresponding to the subclasses of Cap in the + * Google Maps Android SDK. See + * https://developers.google.com/maps/documentation/android-sdk/reference/com/google/android/libraries/maps/model/Cap. + */ + public enum PlatformCapType { + BUTT_CAP(0), + ROUND_CAP(1), + SQUARE_CAP(2), + CUSTOM_CAP(3); + + final int index; + + PlatformCapType(final int index) { + this.index = index; + } + } + + /** Enumeration of possible types for PatternItem. */ + public enum PlatformPatternItemType { + DOT(0), + DASH(1), + GAP(2); + + final int index; + + PlatformPatternItemType(final int index) { + this.index = index; + } + } + + /** Pigeon equivalent of [MapBitmapScaling]. */ + public enum PlatformMapBitmapScaling { + AUTO(0), + NONE(1); + + final int index; + + PlatformMapBitmapScaling(final int index) { this.index = index; } } @@ -227,7 +283,7 @@ public static final class Builder { @NonNull ArrayList toList() { - ArrayList toListResult = new ArrayList(4); + ArrayList toListResult = new ArrayList<>(4); toListResult.add(bearing); toListResult.add(target); toListResult.add(tilt); @@ -235,15 +291,15 @@ ArrayList toList() { return toListResult; } - static @NonNull PlatformCameraPosition fromList(@NonNull ArrayList __pigeon_list) { + static @NonNull PlatformCameraPosition fromList(@NonNull ArrayList pigeonVar_list) { PlatformCameraPosition pigeonResult = new PlatformCameraPosition(); - Object bearing = __pigeon_list.get(0); + Object bearing = pigeonVar_list.get(0); pigeonResult.setBearing((Double) bearing); - Object target = __pigeon_list.get(1); + Object target = pigeonVar_list.get(1); pigeonResult.setTarget((PlatformLatLng) target); - Object tilt = __pigeon_list.get(2); + Object tilt = pigeonVar_list.get(2); pigeonResult.setTilt((Double) tilt); - Object zoom = __pigeon_list.get(3); + Object zoom = pigeonVar_list.get(3); pigeonResult.setZoom((Double) zoom); return pigeonResult; } @@ -256,21 +312,22 @@ ArrayList toList() { */ public static final class PlatformCameraUpdate { /** - * The update data, as JSON. This should only be set from CameraUpdate.toJson, and the native - * code must interpret it according to the internal implementation details of the CameraUpdate - * class. + * This Object shall be any of the below classes prefixed with PlatformCameraUpdate. Each such + * class represents a different type of camera update, and each holds a different set of data, + * preventing the use of a single unified class. Pigeon does not support inheritance, which + * prevents a more strict type bound. See https://github.com/flutter/flutter/issues/117819. */ - private @NonNull Object json; + private @NonNull Object cameraUpdate; - public @NonNull Object getJson() { - return json; + public @NonNull Object getCameraUpdate() { + return cameraUpdate; } - public void setJson(@NonNull Object setterArg) { + public void setCameraUpdate(@NonNull Object setterArg) { if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"json\" is null."); + throw new IllegalStateException("Nonnull field \"cameraUpdate\" is null."); } - this.json = setterArg; + this.cameraUpdate = setterArg; } /** Constructor is non-public to enforce null safety; use Builder. */ @@ -285,171 +342,226 @@ public boolean equals(Object o) { return false; } PlatformCameraUpdate that = (PlatformCameraUpdate) o; - return json.equals(that.json); + return cameraUpdate.equals(that.cameraUpdate); } @Override public int hashCode() { - return Objects.hash(json); + return Objects.hash(cameraUpdate); } public static final class Builder { - private @Nullable Object json; + private @Nullable Object cameraUpdate; @CanIgnoreReturnValue - public @NonNull Builder setJson(@NonNull Object setterArg) { - this.json = setterArg; + public @NonNull Builder setCameraUpdate(@NonNull Object setterArg) { + this.cameraUpdate = setterArg; return this; } public @NonNull PlatformCameraUpdate build() { PlatformCameraUpdate pigeonReturn = new PlatformCameraUpdate(); - pigeonReturn.setJson(json); + pigeonReturn.setCameraUpdate(cameraUpdate); return pigeonReturn; } } @NonNull ArrayList toList() { - ArrayList toListResult = new ArrayList(1); - toListResult.add(json); + ArrayList toListResult = new ArrayList<>(1); + toListResult.add(cameraUpdate); return toListResult; } - static @NonNull PlatformCameraUpdate fromList(@NonNull ArrayList __pigeon_list) { + static @NonNull PlatformCameraUpdate fromList(@NonNull ArrayList pigeonVar_list) { PlatformCameraUpdate pigeonResult = new PlatformCameraUpdate(); - Object json = __pigeon_list.get(0); - pigeonResult.setJson(json); + Object cameraUpdate = pigeonVar_list.get(0); + pigeonResult.setCameraUpdate(cameraUpdate); return pigeonResult; } } /** - * Pigeon equivalent of the Circle class. + * Pigeon equivalent of NewCameraPosition * *

Generated class from Pigeon that represents data sent in messages. */ - public static final class PlatformCircle { - private @NonNull Boolean consumeTapEvents; + public static final class PlatformCameraUpdateNewCameraPosition { + private @NonNull PlatformCameraPosition cameraPosition; - public @NonNull Boolean getConsumeTapEvents() { - return consumeTapEvents; + public @NonNull PlatformCameraPosition getCameraPosition() { + return cameraPosition; } - public void setConsumeTapEvents(@NonNull Boolean setterArg) { + public void setCameraPosition(@NonNull PlatformCameraPosition setterArg) { if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"consumeTapEvents\" is null."); + throw new IllegalStateException("Nonnull field \"cameraPosition\" is null."); } - this.consumeTapEvents = setterArg; + this.cameraPosition = setterArg; } - private @NonNull Long fillColor; + /** Constructor is non-public to enforce null safety; use Builder. */ + PlatformCameraUpdateNewCameraPosition() {} - public @NonNull Long getFillColor() { - return fillColor; + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlatformCameraUpdateNewCameraPosition that = (PlatformCameraUpdateNewCameraPosition) o; + return cameraPosition.equals(that.cameraPosition); } - public void setFillColor(@NonNull Long setterArg) { - if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"fillColor\" is null."); - } - this.fillColor = setterArg; + @Override + public int hashCode() { + return Objects.hash(cameraPosition); } - private @NonNull Long strokeColor; + public static final class Builder { - public @NonNull Long getStrokeColor() { - return strokeColor; - } + private @Nullable PlatformCameraPosition cameraPosition; - public void setStrokeColor(@NonNull Long setterArg) { - if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"strokeColor\" is null."); + @CanIgnoreReturnValue + public @NonNull Builder setCameraPosition(@NonNull PlatformCameraPosition setterArg) { + this.cameraPosition = setterArg; + return this; } - this.strokeColor = setterArg; - } - private @NonNull Boolean visible; + public @NonNull PlatformCameraUpdateNewCameraPosition build() { + PlatformCameraUpdateNewCameraPosition pigeonReturn = + new PlatformCameraUpdateNewCameraPosition(); + pigeonReturn.setCameraPosition(cameraPosition); + return pigeonReturn; + } + } - public @NonNull Boolean getVisible() { - return visible; + @NonNull + ArrayList toList() { + ArrayList toListResult = new ArrayList<>(1); + toListResult.add(cameraPosition); + return toListResult; } - public void setVisible(@NonNull Boolean setterArg) { - if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"visible\" is null."); - } - this.visible = setterArg; + static @NonNull PlatformCameraUpdateNewCameraPosition fromList( + @NonNull ArrayList pigeonVar_list) { + PlatformCameraUpdateNewCameraPosition pigeonResult = + new PlatformCameraUpdateNewCameraPosition(); + Object cameraPosition = pigeonVar_list.get(0); + pigeonResult.setCameraPosition((PlatformCameraPosition) cameraPosition); + return pigeonResult; } + } - private @NonNull Long strokeWidth; + /** + * Pigeon equivalent of NewLatLng + * + *

Generated class from Pigeon that represents data sent in messages. + */ + public static final class PlatformCameraUpdateNewLatLng { + private @NonNull PlatformLatLng latLng; - public @NonNull Long getStrokeWidth() { - return strokeWidth; + public @NonNull PlatformLatLng getLatLng() { + return latLng; } - public void setStrokeWidth(@NonNull Long setterArg) { + public void setLatLng(@NonNull PlatformLatLng setterArg) { if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"strokeWidth\" is null."); + throw new IllegalStateException("Nonnull field \"latLng\" is null."); } - this.strokeWidth = setterArg; + this.latLng = setterArg; } - private @NonNull Double zIndex; + /** Constructor is non-public to enforce null safety; use Builder. */ + PlatformCameraUpdateNewLatLng() {} - public @NonNull Double getZIndex() { - return zIndex; + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlatformCameraUpdateNewLatLng that = (PlatformCameraUpdateNewLatLng) o; + return latLng.equals(that.latLng); } - public void setZIndex(@NonNull Double setterArg) { - if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"zIndex\" is null."); - } - this.zIndex = setterArg; + @Override + public int hashCode() { + return Objects.hash(latLng); } - private @NonNull PlatformLatLng center; + public static final class Builder { - public @NonNull PlatformLatLng getCenter() { - return center; - } + private @Nullable PlatformLatLng latLng; - public void setCenter(@NonNull PlatformLatLng setterArg) { - if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"center\" is null."); + @CanIgnoreReturnValue + public @NonNull Builder setLatLng(@NonNull PlatformLatLng setterArg) { + this.latLng = setterArg; + return this; + } + + public @NonNull PlatformCameraUpdateNewLatLng build() { + PlatformCameraUpdateNewLatLng pigeonReturn = new PlatformCameraUpdateNewLatLng(); + pigeonReturn.setLatLng(latLng); + return pigeonReturn; } - this.center = setterArg; } - private @NonNull Double radius; + @NonNull + ArrayList toList() { + ArrayList toListResult = new ArrayList<>(1); + toListResult.add(latLng); + return toListResult; + } - public @NonNull Double getRadius() { - return radius; + static @NonNull PlatformCameraUpdateNewLatLng fromList( + @NonNull ArrayList pigeonVar_list) { + PlatformCameraUpdateNewLatLng pigeonResult = new PlatformCameraUpdateNewLatLng(); + Object latLng = pigeonVar_list.get(0); + pigeonResult.setLatLng((PlatformLatLng) latLng); + return pigeonResult; } + } - public void setRadius(@NonNull Double setterArg) { + /** + * Pigeon equivalent of NewLatLngBounds + * + *

Generated class from Pigeon that represents data sent in messages. + */ + public static final class PlatformCameraUpdateNewLatLngBounds { + private @NonNull PlatformLatLngBounds bounds; + + public @NonNull PlatformLatLngBounds getBounds() { + return bounds; + } + + public void setBounds(@NonNull PlatformLatLngBounds setterArg) { if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"radius\" is null."); + throw new IllegalStateException("Nonnull field \"bounds\" is null."); } - this.radius = setterArg; + this.bounds = setterArg; } - private @NonNull String circleId; + private @NonNull Double padding; - public @NonNull String getCircleId() { - return circleId; + public @NonNull Double getPadding() { + return padding; } - public void setCircleId(@NonNull String setterArg) { + public void setPadding(@NonNull Double setterArg) { if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"circleId\" is null."); + throw new IllegalStateException("Nonnull field \"padding\" is null."); } - this.circleId = setterArg; + this.padding = setterArg; } /** Constructor is non-public to enforce null safety; use Builder. */ - PlatformCircle() {} + PlatformCameraUpdateNewLatLngBounds() {} @Override public boolean equals(Object o) { @@ -459,194 +571,192 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - PlatformCircle that = (PlatformCircle) o; - return consumeTapEvents.equals(that.consumeTapEvents) - && fillColor.equals(that.fillColor) - && strokeColor.equals(that.strokeColor) - && visible.equals(that.visible) - && strokeWidth.equals(that.strokeWidth) - && zIndex.equals(that.zIndex) - && center.equals(that.center) - && radius.equals(that.radius) - && circleId.equals(that.circleId); + PlatformCameraUpdateNewLatLngBounds that = (PlatformCameraUpdateNewLatLngBounds) o; + return bounds.equals(that.bounds) && padding.equals(that.padding); } @Override public int hashCode() { - return Objects.hash( - consumeTapEvents, - fillColor, - strokeColor, - visible, - strokeWidth, - zIndex, - center, - radius, - circleId); + return Objects.hash(bounds, padding); } public static final class Builder { - private @Nullable Boolean consumeTapEvents; + private @Nullable PlatformLatLngBounds bounds; @CanIgnoreReturnValue - public @NonNull Builder setConsumeTapEvents(@NonNull Boolean setterArg) { - this.consumeTapEvents = setterArg; + public @NonNull Builder setBounds(@NonNull PlatformLatLngBounds setterArg) { + this.bounds = setterArg; return this; } - private @Nullable Long fillColor; + private @Nullable Double padding; @CanIgnoreReturnValue - public @NonNull Builder setFillColor(@NonNull Long setterArg) { - this.fillColor = setterArg; + public @NonNull Builder setPadding(@NonNull Double setterArg) { + this.padding = setterArg; return this; } - private @Nullable Long strokeColor; - - @CanIgnoreReturnValue - public @NonNull Builder setStrokeColor(@NonNull Long setterArg) { - this.strokeColor = setterArg; - return this; + public @NonNull PlatformCameraUpdateNewLatLngBounds build() { + PlatformCameraUpdateNewLatLngBounds pigeonReturn = + new PlatformCameraUpdateNewLatLngBounds(); + pigeonReturn.setBounds(bounds); + pigeonReturn.setPadding(padding); + return pigeonReturn; } + } - private @Nullable Boolean visible; + @NonNull + ArrayList toList() { + ArrayList toListResult = new ArrayList<>(2); + toListResult.add(bounds); + toListResult.add(padding); + return toListResult; + } - @CanIgnoreReturnValue - public @NonNull Builder setVisible(@NonNull Boolean setterArg) { - this.visible = setterArg; - return this; - } + static @NonNull PlatformCameraUpdateNewLatLngBounds fromList( + @NonNull ArrayList pigeonVar_list) { + PlatformCameraUpdateNewLatLngBounds pigeonResult = new PlatformCameraUpdateNewLatLngBounds(); + Object bounds = pigeonVar_list.get(0); + pigeonResult.setBounds((PlatformLatLngBounds) bounds); + Object padding = pigeonVar_list.get(1); + pigeonResult.setPadding((Double) padding); + return pigeonResult; + } + } - private @Nullable Long strokeWidth; + /** + * Pigeon equivalent of NewLatLngZoom + * + *

Generated class from Pigeon that represents data sent in messages. + */ + public static final class PlatformCameraUpdateNewLatLngZoom { + private @NonNull PlatformLatLng latLng; - @CanIgnoreReturnValue - public @NonNull Builder setStrokeWidth(@NonNull Long setterArg) { - this.strokeWidth = setterArg; - return this; + public @NonNull PlatformLatLng getLatLng() { + return latLng; + } + + public void setLatLng(@NonNull PlatformLatLng setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"latLng\" is null."); } + this.latLng = setterArg; + } - private @Nullable Double zIndex; + private @NonNull Double zoom; - @CanIgnoreReturnValue - public @NonNull Builder setZIndex(@NonNull Double setterArg) { - this.zIndex = setterArg; - return this; + public @NonNull Double getZoom() { + return zoom; + } + + public void setZoom(@NonNull Double setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"zoom\" is null."); } + this.zoom = setterArg; + } - private @Nullable PlatformLatLng center; + /** Constructor is non-public to enforce null safety; use Builder. */ + PlatformCameraUpdateNewLatLngZoom() {} - @CanIgnoreReturnValue - public @NonNull Builder setCenter(@NonNull PlatformLatLng setterArg) { - this.center = setterArg; - return this; + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlatformCameraUpdateNewLatLngZoom that = (PlatformCameraUpdateNewLatLngZoom) o; + return latLng.equals(that.latLng) && zoom.equals(that.zoom); + } - private @Nullable Double radius; + @Override + public int hashCode() { + return Objects.hash(latLng, zoom); + } + + public static final class Builder { + + private @Nullable PlatformLatLng latLng; @CanIgnoreReturnValue - public @NonNull Builder setRadius(@NonNull Double setterArg) { - this.radius = setterArg; + public @NonNull Builder setLatLng(@NonNull PlatformLatLng setterArg) { + this.latLng = setterArg; return this; } - private @Nullable String circleId; + private @Nullable Double zoom; @CanIgnoreReturnValue - public @NonNull Builder setCircleId(@NonNull String setterArg) { - this.circleId = setterArg; + public @NonNull Builder setZoom(@NonNull Double setterArg) { + this.zoom = setterArg; return this; } - public @NonNull PlatformCircle build() { - PlatformCircle pigeonReturn = new PlatformCircle(); - pigeonReturn.setConsumeTapEvents(consumeTapEvents); - pigeonReturn.setFillColor(fillColor); - pigeonReturn.setStrokeColor(strokeColor); - pigeonReturn.setVisible(visible); - pigeonReturn.setStrokeWidth(strokeWidth); - pigeonReturn.setZIndex(zIndex); - pigeonReturn.setCenter(center); - pigeonReturn.setRadius(radius); - pigeonReturn.setCircleId(circleId); + public @NonNull PlatformCameraUpdateNewLatLngZoom build() { + PlatformCameraUpdateNewLatLngZoom pigeonReturn = new PlatformCameraUpdateNewLatLngZoom(); + pigeonReturn.setLatLng(latLng); + pigeonReturn.setZoom(zoom); return pigeonReturn; } } @NonNull ArrayList toList() { - ArrayList toListResult = new ArrayList(9); - toListResult.add(consumeTapEvents); - toListResult.add(fillColor); - toListResult.add(strokeColor); - toListResult.add(visible); - toListResult.add(strokeWidth); - toListResult.add(zIndex); - toListResult.add(center); - toListResult.add(radius); - toListResult.add(circleId); + ArrayList toListResult = new ArrayList<>(2); + toListResult.add(latLng); + toListResult.add(zoom); return toListResult; } - static @NonNull PlatformCircle fromList(@NonNull ArrayList __pigeon_list) { - PlatformCircle pigeonResult = new PlatformCircle(); - Object consumeTapEvents = __pigeon_list.get(0); - pigeonResult.setConsumeTapEvents((Boolean) consumeTapEvents); - Object fillColor = __pigeon_list.get(1); - pigeonResult.setFillColor( - (fillColor == null) - ? null - : ((fillColor instanceof Integer) ? (Integer) fillColor : (Long) fillColor)); - Object strokeColor = __pigeon_list.get(2); - pigeonResult.setStrokeColor( - (strokeColor == null) - ? null - : ((strokeColor instanceof Integer) ? (Integer) strokeColor : (Long) strokeColor)); - Object visible = __pigeon_list.get(3); - pigeonResult.setVisible((Boolean) visible); - Object strokeWidth = __pigeon_list.get(4); - pigeonResult.setStrokeWidth( - (strokeWidth == null) - ? null - : ((strokeWidth instanceof Integer) ? (Integer) strokeWidth : (Long) strokeWidth)); - Object zIndex = __pigeon_list.get(5); - pigeonResult.setZIndex((Double) zIndex); - Object center = __pigeon_list.get(6); - pigeonResult.setCenter((PlatformLatLng) center); - Object radius = __pigeon_list.get(7); - pigeonResult.setRadius((Double) radius); - Object circleId = __pigeon_list.get(8); - pigeonResult.setCircleId((String) circleId); + static @NonNull PlatformCameraUpdateNewLatLngZoom fromList( + @NonNull ArrayList pigeonVar_list) { + PlatformCameraUpdateNewLatLngZoom pigeonResult = new PlatformCameraUpdateNewLatLngZoom(); + Object latLng = pigeonVar_list.get(0); + pigeonResult.setLatLng((PlatformLatLng) latLng); + Object zoom = pigeonVar_list.get(1); + pigeonResult.setZoom((Double) zoom); return pigeonResult; } } /** - * Pigeon equivalent of the Heatmap class. + * Pigeon equivalent of ScrollBy * *

Generated class from Pigeon that represents data sent in messages. */ - public static final class PlatformHeatmap { - /** - * The heatmap data, as JSON. This should only be set from Heatmap.toJson, and the native code - * must interpret it according to the internal implementation details of that method. - */ - private @NonNull Map json; + public static final class PlatformCameraUpdateScrollBy { + private @NonNull Double dx; - public @NonNull Map getJson() { - return json; + public @NonNull Double getDx() { + return dx; } - public void setJson(@NonNull Map setterArg) { + public void setDx(@NonNull Double setterArg) { if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"json\" is null."); + throw new IllegalStateException("Nonnull field \"dx\" is null."); } - this.json = setterArg; + this.dx = setterArg; + } + + private @NonNull Double dy; + + public @NonNull Double getDy() { + return dy; + } + + public void setDy(@NonNull Double setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"dy\" is null."); + } + this.dy = setterArg; } /** Constructor is non-public to enforce null safety; use Builder. */ - PlatformHeatmap() {} + PlatformCameraUpdateScrollBy() {} @Override public boolean equals(Object o) { @@ -656,68 +766,91 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - PlatformHeatmap that = (PlatformHeatmap) o; - return json.equals(that.json); + PlatformCameraUpdateScrollBy that = (PlatformCameraUpdateScrollBy) o; + return dx.equals(that.dx) && dy.equals(that.dy); } @Override public int hashCode() { - return Objects.hash(json); + return Objects.hash(dx, dy); } public static final class Builder { - private @Nullable Map json; + private @Nullable Double dx; @CanIgnoreReturnValue - public @NonNull Builder setJson(@NonNull Map setterArg) { - this.json = setterArg; + public @NonNull Builder setDx(@NonNull Double setterArg) { + this.dx = setterArg; return this; } - public @NonNull PlatformHeatmap build() { - PlatformHeatmap pigeonReturn = new PlatformHeatmap(); - pigeonReturn.setJson(json); + private @Nullable Double dy; + + @CanIgnoreReturnValue + public @NonNull Builder setDy(@NonNull Double setterArg) { + this.dy = setterArg; + return this; + } + + public @NonNull PlatformCameraUpdateScrollBy build() { + PlatformCameraUpdateScrollBy pigeonReturn = new PlatformCameraUpdateScrollBy(); + pigeonReturn.setDx(dx); + pigeonReturn.setDy(dy); return pigeonReturn; } } @NonNull ArrayList toList() { - ArrayList toListResult = new ArrayList(1); - toListResult.add(json); + ArrayList toListResult = new ArrayList<>(2); + toListResult.add(dx); + toListResult.add(dy); return toListResult; } - static @NonNull PlatformHeatmap fromList(@NonNull ArrayList __pigeon_list) { - PlatformHeatmap pigeonResult = new PlatformHeatmap(); - Object json = __pigeon_list.get(0); - pigeonResult.setJson((Map) json); + static @NonNull PlatformCameraUpdateScrollBy fromList( + @NonNull ArrayList pigeonVar_list) { + PlatformCameraUpdateScrollBy pigeonResult = new PlatformCameraUpdateScrollBy(); + Object dx = pigeonVar_list.get(0); + pigeonResult.setDx((Double) dx); + Object dy = pigeonVar_list.get(1); + pigeonResult.setDy((Double) dy); return pigeonResult; } } /** - * Pigeon equivalent of the ClusterManager class. + * Pigeon equivalent of ZoomBy * *

Generated class from Pigeon that represents data sent in messages. */ - public static final class PlatformClusterManager { - private @NonNull String identifier; + public static final class PlatformCameraUpdateZoomBy { + private @NonNull Double amount; - public @NonNull String getIdentifier() { - return identifier; + public @NonNull Double getAmount() { + return amount; } - public void setIdentifier(@NonNull String setterArg) { + public void setAmount(@NonNull Double setterArg) { if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"identifier\" is null."); + throw new IllegalStateException("Nonnull field \"amount\" is null."); } - this.identifier = setterArg; + this.amount = setterArg; + } + + private @Nullable PlatformDoublePair focus; + + public @Nullable PlatformDoublePair getFocus() { + return focus; + } + + public void setFocus(@Nullable PlatformDoublePair setterArg) { + this.focus = setterArg; } /** Constructor is non-public to enforce null safety; use Builder. */ - PlatformClusterManager() {} + PlatformCameraUpdateZoomBy() {} @Override public boolean equals(Object o) { @@ -727,81 +860,80 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - PlatformClusterManager that = (PlatformClusterManager) o; - return identifier.equals(that.identifier); + PlatformCameraUpdateZoomBy that = (PlatformCameraUpdateZoomBy) o; + return amount.equals(that.amount) && Objects.equals(focus, that.focus); } @Override public int hashCode() { - return Objects.hash(identifier); + return Objects.hash(amount, focus); } public static final class Builder { - private @Nullable String identifier; + private @Nullable Double amount; @CanIgnoreReturnValue - public @NonNull Builder setIdentifier(@NonNull String setterArg) { - this.identifier = setterArg; + public @NonNull Builder setAmount(@NonNull Double setterArg) { + this.amount = setterArg; return this; } - public @NonNull PlatformClusterManager build() { - PlatformClusterManager pigeonReturn = new PlatformClusterManager(); - pigeonReturn.setIdentifier(identifier); + private @Nullable PlatformDoublePair focus; + + @CanIgnoreReturnValue + public @NonNull Builder setFocus(@Nullable PlatformDoublePair setterArg) { + this.focus = setterArg; + return this; + } + + public @NonNull PlatformCameraUpdateZoomBy build() { + PlatformCameraUpdateZoomBy pigeonReturn = new PlatformCameraUpdateZoomBy(); + pigeonReturn.setAmount(amount); + pigeonReturn.setFocus(focus); return pigeonReturn; } } @NonNull ArrayList toList() { - ArrayList toListResult = new ArrayList(1); - toListResult.add(identifier); + ArrayList toListResult = new ArrayList<>(2); + toListResult.add(amount); + toListResult.add(focus); return toListResult; } - static @NonNull PlatformClusterManager fromList(@NonNull ArrayList __pigeon_list) { - PlatformClusterManager pigeonResult = new PlatformClusterManager(); - Object identifier = __pigeon_list.get(0); - pigeonResult.setIdentifier((String) identifier); + static @NonNull PlatformCameraUpdateZoomBy fromList(@NonNull ArrayList pigeonVar_list) { + PlatformCameraUpdateZoomBy pigeonResult = new PlatformCameraUpdateZoomBy(); + Object amount = pigeonVar_list.get(0); + pigeonResult.setAmount((Double) amount); + Object focus = pigeonVar_list.get(1); + pigeonResult.setFocus((PlatformDoublePair) focus); return pigeonResult; } } /** - * Pigeon equivalent of the Offset class. + * Pigeon equivalent of ZoomIn/ZoomOut * *

Generated class from Pigeon that represents data sent in messages. */ - public static final class PlatformOffset { - private @NonNull Double dx; - - public @NonNull Double getDx() { - return dx; - } - - public void setDx(@NonNull Double setterArg) { - if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"dx\" is null."); - } - this.dx = setterArg; - } - - private @NonNull Double dy; + public static final class PlatformCameraUpdateZoom { + private @NonNull Boolean out; - public @NonNull Double getDy() { - return dy; + public @NonNull Boolean getOut() { + return out; } - public void setDy(@NonNull Double setterArg) { + public void setOut(@NonNull Boolean setterArg) { if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"dy\" is null."); + throw new IllegalStateException("Nonnull field \"out\" is null."); } - this.dy = setterArg; + this.out = setterArg; } /** Constructor is non-public to enforce null safety; use Builder. */ - PlatformOffset() {} + PlatformCameraUpdateZoom() {} @Override public boolean equals(Object o) { @@ -811,100 +943,68 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - PlatformOffset that = (PlatformOffset) o; - return dx.equals(that.dx) && dy.equals(that.dy); + PlatformCameraUpdateZoom that = (PlatformCameraUpdateZoom) o; + return out.equals(that.out); } @Override public int hashCode() { - return Objects.hash(dx, dy); + return Objects.hash(out); } public static final class Builder { - private @Nullable Double dx; - - @CanIgnoreReturnValue - public @NonNull Builder setDx(@NonNull Double setterArg) { - this.dx = setterArg; - return this; - } - - private @Nullable Double dy; + private @Nullable Boolean out; @CanIgnoreReturnValue - public @NonNull Builder setDy(@NonNull Double setterArg) { - this.dy = setterArg; + public @NonNull Builder setOut(@NonNull Boolean setterArg) { + this.out = setterArg; return this; } - public @NonNull PlatformOffset build() { - PlatformOffset pigeonReturn = new PlatformOffset(); - pigeonReturn.setDx(dx); - pigeonReturn.setDy(dy); + public @NonNull PlatformCameraUpdateZoom build() { + PlatformCameraUpdateZoom pigeonReturn = new PlatformCameraUpdateZoom(); + pigeonReturn.setOut(out); return pigeonReturn; } } @NonNull ArrayList toList() { - ArrayList toListResult = new ArrayList(2); - toListResult.add(dx); - toListResult.add(dy); + ArrayList toListResult = new ArrayList<>(1); + toListResult.add(out); return toListResult; } - static @NonNull PlatformOffset fromList(@NonNull ArrayList __pigeon_list) { - PlatformOffset pigeonResult = new PlatformOffset(); - Object dx = __pigeon_list.get(0); - pigeonResult.setDx((Double) dx); - Object dy = __pigeon_list.get(1); - pigeonResult.setDy((Double) dy); + static @NonNull PlatformCameraUpdateZoom fromList(@NonNull ArrayList pigeonVar_list) { + PlatformCameraUpdateZoom pigeonResult = new PlatformCameraUpdateZoom(); + Object out = pigeonVar_list.get(0); + pigeonResult.setOut((Boolean) out); return pigeonResult; } } /** - * Pigeon equivalent of the InfoWindow class. + * Pigeon equivalent of ZoomTo * *

Generated class from Pigeon that represents data sent in messages. */ - public static final class PlatformInfoWindow { - private @Nullable String title; - - public @Nullable String getTitle() { - return title; - } - - public void setTitle(@Nullable String setterArg) { - this.title = setterArg; - } - - private @Nullable String snippet; - - public @Nullable String getSnippet() { - return snippet; - } - - public void setSnippet(@Nullable String setterArg) { - this.snippet = setterArg; - } - - private @NonNull PlatformOffset anchor; + public static final class PlatformCameraUpdateZoomTo { + private @NonNull Double zoom; - public @NonNull PlatformOffset getAnchor() { - return anchor; + public @NonNull Double getZoom() { + return zoom; } - public void setAnchor(@NonNull PlatformOffset setterArg) { + public void setZoom(@NonNull Double setterArg) { if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"anchor\" is null."); + throw new IllegalStateException("Nonnull field \"zoom\" is null."); } - this.anchor = setterArg; + this.zoom = setterArg; } /** Constructor is non-public to enforce null safety; use Builder. */ - PlatformInfoWindow() {} + PlatformCameraUpdateZoomTo() {} @Override public boolean equals(Object o) { @@ -914,105 +1014,53 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - PlatformInfoWindow that = (PlatformInfoWindow) o; - return Objects.equals(title, that.title) - && Objects.equals(snippet, that.snippet) - && anchor.equals(that.anchor); + PlatformCameraUpdateZoomTo that = (PlatformCameraUpdateZoomTo) o; + return zoom.equals(that.zoom); } @Override public int hashCode() { - return Objects.hash(title, snippet, anchor); + return Objects.hash(zoom); } public static final class Builder { - private @Nullable String title; - - @CanIgnoreReturnValue - public @NonNull Builder setTitle(@Nullable String setterArg) { - this.title = setterArg; - return this; - } - - private @Nullable String snippet; - - @CanIgnoreReturnValue - public @NonNull Builder setSnippet(@Nullable String setterArg) { - this.snippet = setterArg; - return this; - } - - private @Nullable PlatformOffset anchor; + private @Nullable Double zoom; @CanIgnoreReturnValue - public @NonNull Builder setAnchor(@NonNull PlatformOffset setterArg) { - this.anchor = setterArg; + public @NonNull Builder setZoom(@NonNull Double setterArg) { + this.zoom = setterArg; return this; } - public @NonNull PlatformInfoWindow build() { - PlatformInfoWindow pigeonReturn = new PlatformInfoWindow(); - pigeonReturn.setTitle(title); - pigeonReturn.setSnippet(snippet); - pigeonReturn.setAnchor(anchor); + public @NonNull PlatformCameraUpdateZoomTo build() { + PlatformCameraUpdateZoomTo pigeonReturn = new PlatformCameraUpdateZoomTo(); + pigeonReturn.setZoom(zoom); return pigeonReturn; } } @NonNull ArrayList toList() { - ArrayList toListResult = new ArrayList(3); - toListResult.add(title); - toListResult.add(snippet); - toListResult.add(anchor); + ArrayList toListResult = new ArrayList<>(1); + toListResult.add(zoom); return toListResult; } - static @NonNull PlatformInfoWindow fromList(@NonNull ArrayList __pigeon_list) { - PlatformInfoWindow pigeonResult = new PlatformInfoWindow(); - Object title = __pigeon_list.get(0); - pigeonResult.setTitle((String) title); - Object snippet = __pigeon_list.get(1); - pigeonResult.setSnippet((String) snippet); - Object anchor = __pigeon_list.get(2); - pigeonResult.setAnchor((PlatformOffset) anchor); + static @NonNull PlatformCameraUpdateZoomTo fromList(@NonNull ArrayList pigeonVar_list) { + PlatformCameraUpdateZoomTo pigeonResult = new PlatformCameraUpdateZoomTo(); + Object zoom = pigeonVar_list.get(0); + pigeonResult.setZoom((Double) zoom); return pigeonResult; } } /** - * Pigeon equivalent of the Marker class. + * Pigeon equivalent of the Circle class. * *

Generated class from Pigeon that represents data sent in messages. */ - public static final class PlatformMarker { - private @NonNull Double alpha; - - public @NonNull Double getAlpha() { - return alpha; - } - - public void setAlpha(@NonNull Double setterArg) { - if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"alpha\" is null."); - } - this.alpha = setterArg; - } - - private @NonNull PlatformOffset anchor; - - public @NonNull PlatformOffset getAnchor() { - return anchor; - } - - public void setAnchor(@NonNull PlatformOffset setterArg) { - if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"anchor\" is null."); - } - this.anchor = setterArg; - } - + public static final class PlatformCircle { private @NonNull Boolean consumeTapEvents; public @NonNull Boolean getConsumeTapEvents() { @@ -1026,135 +1074,112 @@ public void setConsumeTapEvents(@NonNull Boolean setterArg) { this.consumeTapEvents = setterArg; } - private @NonNull Boolean draggable; - - public @NonNull Boolean getDraggable() { - return draggable; - } - - public void setDraggable(@NonNull Boolean setterArg) { - if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"draggable\" is null."); - } - this.draggable = setterArg; - } - - private @NonNull Boolean flat; + private @NonNull Long fillColor; - public @NonNull Boolean getFlat() { - return flat; + public @NonNull Long getFillColor() { + return fillColor; } - public void setFlat(@NonNull Boolean setterArg) { + public void setFillColor(@NonNull Long setterArg) { if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"flat\" is null."); + throw new IllegalStateException("Nonnull field \"fillColor\" is null."); } - this.flat = setterArg; + this.fillColor = setterArg; } - private @NonNull Object icon; + private @NonNull Long strokeColor; - public @NonNull Object getIcon() { - return icon; + public @NonNull Long getStrokeColor() { + return strokeColor; } - public void setIcon(@NonNull Object setterArg) { + public void setStrokeColor(@NonNull Long setterArg) { if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"icon\" is null."); + throw new IllegalStateException("Nonnull field \"strokeColor\" is null."); } - this.icon = setterArg; + this.strokeColor = setterArg; } - private @NonNull PlatformInfoWindow infoWindow; + private @NonNull Boolean visible; - public @NonNull PlatformInfoWindow getInfoWindow() { - return infoWindow; + public @NonNull Boolean getVisible() { + return visible; } - public void setInfoWindow(@NonNull PlatformInfoWindow setterArg) { + public void setVisible(@NonNull Boolean setterArg) { if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"infoWindow\" is null."); + throw new IllegalStateException("Nonnull field \"visible\" is null."); } - this.infoWindow = setterArg; + this.visible = setterArg; } - private @NonNull PlatformLatLng position; + private @NonNull Long strokeWidth; - public @NonNull PlatformLatLng getPosition() { - return position; + public @NonNull Long getStrokeWidth() { + return strokeWidth; } - public void setPosition(@NonNull PlatformLatLng setterArg) { + public void setStrokeWidth(@NonNull Long setterArg) { if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"position\" is null."); + throw new IllegalStateException("Nonnull field \"strokeWidth\" is null."); } - this.position = setterArg; + this.strokeWidth = setterArg; } - private @NonNull Double rotation; + private @NonNull Double zIndex; - public @NonNull Double getRotation() { - return rotation; + public @NonNull Double getZIndex() { + return zIndex; } - public void setRotation(@NonNull Double setterArg) { + public void setZIndex(@NonNull Double setterArg) { if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"rotation\" is null."); + throw new IllegalStateException("Nonnull field \"zIndex\" is null."); } - this.rotation = setterArg; + this.zIndex = setterArg; } - private @NonNull Boolean visible; + private @NonNull PlatformLatLng center; - public @NonNull Boolean getVisible() { - return visible; + public @NonNull PlatformLatLng getCenter() { + return center; } - public void setVisible(@NonNull Boolean setterArg) { + public void setCenter(@NonNull PlatformLatLng setterArg) { if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"visible\" is null."); + throw new IllegalStateException("Nonnull field \"center\" is null."); } - this.visible = setterArg; + this.center = setterArg; } - private @NonNull Double zIndex; + private @NonNull Double radius; - public @NonNull Double getZIndex() { - return zIndex; + public @NonNull Double getRadius() { + return radius; } - public void setZIndex(@NonNull Double setterArg) { + public void setRadius(@NonNull Double setterArg) { if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"zIndex\" is null."); + throw new IllegalStateException("Nonnull field \"radius\" is null."); } - this.zIndex = setterArg; + this.radius = setterArg; } - private @NonNull String markerId; + private @NonNull String circleId; - public @NonNull String getMarkerId() { - return markerId; + public @NonNull String getCircleId() { + return circleId; } - public void setMarkerId(@NonNull String setterArg) { + public void setCircleId(@NonNull String setterArg) { if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"markerId\" is null."); + throw new IllegalStateException("Nonnull field \"circleId\" is null."); } - this.markerId = setterArg; - } - - private @Nullable String clusterManagerId; - - public @Nullable String getClusterManagerId() { - return clusterManagerId; - } - - public void setClusterManagerId(@Nullable String setterArg) { - this.clusterManagerId = setterArg; + this.circleId = setterArg; } /** Constructor is non-public to enforce null safety; use Builder. */ - PlatformMarker() {} + PlatformCircle() {} @Override public boolean equals(Object o) { @@ -1164,58 +1189,34 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - PlatformMarker that = (PlatformMarker) o; - return alpha.equals(that.alpha) - && anchor.equals(that.anchor) - && consumeTapEvents.equals(that.consumeTapEvents) - && draggable.equals(that.draggable) - && flat.equals(that.flat) - && icon.equals(that.icon) - && infoWindow.equals(that.infoWindow) - && position.equals(that.position) - && rotation.equals(that.rotation) + PlatformCircle that = (PlatformCircle) o; + return consumeTapEvents.equals(that.consumeTapEvents) + && fillColor.equals(that.fillColor) + && strokeColor.equals(that.strokeColor) && visible.equals(that.visible) + && strokeWidth.equals(that.strokeWidth) && zIndex.equals(that.zIndex) - && markerId.equals(that.markerId) - && Objects.equals(clusterManagerId, that.clusterManagerId); + && center.equals(that.center) + && radius.equals(that.radius) + && circleId.equals(that.circleId); } @Override public int hashCode() { return Objects.hash( - alpha, - anchor, consumeTapEvents, - draggable, - flat, - icon, - infoWindow, - position, - rotation, + fillColor, + strokeColor, visible, + strokeWidth, zIndex, - markerId, - clusterManagerId); + center, + radius, + circleId); } public static final class Builder { - private @Nullable Double alpha; - - @CanIgnoreReturnValue - public @NonNull Builder setAlpha(@NonNull Double setterArg) { - this.alpha = setterArg; - return this; - } - - private @Nullable PlatformOffset anchor; - - @CanIgnoreReturnValue - public @NonNull Builder setAnchor(@NonNull PlatformOffset setterArg) { - this.anchor = setterArg; - return this; - } - private @Nullable Boolean consumeTapEvents; @CanIgnoreReturnValue @@ -1224,164 +1225,132 @@ public static final class Builder { return this; } - private @Nullable Boolean draggable; - - @CanIgnoreReturnValue - public @NonNull Builder setDraggable(@NonNull Boolean setterArg) { - this.draggable = setterArg; - return this; - } - - private @Nullable Boolean flat; + private @Nullable Long fillColor; @CanIgnoreReturnValue - public @NonNull Builder setFlat(@NonNull Boolean setterArg) { - this.flat = setterArg; + public @NonNull Builder setFillColor(@NonNull Long setterArg) { + this.fillColor = setterArg; return this; } - private @Nullable Object icon; + private @Nullable Long strokeColor; @CanIgnoreReturnValue - public @NonNull Builder setIcon(@NonNull Object setterArg) { - this.icon = setterArg; + public @NonNull Builder setStrokeColor(@NonNull Long setterArg) { + this.strokeColor = setterArg; return this; } - private @Nullable PlatformInfoWindow infoWindow; + private @Nullable Boolean visible; @CanIgnoreReturnValue - public @NonNull Builder setInfoWindow(@NonNull PlatformInfoWindow setterArg) { - this.infoWindow = setterArg; + public @NonNull Builder setVisible(@NonNull Boolean setterArg) { + this.visible = setterArg; return this; } - private @Nullable PlatformLatLng position; + private @Nullable Long strokeWidth; @CanIgnoreReturnValue - public @NonNull Builder setPosition(@NonNull PlatformLatLng setterArg) { - this.position = setterArg; + public @NonNull Builder setStrokeWidth(@NonNull Long setterArg) { + this.strokeWidth = setterArg; return this; } - private @Nullable Double rotation; + private @Nullable Double zIndex; @CanIgnoreReturnValue - public @NonNull Builder setRotation(@NonNull Double setterArg) { - this.rotation = setterArg; + public @NonNull Builder setZIndex(@NonNull Double setterArg) { + this.zIndex = setterArg; return this; } - private @Nullable Boolean visible; + private @Nullable PlatformLatLng center; @CanIgnoreReturnValue - public @NonNull Builder setVisible(@NonNull Boolean setterArg) { - this.visible = setterArg; + public @NonNull Builder setCenter(@NonNull PlatformLatLng setterArg) { + this.center = setterArg; return this; } - private @Nullable Double zIndex; + private @Nullable Double radius; @CanIgnoreReturnValue - public @NonNull Builder setZIndex(@NonNull Double setterArg) { - this.zIndex = setterArg; + public @NonNull Builder setRadius(@NonNull Double setterArg) { + this.radius = setterArg; return this; } - private @Nullable String markerId; + private @Nullable String circleId; @CanIgnoreReturnValue - public @NonNull Builder setMarkerId(@NonNull String setterArg) { - this.markerId = setterArg; + public @NonNull Builder setCircleId(@NonNull String setterArg) { + this.circleId = setterArg; return this; } - private @Nullable String clusterManagerId; - - @CanIgnoreReturnValue - public @NonNull Builder setClusterManagerId(@Nullable String setterArg) { - this.clusterManagerId = setterArg; - return this; - } - - public @NonNull PlatformMarker build() { - PlatformMarker pigeonReturn = new PlatformMarker(); - pigeonReturn.setAlpha(alpha); - pigeonReturn.setAnchor(anchor); + public @NonNull PlatformCircle build() { + PlatformCircle pigeonReturn = new PlatformCircle(); pigeonReturn.setConsumeTapEvents(consumeTapEvents); - pigeonReturn.setDraggable(draggable); - pigeonReturn.setFlat(flat); - pigeonReturn.setIcon(icon); - pigeonReturn.setInfoWindow(infoWindow); - pigeonReturn.setPosition(position); - pigeonReturn.setRotation(rotation); + pigeonReturn.setFillColor(fillColor); + pigeonReturn.setStrokeColor(strokeColor); pigeonReturn.setVisible(visible); + pigeonReturn.setStrokeWidth(strokeWidth); pigeonReturn.setZIndex(zIndex); - pigeonReturn.setMarkerId(markerId); - pigeonReturn.setClusterManagerId(clusterManagerId); + pigeonReturn.setCenter(center); + pigeonReturn.setRadius(radius); + pigeonReturn.setCircleId(circleId); return pigeonReturn; } } @NonNull ArrayList toList() { - ArrayList toListResult = new ArrayList(13); - toListResult.add(alpha); - toListResult.add(anchor); + ArrayList toListResult = new ArrayList<>(9); toListResult.add(consumeTapEvents); - toListResult.add(draggable); - toListResult.add(flat); - toListResult.add(icon); - toListResult.add(infoWindow); - toListResult.add(position); - toListResult.add(rotation); + toListResult.add(fillColor); + toListResult.add(strokeColor); toListResult.add(visible); + toListResult.add(strokeWidth); toListResult.add(zIndex); - toListResult.add(markerId); - toListResult.add(clusterManagerId); + toListResult.add(center); + toListResult.add(radius); + toListResult.add(circleId); return toListResult; } - static @NonNull PlatformMarker fromList(@NonNull ArrayList __pigeon_list) { - PlatformMarker pigeonResult = new PlatformMarker(); - Object alpha = __pigeon_list.get(0); - pigeonResult.setAlpha((Double) alpha); - Object anchor = __pigeon_list.get(1); - pigeonResult.setAnchor((PlatformOffset) anchor); - Object consumeTapEvents = __pigeon_list.get(2); + static @NonNull PlatformCircle fromList(@NonNull ArrayList pigeonVar_list) { + PlatformCircle pigeonResult = new PlatformCircle(); + Object consumeTapEvents = pigeonVar_list.get(0); pigeonResult.setConsumeTapEvents((Boolean) consumeTapEvents); - Object draggable = __pigeon_list.get(3); - pigeonResult.setDraggable((Boolean) draggable); - Object flat = __pigeon_list.get(4); - pigeonResult.setFlat((Boolean) flat); - Object icon = __pigeon_list.get(5); - pigeonResult.setIcon(icon); - Object infoWindow = __pigeon_list.get(6); - pigeonResult.setInfoWindow((PlatformInfoWindow) infoWindow); - Object position = __pigeon_list.get(7); - pigeonResult.setPosition((PlatformLatLng) position); - Object rotation = __pigeon_list.get(8); - pigeonResult.setRotation((Double) rotation); - Object visible = __pigeon_list.get(9); + Object fillColor = pigeonVar_list.get(1); + pigeonResult.setFillColor((Long) fillColor); + Object strokeColor = pigeonVar_list.get(2); + pigeonResult.setStrokeColor((Long) strokeColor); + Object visible = pigeonVar_list.get(3); pigeonResult.setVisible((Boolean) visible); - Object zIndex = __pigeon_list.get(10); + Object strokeWidth = pigeonVar_list.get(4); + pigeonResult.setStrokeWidth((Long) strokeWidth); + Object zIndex = pigeonVar_list.get(5); pigeonResult.setZIndex((Double) zIndex); - Object markerId = __pigeon_list.get(11); - pigeonResult.setMarkerId((String) markerId); - Object clusterManagerId = __pigeon_list.get(12); - pigeonResult.setClusterManagerId((String) clusterManagerId); + Object center = pigeonVar_list.get(6); + pigeonResult.setCenter((PlatformLatLng) center); + Object radius = pigeonVar_list.get(7); + pigeonResult.setRadius((Double) radius); + Object circleId = pigeonVar_list.get(8); + pigeonResult.setCircleId((String) circleId); return pigeonResult; } } /** - * Pigeon equivalent of the Polygon class. + * Pigeon equivalent of the Heatmap class. * *

Generated class from Pigeon that represents data sent in messages. */ - public static final class PlatformPolygon { + public static final class PlatformHeatmap { /** - * The polygon data, as JSON. This should only be set from Polygon.toJson, and the native code + * The heatmap data, as JSON. This should only be set from Heatmap.toJson, and the native code * must interpret it according to the internal implementation details of that method. */ private @NonNull Map json; @@ -1398,7 +1367,7 @@ public void setJson(@NonNull Map setterArg) { } /** Constructor is non-public to enforce null safety; use Builder. */ - PlatformPolygon() {} + PlatformHeatmap() {} @Override public boolean equals(Object o) { @@ -1408,7 +1377,7 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - PlatformPolygon that = (PlatformPolygon) o; + PlatformHeatmap that = (PlatformHeatmap) o; return json.equals(that.json); } @@ -1427,8 +1396,8 @@ public static final class Builder { return this; } - public @NonNull PlatformPolygon build() { - PlatformPolygon pigeonReturn = new PlatformPolygon(); + public @NonNull PlatformHeatmap build() { + PlatformHeatmap pigeonReturn = new PlatformHeatmap(); pigeonReturn.setJson(json); return pigeonReturn; } @@ -1436,44 +1405,40 @@ public static final class Builder { @NonNull ArrayList toList() { - ArrayList toListResult = new ArrayList(1); + ArrayList toListResult = new ArrayList<>(1); toListResult.add(json); return toListResult; } - static @NonNull PlatformPolygon fromList(@NonNull ArrayList __pigeon_list) { - PlatformPolygon pigeonResult = new PlatformPolygon(); - Object json = __pigeon_list.get(0); + static @NonNull PlatformHeatmap fromList(@NonNull ArrayList pigeonVar_list) { + PlatformHeatmap pigeonResult = new PlatformHeatmap(); + Object json = pigeonVar_list.get(0); pigeonResult.setJson((Map) json); return pigeonResult; } } /** - * Pigeon equivalent of the Polyline class. + * Pigeon equivalent of the ClusterManager class. * *

Generated class from Pigeon that represents data sent in messages. */ - public static final class PlatformPolyline { - /** - * The polyline data, as JSON. This should only be set from Polyline.toJson, and the native code - * must interpret it according to the internal implementation details of that method. - */ - private @NonNull Map json; + public static final class PlatformClusterManager { + private @NonNull String identifier; - public @NonNull Map getJson() { - return json; + public @NonNull String getIdentifier() { + return identifier; } - public void setJson(@NonNull Map setterArg) { + public void setIdentifier(@NonNull String setterArg) { if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"json\" is null."); + throw new IllegalStateException("Nonnull field \"identifier\" is null."); } - this.json = setterArg; + this.identifier = setterArg; } /** Constructor is non-public to enforce null safety; use Builder. */ - PlatformPolyline() {} + PlatformClusterManager() {} @Override public boolean equals(Object o) { @@ -1483,91 +1448,81 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - PlatformPolyline that = (PlatformPolyline) o; - return json.equals(that.json); + PlatformClusterManager that = (PlatformClusterManager) o; + return identifier.equals(that.identifier); } @Override public int hashCode() { - return Objects.hash(json); + return Objects.hash(identifier); } public static final class Builder { - private @Nullable Map json; + private @Nullable String identifier; @CanIgnoreReturnValue - public @NonNull Builder setJson(@NonNull Map setterArg) { - this.json = setterArg; + public @NonNull Builder setIdentifier(@NonNull String setterArg) { + this.identifier = setterArg; return this; } - public @NonNull PlatformPolyline build() { - PlatformPolyline pigeonReturn = new PlatformPolyline(); - pigeonReturn.setJson(json); + public @NonNull PlatformClusterManager build() { + PlatformClusterManager pigeonReturn = new PlatformClusterManager(); + pigeonReturn.setIdentifier(identifier); return pigeonReturn; } } @NonNull ArrayList toList() { - ArrayList toListResult = new ArrayList(1); - toListResult.add(json); + ArrayList toListResult = new ArrayList<>(1); + toListResult.add(identifier); return toListResult; } - static @NonNull PlatformPolyline fromList(@NonNull ArrayList __pigeon_list) { - PlatformPolyline pigeonResult = new PlatformPolyline(); - Object json = __pigeon_list.get(0); - pigeonResult.setJson((Map) json); + static @NonNull PlatformClusterManager fromList(@NonNull ArrayList pigeonVar_list) { + PlatformClusterManager pigeonResult = new PlatformClusterManager(); + Object identifier = pigeonVar_list.get(0); + pigeonResult.setIdentifier((String) identifier); return pigeonResult; } } /** - * Pigeon equivalent of the Tile class. + * Pair of double values, such as for an offset or size. * *

Generated class from Pigeon that represents data sent in messages. */ - public static final class PlatformTile { - private @NonNull Long width; + public static final class PlatformDoublePair { + private @NonNull Double x; - public @NonNull Long getWidth() { - return width; + public @NonNull Double getX() { + return x; } - public void setWidth(@NonNull Long setterArg) { + public void setX(@NonNull Double setterArg) { if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"width\" is null."); + throw new IllegalStateException("Nonnull field \"x\" is null."); } - this.width = setterArg; + this.x = setterArg; } - private @NonNull Long height; + private @NonNull Double y; - public @NonNull Long getHeight() { - return height; + public @NonNull Double getY() { + return y; } - public void setHeight(@NonNull Long setterArg) { + public void setY(@NonNull Double setterArg) { if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"height\" is null."); + throw new IllegalStateException("Nonnull field \"y\" is null."); } - this.height = setterArg; - } - - private @Nullable byte[] data; - - public @Nullable byte[] getData() { - return data; - } - - public void setData(@Nullable byte[] setterArg) { - this.data = setterArg; + this.y = setterArg; } /** Constructor is non-public to enforce null safety; use Builder. */ - PlatformTile() {} + PlatformDoublePair() {} @Override public boolean equals(Object o) { @@ -1577,105 +1532,100 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - PlatformTile that = (PlatformTile) o; - return width.equals(that.width) - && height.equals(that.height) - && Arrays.equals(data, that.data); + PlatformDoublePair that = (PlatformDoublePair) o; + return x.equals(that.x) && y.equals(that.y); } @Override public int hashCode() { - int __pigeon_result = Objects.hash(width, height); - __pigeon_result = 31 * __pigeon_result + Arrays.hashCode(data); - return __pigeon_result; + return Objects.hash(x, y); } public static final class Builder { - private @Nullable Long width; - - @CanIgnoreReturnValue - public @NonNull Builder setWidth(@NonNull Long setterArg) { - this.width = setterArg; - return this; - } - - private @Nullable Long height; + private @Nullable Double x; @CanIgnoreReturnValue - public @NonNull Builder setHeight(@NonNull Long setterArg) { - this.height = setterArg; + public @NonNull Builder setX(@NonNull Double setterArg) { + this.x = setterArg; return this; } - private @Nullable byte[] data; + private @Nullable Double y; @CanIgnoreReturnValue - public @NonNull Builder setData(@Nullable byte[] setterArg) { - this.data = setterArg; + public @NonNull Builder setY(@NonNull Double setterArg) { + this.y = setterArg; return this; } - public @NonNull PlatformTile build() { - PlatformTile pigeonReturn = new PlatformTile(); - pigeonReturn.setWidth(width); - pigeonReturn.setHeight(height); - pigeonReturn.setData(data); + public @NonNull PlatformDoublePair build() { + PlatformDoublePair pigeonReturn = new PlatformDoublePair(); + pigeonReturn.setX(x); + pigeonReturn.setY(y); return pigeonReturn; } } @NonNull ArrayList toList() { - ArrayList toListResult = new ArrayList(3); - toListResult.add(width); - toListResult.add(height); - toListResult.add(data); + ArrayList toListResult = new ArrayList<>(2); + toListResult.add(x); + toListResult.add(y); return toListResult; } - static @NonNull PlatformTile fromList(@NonNull ArrayList __pigeon_list) { - PlatformTile pigeonResult = new PlatformTile(); - Object width = __pigeon_list.get(0); - pigeonResult.setWidth( - (width == null) ? null : ((width instanceof Integer) ? (Integer) width : (Long) width)); - Object height = __pigeon_list.get(1); - pigeonResult.setHeight( - (height == null) - ? null - : ((height instanceof Integer) ? (Integer) height : (Long) height)); - Object data = __pigeon_list.get(2); - pigeonResult.setData((byte[]) data); + static @NonNull PlatformDoublePair fromList(@NonNull ArrayList pigeonVar_list) { + PlatformDoublePair pigeonResult = new PlatformDoublePair(); + Object x = pigeonVar_list.get(0); + pigeonResult.setX((Double) x); + Object y = pigeonVar_list.get(1); + pigeonResult.setY((Double) y); return pigeonResult; } } /** - * Pigeon equivalent of the TileOverlay class. + * Pigeon equivalent of the InfoWindow class. * *

Generated class from Pigeon that represents data sent in messages. */ - public static final class PlatformTileOverlay { - /** - * The tile overlay data, as JSON. This should only be set from TileOverlay.toJson, and the - * native code must interpret it according to the internal implementation details of that - * method. - */ - private @NonNull Map json; + public static final class PlatformInfoWindow { + private @Nullable String title; - public @NonNull Map getJson() { - return json; + public @Nullable String getTitle() { + return title; } - public void setJson(@NonNull Map setterArg) { + public void setTitle(@Nullable String setterArg) { + this.title = setterArg; + } + + private @Nullable String snippet; + + public @Nullable String getSnippet() { + return snippet; + } + + public void setSnippet(@Nullable String setterArg) { + this.snippet = setterArg; + } + + private @NonNull PlatformDoublePair anchor; + + public @NonNull PlatformDoublePair getAnchor() { + return anchor; + } + + public void setAnchor(@NonNull PlatformDoublePair setterArg) { if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"json\" is null."); + throw new IllegalStateException("Nonnull field \"anchor\" is null."); } - this.json = setterArg; + this.anchor = setterArg; } /** Constructor is non-public to enforce null safety; use Builder. */ - PlatformTileOverlay() {} + PlatformInfoWindow() {} @Override public boolean equals(Object o) { @@ -1685,230 +1635,247 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - PlatformTileOverlay that = (PlatformTileOverlay) o; - return json.equals(that.json); + PlatformInfoWindow that = (PlatformInfoWindow) o; + return Objects.equals(title, that.title) + && Objects.equals(snippet, that.snippet) + && anchor.equals(that.anchor); } @Override public int hashCode() { - return Objects.hash(json); + return Objects.hash(title, snippet, anchor); } public static final class Builder { - private @Nullable Map json; + private @Nullable String title; @CanIgnoreReturnValue - public @NonNull Builder setJson(@NonNull Map setterArg) { - this.json = setterArg; + public @NonNull Builder setTitle(@Nullable String setterArg) { + this.title = setterArg; return this; } - public @NonNull PlatformTileOverlay build() { - PlatformTileOverlay pigeonReturn = new PlatformTileOverlay(); - pigeonReturn.setJson(json); + private @Nullable String snippet; + + @CanIgnoreReturnValue + public @NonNull Builder setSnippet(@Nullable String setterArg) { + this.snippet = setterArg; + return this; + } + + private @Nullable PlatformDoublePair anchor; + + @CanIgnoreReturnValue + public @NonNull Builder setAnchor(@NonNull PlatformDoublePair setterArg) { + this.anchor = setterArg; + return this; + } + + public @NonNull PlatformInfoWindow build() { + PlatformInfoWindow pigeonReturn = new PlatformInfoWindow(); + pigeonReturn.setTitle(title); + pigeonReturn.setSnippet(snippet); + pigeonReturn.setAnchor(anchor); return pigeonReturn; } } @NonNull ArrayList toList() { - ArrayList toListResult = new ArrayList(1); - toListResult.add(json); - return toListResult; + ArrayList toListResult = new ArrayList<>(3); + toListResult.add(title); + toListResult.add(snippet); + toListResult.add(anchor); + return toListResult; } - static @NonNull PlatformTileOverlay fromList(@NonNull ArrayList __pigeon_list) { - PlatformTileOverlay pigeonResult = new PlatformTileOverlay(); - Object json = __pigeon_list.get(0); - pigeonResult.setJson((Map) json); + static @NonNull PlatformInfoWindow fromList(@NonNull ArrayList pigeonVar_list) { + PlatformInfoWindow pigeonResult = new PlatformInfoWindow(); + Object title = pigeonVar_list.get(0); + pigeonResult.setTitle((String) title); + Object snippet = pigeonVar_list.get(1); + pigeonResult.setSnippet((String) snippet); + Object anchor = pigeonVar_list.get(2); + pigeonResult.setAnchor((PlatformDoublePair) anchor); return pigeonResult; } } /** - * Pigeon equivalent of Flutter's EdgeInsets. + * Pigeon equivalent of the Marker class. * *

Generated class from Pigeon that represents data sent in messages. */ - public static final class PlatformEdgeInsets { - private @NonNull Double top; + public static final class PlatformMarker { + private @NonNull Double alpha; - public @NonNull Double getTop() { - return top; + public @NonNull Double getAlpha() { + return alpha; } - public void setTop(@NonNull Double setterArg) { + public void setAlpha(@NonNull Double setterArg) { if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"top\" is null."); + throw new IllegalStateException("Nonnull field \"alpha\" is null."); } - this.top = setterArg; + this.alpha = setterArg; } - private @NonNull Double bottom; + private @NonNull PlatformDoublePair anchor; - public @NonNull Double getBottom() { - return bottom; + public @NonNull PlatformDoublePair getAnchor() { + return anchor; } - public void setBottom(@NonNull Double setterArg) { + public void setAnchor(@NonNull PlatformDoublePair setterArg) { if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"bottom\" is null."); + throw new IllegalStateException("Nonnull field \"anchor\" is null."); } - this.bottom = setterArg; + this.anchor = setterArg; } - private @NonNull Double left; + private @NonNull Boolean consumeTapEvents; - public @NonNull Double getLeft() { - return left; + public @NonNull Boolean getConsumeTapEvents() { + return consumeTapEvents; } - public void setLeft(@NonNull Double setterArg) { + public void setConsumeTapEvents(@NonNull Boolean setterArg) { if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"left\" is null."); + throw new IllegalStateException("Nonnull field \"consumeTapEvents\" is null."); } - this.left = setterArg; + this.consumeTapEvents = setterArg; } - private @NonNull Double right; + private @NonNull Boolean draggable; - public @NonNull Double getRight() { - return right; + public @NonNull Boolean getDraggable() { + return draggable; } - public void setRight(@NonNull Double setterArg) { + public void setDraggable(@NonNull Boolean setterArg) { if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"right\" is null."); + throw new IllegalStateException("Nonnull field \"draggable\" is null."); } - this.right = setterArg; + this.draggable = setterArg; } - /** Constructor is non-public to enforce null safety; use Builder. */ - PlatformEdgeInsets() {} + private @NonNull Boolean flat; - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - PlatformEdgeInsets that = (PlatformEdgeInsets) o; - return top.equals(that.top) - && bottom.equals(that.bottom) - && left.equals(that.left) - && right.equals(that.right); + public @NonNull Boolean getFlat() { + return flat; } - @Override - public int hashCode() { - return Objects.hash(top, bottom, left, right); + public void setFlat(@NonNull Boolean setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"flat\" is null."); + } + this.flat = setterArg; } - public static final class Builder { + private @NonNull PlatformBitmap icon; - private @Nullable Double top; + public @NonNull PlatformBitmap getIcon() { + return icon; + } - @CanIgnoreReturnValue - public @NonNull Builder setTop(@NonNull Double setterArg) { - this.top = setterArg; - return this; + public void setIcon(@NonNull PlatformBitmap setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"icon\" is null."); } + this.icon = setterArg; + } - private @Nullable Double bottom; + private @NonNull PlatformInfoWindow infoWindow; - @CanIgnoreReturnValue - public @NonNull Builder setBottom(@NonNull Double setterArg) { - this.bottom = setterArg; - return this; + public @NonNull PlatformInfoWindow getInfoWindow() { + return infoWindow; + } + + public void setInfoWindow(@NonNull PlatformInfoWindow setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"infoWindow\" is null."); } + this.infoWindow = setterArg; + } - private @Nullable Double left; + private @NonNull PlatformLatLng position; - @CanIgnoreReturnValue - public @NonNull Builder setLeft(@NonNull Double setterArg) { - this.left = setterArg; - return this; + public @NonNull PlatformLatLng getPosition() { + return position; + } + + public void setPosition(@NonNull PlatformLatLng setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"position\" is null."); } + this.position = setterArg; + } - private @Nullable Double right; + private @NonNull Double rotation; - @CanIgnoreReturnValue - public @NonNull Builder setRight(@NonNull Double setterArg) { - this.right = setterArg; - return this; - } + public @NonNull Double getRotation() { + return rotation; + } - public @NonNull PlatformEdgeInsets build() { - PlatformEdgeInsets pigeonReturn = new PlatformEdgeInsets(); - pigeonReturn.setTop(top); - pigeonReturn.setBottom(bottom); - pigeonReturn.setLeft(left); - pigeonReturn.setRight(right); - return pigeonReturn; + public void setRotation(@NonNull Double setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"rotation\" is null."); } + this.rotation = setterArg; } - @NonNull - ArrayList toList() { - ArrayList toListResult = new ArrayList(4); - toListResult.add(top); - toListResult.add(bottom); - toListResult.add(left); - toListResult.add(right); - return toListResult; + private @NonNull Boolean visible; + + public @NonNull Boolean getVisible() { + return visible; } - static @NonNull PlatformEdgeInsets fromList(@NonNull ArrayList __pigeon_list) { - PlatformEdgeInsets pigeonResult = new PlatformEdgeInsets(); - Object top = __pigeon_list.get(0); - pigeonResult.setTop((Double) top); - Object bottom = __pigeon_list.get(1); - pigeonResult.setBottom((Double) bottom); - Object left = __pigeon_list.get(2); - pigeonResult.setLeft((Double) left); - Object right = __pigeon_list.get(3); - pigeonResult.setRight((Double) right); - return pigeonResult; + public void setVisible(@NonNull Boolean setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"visible\" is null."); + } + this.visible = setterArg; } - } - /** - * Pigeon equivalent of LatLng. - * - *

Generated class from Pigeon that represents data sent in messages. - */ - public static final class PlatformLatLng { - private @NonNull Double latitude; + private @NonNull Double zIndex; - public @NonNull Double getLatitude() { - return latitude; + public @NonNull Double getZIndex() { + return zIndex; } - public void setLatitude(@NonNull Double setterArg) { + public void setZIndex(@NonNull Double setterArg) { if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"latitude\" is null."); + throw new IllegalStateException("Nonnull field \"zIndex\" is null."); } - this.latitude = setterArg; + this.zIndex = setterArg; } - private @NonNull Double longitude; + private @NonNull String markerId; - public @NonNull Double getLongitude() { - return longitude; + public @NonNull String getMarkerId() { + return markerId; } - public void setLongitude(@NonNull Double setterArg) { + public void setMarkerId(@NonNull String setterArg) { if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"longitude\" is null."); + throw new IllegalStateException("Nonnull field \"markerId\" is null."); } - this.longitude = setterArg; + this.markerId = setterArg; + } + + private @Nullable String clusterManagerId; + + public @Nullable String getClusterManagerId() { + return clusterManagerId; + } + + public void setClusterManagerId(@Nullable String setterArg) { + this.clusterManagerId = setterArg; } /** Constructor is non-public to enforce null safety; use Builder. */ - PlatformLatLng() {} + PlatformMarker() {} @Override public boolean equals(Object o) { @@ -1918,323 +1885,355 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - PlatformLatLng that = (PlatformLatLng) o; - return latitude.equals(that.latitude) && longitude.equals(that.longitude); + PlatformMarker that = (PlatformMarker) o; + return alpha.equals(that.alpha) + && anchor.equals(that.anchor) + && consumeTapEvents.equals(that.consumeTapEvents) + && draggable.equals(that.draggable) + && flat.equals(that.flat) + && icon.equals(that.icon) + && infoWindow.equals(that.infoWindow) + && position.equals(that.position) + && rotation.equals(that.rotation) + && visible.equals(that.visible) + && zIndex.equals(that.zIndex) + && markerId.equals(that.markerId) + && Objects.equals(clusterManagerId, that.clusterManagerId); } @Override public int hashCode() { - return Objects.hash(latitude, longitude); + return Objects.hash( + alpha, + anchor, + consumeTapEvents, + draggable, + flat, + icon, + infoWindow, + position, + rotation, + visible, + zIndex, + markerId, + clusterManagerId); } public static final class Builder { - private @Nullable Double latitude; + private @Nullable Double alpha; @CanIgnoreReturnValue - public @NonNull Builder setLatitude(@NonNull Double setterArg) { - this.latitude = setterArg; + public @NonNull Builder setAlpha(@NonNull Double setterArg) { + this.alpha = setterArg; return this; } - private @Nullable Double longitude; + private @Nullable PlatformDoublePair anchor; @CanIgnoreReturnValue - public @NonNull Builder setLongitude(@NonNull Double setterArg) { - this.longitude = setterArg; + public @NonNull Builder setAnchor(@NonNull PlatformDoublePair setterArg) { + this.anchor = setterArg; return this; } - public @NonNull PlatformLatLng build() { - PlatformLatLng pigeonReturn = new PlatformLatLng(); - pigeonReturn.setLatitude(latitude); - pigeonReturn.setLongitude(longitude); - return pigeonReturn; + private @Nullable Boolean consumeTapEvents; + + @CanIgnoreReturnValue + public @NonNull Builder setConsumeTapEvents(@NonNull Boolean setterArg) { + this.consumeTapEvents = setterArg; + return this; } - } - @NonNull - ArrayList toList() { - ArrayList toListResult = new ArrayList(2); - toListResult.add(latitude); - toListResult.add(longitude); - return toListResult; - } + private @Nullable Boolean draggable; - static @NonNull PlatformLatLng fromList(@NonNull ArrayList __pigeon_list) { - PlatformLatLng pigeonResult = new PlatformLatLng(); - Object latitude = __pigeon_list.get(0); - pigeonResult.setLatitude((Double) latitude); - Object longitude = __pigeon_list.get(1); - pigeonResult.setLongitude((Double) longitude); - return pigeonResult; - } - } + @CanIgnoreReturnValue + public @NonNull Builder setDraggable(@NonNull Boolean setterArg) { + this.draggable = setterArg; + return this; + } - /** - * Pigeon equivalent of LatLngBounds. - * - *

Generated class from Pigeon that represents data sent in messages. - */ - public static final class PlatformLatLngBounds { - private @NonNull PlatformLatLng northeast; + private @Nullable Boolean flat; - public @NonNull PlatformLatLng getNortheast() { - return northeast; - } + @CanIgnoreReturnValue + public @NonNull Builder setFlat(@NonNull Boolean setterArg) { + this.flat = setterArg; + return this; + } - public void setNortheast(@NonNull PlatformLatLng setterArg) { - if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"northeast\" is null."); + private @Nullable PlatformBitmap icon; + + @CanIgnoreReturnValue + public @NonNull Builder setIcon(@NonNull PlatformBitmap setterArg) { + this.icon = setterArg; + return this; } - this.northeast = setterArg; - } - private @NonNull PlatformLatLng southwest; + private @Nullable PlatformInfoWindow infoWindow; - public @NonNull PlatformLatLng getSouthwest() { - return southwest; - } + @CanIgnoreReturnValue + public @NonNull Builder setInfoWindow(@NonNull PlatformInfoWindow setterArg) { + this.infoWindow = setterArg; + return this; + } - public void setSouthwest(@NonNull PlatformLatLng setterArg) { - if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"southwest\" is null."); + private @Nullable PlatformLatLng position; + + @CanIgnoreReturnValue + public @NonNull Builder setPosition(@NonNull PlatformLatLng setterArg) { + this.position = setterArg; + return this; } - this.southwest = setterArg; - } - /** Constructor is non-public to enforce null safety; use Builder. */ - PlatformLatLngBounds() {} + private @Nullable Double rotation; - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @CanIgnoreReturnValue + public @NonNull Builder setRotation(@NonNull Double setterArg) { + this.rotation = setterArg; + return this; } - if (o == null || getClass() != o.getClass()) { - return false; + + private @Nullable Boolean visible; + + @CanIgnoreReturnValue + public @NonNull Builder setVisible(@NonNull Boolean setterArg) { + this.visible = setterArg; + return this; } - PlatformLatLngBounds that = (PlatformLatLngBounds) o; - return northeast.equals(that.northeast) && southwest.equals(that.southwest); - } - @Override - public int hashCode() { - return Objects.hash(northeast, southwest); - } + private @Nullable Double zIndex; - public static final class Builder { + @CanIgnoreReturnValue + public @NonNull Builder setZIndex(@NonNull Double setterArg) { + this.zIndex = setterArg; + return this; + } - private @Nullable PlatformLatLng northeast; + private @Nullable String markerId; @CanIgnoreReturnValue - public @NonNull Builder setNortheast(@NonNull PlatformLatLng setterArg) { - this.northeast = setterArg; + public @NonNull Builder setMarkerId(@NonNull String setterArg) { + this.markerId = setterArg; return this; } - private @Nullable PlatformLatLng southwest; + private @Nullable String clusterManagerId; @CanIgnoreReturnValue - public @NonNull Builder setSouthwest(@NonNull PlatformLatLng setterArg) { - this.southwest = setterArg; + public @NonNull Builder setClusterManagerId(@Nullable String setterArg) { + this.clusterManagerId = setterArg; return this; } - public @NonNull PlatformLatLngBounds build() { - PlatformLatLngBounds pigeonReturn = new PlatformLatLngBounds(); - pigeonReturn.setNortheast(northeast); - pigeonReturn.setSouthwest(southwest); + public @NonNull PlatformMarker build() { + PlatformMarker pigeonReturn = new PlatformMarker(); + pigeonReturn.setAlpha(alpha); + pigeonReturn.setAnchor(anchor); + pigeonReturn.setConsumeTapEvents(consumeTapEvents); + pigeonReturn.setDraggable(draggable); + pigeonReturn.setFlat(flat); + pigeonReturn.setIcon(icon); + pigeonReturn.setInfoWindow(infoWindow); + pigeonReturn.setPosition(position); + pigeonReturn.setRotation(rotation); + pigeonReturn.setVisible(visible); + pigeonReturn.setZIndex(zIndex); + pigeonReturn.setMarkerId(markerId); + pigeonReturn.setClusterManagerId(clusterManagerId); return pigeonReturn; } } @NonNull ArrayList toList() { - ArrayList toListResult = new ArrayList(2); - toListResult.add(northeast); - toListResult.add(southwest); + ArrayList toListResult = new ArrayList<>(13); + toListResult.add(alpha); + toListResult.add(anchor); + toListResult.add(consumeTapEvents); + toListResult.add(draggable); + toListResult.add(flat); + toListResult.add(icon); + toListResult.add(infoWindow); + toListResult.add(position); + toListResult.add(rotation); + toListResult.add(visible); + toListResult.add(zIndex); + toListResult.add(markerId); + toListResult.add(clusterManagerId); return toListResult; } - static @NonNull PlatformLatLngBounds fromList(@NonNull ArrayList __pigeon_list) { - PlatformLatLngBounds pigeonResult = new PlatformLatLngBounds(); - Object northeast = __pigeon_list.get(0); - pigeonResult.setNortheast((PlatformLatLng) northeast); - Object southwest = __pigeon_list.get(1); - pigeonResult.setSouthwest((PlatformLatLng) southwest); + static @NonNull PlatformMarker fromList(@NonNull ArrayList pigeonVar_list) { + PlatformMarker pigeonResult = new PlatformMarker(); + Object alpha = pigeonVar_list.get(0); + pigeonResult.setAlpha((Double) alpha); + Object anchor = pigeonVar_list.get(1); + pigeonResult.setAnchor((PlatformDoublePair) anchor); + Object consumeTapEvents = pigeonVar_list.get(2); + pigeonResult.setConsumeTapEvents((Boolean) consumeTapEvents); + Object draggable = pigeonVar_list.get(3); + pigeonResult.setDraggable((Boolean) draggable); + Object flat = pigeonVar_list.get(4); + pigeonResult.setFlat((Boolean) flat); + Object icon = pigeonVar_list.get(5); + pigeonResult.setIcon((PlatformBitmap) icon); + Object infoWindow = pigeonVar_list.get(6); + pigeonResult.setInfoWindow((PlatformInfoWindow) infoWindow); + Object position = pigeonVar_list.get(7); + pigeonResult.setPosition((PlatformLatLng) position); + Object rotation = pigeonVar_list.get(8); + pigeonResult.setRotation((Double) rotation); + Object visible = pigeonVar_list.get(9); + pigeonResult.setVisible((Boolean) visible); + Object zIndex = pigeonVar_list.get(10); + pigeonResult.setZIndex((Double) zIndex); + Object markerId = pigeonVar_list.get(11); + pigeonResult.setMarkerId((String) markerId); + Object clusterManagerId = pigeonVar_list.get(12); + pigeonResult.setClusterManagerId((String) clusterManagerId); return pigeonResult; } } /** - * Pigeon equivalent of Cluster. + * Pigeon equivalent of the Polygon class. * *

Generated class from Pigeon that represents data sent in messages. */ - public static final class PlatformCluster { - private @NonNull String clusterManagerId; + public static final class PlatformPolygon { + private @NonNull String polygonId; - public @NonNull String getClusterManagerId() { - return clusterManagerId; + public @NonNull String getPolygonId() { + return polygonId; } - public void setClusterManagerId(@NonNull String setterArg) { + public void setPolygonId(@NonNull String setterArg) { if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"clusterManagerId\" is null."); + throw new IllegalStateException("Nonnull field \"polygonId\" is null."); } - this.clusterManagerId = setterArg; + this.polygonId = setterArg; } - private @NonNull PlatformLatLng position; + private @NonNull Boolean consumesTapEvents; - public @NonNull PlatformLatLng getPosition() { - return position; + public @NonNull Boolean getConsumesTapEvents() { + return consumesTapEvents; } - public void setPosition(@NonNull PlatformLatLng setterArg) { + public void setConsumesTapEvents(@NonNull Boolean setterArg) { if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"position\" is null."); + throw new IllegalStateException("Nonnull field \"consumesTapEvents\" is null."); } - this.position = setterArg; + this.consumesTapEvents = setterArg; } - private @NonNull PlatformLatLngBounds bounds; + private @NonNull Long fillColor; - public @NonNull PlatformLatLngBounds getBounds() { - return bounds; + public @NonNull Long getFillColor() { + return fillColor; } - public void setBounds(@NonNull PlatformLatLngBounds setterArg) { + public void setFillColor(@NonNull Long setterArg) { if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"bounds\" is null."); + throw new IllegalStateException("Nonnull field \"fillColor\" is null."); } - this.bounds = setterArg; + this.fillColor = setterArg; } - private @NonNull List markerIds; + private @NonNull Boolean geodesic; - public @NonNull List getMarkerIds() { - return markerIds; + public @NonNull Boolean getGeodesic() { + return geodesic; } - public void setMarkerIds(@NonNull List setterArg) { + public void setGeodesic(@NonNull Boolean setterArg) { if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"markerIds\" is null."); + throw new IllegalStateException("Nonnull field \"geodesic\" is null."); } - this.markerIds = setterArg; + this.geodesic = setterArg; } - /** Constructor is non-public to enforce null safety; use Builder. */ - PlatformCluster() {} + private @NonNull List points; - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - PlatformCluster that = (PlatformCluster) o; - return clusterManagerId.equals(that.clusterManagerId) - && position.equals(that.position) - && bounds.equals(that.bounds) - && markerIds.equals(that.markerIds); + public @NonNull List getPoints() { + return points; } - @Override - public int hashCode() { - return Objects.hash(clusterManagerId, position, bounds, markerIds); + public void setPoints(@NonNull List setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"points\" is null."); + } + this.points = setterArg; } - public static final class Builder { + private @NonNull List> holes; - private @Nullable String clusterManagerId; + public @NonNull List> getHoles() { + return holes; + } - @CanIgnoreReturnValue - public @NonNull Builder setClusterManagerId(@NonNull String setterArg) { - this.clusterManagerId = setterArg; - return this; + public void setHoles(@NonNull List> setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"holes\" is null."); } + this.holes = setterArg; + } - private @Nullable PlatformLatLng position; - - @CanIgnoreReturnValue - public @NonNull Builder setPosition(@NonNull PlatformLatLng setterArg) { - this.position = setterArg; - return this; - } + private @NonNull Boolean visible; - private @Nullable PlatformLatLngBounds bounds; + public @NonNull Boolean getVisible() { + return visible; + } - @CanIgnoreReturnValue - public @NonNull Builder setBounds(@NonNull PlatformLatLngBounds setterArg) { - this.bounds = setterArg; - return this; + public void setVisible(@NonNull Boolean setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"visible\" is null."); } + this.visible = setterArg; + } - private @Nullable List markerIds; + private @NonNull Long strokeColor; - @CanIgnoreReturnValue - public @NonNull Builder setMarkerIds(@NonNull List setterArg) { - this.markerIds = setterArg; - return this; - } + public @NonNull Long getStrokeColor() { + return strokeColor; + } - public @NonNull PlatformCluster build() { - PlatformCluster pigeonReturn = new PlatformCluster(); - pigeonReturn.setClusterManagerId(clusterManagerId); - pigeonReturn.setPosition(position); - pigeonReturn.setBounds(bounds); - pigeonReturn.setMarkerIds(markerIds); - return pigeonReturn; + public void setStrokeColor(@NonNull Long setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"strokeColor\" is null."); } + this.strokeColor = setterArg; } - @NonNull - ArrayList toList() { - ArrayList toListResult = new ArrayList(4); - toListResult.add(clusterManagerId); - toListResult.add(position); - toListResult.add(bounds); - toListResult.add(markerIds); - return toListResult; + private @NonNull Long strokeWidth; + + public @NonNull Long getStrokeWidth() { + return strokeWidth; } - static @NonNull PlatformCluster fromList(@NonNull ArrayList __pigeon_list) { - PlatformCluster pigeonResult = new PlatformCluster(); - Object clusterManagerId = __pigeon_list.get(0); - pigeonResult.setClusterManagerId((String) clusterManagerId); - Object position = __pigeon_list.get(1); - pigeonResult.setPosition((PlatformLatLng) position); - Object bounds = __pigeon_list.get(2); - pigeonResult.setBounds((PlatformLatLngBounds) bounds); - Object markerIds = __pigeon_list.get(3); - pigeonResult.setMarkerIds((List) markerIds); - return pigeonResult; + public void setStrokeWidth(@NonNull Long setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"strokeWidth\" is null."); + } + this.strokeWidth = setterArg; } - } - /** - * Pigeon equivalent of CameraTargetBounds. - * - *

As with the Dart version, it exists to distinguish between not setting a a target, and - * having an explicitly unbounded target (null [bounds]). - * - *

Generated class from Pigeon that represents data sent in messages. - */ - public static final class PlatformCameraTargetBounds { - private @Nullable PlatformLatLngBounds bounds; + private @NonNull Long zIndex; - public @Nullable PlatformLatLngBounds getBounds() { - return bounds; + public @NonNull Long getZIndex() { + return zIndex; } - public void setBounds(@Nullable PlatformLatLngBounds setterArg) { - this.bounds = setterArg; + public void setZIndex(@NonNull Long setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"zIndex\" is null."); + } + this.zIndex = setterArg; } + /** Constructor is non-public to enforce null safety; use Builder. */ + PlatformPolygon() {} + @Override public boolean equals(Object o) { if (this == o) { @@ -2243,172 +2242,344 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - PlatformCameraTargetBounds that = (PlatformCameraTargetBounds) o; - return Objects.equals(bounds, that.bounds); + PlatformPolygon that = (PlatformPolygon) o; + return polygonId.equals(that.polygonId) + && consumesTapEvents.equals(that.consumesTapEvents) + && fillColor.equals(that.fillColor) + && geodesic.equals(that.geodesic) + && points.equals(that.points) + && holes.equals(that.holes) + && visible.equals(that.visible) + && strokeColor.equals(that.strokeColor) + && strokeWidth.equals(that.strokeWidth) + && zIndex.equals(that.zIndex); } @Override public int hashCode() { - return Objects.hash(bounds); + return Objects.hash( + polygonId, + consumesTapEvents, + fillColor, + geodesic, + points, + holes, + visible, + strokeColor, + strokeWidth, + zIndex); } public static final class Builder { - private @Nullable PlatformLatLngBounds bounds; + private @Nullable String polygonId; @CanIgnoreReturnValue - public @NonNull Builder setBounds(@Nullable PlatformLatLngBounds setterArg) { - this.bounds = setterArg; + public @NonNull Builder setPolygonId(@NonNull String setterArg) { + this.polygonId = setterArg; return this; } - public @NonNull PlatformCameraTargetBounds build() { - PlatformCameraTargetBounds pigeonReturn = new PlatformCameraTargetBounds(); - pigeonReturn.setBounds(bounds); + private @Nullable Boolean consumesTapEvents; + + @CanIgnoreReturnValue + public @NonNull Builder setConsumesTapEvents(@NonNull Boolean setterArg) { + this.consumesTapEvents = setterArg; + return this; + } + + private @Nullable Long fillColor; + + @CanIgnoreReturnValue + public @NonNull Builder setFillColor(@NonNull Long setterArg) { + this.fillColor = setterArg; + return this; + } + + private @Nullable Boolean geodesic; + + @CanIgnoreReturnValue + public @NonNull Builder setGeodesic(@NonNull Boolean setterArg) { + this.geodesic = setterArg; + return this; + } + + private @Nullable List points; + + @CanIgnoreReturnValue + public @NonNull Builder setPoints(@NonNull List setterArg) { + this.points = setterArg; + return this; + } + + private @Nullable List> holes; + + @CanIgnoreReturnValue + public @NonNull Builder setHoles(@NonNull List> setterArg) { + this.holes = setterArg; + return this; + } + + private @Nullable Boolean visible; + + @CanIgnoreReturnValue + public @NonNull Builder setVisible(@NonNull Boolean setterArg) { + this.visible = setterArg; + return this; + } + + private @Nullable Long strokeColor; + + @CanIgnoreReturnValue + public @NonNull Builder setStrokeColor(@NonNull Long setterArg) { + this.strokeColor = setterArg; + return this; + } + + private @Nullable Long strokeWidth; + + @CanIgnoreReturnValue + public @NonNull Builder setStrokeWidth(@NonNull Long setterArg) { + this.strokeWidth = setterArg; + return this; + } + + private @Nullable Long zIndex; + + @CanIgnoreReturnValue + public @NonNull Builder setZIndex(@NonNull Long setterArg) { + this.zIndex = setterArg; + return this; + } + + public @NonNull PlatformPolygon build() { + PlatformPolygon pigeonReturn = new PlatformPolygon(); + pigeonReturn.setPolygonId(polygonId); + pigeonReturn.setConsumesTapEvents(consumesTapEvents); + pigeonReturn.setFillColor(fillColor); + pigeonReturn.setGeodesic(geodesic); + pigeonReturn.setPoints(points); + pigeonReturn.setHoles(holes); + pigeonReturn.setVisible(visible); + pigeonReturn.setStrokeColor(strokeColor); + pigeonReturn.setStrokeWidth(strokeWidth); + pigeonReturn.setZIndex(zIndex); return pigeonReturn; } } @NonNull ArrayList toList() { - ArrayList toListResult = new ArrayList(1); - toListResult.add(bounds); + ArrayList toListResult = new ArrayList<>(10); + toListResult.add(polygonId); + toListResult.add(consumesTapEvents); + toListResult.add(fillColor); + toListResult.add(geodesic); + toListResult.add(points); + toListResult.add(holes); + toListResult.add(visible); + toListResult.add(strokeColor); + toListResult.add(strokeWidth); + toListResult.add(zIndex); return toListResult; } - static @NonNull PlatformCameraTargetBounds fromList(@NonNull ArrayList __pigeon_list) { - PlatformCameraTargetBounds pigeonResult = new PlatformCameraTargetBounds(); - Object bounds = __pigeon_list.get(0); - pigeonResult.setBounds((PlatformLatLngBounds) bounds); + static @NonNull PlatformPolygon fromList(@NonNull ArrayList pigeonVar_list) { + PlatformPolygon pigeonResult = new PlatformPolygon(); + Object polygonId = pigeonVar_list.get(0); + pigeonResult.setPolygonId((String) polygonId); + Object consumesTapEvents = pigeonVar_list.get(1); + pigeonResult.setConsumesTapEvents((Boolean) consumesTapEvents); + Object fillColor = pigeonVar_list.get(2); + pigeonResult.setFillColor((Long) fillColor); + Object geodesic = pigeonVar_list.get(3); + pigeonResult.setGeodesic((Boolean) geodesic); + Object points = pigeonVar_list.get(4); + pigeonResult.setPoints((List) points); + Object holes = pigeonVar_list.get(5); + pigeonResult.setHoles((List>) holes); + Object visible = pigeonVar_list.get(6); + pigeonResult.setVisible((Boolean) visible); + Object strokeColor = pigeonVar_list.get(7); + pigeonResult.setStrokeColor((Long) strokeColor); + Object strokeWidth = pigeonVar_list.get(8); + pigeonResult.setStrokeWidth((Long) strokeWidth); + Object zIndex = pigeonVar_list.get(9); + pigeonResult.setZIndex((Long) zIndex); return pigeonResult; } } /** - * Information passed to the platform view creation. + * Pigeon equivalent of the Polyline class. * *

Generated class from Pigeon that represents data sent in messages. */ - public static final class PlatformMapViewCreationParams { - private @NonNull PlatformCameraPosition initialCameraPosition; + public static final class PlatformPolyline { + private @NonNull String polylineId; - public @NonNull PlatformCameraPosition getInitialCameraPosition() { - return initialCameraPosition; + public @NonNull String getPolylineId() { + return polylineId; } - public void setInitialCameraPosition(@NonNull PlatformCameraPosition setterArg) { + public void setPolylineId(@NonNull String setterArg) { if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"initialCameraPosition\" is null."); + throw new IllegalStateException("Nonnull field \"polylineId\" is null."); } - this.initialCameraPosition = setterArg; + this.polylineId = setterArg; } - private @NonNull PlatformMapConfiguration mapConfiguration; + private @NonNull Boolean consumesTapEvents; - public @NonNull PlatformMapConfiguration getMapConfiguration() { - return mapConfiguration; + public @NonNull Boolean getConsumesTapEvents() { + return consumesTapEvents; } - public void setMapConfiguration(@NonNull PlatformMapConfiguration setterArg) { + public void setConsumesTapEvents(@NonNull Boolean setterArg) { if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"mapConfiguration\" is null."); + throw new IllegalStateException("Nonnull field \"consumesTapEvents\" is null."); } - this.mapConfiguration = setterArg; + this.consumesTapEvents = setterArg; } - private @NonNull List initialCircles; + private @NonNull Long color; - public @NonNull List getInitialCircles() { - return initialCircles; + public @NonNull Long getColor() { + return color; } - public void setInitialCircles(@NonNull List setterArg) { + public void setColor(@NonNull Long setterArg) { if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"initialCircles\" is null."); + throw new IllegalStateException("Nonnull field \"color\" is null."); } - this.initialCircles = setterArg; + this.color = setterArg; } - private @NonNull List initialMarkers; + private @NonNull Boolean geodesic; - public @NonNull List getInitialMarkers() { - return initialMarkers; + public @NonNull Boolean getGeodesic() { + return geodesic; } - public void setInitialMarkers(@NonNull List setterArg) { + public void setGeodesic(@NonNull Boolean setterArg) { if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"initialMarkers\" is null."); + throw new IllegalStateException("Nonnull field \"geodesic\" is null."); } - this.initialMarkers = setterArg; + this.geodesic = setterArg; } - private @NonNull List initialPolygons; + /** The joint type. */ + private @NonNull PlatformJointType jointType; - public @NonNull List getInitialPolygons() { - return initialPolygons; + public @NonNull PlatformJointType getJointType() { + return jointType; } - public void setInitialPolygons(@NonNull List setterArg) { + public void setJointType(@NonNull PlatformJointType setterArg) { if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"initialPolygons\" is null."); + throw new IllegalStateException("Nonnull field \"jointType\" is null."); } - this.initialPolygons = setterArg; + this.jointType = setterArg; } - private @NonNull List initialPolylines; + /** The pattern data, as a list of pattern items. */ + private @NonNull List patterns; - public @NonNull List getInitialPolylines() { - return initialPolylines; + public @NonNull List getPatterns() { + return patterns; } - public void setInitialPolylines(@NonNull List setterArg) { + public void setPatterns(@NonNull List setterArg) { if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"initialPolylines\" is null."); + throw new IllegalStateException("Nonnull field \"patterns\" is null."); } - this.initialPolylines = setterArg; + this.patterns = setterArg; } - private @NonNull List initialHeatmaps; + private @NonNull List points; - public @NonNull List getInitialHeatmaps() { - return initialHeatmaps; + public @NonNull List getPoints() { + return points; } - public void setInitialHeatmaps(@NonNull List setterArg) { + public void setPoints(@NonNull List setterArg) { if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"initialHeatmaps\" is null."); + throw new IllegalStateException("Nonnull field \"points\" is null."); } - this.initialHeatmaps = setterArg; + this.points = setterArg; } - private @NonNull List initialTileOverlays; + /** + * The cap at the start and end vertex of a polyline. See + * https://developers.google.com/maps/documentation/android-sdk/reference/com/google/android/libraries/maps/model/Cap. + */ + private @NonNull PlatformCap startCap; - public @NonNull List getInitialTileOverlays() { - return initialTileOverlays; + public @NonNull PlatformCap getStartCap() { + return startCap; } - public void setInitialTileOverlays(@NonNull List setterArg) { + public void setStartCap(@NonNull PlatformCap setterArg) { if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"initialTileOverlays\" is null."); + throw new IllegalStateException("Nonnull field \"startCap\" is null."); } - this.initialTileOverlays = setterArg; + this.startCap = setterArg; } - private @NonNull List initialClusterManagers; + private @NonNull PlatformCap endCap; - public @NonNull List getInitialClusterManagers() { - return initialClusterManagers; + public @NonNull PlatformCap getEndCap() { + return endCap; } - public void setInitialClusterManagers(@NonNull List setterArg) { + public void setEndCap(@NonNull PlatformCap setterArg) { if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"initialClusterManagers\" is null."); + throw new IllegalStateException("Nonnull field \"endCap\" is null."); } - this.initialClusterManagers = setterArg; + this.endCap = setterArg; + } + + private @NonNull Boolean visible; + + public @NonNull Boolean getVisible() { + return visible; + } + + public void setVisible(@NonNull Boolean setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"visible\" is null."); + } + this.visible = setterArg; + } + + private @NonNull Long width; + + public @NonNull Long getWidth() { + return width; + } + + public void setWidth(@NonNull Long setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"width\" is null."); + } + this.width = setterArg; + } + + private @NonNull Long zIndex; + + public @NonNull Long getZIndex() { + return zIndex; + } + + public void setZIndex(@NonNull Long setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"zIndex\" is null."); + } + this.zIndex = setterArg; } /** Constructor is non-public to enforce null safety; use Builder. */ - PlatformMapViewCreationParams() {} + PlatformPolyline() {} @Override public boolean equals(Object o) { @@ -2418,368 +2589,622 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - PlatformMapViewCreationParams that = (PlatformMapViewCreationParams) o; - return initialCameraPosition.equals(that.initialCameraPosition) - && mapConfiguration.equals(that.mapConfiguration) - && initialCircles.equals(that.initialCircles) - && initialMarkers.equals(that.initialMarkers) - && initialPolygons.equals(that.initialPolygons) - && initialPolylines.equals(that.initialPolylines) - && initialHeatmaps.equals(that.initialHeatmaps) - && initialTileOverlays.equals(that.initialTileOverlays) - && initialClusterManagers.equals(that.initialClusterManagers); + PlatformPolyline that = (PlatformPolyline) o; + return polylineId.equals(that.polylineId) + && consumesTapEvents.equals(that.consumesTapEvents) + && color.equals(that.color) + && geodesic.equals(that.geodesic) + && jointType.equals(that.jointType) + && patterns.equals(that.patterns) + && points.equals(that.points) + && startCap.equals(that.startCap) + && endCap.equals(that.endCap) + && visible.equals(that.visible) + && width.equals(that.width) + && zIndex.equals(that.zIndex); } @Override public int hashCode() { return Objects.hash( - initialCameraPosition, - mapConfiguration, - initialCircles, - initialMarkers, - initialPolygons, - initialPolylines, - initialHeatmaps, - initialTileOverlays, - initialClusterManagers); + polylineId, + consumesTapEvents, + color, + geodesic, + jointType, + patterns, + points, + startCap, + endCap, + visible, + width, + zIndex); } public static final class Builder { - private @Nullable PlatformCameraPosition initialCameraPosition; + private @Nullable String polylineId; @CanIgnoreReturnValue - public @NonNull Builder setInitialCameraPosition(@NonNull PlatformCameraPosition setterArg) { - this.initialCameraPosition = setterArg; + public @NonNull Builder setPolylineId(@NonNull String setterArg) { + this.polylineId = setterArg; return this; } - private @Nullable PlatformMapConfiguration mapConfiguration; + private @Nullable Boolean consumesTapEvents; @CanIgnoreReturnValue - public @NonNull Builder setMapConfiguration(@NonNull PlatformMapConfiguration setterArg) { - this.mapConfiguration = setterArg; + public @NonNull Builder setConsumesTapEvents(@NonNull Boolean setterArg) { + this.consumesTapEvents = setterArg; return this; } - private @Nullable List initialCircles; + private @Nullable Long color; @CanIgnoreReturnValue - public @NonNull Builder setInitialCircles(@NonNull List setterArg) { - this.initialCircles = setterArg; + public @NonNull Builder setColor(@NonNull Long setterArg) { + this.color = setterArg; return this; } - private @Nullable List initialMarkers; + private @Nullable Boolean geodesic; @CanIgnoreReturnValue - public @NonNull Builder setInitialMarkers(@NonNull List setterArg) { - this.initialMarkers = setterArg; + public @NonNull Builder setGeodesic(@NonNull Boolean setterArg) { + this.geodesic = setterArg; return this; } - private @Nullable List initialPolygons; + private @Nullable PlatformJointType jointType; @CanIgnoreReturnValue - public @NonNull Builder setInitialPolygons(@NonNull List setterArg) { - this.initialPolygons = setterArg; + public @NonNull Builder setJointType(@NonNull PlatformJointType setterArg) { + this.jointType = setterArg; return this; } - private @Nullable List initialPolylines; + private @Nullable List patterns; @CanIgnoreReturnValue - public @NonNull Builder setInitialPolylines(@NonNull List setterArg) { - this.initialPolylines = setterArg; + public @NonNull Builder setPatterns(@NonNull List setterArg) { + this.patterns = setterArg; return this; } - private @Nullable List initialHeatmaps; + private @Nullable List points; @CanIgnoreReturnValue - public @NonNull Builder setInitialHeatmaps(@NonNull List setterArg) { - this.initialHeatmaps = setterArg; + public @NonNull Builder setPoints(@NonNull List setterArg) { + this.points = setterArg; return this; } - private @Nullable List initialTileOverlays; + private @Nullable PlatformCap startCap; @CanIgnoreReturnValue - public @NonNull Builder setInitialTileOverlays(@NonNull List setterArg) { - this.initialTileOverlays = setterArg; + public @NonNull Builder setStartCap(@NonNull PlatformCap setterArg) { + this.startCap = setterArg; return this; } - private @Nullable List initialClusterManagers; + private @Nullable PlatformCap endCap; @CanIgnoreReturnValue - public @NonNull Builder setInitialClusterManagers( - @NonNull List setterArg) { - this.initialClusterManagers = setterArg; + public @NonNull Builder setEndCap(@NonNull PlatformCap setterArg) { + this.endCap = setterArg; return this; } - public @NonNull PlatformMapViewCreationParams build() { - PlatformMapViewCreationParams pigeonReturn = new PlatformMapViewCreationParams(); - pigeonReturn.setInitialCameraPosition(initialCameraPosition); - pigeonReturn.setMapConfiguration(mapConfiguration); - pigeonReturn.setInitialCircles(initialCircles); - pigeonReturn.setInitialMarkers(initialMarkers); - pigeonReturn.setInitialPolygons(initialPolygons); - pigeonReturn.setInitialPolylines(initialPolylines); - pigeonReturn.setInitialHeatmaps(initialHeatmaps); - pigeonReturn.setInitialTileOverlays(initialTileOverlays); - pigeonReturn.setInitialClusterManagers(initialClusterManagers); + private @Nullable Boolean visible; + + @CanIgnoreReturnValue + public @NonNull Builder setVisible(@NonNull Boolean setterArg) { + this.visible = setterArg; + return this; + } + + private @Nullable Long width; + + @CanIgnoreReturnValue + public @NonNull Builder setWidth(@NonNull Long setterArg) { + this.width = setterArg; + return this; + } + + private @Nullable Long zIndex; + + @CanIgnoreReturnValue + public @NonNull Builder setZIndex(@NonNull Long setterArg) { + this.zIndex = setterArg; + return this; + } + + public @NonNull PlatformPolyline build() { + PlatformPolyline pigeonReturn = new PlatformPolyline(); + pigeonReturn.setPolylineId(polylineId); + pigeonReturn.setConsumesTapEvents(consumesTapEvents); + pigeonReturn.setColor(color); + pigeonReturn.setGeodesic(geodesic); + pigeonReturn.setJointType(jointType); + pigeonReturn.setPatterns(patterns); + pigeonReturn.setPoints(points); + pigeonReturn.setStartCap(startCap); + pigeonReturn.setEndCap(endCap); + pigeonReturn.setVisible(visible); + pigeonReturn.setWidth(width); + pigeonReturn.setZIndex(zIndex); return pigeonReturn; } } @NonNull ArrayList toList() { - ArrayList toListResult = new ArrayList(9); - toListResult.add(initialCameraPosition); - toListResult.add(mapConfiguration); - toListResult.add(initialCircles); - toListResult.add(initialMarkers); - toListResult.add(initialPolygons); - toListResult.add(initialPolylines); - toListResult.add(initialHeatmaps); - toListResult.add(initialTileOverlays); - toListResult.add(initialClusterManagers); + ArrayList toListResult = new ArrayList<>(12); + toListResult.add(polylineId); + toListResult.add(consumesTapEvents); + toListResult.add(color); + toListResult.add(geodesic); + toListResult.add(jointType); + toListResult.add(patterns); + toListResult.add(points); + toListResult.add(startCap); + toListResult.add(endCap); + toListResult.add(visible); + toListResult.add(width); + toListResult.add(zIndex); return toListResult; } - static @NonNull PlatformMapViewCreationParams fromList( - @NonNull ArrayList __pigeon_list) { - PlatformMapViewCreationParams pigeonResult = new PlatformMapViewCreationParams(); - Object initialCameraPosition = __pigeon_list.get(0); - pigeonResult.setInitialCameraPosition((PlatformCameraPosition) initialCameraPosition); - Object mapConfiguration = __pigeon_list.get(1); - pigeonResult.setMapConfiguration((PlatformMapConfiguration) mapConfiguration); - Object initialCircles = __pigeon_list.get(2); - pigeonResult.setInitialCircles((List) initialCircles); - Object initialMarkers = __pigeon_list.get(3); - pigeonResult.setInitialMarkers((List) initialMarkers); - Object initialPolygons = __pigeon_list.get(4); - pigeonResult.setInitialPolygons((List) initialPolygons); - Object initialPolylines = __pigeon_list.get(5); - pigeonResult.setInitialPolylines((List) initialPolylines); - Object initialHeatmaps = __pigeon_list.get(6); - pigeonResult.setInitialHeatmaps((List) initialHeatmaps); - Object initialTileOverlays = __pigeon_list.get(7); - pigeonResult.setInitialTileOverlays((List) initialTileOverlays); - Object initialClusterManagers = __pigeon_list.get(8); - pigeonResult.setInitialClusterManagers((List) initialClusterManagers); + static @NonNull PlatformPolyline fromList(@NonNull ArrayList pigeonVar_list) { + PlatformPolyline pigeonResult = new PlatformPolyline(); + Object polylineId = pigeonVar_list.get(0); + pigeonResult.setPolylineId((String) polylineId); + Object consumesTapEvents = pigeonVar_list.get(1); + pigeonResult.setConsumesTapEvents((Boolean) consumesTapEvents); + Object color = pigeonVar_list.get(2); + pigeonResult.setColor((Long) color); + Object geodesic = pigeonVar_list.get(3); + pigeonResult.setGeodesic((Boolean) geodesic); + Object jointType = pigeonVar_list.get(4); + pigeonResult.setJointType((PlatformJointType) jointType); + Object patterns = pigeonVar_list.get(5); + pigeonResult.setPatterns((List) patterns); + Object points = pigeonVar_list.get(6); + pigeonResult.setPoints((List) points); + Object startCap = pigeonVar_list.get(7); + pigeonResult.setStartCap((PlatformCap) startCap); + Object endCap = pigeonVar_list.get(8); + pigeonResult.setEndCap((PlatformCap) endCap); + Object visible = pigeonVar_list.get(9); + pigeonResult.setVisible((Boolean) visible); + Object width = pigeonVar_list.get(10); + pigeonResult.setWidth((Long) width); + Object zIndex = pigeonVar_list.get(11); + pigeonResult.setZIndex((Long) zIndex); return pigeonResult; } } /** - * Pigeon equivalent of MapConfiguration. + * Pigeon equivalent of Cap from the platform interface. + * https://github.com/flutter/packages/blob/main/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/cap.dart * *

Generated class from Pigeon that represents data sent in messages. */ - public static final class PlatformMapConfiguration { - private @Nullable Boolean compassEnabled; + public static final class PlatformCap { + private @NonNull PlatformCapType type; - public @Nullable Boolean getCompassEnabled() { - return compassEnabled; + public @NonNull PlatformCapType getType() { + return type; } - public void setCompassEnabled(@Nullable Boolean setterArg) { - this.compassEnabled = setterArg; + public void setType(@NonNull PlatformCapType setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"type\" is null."); + } + this.type = setterArg; } - private @Nullable PlatformCameraTargetBounds cameraTargetBounds; + private @Nullable PlatformBitmap bitmapDescriptor; - public @Nullable PlatformCameraTargetBounds getCameraTargetBounds() { - return cameraTargetBounds; + public @Nullable PlatformBitmap getBitmapDescriptor() { + return bitmapDescriptor; } - public void setCameraTargetBounds(@Nullable PlatformCameraTargetBounds setterArg) { - this.cameraTargetBounds = setterArg; + public void setBitmapDescriptor(@Nullable PlatformBitmap setterArg) { + this.bitmapDescriptor = setterArg; } - private @Nullable PlatformMapType mapType; + private @Nullable Double refWidth; - public @Nullable PlatformMapType getMapType() { - return mapType; + public @Nullable Double getRefWidth() { + return refWidth; } - public void setMapType(@Nullable PlatformMapType setterArg) { - this.mapType = setterArg; + public void setRefWidth(@Nullable Double setterArg) { + this.refWidth = setterArg; } - private @Nullable PlatformZoomRange minMaxZoomPreference; + /** Constructor is non-public to enforce null safety; use Builder. */ + PlatformCap() {} - public @Nullable PlatformZoomRange getMinMaxZoomPreference() { - return minMaxZoomPreference; + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlatformCap that = (PlatformCap) o; + return type.equals(that.type) + && Objects.equals(bitmapDescriptor, that.bitmapDescriptor) + && Objects.equals(refWidth, that.refWidth); } - public void setMinMaxZoomPreference(@Nullable PlatformZoomRange setterArg) { - this.minMaxZoomPreference = setterArg; + @Override + public int hashCode() { + return Objects.hash(type, bitmapDescriptor, refWidth); } - private @Nullable Boolean mapToolbarEnabled; - - public @Nullable Boolean getMapToolbarEnabled() { - return mapToolbarEnabled; - } + public static final class Builder { - public void setMapToolbarEnabled(@Nullable Boolean setterArg) { - this.mapToolbarEnabled = setterArg; - } + private @Nullable PlatformCapType type; - private @Nullable Boolean rotateGesturesEnabled; + @CanIgnoreReturnValue + public @NonNull Builder setType(@NonNull PlatformCapType setterArg) { + this.type = setterArg; + return this; + } - public @Nullable Boolean getRotateGesturesEnabled() { - return rotateGesturesEnabled; - } + private @Nullable PlatformBitmap bitmapDescriptor; - public void setRotateGesturesEnabled(@Nullable Boolean setterArg) { - this.rotateGesturesEnabled = setterArg; - } + @CanIgnoreReturnValue + public @NonNull Builder setBitmapDescriptor(@Nullable PlatformBitmap setterArg) { + this.bitmapDescriptor = setterArg; + return this; + } - private @Nullable Boolean scrollGesturesEnabled; + private @Nullable Double refWidth; - public @Nullable Boolean getScrollGesturesEnabled() { - return scrollGesturesEnabled; - } + @CanIgnoreReturnValue + public @NonNull Builder setRefWidth(@Nullable Double setterArg) { + this.refWidth = setterArg; + return this; + } - public void setScrollGesturesEnabled(@Nullable Boolean setterArg) { - this.scrollGesturesEnabled = setterArg; + public @NonNull PlatformCap build() { + PlatformCap pigeonReturn = new PlatformCap(); + pigeonReturn.setType(type); + pigeonReturn.setBitmapDescriptor(bitmapDescriptor); + pigeonReturn.setRefWidth(refWidth); + return pigeonReturn; + } } - private @Nullable Boolean tiltGesturesEnabled; - - public @Nullable Boolean getTiltGesturesEnabled() { - return tiltGesturesEnabled; + @NonNull + ArrayList toList() { + ArrayList toListResult = new ArrayList<>(3); + toListResult.add(type); + toListResult.add(bitmapDescriptor); + toListResult.add(refWidth); + return toListResult; } - public void setTiltGesturesEnabled(@Nullable Boolean setterArg) { - this.tiltGesturesEnabled = setterArg; + static @NonNull PlatformCap fromList(@NonNull ArrayList pigeonVar_list) { + PlatformCap pigeonResult = new PlatformCap(); + Object type = pigeonVar_list.get(0); + pigeonResult.setType((PlatformCapType) type); + Object bitmapDescriptor = pigeonVar_list.get(1); + pigeonResult.setBitmapDescriptor((PlatformBitmap) bitmapDescriptor); + Object refWidth = pigeonVar_list.get(2); + pigeonResult.setRefWidth((Double) refWidth); + return pigeonResult; } + } - private @Nullable Boolean trackCameraPosition; + /** + * Pigeon equivalent of the PatternItem class. + * + *

Generated class from Pigeon that represents data sent in messages. + */ + public static final class PlatformPatternItem { + private @NonNull PlatformPatternItemType type; - public @Nullable Boolean getTrackCameraPosition() { - return trackCameraPosition; + public @NonNull PlatformPatternItemType getType() { + return type; } - public void setTrackCameraPosition(@Nullable Boolean setterArg) { - this.trackCameraPosition = setterArg; + public void setType(@NonNull PlatformPatternItemType setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"type\" is null."); + } + this.type = setterArg; } - private @Nullable Boolean zoomControlsEnabled; + private @Nullable Double length; - public @Nullable Boolean getZoomControlsEnabled() { - return zoomControlsEnabled; + public @Nullable Double getLength() { + return length; } - public void setZoomControlsEnabled(@Nullable Boolean setterArg) { - this.zoomControlsEnabled = setterArg; + public void setLength(@Nullable Double setterArg) { + this.length = setterArg; } - private @Nullable Boolean zoomGesturesEnabled; + /** Constructor is non-public to enforce null safety; use Builder. */ + PlatformPatternItem() {} - public @Nullable Boolean getZoomGesturesEnabled() { - return zoomGesturesEnabled; + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlatformPatternItem that = (PlatformPatternItem) o; + return type.equals(that.type) && Objects.equals(length, that.length); } - public void setZoomGesturesEnabled(@Nullable Boolean setterArg) { - this.zoomGesturesEnabled = setterArg; + @Override + public int hashCode() { + return Objects.hash(type, length); } - private @Nullable Boolean myLocationEnabled; + public static final class Builder { - public @Nullable Boolean getMyLocationEnabled() { - return myLocationEnabled; - } + private @Nullable PlatformPatternItemType type; - public void setMyLocationEnabled(@Nullable Boolean setterArg) { - this.myLocationEnabled = setterArg; - } + @CanIgnoreReturnValue + public @NonNull Builder setType(@NonNull PlatformPatternItemType setterArg) { + this.type = setterArg; + return this; + } - private @Nullable Boolean myLocationButtonEnabled; + private @Nullable Double length; - public @Nullable Boolean getMyLocationButtonEnabled() { - return myLocationButtonEnabled; - } + @CanIgnoreReturnValue + public @NonNull Builder setLength(@Nullable Double setterArg) { + this.length = setterArg; + return this; + } - public void setMyLocationButtonEnabled(@Nullable Boolean setterArg) { - this.myLocationButtonEnabled = setterArg; + public @NonNull PlatformPatternItem build() { + PlatformPatternItem pigeonReturn = new PlatformPatternItem(); + pigeonReturn.setType(type); + pigeonReturn.setLength(length); + return pigeonReturn; + } } - private @Nullable PlatformEdgeInsets padding; - - public @Nullable PlatformEdgeInsets getPadding() { - return padding; + @NonNull + ArrayList toList() { + ArrayList toListResult = new ArrayList<>(2); + toListResult.add(type); + toListResult.add(length); + return toListResult; } - public void setPadding(@Nullable PlatformEdgeInsets setterArg) { - this.padding = setterArg; + static @NonNull PlatformPatternItem fromList(@NonNull ArrayList pigeonVar_list) { + PlatformPatternItem pigeonResult = new PlatformPatternItem(); + Object type = pigeonVar_list.get(0); + pigeonResult.setType((PlatformPatternItemType) type); + Object length = pigeonVar_list.get(1); + pigeonResult.setLength((Double) length); + return pigeonResult; } + } - private @Nullable Boolean indoorViewEnabled; + /** + * Pigeon equivalent of the Tile class. + * + *

Generated class from Pigeon that represents data sent in messages. + */ + public static final class PlatformTile { + private @NonNull Long width; - public @Nullable Boolean getIndoorViewEnabled() { - return indoorViewEnabled; + public @NonNull Long getWidth() { + return width; } - public void setIndoorViewEnabled(@Nullable Boolean setterArg) { - this.indoorViewEnabled = setterArg; + public void setWidth(@NonNull Long setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"width\" is null."); + } + this.width = setterArg; } - private @Nullable Boolean trafficEnabled; + private @NonNull Long height; - public @Nullable Boolean getTrafficEnabled() { - return trafficEnabled; + public @NonNull Long getHeight() { + return height; } - public void setTrafficEnabled(@Nullable Boolean setterArg) { - this.trafficEnabled = setterArg; + public void setHeight(@NonNull Long setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"height\" is null."); + } + this.height = setterArg; } - private @Nullable Boolean buildingsEnabled; + private @Nullable byte[] data; - public @Nullable Boolean getBuildingsEnabled() { - return buildingsEnabled; + public @Nullable byte[] getData() { + return data; } - public void setBuildingsEnabled(@Nullable Boolean setterArg) { - this.buildingsEnabled = setterArg; + public void setData(@Nullable byte[] setterArg) { + this.data = setterArg; } - private @Nullable Boolean liteModeEnabled; + /** Constructor is non-public to enforce null safety; use Builder. */ + PlatformTile() {} - public @Nullable Boolean getLiteModeEnabled() { - return liteModeEnabled; + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlatformTile that = (PlatformTile) o; + return width.equals(that.width) + && height.equals(that.height) + && Arrays.equals(data, that.data); } - public void setLiteModeEnabled(@Nullable Boolean setterArg) { - this.liteModeEnabled = setterArg; + @Override + public int hashCode() { + int pigeonVar_result = Objects.hash(width, height); + pigeonVar_result = 31 * pigeonVar_result + Arrays.hashCode(data); + return pigeonVar_result; } - private @Nullable String cloudMapId; + public static final class Builder { - public @Nullable String getCloudMapId() { - return cloudMapId; + private @Nullable Long width; + + @CanIgnoreReturnValue + public @NonNull Builder setWidth(@NonNull Long setterArg) { + this.width = setterArg; + return this; + } + + private @Nullable Long height; + + @CanIgnoreReturnValue + public @NonNull Builder setHeight(@NonNull Long setterArg) { + this.height = setterArg; + return this; + } + + private @Nullable byte[] data; + + @CanIgnoreReturnValue + public @NonNull Builder setData(@Nullable byte[] setterArg) { + this.data = setterArg; + return this; + } + + public @NonNull PlatformTile build() { + PlatformTile pigeonReturn = new PlatformTile(); + pigeonReturn.setWidth(width); + pigeonReturn.setHeight(height); + pigeonReturn.setData(data); + return pigeonReturn; + } } - public void setCloudMapId(@Nullable String setterArg) { - this.cloudMapId = setterArg; + @NonNull + ArrayList toList() { + ArrayList toListResult = new ArrayList<>(3); + toListResult.add(width); + toListResult.add(height); + toListResult.add(data); + return toListResult; } - private @Nullable String style; + static @NonNull PlatformTile fromList(@NonNull ArrayList pigeonVar_list) { + PlatformTile pigeonResult = new PlatformTile(); + Object width = pigeonVar_list.get(0); + pigeonResult.setWidth((Long) width); + Object height = pigeonVar_list.get(1); + pigeonResult.setHeight((Long) height); + Object data = pigeonVar_list.get(2); + pigeonResult.setData((byte[]) data); + return pigeonResult; + } + } - public @Nullable String getStyle() { - return style; + /** + * Pigeon equivalent of the TileOverlay class. + * + *

Generated class from Pigeon that represents data sent in messages. + */ + public static final class PlatformTileOverlay { + private @NonNull String tileOverlayId; + + public @NonNull String getTileOverlayId() { + return tileOverlayId; } - public void setStyle(@Nullable String setterArg) { - this.style = setterArg; + public void setTileOverlayId(@NonNull String setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"tileOverlayId\" is null."); + } + this.tileOverlayId = setterArg; + } + + private @NonNull Boolean fadeIn; + + public @NonNull Boolean getFadeIn() { + return fadeIn; + } + + public void setFadeIn(@NonNull Boolean setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"fadeIn\" is null."); + } + this.fadeIn = setterArg; + } + + private @NonNull Double transparency; + + public @NonNull Double getTransparency() { + return transparency; + } + + public void setTransparency(@NonNull Double setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"transparency\" is null."); + } + this.transparency = setterArg; + } + + private @NonNull Long zIndex; + + public @NonNull Long getZIndex() { + return zIndex; + } + + public void setZIndex(@NonNull Long setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"zIndex\" is null."); + } + this.zIndex = setterArg; + } + + private @NonNull Boolean visible; + + public @NonNull Boolean getVisible() { + return visible; + } + + public void setVisible(@NonNull Boolean setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"visible\" is null."); + } + this.visible = setterArg; + } + + private @NonNull Long tileSize; + + public @NonNull Long getTileSize() { + return tileSize; + } + + public void setTileSize(@NonNull Long setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"tileSize\" is null."); + } + this.tileSize = setterArg; } + /** Constructor is non-public to enforce null safety; use Builder. */ + PlatformTileOverlay() {} + @Override public boolean equals(Object o) { if (this == o) { @@ -2788,349 +3213,2197 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - PlatformMapConfiguration that = (PlatformMapConfiguration) o; - return Objects.equals(compassEnabled, that.compassEnabled) - && Objects.equals(cameraTargetBounds, that.cameraTargetBounds) - && Objects.equals(mapType, that.mapType) - && Objects.equals(minMaxZoomPreference, that.minMaxZoomPreference) - && Objects.equals(mapToolbarEnabled, that.mapToolbarEnabled) - && Objects.equals(rotateGesturesEnabled, that.rotateGesturesEnabled) - && Objects.equals(scrollGesturesEnabled, that.scrollGesturesEnabled) - && Objects.equals(tiltGesturesEnabled, that.tiltGesturesEnabled) - && Objects.equals(trackCameraPosition, that.trackCameraPosition) - && Objects.equals(zoomControlsEnabled, that.zoomControlsEnabled) - && Objects.equals(zoomGesturesEnabled, that.zoomGesturesEnabled) - && Objects.equals(myLocationEnabled, that.myLocationEnabled) - && Objects.equals(myLocationButtonEnabled, that.myLocationButtonEnabled) - && Objects.equals(padding, that.padding) - && Objects.equals(indoorViewEnabled, that.indoorViewEnabled) - && Objects.equals(trafficEnabled, that.trafficEnabled) - && Objects.equals(buildingsEnabled, that.buildingsEnabled) - && Objects.equals(liteModeEnabled, that.liteModeEnabled) - && Objects.equals(cloudMapId, that.cloudMapId) - && Objects.equals(style, that.style); + PlatformTileOverlay that = (PlatformTileOverlay) o; + return tileOverlayId.equals(that.tileOverlayId) + && fadeIn.equals(that.fadeIn) + && transparency.equals(that.transparency) + && zIndex.equals(that.zIndex) + && visible.equals(that.visible) + && tileSize.equals(that.tileSize); } @Override public int hashCode() { - return Objects.hash( - compassEnabled, - cameraTargetBounds, - mapType, - minMaxZoomPreference, - mapToolbarEnabled, - rotateGesturesEnabled, - scrollGesturesEnabled, - tiltGesturesEnabled, - trackCameraPosition, - zoomControlsEnabled, - zoomGesturesEnabled, - myLocationEnabled, - myLocationButtonEnabled, - padding, - indoorViewEnabled, - trafficEnabled, - buildingsEnabled, - liteModeEnabled, - cloudMapId, - style); + return Objects.hash(tileOverlayId, fadeIn, transparency, zIndex, visible, tileSize); } public static final class Builder { - private @Nullable Boolean compassEnabled; + private @Nullable String tileOverlayId; @CanIgnoreReturnValue - public @NonNull Builder setCompassEnabled(@Nullable Boolean setterArg) { - this.compassEnabled = setterArg; + public @NonNull Builder setTileOverlayId(@NonNull String setterArg) { + this.tileOverlayId = setterArg; return this; } - private @Nullable PlatformCameraTargetBounds cameraTargetBounds; + private @Nullable Boolean fadeIn; @CanIgnoreReturnValue - public @NonNull Builder setCameraTargetBounds( - @Nullable PlatformCameraTargetBounds setterArg) { - this.cameraTargetBounds = setterArg; + public @NonNull Builder setFadeIn(@NonNull Boolean setterArg) { + this.fadeIn = setterArg; return this; } - private @Nullable PlatformMapType mapType; + private @Nullable Double transparency; @CanIgnoreReturnValue - public @NonNull Builder setMapType(@Nullable PlatformMapType setterArg) { - this.mapType = setterArg; + public @NonNull Builder setTransparency(@NonNull Double setterArg) { + this.transparency = setterArg; return this; } - private @Nullable PlatformZoomRange minMaxZoomPreference; + private @Nullable Long zIndex; @CanIgnoreReturnValue - public @NonNull Builder setMinMaxZoomPreference(@Nullable PlatformZoomRange setterArg) { - this.minMaxZoomPreference = setterArg; + public @NonNull Builder setZIndex(@NonNull Long setterArg) { + this.zIndex = setterArg; return this; } - private @Nullable Boolean mapToolbarEnabled; + private @Nullable Boolean visible; @CanIgnoreReturnValue - public @NonNull Builder setMapToolbarEnabled(@Nullable Boolean setterArg) { - this.mapToolbarEnabled = setterArg; + public @NonNull Builder setVisible(@NonNull Boolean setterArg) { + this.visible = setterArg; + return this; + } + + private @Nullable Long tileSize; + + @CanIgnoreReturnValue + public @NonNull Builder setTileSize(@NonNull Long setterArg) { + this.tileSize = setterArg; + return this; + } + + public @NonNull PlatformTileOverlay build() { + PlatformTileOverlay pigeonReturn = new PlatformTileOverlay(); + pigeonReturn.setTileOverlayId(tileOverlayId); + pigeonReturn.setFadeIn(fadeIn); + pigeonReturn.setTransparency(transparency); + pigeonReturn.setZIndex(zIndex); + pigeonReturn.setVisible(visible); + pigeonReturn.setTileSize(tileSize); + return pigeonReturn; + } + } + + @NonNull + ArrayList toList() { + ArrayList toListResult = new ArrayList<>(6); + toListResult.add(tileOverlayId); + toListResult.add(fadeIn); + toListResult.add(transparency); + toListResult.add(zIndex); + toListResult.add(visible); + toListResult.add(tileSize); + return toListResult; + } + + static @NonNull PlatformTileOverlay fromList(@NonNull ArrayList pigeonVar_list) { + PlatformTileOverlay pigeonResult = new PlatformTileOverlay(); + Object tileOverlayId = pigeonVar_list.get(0); + pigeonResult.setTileOverlayId((String) tileOverlayId); + Object fadeIn = pigeonVar_list.get(1); + pigeonResult.setFadeIn((Boolean) fadeIn); + Object transparency = pigeonVar_list.get(2); + pigeonResult.setTransparency((Double) transparency); + Object zIndex = pigeonVar_list.get(3); + pigeonResult.setZIndex((Long) zIndex); + Object visible = pigeonVar_list.get(4); + pigeonResult.setVisible((Boolean) visible); + Object tileSize = pigeonVar_list.get(5); + pigeonResult.setTileSize((Long) tileSize); + return pigeonResult; + } + } + + /** + * Pigeon equivalent of Flutter's EdgeInsets. + * + *

Generated class from Pigeon that represents data sent in messages. + */ + public static final class PlatformEdgeInsets { + private @NonNull Double top; + + public @NonNull Double getTop() { + return top; + } + + public void setTop(@NonNull Double setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"top\" is null."); + } + this.top = setterArg; + } + + private @NonNull Double bottom; + + public @NonNull Double getBottom() { + return bottom; + } + + public void setBottom(@NonNull Double setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"bottom\" is null."); + } + this.bottom = setterArg; + } + + private @NonNull Double left; + + public @NonNull Double getLeft() { + return left; + } + + public void setLeft(@NonNull Double setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"left\" is null."); + } + this.left = setterArg; + } + + private @NonNull Double right; + + public @NonNull Double getRight() { + return right; + } + + public void setRight(@NonNull Double setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"right\" is null."); + } + this.right = setterArg; + } + + /** Constructor is non-public to enforce null safety; use Builder. */ + PlatformEdgeInsets() {} + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlatformEdgeInsets that = (PlatformEdgeInsets) o; + return top.equals(that.top) + && bottom.equals(that.bottom) + && left.equals(that.left) + && right.equals(that.right); + } + + @Override + public int hashCode() { + return Objects.hash(top, bottom, left, right); + } + + public static final class Builder { + + private @Nullable Double top; + + @CanIgnoreReturnValue + public @NonNull Builder setTop(@NonNull Double setterArg) { + this.top = setterArg; + return this; + } + + private @Nullable Double bottom; + + @CanIgnoreReturnValue + public @NonNull Builder setBottom(@NonNull Double setterArg) { + this.bottom = setterArg; + return this; + } + + private @Nullable Double left; + + @CanIgnoreReturnValue + public @NonNull Builder setLeft(@NonNull Double setterArg) { + this.left = setterArg; + return this; + } + + private @Nullable Double right; + + @CanIgnoreReturnValue + public @NonNull Builder setRight(@NonNull Double setterArg) { + this.right = setterArg; + return this; + } + + public @NonNull PlatformEdgeInsets build() { + PlatformEdgeInsets pigeonReturn = new PlatformEdgeInsets(); + pigeonReturn.setTop(top); + pigeonReturn.setBottom(bottom); + pigeonReturn.setLeft(left); + pigeonReturn.setRight(right); + return pigeonReturn; + } + } + + @NonNull + ArrayList toList() { + ArrayList toListResult = new ArrayList<>(4); + toListResult.add(top); + toListResult.add(bottom); + toListResult.add(left); + toListResult.add(right); + return toListResult; + } + + static @NonNull PlatformEdgeInsets fromList(@NonNull ArrayList pigeonVar_list) { + PlatformEdgeInsets pigeonResult = new PlatformEdgeInsets(); + Object top = pigeonVar_list.get(0); + pigeonResult.setTop((Double) top); + Object bottom = pigeonVar_list.get(1); + pigeonResult.setBottom((Double) bottom); + Object left = pigeonVar_list.get(2); + pigeonResult.setLeft((Double) left); + Object right = pigeonVar_list.get(3); + pigeonResult.setRight((Double) right); + return pigeonResult; + } + } + + /** + * Pigeon equivalent of LatLng. + * + *

Generated class from Pigeon that represents data sent in messages. + */ + public static final class PlatformLatLng { + private @NonNull Double latitude; + + public @NonNull Double getLatitude() { + return latitude; + } + + public void setLatitude(@NonNull Double setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"latitude\" is null."); + } + this.latitude = setterArg; + } + + private @NonNull Double longitude; + + public @NonNull Double getLongitude() { + return longitude; + } + + public void setLongitude(@NonNull Double setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"longitude\" is null."); + } + this.longitude = setterArg; + } + + /** Constructor is non-public to enforce null safety; use Builder. */ + PlatformLatLng() {} + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlatformLatLng that = (PlatformLatLng) o; + return latitude.equals(that.latitude) && longitude.equals(that.longitude); + } + + @Override + public int hashCode() { + return Objects.hash(latitude, longitude); + } + + public static final class Builder { + + private @Nullable Double latitude; + + @CanIgnoreReturnValue + public @NonNull Builder setLatitude(@NonNull Double setterArg) { + this.latitude = setterArg; + return this; + } + + private @Nullable Double longitude; + + @CanIgnoreReturnValue + public @NonNull Builder setLongitude(@NonNull Double setterArg) { + this.longitude = setterArg; + return this; + } + + public @NonNull PlatformLatLng build() { + PlatformLatLng pigeonReturn = new PlatformLatLng(); + pigeonReturn.setLatitude(latitude); + pigeonReturn.setLongitude(longitude); + return pigeonReturn; + } + } + + @NonNull + ArrayList toList() { + ArrayList toListResult = new ArrayList<>(2); + toListResult.add(latitude); + toListResult.add(longitude); + return toListResult; + } + + static @NonNull PlatformLatLng fromList(@NonNull ArrayList pigeonVar_list) { + PlatformLatLng pigeonResult = new PlatformLatLng(); + Object latitude = pigeonVar_list.get(0); + pigeonResult.setLatitude((Double) latitude); + Object longitude = pigeonVar_list.get(1); + pigeonResult.setLongitude((Double) longitude); + return pigeonResult; + } + } + + /** + * Pigeon equivalent of LatLngBounds. + * + *

Generated class from Pigeon that represents data sent in messages. + */ + public static final class PlatformLatLngBounds { + private @NonNull PlatformLatLng northeast; + + public @NonNull PlatformLatLng getNortheast() { + return northeast; + } + + public void setNortheast(@NonNull PlatformLatLng setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"northeast\" is null."); + } + this.northeast = setterArg; + } + + private @NonNull PlatformLatLng southwest; + + public @NonNull PlatformLatLng getSouthwest() { + return southwest; + } + + public void setSouthwest(@NonNull PlatformLatLng setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"southwest\" is null."); + } + this.southwest = setterArg; + } + + /** Constructor is non-public to enforce null safety; use Builder. */ + PlatformLatLngBounds() {} + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlatformLatLngBounds that = (PlatformLatLngBounds) o; + return northeast.equals(that.northeast) && southwest.equals(that.southwest); + } + + @Override + public int hashCode() { + return Objects.hash(northeast, southwest); + } + + public static final class Builder { + + private @Nullable PlatformLatLng northeast; + + @CanIgnoreReturnValue + public @NonNull Builder setNortheast(@NonNull PlatformLatLng setterArg) { + this.northeast = setterArg; + return this; + } + + private @Nullable PlatformLatLng southwest; + + @CanIgnoreReturnValue + public @NonNull Builder setSouthwest(@NonNull PlatformLatLng setterArg) { + this.southwest = setterArg; + return this; + } + + public @NonNull PlatformLatLngBounds build() { + PlatformLatLngBounds pigeonReturn = new PlatformLatLngBounds(); + pigeonReturn.setNortheast(northeast); + pigeonReturn.setSouthwest(southwest); + return pigeonReturn; + } + } + + @NonNull + ArrayList toList() { + ArrayList toListResult = new ArrayList<>(2); + toListResult.add(northeast); + toListResult.add(southwest); + return toListResult; + } + + static @NonNull PlatformLatLngBounds fromList(@NonNull ArrayList pigeonVar_list) { + PlatformLatLngBounds pigeonResult = new PlatformLatLngBounds(); + Object northeast = pigeonVar_list.get(0); + pigeonResult.setNortheast((PlatformLatLng) northeast); + Object southwest = pigeonVar_list.get(1); + pigeonResult.setSouthwest((PlatformLatLng) southwest); + return pigeonResult; + } + } + + /** + * Pigeon equivalent of Cluster. + * + *

Generated class from Pigeon that represents data sent in messages. + */ + public static final class PlatformCluster { + private @NonNull String clusterManagerId; + + public @NonNull String getClusterManagerId() { + return clusterManagerId; + } + + public void setClusterManagerId(@NonNull String setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"clusterManagerId\" is null."); + } + this.clusterManagerId = setterArg; + } + + private @NonNull PlatformLatLng position; + + public @NonNull PlatformLatLng getPosition() { + return position; + } + + public void setPosition(@NonNull PlatformLatLng setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"position\" is null."); + } + this.position = setterArg; + } + + private @NonNull PlatformLatLngBounds bounds; + + public @NonNull PlatformLatLngBounds getBounds() { + return bounds; + } + + public void setBounds(@NonNull PlatformLatLngBounds setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"bounds\" is null."); + } + this.bounds = setterArg; + } + + private @NonNull List markerIds; + + public @NonNull List getMarkerIds() { + return markerIds; + } + + public void setMarkerIds(@NonNull List setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"markerIds\" is null."); + } + this.markerIds = setterArg; + } + + /** Constructor is non-public to enforce null safety; use Builder. */ + PlatformCluster() {} + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlatformCluster that = (PlatformCluster) o; + return clusterManagerId.equals(that.clusterManagerId) + && position.equals(that.position) + && bounds.equals(that.bounds) + && markerIds.equals(that.markerIds); + } + + @Override + public int hashCode() { + return Objects.hash(clusterManagerId, position, bounds, markerIds); + } + + public static final class Builder { + + private @Nullable String clusterManagerId; + + @CanIgnoreReturnValue + public @NonNull Builder setClusterManagerId(@NonNull String setterArg) { + this.clusterManagerId = setterArg; + return this; + } + + private @Nullable PlatformLatLng position; + + @CanIgnoreReturnValue + public @NonNull Builder setPosition(@NonNull PlatformLatLng setterArg) { + this.position = setterArg; + return this; + } + + private @Nullable PlatformLatLngBounds bounds; + + @CanIgnoreReturnValue + public @NonNull Builder setBounds(@NonNull PlatformLatLngBounds setterArg) { + this.bounds = setterArg; + return this; + } + + private @Nullable List markerIds; + + @CanIgnoreReturnValue + public @NonNull Builder setMarkerIds(@NonNull List setterArg) { + this.markerIds = setterArg; + return this; + } + + public @NonNull PlatformCluster build() { + PlatformCluster pigeonReturn = new PlatformCluster(); + pigeonReturn.setClusterManagerId(clusterManagerId); + pigeonReturn.setPosition(position); + pigeonReturn.setBounds(bounds); + pigeonReturn.setMarkerIds(markerIds); + return pigeonReturn; + } + } + + @NonNull + ArrayList toList() { + ArrayList toListResult = new ArrayList<>(4); + toListResult.add(clusterManagerId); + toListResult.add(position); + toListResult.add(bounds); + toListResult.add(markerIds); + return toListResult; + } + + static @NonNull PlatformCluster fromList(@NonNull ArrayList pigeonVar_list) { + PlatformCluster pigeonResult = new PlatformCluster(); + Object clusterManagerId = pigeonVar_list.get(0); + pigeonResult.setClusterManagerId((String) clusterManagerId); + Object position = pigeonVar_list.get(1); + pigeonResult.setPosition((PlatformLatLng) position); + Object bounds = pigeonVar_list.get(2); + pigeonResult.setBounds((PlatformLatLngBounds) bounds); + Object markerIds = pigeonVar_list.get(3); + pigeonResult.setMarkerIds((List) markerIds); + return pigeonResult; + } + } + + /** + * Pigeon equivalent of CameraTargetBounds. + * + *

As with the Dart version, it exists to distinguish between not setting a a target, and + * having an explicitly unbounded target (null [bounds]). + * + *

Generated class from Pigeon that represents data sent in messages. + */ + public static final class PlatformCameraTargetBounds { + private @Nullable PlatformLatLngBounds bounds; + + public @Nullable PlatformLatLngBounds getBounds() { + return bounds; + } + + public void setBounds(@Nullable PlatformLatLngBounds setterArg) { + this.bounds = setterArg; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlatformCameraTargetBounds that = (PlatformCameraTargetBounds) o; + return Objects.equals(bounds, that.bounds); + } + + @Override + public int hashCode() { + return Objects.hash(bounds); + } + + public static final class Builder { + + private @Nullable PlatformLatLngBounds bounds; + + @CanIgnoreReturnValue + public @NonNull Builder setBounds(@Nullable PlatformLatLngBounds setterArg) { + this.bounds = setterArg; + return this; + } + + public @NonNull PlatformCameraTargetBounds build() { + PlatformCameraTargetBounds pigeonReturn = new PlatformCameraTargetBounds(); + pigeonReturn.setBounds(bounds); + return pigeonReturn; + } + } + + @NonNull + ArrayList toList() { + ArrayList toListResult = new ArrayList<>(1); + toListResult.add(bounds); + return toListResult; + } + + static @NonNull PlatformCameraTargetBounds fromList(@NonNull ArrayList pigeonVar_list) { + PlatformCameraTargetBounds pigeonResult = new PlatformCameraTargetBounds(); + Object bounds = pigeonVar_list.get(0); + pigeonResult.setBounds((PlatformLatLngBounds) bounds); + return pigeonResult; + } + } + + /** + * Information passed to the platform view creation. + * + *

Generated class from Pigeon that represents data sent in messages. + */ + public static final class PlatformMapViewCreationParams { + private @NonNull PlatformCameraPosition initialCameraPosition; + + public @NonNull PlatformCameraPosition getInitialCameraPosition() { + return initialCameraPosition; + } + + public void setInitialCameraPosition(@NonNull PlatformCameraPosition setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"initialCameraPosition\" is null."); + } + this.initialCameraPosition = setterArg; + } + + private @NonNull PlatformMapConfiguration mapConfiguration; + + public @NonNull PlatformMapConfiguration getMapConfiguration() { + return mapConfiguration; + } + + public void setMapConfiguration(@NonNull PlatformMapConfiguration setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"mapConfiguration\" is null."); + } + this.mapConfiguration = setterArg; + } + + private @NonNull List initialCircles; + + public @NonNull List getInitialCircles() { + return initialCircles; + } + + public void setInitialCircles(@NonNull List setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"initialCircles\" is null."); + } + this.initialCircles = setterArg; + } + + private @NonNull List initialMarkers; + + public @NonNull List getInitialMarkers() { + return initialMarkers; + } + + public void setInitialMarkers(@NonNull List setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"initialMarkers\" is null."); + } + this.initialMarkers = setterArg; + } + + private @NonNull List initialPolygons; + + public @NonNull List getInitialPolygons() { + return initialPolygons; + } + + public void setInitialPolygons(@NonNull List setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"initialPolygons\" is null."); + } + this.initialPolygons = setterArg; + } + + private @NonNull List initialPolylines; + + public @NonNull List getInitialPolylines() { + return initialPolylines; + } + + public void setInitialPolylines(@NonNull List setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"initialPolylines\" is null."); + } + this.initialPolylines = setterArg; + } + + private @NonNull List initialHeatmaps; + + public @NonNull List getInitialHeatmaps() { + return initialHeatmaps; + } + + public void setInitialHeatmaps(@NonNull List setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"initialHeatmaps\" is null."); + } + this.initialHeatmaps = setterArg; + } + + private @NonNull List initialTileOverlays; + + public @NonNull List getInitialTileOverlays() { + return initialTileOverlays; + } + + public void setInitialTileOverlays(@NonNull List setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"initialTileOverlays\" is null."); + } + this.initialTileOverlays = setterArg; + } + + private @NonNull List initialClusterManagers; + + public @NonNull List getInitialClusterManagers() { + return initialClusterManagers; + } + + public void setInitialClusterManagers(@NonNull List setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"initialClusterManagers\" is null."); + } + this.initialClusterManagers = setterArg; + } + + /** Constructor is non-public to enforce null safety; use Builder. */ + PlatformMapViewCreationParams() {} + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlatformMapViewCreationParams that = (PlatformMapViewCreationParams) o; + return initialCameraPosition.equals(that.initialCameraPosition) + && mapConfiguration.equals(that.mapConfiguration) + && initialCircles.equals(that.initialCircles) + && initialMarkers.equals(that.initialMarkers) + && initialPolygons.equals(that.initialPolygons) + && initialPolylines.equals(that.initialPolylines) + && initialHeatmaps.equals(that.initialHeatmaps) + && initialTileOverlays.equals(that.initialTileOverlays) + && initialClusterManagers.equals(that.initialClusterManagers); + } + + @Override + public int hashCode() { + return Objects.hash( + initialCameraPosition, + mapConfiguration, + initialCircles, + initialMarkers, + initialPolygons, + initialPolylines, + initialHeatmaps, + initialTileOverlays, + initialClusterManagers); + } + + public static final class Builder { + + private @Nullable PlatformCameraPosition initialCameraPosition; + + @CanIgnoreReturnValue + public @NonNull Builder setInitialCameraPosition(@NonNull PlatformCameraPosition setterArg) { + this.initialCameraPosition = setterArg; + return this; + } + + private @Nullable PlatformMapConfiguration mapConfiguration; + + @CanIgnoreReturnValue + public @NonNull Builder setMapConfiguration(@NonNull PlatformMapConfiguration setterArg) { + this.mapConfiguration = setterArg; + return this; + } + + private @Nullable List initialCircles; + + @CanIgnoreReturnValue + public @NonNull Builder setInitialCircles(@NonNull List setterArg) { + this.initialCircles = setterArg; + return this; + } + + private @Nullable List initialMarkers; + + @CanIgnoreReturnValue + public @NonNull Builder setInitialMarkers(@NonNull List setterArg) { + this.initialMarkers = setterArg; + return this; + } + + private @Nullable List initialPolygons; + + @CanIgnoreReturnValue + public @NonNull Builder setInitialPolygons(@NonNull List setterArg) { + this.initialPolygons = setterArg; + return this; + } + + private @Nullable List initialPolylines; + + @CanIgnoreReturnValue + public @NonNull Builder setInitialPolylines(@NonNull List setterArg) { + this.initialPolylines = setterArg; + return this; + } + + private @Nullable List initialHeatmaps; + + @CanIgnoreReturnValue + public @NonNull Builder setInitialHeatmaps(@NonNull List setterArg) { + this.initialHeatmaps = setterArg; + return this; + } + + private @Nullable List initialTileOverlays; + + @CanIgnoreReturnValue + public @NonNull Builder setInitialTileOverlays(@NonNull List setterArg) { + this.initialTileOverlays = setterArg; + return this; + } + + private @Nullable List initialClusterManagers; + + @CanIgnoreReturnValue + public @NonNull Builder setInitialClusterManagers( + @NonNull List setterArg) { + this.initialClusterManagers = setterArg; + return this; + } + + public @NonNull PlatformMapViewCreationParams build() { + PlatformMapViewCreationParams pigeonReturn = new PlatformMapViewCreationParams(); + pigeonReturn.setInitialCameraPosition(initialCameraPosition); + pigeonReturn.setMapConfiguration(mapConfiguration); + pigeonReturn.setInitialCircles(initialCircles); + pigeonReturn.setInitialMarkers(initialMarkers); + pigeonReturn.setInitialPolygons(initialPolygons); + pigeonReturn.setInitialPolylines(initialPolylines); + pigeonReturn.setInitialHeatmaps(initialHeatmaps); + pigeonReturn.setInitialTileOverlays(initialTileOverlays); + pigeonReturn.setInitialClusterManagers(initialClusterManagers); + return pigeonReturn; + } + } + + @NonNull + ArrayList toList() { + ArrayList toListResult = new ArrayList<>(9); + toListResult.add(initialCameraPosition); + toListResult.add(mapConfiguration); + toListResult.add(initialCircles); + toListResult.add(initialMarkers); + toListResult.add(initialPolygons); + toListResult.add(initialPolylines); + toListResult.add(initialHeatmaps); + toListResult.add(initialTileOverlays); + toListResult.add(initialClusterManagers); + return toListResult; + } + + static @NonNull PlatformMapViewCreationParams fromList( + @NonNull ArrayList pigeonVar_list) { + PlatformMapViewCreationParams pigeonResult = new PlatformMapViewCreationParams(); + Object initialCameraPosition = pigeonVar_list.get(0); + pigeonResult.setInitialCameraPosition((PlatformCameraPosition) initialCameraPosition); + Object mapConfiguration = pigeonVar_list.get(1); + pigeonResult.setMapConfiguration((PlatformMapConfiguration) mapConfiguration); + Object initialCircles = pigeonVar_list.get(2); + pigeonResult.setInitialCircles((List) initialCircles); + Object initialMarkers = pigeonVar_list.get(3); + pigeonResult.setInitialMarkers((List) initialMarkers); + Object initialPolygons = pigeonVar_list.get(4); + pigeonResult.setInitialPolygons((List) initialPolygons); + Object initialPolylines = pigeonVar_list.get(5); + pigeonResult.setInitialPolylines((List) initialPolylines); + Object initialHeatmaps = pigeonVar_list.get(6); + pigeonResult.setInitialHeatmaps((List) initialHeatmaps); + Object initialTileOverlays = pigeonVar_list.get(7); + pigeonResult.setInitialTileOverlays((List) initialTileOverlays); + Object initialClusterManagers = pigeonVar_list.get(8); + pigeonResult.setInitialClusterManagers((List) initialClusterManagers); + return pigeonResult; + } + } + + /** + * Pigeon equivalent of MapConfiguration. + * + *

Generated class from Pigeon that represents data sent in messages. + */ + public static final class PlatformMapConfiguration { + private @Nullable Boolean compassEnabled; + + public @Nullable Boolean getCompassEnabled() { + return compassEnabled; + } + + public void setCompassEnabled(@Nullable Boolean setterArg) { + this.compassEnabled = setterArg; + } + + private @Nullable PlatformCameraTargetBounds cameraTargetBounds; + + public @Nullable PlatformCameraTargetBounds getCameraTargetBounds() { + return cameraTargetBounds; + } + + public void setCameraTargetBounds(@Nullable PlatformCameraTargetBounds setterArg) { + this.cameraTargetBounds = setterArg; + } + + private @Nullable PlatformMapType mapType; + + public @Nullable PlatformMapType getMapType() { + return mapType; + } + + public void setMapType(@Nullable PlatformMapType setterArg) { + this.mapType = setterArg; + } + + private @Nullable PlatformZoomRange minMaxZoomPreference; + + public @Nullable PlatformZoomRange getMinMaxZoomPreference() { + return minMaxZoomPreference; + } + + public void setMinMaxZoomPreference(@Nullable PlatformZoomRange setterArg) { + this.minMaxZoomPreference = setterArg; + } + + private @Nullable Boolean mapToolbarEnabled; + + public @Nullable Boolean getMapToolbarEnabled() { + return mapToolbarEnabled; + } + + public void setMapToolbarEnabled(@Nullable Boolean setterArg) { + this.mapToolbarEnabled = setterArg; + } + + private @Nullable Boolean rotateGesturesEnabled; + + public @Nullable Boolean getRotateGesturesEnabled() { + return rotateGesturesEnabled; + } + + public void setRotateGesturesEnabled(@Nullable Boolean setterArg) { + this.rotateGesturesEnabled = setterArg; + } + + private @Nullable Boolean scrollGesturesEnabled; + + public @Nullable Boolean getScrollGesturesEnabled() { + return scrollGesturesEnabled; + } + + public void setScrollGesturesEnabled(@Nullable Boolean setterArg) { + this.scrollGesturesEnabled = setterArg; + } + + private @Nullable Boolean tiltGesturesEnabled; + + public @Nullable Boolean getTiltGesturesEnabled() { + return tiltGesturesEnabled; + } + + public void setTiltGesturesEnabled(@Nullable Boolean setterArg) { + this.tiltGesturesEnabled = setterArg; + } + + private @Nullable Boolean trackCameraPosition; + + public @Nullable Boolean getTrackCameraPosition() { + return trackCameraPosition; + } + + public void setTrackCameraPosition(@Nullable Boolean setterArg) { + this.trackCameraPosition = setterArg; + } + + private @Nullable Boolean zoomControlsEnabled; + + public @Nullable Boolean getZoomControlsEnabled() { + return zoomControlsEnabled; + } + + public void setZoomControlsEnabled(@Nullable Boolean setterArg) { + this.zoomControlsEnabled = setterArg; + } + + private @Nullable Boolean zoomGesturesEnabled; + + public @Nullable Boolean getZoomGesturesEnabled() { + return zoomGesturesEnabled; + } + + public void setZoomGesturesEnabled(@Nullable Boolean setterArg) { + this.zoomGesturesEnabled = setterArg; + } + + private @Nullable Boolean myLocationEnabled; + + public @Nullable Boolean getMyLocationEnabled() { + return myLocationEnabled; + } + + public void setMyLocationEnabled(@Nullable Boolean setterArg) { + this.myLocationEnabled = setterArg; + } + + private @Nullable Boolean myLocationButtonEnabled; + + public @Nullable Boolean getMyLocationButtonEnabled() { + return myLocationButtonEnabled; + } + + public void setMyLocationButtonEnabled(@Nullable Boolean setterArg) { + this.myLocationButtonEnabled = setterArg; + } + + private @Nullable PlatformEdgeInsets padding; + + public @Nullable PlatformEdgeInsets getPadding() { + return padding; + } + + public void setPadding(@Nullable PlatformEdgeInsets setterArg) { + this.padding = setterArg; + } + + private @Nullable Boolean indoorViewEnabled; + + public @Nullable Boolean getIndoorViewEnabled() { + return indoorViewEnabled; + } + + public void setIndoorViewEnabled(@Nullable Boolean setterArg) { + this.indoorViewEnabled = setterArg; + } + + private @Nullable Boolean trafficEnabled; + + public @Nullable Boolean getTrafficEnabled() { + return trafficEnabled; + } + + public void setTrafficEnabled(@Nullable Boolean setterArg) { + this.trafficEnabled = setterArg; + } + + private @Nullable Boolean buildingsEnabled; + + public @Nullable Boolean getBuildingsEnabled() { + return buildingsEnabled; + } + + public void setBuildingsEnabled(@Nullable Boolean setterArg) { + this.buildingsEnabled = setterArg; + } + + private @Nullable Boolean liteModeEnabled; + + public @Nullable Boolean getLiteModeEnabled() { + return liteModeEnabled; + } + + public void setLiteModeEnabled(@Nullable Boolean setterArg) { + this.liteModeEnabled = setterArg; + } + + private @Nullable String cloudMapId; + + public @Nullable String getCloudMapId() { + return cloudMapId; + } + + public void setCloudMapId(@Nullable String setterArg) { + this.cloudMapId = setterArg; + } + + private @Nullable String style; + + public @Nullable String getStyle() { + return style; + } + + public void setStyle(@Nullable String setterArg) { + this.style = setterArg; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlatformMapConfiguration that = (PlatformMapConfiguration) o; + return Objects.equals(compassEnabled, that.compassEnabled) + && Objects.equals(cameraTargetBounds, that.cameraTargetBounds) + && Objects.equals(mapType, that.mapType) + && Objects.equals(minMaxZoomPreference, that.minMaxZoomPreference) + && Objects.equals(mapToolbarEnabled, that.mapToolbarEnabled) + && Objects.equals(rotateGesturesEnabled, that.rotateGesturesEnabled) + && Objects.equals(scrollGesturesEnabled, that.scrollGesturesEnabled) + && Objects.equals(tiltGesturesEnabled, that.tiltGesturesEnabled) + && Objects.equals(trackCameraPosition, that.trackCameraPosition) + && Objects.equals(zoomControlsEnabled, that.zoomControlsEnabled) + && Objects.equals(zoomGesturesEnabled, that.zoomGesturesEnabled) + && Objects.equals(myLocationEnabled, that.myLocationEnabled) + && Objects.equals(myLocationButtonEnabled, that.myLocationButtonEnabled) + && Objects.equals(padding, that.padding) + && Objects.equals(indoorViewEnabled, that.indoorViewEnabled) + && Objects.equals(trafficEnabled, that.trafficEnabled) + && Objects.equals(buildingsEnabled, that.buildingsEnabled) + && Objects.equals(liteModeEnabled, that.liteModeEnabled) + && Objects.equals(cloudMapId, that.cloudMapId) + && Objects.equals(style, that.style); + } + + @Override + public int hashCode() { + return Objects.hash( + compassEnabled, + cameraTargetBounds, + mapType, + minMaxZoomPreference, + mapToolbarEnabled, + rotateGesturesEnabled, + scrollGesturesEnabled, + tiltGesturesEnabled, + trackCameraPosition, + zoomControlsEnabled, + zoomGesturesEnabled, + myLocationEnabled, + myLocationButtonEnabled, + padding, + indoorViewEnabled, + trafficEnabled, + buildingsEnabled, + liteModeEnabled, + cloudMapId, + style); + } + + public static final class Builder { + + private @Nullable Boolean compassEnabled; + + @CanIgnoreReturnValue + public @NonNull Builder setCompassEnabled(@Nullable Boolean setterArg) { + this.compassEnabled = setterArg; + return this; + } + + private @Nullable PlatformCameraTargetBounds cameraTargetBounds; + + @CanIgnoreReturnValue + public @NonNull Builder setCameraTargetBounds( + @Nullable PlatformCameraTargetBounds setterArg) { + this.cameraTargetBounds = setterArg; + return this; + } + + private @Nullable PlatformMapType mapType; + + @CanIgnoreReturnValue + public @NonNull Builder setMapType(@Nullable PlatformMapType setterArg) { + this.mapType = setterArg; + return this; + } + + private @Nullable PlatformZoomRange minMaxZoomPreference; + + @CanIgnoreReturnValue + public @NonNull Builder setMinMaxZoomPreference(@Nullable PlatformZoomRange setterArg) { + this.minMaxZoomPreference = setterArg; + return this; + } + + private @Nullable Boolean mapToolbarEnabled; + + @CanIgnoreReturnValue + public @NonNull Builder setMapToolbarEnabled(@Nullable Boolean setterArg) { + this.mapToolbarEnabled = setterArg; + return this; + } + + private @Nullable Boolean rotateGesturesEnabled; + + @CanIgnoreReturnValue + public @NonNull Builder setRotateGesturesEnabled(@Nullable Boolean setterArg) { + this.rotateGesturesEnabled = setterArg; + return this; + } + + private @Nullable Boolean scrollGesturesEnabled; + + @CanIgnoreReturnValue + public @NonNull Builder setScrollGesturesEnabled(@Nullable Boolean setterArg) { + this.scrollGesturesEnabled = setterArg; + return this; + } + + private @Nullable Boolean tiltGesturesEnabled; + + @CanIgnoreReturnValue + public @NonNull Builder setTiltGesturesEnabled(@Nullable Boolean setterArg) { + this.tiltGesturesEnabled = setterArg; + return this; + } + + private @Nullable Boolean trackCameraPosition; + + @CanIgnoreReturnValue + public @NonNull Builder setTrackCameraPosition(@Nullable Boolean setterArg) { + this.trackCameraPosition = setterArg; + return this; + } + + private @Nullable Boolean zoomControlsEnabled; + + @CanIgnoreReturnValue + public @NonNull Builder setZoomControlsEnabled(@Nullable Boolean setterArg) { + this.zoomControlsEnabled = setterArg; + return this; + } + + private @Nullable Boolean zoomGesturesEnabled; + + @CanIgnoreReturnValue + public @NonNull Builder setZoomGesturesEnabled(@Nullable Boolean setterArg) { + this.zoomGesturesEnabled = setterArg; + return this; + } + + private @Nullable Boolean myLocationEnabled; + + @CanIgnoreReturnValue + public @NonNull Builder setMyLocationEnabled(@Nullable Boolean setterArg) { + this.myLocationEnabled = setterArg; + return this; + } + + private @Nullable Boolean myLocationButtonEnabled; + + @CanIgnoreReturnValue + public @NonNull Builder setMyLocationButtonEnabled(@Nullable Boolean setterArg) { + this.myLocationButtonEnabled = setterArg; + return this; + } + + private @Nullable PlatformEdgeInsets padding; + + @CanIgnoreReturnValue + public @NonNull Builder setPadding(@Nullable PlatformEdgeInsets setterArg) { + this.padding = setterArg; + return this; + } + + private @Nullable Boolean indoorViewEnabled; + + @CanIgnoreReturnValue + public @NonNull Builder setIndoorViewEnabled(@Nullable Boolean setterArg) { + this.indoorViewEnabled = setterArg; + return this; + } + + private @Nullable Boolean trafficEnabled; + + @CanIgnoreReturnValue + public @NonNull Builder setTrafficEnabled(@Nullable Boolean setterArg) { + this.trafficEnabled = setterArg; + return this; + } + + private @Nullable Boolean buildingsEnabled; + + @CanIgnoreReturnValue + public @NonNull Builder setBuildingsEnabled(@Nullable Boolean setterArg) { + this.buildingsEnabled = setterArg; + return this; + } + + private @Nullable Boolean liteModeEnabled; + + @CanIgnoreReturnValue + public @NonNull Builder setLiteModeEnabled(@Nullable Boolean setterArg) { + this.liteModeEnabled = setterArg; + return this; + } + + private @Nullable String cloudMapId; + + @CanIgnoreReturnValue + public @NonNull Builder setCloudMapId(@Nullable String setterArg) { + this.cloudMapId = setterArg; + return this; + } + + private @Nullable String style; + + @CanIgnoreReturnValue + public @NonNull Builder setStyle(@Nullable String setterArg) { + this.style = setterArg; + return this; + } + + public @NonNull PlatformMapConfiguration build() { + PlatformMapConfiguration pigeonReturn = new PlatformMapConfiguration(); + pigeonReturn.setCompassEnabled(compassEnabled); + pigeonReturn.setCameraTargetBounds(cameraTargetBounds); + pigeonReturn.setMapType(mapType); + pigeonReturn.setMinMaxZoomPreference(minMaxZoomPreference); + pigeonReturn.setMapToolbarEnabled(mapToolbarEnabled); + pigeonReturn.setRotateGesturesEnabled(rotateGesturesEnabled); + pigeonReturn.setScrollGesturesEnabled(scrollGesturesEnabled); + pigeonReturn.setTiltGesturesEnabled(tiltGesturesEnabled); + pigeonReturn.setTrackCameraPosition(trackCameraPosition); + pigeonReturn.setZoomControlsEnabled(zoomControlsEnabled); + pigeonReturn.setZoomGesturesEnabled(zoomGesturesEnabled); + pigeonReturn.setMyLocationEnabled(myLocationEnabled); + pigeonReturn.setMyLocationButtonEnabled(myLocationButtonEnabled); + pigeonReturn.setPadding(padding); + pigeonReturn.setIndoorViewEnabled(indoorViewEnabled); + pigeonReturn.setTrafficEnabled(trafficEnabled); + pigeonReturn.setBuildingsEnabled(buildingsEnabled); + pigeonReturn.setLiteModeEnabled(liteModeEnabled); + pigeonReturn.setCloudMapId(cloudMapId); + pigeonReturn.setStyle(style); + return pigeonReturn; + } + } + + @NonNull + ArrayList toList() { + ArrayList toListResult = new ArrayList<>(20); + toListResult.add(compassEnabled); + toListResult.add(cameraTargetBounds); + toListResult.add(mapType); + toListResult.add(minMaxZoomPreference); + toListResult.add(mapToolbarEnabled); + toListResult.add(rotateGesturesEnabled); + toListResult.add(scrollGesturesEnabled); + toListResult.add(tiltGesturesEnabled); + toListResult.add(trackCameraPosition); + toListResult.add(zoomControlsEnabled); + toListResult.add(zoomGesturesEnabled); + toListResult.add(myLocationEnabled); + toListResult.add(myLocationButtonEnabled); + toListResult.add(padding); + toListResult.add(indoorViewEnabled); + toListResult.add(trafficEnabled); + toListResult.add(buildingsEnabled); + toListResult.add(liteModeEnabled); + toListResult.add(cloudMapId); + toListResult.add(style); + return toListResult; + } + + static @NonNull PlatformMapConfiguration fromList(@NonNull ArrayList pigeonVar_list) { + PlatformMapConfiguration pigeonResult = new PlatformMapConfiguration(); + Object compassEnabled = pigeonVar_list.get(0); + pigeonResult.setCompassEnabled((Boolean) compassEnabled); + Object cameraTargetBounds = pigeonVar_list.get(1); + pigeonResult.setCameraTargetBounds((PlatformCameraTargetBounds) cameraTargetBounds); + Object mapType = pigeonVar_list.get(2); + pigeonResult.setMapType((PlatformMapType) mapType); + Object minMaxZoomPreference = pigeonVar_list.get(3); + pigeonResult.setMinMaxZoomPreference((PlatformZoomRange) minMaxZoomPreference); + Object mapToolbarEnabled = pigeonVar_list.get(4); + pigeonResult.setMapToolbarEnabled((Boolean) mapToolbarEnabled); + Object rotateGesturesEnabled = pigeonVar_list.get(5); + pigeonResult.setRotateGesturesEnabled((Boolean) rotateGesturesEnabled); + Object scrollGesturesEnabled = pigeonVar_list.get(6); + pigeonResult.setScrollGesturesEnabled((Boolean) scrollGesturesEnabled); + Object tiltGesturesEnabled = pigeonVar_list.get(7); + pigeonResult.setTiltGesturesEnabled((Boolean) tiltGesturesEnabled); + Object trackCameraPosition = pigeonVar_list.get(8); + pigeonResult.setTrackCameraPosition((Boolean) trackCameraPosition); + Object zoomControlsEnabled = pigeonVar_list.get(9); + pigeonResult.setZoomControlsEnabled((Boolean) zoomControlsEnabled); + Object zoomGesturesEnabled = pigeonVar_list.get(10); + pigeonResult.setZoomGesturesEnabled((Boolean) zoomGesturesEnabled); + Object myLocationEnabled = pigeonVar_list.get(11); + pigeonResult.setMyLocationEnabled((Boolean) myLocationEnabled); + Object myLocationButtonEnabled = pigeonVar_list.get(12); + pigeonResult.setMyLocationButtonEnabled((Boolean) myLocationButtonEnabled); + Object padding = pigeonVar_list.get(13); + pigeonResult.setPadding((PlatformEdgeInsets) padding); + Object indoorViewEnabled = pigeonVar_list.get(14); + pigeonResult.setIndoorViewEnabled((Boolean) indoorViewEnabled); + Object trafficEnabled = pigeonVar_list.get(15); + pigeonResult.setTrafficEnabled((Boolean) trafficEnabled); + Object buildingsEnabled = pigeonVar_list.get(16); + pigeonResult.setBuildingsEnabled((Boolean) buildingsEnabled); + Object liteModeEnabled = pigeonVar_list.get(17); + pigeonResult.setLiteModeEnabled((Boolean) liteModeEnabled); + Object cloudMapId = pigeonVar_list.get(18); + pigeonResult.setCloudMapId((String) cloudMapId); + Object style = pigeonVar_list.get(19); + pigeonResult.setStyle((String) style); + return pigeonResult; + } + } + + /** + * Pigeon representation of an x,y coordinate. + * + *

Generated class from Pigeon that represents data sent in messages. + */ + public static final class PlatformPoint { + private @NonNull Long x; + + public @NonNull Long getX() { + return x; + } + + public void setX(@NonNull Long setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"x\" is null."); + } + this.x = setterArg; + } + + private @NonNull Long y; + + public @NonNull Long getY() { + return y; + } + + public void setY(@NonNull Long setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"y\" is null."); + } + this.y = setterArg; + } + + /** Constructor is non-public to enforce null safety; use Builder. */ + PlatformPoint() {} + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlatformPoint that = (PlatformPoint) o; + return x.equals(that.x) && y.equals(that.y); + } + + @Override + public int hashCode() { + return Objects.hash(x, y); + } + + public static final class Builder { + + private @Nullable Long x; + + @CanIgnoreReturnValue + public @NonNull Builder setX(@NonNull Long setterArg) { + this.x = setterArg; + return this; + } + + private @Nullable Long y; + + @CanIgnoreReturnValue + public @NonNull Builder setY(@NonNull Long setterArg) { + this.y = setterArg; + return this; + } + + public @NonNull PlatformPoint build() { + PlatformPoint pigeonReturn = new PlatformPoint(); + pigeonReturn.setX(x); + pigeonReturn.setY(y); + return pigeonReturn; + } + } + + @NonNull + ArrayList toList() { + ArrayList toListResult = new ArrayList<>(2); + toListResult.add(x); + toListResult.add(y); + return toListResult; + } + + static @NonNull PlatformPoint fromList(@NonNull ArrayList pigeonVar_list) { + PlatformPoint pigeonResult = new PlatformPoint(); + Object x = pigeonVar_list.get(0); + pigeonResult.setX((Long) x); + Object y = pigeonVar_list.get(1); + pigeonResult.setY((Long) y); + return pigeonResult; + } + } + + /** + * Pigeon equivalent of native TileOverlay properties. + * + *

Generated class from Pigeon that represents data sent in messages. + */ + public static final class PlatformTileLayer { + private @NonNull Boolean visible; + + public @NonNull Boolean getVisible() { + return visible; + } + + public void setVisible(@NonNull Boolean setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"visible\" is null."); + } + this.visible = setterArg; + } + + private @NonNull Boolean fadeIn; + + public @NonNull Boolean getFadeIn() { + return fadeIn; + } + + public void setFadeIn(@NonNull Boolean setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"fadeIn\" is null."); + } + this.fadeIn = setterArg; + } + + private @NonNull Double transparency; + + public @NonNull Double getTransparency() { + return transparency; + } + + public void setTransparency(@NonNull Double setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"transparency\" is null."); + } + this.transparency = setterArg; + } + + private @NonNull Double zIndex; + + public @NonNull Double getZIndex() { + return zIndex; + } + + public void setZIndex(@NonNull Double setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"zIndex\" is null."); + } + this.zIndex = setterArg; + } + + /** Constructor is non-public to enforce null safety; use Builder. */ + PlatformTileLayer() {} + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlatformTileLayer that = (PlatformTileLayer) o; + return visible.equals(that.visible) + && fadeIn.equals(that.fadeIn) + && transparency.equals(that.transparency) + && zIndex.equals(that.zIndex); + } + + @Override + public int hashCode() { + return Objects.hash(visible, fadeIn, transparency, zIndex); + } + + public static final class Builder { + + private @Nullable Boolean visible; + + @CanIgnoreReturnValue + public @NonNull Builder setVisible(@NonNull Boolean setterArg) { + this.visible = setterArg; return this; } - private @Nullable Boolean rotateGesturesEnabled; + private @Nullable Boolean fadeIn; + + @CanIgnoreReturnValue + public @NonNull Builder setFadeIn(@NonNull Boolean setterArg) { + this.fadeIn = setterArg; + return this; + } + + private @Nullable Double transparency; + + @CanIgnoreReturnValue + public @NonNull Builder setTransparency(@NonNull Double setterArg) { + this.transparency = setterArg; + return this; + } + + private @Nullable Double zIndex; + + @CanIgnoreReturnValue + public @NonNull Builder setZIndex(@NonNull Double setterArg) { + this.zIndex = setterArg; + return this; + } + + public @NonNull PlatformTileLayer build() { + PlatformTileLayer pigeonReturn = new PlatformTileLayer(); + pigeonReturn.setVisible(visible); + pigeonReturn.setFadeIn(fadeIn); + pigeonReturn.setTransparency(transparency); + pigeonReturn.setZIndex(zIndex); + return pigeonReturn; + } + } + + @NonNull + ArrayList toList() { + ArrayList toListResult = new ArrayList<>(4); + toListResult.add(visible); + toListResult.add(fadeIn); + toListResult.add(transparency); + toListResult.add(zIndex); + return toListResult; + } + + static @NonNull PlatformTileLayer fromList(@NonNull ArrayList pigeonVar_list) { + PlatformTileLayer pigeonResult = new PlatformTileLayer(); + Object visible = pigeonVar_list.get(0); + pigeonResult.setVisible((Boolean) visible); + Object fadeIn = pigeonVar_list.get(1); + pigeonResult.setFadeIn((Boolean) fadeIn); + Object transparency = pigeonVar_list.get(2); + pigeonResult.setTransparency((Double) transparency); + Object zIndex = pigeonVar_list.get(3); + pigeonResult.setZIndex((Double) zIndex); + return pigeonResult; + } + } + + /** + * Possible outcomes of launching a URL. + * + *

Generated class from Pigeon that represents data sent in messages. + */ + public static final class PlatformZoomRange { + private @Nullable Double min; + + public @Nullable Double getMin() { + return min; + } + + public void setMin(@Nullable Double setterArg) { + this.min = setterArg; + } + + private @Nullable Double max; + + public @Nullable Double getMax() { + return max; + } + + public void setMax(@Nullable Double setterArg) { + this.max = setterArg; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlatformZoomRange that = (PlatformZoomRange) o; + return Objects.equals(min, that.min) && Objects.equals(max, that.max); + } + + @Override + public int hashCode() { + return Objects.hash(min, max); + } + + public static final class Builder { + + private @Nullable Double min; + + @CanIgnoreReturnValue + public @NonNull Builder setMin(@Nullable Double setterArg) { + this.min = setterArg; + return this; + } + + private @Nullable Double max; + + @CanIgnoreReturnValue + public @NonNull Builder setMax(@Nullable Double setterArg) { + this.max = setterArg; + return this; + } + + public @NonNull PlatformZoomRange build() { + PlatformZoomRange pigeonReturn = new PlatformZoomRange(); + pigeonReturn.setMin(min); + pigeonReturn.setMax(max); + return pigeonReturn; + } + } + + @NonNull + ArrayList toList() { + ArrayList toListResult = new ArrayList<>(2); + toListResult.add(min); + toListResult.add(max); + return toListResult; + } + + static @NonNull PlatformZoomRange fromList(@NonNull ArrayList pigeonVar_list) { + PlatformZoomRange pigeonResult = new PlatformZoomRange(); + Object min = pigeonVar_list.get(0); + pigeonResult.setMin((Double) min); + Object max = pigeonVar_list.get(1); + pigeonResult.setMax((Double) max); + return pigeonResult; + } + } + + /** + * Pigeon equivalent of [BitmapDescriptor]. As there are multiple disjoint types of + * [BitmapDescriptor], [PlatformBitmap] contains a single field which may hold the pigeon + * equivalent type of any of them. + * + *

Generated class from Pigeon that represents data sent in messages. + */ + public static final class PlatformBitmap { + /** + * One of [PlatformBitmapAssetMap], [PlatformBitmapAsset], [PlatformBitmapAssetImage], + * [PlatformBitmapBytesMap], [PlatformBitmapBytes], or [PlatformBitmapDefaultMarker]. As Pigeon + * does not currently support data class inheritance, this approach allows for the different + * bitmap implementations to be valid argument and return types of the API methods. See + * https://github.com/flutter/flutter/issues/117819. + */ + private @NonNull Object bitmap; + + public @NonNull Object getBitmap() { + return bitmap; + } + + public void setBitmap(@NonNull Object setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"bitmap\" is null."); + } + this.bitmap = setterArg; + } + + /** Constructor is non-public to enforce null safety; use Builder. */ + PlatformBitmap() {} + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlatformBitmap that = (PlatformBitmap) o; + return bitmap.equals(that.bitmap); + } + + @Override + public int hashCode() { + return Objects.hash(bitmap); + } + + public static final class Builder { + + private @Nullable Object bitmap; + + @CanIgnoreReturnValue + public @NonNull Builder setBitmap(@NonNull Object setterArg) { + this.bitmap = setterArg; + return this; + } + + public @NonNull PlatformBitmap build() { + PlatformBitmap pigeonReturn = new PlatformBitmap(); + pigeonReturn.setBitmap(bitmap); + return pigeonReturn; + } + } + + @NonNull + ArrayList toList() { + ArrayList toListResult = new ArrayList<>(1); + toListResult.add(bitmap); + return toListResult; + } + + static @NonNull PlatformBitmap fromList(@NonNull ArrayList pigeonVar_list) { + PlatformBitmap pigeonResult = new PlatformBitmap(); + Object bitmap = pigeonVar_list.get(0); + pigeonResult.setBitmap(bitmap); + return pigeonResult; + } + } + + /** + * Pigeon equivalent of [DefaultMarker]. See + * https://developers.google.com/maps/documentation/android-sdk/reference/com/google/android/libraries/maps/model/BitmapDescriptorFactory#defaultMarker(float) + * + *

Generated class from Pigeon that represents data sent in messages. + */ + public static final class PlatformBitmapDefaultMarker { + private @Nullable Double hue; + + public @Nullable Double getHue() { + return hue; + } + + public void setHue(@Nullable Double setterArg) { + this.hue = setterArg; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlatformBitmapDefaultMarker that = (PlatformBitmapDefaultMarker) o; + return Objects.equals(hue, that.hue); + } + + @Override + public int hashCode() { + return Objects.hash(hue); + } + + public static final class Builder { + + private @Nullable Double hue; + + @CanIgnoreReturnValue + public @NonNull Builder setHue(@Nullable Double setterArg) { + this.hue = setterArg; + return this; + } + + public @NonNull PlatformBitmapDefaultMarker build() { + PlatformBitmapDefaultMarker pigeonReturn = new PlatformBitmapDefaultMarker(); + pigeonReturn.setHue(hue); + return pigeonReturn; + } + } + + @NonNull + ArrayList toList() { + ArrayList toListResult = new ArrayList<>(1); + toListResult.add(hue); + return toListResult; + } + + static @NonNull PlatformBitmapDefaultMarker fromList( + @NonNull ArrayList pigeonVar_list) { + PlatformBitmapDefaultMarker pigeonResult = new PlatformBitmapDefaultMarker(); + Object hue = pigeonVar_list.get(0); + pigeonResult.setHue((Double) hue); + return pigeonResult; + } + } - @CanIgnoreReturnValue - public @NonNull Builder setRotateGesturesEnabled(@Nullable Boolean setterArg) { - this.rotateGesturesEnabled = setterArg; - return this; - } + /** + * Pigeon equivalent of [BytesBitmap]. See + * https://developers.google.com/maps/documentation/android-sdk/reference/com/google/android/libraries/maps/model/BitmapDescriptorFactory#fromBitmap(android.graphics.Bitmap) + * + *

Generated class from Pigeon that represents data sent in messages. + */ + public static final class PlatformBitmapBytes { + private @NonNull byte[] byteData; - private @Nullable Boolean scrollGesturesEnabled; + public @NonNull byte[] getByteData() { + return byteData; + } - @CanIgnoreReturnValue - public @NonNull Builder setScrollGesturesEnabled(@Nullable Boolean setterArg) { - this.scrollGesturesEnabled = setterArg; - return this; + public void setByteData(@NonNull byte[] setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"byteData\" is null."); } + this.byteData = setterArg; + } - private @Nullable Boolean tiltGesturesEnabled; + private @Nullable PlatformDoublePair size; - @CanIgnoreReturnValue - public @NonNull Builder setTiltGesturesEnabled(@Nullable Boolean setterArg) { - this.tiltGesturesEnabled = setterArg; - return this; - } + public @Nullable PlatformDoublePair getSize() { + return size; + } - private @Nullable Boolean trackCameraPosition; + public void setSize(@Nullable PlatformDoublePair setterArg) { + this.size = setterArg; + } - @CanIgnoreReturnValue - public @NonNull Builder setTrackCameraPosition(@Nullable Boolean setterArg) { - this.trackCameraPosition = setterArg; - return this; + /** Constructor is non-public to enforce null safety; use Builder. */ + PlatformBitmapBytes() {} + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; } + PlatformBitmapBytes that = (PlatformBitmapBytes) o; + return Arrays.equals(byteData, that.byteData) && Objects.equals(size, that.size); + } - private @Nullable Boolean zoomControlsEnabled; + @Override + public int hashCode() { + int pigeonVar_result = Objects.hash(size); + pigeonVar_result = 31 * pigeonVar_result + Arrays.hashCode(byteData); + return pigeonVar_result; + } - @CanIgnoreReturnValue - public @NonNull Builder setZoomControlsEnabled(@Nullable Boolean setterArg) { - this.zoomControlsEnabled = setterArg; - return this; - } + public static final class Builder { - private @Nullable Boolean zoomGesturesEnabled; + private @Nullable byte[] byteData; @CanIgnoreReturnValue - public @NonNull Builder setZoomGesturesEnabled(@Nullable Boolean setterArg) { - this.zoomGesturesEnabled = setterArg; + public @NonNull Builder setByteData(@NonNull byte[] setterArg) { + this.byteData = setterArg; return this; } - private @Nullable Boolean myLocationEnabled; + private @Nullable PlatformDoublePair size; @CanIgnoreReturnValue - public @NonNull Builder setMyLocationEnabled(@Nullable Boolean setterArg) { - this.myLocationEnabled = setterArg; + public @NonNull Builder setSize(@Nullable PlatformDoublePair setterArg) { + this.size = setterArg; return this; } - private @Nullable Boolean myLocationButtonEnabled; - - @CanIgnoreReturnValue - public @NonNull Builder setMyLocationButtonEnabled(@Nullable Boolean setterArg) { - this.myLocationButtonEnabled = setterArg; - return this; + public @NonNull PlatformBitmapBytes build() { + PlatformBitmapBytes pigeonReturn = new PlatformBitmapBytes(); + pigeonReturn.setByteData(byteData); + pigeonReturn.setSize(size); + return pigeonReturn; } + } - private @Nullable PlatformEdgeInsets padding; + @NonNull + ArrayList toList() { + ArrayList toListResult = new ArrayList<>(2); + toListResult.add(byteData); + toListResult.add(size); + return toListResult; + } - @CanIgnoreReturnValue - public @NonNull Builder setPadding(@Nullable PlatformEdgeInsets setterArg) { - this.padding = setterArg; - return this; - } + static @NonNull PlatformBitmapBytes fromList(@NonNull ArrayList pigeonVar_list) { + PlatformBitmapBytes pigeonResult = new PlatformBitmapBytes(); + Object byteData = pigeonVar_list.get(0); + pigeonResult.setByteData((byte[]) byteData); + Object size = pigeonVar_list.get(1); + pigeonResult.setSize((PlatformDoublePair) size); + return pigeonResult; + } + } - private @Nullable Boolean indoorViewEnabled; + /** + * Pigeon equivalent of [AssetBitmap]. See + * https://developers.google.com/maps/documentation/android-sdk/reference/com/google/android/libraries/maps/model/BitmapDescriptorFactory#public-static-bitmapdescriptor-fromasset-string-assetname + * + *

Generated class from Pigeon that represents data sent in messages. + */ + public static final class PlatformBitmapAsset { + private @NonNull String name; - @CanIgnoreReturnValue - public @NonNull Builder setIndoorViewEnabled(@Nullable Boolean setterArg) { - this.indoorViewEnabled = setterArg; - return this; + public @NonNull String getName() { + return name; + } + + public void setName(@NonNull String setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"name\" is null."); } + this.name = setterArg; + } - private @Nullable Boolean trafficEnabled; + private @Nullable String pkg; - @CanIgnoreReturnValue - public @NonNull Builder setTrafficEnabled(@Nullable Boolean setterArg) { - this.trafficEnabled = setterArg; - return this; - } + public @Nullable String getPkg() { + return pkg; + } - private @Nullable Boolean buildingsEnabled; + public void setPkg(@Nullable String setterArg) { + this.pkg = setterArg; + } - @CanIgnoreReturnValue - public @NonNull Builder setBuildingsEnabled(@Nullable Boolean setterArg) { - this.buildingsEnabled = setterArg; - return this; + /** Constructor is non-public to enforce null safety; use Builder. */ + PlatformBitmapAsset() {} + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; } + PlatformBitmapAsset that = (PlatformBitmapAsset) o; + return name.equals(that.name) && Objects.equals(pkg, that.pkg); + } - private @Nullable Boolean liteModeEnabled; + @Override + public int hashCode() { + return Objects.hash(name, pkg); + } - @CanIgnoreReturnValue - public @NonNull Builder setLiteModeEnabled(@Nullable Boolean setterArg) { - this.liteModeEnabled = setterArg; - return this; - } + public static final class Builder { - private @Nullable String cloudMapId; + private @Nullable String name; @CanIgnoreReturnValue - public @NonNull Builder setCloudMapId(@Nullable String setterArg) { - this.cloudMapId = setterArg; + public @NonNull Builder setName(@NonNull String setterArg) { + this.name = setterArg; return this; } - private @Nullable String style; + private @Nullable String pkg; @CanIgnoreReturnValue - public @NonNull Builder setStyle(@Nullable String setterArg) { - this.style = setterArg; + public @NonNull Builder setPkg(@Nullable String setterArg) { + this.pkg = setterArg; return this; } - public @NonNull PlatformMapConfiguration build() { - PlatformMapConfiguration pigeonReturn = new PlatformMapConfiguration(); - pigeonReturn.setCompassEnabled(compassEnabled); - pigeonReturn.setCameraTargetBounds(cameraTargetBounds); - pigeonReturn.setMapType(mapType); - pigeonReturn.setMinMaxZoomPreference(minMaxZoomPreference); - pigeonReturn.setMapToolbarEnabled(mapToolbarEnabled); - pigeonReturn.setRotateGesturesEnabled(rotateGesturesEnabled); - pigeonReturn.setScrollGesturesEnabled(scrollGesturesEnabled); - pigeonReturn.setTiltGesturesEnabled(tiltGesturesEnabled); - pigeonReturn.setTrackCameraPosition(trackCameraPosition); - pigeonReturn.setZoomControlsEnabled(zoomControlsEnabled); - pigeonReturn.setZoomGesturesEnabled(zoomGesturesEnabled); - pigeonReturn.setMyLocationEnabled(myLocationEnabled); - pigeonReturn.setMyLocationButtonEnabled(myLocationButtonEnabled); - pigeonReturn.setPadding(padding); - pigeonReturn.setIndoorViewEnabled(indoorViewEnabled); - pigeonReturn.setTrafficEnabled(trafficEnabled); - pigeonReturn.setBuildingsEnabled(buildingsEnabled); - pigeonReturn.setLiteModeEnabled(liteModeEnabled); - pigeonReturn.setCloudMapId(cloudMapId); - pigeonReturn.setStyle(style); + public @NonNull PlatformBitmapAsset build() { + PlatformBitmapAsset pigeonReturn = new PlatformBitmapAsset(); + pigeonReturn.setName(name); + pigeonReturn.setPkg(pkg); return pigeonReturn; } } @NonNull ArrayList toList() { - ArrayList toListResult = new ArrayList(20); - toListResult.add(compassEnabled); - toListResult.add(cameraTargetBounds); - toListResult.add(mapType); - toListResult.add(minMaxZoomPreference); - toListResult.add(mapToolbarEnabled); - toListResult.add(rotateGesturesEnabled); - toListResult.add(scrollGesturesEnabled); - toListResult.add(tiltGesturesEnabled); - toListResult.add(trackCameraPosition); - toListResult.add(zoomControlsEnabled); - toListResult.add(zoomGesturesEnabled); - toListResult.add(myLocationEnabled); - toListResult.add(myLocationButtonEnabled); - toListResult.add(padding); - toListResult.add(indoorViewEnabled); - toListResult.add(trafficEnabled); - toListResult.add(buildingsEnabled); - toListResult.add(liteModeEnabled); - toListResult.add(cloudMapId); - toListResult.add(style); + ArrayList toListResult = new ArrayList<>(2); + toListResult.add(name); + toListResult.add(pkg); return toListResult; } - static @NonNull PlatformMapConfiguration fromList(@NonNull ArrayList __pigeon_list) { - PlatformMapConfiguration pigeonResult = new PlatformMapConfiguration(); - Object compassEnabled = __pigeon_list.get(0); - pigeonResult.setCompassEnabled((Boolean) compassEnabled); - Object cameraTargetBounds = __pigeon_list.get(1); - pigeonResult.setCameraTargetBounds((PlatformCameraTargetBounds) cameraTargetBounds); - Object mapType = __pigeon_list.get(2); - pigeonResult.setMapType((PlatformMapType) mapType); - Object minMaxZoomPreference = __pigeon_list.get(3); - pigeonResult.setMinMaxZoomPreference((PlatformZoomRange) minMaxZoomPreference); - Object mapToolbarEnabled = __pigeon_list.get(4); - pigeonResult.setMapToolbarEnabled((Boolean) mapToolbarEnabled); - Object rotateGesturesEnabled = __pigeon_list.get(5); - pigeonResult.setRotateGesturesEnabled((Boolean) rotateGesturesEnabled); - Object scrollGesturesEnabled = __pigeon_list.get(6); - pigeonResult.setScrollGesturesEnabled((Boolean) scrollGesturesEnabled); - Object tiltGesturesEnabled = __pigeon_list.get(7); - pigeonResult.setTiltGesturesEnabled((Boolean) tiltGesturesEnabled); - Object trackCameraPosition = __pigeon_list.get(8); - pigeonResult.setTrackCameraPosition((Boolean) trackCameraPosition); - Object zoomControlsEnabled = __pigeon_list.get(9); - pigeonResult.setZoomControlsEnabled((Boolean) zoomControlsEnabled); - Object zoomGesturesEnabled = __pigeon_list.get(10); - pigeonResult.setZoomGesturesEnabled((Boolean) zoomGesturesEnabled); - Object myLocationEnabled = __pigeon_list.get(11); - pigeonResult.setMyLocationEnabled((Boolean) myLocationEnabled); - Object myLocationButtonEnabled = __pigeon_list.get(12); - pigeonResult.setMyLocationButtonEnabled((Boolean) myLocationButtonEnabled); - Object padding = __pigeon_list.get(13); - pigeonResult.setPadding((PlatformEdgeInsets) padding); - Object indoorViewEnabled = __pigeon_list.get(14); - pigeonResult.setIndoorViewEnabled((Boolean) indoorViewEnabled); - Object trafficEnabled = __pigeon_list.get(15); - pigeonResult.setTrafficEnabled((Boolean) trafficEnabled); - Object buildingsEnabled = __pigeon_list.get(16); - pigeonResult.setBuildingsEnabled((Boolean) buildingsEnabled); - Object liteModeEnabled = __pigeon_list.get(17); - pigeonResult.setLiteModeEnabled((Boolean) liteModeEnabled); - Object cloudMapId = __pigeon_list.get(18); - pigeonResult.setCloudMapId((String) cloudMapId); - Object style = __pigeon_list.get(19); - pigeonResult.setStyle((String) style); + static @NonNull PlatformBitmapAsset fromList(@NonNull ArrayList pigeonVar_list) { + PlatformBitmapAsset pigeonResult = new PlatformBitmapAsset(); + Object name = pigeonVar_list.get(0); + pigeonResult.setName((String) name); + Object pkg = pigeonVar_list.get(1); + pigeonResult.setPkg((String) pkg); return pigeonResult; } } /** - * Pigeon representation of an x,y coordinate. + * Pigeon equivalent of [AssetImageBitmap]. See + * https://developers.google.com/maps/documentation/android-sdk/reference/com/google/android/libraries/maps/model/BitmapDescriptorFactory#public-static-bitmapdescriptor-fromasset-string-assetname * *

Generated class from Pigeon that represents data sent in messages. */ - public static final class PlatformPoint { - private @NonNull Long x; + public static final class PlatformBitmapAssetImage { + private @NonNull String name; - public @NonNull Long getX() { - return x; + public @NonNull String getName() { + return name; } - public void setX(@NonNull Long setterArg) { + public void setName(@NonNull String setterArg) { if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"x\" is null."); + throw new IllegalStateException("Nonnull field \"name\" is null."); } - this.x = setterArg; + this.name = setterArg; } - private @NonNull Long y; + private @NonNull Double scale; - public @NonNull Long getY() { - return y; + public @NonNull Double getScale() { + return scale; } - public void setY(@NonNull Long setterArg) { + public void setScale(@NonNull Double setterArg) { if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"y\" is null."); + throw new IllegalStateException("Nonnull field \"scale\" is null."); } - this.y = setterArg; + this.scale = setterArg; + } + + private @Nullable PlatformDoublePair size; + + public @Nullable PlatformDoublePair getSize() { + return size; + } + + public void setSize(@Nullable PlatformDoublePair setterArg) { + this.size = setterArg; } /** Constructor is non-public to enforce null safety; use Builder. */ - PlatformPoint() {} + PlatformBitmapAssetImage() {} @Override public boolean equals(Object o) { @@ -3140,119 +5413,139 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - PlatformPoint that = (PlatformPoint) o; - return x.equals(that.x) && y.equals(that.y); + PlatformBitmapAssetImage that = (PlatformBitmapAssetImage) o; + return name.equals(that.name) && scale.equals(that.scale) && Objects.equals(size, that.size); } @Override public int hashCode() { - return Objects.hash(x, y); + return Objects.hash(name, scale, size); } public static final class Builder { - private @Nullable Long x; + private @Nullable String name; @CanIgnoreReturnValue - public @NonNull Builder setX(@NonNull Long setterArg) { - this.x = setterArg; + public @NonNull Builder setName(@NonNull String setterArg) { + this.name = setterArg; return this; } - private @Nullable Long y; + private @Nullable Double scale; @CanIgnoreReturnValue - public @NonNull Builder setY(@NonNull Long setterArg) { - this.y = setterArg; + public @NonNull Builder setScale(@NonNull Double setterArg) { + this.scale = setterArg; return this; } - public @NonNull PlatformPoint build() { - PlatformPoint pigeonReturn = new PlatformPoint(); - pigeonReturn.setX(x); - pigeonReturn.setY(y); + private @Nullable PlatformDoublePair size; + + @CanIgnoreReturnValue + public @NonNull Builder setSize(@Nullable PlatformDoublePair setterArg) { + this.size = setterArg; + return this; + } + + public @NonNull PlatformBitmapAssetImage build() { + PlatformBitmapAssetImage pigeonReturn = new PlatformBitmapAssetImage(); + pigeonReturn.setName(name); + pigeonReturn.setScale(scale); + pigeonReturn.setSize(size); return pigeonReturn; } } @NonNull ArrayList toList() { - ArrayList toListResult = new ArrayList(2); - toListResult.add(x); - toListResult.add(y); + ArrayList toListResult = new ArrayList<>(3); + toListResult.add(name); + toListResult.add(scale); + toListResult.add(size); return toListResult; } - static @NonNull PlatformPoint fromList(@NonNull ArrayList __pigeon_list) { - PlatformPoint pigeonResult = new PlatformPoint(); - Object x = __pigeon_list.get(0); - pigeonResult.setX((x == null) ? null : ((x instanceof Integer) ? (Integer) x : (Long) x)); - Object y = __pigeon_list.get(1); - pigeonResult.setY((y == null) ? null : ((y instanceof Integer) ? (Integer) y : (Long) y)); + static @NonNull PlatformBitmapAssetImage fromList(@NonNull ArrayList pigeonVar_list) { + PlatformBitmapAssetImage pigeonResult = new PlatformBitmapAssetImage(); + Object name = pigeonVar_list.get(0); + pigeonResult.setName((String) name); + Object scale = pigeonVar_list.get(1); + pigeonResult.setScale((Double) scale); + Object size = pigeonVar_list.get(2); + pigeonResult.setSize((PlatformDoublePair) size); return pigeonResult; } } /** - * Pigeon equivalent of native TileOverlay properties. + * Pigeon equivalent of [AssetMapBitmap]. See + * https://developers.google.com/maps/documentation/android-sdk/reference/com/google/android/libraries/maps/model/BitmapDescriptorFactory#public-static-bitmapdescriptor-fromasset-string-assetname * *

Generated class from Pigeon that represents data sent in messages. */ - public static final class PlatformTileLayer { - private @NonNull Boolean visible; + public static final class PlatformBitmapAssetMap { + private @NonNull String assetName; - public @NonNull Boolean getVisible() { - return visible; + public @NonNull String getAssetName() { + return assetName; } - public void setVisible(@NonNull Boolean setterArg) { + public void setAssetName(@NonNull String setterArg) { if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"visible\" is null."); + throw new IllegalStateException("Nonnull field \"assetName\" is null."); } - this.visible = setterArg; + this.assetName = setterArg; } - private @NonNull Boolean fadeIn; + private @NonNull PlatformMapBitmapScaling bitmapScaling; - public @NonNull Boolean getFadeIn() { - return fadeIn; + public @NonNull PlatformMapBitmapScaling getBitmapScaling() { + return bitmapScaling; } - public void setFadeIn(@NonNull Boolean setterArg) { + public void setBitmapScaling(@NonNull PlatformMapBitmapScaling setterArg) { if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"fadeIn\" is null."); + throw new IllegalStateException("Nonnull field \"bitmapScaling\" is null."); } - this.fadeIn = setterArg; + this.bitmapScaling = setterArg; } - private @NonNull Double transparency; + private @NonNull Double imagePixelRatio; - public @NonNull Double getTransparency() { - return transparency; + public @NonNull Double getImagePixelRatio() { + return imagePixelRatio; } - public void setTransparency(@NonNull Double setterArg) { + public void setImagePixelRatio(@NonNull Double setterArg) { if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"transparency\" is null."); + throw new IllegalStateException("Nonnull field \"imagePixelRatio\" is null."); } - this.transparency = setterArg; + this.imagePixelRatio = setterArg; + } + + private @Nullable Double width; + + public @Nullable Double getWidth() { + return width; } - private @NonNull Double zIndex; + public void setWidth(@Nullable Double setterArg) { + this.width = setterArg; + } - public @NonNull Double getZIndex() { - return zIndex; + private @Nullable Double height; + + public @Nullable Double getHeight() { + return height; } - public void setZIndex(@NonNull Double setterArg) { - if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"zIndex\" is null."); - } - this.zIndex = setterArg; + public void setHeight(@Nullable Double setterArg) { + this.height = setterArg; } /** Constructor is non-public to enforce null safety; use Builder. */ - PlatformTileLayer() {} + PlatformBitmapAssetMap() {} @Override public boolean equals(Object o) { @@ -3262,112 +5555,168 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - PlatformTileLayer that = (PlatformTileLayer) o; - return visible.equals(that.visible) - && fadeIn.equals(that.fadeIn) - && transparency.equals(that.transparency) - && zIndex.equals(that.zIndex); + PlatformBitmapAssetMap that = (PlatformBitmapAssetMap) o; + return assetName.equals(that.assetName) + && bitmapScaling.equals(that.bitmapScaling) + && imagePixelRatio.equals(that.imagePixelRatio) + && Objects.equals(width, that.width) + && Objects.equals(height, that.height); } @Override public int hashCode() { - return Objects.hash(visible, fadeIn, transparency, zIndex); + return Objects.hash(assetName, bitmapScaling, imagePixelRatio, width, height); } public static final class Builder { - private @Nullable Boolean visible; + private @Nullable String assetName; @CanIgnoreReturnValue - public @NonNull Builder setVisible(@NonNull Boolean setterArg) { - this.visible = setterArg; + public @NonNull Builder setAssetName(@NonNull String setterArg) { + this.assetName = setterArg; return this; } - private @Nullable Boolean fadeIn; + private @Nullable PlatformMapBitmapScaling bitmapScaling; @CanIgnoreReturnValue - public @NonNull Builder setFadeIn(@NonNull Boolean setterArg) { - this.fadeIn = setterArg; + public @NonNull Builder setBitmapScaling(@NonNull PlatformMapBitmapScaling setterArg) { + this.bitmapScaling = setterArg; return this; } - private @Nullable Double transparency; + private @Nullable Double imagePixelRatio; @CanIgnoreReturnValue - public @NonNull Builder setTransparency(@NonNull Double setterArg) { - this.transparency = setterArg; + public @NonNull Builder setImagePixelRatio(@NonNull Double setterArg) { + this.imagePixelRatio = setterArg; return this; } - private @Nullable Double zIndex; + private @Nullable Double width; @CanIgnoreReturnValue - public @NonNull Builder setZIndex(@NonNull Double setterArg) { - this.zIndex = setterArg; + public @NonNull Builder setWidth(@Nullable Double setterArg) { + this.width = setterArg; return this; } - public @NonNull PlatformTileLayer build() { - PlatformTileLayer pigeonReturn = new PlatformTileLayer(); - pigeonReturn.setVisible(visible); - pigeonReturn.setFadeIn(fadeIn); - pigeonReturn.setTransparency(transparency); - pigeonReturn.setZIndex(zIndex); + private @Nullable Double height; + + @CanIgnoreReturnValue + public @NonNull Builder setHeight(@Nullable Double setterArg) { + this.height = setterArg; + return this; + } + + public @NonNull PlatformBitmapAssetMap build() { + PlatformBitmapAssetMap pigeonReturn = new PlatformBitmapAssetMap(); + pigeonReturn.setAssetName(assetName); + pigeonReturn.setBitmapScaling(bitmapScaling); + pigeonReturn.setImagePixelRatio(imagePixelRatio); + pigeonReturn.setWidth(width); + pigeonReturn.setHeight(height); return pigeonReturn; } } @NonNull ArrayList toList() { - ArrayList toListResult = new ArrayList(4); - toListResult.add(visible); - toListResult.add(fadeIn); - toListResult.add(transparency); - toListResult.add(zIndex); + ArrayList toListResult = new ArrayList<>(5); + toListResult.add(assetName); + toListResult.add(bitmapScaling); + toListResult.add(imagePixelRatio); + toListResult.add(width); + toListResult.add(height); return toListResult; } - static @NonNull PlatformTileLayer fromList(@NonNull ArrayList __pigeon_list) { - PlatformTileLayer pigeonResult = new PlatformTileLayer(); - Object visible = __pigeon_list.get(0); - pigeonResult.setVisible((Boolean) visible); - Object fadeIn = __pigeon_list.get(1); - pigeonResult.setFadeIn((Boolean) fadeIn); - Object transparency = __pigeon_list.get(2); - pigeonResult.setTransparency((Double) transparency); - Object zIndex = __pigeon_list.get(3); - pigeonResult.setZIndex((Double) zIndex); + static @NonNull PlatformBitmapAssetMap fromList(@NonNull ArrayList pigeonVar_list) { + PlatformBitmapAssetMap pigeonResult = new PlatformBitmapAssetMap(); + Object assetName = pigeonVar_list.get(0); + pigeonResult.setAssetName((String) assetName); + Object bitmapScaling = pigeonVar_list.get(1); + pigeonResult.setBitmapScaling((PlatformMapBitmapScaling) bitmapScaling); + Object imagePixelRatio = pigeonVar_list.get(2); + pigeonResult.setImagePixelRatio((Double) imagePixelRatio); + Object width = pigeonVar_list.get(3); + pigeonResult.setWidth((Double) width); + Object height = pigeonVar_list.get(4); + pigeonResult.setHeight((Double) height); return pigeonResult; } } /** - * Possible outcomes of launching a URL. + * Pigeon equivalent of [BytesMapBitmap]. See + * https://developers.google.com/maps/documentation/android-sdk/reference/com/google/android/libraries/maps/model/BitmapDescriptorFactory#public-static-bitmapdescriptor-frombitmap-bitmap-image * *

Generated class from Pigeon that represents data sent in messages. */ - public static final class PlatformZoomRange { - private @Nullable Double min; + public static final class PlatformBitmapBytesMap { + private @NonNull byte[] byteData; - public @Nullable Double getMin() { - return min; + public @NonNull byte[] getByteData() { + return byteData; } - public void setMin(@Nullable Double setterArg) { - this.min = setterArg; + public void setByteData(@NonNull byte[] setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"byteData\" is null."); + } + this.byteData = setterArg; } - private @Nullable Double max; + private @NonNull PlatformMapBitmapScaling bitmapScaling; - public @Nullable Double getMax() { - return max; + public @NonNull PlatformMapBitmapScaling getBitmapScaling() { + return bitmapScaling; } - public void setMax(@Nullable Double setterArg) { - this.max = setterArg; + public void setBitmapScaling(@NonNull PlatformMapBitmapScaling setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"bitmapScaling\" is null."); + } + this.bitmapScaling = setterArg; + } + + private @NonNull Double imagePixelRatio; + + public @NonNull Double getImagePixelRatio() { + return imagePixelRatio; + } + + public void setImagePixelRatio(@NonNull Double setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"imagePixelRatio\" is null."); + } + this.imagePixelRatio = setterArg; + } + + private @Nullable Double width; + + public @Nullable Double getWidth() { + return width; + } + + public void setWidth(@Nullable Double setterArg) { + this.width = setterArg; + } + + private @Nullable Double height; + + public @Nullable Double getHeight() { + return height; + } + + public void setHeight(@Nullable Double setterArg) { + this.height = setterArg; } + /** Constructor is non-public to enforce null safety; use Builder. */ + PlatformBitmapBytesMap() {} + @Override public boolean equals(Object o) { if (this == o) { @@ -3376,55 +5725,97 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - PlatformZoomRange that = (PlatformZoomRange) o; - return Objects.equals(min, that.min) && Objects.equals(max, that.max); + PlatformBitmapBytesMap that = (PlatformBitmapBytesMap) o; + return Arrays.equals(byteData, that.byteData) + && bitmapScaling.equals(that.bitmapScaling) + && imagePixelRatio.equals(that.imagePixelRatio) + && Objects.equals(width, that.width) + && Objects.equals(height, that.height); } @Override public int hashCode() { - return Objects.hash(min, max); + int pigeonVar_result = Objects.hash(bitmapScaling, imagePixelRatio, width, height); + pigeonVar_result = 31 * pigeonVar_result + Arrays.hashCode(byteData); + return pigeonVar_result; } public static final class Builder { - private @Nullable Double min; + private @Nullable byte[] byteData; @CanIgnoreReturnValue - public @NonNull Builder setMin(@Nullable Double setterArg) { - this.min = setterArg; + public @NonNull Builder setByteData(@NonNull byte[] setterArg) { + this.byteData = setterArg; return this; } - private @Nullable Double max; + private @Nullable PlatformMapBitmapScaling bitmapScaling; @CanIgnoreReturnValue - public @NonNull Builder setMax(@Nullable Double setterArg) { - this.max = setterArg; + public @NonNull Builder setBitmapScaling(@NonNull PlatformMapBitmapScaling setterArg) { + this.bitmapScaling = setterArg; return this; } - public @NonNull PlatformZoomRange build() { - PlatformZoomRange pigeonReturn = new PlatformZoomRange(); - pigeonReturn.setMin(min); - pigeonReturn.setMax(max); + private @Nullable Double imagePixelRatio; + + @CanIgnoreReturnValue + public @NonNull Builder setImagePixelRatio(@NonNull Double setterArg) { + this.imagePixelRatio = setterArg; + return this; + } + + private @Nullable Double width; + + @CanIgnoreReturnValue + public @NonNull Builder setWidth(@Nullable Double setterArg) { + this.width = setterArg; + return this; + } + + private @Nullable Double height; + + @CanIgnoreReturnValue + public @NonNull Builder setHeight(@Nullable Double setterArg) { + this.height = setterArg; + return this; + } + + public @NonNull PlatformBitmapBytesMap build() { + PlatformBitmapBytesMap pigeonReturn = new PlatformBitmapBytesMap(); + pigeonReturn.setByteData(byteData); + pigeonReturn.setBitmapScaling(bitmapScaling); + pigeonReturn.setImagePixelRatio(imagePixelRatio); + pigeonReturn.setWidth(width); + pigeonReturn.setHeight(height); return pigeonReturn; } } @NonNull ArrayList toList() { - ArrayList toListResult = new ArrayList(2); - toListResult.add(min); - toListResult.add(max); + ArrayList toListResult = new ArrayList<>(5); + toListResult.add(byteData); + toListResult.add(bitmapScaling); + toListResult.add(imagePixelRatio); + toListResult.add(width); + toListResult.add(height); return toListResult; } - static @NonNull PlatformZoomRange fromList(@NonNull ArrayList __pigeon_list) { - PlatformZoomRange pigeonResult = new PlatformZoomRange(); - Object min = __pigeon_list.get(0); - pigeonResult.setMin((Double) min); - Object max = __pigeon_list.get(1); - pigeonResult.setMax((Double) max); + static @NonNull PlatformBitmapBytesMap fromList(@NonNull ArrayList pigeonVar_list) { + PlatformBitmapBytesMap pigeonResult = new PlatformBitmapBytesMap(); + Object byteData = pigeonVar_list.get(0); + pigeonResult.setByteData((byte[]) byteData); + Object bitmapScaling = pigeonVar_list.get(1); + pigeonResult.setBitmapScaling((PlatformMapBitmapScaling) bitmapScaling); + Object imagePixelRatio = pigeonVar_list.get(2); + pigeonResult.setImagePixelRatio((Double) imagePixelRatio); + Object width = pigeonVar_list.get(3); + pigeonResult.setWidth((Double) width); + Object height = pigeonVar_list.get(4); + pigeonResult.setHeight((Double) height); return pigeonResult; } } @@ -3438,63 +5829,119 @@ private PigeonCodec() {} protected Object readValueOfType(byte type, @NonNull ByteBuffer buffer) { switch (type) { case (byte) 129: - return PlatformCameraPosition.fromList((ArrayList) readValue(buffer)); + { + Object value = readValue(buffer); + return value == null ? null : PlatformMapType.values()[((Long) value).intValue()]; + } case (byte) 130: - return PlatformCameraUpdate.fromList((ArrayList) readValue(buffer)); + { + Object value = readValue(buffer); + return value == null ? null : PlatformRendererType.values()[((Long) value).intValue()]; + } case (byte) 131: - return PlatformCircle.fromList((ArrayList) readValue(buffer)); + { + Object value = readValue(buffer); + return value == null ? null : PlatformJointType.values()[((Long) value).intValue()]; + } case (byte) 132: - return PlatformHeatmap.fromList((ArrayList) readValue(buffer)); + { + Object value = readValue(buffer); + return value == null ? null : PlatformCapType.values()[((Long) value).intValue()]; + } case (byte) 133: - return PlatformClusterManager.fromList((ArrayList) readValue(buffer)); + { + Object value = readValue(buffer); + return value == null + ? null + : PlatformPatternItemType.values()[((Long) value).intValue()]; + } case (byte) 134: - return PlatformOffset.fromList((ArrayList) readValue(buffer)); + { + Object value = readValue(buffer); + return value == null + ? null + : PlatformMapBitmapScaling.values()[((Long) value).intValue()]; + } case (byte) 135: - return PlatformInfoWindow.fromList((ArrayList) readValue(buffer)); + return PlatformCameraPosition.fromList((ArrayList) readValue(buffer)); case (byte) 136: - return PlatformMarker.fromList((ArrayList) readValue(buffer)); + return PlatformCameraUpdate.fromList((ArrayList) readValue(buffer)); case (byte) 137: - return PlatformPolygon.fromList((ArrayList) readValue(buffer)); + return PlatformCameraUpdateNewCameraPosition.fromList( + (ArrayList) readValue(buffer)); case (byte) 138: - return PlatformPolyline.fromList((ArrayList) readValue(buffer)); + return PlatformCameraUpdateNewLatLng.fromList((ArrayList) readValue(buffer)); case (byte) 139: - return PlatformTile.fromList((ArrayList) readValue(buffer)); + return PlatformCameraUpdateNewLatLngBounds.fromList( + (ArrayList) readValue(buffer)); case (byte) 140: - return PlatformTileOverlay.fromList((ArrayList) readValue(buffer)); + return PlatformCameraUpdateNewLatLngZoom.fromList((ArrayList) readValue(buffer)); case (byte) 141: - return PlatformEdgeInsets.fromList((ArrayList) readValue(buffer)); + return PlatformCameraUpdateScrollBy.fromList((ArrayList) readValue(buffer)); case (byte) 142: - return PlatformLatLng.fromList((ArrayList) readValue(buffer)); + return PlatformCameraUpdateZoomBy.fromList((ArrayList) readValue(buffer)); case (byte) 143: - return PlatformLatLngBounds.fromList((ArrayList) readValue(buffer)); + return PlatformCameraUpdateZoom.fromList((ArrayList) readValue(buffer)); case (byte) 144: - return PlatformCluster.fromList((ArrayList) readValue(buffer)); + return PlatformCameraUpdateZoomTo.fromList((ArrayList) readValue(buffer)); case (byte) 145: - return PlatformCameraTargetBounds.fromList((ArrayList) readValue(buffer)); + return PlatformCircle.fromList((ArrayList) readValue(buffer)); case (byte) 146: - return PlatformMapViewCreationParams.fromList((ArrayList) readValue(buffer)); + return PlatformHeatmap.fromList((ArrayList) readValue(buffer)); case (byte) 147: - return PlatformMapConfiguration.fromList((ArrayList) readValue(buffer)); + return PlatformClusterManager.fromList((ArrayList) readValue(buffer)); case (byte) 148: - return PlatformPoint.fromList((ArrayList) readValue(buffer)); + return PlatformDoublePair.fromList((ArrayList) readValue(buffer)); case (byte) 149: - return PlatformTileLayer.fromList((ArrayList) readValue(buffer)); + return PlatformInfoWindow.fromList((ArrayList) readValue(buffer)); case (byte) 150: - return PlatformZoomRange.fromList((ArrayList) readValue(buffer)); + return PlatformMarker.fromList((ArrayList) readValue(buffer)); case (byte) 151: - // Manual edit to fix https://github.com/flutter/flutter/issues/150108 - // the way the generator will fix it once the PR lands. - { - Object value = readValue(buffer); - return value == null ? null : PlatformMapType.values()[(int) value]; - } + return PlatformPolygon.fromList((ArrayList) readValue(buffer)); case (byte) 152: - // Manual edit to fix https://github.com/flutter/flutter/issues/150108 - // the way the generator will fix it once the PR lands. - { - Object value = readValue(buffer); - return value == null ? null : PlatformRendererType.values()[(int) value]; - } + return PlatformPolyline.fromList((ArrayList) readValue(buffer)); + case (byte) 153: + return PlatformCap.fromList((ArrayList) readValue(buffer)); + case (byte) 154: + return PlatformPatternItem.fromList((ArrayList) readValue(buffer)); + case (byte) 155: + return PlatformTile.fromList((ArrayList) readValue(buffer)); + case (byte) 156: + return PlatformTileOverlay.fromList((ArrayList) readValue(buffer)); + case (byte) 157: + return PlatformEdgeInsets.fromList((ArrayList) readValue(buffer)); + case (byte) 158: + return PlatformLatLng.fromList((ArrayList) readValue(buffer)); + case (byte) 159: + return PlatformLatLngBounds.fromList((ArrayList) readValue(buffer)); + case (byte) 160: + return PlatformCluster.fromList((ArrayList) readValue(buffer)); + case (byte) 161: + return PlatformCameraTargetBounds.fromList((ArrayList) readValue(buffer)); + case (byte) 162: + return PlatformMapViewCreationParams.fromList((ArrayList) readValue(buffer)); + case (byte) 163: + return PlatformMapConfiguration.fromList((ArrayList) readValue(buffer)); + case (byte) 164: + return PlatformPoint.fromList((ArrayList) readValue(buffer)); + case (byte) 165: + return PlatformTileLayer.fromList((ArrayList) readValue(buffer)); + case (byte) 166: + return PlatformZoomRange.fromList((ArrayList) readValue(buffer)); + case (byte) 167: + return PlatformBitmap.fromList((ArrayList) readValue(buffer)); + case (byte) 168: + return PlatformBitmapDefaultMarker.fromList((ArrayList) readValue(buffer)); + case (byte) 169: + return PlatformBitmapBytes.fromList((ArrayList) readValue(buffer)); + case (byte) 170: + return PlatformBitmapAsset.fromList((ArrayList) readValue(buffer)); + case (byte) 171: + return PlatformBitmapAssetImage.fromList((ArrayList) readValue(buffer)); + case (byte) 172: + return PlatformBitmapAssetMap.fromList((ArrayList) readValue(buffer)); + case (byte) 173: + return PlatformBitmapBytesMap.fromList((ArrayList) readValue(buffer)); default: return super.readValueOfType(type, buffer); } @@ -3502,78 +5949,141 @@ protected Object readValueOfType(byte type, @NonNull ByteBuffer buffer) { @Override protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { - if (value instanceof PlatformCameraPosition) { + if (value instanceof PlatformMapType) { stream.write(129); + writeValue(stream, value == null ? null : ((PlatformMapType) value).index); + } else if (value instanceof PlatformRendererType) { + stream.write(130); + writeValue(stream, value == null ? null : ((PlatformRendererType) value).index); + } else if (value instanceof PlatformJointType) { + stream.write(131); + writeValue(stream, value == null ? null : ((PlatformJointType) value).index); + } else if (value instanceof PlatformCapType) { + stream.write(132); + writeValue(stream, value == null ? null : ((PlatformCapType) value).index); + } else if (value instanceof PlatformPatternItemType) { + stream.write(133); + writeValue(stream, value == null ? null : ((PlatformPatternItemType) value).index); + } else if (value instanceof PlatformMapBitmapScaling) { + stream.write(134); + writeValue(stream, value == null ? null : ((PlatformMapBitmapScaling) value).index); + } else if (value instanceof PlatformCameraPosition) { + stream.write(135); writeValue(stream, ((PlatformCameraPosition) value).toList()); } else if (value instanceof PlatformCameraUpdate) { - stream.write(130); + stream.write(136); writeValue(stream, ((PlatformCameraUpdate) value).toList()); + } else if (value instanceof PlatformCameraUpdateNewCameraPosition) { + stream.write(137); + writeValue(stream, ((PlatformCameraUpdateNewCameraPosition) value).toList()); + } else if (value instanceof PlatformCameraUpdateNewLatLng) { + stream.write(138); + writeValue(stream, ((PlatformCameraUpdateNewLatLng) value).toList()); + } else if (value instanceof PlatformCameraUpdateNewLatLngBounds) { + stream.write(139); + writeValue(stream, ((PlatformCameraUpdateNewLatLngBounds) value).toList()); + } else if (value instanceof PlatformCameraUpdateNewLatLngZoom) { + stream.write(140); + writeValue(stream, ((PlatformCameraUpdateNewLatLngZoom) value).toList()); + } else if (value instanceof PlatformCameraUpdateScrollBy) { + stream.write(141); + writeValue(stream, ((PlatformCameraUpdateScrollBy) value).toList()); + } else if (value instanceof PlatformCameraUpdateZoomBy) { + stream.write(142); + writeValue(stream, ((PlatformCameraUpdateZoomBy) value).toList()); + } else if (value instanceof PlatformCameraUpdateZoom) { + stream.write(143); + writeValue(stream, ((PlatformCameraUpdateZoom) value).toList()); + } else if (value instanceof PlatformCameraUpdateZoomTo) { + stream.write(144); + writeValue(stream, ((PlatformCameraUpdateZoomTo) value).toList()); } else if (value instanceof PlatformCircle) { - stream.write(131); + stream.write(145); writeValue(stream, ((PlatformCircle) value).toList()); } else if (value instanceof PlatformHeatmap) { - stream.write(132); + stream.write(146); writeValue(stream, ((PlatformHeatmap) value).toList()); } else if (value instanceof PlatformClusterManager) { - stream.write(133); + stream.write(147); writeValue(stream, ((PlatformClusterManager) value).toList()); - } else if (value instanceof PlatformOffset) { - stream.write(134); - writeValue(stream, ((PlatformOffset) value).toList()); + } else if (value instanceof PlatformDoublePair) { + stream.write(148); + writeValue(stream, ((PlatformDoublePair) value).toList()); } else if (value instanceof PlatformInfoWindow) { - stream.write(135); + stream.write(149); writeValue(stream, ((PlatformInfoWindow) value).toList()); } else if (value instanceof PlatformMarker) { - stream.write(136); + stream.write(150); writeValue(stream, ((PlatformMarker) value).toList()); } else if (value instanceof PlatformPolygon) { - stream.write(137); + stream.write(151); writeValue(stream, ((PlatformPolygon) value).toList()); } else if (value instanceof PlatformPolyline) { - stream.write(138); + stream.write(152); writeValue(stream, ((PlatformPolyline) value).toList()); + } else if (value instanceof PlatformCap) { + stream.write(153); + writeValue(stream, ((PlatformCap) value).toList()); + } else if (value instanceof PlatformPatternItem) { + stream.write(154); + writeValue(stream, ((PlatformPatternItem) value).toList()); } else if (value instanceof PlatformTile) { - stream.write(139); + stream.write(155); writeValue(stream, ((PlatformTile) value).toList()); } else if (value instanceof PlatformTileOverlay) { - stream.write(140); + stream.write(156); writeValue(stream, ((PlatformTileOverlay) value).toList()); } else if (value instanceof PlatformEdgeInsets) { - stream.write(141); + stream.write(157); writeValue(stream, ((PlatformEdgeInsets) value).toList()); } else if (value instanceof PlatformLatLng) { - stream.write(142); + stream.write(158); writeValue(stream, ((PlatformLatLng) value).toList()); } else if (value instanceof PlatformLatLngBounds) { - stream.write(143); + stream.write(159); writeValue(stream, ((PlatformLatLngBounds) value).toList()); } else if (value instanceof PlatformCluster) { - stream.write(144); + stream.write(160); writeValue(stream, ((PlatformCluster) value).toList()); } else if (value instanceof PlatformCameraTargetBounds) { - stream.write(145); + stream.write(161); writeValue(stream, ((PlatformCameraTargetBounds) value).toList()); } else if (value instanceof PlatformMapViewCreationParams) { - stream.write(146); + stream.write(162); writeValue(stream, ((PlatformMapViewCreationParams) value).toList()); } else if (value instanceof PlatformMapConfiguration) { - stream.write(147); + stream.write(163); writeValue(stream, ((PlatformMapConfiguration) value).toList()); } else if (value instanceof PlatformPoint) { - stream.write(148); + stream.write(164); writeValue(stream, ((PlatformPoint) value).toList()); } else if (value instanceof PlatformTileLayer) { - stream.write(149); + stream.write(165); writeValue(stream, ((PlatformTileLayer) value).toList()); } else if (value instanceof PlatformZoomRange) { - stream.write(150); + stream.write(166); writeValue(stream, ((PlatformZoomRange) value).toList()); - } else if (value instanceof PlatformMapType) { - stream.write(151); - writeValue(stream, value == null ? null : ((PlatformMapType) value).index); - } else if (value instanceof PlatformRendererType) { - stream.write(152); - writeValue(stream, value == null ? null : ((PlatformRendererType) value).index); + } else if (value instanceof PlatformBitmap) { + stream.write(167); + writeValue(stream, ((PlatformBitmap) value).toList()); + } else if (value instanceof PlatformBitmapDefaultMarker) { + stream.write(168); + writeValue(stream, ((PlatformBitmapDefaultMarker) value).toList()); + } else if (value instanceof PlatformBitmapBytes) { + stream.write(169); + writeValue(stream, ((PlatformBitmapBytes) value).toList()); + } else if (value instanceof PlatformBitmapAsset) { + stream.write(170); + writeValue(stream, ((PlatformBitmapAsset) value).toList()); + } else if (value instanceof PlatformBitmapAssetImage) { + stream.write(171); + writeValue(stream, ((PlatformBitmapAssetImage) value).toList()); + } else if (value instanceof PlatformBitmapAssetMap) { + stream.write(172); + writeValue(stream, ((PlatformBitmapAssetMap) value).toList()); + } else if (value instanceof PlatformBitmapBytesMap) { + stream.write(173); + writeValue(stream, ((PlatformBitmapBytesMap) value).toList()); } else { super.writeValue(stream, value); } @@ -3723,7 +6233,7 @@ static void setUp( if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); VoidResult resultCallback = new VoidResult() { public void success() { @@ -3753,15 +6263,14 @@ public void error(Throwable error) { if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; PlatformMapConfiguration configurationArg = (PlatformMapConfiguration) args.get(0); try { api.updateMapConfiguration(configurationArg); wrapped.add(0, null); } catch (Throwable exception) { - ArrayList wrappedError = wrapError(exception); - wrapped = wrappedError; + wrapped = wrapError(exception); } reply.reply(wrapped); }); @@ -3779,7 +6288,7 @@ public void error(Throwable error) { if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; List toAddArg = (List) args.get(0); List toChangeArg = (List) args.get(1); @@ -3788,8 +6297,7 @@ public void error(Throwable error) { api.updateCircles(toAddArg, toChangeArg, idsToRemoveArg); wrapped.add(0, null); } catch (Throwable exception) { - ArrayList wrappedError = wrapError(exception); - wrapped = wrappedError; + wrapped = wrapError(exception); } reply.reply(wrapped); }); @@ -3807,7 +6315,7 @@ public void error(Throwable error) { if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; List toAddArg = (List) args.get(0); List toChangeArg = (List) args.get(1); @@ -3816,8 +6324,7 @@ public void error(Throwable error) { api.updateHeatmaps(toAddArg, toChangeArg, idsToRemoveArg); wrapped.add(0, null); } catch (Throwable exception) { - ArrayList wrappedError = wrapError(exception); - wrapped = wrappedError; + wrapped = wrapError(exception); } reply.reply(wrapped); }); @@ -3835,7 +6342,7 @@ public void error(Throwable error) { if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; List toAddArg = (List) args.get(0); List idsToRemoveArg = (List) args.get(1); @@ -3843,8 +6350,7 @@ public void error(Throwable error) { api.updateClusterManagers(toAddArg, idsToRemoveArg); wrapped.add(0, null); } catch (Throwable exception) { - ArrayList wrappedError = wrapError(exception); - wrapped = wrappedError; + wrapped = wrapError(exception); } reply.reply(wrapped); }); @@ -3862,7 +6368,7 @@ public void error(Throwable error) { if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; List toAddArg = (List) args.get(0); List toChangeArg = (List) args.get(1); @@ -3871,8 +6377,7 @@ public void error(Throwable error) { api.updateMarkers(toAddArg, toChangeArg, idsToRemoveArg); wrapped.add(0, null); } catch (Throwable exception) { - ArrayList wrappedError = wrapError(exception); - wrapped = wrappedError; + wrapped = wrapError(exception); } reply.reply(wrapped); }); @@ -3890,7 +6395,7 @@ public void error(Throwable error) { if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; List toAddArg = (List) args.get(0); List toChangeArg = (List) args.get(1); @@ -3899,8 +6404,7 @@ public void error(Throwable error) { api.updatePolygons(toAddArg, toChangeArg, idsToRemoveArg); wrapped.add(0, null); } catch (Throwable exception) { - ArrayList wrappedError = wrapError(exception); - wrapped = wrappedError; + wrapped = wrapError(exception); } reply.reply(wrapped); }); @@ -3918,7 +6422,7 @@ public void error(Throwable error) { if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; List toAddArg = (List) args.get(0); List toChangeArg = (List) args.get(1); @@ -3927,8 +6431,7 @@ public void error(Throwable error) { api.updatePolylines(toAddArg, toChangeArg, idsToRemoveArg); wrapped.add(0, null); } catch (Throwable exception) { - ArrayList wrappedError = wrapError(exception); - wrapped = wrappedError; + wrapped = wrapError(exception); } reply.reply(wrapped); }); @@ -3946,7 +6449,7 @@ public void error(Throwable error) { if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; List toAddArg = (List) args.get(0); List toChangeArg = (List) args.get(1); @@ -3955,8 +6458,7 @@ public void error(Throwable error) { api.updateTileOverlays(toAddArg, toChangeArg, idsToRemoveArg); wrapped.add(0, null); } catch (Throwable exception) { - ArrayList wrappedError = wrapError(exception); - wrapped = wrappedError; + wrapped = wrapError(exception); } reply.reply(wrapped); }); @@ -3974,15 +6476,14 @@ public void error(Throwable error) { if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; PlatformLatLng latLngArg = (PlatformLatLng) args.get(0); try { PlatformPoint output = api.getScreenCoordinate(latLngArg); wrapped.add(0, output); } catch (Throwable exception) { - ArrayList wrappedError = wrapError(exception); - wrapped = wrappedError; + wrapped = wrapError(exception); } reply.reply(wrapped); }); @@ -4000,15 +6501,14 @@ public void error(Throwable error) { if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; PlatformPoint screenCoordinateArg = (PlatformPoint) args.get(0); try { PlatformLatLng output = api.getLatLng(screenCoordinateArg); wrapped.add(0, output); } catch (Throwable exception) { - ArrayList wrappedError = wrapError(exception); - wrapped = wrappedError; + wrapped = wrapError(exception); } reply.reply(wrapped); }); @@ -4026,13 +6526,12 @@ public void error(Throwable error) { if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); try { PlatformLatLngBounds output = api.getVisibleRegion(); wrapped.add(0, output); } catch (Throwable exception) { - ArrayList wrappedError = wrapError(exception); - wrapped = wrappedError; + wrapped = wrapError(exception); } reply.reply(wrapped); }); @@ -4050,15 +6549,14 @@ public void error(Throwable error) { if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; PlatformCameraUpdate cameraUpdateArg = (PlatformCameraUpdate) args.get(0); try { api.moveCamera(cameraUpdateArg); wrapped.add(0, null); } catch (Throwable exception) { - ArrayList wrappedError = wrapError(exception); - wrapped = wrappedError; + wrapped = wrapError(exception); } reply.reply(wrapped); }); @@ -4076,15 +6574,14 @@ public void error(Throwable error) { if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; PlatformCameraUpdate cameraUpdateArg = (PlatformCameraUpdate) args.get(0); try { api.animateCamera(cameraUpdateArg); wrapped.add(0, null); } catch (Throwable exception) { - ArrayList wrappedError = wrapError(exception); - wrapped = wrappedError; + wrapped = wrapError(exception); } reply.reply(wrapped); }); @@ -4102,13 +6599,12 @@ public void error(Throwable error) { if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); try { Double output = api.getZoomLevel(); wrapped.add(0, output); } catch (Throwable exception) { - ArrayList wrappedError = wrapError(exception); - wrapped = wrappedError; + wrapped = wrapError(exception); } reply.reply(wrapped); }); @@ -4126,15 +6622,14 @@ public void error(Throwable error) { if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; String markerIdArg = (String) args.get(0); try { api.showInfoWindow(markerIdArg); wrapped.add(0, null); } catch (Throwable exception) { - ArrayList wrappedError = wrapError(exception); - wrapped = wrappedError; + wrapped = wrapError(exception); } reply.reply(wrapped); }); @@ -4152,15 +6647,14 @@ public void error(Throwable error) { if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; String markerIdArg = (String) args.get(0); try { api.hideInfoWindow(markerIdArg); wrapped.add(0, null); } catch (Throwable exception) { - ArrayList wrappedError = wrapError(exception); - wrapped = wrappedError; + wrapped = wrapError(exception); } reply.reply(wrapped); }); @@ -4178,15 +6672,14 @@ public void error(Throwable error) { if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; String markerIdArg = (String) args.get(0); try { Boolean output = api.isInfoWindowShown(markerIdArg); wrapped.add(0, output); } catch (Throwable exception) { - ArrayList wrappedError = wrapError(exception); - wrapped = wrappedError; + wrapped = wrapError(exception); } reply.reply(wrapped); }); @@ -4204,15 +6697,14 @@ public void error(Throwable error) { if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; String styleArg = (String) args.get(0); try { Boolean output = api.setStyle(styleArg); wrapped.add(0, output); } catch (Throwable exception) { - ArrayList wrappedError = wrapError(exception); - wrapped = wrappedError; + wrapped = wrapError(exception); } reply.reply(wrapped); }); @@ -4230,13 +6722,12 @@ public void error(Throwable error) { if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); try { Boolean output = api.didLastStyleSucceed(); wrapped.add(0, output); } catch (Throwable exception) { - ArrayList wrappedError = wrapError(exception); - wrapped = wrappedError; + wrapped = wrapError(exception); } reply.reply(wrapped); }); @@ -4254,15 +6745,14 @@ public void error(Throwable error) { if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; String tileOverlayIdArg = (String) args.get(0); try { api.clearTileCache(tileOverlayIdArg); wrapped.add(0, null); } catch (Throwable exception) { - ArrayList wrappedError = wrapError(exception); - wrapped = wrappedError; + wrapped = wrapError(exception); } reply.reply(wrapped); }); @@ -4280,7 +6770,7 @@ public void error(Throwable error) { if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); Result resultCallback = new Result() { public void success(byte[] result) { @@ -4317,8 +6807,7 @@ public MapsCallbackApi( this.messageChannelSuffix = messageChannelSuffix.isEmpty() ? "" : "." + messageChannelSuffix; } - /** Public interface for sending reply. */ - /** The codec used by MapsCallbackApi. */ + /** Public interface for sending reply. The codec used by MapsCallbackApi. */ static @NonNull MessageCodec getCodec() { return PigeonCodec.INSTANCE; } @@ -4337,9 +6826,7 @@ public void onCameraMoveStarted(@NonNull VoidResult result) { if (listReply.size() > 1) { result.error( new FlutterError( - (String) listReply.get(0), - (String) listReply.get(1), - (String) listReply.get(2))); + (String) listReply.get(0), (String) listReply.get(1), listReply.get(2))); } else { result.success(); } @@ -4357,16 +6844,14 @@ public void onCameraMove( BasicMessageChannel channel = new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( - new ArrayList(Collections.singletonList(cameraPositionArg)), + new ArrayList<>(Collections.singletonList(cameraPositionArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { result.error( new FlutterError( - (String) listReply.get(0), - (String) listReply.get(1), - (String) listReply.get(2))); + (String) listReply.get(0), (String) listReply.get(1), listReply.get(2))); } else { result.success(); } @@ -4390,9 +6875,7 @@ public void onCameraIdle(@NonNull VoidResult result) { if (listReply.size() > 1) { result.error( new FlutterError( - (String) listReply.get(0), - (String) listReply.get(1), - (String) listReply.get(2))); + (String) listReply.get(0), (String) listReply.get(1), listReply.get(2))); } else { result.success(); } @@ -4409,16 +6892,14 @@ public void onTap(@NonNull PlatformLatLng positionArg, @NonNull VoidResult resul BasicMessageChannel channel = new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( - new ArrayList(Collections.singletonList(positionArg)), + new ArrayList<>(Collections.singletonList(positionArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { result.error( new FlutterError( - (String) listReply.get(0), - (String) listReply.get(1), - (String) listReply.get(2))); + (String) listReply.get(0), (String) listReply.get(1), listReply.get(2))); } else { result.success(); } @@ -4435,16 +6916,14 @@ public void onLongPress(@NonNull PlatformLatLng positionArg, @NonNull VoidResult BasicMessageChannel channel = new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( - new ArrayList(Collections.singletonList(positionArg)), + new ArrayList<>(Collections.singletonList(positionArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { result.error( new FlutterError( - (String) listReply.get(0), - (String) listReply.get(1), - (String) listReply.get(2))); + (String) listReply.get(0), (String) listReply.get(1), listReply.get(2))); } else { result.success(); } @@ -4461,16 +6940,14 @@ public void onMarkerTap(@NonNull String markerIdArg, @NonNull VoidResult result) BasicMessageChannel channel = new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( - new ArrayList(Collections.singletonList(markerIdArg)), + new ArrayList<>(Collections.singletonList(markerIdArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { result.error( new FlutterError( - (String) listReply.get(0), - (String) listReply.get(1), - (String) listReply.get(2))); + (String) listReply.get(0), (String) listReply.get(1), listReply.get(2))); } else { result.success(); } @@ -4490,16 +6967,14 @@ public void onMarkerDragStart( BasicMessageChannel channel = new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( - new ArrayList(Arrays.asList(markerIdArg, positionArg)), + new ArrayList<>(Arrays.asList(markerIdArg, positionArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { result.error( new FlutterError( - (String) listReply.get(0), - (String) listReply.get(1), - (String) listReply.get(2))); + (String) listReply.get(0), (String) listReply.get(1), listReply.get(2))); } else { result.success(); } @@ -4519,16 +6994,14 @@ public void onMarkerDrag( BasicMessageChannel channel = new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( - new ArrayList(Arrays.asList(markerIdArg, positionArg)), + new ArrayList<>(Arrays.asList(markerIdArg, positionArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { result.error( new FlutterError( - (String) listReply.get(0), - (String) listReply.get(1), - (String) listReply.get(2))); + (String) listReply.get(0), (String) listReply.get(1), listReply.get(2))); } else { result.success(); } @@ -4548,16 +7021,14 @@ public void onMarkerDragEnd( BasicMessageChannel channel = new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( - new ArrayList(Arrays.asList(markerIdArg, positionArg)), + new ArrayList<>(Arrays.asList(markerIdArg, positionArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { result.error( new FlutterError( - (String) listReply.get(0), - (String) listReply.get(1), - (String) listReply.get(2))); + (String) listReply.get(0), (String) listReply.get(1), listReply.get(2))); } else { result.success(); } @@ -4574,16 +7045,14 @@ public void onInfoWindowTap(@NonNull String markerIdArg, @NonNull VoidResult res BasicMessageChannel channel = new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( - new ArrayList(Collections.singletonList(markerIdArg)), + new ArrayList<>(Collections.singletonList(markerIdArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { result.error( new FlutterError( - (String) listReply.get(0), - (String) listReply.get(1), - (String) listReply.get(2))); + (String) listReply.get(0), (String) listReply.get(1), listReply.get(2))); } else { result.success(); } @@ -4600,16 +7069,14 @@ public void onCircleTap(@NonNull String circleIdArg, @NonNull VoidResult result) BasicMessageChannel channel = new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( - new ArrayList(Collections.singletonList(circleIdArg)), + new ArrayList<>(Collections.singletonList(circleIdArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { result.error( new FlutterError( - (String) listReply.get(0), - (String) listReply.get(1), - (String) listReply.get(2))); + (String) listReply.get(0), (String) listReply.get(1), listReply.get(2))); } else { result.success(); } @@ -4626,16 +7093,14 @@ public void onClusterTap(@NonNull PlatformCluster clusterArg, @NonNull VoidResul BasicMessageChannel channel = new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( - new ArrayList(Collections.singletonList(clusterArg)), + new ArrayList<>(Collections.singletonList(clusterArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { result.error( new FlutterError( - (String) listReply.get(0), - (String) listReply.get(1), - (String) listReply.get(2))); + (String) listReply.get(0), (String) listReply.get(1), listReply.get(2))); } else { result.success(); } @@ -4652,16 +7117,14 @@ public void onPolygonTap(@NonNull String polygonIdArg, @NonNull VoidResult resul BasicMessageChannel channel = new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( - new ArrayList(Collections.singletonList(polygonIdArg)), + new ArrayList<>(Collections.singletonList(polygonIdArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { result.error( new FlutterError( - (String) listReply.get(0), - (String) listReply.get(1), - (String) listReply.get(2))); + (String) listReply.get(0), (String) listReply.get(1), listReply.get(2))); } else { result.success(); } @@ -4678,16 +7141,14 @@ public void onPolylineTap(@NonNull String polylineIdArg, @NonNull VoidResult res BasicMessageChannel channel = new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( - new ArrayList(Collections.singletonList(polylineIdArg)), + new ArrayList<>(Collections.singletonList(polylineIdArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { result.error( new FlutterError( - (String) listReply.get(0), - (String) listReply.get(1), - (String) listReply.get(2))); + (String) listReply.get(0), (String) listReply.get(1), listReply.get(2))); } else { result.success(); } @@ -4708,16 +7169,14 @@ public void getTileOverlayTile( BasicMessageChannel channel = new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( - new ArrayList(Arrays.asList(tileOverlayIdArg, locationArg, zoomArg)), + new ArrayList<>(Arrays.asList(tileOverlayIdArg, locationArg, zoomArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { result.error( new FlutterError( - (String) listReply.get(0), - (String) listReply.get(1), - (String) listReply.get(2))); + (String) listReply.get(0), (String) listReply.get(1), listReply.get(2))); } else if (listReply.get(0) == null) { result.error( new FlutterError( @@ -4777,7 +7236,7 @@ static void setUp( if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; PlatformRendererType typeArg = (PlatformRendererType) args.get(0); Result resultCallback = @@ -4838,15 +7297,14 @@ static void setUp( if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; PlatformMapViewCreationParams typeArg = (PlatformMapViewCreationParams) args.get(0); try { api.createView(typeArg); wrapped.add(0, null); } catch (Throwable exception) { - ArrayList wrappedError = wrapError(exception); - wrapped = wrappedError; + wrapped = wrapError(exception); } reply.reply(wrapped); }); @@ -4931,13 +7389,12 @@ static void setUp( if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); try { Boolean output = api.areBuildingsEnabled(); wrapped.add(0, output); } catch (Throwable exception) { - ArrayList wrappedError = wrapError(exception); - wrapped = wrappedError; + wrapped = wrapError(exception); } reply.reply(wrapped); }); @@ -4955,13 +7412,12 @@ static void setUp( if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); try { Boolean output = api.areRotateGesturesEnabled(); wrapped.add(0, output); } catch (Throwable exception) { - ArrayList wrappedError = wrapError(exception); - wrapped = wrappedError; + wrapped = wrapError(exception); } reply.reply(wrapped); }); @@ -4979,13 +7435,12 @@ static void setUp( if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); try { Boolean output = api.areZoomControlsEnabled(); wrapped.add(0, output); } catch (Throwable exception) { - ArrayList wrappedError = wrapError(exception); - wrapped = wrappedError; + wrapped = wrapError(exception); } reply.reply(wrapped); }); @@ -5003,13 +7458,12 @@ static void setUp( if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); try { Boolean output = api.areScrollGesturesEnabled(); wrapped.add(0, output); } catch (Throwable exception) { - ArrayList wrappedError = wrapError(exception); - wrapped = wrappedError; + wrapped = wrapError(exception); } reply.reply(wrapped); }); @@ -5027,13 +7481,12 @@ static void setUp( if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); try { Boolean output = api.areTiltGesturesEnabled(); wrapped.add(0, output); } catch (Throwable exception) { - ArrayList wrappedError = wrapError(exception); - wrapped = wrappedError; + wrapped = wrapError(exception); } reply.reply(wrapped); }); @@ -5051,13 +7504,12 @@ static void setUp( if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); try { Boolean output = api.areZoomGesturesEnabled(); wrapped.add(0, output); } catch (Throwable exception) { - ArrayList wrappedError = wrapError(exception); - wrapped = wrappedError; + wrapped = wrapError(exception); } reply.reply(wrapped); }); @@ -5075,13 +7527,12 @@ static void setUp( if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); try { Boolean output = api.isCompassEnabled(); wrapped.add(0, output); } catch (Throwable exception) { - ArrayList wrappedError = wrapError(exception); - wrapped = wrappedError; + wrapped = wrapError(exception); } reply.reply(wrapped); }); @@ -5099,13 +7550,12 @@ static void setUp( if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); try { Boolean output = api.isLiteModeEnabled(); wrapped.add(0, output); } catch (Throwable exception) { - ArrayList wrappedError = wrapError(exception); - wrapped = wrappedError; + wrapped = wrapError(exception); } reply.reply(wrapped); }); @@ -5123,13 +7573,12 @@ static void setUp( if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); try { Boolean output = api.isMapToolbarEnabled(); wrapped.add(0, output); } catch (Throwable exception) { - ArrayList wrappedError = wrapError(exception); - wrapped = wrappedError; + wrapped = wrapError(exception); } reply.reply(wrapped); }); @@ -5147,13 +7596,12 @@ static void setUp( if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); try { Boolean output = api.isMyLocationButtonEnabled(); wrapped.add(0, output); } catch (Throwable exception) { - ArrayList wrappedError = wrapError(exception); - wrapped = wrappedError; + wrapped = wrapError(exception); } reply.reply(wrapped); }); @@ -5171,13 +7619,12 @@ static void setUp( if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); try { Boolean output = api.isTrafficEnabled(); wrapped.add(0, output); } catch (Throwable exception) { - ArrayList wrappedError = wrapError(exception); - wrapped = wrappedError; + wrapped = wrapError(exception); } reply.reply(wrapped); }); @@ -5195,15 +7642,14 @@ static void setUp( if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; String tileOverlayIdArg = (String) args.get(0); try { PlatformTileLayer output = api.getTileOverlayInfo(tileOverlayIdArg); wrapped.add(0, output); } catch (Throwable exception) { - ArrayList wrappedError = wrapError(exception); - wrapped = wrappedError; + wrapped = wrapError(exception); } reply.reply(wrapped); }); @@ -5221,13 +7667,12 @@ static void setUp( if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); try { PlatformZoomRange output = api.getZoomRange(); wrapped.add(0, output); } catch (Throwable exception) { - ArrayList wrappedError = wrapError(exception); - wrapped = wrappedError; + wrapped = wrapError(exception); } reply.reply(wrapped); }); @@ -5245,15 +7690,14 @@ static void setUp( if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; String clusterManagerIdArg = (String) args.get(0); try { List output = api.getClusters(clusterManagerIdArg); wrapped.add(0, output); } catch (Throwable exception) { - ArrayList wrappedError = wrapError(exception); - wrapped = wrappedError; + wrapped = wrapError(exception); } reply.reply(wrapped); }); diff --git a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/PolygonsController.java b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/PolygonsController.java index 57d7a6a5271f..98a43477765f 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/PolygonsController.java +++ b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/PolygonsController.java @@ -34,13 +34,13 @@ void setGoogleMap(GoogleMap googleMap) { void addPolygons(@NonNull List polygonsToAdd) { for (Messages.PlatformPolygon polygonToAdd : polygonsToAdd) { - addJsonPolygon(polygonToAdd.getJson()); + addPolygon(polygonToAdd); } } void changePolygons(@NonNull List polygonsToChange) { for (Messages.PlatformPolygon polygonToChange : polygonsToChange) { - changeJsonPolygon(polygonToChange.getJson()); + changePolygon(polygonToChange); } } @@ -67,10 +67,7 @@ boolean onPolygonTap(String googlePolygonId) { return false; } - private void addJsonPolygon(Map polygon) { - if (polygon == null) { - return; - } + private void addPolygon(@NonNull Messages.PlatformPolygon polygon) { PolygonBuilder polygonBuilder = new PolygonBuilder(density); String polygonId = Convert.interpretPolygonOptions(polygon, polygonBuilder); PolygonOptions options = polygonBuilder.build(); @@ -85,12 +82,8 @@ private void addPolygon( googleMapsPolygonIdToDartPolygonId.put(polygon.getId(), polygonId); } - private void changeJsonPolygon(Map polygon) { - if (polygon == null) { - return; - } - String polygonId = getPolygonId(polygon); - PolygonController polygonController = polygonIdToController.get(polygonId); + private void changePolygon(@NonNull Messages.PlatformPolygon polygon) { + PolygonController polygonController = polygonIdToController.get(polygon.getPolygonId()); if (polygonController != null) { Convert.interpretPolygonOptions(polygon, polygonController); } diff --git a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/PolylinesController.java b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/PolylinesController.java index 646f14c44973..65b53eb7e070 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/PolylinesController.java +++ b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/PolylinesController.java @@ -38,13 +38,13 @@ void setGoogleMap(GoogleMap googleMap) { void addPolylines(@NonNull List polylinesToAdd) { for (Messages.PlatformPolyline polylineToAdd : polylinesToAdd) { - addJsonPolyline(polylineToAdd.getJson()); + addPolyline(polylineToAdd); } } void changePolylines(@NonNull List polylinesToChange) { for (Messages.PlatformPolyline polylineToChange : polylinesToChange) { - changeJsonPolyline(polylineToChange.getJson()); + changePolyline(polylineToChange); } } @@ -71,10 +71,7 @@ boolean onPolylineTap(String googlePolylineId) { return false; } - private void addJsonPolyline(Map polyline) { - if (polyline == null) { - return; - } + private void addPolyline(@NonNull Messages.PlatformPolyline polyline) { PolylineBuilder polylineBuilder = new PolylineBuilder(density); String polylineId = Convert.interpretPolylineOptions(polyline, polylineBuilder, assetManager, density); @@ -90,11 +87,8 @@ private void addPolyline( googleMapsPolylineIdToDartPolylineId.put(polyline.getId(), polylineId); } - private void changeJsonPolyline(Map polyline) { - if (polyline == null) { - return; - } - String polylineId = getPolylineId(polyline); + private void changePolyline(@NonNull Messages.PlatformPolyline polyline) { + String polylineId = polyline.getPolylineId(); PolylineController polylineController = polylineIdToController.get(polylineId); if (polylineController != null) { Convert.interpretPolylineOptions(polyline, polylineController, assetManager, density); diff --git a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/TileOverlaysController.java b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/TileOverlaysController.java index fcc5c212d8dd..2ee8dcac8572 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/TileOverlaysController.java +++ b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/TileOverlaysController.java @@ -31,17 +31,13 @@ void setGoogleMap(GoogleMap googleMap) { void addTileOverlays(@NonNull List tileOverlaysToAdd) { for (Messages.PlatformTileOverlay tileOverlayToAdd : tileOverlaysToAdd) { - @SuppressWarnings("unchecked") - final Map overlayJson = (Map) tileOverlayToAdd.getJson(); - addJsonTileOverlay(overlayJson); + addTileOverlay(tileOverlayToAdd); } } void changeTileOverlays(@NonNull List tileOverlaysToChange) { for (Messages.PlatformTileOverlay tileOverlayToChange : tileOverlaysToChange) { - @SuppressWarnings("unchecked") - final Map overlayJson = (Map) tileOverlayToChange.getJson(); - changeJsonTileOverlay(overlayJson); + changeTileOverlay(tileOverlayToChange); } } @@ -79,13 +75,10 @@ TileOverlay getTileOverlay(String tileOverlayId) { return tileOverlayController.getTileOverlay(); } - private void addJsonTileOverlay(Map tileOverlayOptions) { - if (tileOverlayOptions == null) { - return; - } + private void addTileOverlay(@NonNull Messages.PlatformTileOverlay platformTileOverlay) { TileOverlayBuilder tileOverlayOptionsBuilder = new TileOverlayBuilder(); String tileOverlayId = - Convert.interpretTileOverlayOptions(tileOverlayOptions, tileOverlayOptionsBuilder); + Convert.interpretTileOverlayOptions(platformTileOverlay, tileOverlayOptionsBuilder); TileProviderController tileProviderController = new TileProviderController(flutterApi, tileOverlayId); tileOverlayOptionsBuilder.setTileProvider(tileProviderController); @@ -95,14 +88,11 @@ private void addJsonTileOverlay(Map tileOverlayOptions) { tileOverlayIdToController.put(tileOverlayId, tileOverlayController); } - private void changeJsonTileOverlay(Map tileOverlayOptions) { - if (tileOverlayOptions == null) { - return; - } - String tileOverlayId = getTileOverlayId(tileOverlayOptions); + private void changeTileOverlay(@NonNull Messages.PlatformTileOverlay platformTileOverlay) { + String tileOverlayId = platformTileOverlay.getTileOverlayId(); TileOverlayController tileOverlayController = tileOverlayIdToController.get(tileOverlayId); if (tileOverlayController != null) { - Convert.interpretTileOverlayOptions(tileOverlayOptions, tileOverlayController); + Convert.interpretTileOverlayOptions(platformTileOverlay, tileOverlayController); } } diff --git a/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/ClusterManagersControllerTest.java b/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/ClusterManagersControllerTest.java index dd41a3fbd027..df4208df5e67 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/ClusterManagersControllerTest.java +++ b/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/ClusterManagersControllerTest.java @@ -28,12 +28,9 @@ import io.flutter.plugins.googlemaps.Messages.MapsCallbackApi; import java.io.ByteArrayOutputStream; import java.util.ArrayList; -import java.util.Arrays; import java.util.Collections; -import java.util.HashMap; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Set; import org.junit.After; import org.junit.Before; @@ -47,7 +44,7 @@ import org.robolectric.annotation.Config; @RunWith(RobolectricTestRunner.class) -@Config(sdk = Build.VERSION_CODES.P) +@Config(minSdk = Build.VERSION_CODES.LOLLIPOP) public class ClusterManagersControllerTest { private Context context; private MapsCallbackApi flutterApi; @@ -185,16 +182,21 @@ private Messages.PlatformMarker createPlatformMarker( ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); fakeBitmap.compress(Bitmap.CompressFormat.PNG, 100, byteArrayOutputStream); byte[] byteArray = byteArrayOutputStream.toByteArray(); - Map byteData = new HashMap<>(); - byteData.put("byteData", byteArray); - byteData.put("bitmapScaling", "none"); - byteData.put("imagePixelRatio", ""); - Messages.PlatformOffset anchor = - new Messages.PlatformOffset.Builder().setDx(0.0).setDy(0.0).build(); + Messages.PlatformBitmap icon = + new Messages.PlatformBitmap.Builder() + .setBitmap( + new Messages.PlatformBitmapBytesMap.Builder() + .setByteData(byteArray) + .setImagePixelRatio(1.0) + .setBitmapScaling(Messages.PlatformMapBitmapScaling.NONE) + .build()) + .build(); + Messages.PlatformDoublePair anchor = + new Messages.PlatformDoublePair.Builder().setX(0.0).setY(0.0).build(); return new Messages.PlatformMarker.Builder() .setMarkerId(markerId) .setConsumeTapEvents(false) - .setIcon(Arrays.asList("bytes", byteData)) + .setIcon(icon) .setAlpha(1.0) .setDraggable(false) .setFlat(false) diff --git a/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/ConvertTest.java b/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/ConvertTest.java index 1efab3540866..a2733980559d 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/ConvertTest.java +++ b/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/ConvertTest.java @@ -43,8 +43,7 @@ import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.InputStream; -import java.util.ArrayList; -import java.util.HashMap; +import java.util.Collections; import java.util.List; import java.util.Map; import org.junit.After; @@ -58,7 +57,7 @@ import org.robolectric.annotation.Config; @RunWith(RobolectricTestRunner.class) -@Config(minSdk = Build.VERSION_CODES.P) +@Config(minSdk = Build.VERSION_CODES.LOLLIPOP) public class ConvertTest { @Mock private AssetManager assetManager; @@ -86,15 +85,12 @@ public void tearDown() throws Exception { } @Test - public void ConvertToPointsConvertsThePointsWithFullPrecision() { + public void ConvertPointsFromPigeonConvertsThePointsWithFullPrecision() { double latitude = 43.03725568057; double longitude = -87.90466904649; - ArrayList point = new ArrayList<>(); - point.add(latitude); - point.add(longitude); - ArrayList> pointsList = new ArrayList<>(); - pointsList.add(point); - List latLngs = Convert.toPoints(pointsList); + Messages.PlatformLatLng platLng = + new Messages.PlatformLatLng.Builder().setLatitude(latitude).setLongitude(longitude).build(); + List latLngs = Convert.pointsFromPigeon(Collections.singletonList(platLng)); LatLng latLng = latLngs.get(0); Assert.assertEquals(latitude, latLng.latitude, 1e-15); Assert.assertEquals(longitude, latLng.longitude, 1e-15); @@ -143,26 +139,24 @@ public void ConvertClusterToPigeonReturnsCorrectData() { public void GetBitmapFromAssetAuto() throws Exception { String fakeAssetName = "fake_asset_name"; String fakeAssetKey = "fake_asset_key"; - Map assetDetails = new HashMap<>(); - assetDetails.put("assetName", fakeAssetName); - assetDetails.put("bitmapScaling", "auto"); - assetDetails.put("width", 15.0f); - assetDetails.put("height", 15.0f); - assetDetails.put("imagePixelRatio", 2.0f); when(flutterInjectorWrapper.getLookupKeyForAsset(fakeAssetName)).thenReturn(fakeAssetKey); when(assetManager.open(fakeAssetKey)).thenReturn(buildImageInputStream()); when(bitmapDescriptorFactoryWrapper.fromBitmap(any())).thenReturn(mockBitmapDescriptor); + Messages.PlatformBitmapAssetMap bitmap = + new Messages.PlatformBitmapAssetMap.Builder() + .setBitmapScaling(Messages.PlatformMapBitmapScaling.AUTO) + .setWidth(15.0) + .setHeight(15.0) + .setImagePixelRatio(2.0) + .setAssetName(fakeAssetName) + .build(); BitmapDescriptor result = Convert.getBitmapFromAsset( - assetDetails, - assetManager, - 1.0f, - bitmapDescriptorFactoryWrapper, - flutterInjectorWrapper); + bitmap, assetManager, 1.0f, bitmapDescriptorFactoryWrapper, flutterInjectorWrapper); Assert.assertEquals(mockBitmapDescriptor, result); } @@ -172,25 +166,22 @@ public void GetBitmapFromAssetAutoAndWidth() throws Exception { String fakeAssetName = "fake_asset_name"; String fakeAssetKey = "fake_asset_key"; - Map assetDetails = new HashMap<>(); - assetDetails.put("assetName", fakeAssetName); - assetDetails.put("bitmapScaling", "auto"); - assetDetails.put("width", 15.0f); - assetDetails.put("imagePixelRatio", 2.0f); - when(flutterInjectorWrapper.getLookupKeyForAsset(fakeAssetName)).thenReturn(fakeAssetKey); when(assetManager.open(fakeAssetKey)).thenReturn(buildImageInputStream()); when(bitmapDescriptorFactoryWrapper.fromBitmap(any())).thenReturn(mockBitmapDescriptor); + Messages.PlatformBitmapAssetMap bitmap = + new Messages.PlatformBitmapAssetMap.Builder() + .setAssetName(fakeAssetName) + .setWidth(15.0) + .setImagePixelRatio(2.0) + .setBitmapScaling(Messages.PlatformMapBitmapScaling.AUTO) + .build(); BitmapDescriptor result = Convert.getBitmapFromAsset( - assetDetails, - assetManager, - 1.0f, - bitmapDescriptorFactoryWrapper, - flutterInjectorWrapper); + bitmap, assetManager, 1.0f, bitmapDescriptorFactoryWrapper, flutterInjectorWrapper); Assert.assertEquals(mockBitmapDescriptor, result); } @@ -200,25 +191,22 @@ public void GetBitmapFromAssetAutoAndHeight() throws Exception { String fakeAssetName = "fake_asset_name"; String fakeAssetKey = "fake_asset_key"; - Map assetDetails = new HashMap<>(); - assetDetails.put("assetName", fakeAssetName); - assetDetails.put("bitmapScaling", "auto"); - assetDetails.put("height", 15.0f); - assetDetails.put("imagePixelRatio", 2.0f); - when(flutterInjectorWrapper.getLookupKeyForAsset(fakeAssetName)).thenReturn(fakeAssetKey); when(assetManager.open(fakeAssetKey)).thenReturn(buildImageInputStream()); when(bitmapDescriptorFactoryWrapper.fromBitmap(any())).thenReturn(mockBitmapDescriptor); + Messages.PlatformBitmapAssetMap bitmap = + new Messages.PlatformBitmapAssetMap.Builder() + .setBitmapScaling(Messages.PlatformMapBitmapScaling.AUTO) + .setHeight(15.0) + .setImagePixelRatio(2.0) + .setAssetName(fakeAssetName) + .build(); BitmapDescriptor result = Convert.getBitmapFromAsset( - assetDetails, - assetManager, - 1.0f, - bitmapDescriptorFactoryWrapper, - flutterInjectorWrapper); + bitmap, assetManager, 1.0f, bitmapDescriptorFactoryWrapper, flutterInjectorWrapper); Assert.assertEquals(mockBitmapDescriptor, result); } @@ -228,11 +216,6 @@ public void GetBitmapFromAssetNoScaling() throws Exception { String fakeAssetName = "fake_asset_name"; String fakeAssetKey = "fake_asset_key"; - Map assetDetails = new HashMap<>(); - assetDetails.put("assetName", fakeAssetName); - assetDetails.put("bitmapScaling", "noScaling"); - assetDetails.put("imagePixelRatio", 2.0f); - when(flutterInjectorWrapper.getLookupKeyForAsset(fakeAssetName)).thenReturn(fakeAssetKey); when(assetManager.open(fakeAssetKey)).thenReturn(buildImageInputStream()); @@ -240,14 +223,16 @@ public void GetBitmapFromAssetNoScaling() throws Exception { when(bitmapDescriptorFactoryWrapper.fromAsset(any())).thenReturn(mockBitmapDescriptor); verify(bitmapDescriptorFactoryWrapper, never()).fromBitmap(any()); + Messages.PlatformBitmapAssetMap bitmap = + new Messages.PlatformBitmapAssetMap.Builder() + .setBitmapScaling(Messages.PlatformMapBitmapScaling.NONE) + .setImagePixelRatio(2.0) + .setAssetName(fakeAssetName) + .build(); BitmapDescriptor result = Convert.getBitmapFromAsset( - assetDetails, - assetManager, - 1.0f, - bitmapDescriptorFactoryWrapper, - flutterInjectorWrapper); + bitmap, assetManager, 1.0f, bitmapDescriptorFactoryWrapper, flutterInjectorWrapper); Assert.assertEquals(mockBitmapDescriptor, result); } @@ -256,15 +241,17 @@ public void GetBitmapFromAssetNoScaling() throws Exception { public void GetBitmapFromBytesAuto() { byte[] bmpData = Base64.decode(base64Image, Base64.DEFAULT); - Map assetDetails = new HashMap<>(); - assetDetails.put("byteData", bmpData); - assetDetails.put("bitmapScaling", "auto"); - assetDetails.put("imagePixelRatio", 2.0f); - when(bitmapDescriptorFactoryWrapper.fromBitmap(any())).thenReturn(mockBitmapDescriptor); + Messages.PlatformBitmapBytesMap bitmap = + new Messages.PlatformBitmapBytesMap.Builder() + .setBitmapScaling(Messages.PlatformMapBitmapScaling.AUTO) + .setImagePixelRatio(2.0) + .setByteData(bmpData) + .build(); + BitmapDescriptor result = - Convert.getBitmapFromBytes(assetDetails, 1f, bitmapDescriptorFactoryWrapper); + Convert.getBitmapFromBytes(bitmap, 1f, bitmapDescriptorFactoryWrapper); Assert.assertEquals(mockBitmapDescriptor, result); } @@ -273,16 +260,17 @@ public void GetBitmapFromBytesAuto() { public void GetBitmapFromBytesAutoAndWidth() { byte[] bmpData = Base64.decode(base64Image, Base64.DEFAULT); - Map assetDetails = new HashMap<>(); - assetDetails.put("byteData", bmpData); - assetDetails.put("bitmapScaling", "auto"); - assetDetails.put("imagePixelRatio", 2.0f); - assetDetails.put("width", 15.0f); - when(bitmapDescriptorFactoryWrapper.fromBitmap(any())).thenReturn(mockBitmapDescriptor); + Messages.PlatformBitmapBytesMap bitmap = + new Messages.PlatformBitmapBytesMap.Builder() + .setBitmapScaling(Messages.PlatformMapBitmapScaling.AUTO) + .setImagePixelRatio(2.0) + .setByteData(bmpData) + .setWidth(15.0) + .build(); BitmapDescriptor result = - Convert.getBitmapFromBytes(assetDetails, 1f, bitmapDescriptorFactoryWrapper); + Convert.getBitmapFromBytes(bitmap, 1f, bitmapDescriptorFactoryWrapper); Assert.assertEquals(mockBitmapDescriptor, result); } @@ -291,16 +279,17 @@ public void GetBitmapFromBytesAutoAndWidth() { public void GetBitmapFromBytesAutoAndHeight() { byte[] bmpData = Base64.decode(base64Image, Base64.DEFAULT); - Map assetDetails = new HashMap<>(); - assetDetails.put("byteData", bmpData); - assetDetails.put("bitmapScaling", "auto"); - assetDetails.put("imagePixelRatio", 2.0f); - assetDetails.put("height", 15.0f); - when(bitmapDescriptorFactoryWrapper.fromBitmap(any())).thenReturn(mockBitmapDescriptor); + Messages.PlatformBitmapBytesMap bitmap = + new Messages.PlatformBitmapBytesMap.Builder() + .setBitmapScaling(Messages.PlatformMapBitmapScaling.AUTO) + .setImagePixelRatio(2.0) + .setByteData(bmpData) + .setHeight(15.0) + .build(); BitmapDescriptor result = - Convert.getBitmapFromBytes(assetDetails, 1f, bitmapDescriptorFactoryWrapper); + Convert.getBitmapFromBytes(bitmap, 1f, bitmapDescriptorFactoryWrapper); Assert.assertEquals(mockBitmapDescriptor, result); } @@ -309,15 +298,16 @@ public void GetBitmapFromBytesAutoAndHeight() { public void GetBitmapFromBytesNoScaling() { byte[] bmpData = Base64.decode(base64Image, Base64.DEFAULT); - Map assetDetails = new HashMap<>(); - assetDetails.put("byteData", bmpData); - assetDetails.put("bitmapScaling", "noScaling"); - assetDetails.put("imagePixelRatio", 2.0f); - when(bitmapDescriptorFactoryWrapper.fromBitmap(any())).thenReturn(mockBitmapDescriptor); + Messages.PlatformBitmapBytesMap bitmap = + new Messages.PlatformBitmapBytesMap.Builder() + .setBitmapScaling(Messages.PlatformMapBitmapScaling.NONE) + .setImagePixelRatio(2.0) + .setByteData(bmpData) + .build(); BitmapDescriptor result = - Convert.getBitmapFromBytes(assetDetails, 1f, bitmapDescriptorFactoryWrapper); + Convert.getBitmapFromBytes(bitmap, 1f, bitmapDescriptorFactoryWrapper); Assert.assertEquals(mockBitmapDescriptor, result); } @@ -327,15 +317,16 @@ public void GetBitmapFromBytesThrowsErrorIfInvalidImageData() { String invalidBase64Image = "not valid image data"; byte[] bmpData = Base64.decode(invalidBase64Image, Base64.DEFAULT); - Map assetDetails = new HashMap<>(); - assetDetails.put("byteData", bmpData); - assetDetails.put("bitmapScaling", "noScaling"); - assetDetails.put("imagePixelRatio", 2.0f); - verify(bitmapDescriptorFactoryWrapper, never()).fromBitmap(any()); + Messages.PlatformBitmapBytesMap bitmap = + new Messages.PlatformBitmapBytesMap.Builder() + .setBitmapScaling(Messages.PlatformMapBitmapScaling.NONE) + .setImagePixelRatio(2.0) + .setByteData(bmpData) + .build(); try { - Convert.getBitmapFromBytes(assetDetails, 1f, bitmapDescriptorFactoryWrapper); + Convert.getBitmapFromBytes(bitmap, 1f, bitmapDescriptorFactoryWrapper); } catch (IllegalArgumentException e) { Assert.assertEquals(e.getMessage(), "Unable to interpret bytes as a valid image."); throw e; // rethrow the exception 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 c0d54ba19584..48d8b619bebc 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 @@ -34,7 +34,7 @@ import org.robolectric.annotation.Config; @RunWith(RobolectricTestRunner.class) -@Config(sdk = Build.VERSION_CODES.P) +@Config(minSdk = Build.VERSION_CODES.LOLLIPOP) public class GoogleMapControllerTest { private Context context; diff --git a/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/GoogleMapInitializerTest.java b/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/GoogleMapInitializerTest.java index 374964cbad61..302e48cb720a 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/GoogleMapInitializerTest.java +++ b/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/GoogleMapInitializerTest.java @@ -26,7 +26,7 @@ import org.robolectric.annotation.Config; @RunWith(RobolectricTestRunner.class) -@Config(sdk = Build.VERSION_CODES.P) +@Config(minSdk = Build.VERSION_CODES.LOLLIPOP) public class GoogleMapInitializerTest { private GoogleMapInitializer googleMapInitializer; diff --git a/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/HeatmapsControllerTest.java b/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/HeatmapsControllerTest.java index 752472c4286f..59c4560f97d4 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/HeatmapsControllerTest.java +++ b/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/HeatmapsControllerTest.java @@ -33,7 +33,7 @@ import org.robolectric.annotation.Config; @RunWith(RobolectricTestRunner.class) -@Config(sdk = Build.VERSION_CODES.P) +@Config(minSdk = Build.VERSION_CODES.LOLLIPOP) public class HeatmapsControllerTest { private HeatmapsController controller; private GoogleMap googleMap; diff --git a/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/MarkersControllerTest.java b/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/MarkersControllerTest.java index 9df0b8d523db..1540ebccf69c 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/MarkersControllerTest.java +++ b/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/MarkersControllerTest.java @@ -25,11 +25,8 @@ import io.flutter.plugin.common.BinaryMessenger; import io.flutter.plugins.googlemaps.Messages.MapsCallbackApi; import java.io.ByteArrayOutputStream; -import java.util.Arrays; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -42,7 +39,7 @@ import org.robolectric.annotation.Config; @RunWith(RobolectricTestRunner.class) -@Config(sdk = Build.VERSION_CODES.P) +@Config(minSdk = Build.VERSION_CODES.LOLLIPOP) public class MarkersControllerTest { private Context context; private MapsCallbackApi flutterApi; @@ -62,18 +59,23 @@ private static Messages.PlatformMarker.Builder defaultMarkerBuilder() { ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); fakeBitmap.compress(Bitmap.CompressFormat.PNG, 100, byteArrayOutputStream); byte[] byteArray = byteArrayOutputStream.toByteArray(); - Map byteData = new HashMap<>(); - byteData.put("byteData", byteArray); - byteData.put("bitmapScaling", "none"); - byteData.put("imagePixelRatio", ""); - Messages.PlatformOffset anchor = - new Messages.PlatformOffset.Builder().setDx(0.5).setDy(0.0).build(); + Messages.PlatformBitmap icon = + new Messages.PlatformBitmap.Builder() + .setBitmap( + new Messages.PlatformBitmapBytesMap.Builder() + .setByteData(byteArray) + .setImagePixelRatio(1.0) + .setBitmapScaling(Messages.PlatformMapBitmapScaling.NONE) + .build()) + .build(); + Messages.PlatformDoublePair anchor = + new Messages.PlatformDoublePair.Builder().setX(0.5).setY(0.0).build(); Messages.PlatformInfoWindow infoWindow = new Messages.PlatformInfoWindow.Builder().setAnchor(anchor).build(); return new Messages.PlatformMarker.Builder() .setPosition( new Messages.PlatformLatLng.Builder().setLatitude(0.0).setLongitude(0.0).build()) - .setAnchor(new Messages.PlatformOffset.Builder().setDx(0.0).setDy(0.0).build()) + .setAnchor(new Messages.PlatformDoublePair.Builder().setX(0.0).setY(0.0).build()) .setFlat(false) .setDraggable(false) .setVisible(true) @@ -81,7 +83,7 @@ private static Messages.PlatformMarker.Builder defaultMarkerBuilder() { .setRotation(0.0) .setZIndex(0.0) .setConsumeTapEvents(false) - .setIcon(Arrays.asList("bytes", byteData)) + .setIcon(icon) .setInfoWindow(infoWindow); } diff --git a/packages/google_maps_flutter/google_maps_flutter_android/example/android/app/build.gradle b/packages/google_maps_flutter/google_maps_flutter_android/example/android/app/build.gradle index 6ab57de08264..fc357ff0e1ec 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/example/android/app/build.gradle +++ b/packages/google_maps_flutter/google_maps_flutter_android/example/android/app/build.gradle @@ -32,7 +32,7 @@ android { defaultConfig { applicationId "io.flutter.plugins.googlemapsexample" minSdkVersion flutter.minSdkVersion - targetSdkVersion 28 + targetSdkVersion 34 multiDexEnabled true versionCode flutterVersionCode.toInteger() versionName flutterVersionName 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..d951fac2bf31 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-8.7-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/packages/google_maps_flutter/google_maps_flutter_android/example/android/app/src/main/AndroidManifest.xml b/packages/google_maps_flutter/google_maps_flutter_android/example/android/app/src/main/AndroidManifest.xml index 1550b7a1204f..9dce53b155c2 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/example/android/app/src/main/AndroidManifest.xml +++ b/packages/google_maps_flutter/google_maps_flutter_android/example/android/app/src/main/AndroidManifest.xml @@ -1,8 +1,10 @@ - + { TextButton( onPressed: (selectedId == null) ? null - : ((polygons[selectedId]!.holes.isNotEmpty) + : (polygons[selectedId]!.holes.isNotEmpty ? null : () => _addHoles(selectedId)), child: const Text('add holes'), @@ -234,7 +234,7 @@ class PlacePolygonBodyState extends State { TextButton( onPressed: (selectedId == null) ? null - : ((polygons[selectedId]!.holes.isEmpty) + : (polygons[selectedId]!.holes.isEmpty ? null : () => _removeHoles(selectedId)), child: const Text('remove holes'), diff --git a/packages/google_maps_flutter/google_maps_flutter_android/example/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter_android/example/pubspec.yaml index 9f3931140f67..4aac17d849b7 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/example/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter_android/example/pubspec.yaml @@ -3,8 +3,8 @@ description: Demonstrates how to use the google_maps_flutter plugin. publish_to: none environment: - sdk: ^3.4.0 - flutter: ">=3.22.0" + sdk: ^3.5.0 + flutter: ">=3.24.0" dependencies: cupertino_icons: ^1.0.5 @@ -18,11 +18,11 @@ 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_maps_flutter_platform_interface: ^2.9.0 + google_maps_flutter_platform_interface: ^2.9.2 dev_dependencies: build_runner: ^2.1.10 - espresso: ^0.2.0 + espresso: ^0.4.0 flutter_test: sdk: flutter integration_test: 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 b7051ca679ef..32a751825d71 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 @@ -362,7 +362,7 @@ class GoogleMapsFlutterAndroid extends GoogleMapsFlutterPlatform { required int mapId, }) { return _hostApi(mapId) - .animateCamera(PlatformCameraUpdate(json: cameraUpdate.toJson())); + .animateCamera(_platformCameraUpdateFromCameraUpdate(cameraUpdate)); } @override @@ -371,7 +371,7 @@ class GoogleMapsFlutterAndroid extends GoogleMapsFlutterPlatform { required int mapId, }) { return _hostApi(mapId) - .moveCamera(PlatformCameraUpdate(json: cameraUpdate.toJson())); + .moveCamera(_platformCameraUpdateFromCameraUpdate(cameraUpdate)); } @override @@ -681,8 +681,12 @@ class GoogleMapsFlutterAndroid extends GoogleMapsFlutterPlatform { latitude: latLng.latitude, longitude: latLng.longitude); } - static PlatformOffset _platformOffsetFromOffset(Offset offset) { - return PlatformOffset(dx: offset.dx, dy: offset.dy); + static PlatformDoublePair _platformPairFromOffset(Offset offset) { + return PlatformDoublePair(x: offset.dx, y: offset.dy); + } + + static PlatformDoublePair _platformPairFromSize(Size size) { + return PlatformDoublePair(x: size.width, y: size.height); } static ScreenCoordinate _screenCoordinateFromPlatformPoint( @@ -724,17 +728,17 @@ class GoogleMapsFlutterAndroid extends GoogleMapsFlutterPlatform { return PlatformInfoWindow( title: window.title, snippet: window.snippet, - anchor: _platformOffsetFromOffset(window.anchor)); + anchor: _platformPairFromOffset(window.anchor)); } static PlatformMarker _platformMarkerFromMarker(Marker marker) { return PlatformMarker( alpha: marker.alpha, - anchor: _platformOffsetFromOffset(marker.anchor), + anchor: _platformPairFromOffset(marker.anchor), consumeTapEvents: marker.consumeTapEvents, draggable: marker.draggable, flat: marker.flat, - icon: marker.icon.toJson(), + icon: platformBitmapFromBitmapDescriptor(marker.icon), infoWindow: _platformInfoWindowFromInfoWindow(marker.infoWindow), position: _platformLatLngFromLatLng(marker.position), rotation: marker.rotation, @@ -746,26 +750,201 @@ class GoogleMapsFlutterAndroid extends GoogleMapsFlutterPlatform { } static PlatformPolygon _platformPolygonFromPolygon(Polygon polygon) { - // This cast is not ideal, but the Java code already assumes this format. - // See the TODOs at the top of this file and on the 'json' field in - // messages.dart. - return PlatformPolygon(json: polygon.toJson() as Map); + final List points = + polygon.points.map(_platformLatLngFromLatLng).toList(); + final List?> holes = + polygon.holes.map((List hole) { + return hole.map(_platformLatLngFromLatLng).toList(); + }).toList(); + return PlatformPolygon( + polygonId: polygon.polygonId.value, + fillColor: polygon.fillColor.value, + geodesic: polygon.geodesic, + consumesTapEvents: polygon.consumeTapEvents, + points: points, + holes: holes, + strokeColor: polygon.strokeColor.value, + strokeWidth: polygon.strokeWidth, + zIndex: polygon.zIndex, + visible: polygon.visible, + ); } static PlatformPolyline _platformPolylineFromPolyline(Polyline polyline) { - // This cast is not ideal, but the Java code already assumes this format. - // See the TODOs at the top of this file and on the 'json' field in - // messages.dart. - return PlatformPolyline(json: polyline.toJson() as Map); + final List points = + polyline.points.map(_platformLatLngFromLatLng).toList(); + final List pattern = + polyline.patterns.map(platformPatternItemFromPatternItem).toList(); + return PlatformPolyline( + polylineId: polyline.polylineId.value, + consumesTapEvents: polyline.consumeTapEvents, + color: polyline.color.value, + startCap: platformCapFromCap(polyline.startCap), + endCap: platformCapFromCap(polyline.endCap), + geodesic: polyline.geodesic, + visible: polyline.visible, + width: polyline.width, + zIndex: polyline.zIndex, + points: points, + jointType: platformJointTypeFromJointType(polyline.jointType), + patterns: pattern, + ); } static PlatformTileOverlay _platformTileOverlayFromTileOverlay( TileOverlay tileOverlay) { - // This cast is not ideal, but the Java code already assumes this format. - // See the TODOs at the top of this file and on the 'json' field in - // messages.dart. return PlatformTileOverlay( - json: tileOverlay.toJson() as Map); + tileOverlayId: tileOverlay.tileOverlayId.value, + fadeIn: tileOverlay.fadeIn, + transparency: tileOverlay.transparency, + zIndex: tileOverlay.zIndex, + visible: tileOverlay.visible, + tileSize: tileOverlay.tileSize, + ); + } + + static PlatformCameraUpdate _platformCameraUpdateFromCameraUpdate( + CameraUpdate update) { + switch (update.updateType) { + case CameraUpdateType.newCameraPosition: + update as CameraUpdateNewCameraPosition; + return PlatformCameraUpdate( + cameraUpdate: PlatformCameraUpdateNewCameraPosition( + cameraPosition: _platformCameraPositionFromCameraPosition( + update.cameraPosition))); + case CameraUpdateType.newLatLng: + update as CameraUpdateNewLatLng; + return PlatformCameraUpdate( + cameraUpdate: PlatformCameraUpdateNewLatLng( + latLng: _platformLatLngFromLatLng(update.latLng))); + case CameraUpdateType.newLatLngZoom: + update as CameraUpdateNewLatLngZoom; + return PlatformCameraUpdate( + cameraUpdate: PlatformCameraUpdateNewLatLngZoom( + latLng: _platformLatLngFromLatLng(update.latLng), + zoom: update.zoom)); + case CameraUpdateType.newLatLngBounds: + update as CameraUpdateNewLatLngBounds; + return PlatformCameraUpdate( + cameraUpdate: PlatformCameraUpdateNewLatLngBounds( + bounds: _platformLatLngBoundsFromLatLngBounds(update.bounds)!, + padding: update.padding)); + case CameraUpdateType.zoomTo: + update as CameraUpdateZoomTo; + return PlatformCameraUpdate( + cameraUpdate: PlatformCameraUpdateZoomTo(zoom: update.zoom)); + case CameraUpdateType.zoomBy: + update as CameraUpdateZoomBy; + return PlatformCameraUpdate( + cameraUpdate: PlatformCameraUpdateZoomBy( + amount: update.amount, + focus: update.focus == null + ? null + : _platformPairFromOffset(update.focus!))); + case CameraUpdateType.zoomIn: + update as CameraUpdateZoomIn; + return PlatformCameraUpdate( + cameraUpdate: PlatformCameraUpdateZoom(out: false)); + case CameraUpdateType.zoomOut: + update as CameraUpdateZoomOut; + return PlatformCameraUpdate( + cameraUpdate: PlatformCameraUpdateZoom(out: true)); + case CameraUpdateType.scrollBy: + update as CameraUpdateScrollBy; + return PlatformCameraUpdate( + cameraUpdate: + PlatformCameraUpdateScrollBy(dx: update.dx, dy: update.dy)); + } + } + + /// Convert [MapBitmapScaling] from platform interface to [PlatformMapBitmapScaling] Pigeon. + @visibleForTesting + static PlatformMapBitmapScaling platformMapBitmapScalingFromScaling( + MapBitmapScaling scaling) { + switch (scaling) { + case MapBitmapScaling.auto: + return PlatformMapBitmapScaling.auto; + case MapBitmapScaling.none: + return PlatformMapBitmapScaling.none; + } + + // The enum comes from a different package, which could get a new value at + // any time, so provide a fallback that ensures this won't break when used + // with a version that contains new values. This is deliberately outside + // the switch rather than a `default` so that the linter will flag the + // switch as needing an update. + // ignore: dead_code + return PlatformMapBitmapScaling.auto; + } + + /// Convert [BitmapDescriptor] from platform interface to [PlatformBitmap] pigeon. + @visibleForTesting + static PlatformBitmap platformBitmapFromBitmapDescriptor( + BitmapDescriptor bitmap) { + switch (bitmap) { + case final DefaultMarker marker: + return PlatformBitmap( + bitmap: PlatformBitmapDefaultMarker(hue: marker.hue?.toDouble())); + case final BytesBitmap bytes: + return PlatformBitmap( + bitmap: PlatformBitmapBytes( + byteData: bytes.byteData, + size: (bytes.size == null) + ? null + : _platformPairFromSize(bytes.size!))); + case final AssetBitmap asset: + return PlatformBitmap( + bitmap: PlatformBitmapAsset(name: asset.name, pkg: asset.package)); + case final AssetImageBitmap asset: + return PlatformBitmap( + bitmap: PlatformBitmapAssetImage( + name: asset.name, + scale: asset.scale, + size: (asset.size == null) + ? null + : _platformPairFromSize(asset.size!))); + case final AssetMapBitmap asset: + return PlatformBitmap( + bitmap: PlatformBitmapAssetMap( + assetName: asset.assetName, + bitmapScaling: + platformMapBitmapScalingFromScaling(asset.bitmapScaling), + imagePixelRatio: asset.imagePixelRatio, + width: asset.width, + height: asset.height)); + case final BytesMapBitmap bytes: + return PlatformBitmap( + bitmap: PlatformBitmapBytesMap( + byteData: bytes.byteData, + bitmapScaling: + platformMapBitmapScalingFromScaling(bytes.bitmapScaling), + imagePixelRatio: bytes.imagePixelRatio, + width: bytes.width, + height: bytes.height)); + default: + throw ArgumentError( + 'Unrecognized type of bitmap ${bitmap.runtimeType}', 'bitmap'); + } + } + + /// Convert [Cap] from platform interface to [PlatformCap] pigeon. + @visibleForTesting + static PlatformCap platformCapFromCap(Cap cap) { + switch (cap.type) { + case CapType.butt: + return PlatformCap(type: PlatformCapType.buttCap); + case CapType.square: + return PlatformCap(type: PlatformCapType.squareCap); + case CapType.round: + return PlatformCap(type: PlatformCapType.roundCap); + case CapType.custom: + cap as CustomCap; + return PlatformCap( + type: PlatformCapType.customCap, + bitmapDescriptor: + platformBitmapFromBitmapDescriptor(cap.bitmapDescriptor), + refWidth: cap.refWidth); + } } } @@ -1114,6 +1293,52 @@ PlatformZoomRange? _platformZoomRangeFromMinMaxZoomPreferenceJson( return PlatformZoomRange(min: minMaxZoom[0], max: minMaxZoom[1]); } +/// Converts platform interface's JointType to Pigeon's PlatformJointType. +@visibleForTesting +PlatformJointType platformJointTypeFromJointType(JointType jointType) { + switch (jointType) { + case JointType.mitered: + return PlatformJointType.mitered; + case JointType.bevel: + return PlatformJointType.bevel; + case JointType.round: + return PlatformJointType.round; + } + // The enum comes from a different package, which could get a new value at + // any time, so provide a fallback that ensures this won't break when used + // with a version that contains new values. This is deliberately outside + // the switch rather than a `default` so that the linter will flag the + // switch as needing an update. + // ignore: dead_code + return PlatformJointType.mitered; +} + +/// Converts a PatternItem to Pigeon's PlatformPatternItem for PlatformPolyline +/// pattern member. +@visibleForTesting +PlatformPatternItem platformPatternItemFromPatternItem(PatternItem item) { + switch (item.type) { + case PatternItemType.dot: + return PlatformPatternItem(type: PlatformPatternItemType.dot); + case PatternItemType.dash: + final double length = (item as VariableLengthPatternItem).length; + return PlatformPatternItem( + type: PlatformPatternItemType.dash, length: length); + case PatternItemType.gap: + final double length = (item as VariableLengthPatternItem).length; + return PlatformPatternItem( + type: PlatformPatternItemType.gap, length: length); + } + + // The enum comes from a different package, which could get a new value at + // any time, so provide a fallback that ensures this won't break when used + // with a version that contains new values. This is deliberately outside + // the switch rather than a `default` so that the linter will flag the + // switch as needing an update. + // ignore: dead_code + return PlatformPatternItem(type: PlatformPatternItemType.dot); +} + /// Update specification for a set of [TileOverlay]s. // TODO(stuartmorgan): Fix the missing export of this class in the platform // interface, and remove this copy. diff --git a/packages/google_maps_flutter/google_maps_flutter_android/lib/src/messages.g.dart b/packages/google_maps_flutter/google_maps_flutter_android/lib/src/messages.g.dart index d28a12eb1b52..51bf2abd56f6 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/lib/src/messages.g.dart +++ b/packages/google_maps_flutter/google_maps_flutter_android/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 (v20.0.2), do not edit directly. +// Autogenerated from Pigeon (v22.4.0), 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, no_leading_underscores_for_local_identifiers @@ -43,6 +43,36 @@ enum PlatformRendererType { latest, } +/// Join types for polyline joints. +enum PlatformJointType { + mitered, + bevel, + round, +} + +/// Enumeration of possible types of PlatformCap, corresponding to the +/// subclasses of Cap in the Google Maps Android SDK. +/// See https://developers.google.com/maps/documentation/android-sdk/reference/com/google/android/libraries/maps/model/Cap. +enum PlatformCapType { + buttCap, + roundCap, + squareCap, + customCap, +} + +/// Enumeration of possible types for PatternItem. +enum PlatformPatternItemType { + dot, + dash, + gap, +} + +/// Pigeon equivalent of [MapBitmapScaling]. +enum PlatformMapBitmapScaling { + auto, + none, +} + /// Pigeon representatation of a CameraPosition. class PlatformCameraPosition { PlatformCameraPosition({ @@ -83,24 +113,223 @@ class PlatformCameraPosition { /// Pigeon representation of a CameraUpdate. class PlatformCameraUpdate { PlatformCameraUpdate({ - required this.json, + required this.cameraUpdate, }); - /// The update data, as JSON. This should only be set from - /// CameraUpdate.toJson, and the native code must interpret it according to the - /// internal implementation details of the CameraUpdate class. - Object json; + /// This Object shall be any of the below classes prefixed with + /// PlatformCameraUpdate. Each such class represents a different type of + /// camera update, and each holds a different set of data, preventing the + /// use of a single unified class. Pigeon does not support inheritance, which + /// prevents a more strict type bound. + /// See https://github.com/flutter/flutter/issues/117819. + Object cameraUpdate; Object encode() { return [ - json, + cameraUpdate, ]; } static PlatformCameraUpdate decode(Object result) { result as List; return PlatformCameraUpdate( - json: result[0]!, + cameraUpdate: result[0]!, + ); + } +} + +/// Pigeon equivalent of NewCameraPosition +class PlatformCameraUpdateNewCameraPosition { + PlatformCameraUpdateNewCameraPosition({ + required this.cameraPosition, + }); + + PlatformCameraPosition cameraPosition; + + Object encode() { + return [ + cameraPosition, + ]; + } + + static PlatformCameraUpdateNewCameraPosition decode(Object result) { + result as List; + return PlatformCameraUpdateNewCameraPosition( + cameraPosition: result[0]! as PlatformCameraPosition, + ); + } +} + +/// Pigeon equivalent of NewLatLng +class PlatformCameraUpdateNewLatLng { + PlatformCameraUpdateNewLatLng({ + required this.latLng, + }); + + PlatformLatLng latLng; + + Object encode() { + return [ + latLng, + ]; + } + + static PlatformCameraUpdateNewLatLng decode(Object result) { + result as List; + return PlatformCameraUpdateNewLatLng( + latLng: result[0]! as PlatformLatLng, + ); + } +} + +/// Pigeon equivalent of NewLatLngBounds +class PlatformCameraUpdateNewLatLngBounds { + PlatformCameraUpdateNewLatLngBounds({ + required this.bounds, + required this.padding, + }); + + PlatformLatLngBounds bounds; + + double padding; + + Object encode() { + return [ + bounds, + padding, + ]; + } + + static PlatformCameraUpdateNewLatLngBounds decode(Object result) { + result as List; + return PlatformCameraUpdateNewLatLngBounds( + bounds: result[0]! as PlatformLatLngBounds, + padding: result[1]! as double, + ); + } +} + +/// Pigeon equivalent of NewLatLngZoom +class PlatformCameraUpdateNewLatLngZoom { + PlatformCameraUpdateNewLatLngZoom({ + required this.latLng, + required this.zoom, + }); + + PlatformLatLng latLng; + + double zoom; + + Object encode() { + return [ + latLng, + zoom, + ]; + } + + static PlatformCameraUpdateNewLatLngZoom decode(Object result) { + result as List; + return PlatformCameraUpdateNewLatLngZoom( + latLng: result[0]! as PlatformLatLng, + zoom: result[1]! as double, + ); + } +} + +/// Pigeon equivalent of ScrollBy +class PlatformCameraUpdateScrollBy { + PlatformCameraUpdateScrollBy({ + required this.dx, + required this.dy, + }); + + double dx; + + double dy; + + Object encode() { + return [ + dx, + dy, + ]; + } + + static PlatformCameraUpdateScrollBy decode(Object result) { + result as List; + return PlatformCameraUpdateScrollBy( + dx: result[0]! as double, + dy: result[1]! as double, + ); + } +} + +/// Pigeon equivalent of ZoomBy +class PlatformCameraUpdateZoomBy { + PlatformCameraUpdateZoomBy({ + required this.amount, + this.focus, + }); + + double amount; + + PlatformDoublePair? focus; + + Object encode() { + return [ + amount, + focus, + ]; + } + + static PlatformCameraUpdateZoomBy decode(Object result) { + result as List; + return PlatformCameraUpdateZoomBy( + amount: result[0]! as double, + focus: result[1] as PlatformDoublePair?, + ); + } +} + +/// Pigeon equivalent of ZoomIn/ZoomOut +class PlatformCameraUpdateZoom { + PlatformCameraUpdateZoom({ + required this.out, + }); + + bool out; + + Object encode() { + return [ + out, + ]; + } + + static PlatformCameraUpdateZoom decode(Object result) { + result as List; + return PlatformCameraUpdateZoom( + out: result[0]! as bool, + ); + } +} + +/// Pigeon equivalent of ZoomTo +class PlatformCameraUpdateZoomTo { + PlatformCameraUpdateZoomTo({ + required this.zoom, + }); + + double zoom; + + Object encode() { + return [ + zoom, + ]; + } + + static PlatformCameraUpdateZoomTo decode(Object result) { + result as List; + return PlatformCameraUpdateZoomTo( + zoom: result[0]! as double, ); } } @@ -214,29 +443,29 @@ class PlatformClusterManager { } } -/// Pigeon equivalent of the Offset class. -class PlatformOffset { - PlatformOffset({ - required this.dx, - required this.dy, +/// Pair of double values, such as for an offset or size. +class PlatformDoublePair { + PlatformDoublePair({ + required this.x, + required this.y, }); - double dx; + double x; - double dy; + double y; Object encode() { return [ - dx, - dy, + x, + y, ]; } - static PlatformOffset decode(Object result) { + static PlatformDoublePair decode(Object result) { result as List; - return PlatformOffset( - dx: result[0]! as double, - dy: result[1]! as double, + return PlatformDoublePair( + x: result[0]! as double, + y: result[1]! as double, ); } } @@ -253,7 +482,7 @@ class PlatformInfoWindow { String? snippet; - PlatformOffset anchor; + PlatformDoublePair anchor; Object encode() { return [ @@ -268,7 +497,7 @@ class PlatformInfoWindow { return PlatformInfoWindow( title: result[0] as String?, snippet: result[1] as String?, - anchor: result[2]! as PlatformOffset, + anchor: result[2]! as PlatformDoublePair, ); } } @@ -281,7 +510,7 @@ class PlatformMarker { this.consumeTapEvents = false, this.draggable = false, this.flat = false, - this.icon = const ['defaultMarker'], + required this.icon, required this.infoWindow, required this.position, this.rotation = 0.0, @@ -293,7 +522,7 @@ class PlatformMarker { double alpha; - PlatformOffset anchor; + PlatformDoublePair anchor; bool consumeTapEvents; @@ -301,7 +530,7 @@ class PlatformMarker { bool flat; - Object icon; + PlatformBitmap icon; PlatformInfoWindow infoWindow; @@ -339,11 +568,11 @@ class PlatformMarker { result as List; return PlatformMarker( alpha: result[0]! as double, - anchor: result[1]! as PlatformOffset, + anchor: result[1]! as PlatformDoublePair, consumeTapEvents: result[2]! as bool, draggable: result[3]! as bool, flat: result[4]! as bool, - icon: result[5]!, + icon: result[5]! as PlatformBitmap, infoWindow: result[6]! as PlatformInfoWindow, position: result[7]! as PlatformLatLng, rotation: result[8]! as double, @@ -358,24 +587,66 @@ class PlatformMarker { /// Pigeon equivalent of the Polygon class. class PlatformPolygon { PlatformPolygon({ - required this.json, + required this.polygonId, + required this.consumesTapEvents, + required this.fillColor, + required this.geodesic, + required this.points, + required this.holes, + required this.visible, + required this.strokeColor, + required this.strokeWidth, + required this.zIndex, }); - /// The polygon data, as JSON. This should only be set from - /// Polygon.toJson, and the native code must interpret it according to the - /// internal implementation details of that method. - Map json; + String polygonId; + + bool consumesTapEvents; + + int fillColor; + + bool geodesic; + + List points; + + List?> holes; + + bool visible; + + int strokeColor; + + int strokeWidth; + + int zIndex; Object encode() { return [ - json, + polygonId, + consumesTapEvents, + fillColor, + geodesic, + points, + holes, + visible, + strokeColor, + strokeWidth, + zIndex, ]; } static PlatformPolygon decode(Object result) { result as List; return PlatformPolygon( - json: (result[0] as Map?)!.cast(), + polygonId: result[0]! as String, + consumesTapEvents: result[1]! as bool, + fillColor: result[2]! as int, + geodesic: result[3]! as bool, + points: (result[4] as List?)!.cast(), + holes: (result[5] as List?)!.cast?>(), + visible: result[6]! as bool, + strokeColor: result[7]! as int, + strokeWidth: result[8]! as int, + zIndex: result[9]! as int, ); } } @@ -383,24 +654,140 @@ class PlatformPolygon { /// Pigeon equivalent of the Polyline class. class PlatformPolyline { PlatformPolyline({ - required this.json, + required this.polylineId, + required this.consumesTapEvents, + required this.color, + required this.geodesic, + required this.jointType, + required this.patterns, + required this.points, + required this.startCap, + required this.endCap, + required this.visible, + required this.width, + required this.zIndex, }); - /// The polyline data, as JSON. This should only be set from - /// Polyline.toJson, and the native code must interpret it according to the - /// internal implementation details of that method. - Map json; + String polylineId; + + bool consumesTapEvents; + + int color; + + bool geodesic; + + /// The joint type. + PlatformJointType jointType; + + /// The pattern data, as a list of pattern items. + List patterns; + + List points; + + /// The cap at the start and end vertex of a polyline. + /// See https://developers.google.com/maps/documentation/android-sdk/reference/com/google/android/libraries/maps/model/Cap. + PlatformCap startCap; + + PlatformCap endCap; + + bool visible; + + int width; + + int zIndex; Object encode() { return [ - json, + polylineId, + consumesTapEvents, + color, + geodesic, + jointType, + patterns, + points, + startCap, + endCap, + visible, + width, + zIndex, ]; } static PlatformPolyline decode(Object result) { result as List; return PlatformPolyline( - json: (result[0] as Map?)!.cast(), + polylineId: result[0]! as String, + consumesTapEvents: result[1]! as bool, + color: result[2]! as int, + geodesic: result[3]! as bool, + jointType: result[4]! as PlatformJointType, + patterns: (result[5] as List?)!.cast(), + points: (result[6] as List?)!.cast(), + startCap: result[7]! as PlatformCap, + endCap: result[8]! as PlatformCap, + visible: result[9]! as bool, + width: result[10]! as int, + zIndex: result[11]! as int, + ); + } +} + +/// Pigeon equivalent of Cap from the platform interface. +/// https://github.com/flutter/packages/blob/main/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/cap.dart +class PlatformCap { + PlatformCap({ + required this.type, + this.bitmapDescriptor, + this.refWidth, + }); + + PlatformCapType type; + + PlatformBitmap? bitmapDescriptor; + + double? refWidth; + + Object encode() { + return [ + type, + bitmapDescriptor, + refWidth, + ]; + } + + static PlatformCap decode(Object result) { + result as List; + return PlatformCap( + type: result[0]! as PlatformCapType, + bitmapDescriptor: result[1] as PlatformBitmap?, + refWidth: result[2] as double?, + ); + } +} + +/// Pigeon equivalent of the PatternItem class. +class PlatformPatternItem { + PlatformPatternItem({ + required this.type, + this.length, + }); + + PlatformPatternItemType type; + + double? length; + + Object encode() { + return [ + type, + length, + ]; + } + + static PlatformPatternItem decode(Object result) { + result as List; + return PlatformPatternItem( + type: result[0]! as PlatformPatternItemType, + length: result[1] as double?, ); } } @@ -440,24 +827,46 @@ class PlatformTile { /// Pigeon equivalent of the TileOverlay class. class PlatformTileOverlay { PlatformTileOverlay({ - required this.json, + required this.tileOverlayId, + required this.fadeIn, + required this.transparency, + required this.zIndex, + required this.visible, + required this.tileSize, }); - /// The tile overlay data, as JSON. This should only be set from - /// TileOverlay.toJson, and the native code must interpret it according to the - /// internal implementation details of that method. - Map json; + String tileOverlayId; + + bool fadeIn; + + double transparency; + + int zIndex; + + bool visible; + + int tileSize; Object encode() { return [ - json, + tileOverlayId, + fadeIn, + transparency, + zIndex, + visible, + tileSize, ]; } static PlatformTileOverlay decode(Object result) { result as List; return PlatformTileOverlay( - json: (result[0] as Map?)!.cast(), + tileOverlayId: result[0]! as String, + fadeIn: result[1]! as bool, + transparency: result[2]! as double, + zIndex: result[3]! as int, + visible: result[4]! as bool, + tileSize: result[5]! as int, ); } } @@ -888,82 +1297,377 @@ class PlatformZoomRange { } } +/// Pigeon equivalent of [BitmapDescriptor]. As there are multiple disjoint +/// types of [BitmapDescriptor], [PlatformBitmap] contains a single field which +/// may hold the pigeon equivalent type of any of them. +class PlatformBitmap { + PlatformBitmap({ + required this.bitmap, + }); + + /// One of [PlatformBitmapAssetMap], [PlatformBitmapAsset], + /// [PlatformBitmapAssetImage], [PlatformBitmapBytesMap], + /// [PlatformBitmapBytes], or [PlatformBitmapDefaultMarker]. + /// As Pigeon does not currently support data class inheritance, this + /// approach allows for the different bitmap implementations to be valid + /// argument and return types of the API methods. See + /// https://github.com/flutter/flutter/issues/117819. + Object bitmap; + + Object encode() { + return [ + bitmap, + ]; + } + + static PlatformBitmap decode(Object result) { + result as List; + return PlatformBitmap( + bitmap: result[0]!, + ); + } +} + +/// Pigeon equivalent of [DefaultMarker]. See +/// https://developers.google.com/maps/documentation/android-sdk/reference/com/google/android/libraries/maps/model/BitmapDescriptorFactory#defaultMarker(float) +class PlatformBitmapDefaultMarker { + PlatformBitmapDefaultMarker({ + this.hue, + }); + + double? hue; + + Object encode() { + return [ + hue, + ]; + } + + static PlatformBitmapDefaultMarker decode(Object result) { + result as List; + return PlatformBitmapDefaultMarker( + hue: result[0] as double?, + ); + } +} + +/// Pigeon equivalent of [BytesBitmap]. See +/// https://developers.google.com/maps/documentation/android-sdk/reference/com/google/android/libraries/maps/model/BitmapDescriptorFactory#fromBitmap(android.graphics.Bitmap) +class PlatformBitmapBytes { + PlatformBitmapBytes({ + required this.byteData, + this.size, + }); + + Uint8List byteData; + + PlatformDoublePair? size; + + Object encode() { + return [ + byteData, + size, + ]; + } + + static PlatformBitmapBytes decode(Object result) { + result as List; + return PlatformBitmapBytes( + byteData: result[0]! as Uint8List, + size: result[1] as PlatformDoublePair?, + ); + } +} + +/// Pigeon equivalent of [AssetBitmap]. See +/// https://developers.google.com/maps/documentation/android-sdk/reference/com/google/android/libraries/maps/model/BitmapDescriptorFactory#public-static-bitmapdescriptor-fromasset-string-assetname +class PlatformBitmapAsset { + PlatformBitmapAsset({ + required this.name, + this.pkg, + }); + + String name; + + String? pkg; + + Object encode() { + return [ + name, + pkg, + ]; + } + + static PlatformBitmapAsset decode(Object result) { + result as List; + return PlatformBitmapAsset( + name: result[0]! as String, + pkg: result[1] as String?, + ); + } +} + +/// Pigeon equivalent of [AssetImageBitmap]. See +/// https://developers.google.com/maps/documentation/android-sdk/reference/com/google/android/libraries/maps/model/BitmapDescriptorFactory#public-static-bitmapdescriptor-fromasset-string-assetname +class PlatformBitmapAssetImage { + PlatformBitmapAssetImage({ + required this.name, + required this.scale, + this.size, + }); + + String name; + + double scale; + + PlatformDoublePair? size; + + Object encode() { + return [ + name, + scale, + size, + ]; + } + + static PlatformBitmapAssetImage decode(Object result) { + result as List; + return PlatformBitmapAssetImage( + name: result[0]! as String, + scale: result[1]! as double, + size: result[2] as PlatformDoublePair?, + ); + } +} + +/// Pigeon equivalent of [AssetMapBitmap]. See +/// https://developers.google.com/maps/documentation/android-sdk/reference/com/google/android/libraries/maps/model/BitmapDescriptorFactory#public-static-bitmapdescriptor-fromasset-string-assetname +class PlatformBitmapAssetMap { + PlatformBitmapAssetMap({ + required this.assetName, + required this.bitmapScaling, + required this.imagePixelRatio, + this.width, + this.height, + }); + + String assetName; + + PlatformMapBitmapScaling bitmapScaling; + + double imagePixelRatio; + + double? width; + + double? height; + + Object encode() { + return [ + assetName, + bitmapScaling, + imagePixelRatio, + width, + height, + ]; + } + + static PlatformBitmapAssetMap decode(Object result) { + result as List; + return PlatformBitmapAssetMap( + assetName: result[0]! as String, + bitmapScaling: result[1]! as PlatformMapBitmapScaling, + imagePixelRatio: result[2]! as double, + width: result[3] as double?, + height: result[4] as double?, + ); + } +} + +/// Pigeon equivalent of [BytesMapBitmap]. See +/// https://developers.google.com/maps/documentation/android-sdk/reference/com/google/android/libraries/maps/model/BitmapDescriptorFactory#public-static-bitmapdescriptor-frombitmap-bitmap-image +class PlatformBitmapBytesMap { + PlatformBitmapBytesMap({ + required this.byteData, + required this.bitmapScaling, + required this.imagePixelRatio, + this.width, + this.height, + }); + + Uint8List byteData; + + PlatformMapBitmapScaling bitmapScaling; + + double imagePixelRatio; + + double? width; + + double? height; + + Object encode() { + return [ + byteData, + bitmapScaling, + imagePixelRatio, + width, + height, + ]; + } + + static PlatformBitmapBytesMap decode(Object result) { + result as List; + return PlatformBitmapBytesMap( + byteData: result[0]! as Uint8List, + bitmapScaling: result[1]! as PlatformMapBitmapScaling, + imagePixelRatio: result[2]! as double, + width: result[3] as double?, + height: result[4] as double?, + ); + } +} + class _PigeonCodec extends StandardMessageCodec { const _PigeonCodec(); @override void writeValue(WriteBuffer buffer, Object? value) { - if (value is PlatformCameraPosition) { + if (value is int) { + buffer.putUint8(4); + buffer.putInt64(value); + } else if (value is PlatformMapType) { buffer.putUint8(129); + writeValue(buffer, value.index); + } else if (value is PlatformRendererType) { + buffer.putUint8(130); + writeValue(buffer, value.index); + } else if (value is PlatformJointType) { + buffer.putUint8(131); + writeValue(buffer, value.index); + } else if (value is PlatformCapType) { + buffer.putUint8(132); + writeValue(buffer, value.index); + } else if (value is PlatformPatternItemType) { + buffer.putUint8(133); + writeValue(buffer, value.index); + } else if (value is PlatformMapBitmapScaling) { + buffer.putUint8(134); + writeValue(buffer, value.index); + } else if (value is PlatformCameraPosition) { + buffer.putUint8(135); writeValue(buffer, value.encode()); } else if (value is PlatformCameraUpdate) { - buffer.putUint8(130); + buffer.putUint8(136); + writeValue(buffer, value.encode()); + } else if (value is PlatformCameraUpdateNewCameraPosition) { + buffer.putUint8(137); + writeValue(buffer, value.encode()); + } else if (value is PlatformCameraUpdateNewLatLng) { + buffer.putUint8(138); + writeValue(buffer, value.encode()); + } else if (value is PlatformCameraUpdateNewLatLngBounds) { + buffer.putUint8(139); + writeValue(buffer, value.encode()); + } else if (value is PlatformCameraUpdateNewLatLngZoom) { + buffer.putUint8(140); + writeValue(buffer, value.encode()); + } else if (value is PlatformCameraUpdateScrollBy) { + buffer.putUint8(141); + writeValue(buffer, value.encode()); + } else if (value is PlatformCameraUpdateZoomBy) { + buffer.putUint8(142); + writeValue(buffer, value.encode()); + } else if (value is PlatformCameraUpdateZoom) { + buffer.putUint8(143); + writeValue(buffer, value.encode()); + } else if (value is PlatformCameraUpdateZoomTo) { + buffer.putUint8(144); writeValue(buffer, value.encode()); } else if (value is PlatformCircle) { - buffer.putUint8(131); + buffer.putUint8(145); writeValue(buffer, value.encode()); } else if (value is PlatformHeatmap) { - buffer.putUint8(132); + buffer.putUint8(146); writeValue(buffer, value.encode()); } else if (value is PlatformClusterManager) { - buffer.putUint8(133); + buffer.putUint8(147); writeValue(buffer, value.encode()); - } else if (value is PlatformOffset) { - buffer.putUint8(134); + } else if (value is PlatformDoublePair) { + buffer.putUint8(148); writeValue(buffer, value.encode()); } else if (value is PlatformInfoWindow) { - buffer.putUint8(135); + buffer.putUint8(149); writeValue(buffer, value.encode()); } else if (value is PlatformMarker) { - buffer.putUint8(136); + buffer.putUint8(150); writeValue(buffer, value.encode()); } else if (value is PlatformPolygon) { - buffer.putUint8(137); + buffer.putUint8(151); writeValue(buffer, value.encode()); } else if (value is PlatformPolyline) { - buffer.putUint8(138); + buffer.putUint8(152); + writeValue(buffer, value.encode()); + } else if (value is PlatformCap) { + buffer.putUint8(153); + writeValue(buffer, value.encode()); + } else if (value is PlatformPatternItem) { + buffer.putUint8(154); writeValue(buffer, value.encode()); } else if (value is PlatformTile) { - buffer.putUint8(139); + buffer.putUint8(155); writeValue(buffer, value.encode()); } else if (value is PlatformTileOverlay) { - buffer.putUint8(140); + buffer.putUint8(156); writeValue(buffer, value.encode()); } else if (value is PlatformEdgeInsets) { - buffer.putUint8(141); + buffer.putUint8(157); writeValue(buffer, value.encode()); } else if (value is PlatformLatLng) { - buffer.putUint8(142); + buffer.putUint8(158); writeValue(buffer, value.encode()); } else if (value is PlatformLatLngBounds) { - buffer.putUint8(143); + buffer.putUint8(159); writeValue(buffer, value.encode()); } else if (value is PlatformCluster) { - buffer.putUint8(144); + buffer.putUint8(160); writeValue(buffer, value.encode()); } else if (value is PlatformCameraTargetBounds) { - buffer.putUint8(145); + buffer.putUint8(161); writeValue(buffer, value.encode()); } else if (value is PlatformMapViewCreationParams) { - buffer.putUint8(146); + buffer.putUint8(162); writeValue(buffer, value.encode()); } else if (value is PlatformMapConfiguration) { - buffer.putUint8(147); + buffer.putUint8(163); writeValue(buffer, value.encode()); } else if (value is PlatformPoint) { - buffer.putUint8(148); + buffer.putUint8(164); writeValue(buffer, value.encode()); } else if (value is PlatformTileLayer) { - buffer.putUint8(149); + buffer.putUint8(165); writeValue(buffer, value.encode()); } else if (value is PlatformZoomRange) { - buffer.putUint8(150); + buffer.putUint8(166); + writeValue(buffer, value.encode()); + } else if (value is PlatformBitmap) { + buffer.putUint8(167); + writeValue(buffer, value.encode()); + } else if (value is PlatformBitmapDefaultMarker) { + buffer.putUint8(168); + writeValue(buffer, value.encode()); + } else if (value is PlatformBitmapBytes) { + buffer.putUint8(169); + writeValue(buffer, value.encode()); + } else if (value is PlatformBitmapAsset) { + buffer.putUint8(170); + writeValue(buffer, value.encode()); + } else if (value is PlatformBitmapAssetImage) { + buffer.putUint8(171); + writeValue(buffer, value.encode()); + } else if (value is PlatformBitmapAssetMap) { + buffer.putUint8(172); + writeValue(buffer, value.encode()); + } else if (value is PlatformBitmapBytesMap) { + buffer.putUint8(173); writeValue(buffer, value.encode()); - } else if (value is PlatformMapType) { - buffer.putUint8(151); - writeValue(buffer, value.index); - } else if (value is PlatformRendererType) { - buffer.putUint8(152); - writeValue(buffer, value.index); } else { super.writeValue(buffer, value); } @@ -973,55 +1677,101 @@ class _PigeonCodec extends StandardMessageCodec { Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { case 129: - return PlatformCameraPosition.decode(readValue(buffer)!); + final int? value = readValue(buffer) as int?; + return value == null ? null : PlatformMapType.values[value]; case 130: - return PlatformCameraUpdate.decode(readValue(buffer)!); + final int? value = readValue(buffer) as int?; + return value == null ? null : PlatformRendererType.values[value]; case 131: - return PlatformCircle.decode(readValue(buffer)!); + final int? value = readValue(buffer) as int?; + return value == null ? null : PlatformJointType.values[value]; case 132: - return PlatformHeatmap.decode(readValue(buffer)!); + final int? value = readValue(buffer) as int?; + return value == null ? null : PlatformCapType.values[value]; case 133: - return PlatformClusterManager.decode(readValue(buffer)!); + final int? value = readValue(buffer) as int?; + return value == null ? null : PlatformPatternItemType.values[value]; case 134: - return PlatformOffset.decode(readValue(buffer)!); + final int? value = readValue(buffer) as int?; + return value == null ? null : PlatformMapBitmapScaling.values[value]; case 135: - return PlatformInfoWindow.decode(readValue(buffer)!); + return PlatformCameraPosition.decode(readValue(buffer)!); case 136: - return PlatformMarker.decode(readValue(buffer)!); + return PlatformCameraUpdate.decode(readValue(buffer)!); case 137: - return PlatformPolygon.decode(readValue(buffer)!); + return PlatformCameraUpdateNewCameraPosition.decode(readValue(buffer)!); case 138: - return PlatformPolyline.decode(readValue(buffer)!); + return PlatformCameraUpdateNewLatLng.decode(readValue(buffer)!); case 139: - return PlatformTile.decode(readValue(buffer)!); + return PlatformCameraUpdateNewLatLngBounds.decode(readValue(buffer)!); case 140: - return PlatformTileOverlay.decode(readValue(buffer)!); + return PlatformCameraUpdateNewLatLngZoom.decode(readValue(buffer)!); case 141: - return PlatformEdgeInsets.decode(readValue(buffer)!); + return PlatformCameraUpdateScrollBy.decode(readValue(buffer)!); case 142: - return PlatformLatLng.decode(readValue(buffer)!); + return PlatformCameraUpdateZoomBy.decode(readValue(buffer)!); case 143: - return PlatformLatLngBounds.decode(readValue(buffer)!); + return PlatformCameraUpdateZoom.decode(readValue(buffer)!); case 144: - return PlatformCluster.decode(readValue(buffer)!); + return PlatformCameraUpdateZoomTo.decode(readValue(buffer)!); case 145: - return PlatformCameraTargetBounds.decode(readValue(buffer)!); + return PlatformCircle.decode(readValue(buffer)!); case 146: - return PlatformMapViewCreationParams.decode(readValue(buffer)!); + return PlatformHeatmap.decode(readValue(buffer)!); case 147: - return PlatformMapConfiguration.decode(readValue(buffer)!); + return PlatformClusterManager.decode(readValue(buffer)!); case 148: - return PlatformPoint.decode(readValue(buffer)!); + return PlatformDoublePair.decode(readValue(buffer)!); case 149: - return PlatformTileLayer.decode(readValue(buffer)!); + return PlatformInfoWindow.decode(readValue(buffer)!); case 150: - return PlatformZoomRange.decode(readValue(buffer)!); + return PlatformMarker.decode(readValue(buffer)!); case 151: - final int? value = readValue(buffer) as int?; - return value == null ? null : PlatformMapType.values[value]; + return PlatformPolygon.decode(readValue(buffer)!); case 152: - final int? value = readValue(buffer) as int?; - return value == null ? null : PlatformRendererType.values[value]; + return PlatformPolyline.decode(readValue(buffer)!); + case 153: + return PlatformCap.decode(readValue(buffer)!); + case 154: + return PlatformPatternItem.decode(readValue(buffer)!); + case 155: + return PlatformTile.decode(readValue(buffer)!); + case 156: + return PlatformTileOverlay.decode(readValue(buffer)!); + case 157: + return PlatformEdgeInsets.decode(readValue(buffer)!); + case 158: + return PlatformLatLng.decode(readValue(buffer)!); + case 159: + return PlatformLatLngBounds.decode(readValue(buffer)!); + case 160: + return PlatformCluster.decode(readValue(buffer)!); + case 161: + return PlatformCameraTargetBounds.decode(readValue(buffer)!); + case 162: + return PlatformMapViewCreationParams.decode(readValue(buffer)!); + case 163: + return PlatformMapConfiguration.decode(readValue(buffer)!); + case 164: + return PlatformPoint.decode(readValue(buffer)!); + case 165: + return PlatformTileLayer.decode(readValue(buffer)!); + case 166: + return PlatformZoomRange.decode(readValue(buffer)!); + case 167: + return PlatformBitmap.decode(readValue(buffer)!); + case 168: + return PlatformBitmapDefaultMarker.decode(readValue(buffer)!); + case 169: + return PlatformBitmapBytes.decode(readValue(buffer)!); + case 170: + return PlatformBitmapAsset.decode(readValue(buffer)!); + case 171: + return PlatformBitmapAssetImage.decode(readValue(buffer)!); + case 172: + return PlatformBitmapAssetMap.decode(readValue(buffer)!); + case 173: + return PlatformBitmapBytesMap.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); } @@ -1036,34 +1786,34 @@ class MapsApi { /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. MapsApi({BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) - : __pigeon_binaryMessenger = binaryMessenger, - __pigeon_messageChannelSuffix = + : pigeonVar_binaryMessenger = binaryMessenger, + pigeonVar_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; - final BinaryMessenger? __pigeon_binaryMessenger; + final BinaryMessenger? pigeonVar_binaryMessenger; static const MessageCodec pigeonChannelCodec = _PigeonCodec(); - final String __pigeon_messageChannelSuffix; + final String pigeonVar_messageChannelSuffix; /// Returns once the map instance is available. Future waitForMap() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.waitForMap$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.waitForMap$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -1076,23 +1826,23 @@ class MapsApi { /// null values will remain unchanged. Future updateMapConfiguration( PlatformMapConfiguration configuration) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateMapConfiguration$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateMapConfiguration$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([configuration]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = await pigeonVar_channel + .send([configuration]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -1102,23 +1852,23 @@ class MapsApi { /// Updates the set of circles on the map. Future updateCircles(List toAdd, List toChange, List idsToRemove) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateCircles$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateCircles$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel + final List? pigeonVar_replyList = await pigeonVar_channel .send([toAdd, toChange, idsToRemove]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -1128,23 +1878,23 @@ class MapsApi { /// Updates the set of heatmaps on the map. Future updateHeatmaps(List toAdd, List toChange, List idsToRemove) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateHeatmaps$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateHeatmaps$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel + final List? pigeonVar_replyList = await pigeonVar_channel .send([toAdd, toChange, idsToRemove]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -1154,23 +1904,23 @@ class MapsApi { /// Updates the set of custer managers for clusters on the map. Future updateClusterManagers( List toAdd, List idsToRemove) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateClusterManagers$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateClusterManagers$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel + final List? pigeonVar_replyList = await pigeonVar_channel .send([toAdd, idsToRemove]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -1180,23 +1930,23 @@ class MapsApi { /// Updates the set of markers on the map. Future updateMarkers(List toAdd, List toChange, List idsToRemove) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateMarkers$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateMarkers$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel + final List? pigeonVar_replyList = await pigeonVar_channel .send([toAdd, toChange, idsToRemove]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -1206,23 +1956,23 @@ class MapsApi { /// Updates the set of polygonss on the map. Future updatePolygons(List toAdd, List toChange, List idsToRemove) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updatePolygons$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updatePolygons$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel + final List? pigeonVar_replyList = await pigeonVar_channel .send([toAdd, toChange, idsToRemove]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -1232,23 +1982,23 @@ class MapsApi { /// Updates the set of polylines on the map. Future updatePolylines(List toAdd, List toChange, List idsToRemove) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updatePolylines$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updatePolylines$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel + final List? pigeonVar_replyList = await pigeonVar_channel .send([toAdd, toChange, idsToRemove]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -1258,23 +2008,23 @@ class MapsApi { /// Updates the set of tile overlays on the map. Future updateTileOverlays(List toAdd, List toChange, List idsToRemove) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateTileOverlays$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.updateTileOverlays$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel + final List? pigeonVar_replyList = await pigeonVar_channel .send([toAdd, toChange, idsToRemove]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -1283,114 +2033,114 @@ class MapsApi { /// Gets the screen coordinate for the given map location. Future getScreenCoordinate(PlatformLatLng latLng) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.getScreenCoordinate$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.getScreenCoordinate$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([latLng]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([latLng]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as PlatformPoint?)!; + return (pigeonVar_replyList[0] as PlatformPoint?)!; } } /// Gets the map location for the given screen coordinate. Future getLatLng(PlatformPoint screenCoordinate) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.getLatLng$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.getLatLng$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel + final List? pigeonVar_replyList = await pigeonVar_channel .send([screenCoordinate]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as PlatformLatLng?)!; + return (pigeonVar_replyList[0] as PlatformLatLng?)!; } } /// Gets the map region currently displayed on the map. Future getVisibleRegion() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.getVisibleRegion$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.getVisibleRegion$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as PlatformLatLngBounds?)!; + return (pigeonVar_replyList[0] as PlatformLatLngBounds?)!; } } /// Moves the camera according to [cameraUpdate] immediately, with no /// animation. Future moveCamera(PlatformCameraUpdate cameraUpdate) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.moveCamera$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.moveCamera$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([cameraUpdate]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([cameraUpdate]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -1399,23 +2149,23 @@ class MapsApi { /// Moves the camera according to [cameraUpdate], animating the update. Future animateCamera(PlatformCameraUpdate cameraUpdate) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.animateCamera$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.animateCamera$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([cameraUpdate]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([cameraUpdate]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -1424,53 +2174,53 @@ class MapsApi { /// Gets the current map zoom level. Future getZoomLevel() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.getZoomLevel$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.getZoomLevel$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as double?)!; + return (pigeonVar_replyList[0] as double?)!; } } /// Show the info window for the marker with the given ID. Future showInfoWindow(String markerId) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.showInfoWindow$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.showInfoWindow$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([markerId]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([markerId]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -1479,23 +2229,23 @@ class MapsApi { /// Hide the info window for the marker with the given ID. Future hideInfoWindow(String markerId) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.hideInfoWindow$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.hideInfoWindow$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([markerId]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([markerId]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -1505,31 +2255,31 @@ class MapsApi { /// Returns true if the marker with the given ID is currently displaying its /// info window. Future isInfoWindowShown(String markerId) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.isInfoWindowShown$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.isInfoWindowShown$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([markerId]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([markerId]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as bool?)!; + return (pigeonVar_replyList[0] as bool?)!; } } @@ -1539,31 +2289,31 @@ class MapsApi { /// Returns false if there was an error setting the style, such as an invalid /// style string. Future setStyle(String style) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.setStyle$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.setStyle$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([style]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([style]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as bool?)!; + return (pigeonVar_replyList[0] as bool?)!; } } @@ -1573,53 +2323,53 @@ class MapsApi { /// This allows checking asynchronously for initial style failures, as there /// is no way to return failures from map initialization. Future didLastStyleSucceed() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.didLastStyleSucceed$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.didLastStyleSucceed$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as bool?)!; + return (pigeonVar_replyList[0] as bool?)!; } } /// Clears the cache of tiles previously requseted from the tile provider. Future clearTileCache(String tileOverlayId) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.clearTileCache$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.clearTileCache$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([tileOverlayId]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = await pigeonVar_channel + .send([tileOverlayId]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -1628,31 +2378,31 @@ class MapsApi { /// Takes a snapshot of the map and returns its image data. Future takeSnapshot() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.takeSnapshot$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsApi.takeSnapshot$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as Uint8List?)!; + return (pigeonVar_replyList[0] as Uint8List?)!; } } } @@ -1714,15 +2464,16 @@ abstract class MapsCallbackApi { messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onCameraMoveStarted$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { try { api.onCameraMoveStarted(); return wrapResponse(empty: true); @@ -1736,15 +2487,16 @@ abstract class MapsCallbackApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onCameraMove$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onCameraMove was null.'); final List args = (message as List?)!; @@ -1765,15 +2517,16 @@ abstract class MapsCallbackApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onCameraIdle$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { try { api.onCameraIdle(); return wrapResponse(empty: true); @@ -1787,15 +2540,16 @@ abstract class MapsCallbackApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onTap$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onTap was null.'); final List args = (message as List?)!; @@ -1815,15 +2569,16 @@ abstract class MapsCallbackApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onLongPress$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onLongPress was null.'); final List args = (message as List?)!; @@ -1843,15 +2598,16 @@ abstract class MapsCallbackApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onMarkerTap$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onMarkerTap was null.'); final List args = (message as List?)!; @@ -1871,15 +2627,16 @@ abstract class MapsCallbackApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onMarkerDragStart$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onMarkerDragStart was null.'); final List args = (message as List?)!; @@ -1902,15 +2659,16 @@ abstract class MapsCallbackApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onMarkerDrag$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onMarkerDrag was null.'); final List args = (message as List?)!; @@ -1933,15 +2691,16 @@ abstract class MapsCallbackApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onMarkerDragEnd$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onMarkerDragEnd was null.'); final List args = (message as List?)!; @@ -1964,15 +2723,16 @@ abstract class MapsCallbackApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onInfoWindowTap$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onInfoWindowTap was null.'); final List args = (message as List?)!; @@ -1992,15 +2752,16 @@ abstract class MapsCallbackApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onCircleTap$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onCircleTap was null.'); final List args = (message as List?)!; @@ -2020,15 +2781,16 @@ abstract class MapsCallbackApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onClusterTap$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onClusterTap was null.'); final List args = (message as List?)!; @@ -2048,15 +2810,16 @@ abstract class MapsCallbackApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onPolygonTap$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onPolygonTap was null.'); final List args = (message as List?)!; @@ -2076,15 +2839,16 @@ abstract class MapsCallbackApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onPolylineTap$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.onPolylineTap was null.'); final List args = (message as List?)!; @@ -2104,15 +2868,16 @@ abstract class MapsCallbackApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.getTileOverlayTile$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.google_maps_flutter_android.MapsCallbackApi.getTileOverlayTile was null.'); final List args = (message as List?)!; @@ -2148,14 +2913,14 @@ class MapsInitializerApi { /// BinaryMessenger will be used which routes to the host platform. MapsInitializerApi( {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) - : __pigeon_binaryMessenger = binaryMessenger, - __pigeon_messageChannelSuffix = + : pigeonVar_binaryMessenger = binaryMessenger, + pigeonVar_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; - final BinaryMessenger? __pigeon_binaryMessenger; + final BinaryMessenger? pigeonVar_binaryMessenger; static const MessageCodec pigeonChannelCodec = _PigeonCodec(); - final String __pigeon_messageChannelSuffix; + final String pigeonVar_messageChannelSuffix; /// Initializes the Google Maps SDK with the given renderer preference. /// @@ -2165,31 +2930,31 @@ class MapsInitializerApi { /// in an error. Future initializeWithPreferredRenderer( PlatformRendererType? type) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsInitializerApi.initializeWithPreferredRenderer$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsInitializerApi.initializeWithPreferredRenderer$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([type]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([type]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as PlatformRendererType?)!; + return (pigeonVar_replyList[0] as PlatformRendererType?)!; } } } @@ -2203,33 +2968,33 @@ class MapsPlatformViewApi { /// BinaryMessenger will be used which routes to the host platform. MapsPlatformViewApi( {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) - : __pigeon_binaryMessenger = binaryMessenger, - __pigeon_messageChannelSuffix = + : pigeonVar_binaryMessenger = binaryMessenger, + pigeonVar_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; - final BinaryMessenger? __pigeon_binaryMessenger; + final BinaryMessenger? pigeonVar_binaryMessenger; static const MessageCodec pigeonChannelCodec = _PigeonCodec(); - final String __pigeon_messageChannelSuffix; + final String pigeonVar_messageChannelSuffix; Future createView(PlatformMapViewCreationParams? type) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsPlatformViewApi.createView$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsPlatformViewApi.createView$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([type]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([type]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -2244,408 +3009,408 @@ class MapsInspectorApi { /// BinaryMessenger will be used which routes to the host platform. MapsInspectorApi( {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) - : __pigeon_binaryMessenger = binaryMessenger, - __pigeon_messageChannelSuffix = + : pigeonVar_binaryMessenger = binaryMessenger, + pigeonVar_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; - final BinaryMessenger? __pigeon_binaryMessenger; + final BinaryMessenger? pigeonVar_binaryMessenger; static const MessageCodec pigeonChannelCodec = _PigeonCodec(); - final String __pigeon_messageChannelSuffix; + final String pigeonVar_messageChannelSuffix; Future areBuildingsEnabled() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areBuildingsEnabled$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areBuildingsEnabled$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as bool?)!; + return (pigeonVar_replyList[0] as bool?)!; } } Future areRotateGesturesEnabled() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areRotateGesturesEnabled$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areRotateGesturesEnabled$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as bool?)!; + return (pigeonVar_replyList[0] as bool?)!; } } Future areZoomControlsEnabled() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areZoomControlsEnabled$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areZoomControlsEnabled$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as bool?)!; + return (pigeonVar_replyList[0] as bool?)!; } } Future areScrollGesturesEnabled() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areScrollGesturesEnabled$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areScrollGesturesEnabled$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as bool?)!; + return (pigeonVar_replyList[0] as bool?)!; } } Future areTiltGesturesEnabled() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areTiltGesturesEnabled$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areTiltGesturesEnabled$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as bool?)!; + return (pigeonVar_replyList[0] as bool?)!; } } Future areZoomGesturesEnabled() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areZoomGesturesEnabled$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.areZoomGesturesEnabled$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as bool?)!; + return (pigeonVar_replyList[0] as bool?)!; } } Future isCompassEnabled() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.isCompassEnabled$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.isCompassEnabled$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as bool?)!; + return (pigeonVar_replyList[0] as bool?)!; } } Future isLiteModeEnabled() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.isLiteModeEnabled$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.isLiteModeEnabled$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { - return (__pigeon_replyList[0] as bool?); + return (pigeonVar_replyList[0] as bool?); } } Future isMapToolbarEnabled() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.isMapToolbarEnabled$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.isMapToolbarEnabled$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as bool?)!; + return (pigeonVar_replyList[0] as bool?)!; } } Future isMyLocationButtonEnabled() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.isMyLocationButtonEnabled$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.isMyLocationButtonEnabled$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as bool?)!; + return (pigeonVar_replyList[0] as bool?)!; } } Future isTrafficEnabled() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.isTrafficEnabled$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.isTrafficEnabled$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as bool?)!; + return (pigeonVar_replyList[0] as bool?)!; } } Future getTileOverlayInfo(String tileOverlayId) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.getTileOverlayInfo$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.getTileOverlayInfo$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([tileOverlayId]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = await pigeonVar_channel + .send([tileOverlayId]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { - return (__pigeon_replyList[0] as PlatformTileLayer?); + return (pigeonVar_replyList[0] as PlatformTileLayer?); } } Future getZoomRange() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.getZoomRange$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.getZoomRange$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as PlatformZoomRange?)!; + return (pigeonVar_replyList[0] as PlatformZoomRange?)!; } } Future> getClusters(String clusterManagerId) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.getClusters$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_android.MapsInspectorApi.getClusters$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel + final List? pigeonVar_replyList = await pigeonVar_channel .send([clusterManagerId]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as List?)! + return (pigeonVar_replyList[0] as List?)! .cast(); } } diff --git a/packages/google_maps_flutter/google_maps_flutter_android/pigeons/messages.dart b/packages/google_maps_flutter/google_maps_flutter_android/pigeons/messages.dart index 778aa17f5471..4982a9390eae 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/pigeons/messages.dart +++ b/packages/google_maps_flutter/google_maps_flutter_android/pigeons/messages.dart @@ -40,17 +40,67 @@ class PlatformCameraPosition { /// Pigeon representation of a CameraUpdate. class PlatformCameraUpdate { - PlatformCameraUpdate(this.json); + PlatformCameraUpdate({required this.cameraUpdate}); + + /// This Object shall be any of the below classes prefixed with + /// PlatformCameraUpdate. Each such class represents a different type of + /// camera update, and each holds a different set of data, preventing the + /// use of a single unified class. Pigeon does not support inheritance, which + /// prevents a more strict type bound. + /// See https://github.com/flutter/flutter/issues/117819. + final Object cameraUpdate; +} + +/// Pigeon equivalent of NewCameraPosition +class PlatformCameraUpdateNewCameraPosition { + PlatformCameraUpdateNewCameraPosition(this.cameraPosition); + final PlatformCameraPosition cameraPosition; +} + +/// Pigeon equivalent of NewLatLng +class PlatformCameraUpdateNewLatLng { + PlatformCameraUpdateNewLatLng(this.latLng); + final PlatformLatLng latLng; +} + +/// Pigeon equivalent of NewLatLngBounds +class PlatformCameraUpdateNewLatLngBounds { + PlatformCameraUpdateNewLatLngBounds(this.bounds, this.padding); + final PlatformLatLngBounds bounds; + final double padding; +} - /// The update data, as JSON. This should only be set from - /// CameraUpdate.toJson, and the native code must interpret it according to the - /// internal implementation details of the CameraUpdate class. - // TODO(stuartmorgan): Update the google_maps_platform_interface CameraUpdate - // class to provide a structured representation of an update. Currently it - // uses JSON as its only state, so there is no way to preserve structure. - // This wrapper class exists as a placeholder for now to at least provide - // type safety in the top-level call's arguments. - final Object json; +/// Pigeon equivalent of NewLatLngZoom +class PlatformCameraUpdateNewLatLngZoom { + PlatformCameraUpdateNewLatLngZoom(this.latLng, this.zoom); + final PlatformLatLng latLng; + final double zoom; +} + +/// Pigeon equivalent of ScrollBy +class PlatformCameraUpdateScrollBy { + PlatformCameraUpdateScrollBy(this.dx, this.dy); + final double dx; + final double dy; +} + +/// Pigeon equivalent of ZoomBy +class PlatformCameraUpdateZoomBy { + PlatformCameraUpdateZoomBy(this.amount, [this.focus]); + final double amount; + final PlatformDoublePair? focus; +} + +/// Pigeon equivalent of ZoomIn/ZoomOut +class PlatformCameraUpdateZoom { + PlatformCameraUpdateZoom(this.out); + final bool out; +} + +/// Pigeon equivalent of ZoomTo +class PlatformCameraUpdateZoomTo { + PlatformCameraUpdateZoomTo(this.zoom); + final double zoom; } /// Pigeon equivalent of the Circle class. @@ -97,12 +147,12 @@ class PlatformClusterManager { final String identifier; } -/// Pigeon equivalent of the Offset class. -class PlatformOffset { - PlatformOffset(this.dx, this.dy); +/// Pair of double values, such as for an offset or size. +class PlatformDoublePair { + PlatformDoublePair(this.x, this.y); - final double dx; - final double dy; + final double x; + final double y; } /// Pigeon equivalent of the InfoWindow class. @@ -115,19 +165,19 @@ class PlatformInfoWindow { final String? title; final String? snippet; - final PlatformOffset anchor; + final PlatformDoublePair anchor; } /// Pigeon equivalent of the Marker class. class PlatformMarker { PlatformMarker({ required this.markerId, + required this.icon, this.alpha = 1.0, required this.anchor, this.consumeTapEvents = false, this.draggable = false, this.flat = false, - this.icon = const ['defaultMarker'], required this.infoWindow, required this.position, this.rotation = 0.0, @@ -137,14 +187,12 @@ class PlatformMarker { }); final double alpha; - final PlatformOffset anchor; + final PlatformDoublePair anchor; final bool consumeTapEvents; final bool draggable; final bool flat; - /// The icon as JSON data. - // TODO(schectman): replace this with structured data. - final Object icon; + final PlatformBitmap icon; final PlatformInfoWindow infoWindow; final PlatformLatLng position; final double rotation; @@ -156,26 +204,111 @@ class PlatformMarker { /// Pigeon equivalent of the Polygon class. class PlatformPolygon { - PlatformPolygon(this.json); + PlatformPolygon({ + required this.polygonId, + required this.consumesTapEvents, + required this.fillColor, + required this.geodesic, + required this.points, + required this.holes, + required this.visible, + required this.strokeColor, + required this.strokeWidth, + required this.zIndex, + }); - /// The polygon data, as JSON. This should only be set from - /// Polygon.toJson, and the native code must interpret it according to the - /// internal implementation details of that method. - // TODO(stuartmorgan): Replace this with structured data. This exists only to - // allow incremental migration to Pigeon. - final Map json; + final String polygonId; + final bool consumesTapEvents; + final int fillColor; + final bool geodesic; + final List points; + final List?> holes; + final bool visible; + final int strokeColor; + final int strokeWidth; + final int zIndex; +} + +/// Join types for polyline joints. +enum PlatformJointType { + mitered, + bevel, + round, } /// Pigeon equivalent of the Polyline class. class PlatformPolyline { - PlatformPolyline(this.json); + PlatformPolyline({ + required this.polylineId, + required this.consumesTapEvents, + required this.color, + required this.geodesic, + required this.jointType, + required this.patterns, + required this.points, + required this.startCap, + required this.endCap, + required this.visible, + required this.width, + required this.zIndex, + }); - /// The polyline data, as JSON. This should only be set from - /// Polyline.toJson, and the native code must interpret it according to the - /// internal implementation details of that method. - // TODO(stuartmorgan): Replace this with structured data. This exists only to - // allow incremental migration to Pigeon. - final Map json; + final String polylineId; + final bool consumesTapEvents; + final int color; + final bool geodesic; + + /// The joint type. + final PlatformJointType jointType; + + /// The pattern data, as a list of pattern items. + final List patterns; + final List points; + + /// The cap at the start and end vertex of a polyline. + /// See https://developers.google.com/maps/documentation/android-sdk/reference/com/google/android/libraries/maps/model/Cap. + final PlatformCap startCap; + final PlatformCap endCap; + + final bool visible; + final int width; + final int zIndex; +} + +/// Enumeration of possible types of PlatformCap, corresponding to the +/// subclasses of Cap in the Google Maps Android SDK. +/// See https://developers.google.com/maps/documentation/android-sdk/reference/com/google/android/libraries/maps/model/Cap. +enum PlatformCapType { + buttCap, + roundCap, + squareCap, + customCap, +} + +/// Pigeon equivalent of Cap from the platform interface. +/// https://github.com/flutter/packages/blob/main/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/cap.dart +class PlatformCap { + PlatformCap({required this.type, this.bitmapDescriptor, this.refWidth}); + + final PlatformCapType type; + + final PlatformBitmap? bitmapDescriptor; + final double? refWidth; +} + +/// Enumeration of possible types for PatternItem. +enum PlatformPatternItemType { + dot, + dash, + gap, +} + +/// Pigeon equivalent of the PatternItem class. +class PlatformPatternItem { + PlatformPatternItem({required this.type, this.length}); + + final PlatformPatternItemType type; + final double? length; } /// Pigeon equivalent of the Tile class. @@ -189,14 +322,21 @@ class PlatformTile { /// Pigeon equivalent of the TileOverlay class. class PlatformTileOverlay { - PlatformTileOverlay(this.json); + PlatformTileOverlay({ + required this.tileOverlayId, + required this.fadeIn, + required this.transparency, + required this.zIndex, + required this.visible, + required this.tileSize, + }); - /// The tile overlay data, as JSON. This should only be set from - /// TileOverlay.toJson, and the native code must interpret it according to the - /// internal implementation details of that method. - // TODO(stuartmorgan): Replace this with structured data. This exists only to - // allow incremental migration to Pigeon. - final Map json; + final String tileOverlayId; + final bool fadeIn; + final double transparency; + final int zIndex; + final bool visible; + final int tileSize; } /// Pigeon equivalent of Flutter's EdgeInsets. @@ -364,6 +504,96 @@ class PlatformZoomRange { final double? max; } +/// Pigeon equivalent of [BitmapDescriptor]. As there are multiple disjoint +/// types of [BitmapDescriptor], [PlatformBitmap] contains a single field which +/// may hold the pigeon equivalent type of any of them. +class PlatformBitmap { + PlatformBitmap({required this.bitmap}); + + /// One of [PlatformBitmapAssetMap], [PlatformBitmapAsset], + /// [PlatformBitmapAssetImage], [PlatformBitmapBytesMap], + /// [PlatformBitmapBytes], or [PlatformBitmapDefaultMarker]. + /// As Pigeon does not currently support data class inheritance, this + /// approach allows for the different bitmap implementations to be valid + /// argument and return types of the API methods. See + /// https://github.com/flutter/flutter/issues/117819. + final Object bitmap; +} + +/// Pigeon equivalent of [DefaultMarker]. See +/// https://developers.google.com/maps/documentation/android-sdk/reference/com/google/android/libraries/maps/model/BitmapDescriptorFactory#defaultMarker(float) +class PlatformBitmapDefaultMarker { + PlatformBitmapDefaultMarker({this.hue}); + + final double? hue; +} + +/// Pigeon equivalent of [BytesBitmap]. See +/// https://developers.google.com/maps/documentation/android-sdk/reference/com/google/android/libraries/maps/model/BitmapDescriptorFactory#fromBitmap(android.graphics.Bitmap) +class PlatformBitmapBytes { + PlatformBitmapBytes({required this.byteData, this.size}); + + final Uint8List byteData; + final PlatformDoublePair? size; +} + +/// Pigeon equivalent of [AssetBitmap]. See +/// https://developers.google.com/maps/documentation/android-sdk/reference/com/google/android/libraries/maps/model/BitmapDescriptorFactory#public-static-bitmapdescriptor-fromasset-string-assetname +class PlatformBitmapAsset { + PlatformBitmapAsset({required this.name, this.pkg}); + + final String name; + final String? pkg; +} + +/// Pigeon equivalent of [AssetImageBitmap]. See +/// https://developers.google.com/maps/documentation/android-sdk/reference/com/google/android/libraries/maps/model/BitmapDescriptorFactory#public-static-bitmapdescriptor-fromasset-string-assetname +class PlatformBitmapAssetImage { + PlatformBitmapAssetImage( + {required this.name, required this.scale, this.size}); + final String name; + final double scale; + final PlatformDoublePair? size; +} + +/// Pigeon equivalent of [MapBitmapScaling]. +enum PlatformMapBitmapScaling { + auto, + none, +} + +/// Pigeon equivalent of [AssetMapBitmap]. See +/// https://developers.google.com/maps/documentation/android-sdk/reference/com/google/android/libraries/maps/model/BitmapDescriptorFactory#public-static-bitmapdescriptor-fromasset-string-assetname +class PlatformBitmapAssetMap { + PlatformBitmapAssetMap( + {required this.assetName, + required this.bitmapScaling, + required this.imagePixelRatio, + this.width, + this.height}); + final String assetName; + final PlatformMapBitmapScaling bitmapScaling; + final double imagePixelRatio; + final double? width; + final double? height; +} + +/// Pigeon equivalent of [BytesMapBitmap]. See +/// https://developers.google.com/maps/documentation/android-sdk/reference/com/google/android/libraries/maps/model/BitmapDescriptorFactory#public-static-bitmapdescriptor-frombitmap-bitmap-image +class PlatformBitmapBytesMap { + PlatformBitmapBytesMap( + {required this.byteData, + required this.bitmapScaling, + required this.imagePixelRatio, + this.width, + this.height}); + final Uint8List byteData; + final PlatformMapBitmapScaling bitmapScaling; + final double imagePixelRatio; + final double? width; + final double? height; +} + /// Interface for non-test interactions with the native SDK. /// /// For test-only state queries, see [MapsInspectorApi]. 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 204de6405720..a9a1ec62d361 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter_android/pubspec.yaml @@ -2,11 +2,11 @@ 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.14.1 +version: 2.14.10 environment: - sdk: ^3.4.0 - flutter: ">=3.22.0" + sdk: ^3.5.0 + flutter: ">=3.24.0" flutter: plugin: @@ -21,7 +21,7 @@ dependencies: flutter: sdk: flutter flutter_plugin_android_lifecycle: ^2.0.1 - google_maps_flutter_platform_interface: ^2.9.0 + google_maps_flutter_platform_interface: ^2.9.5 stream_transform: ^2.0.0 dev_dependencies: @@ -29,8 +29,8 @@ dev_dependencies: build_runner: ^2.3.3 flutter_test: sdk: flutter - mockito: 5.4.4 - pigeon: ^20.0.2 + mockito: ^5.4.4 + pigeon: ^22.1.0 plugin_platform_interface: ^2.1.7 topics: 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 95a06148a3ba..2b3bd06edc0b 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 @@ -104,7 +104,7 @@ void main() { expect(bounds, expectedBounds); }); - test('moveCamera calls through', () async { + test('moveCamera calls through with expected scrollBy', () async { const int mapId = 1; final (GoogleMapsFlutterAndroid maps, MockMapsApi api) = setUpMockMap(mapId: mapId); @@ -115,10 +115,14 @@ void main() { final VerificationResult verification = verify(api.moveCamera(captureAny)); final PlatformCameraUpdate passedUpdate = verification.captured[0] as PlatformCameraUpdate; - expect(passedUpdate.json, update.toJson()); + final PlatformCameraUpdateScrollBy scroll = + passedUpdate.cameraUpdate as PlatformCameraUpdateScrollBy; + update as CameraUpdateScrollBy; + expect(scroll.dx, update.dx); + expect(scroll.dy, update.dy); }); - test('animateCamera calls through', () async { + test('animateCamera calls through with expected scrollBy', () async { const int mapId = 1; final (GoogleMapsFlutterAndroid maps, MockMapsApi api) = setUpMockMap(mapId: mapId); @@ -130,7 +134,11 @@ void main() { verify(api.animateCamera(captureAny)); final PlatformCameraUpdate passedUpdate = verification.captured[0] as PlatformCameraUpdate; - expect(passedUpdate.json, update.toJson()); + final PlatformCameraUpdateScrollBy scroll = + passedUpdate.cameraUpdate as PlatformCameraUpdateScrollBy; + update as CameraUpdateScrollBy; + expect(scroll.dx, update.dx); + expect(scroll.dy, update.dy); }); test('getZoomLevel passes values correctly', () async { @@ -400,20 +408,25 @@ void main() { expect(toChange.length, 1); final List? encoded = toChange.first?.encode() as List?; expect(encoded?[0], object2new.alpha); - final PlatformOffset? offset = encoded?[1] as PlatformOffset?; - expect(offset?.dx, object2new.anchor.dx); - expect(offset?.dy, object2new.anchor.dy); - expect(encoded?.getRange(2, 6).toList(), [ + final PlatformDoublePair? offset = encoded?[1] as PlatformDoublePair?; + expect(offset?.x, object2new.anchor.dx); + expect(offset?.y, object2new.anchor.dy); + expect(encoded?.getRange(2, 5).toList(), [ object2new.consumeTapEvents, object2new.draggable, object2new.flat, - object2new.icon.toJson(), ]); + expect( + (encoded?[5] as PlatformBitmap?)?.bitmap.runtimeType, + GoogleMapsFlutterAndroid.platformBitmapFromBitmapDescriptor( + object2new.icon) + .bitmap + .runtimeType); final PlatformInfoWindow? window = encoded?[6] as PlatformInfoWindow?; expect(window?.title, object2new.infoWindow.title); expect(window?.snippet, object2new.infoWindow.snippet); - expect(window?.anchor.dx, object2new.infoWindow.anchor.dx); - expect(window?.anchor.dy, object2new.infoWindow.anchor.dy); + expect(window?.anchor.x, object2new.infoWindow.anchor.dx); + expect(window?.anchor.y, object2new.infoWindow.anchor.dy); final PlatformLatLng? latLng = encoded?[7] as PlatformLatLng?; expect(latLng?.latitude, object2new.position.latitude); expect(latLng?.longitude, object2new.position.longitude); @@ -430,20 +443,25 @@ void main() { expect(toAdd.length, 1); final List? encoded = toAdd.first?.encode() as List?; expect(encoded?[0], object3.alpha); - final PlatformOffset? offset = encoded?[1] as PlatformOffset?; - expect(offset?.dx, object3.anchor.dx); - expect(offset?.dy, object3.anchor.dy); - expect(encoded?.getRange(2, 6).toList(), [ + final PlatformDoublePair? offset = encoded?[1] as PlatformDoublePair?; + expect(offset?.x, object3.anchor.dx); + expect(offset?.y, object3.anchor.dy); + expect(encoded?.getRange(2, 5).toList(), [ object3.consumeTapEvents, object3.draggable, object3.flat, - object3.icon.toJson(), ]); + expect( + (encoded?[5] as PlatformBitmap?)?.bitmap.runtimeType, + GoogleMapsFlutterAndroid.platformBitmapFromBitmapDescriptor( + object3.icon) + .bitmap + .runtimeType); final PlatformInfoWindow? window = encoded?[6] as PlatformInfoWindow?; expect(window?.title, object3.infoWindow.title); expect(window?.snippet, object3.infoWindow.snippet); - expect(window?.anchor.dx, object3.infoWindow.anchor.dx); - expect(window?.anchor.dy, object3.infoWindow.anchor.dy); + expect(window?.anchor.x, object3.infoWindow.anchor.dx); + expect(window?.anchor.y, object3.infoWindow.anchor.dy); final PlatformLatLng? latLng = encoded?[7] as PlatformLatLng?; expect(latLng?.latitude, object3.position.latitude); expect(latLng?.longitude, object3.position.longitude); @@ -481,12 +499,41 @@ void main() { // Object one should be removed. expect(toRemove.length, 1); expect(toRemove.first, object1.polygonId.value); + void expectPolygon(PlatformPolygon actual, Polygon expected) { + final List encoded = actual.encode() as List; + expect(encoded.sublist(0, 4), [ + expected.polygonId.value, + expected.consumeTapEvents, + expected.fillColor.value, + expected.geodesic, + ]); + expect(actual.points.length, expected.points.length); + for (final (int i, PlatformLatLng? point) in actual.points.indexed) { + expect(point?.latitude, actual.points[i]?.latitude); + expect(point?.longitude, actual.points[i]?.longitude); + } + expect(actual.holes.length, expected.holes.length); + for (final (int i, List? hole) in actual.holes.indexed) { + final List expectedHole = expected.holes[i]; + for (final (int j, PlatformLatLng? point) in hole!.indexed) { + expect(point?.latitude, expectedHole[j].latitude); + expect(point?.longitude, expectedHole[j].longitude); + } + } + expect(encoded.sublist(6), [ + expected.visible, + expected.strokeColor.value, + expected.strokeWidth, + expected.zIndex, + ]); + } + // Object two should be changed. expect(toChange.length, 1); - expect(toChange.first?.json, object2new.toJson()); + expectPolygon(toChange.first!, object2new); // Object 3 should be added. expect(toAdd.length, 1); - expect(toAdd.first?.json, object3.toJson()); + expectPolygon(toAdd.first!, object3); }); test('updatePolylines passes expected arguments', () async { @@ -496,8 +543,14 @@ void main() { const Polyline object1 = Polyline(polylineId: PolylineId('1')); const Polyline object2old = Polyline(polylineId: PolylineId('2')); - final Polyline object2new = object2old.copyWith(widthParam: 42); - const Polyline object3 = Polyline(polylineId: PolylineId('3')); + final Polyline object2new = object2old.copyWith( + widthParam: 42, startCapParam: Cap.squareCap, endCapParam: Cap.buttCap); + final Cap customCap = + Cap.customCapFromBitmap(BitmapDescriptor.defaultMarker, refWidth: 15); + final Polyline object3 = Polyline( + polylineId: const PolylineId('3'), + startCap: customCap, + endCap: Cap.roundCap); await maps.updatePolylines( PolylineUpdates.from( {object1, object2old}, {object2new, object3}), @@ -510,15 +563,54 @@ void main() { final List toChange = verification.captured[1] as List; final List toRemove = verification.captured[2] as List; + void expectPolyline(PlatformPolyline actual, Polyline expected) { + final List encoded = actual.encode() as List; + expect(encoded.sublist(0, 5), [ + expected.polylineId.value, + expected.consumeTapEvents, + expected.color.value, + expected.geodesic, + platformJointTypeFromJointType(expected.jointType), + ]); + expect(encoded.sublist(9), [ + expected.visible, + expected.width, + expected.zIndex, + ]); + expect(actual.points.length, expected.points.length); + for (final (int i, PlatformLatLng? point) in actual.points.indexed) { + expect(point?.latitude, actual.points[i]?.latitude); + expect(point?.longitude, actual.points[i]?.longitude); + } + expect(actual.patterns.length, expected.patterns.length); + for (final (int i, PlatformPatternItem? pattern) + in actual.patterns.indexed) { + expect(pattern?.encode(), + platformPatternItemFromPatternItem(expected.patterns[i]).encode()); + } + final PlatformCap expectedStartCap = + GoogleMapsFlutterAndroid.platformCapFromCap(expected.startCap); + final PlatformCap expectedEndCap = + GoogleMapsFlutterAndroid.platformCapFromCap(expected.endCap); + expect(actual.startCap.type, expectedStartCap.type); + expect(actual.startCap.refWidth, expectedStartCap.refWidth); + expect(actual.startCap.bitmapDescriptor?.bitmap.runtimeType, + expectedStartCap.bitmapDescriptor?.bitmap.runtimeType); + expect(actual.endCap.type, expectedEndCap.type); + expect(actual.endCap.refWidth, expectedEndCap.refWidth); + expect(actual.endCap.bitmapDescriptor?.bitmap.runtimeType, + expectedEndCap.bitmapDescriptor?.bitmap.runtimeType); + } + // Object one should be removed. expect(toRemove.length, 1); expect(toRemove.first, object1.polylineId.value); // Object two should be changed. expect(toChange.length, 1); - expect(toChange.first?.json, object2new.toJson()); + expectPolyline(toChange.first!, object2new); // Object 3 should be added. expect(toAdd.length, 1); - expect(toAdd.first?.json, object3.toJson()); + expectPolyline(toAdd.first!, object3); }); test('updateTileOverlays passes expected arguments', () async { @@ -547,15 +639,26 @@ void main() { final List toChange = verification.captured[1] as List; final List toRemove = verification.captured[2] as List; + void expectTileOverlay(PlatformTileOverlay? actual, TileOverlay expected) { + expect(actual?.encode(), [ + expected.tileOverlayId.value, + expected.fadeIn, + expected.transparency, + expected.zIndex, + expected.visible, + expected.tileSize, + ]); + } + // Object one should be removed. expect(toRemove.length, 1); expect(toRemove.first, object1.tileOverlayId.value); // Object two should be changed. expect(toChange.length, 1); - expect(toChange.first?.json, object2new.toJson()); + expectTileOverlay(toChange.first, object2new); // Object 3 should be added. expect(toAdd.length, 1); - expect(toAdd.first?.json, object3.toJson()); + expectTileOverlay(toAdd.first, object3); }); test('markers send drag event to correct streams', () async { @@ -709,6 +812,233 @@ void main() { }, ); + test('moveCamera calls through with expected newCameraPosition', () async { + const int mapId = 1; + final (GoogleMapsFlutterAndroid maps, MockMapsApi api) = + setUpMockMap(mapId: mapId); + + const LatLng latLng = LatLng(10.0, 20.0); + const CameraPosition position = CameraPosition(target: latLng); + final CameraUpdate update = CameraUpdate.newCameraPosition(position); + await maps.moveCamera(update, mapId: mapId); + + final VerificationResult verification = verify(api.moveCamera(captureAny)); + final PlatformCameraUpdate passedUpdate = + verification.captured[0] as PlatformCameraUpdate; + final PlatformCameraUpdateNewCameraPosition typedUpdate = + passedUpdate.cameraUpdate as PlatformCameraUpdateNewCameraPosition; + update as CameraUpdateNewCameraPosition; + expect(typedUpdate.cameraPosition.target.latitude, + update.cameraPosition.target.latitude); + expect(typedUpdate.cameraPosition.target.longitude, + update.cameraPosition.target.longitude); + }); + + test('moveCamera calls through with expected newLatLng', () async { + const int mapId = 1; + final (GoogleMapsFlutterAndroid maps, MockMapsApi api) = + setUpMockMap(mapId: mapId); + + const LatLng latLng = LatLng(10.0, 20.0); + final CameraUpdate update = CameraUpdate.newLatLng(latLng); + await maps.moveCamera(update, mapId: mapId); + + final VerificationResult verification = verify(api.moveCamera(captureAny)); + final PlatformCameraUpdate passedUpdate = + verification.captured[0] as PlatformCameraUpdate; + final PlatformCameraUpdateNewLatLng typedUpdate = + passedUpdate.cameraUpdate as PlatformCameraUpdateNewLatLng; + update as CameraUpdateNewLatLng; + expect(typedUpdate.latLng.latitude, update.latLng.latitude); + expect(typedUpdate.latLng.longitude, update.latLng.longitude); + }); + + test('moveCamera calls through with expected newLatLngBounds', () async { + const int mapId = 1; + final (GoogleMapsFlutterAndroid maps, MockMapsApi api) = + setUpMockMap(mapId: mapId); + + final LatLngBounds latLng = LatLngBounds( + northeast: const LatLng(10.0, 20.0), + southwest: const LatLng(9.0, 21.0)); + final CameraUpdate update = CameraUpdate.newLatLngBounds(latLng, 1.0); + await maps.moveCamera(update, mapId: mapId); + + final VerificationResult verification = verify(api.moveCamera(captureAny)); + final PlatformCameraUpdate passedUpdate = + verification.captured[0] as PlatformCameraUpdate; + final PlatformCameraUpdateNewLatLngBounds typedUpdate = + passedUpdate.cameraUpdate as PlatformCameraUpdateNewLatLngBounds; + update as CameraUpdateNewLatLngBounds; + expect(typedUpdate.bounds.northeast.latitude, + update.bounds.northeast.latitude); + expect(typedUpdate.bounds.northeast.longitude, + update.bounds.northeast.longitude); + expect(typedUpdate.bounds.southwest.latitude, + update.bounds.southwest.latitude); + expect(typedUpdate.bounds.southwest.longitude, + update.bounds.southwest.longitude); + expect(typedUpdate.padding, update.padding); + }); + + test('moveCamera calls through with expected newLatLngZoom', () async { + const int mapId = 1; + final (GoogleMapsFlutterAndroid maps, MockMapsApi api) = + setUpMockMap(mapId: mapId); + + const LatLng latLng = LatLng(10.0, 20.0); + final CameraUpdate update = CameraUpdate.newLatLngZoom(latLng, 2.0); + await maps.moveCamera(update, mapId: mapId); + + final VerificationResult verification = verify(api.moveCamera(captureAny)); + final PlatformCameraUpdate passedUpdate = + verification.captured[0] as PlatformCameraUpdate; + final PlatformCameraUpdateNewLatLngZoom typedUpdate = + passedUpdate.cameraUpdate as PlatformCameraUpdateNewLatLngZoom; + update as CameraUpdateNewLatLngZoom; + expect(typedUpdate.latLng.latitude, update.latLng.latitude); + expect(typedUpdate.latLng.longitude, update.latLng.longitude); + expect(typedUpdate.zoom, update.zoom); + }); + + test('moveCamera calls through with expected zoomBy', () async { + const int mapId = 1; + final (GoogleMapsFlutterAndroid maps, MockMapsApi api) = + setUpMockMap(mapId: mapId); + + const Offset focus = Offset(10.0, 20.0); + final CameraUpdate update = CameraUpdate.zoomBy(2.0, focus); + await maps.moveCamera(update, mapId: mapId); + + final VerificationResult verification = verify(api.moveCamera(captureAny)); + final PlatformCameraUpdate passedUpdate = + verification.captured[0] as PlatformCameraUpdate; + final PlatformCameraUpdateZoomBy typedUpdate = + passedUpdate.cameraUpdate as PlatformCameraUpdateZoomBy; + update as CameraUpdateZoomBy; + expect(typedUpdate.focus?.x, update.focus?.dx); + expect(typedUpdate.focus?.y, update.focus?.dy); + expect(typedUpdate.amount, update.amount); + }); + + test('moveCamera calls through with expected zoomTo', () async { + const int mapId = 1; + final (GoogleMapsFlutterAndroid maps, MockMapsApi api) = + setUpMockMap(mapId: mapId); + + final CameraUpdate update = CameraUpdate.zoomTo(2.0); + await maps.moveCamera(update, mapId: mapId); + + final VerificationResult verification = verify(api.moveCamera(captureAny)); + final PlatformCameraUpdate passedUpdate = + verification.captured[0] as PlatformCameraUpdate; + final PlatformCameraUpdateZoomTo typedUpdate = + passedUpdate.cameraUpdate as PlatformCameraUpdateZoomTo; + update as CameraUpdateZoomTo; + expect(typedUpdate.zoom, update.zoom); + }); + + test('moveCamera calls through with expected zoomIn', () async { + const int mapId = 1; + final (GoogleMapsFlutterAndroid maps, MockMapsApi api) = + setUpMockMap(mapId: mapId); + + final CameraUpdate update = CameraUpdate.zoomIn(); + await maps.moveCamera(update, mapId: mapId); + + final VerificationResult verification = verify(api.moveCamera(captureAny)); + final PlatformCameraUpdate passedUpdate = + verification.captured[0] as PlatformCameraUpdate; + final PlatformCameraUpdateZoom typedUpdate = + passedUpdate.cameraUpdate as PlatformCameraUpdateZoom; + expect(typedUpdate.out, false); + }); + + test('moveCamera calls through with expected zoomOut', () async { + const int mapId = 1; + final (GoogleMapsFlutterAndroid maps, MockMapsApi api) = + setUpMockMap(mapId: mapId); + + final CameraUpdate update = CameraUpdate.zoomOut(); + await maps.moveCamera(update, mapId: mapId); + + final VerificationResult verification = verify(api.moveCamera(captureAny)); + final PlatformCameraUpdate passedUpdate = + verification.captured[0] as PlatformCameraUpdate; + final PlatformCameraUpdateZoom typedUpdate = + passedUpdate.cameraUpdate as PlatformCameraUpdateZoom; + expect(typedUpdate.out, true); + }); + + test('MapBitmapScaling to PlatformMapBitmapScaling', () { + expect( + GoogleMapsFlutterAndroid.platformMapBitmapScalingFromScaling( + MapBitmapScaling.auto), + PlatformMapBitmapScaling.auto); + expect( + GoogleMapsFlutterAndroid.platformMapBitmapScalingFromScaling( + MapBitmapScaling.none), + PlatformMapBitmapScaling.none); + }); + + test('DefaultMarker bitmap to PlatformBitmap', () { + final BitmapDescriptor bitmap = BitmapDescriptor.defaultMarkerWithHue(10.0); + final PlatformBitmap platformBitmap = + GoogleMapsFlutterAndroid.platformBitmapFromBitmapDescriptor(bitmap); + expect(platformBitmap.bitmap, isA()); + final PlatformBitmapDefaultMarker typedBitmap = + platformBitmap.bitmap as PlatformBitmapDefaultMarker; + expect(typedBitmap.hue, 10.0); + }); + + test('BytesMapBitmap bitmap to PlatformBitmap', () { + final Uint8List data = Uint8List.fromList([1, 2, 3, 4]); + final BytesMapBitmap bitmap = BitmapDescriptor.bytes(data, + imagePixelRatio: 2.0, width: 100.0, height: 200.0); + final PlatformBitmap platformBitmap = + GoogleMapsFlutterAndroid.platformBitmapFromBitmapDescriptor(bitmap); + expect(platformBitmap.bitmap, isA()); + final PlatformBitmapBytesMap typedBitmap = + platformBitmap.bitmap as PlatformBitmapBytesMap; + expect(typedBitmap.byteData, data); + expect(typedBitmap.bitmapScaling, PlatformMapBitmapScaling.auto); + expect(typedBitmap.imagePixelRatio, 2.0); + expect(typedBitmap.width, 100.0); + expect(typedBitmap.height, 200.0); + }); + + test('AssetMapBitmap bitmap to PlatformBitmap', () { + const String assetName = 'fake_asset_name'; + final AssetMapBitmap bitmap = AssetMapBitmap(assetName, + imagePixelRatio: 2.0, width: 100.0, height: 200.0); + final PlatformBitmap platformBitmap = + GoogleMapsFlutterAndroid.platformBitmapFromBitmapDescriptor(bitmap); + expect(platformBitmap.bitmap, isA()); + final PlatformBitmapAssetMap typedBitmap = + platformBitmap.bitmap as PlatformBitmapAssetMap; + expect(typedBitmap.assetName, assetName); + expect(typedBitmap.bitmapScaling, PlatformMapBitmapScaling.auto); + expect(typedBitmap.imagePixelRatio, 2.0); + expect(typedBitmap.width, 100.0); + expect(typedBitmap.height, 200.0); + }); + + test('Cap to PlatformCap', () { + expect(GoogleMapsFlutterAndroid.platformCapFromCap(Cap.buttCap).encode(), + PlatformCap(type: PlatformCapType.buttCap).encode()); + expect(GoogleMapsFlutterAndroid.platformCapFromCap(Cap.roundCap).encode(), + PlatformCap(type: PlatformCapType.roundCap).encode()); + expect(GoogleMapsFlutterAndroid.platformCapFromCap(Cap.squareCap).encode(), + PlatformCap(type: PlatformCapType.squareCap).encode()); + + const BitmapDescriptor bitmap = BitmapDescriptor.defaultMarker; + const CustomCap customCap = CustomCap(bitmap, refWidth: 15.0); + final PlatformCap platformCap = + GoogleMapsFlutterAndroid.platformCapFromCap(customCap); + expect(platformCap.type, PlatformCapType.customCap); + expect(customCap.refWidth, 15.0); + }); + testWidgets('Use PlatformViewLink when using surface view', (WidgetTester tester) async { final GoogleMapsFlutterAndroid maps = GoogleMapsFlutterAndroid(); 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 3e2202dcab52..5f962bb978d6 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios/CHANGELOG.md +++ b/packages/google_maps_flutter/google_maps_flutter_ios/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.13.1 + +* Updates Pigeon for non-nullable collection type support. + ## 2.13.0 * Updates map configuration and platform view creation parameters to use Pigeon. 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 index b9fa7719dcf7..34e5636692e0 100644 --- 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 @@ -15,7 +15,6 @@ 528F16832C62941000148160 /* FGMClusterManagersControllerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 528F16822C62941000148160 /* FGMClusterManagersControllerTests.m */; }; 528F16872C62952700148160 /* ExtractIconFromDataTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 528F16862C62952700148160 /* ExtractIconFromDataTests.m */; }; 6851F3562835BC180032B7C8 /* FLTGoogleMapJSONConversionsConversionTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 6851F3552835BC180032B7C8 /* FLTGoogleMapJSONConversionsConversionTests.m */; }; - 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 */; }; @@ -69,7 +68,6 @@ 528F16862C62952700148160 /* ExtractIconFromDataTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ExtractIconFromDataTests.m; sourceTree = ""; }; 61A9A8623F5CA9BBC813DC6B /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 6851F3552835BC180032B7C8 /* FLTGoogleMapJSONConversionsConversionTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FLTGoogleMapJSONConversionsConversionTests.m; 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 = ""; }; 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 = ""; }; @@ -109,7 +107,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 68E4726A2836FF0C00BDDDAC /* MapKit.framework in Frameworks */, 2BDE99378062AE3E60B40021 /* Pods_RunnerTests.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -127,7 +124,6 @@ 1E7CF0857EFC88FC263CF3B2 /* Frameworks */ = { isa = PBXGroup; children = ( - 68E472692836FF0C00BDDDAC /* MapKit.framework */, 61A9A8623F5CA9BBC813DC6B /* Pods_Runner.framework */, 3ACE0AFE8D82CD5962486AFD /* Pods_RunnerTests.framework */, ); diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/RunnerTests/FLTGoogleMapJSONConversionsConversionTests.m b/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/RunnerTests/FLTGoogleMapJSONConversionsConversionTests.m index 8179ec697a5d..c66698c6834e 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/RunnerTests/FLTGoogleMapJSONConversionsConversionTests.m +++ b/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/RunnerTests/FLTGoogleMapJSONConversionsConversionTests.m @@ -5,7 +5,6 @@ @import google_maps_flutter_ios; @import google_maps_flutter_ios.Test; @import XCTest; -@import MapKit; @import GoogleMaps; #import diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/RunnerUITests/GoogleMapsUITests.m b/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/RunnerUITests/GoogleMapsUITests.m index 3a1191bdb39e..cfb509a3c744 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/RunnerUITests/GoogleMapsUITests.m +++ b/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/RunnerUITests/GoogleMapsUITests.m @@ -8,6 +8,9 @@ static const NSTimeInterval kWaitTime = 60; +// TODO(bparrishMines): Remove once https://github.com/flutter/flutter/issues/154641 is fixed. +static const BOOL skipFor154641 = YES; + @interface GoogleMapsUITests : XCTestCase @property(nonatomic, strong) XCUIApplication *app; @end @@ -46,6 +49,8 @@ - (void)setUp { } - (void)testUserInterface { + XCTSkipIf(skipFor154641); + XCUIApplication *app = self.app; XCUIElement *userInteface = app.staticTexts[@"User interface"]; if (![userInteface waitForExistenceWithTimeout:kWaitTime]) { @@ -77,6 +82,8 @@ - (void)testUserInterface { } - (void)testMapCoordinatesPage { + XCTSkipIf(skipFor154641); + XCUIApplication *app = self.app; XCUIElement *mapCoordinates = app.staticTexts[@"Map coordinates"]; if (![mapCoordinates waitForExistenceWithTimeout:kWaitTime]) { @@ -168,6 +175,8 @@ - (void)validateVisibleRegion:(NSString *)label } - (void)testMapClickPage { + XCTSkipIf(skipFor154641); + XCUIApplication *app = self.app; XCUIElement *mapClick = app.staticTexts[@"Map click"]; if (![mapClick waitForExistenceWithTimeout:kWaitTime]) { @@ -212,6 +221,8 @@ - (void)forceTap:(XCUIElement *)button { } - (void)testMarkerDraggingCallbacks { + XCTSkipIf(skipFor154641); + XCUIApplication *application = [[XCUIApplication alloc] init]; [application launch]; XCUIElement *placeMarkerButton = application.staticTexts[@"Place marker"]; diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios15/ios/Runner.xcodeproj/project.pbxproj b/packages/google_maps_flutter/google_maps_flutter_ios/example/ios15/ios/Runner.xcodeproj/project.pbxproj index defec130df00..04a00376c7aa 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios15/ios/Runner.xcodeproj/project.pbxproj +++ b/packages/google_maps_flutter/google_maps_flutter_ios/example/ios15/ios/Runner.xcodeproj/project.pbxproj @@ -10,7 +10,6 @@ 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 5B5EF9A6C72A03092BDA553E /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 28D4666EF03E57DB7D03E916 /* Pods_RunnerTests.framework */; }; - 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 */; }; @@ -51,7 +50,6 @@ 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 28D4666EF03E57DB7D03E916 /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 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 = ""; }; 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 = ""; }; @@ -88,7 +86,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 68E4726A2836FF0C00BDDDAC /* MapKit.framework in Frameworks */, 5B5EF9A6C72A03092BDA553E /* Pods_RunnerTests.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -99,7 +96,6 @@ 1E7CF0857EFC88FC263CF3B2 /* Frameworks */ = { isa = PBXGroup; children = ( - 68E472692836FF0C00BDDDAC /* MapKit.framework */, 0D457E156D08F0B45EA2F6FF /* Pods_Runner.framework */, 28D4666EF03E57DB7D03E916 /* Pods_RunnerTests.framework */, ); diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/example/shared/maps_example_dart/lib/place_polygon.dart b/packages/google_maps_flutter/google_maps_flutter_ios/example/shared/maps_example_dart/lib/place_polygon.dart index 889c38d6376b..a1fdafd7a31d 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios/example/shared/maps_example_dart/lib/place_polygon.dart +++ b/packages/google_maps_flutter/google_maps_flutter_ios/example/shared/maps_example_dart/lib/place_polygon.dart @@ -226,7 +226,7 @@ class PlacePolygonBodyState extends State { TextButton( onPressed: (selectedId == null) ? null - : ((polygons[selectedId]!.holes.isNotEmpty) + : (polygons[selectedId]!.holes.isNotEmpty ? null : () => _addHoles(selectedId)), child: const Text('add holes'), @@ -234,7 +234,7 @@ class PlacePolygonBodyState extends State { TextButton( onPressed: (selectedId == null) ? null - : ((polygons[selectedId]!.holes.isEmpty) + : (polygons[selectedId]!.holes.isEmpty ? null : () => _removeHoles(selectedId)), child: const Text('remove holes'), diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/ios/Classes/messages.g.h b/packages/google_maps_flutter/google_maps_flutter_ios/ios/Classes/messages.g.h index 5f983e2650e9..088b8a657147 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios/ios/Classes/messages.g.h +++ b/packages/google_maps_flutter/google_maps_flutter_ios/ios/Classes/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 (v20.0.2), do not edit directly. +// Autogenerated from Pigeon (v22.4.2), do not edit directly. // See also: https://pub.dev/packages/pigeon #import diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/ios/Classes/messages.g.m b/packages/google_maps_flutter/google_maps_flutter_ios/ios/Classes/messages.g.m index dd99108301ad..73072d76dc70 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios/ios/Classes/messages.g.m +++ b/packages/google_maps_flutter/google_maps_flutter_ios/ios/Classes/messages.g.m @@ -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 (v20.0.2), do not edit directly. +// Autogenerated from Pigeon (v22.4.2), do not edit directly. // See also: https://pub.dev/packages/pigeon #import "messages.g.h" @@ -761,52 +761,52 @@ @interface FGMMessagesPigeonCodecReader : FlutterStandardReader @implementation FGMMessagesPigeonCodecReader - (nullable id)readValueOfType:(UInt8)type { switch (type) { - case 129: - return [FGMPlatformCameraPosition fromList:[self readValue]]; + case 129: { + NSNumber *enumAsNumber = [self readValue]; + return enumAsNumber == nil + ? nil + : [[FGMPlatformMapTypeBox alloc] initWithValue:[enumAsNumber integerValue]]; + } case 130: - return [FGMPlatformCameraUpdate fromList:[self readValue]]; + return [FGMPlatformCameraPosition fromList:[self readValue]]; case 131: - return [FGMPlatformCircle fromList:[self readValue]]; + return [FGMPlatformCameraUpdate fromList:[self readValue]]; case 132: - return [FGMPlatformHeatmap fromList:[self readValue]]; + return [FGMPlatformCircle fromList:[self readValue]]; case 133: - return [FGMPlatformCluster fromList:[self readValue]]; + return [FGMPlatformHeatmap fromList:[self readValue]]; case 134: - return [FGMPlatformClusterManager fromList:[self readValue]]; + return [FGMPlatformCluster fromList:[self readValue]]; case 135: - return [FGMPlatformMarker fromList:[self readValue]]; + return [FGMPlatformClusterManager fromList:[self readValue]]; case 136: - return [FGMPlatformPolygon fromList:[self readValue]]; + return [FGMPlatformMarker fromList:[self readValue]]; case 137: - return [FGMPlatformPolyline fromList:[self readValue]]; + return [FGMPlatformPolygon fromList:[self readValue]]; case 138: - return [FGMPlatformTile fromList:[self readValue]]; + return [FGMPlatformPolyline fromList:[self readValue]]; case 139: - return [FGMPlatformTileOverlay fromList:[self readValue]]; + return [FGMPlatformTile fromList:[self readValue]]; case 140: - return [FGMPlatformEdgeInsets fromList:[self readValue]]; + return [FGMPlatformTileOverlay fromList:[self readValue]]; case 141: - return [FGMPlatformLatLng fromList:[self readValue]]; + return [FGMPlatformEdgeInsets fromList:[self readValue]]; case 142: - return [FGMPlatformLatLngBounds fromList:[self readValue]]; + return [FGMPlatformLatLng fromList:[self readValue]]; case 143: - return [FGMPlatformCameraTargetBounds fromList:[self readValue]]; + return [FGMPlatformLatLngBounds fromList:[self readValue]]; case 144: - return [FGMPlatformMapViewCreationParams fromList:[self readValue]]; + return [FGMPlatformCameraTargetBounds fromList:[self readValue]]; case 145: - return [FGMPlatformMapConfiguration fromList:[self readValue]]; + return [FGMPlatformMapViewCreationParams fromList:[self readValue]]; case 146: - return [FGMPlatformPoint fromList:[self readValue]]; + return [FGMPlatformMapConfiguration fromList:[self readValue]]; case 147: - return [FGMPlatformTileLayer fromList:[self readValue]]; + return [FGMPlatformPoint fromList:[self readValue]]; case 148: + return [FGMPlatformTileLayer fromList:[self readValue]]; + case 149: return [FGMPlatformZoomRange fromList:[self readValue]]; - case 149: { - NSNumber *enumAsNumber = [self readValue]; - return enumAsNumber == nil - ? nil - : [[FGMPlatformMapTypeBox alloc] initWithValue:[enumAsNumber integerValue]]; - } default: return [super readValueOfType:type]; } @@ -817,70 +817,70 @@ @interface FGMMessagesPigeonCodecWriter : FlutterStandardWriter @end @implementation FGMMessagesPigeonCodecWriter - (void)writeValue:(id)value { - if ([value isKindOfClass:[FGMPlatformCameraPosition class]]) { + if ([value isKindOfClass:[FGMPlatformMapTypeBox class]]) { + FGMPlatformMapTypeBox *box = (FGMPlatformMapTypeBox *)value; [self writeByte:129]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformCameraUpdate class]]) { + [self writeValue:(value == nil ? [NSNull null] : [NSNumber numberWithInteger:box.value])]; + } else if ([value isKindOfClass:[FGMPlatformCameraPosition class]]) { [self writeByte:130]; [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformCircle class]]) { + } else if ([value isKindOfClass:[FGMPlatformCameraUpdate class]]) { [self writeByte:131]; [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformHeatmap class]]) { + } else if ([value isKindOfClass:[FGMPlatformCircle class]]) { [self writeByte:132]; [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformCluster class]]) { + } else if ([value isKindOfClass:[FGMPlatformHeatmap class]]) { [self writeByte:133]; [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformClusterManager class]]) { + } else if ([value isKindOfClass:[FGMPlatformCluster class]]) { [self writeByte:134]; [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformMarker class]]) { + } else if ([value isKindOfClass:[FGMPlatformClusterManager class]]) { [self writeByte:135]; [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformPolygon class]]) { + } else if ([value isKindOfClass:[FGMPlatformMarker class]]) { [self writeByte:136]; [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformPolyline class]]) { + } else if ([value isKindOfClass:[FGMPlatformPolygon class]]) { [self writeByte:137]; [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformTile class]]) { + } else if ([value isKindOfClass:[FGMPlatformPolyline class]]) { [self writeByte:138]; [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformTileOverlay class]]) { + } else if ([value isKindOfClass:[FGMPlatformTile class]]) { [self writeByte:139]; [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformEdgeInsets class]]) { + } else if ([value isKindOfClass:[FGMPlatformTileOverlay class]]) { [self writeByte:140]; [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformLatLng class]]) { + } else if ([value isKindOfClass:[FGMPlatformEdgeInsets class]]) { [self writeByte:141]; [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformLatLngBounds class]]) { + } else if ([value isKindOfClass:[FGMPlatformLatLng class]]) { [self writeByte:142]; [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformCameraTargetBounds class]]) { + } else if ([value isKindOfClass:[FGMPlatformLatLngBounds class]]) { [self writeByte:143]; [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformMapViewCreationParams class]]) { + } else if ([value isKindOfClass:[FGMPlatformCameraTargetBounds class]]) { [self writeByte:144]; [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformMapConfiguration class]]) { + } else if ([value isKindOfClass:[FGMPlatformMapViewCreationParams class]]) { [self writeByte:145]; [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformPoint class]]) { + } else if ([value isKindOfClass:[FGMPlatformMapConfiguration class]]) { [self writeByte:146]; [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformTileLayer class]]) { + } else if ([value isKindOfClass:[FGMPlatformPoint class]]) { [self writeByte:147]; [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformZoomRange class]]) { + } else if ([value isKindOfClass:[FGMPlatformTileLayer class]]) { [self writeByte:148]; [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformMapTypeBox class]]) { - FGMPlatformMapTypeBox *box = (FGMPlatformMapTypeBox *)value; + } else if ([value isKindOfClass:[FGMPlatformZoomRange class]]) { [self writeByte:149]; - [self writeValue:(value == nil ? [NSNull null] : [NSNumber numberWithInteger:box.value])]; + [self writeValue:[value toList]]; } else { [super writeValue:value]; } diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/lib/src/google_map_inspector_ios.dart b/packages/google_maps_flutter/google_maps_flutter_ios/lib/src/google_map_inspector_ios.dart index 9d8ddadf192c..823e210ce73b 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios/lib/src/google_map_inspector_ios.dart +++ b/packages/google_maps_flutter/google_maps_flutter_ios/lib/src/google_map_inspector_ios.dart @@ -137,9 +137,8 @@ class GoogleMapsInspectorIOS extends GoogleMapsInspectorPlatform { }) async { return (await _inspectorProvider(mapId)! .getClusters(clusterManagerId.value)) - // See comment in messages.dart for why the force unwrap is okay. - .map((PlatformCluster? cluster) => - GoogleMapsFlutterIOS.clusterFromPlatformCluster(cluster!)) + .map((PlatformCluster cluster) => + GoogleMapsFlutterIOS.clusterFromPlatformCluster(cluster)) .toList(); } } diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/lib/src/messages.g.dart b/packages/google_maps_flutter/google_maps_flutter_ios/lib/src/messages.g.dart index 8daae542a7da..699d9e4e44af 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios/lib/src/messages.g.dart +++ b/packages/google_maps_flutter/google_maps_flutter_ios/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 (v20.0.2), do not edit directly. +// Autogenerated from Pigeon (v22.4.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, no_leading_underscores_for_local_identifiers @@ -165,7 +165,7 @@ class PlatformCluster { PlatformLatLngBounds bounds; - List markerIds; + List markerIds; Object encode() { return [ @@ -182,7 +182,7 @@ class PlatformCluster { clusterManagerId: result[0]! as String, position: result[1]! as PlatformLatLng, bounds: result[2]! as PlatformLatLngBounds, - markerIds: (result[3] as List?)!.cast(), + markerIds: (result[3] as List?)!.cast(), ); } } @@ -475,19 +475,19 @@ class PlatformMapViewCreationParams { PlatformMapConfiguration mapConfiguration; - List initialCircles; + List initialCircles; - List initialMarkers; + List initialMarkers; - List initialPolygons; + List initialPolygons; - List initialPolylines; + List initialPolylines; - List initialHeatmaps; + List initialHeatmaps; - List initialTileOverlays; + List initialTileOverlays; - List initialClusterManagers; + List initialClusterManagers; Object encode() { return [ @@ -508,16 +508,15 @@ class PlatformMapViewCreationParams { return PlatformMapViewCreationParams( initialCameraPosition: result[0]! as PlatformCameraPosition, mapConfiguration: result[1]! as PlatformMapConfiguration, - initialCircles: (result[2] as List?)!.cast(), - initialMarkers: (result[3] as List?)!.cast(), - initialPolygons: (result[4] as List?)!.cast(), - initialPolylines: - (result[5] as List?)!.cast(), - initialHeatmaps: (result[6] as List?)!.cast(), + initialCircles: (result[2] as List?)!.cast(), + initialMarkers: (result[3] as List?)!.cast(), + initialPolygons: (result[4] as List?)!.cast(), + initialPolylines: (result[5] as List?)!.cast(), + initialHeatmaps: (result[6] as List?)!.cast(), initialTileOverlays: - (result[7] as List?)!.cast(), + (result[7] as List?)!.cast(), initialClusterManagers: - (result[8] as List?)!.cast(), + (result[8] as List?)!.cast(), ); } } @@ -719,69 +718,72 @@ class _PigeonCodec extends StandardMessageCodec { const _PigeonCodec(); @override void writeValue(WriteBuffer buffer, Object? value) { - if (value is PlatformCameraPosition) { + if (value is int) { + buffer.putUint8(4); + buffer.putInt64(value); + } else if (value is PlatformMapType) { buffer.putUint8(129); - writeValue(buffer, value.encode()); - } else if (value is PlatformCameraUpdate) { + writeValue(buffer, value.index); + } else if (value is PlatformCameraPosition) { buffer.putUint8(130); writeValue(buffer, value.encode()); - } else if (value is PlatformCircle) { + } else if (value is PlatformCameraUpdate) { buffer.putUint8(131); writeValue(buffer, value.encode()); - } else if (value is PlatformHeatmap) { + } else if (value is PlatformCircle) { buffer.putUint8(132); writeValue(buffer, value.encode()); - } else if (value is PlatformCluster) { + } else if (value is PlatformHeatmap) { buffer.putUint8(133); writeValue(buffer, value.encode()); - } else if (value is PlatformClusterManager) { + } else if (value is PlatformCluster) { buffer.putUint8(134); writeValue(buffer, value.encode()); - } else if (value is PlatformMarker) { + } else if (value is PlatformClusterManager) { buffer.putUint8(135); writeValue(buffer, value.encode()); - } else if (value is PlatformPolygon) { + } else if (value is PlatformMarker) { buffer.putUint8(136); writeValue(buffer, value.encode()); - } else if (value is PlatformPolyline) { + } else if (value is PlatformPolygon) { buffer.putUint8(137); writeValue(buffer, value.encode()); - } else if (value is PlatformTile) { + } else if (value is PlatformPolyline) { buffer.putUint8(138); writeValue(buffer, value.encode()); - } else if (value is PlatformTileOverlay) { + } else if (value is PlatformTile) { buffer.putUint8(139); writeValue(buffer, value.encode()); - } else if (value is PlatformEdgeInsets) { + } else if (value is PlatformTileOverlay) { buffer.putUint8(140); writeValue(buffer, value.encode()); - } else if (value is PlatformLatLng) { + } else if (value is PlatformEdgeInsets) { buffer.putUint8(141); writeValue(buffer, value.encode()); - } else if (value is PlatformLatLngBounds) { + } else if (value is PlatformLatLng) { buffer.putUint8(142); writeValue(buffer, value.encode()); - } else if (value is PlatformCameraTargetBounds) { + } else if (value is PlatformLatLngBounds) { buffer.putUint8(143); writeValue(buffer, value.encode()); - } else if (value is PlatformMapViewCreationParams) { + } else if (value is PlatformCameraTargetBounds) { buffer.putUint8(144); writeValue(buffer, value.encode()); - } else if (value is PlatformMapConfiguration) { + } else if (value is PlatformMapViewCreationParams) { buffer.putUint8(145); writeValue(buffer, value.encode()); - } else if (value is PlatformPoint) { + } else if (value is PlatformMapConfiguration) { buffer.putUint8(146); writeValue(buffer, value.encode()); - } else if (value is PlatformTileLayer) { + } else if (value is PlatformPoint) { buffer.putUint8(147); writeValue(buffer, value.encode()); - } else if (value is PlatformZoomRange) { + } else if (value is PlatformTileLayer) { buffer.putUint8(148); writeValue(buffer, value.encode()); - } else if (value is PlatformMapType) { + } else if (value is PlatformZoomRange) { buffer.putUint8(149); - writeValue(buffer, value.index); + writeValue(buffer, value.encode()); } else { super.writeValue(buffer, value); } @@ -791,48 +793,48 @@ class _PigeonCodec extends StandardMessageCodec { Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { case 129: - return PlatformCameraPosition.decode(readValue(buffer)!); + final int? value = readValue(buffer) as int?; + return value == null ? null : PlatformMapType.values[value]; case 130: - return PlatformCameraUpdate.decode(readValue(buffer)!); + return PlatformCameraPosition.decode(readValue(buffer)!); case 131: - return PlatformCircle.decode(readValue(buffer)!); + return PlatformCameraUpdate.decode(readValue(buffer)!); case 132: - return PlatformHeatmap.decode(readValue(buffer)!); + return PlatformCircle.decode(readValue(buffer)!); case 133: - return PlatformCluster.decode(readValue(buffer)!); + return PlatformHeatmap.decode(readValue(buffer)!); case 134: - return PlatformClusterManager.decode(readValue(buffer)!); + return PlatformCluster.decode(readValue(buffer)!); case 135: - return PlatformMarker.decode(readValue(buffer)!); + return PlatformClusterManager.decode(readValue(buffer)!); case 136: - return PlatformPolygon.decode(readValue(buffer)!); + return PlatformMarker.decode(readValue(buffer)!); case 137: - return PlatformPolyline.decode(readValue(buffer)!); + return PlatformPolygon.decode(readValue(buffer)!); case 138: - return PlatformTile.decode(readValue(buffer)!); + return PlatformPolyline.decode(readValue(buffer)!); case 139: - return PlatformTileOverlay.decode(readValue(buffer)!); + return PlatformTile.decode(readValue(buffer)!); case 140: - return PlatformEdgeInsets.decode(readValue(buffer)!); + return PlatformTileOverlay.decode(readValue(buffer)!); case 141: - return PlatformLatLng.decode(readValue(buffer)!); + return PlatformEdgeInsets.decode(readValue(buffer)!); case 142: - return PlatformLatLngBounds.decode(readValue(buffer)!); + return PlatformLatLng.decode(readValue(buffer)!); case 143: - return PlatformCameraTargetBounds.decode(readValue(buffer)!); + return PlatformLatLngBounds.decode(readValue(buffer)!); case 144: - return PlatformMapViewCreationParams.decode(readValue(buffer)!); + return PlatformCameraTargetBounds.decode(readValue(buffer)!); case 145: - return PlatformMapConfiguration.decode(readValue(buffer)!); + return PlatformMapViewCreationParams.decode(readValue(buffer)!); case 146: - return PlatformPoint.decode(readValue(buffer)!); + return PlatformMapConfiguration.decode(readValue(buffer)!); case 147: - return PlatformTileLayer.decode(readValue(buffer)!); + return PlatformPoint.decode(readValue(buffer)!); case 148: - return PlatformZoomRange.decode(readValue(buffer)!); + return PlatformTileLayer.decode(readValue(buffer)!); case 149: - final int? value = readValue(buffer) as int?; - return value == null ? null : PlatformMapType.values[value]; + return PlatformZoomRange.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); } @@ -847,34 +849,34 @@ class MapsApi { /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. MapsApi({BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) - : __pigeon_binaryMessenger = binaryMessenger, - __pigeon_messageChannelSuffix = + : pigeonVar_binaryMessenger = binaryMessenger, + pigeonVar_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; - final BinaryMessenger? __pigeon_binaryMessenger; + final BinaryMessenger? pigeonVar_binaryMessenger; static const MessageCodec pigeonChannelCodec = _PigeonCodec(); - final String __pigeon_messageChannelSuffix; + final String pigeonVar_messageChannelSuffix; /// Returns once the map instance is available. Future waitForMap() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.waitForMap$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.waitForMap$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -887,23 +889,23 @@ class MapsApi { /// null values will remain unchanged. Future updateMapConfiguration( PlatformMapConfiguration configuration) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.updateMapConfiguration$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.updateMapConfiguration$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([configuration]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = await pigeonVar_channel + .send([configuration]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -911,25 +913,25 @@ class MapsApi { } /// Updates the set of circles on the map. - Future updateCircles(List toAdd, - List toChange, List idsToRemove) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.updateCircles$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + Future updateCircles(List toAdd, + List toChange, List idsToRemove) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.updateCircles$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel + final List? pigeonVar_replyList = await pigeonVar_channel .send([toAdd, toChange, idsToRemove]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -937,25 +939,25 @@ class MapsApi { } /// Updates the set of heatmaps on the map. - Future updateHeatmaps(List toAdd, - List toChange, List idsToRemove) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.updateHeatmaps$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + Future updateHeatmaps(List toAdd, + List toChange, List idsToRemove) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.updateHeatmaps$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel + final List? pigeonVar_replyList = await pigeonVar_channel .send([toAdd, toChange, idsToRemove]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -964,24 +966,24 @@ class MapsApi { /// Updates the set of custer managers for clusters on the map. Future updateClusterManagers( - List toAdd, List idsToRemove) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.updateClusterManagers$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + List toAdd, List idsToRemove) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.updateClusterManagers$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel + final List? pigeonVar_replyList = await pigeonVar_channel .send([toAdd, idsToRemove]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -989,25 +991,25 @@ class MapsApi { } /// Updates the set of markers on the map. - Future updateMarkers(List toAdd, - List toChange, List idsToRemove) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.updateMarkers$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + Future updateMarkers(List toAdd, + List toChange, List idsToRemove) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.updateMarkers$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel + final List? pigeonVar_replyList = await pigeonVar_channel .send([toAdd, toChange, idsToRemove]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -1015,25 +1017,25 @@ class MapsApi { } /// Updates the set of polygonss on the map. - Future updatePolygons(List toAdd, - List toChange, List idsToRemove) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.updatePolygons$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + Future updatePolygons(List toAdd, + List toChange, List idsToRemove) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.updatePolygons$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel + final List? pigeonVar_replyList = await pigeonVar_channel .send([toAdd, toChange, idsToRemove]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -1041,25 +1043,25 @@ class MapsApi { } /// Updates the set of polylines on the map. - Future updatePolylines(List toAdd, - List toChange, List idsToRemove) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.updatePolylines$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + Future updatePolylines(List toAdd, + List toChange, List idsToRemove) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.updatePolylines$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel + final List? pigeonVar_replyList = await pigeonVar_channel .send([toAdd, toChange, idsToRemove]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -1067,25 +1069,25 @@ class MapsApi { } /// Updates the set of tile overlays on the map. - Future updateTileOverlays(List toAdd, - List toChange, List idsToRemove) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.updateTileOverlays$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + Future updateTileOverlays(List toAdd, + List toChange, List idsToRemove) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.updateTileOverlays$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel + final List? pigeonVar_replyList = await pigeonVar_channel .send([toAdd, toChange, idsToRemove]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -1094,114 +1096,114 @@ class MapsApi { /// Gets the screen coordinate for the given map location. Future getScreenCoordinate(PlatformLatLng latLng) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.getScreenCoordinate$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.getScreenCoordinate$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([latLng]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([latLng]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as PlatformPoint?)!; + return (pigeonVar_replyList[0] as PlatformPoint?)!; } } /// Gets the map location for the given screen coordinate. Future getLatLng(PlatformPoint screenCoordinate) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.getLatLng$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.getLatLng$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel + final List? pigeonVar_replyList = await pigeonVar_channel .send([screenCoordinate]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as PlatformLatLng?)!; + return (pigeonVar_replyList[0] as PlatformLatLng?)!; } } /// Gets the map region currently displayed on the map. Future getVisibleRegion() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.getVisibleRegion$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.getVisibleRegion$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as PlatformLatLngBounds?)!; + return (pigeonVar_replyList[0] as PlatformLatLngBounds?)!; } } /// Moves the camera according to [cameraUpdate] immediately, with no /// animation. Future moveCamera(PlatformCameraUpdate cameraUpdate) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.moveCamera$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.moveCamera$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([cameraUpdate]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([cameraUpdate]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -1210,23 +1212,23 @@ class MapsApi { /// Moves the camera according to [cameraUpdate], animating the update. Future animateCamera(PlatformCameraUpdate cameraUpdate) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.animateCamera$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.animateCamera$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([cameraUpdate]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([cameraUpdate]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -1235,53 +1237,53 @@ class MapsApi { /// Gets the current map zoom level. Future getZoomLevel() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.getZoomLevel$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.getZoomLevel$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as double?)!; + return (pigeonVar_replyList[0] as double?)!; } } /// Show the info window for the marker with the given ID. Future showInfoWindow(String markerId) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.showInfoWindow$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.showInfoWindow$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([markerId]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([markerId]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -1290,23 +1292,23 @@ class MapsApi { /// Hide the info window for the marker with the given ID. Future hideInfoWindow(String markerId) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.hideInfoWindow$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.hideInfoWindow$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([markerId]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([markerId]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -1316,31 +1318,31 @@ class MapsApi { /// Returns true if the marker with the given ID is currently displaying its /// info window. Future isInfoWindowShown(String markerId) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.isInfoWindowShown$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.isInfoWindowShown$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([markerId]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([markerId]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as bool?)!; + return (pigeonVar_replyList[0] as bool?)!; } } @@ -1350,26 +1352,26 @@ class MapsApi { /// If there was an error setting the style, such as an invalid style string, /// returns the error message. Future setStyle(String style) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.setStyle$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.setStyle$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([style]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([style]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { - return (__pigeon_replyList[0] as String?); + return (pigeonVar_replyList[0] as String?); } } @@ -1379,48 +1381,48 @@ class MapsApi { /// This allows checking asynchronously for initial style failures, as there /// is no way to return failures from map initialization. Future getLastStyleError() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.getLastStyleError$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.getLastStyleError$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { - return (__pigeon_replyList[0] as String?); + return (pigeonVar_replyList[0] as String?); } } /// Clears the cache of tiles previously requseted from the tile provider. Future clearTileCache(String tileOverlayId) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.clearTileCache$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.clearTileCache$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([tileOverlayId]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = await pigeonVar_channel + .send([tileOverlayId]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -1429,26 +1431,26 @@ class MapsApi { /// Takes a snapshot of the map and returns its image data. Future takeSnapshot() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.takeSnapshot$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.takeSnapshot$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { - return (__pigeon_replyList[0] as Uint8List?); + return (pigeonVar_replyList[0] as Uint8List?); } } } @@ -1511,15 +1513,16 @@ abstract class MapsCallbackApi { messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onCameraMoveStarted$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { try { api.onCameraMoveStarted(); return wrapResponse(empty: true); @@ -1533,15 +1536,16 @@ abstract class MapsCallbackApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onCameraMove$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onCameraMove was null.'); final List args = (message as List?)!; @@ -1562,15 +1566,16 @@ abstract class MapsCallbackApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onCameraIdle$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { try { api.onCameraIdle(); return wrapResponse(empty: true); @@ -1584,15 +1589,16 @@ abstract class MapsCallbackApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onTap$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onTap was null.'); final List args = (message as List?)!; @@ -1612,15 +1618,16 @@ abstract class MapsCallbackApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onLongPress$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onLongPress was null.'); final List args = (message as List?)!; @@ -1640,15 +1647,16 @@ abstract class MapsCallbackApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onMarkerTap$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onMarkerTap was null.'); final List args = (message as List?)!; @@ -1668,15 +1676,16 @@ abstract class MapsCallbackApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onMarkerDragStart$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onMarkerDragStart was null.'); final List args = (message as List?)!; @@ -1699,15 +1708,16 @@ abstract class MapsCallbackApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onMarkerDrag$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onMarkerDrag was null.'); final List args = (message as List?)!; @@ -1730,15 +1740,16 @@ abstract class MapsCallbackApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onMarkerDragEnd$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onMarkerDragEnd was null.'); final List args = (message as List?)!; @@ -1761,15 +1772,16 @@ abstract class MapsCallbackApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onInfoWindowTap$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onInfoWindowTap was null.'); final List args = (message as List?)!; @@ -1789,15 +1801,16 @@ abstract class MapsCallbackApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onCircleTap$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onCircleTap was null.'); final List args = (message as List?)!; @@ -1817,15 +1830,16 @@ abstract class MapsCallbackApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onClusterTap$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onClusterTap was null.'); final List args = (message as List?)!; @@ -1845,15 +1859,16 @@ abstract class MapsCallbackApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onPolygonTap$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onPolygonTap was null.'); final List args = (message as List?)!; @@ -1873,15 +1888,16 @@ abstract class MapsCallbackApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onPolylineTap$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onPolylineTap was null.'); final List args = (message as List?)!; @@ -1901,15 +1917,16 @@ abstract class MapsCallbackApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.getTileOverlayTile$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.getTileOverlayTile was null.'); final List args = (message as List?)!; @@ -1947,33 +1964,33 @@ class MapsPlatformViewApi { /// BinaryMessenger will be used which routes to the host platform. MapsPlatformViewApi( {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) - : __pigeon_binaryMessenger = binaryMessenger, - __pigeon_messageChannelSuffix = + : pigeonVar_binaryMessenger = binaryMessenger, + pigeonVar_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; - final BinaryMessenger? __pigeon_binaryMessenger; + final BinaryMessenger? pigeonVar_binaryMessenger; static const MessageCodec pigeonChannelCodec = _PigeonCodec(); - final String __pigeon_messageChannelSuffix; + final String pigeonVar_messageChannelSuffix; Future createView(PlatformMapViewCreationParams? type) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_ios.MapsPlatformViewApi.createView$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_ios.MapsPlatformViewApi.createView$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([type]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([type]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -1988,351 +2005,351 @@ class MapsInspectorApi { /// BinaryMessenger will be used which routes to the host platform. MapsInspectorApi( {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) - : __pigeon_binaryMessenger = binaryMessenger, - __pigeon_messageChannelSuffix = + : pigeonVar_binaryMessenger = binaryMessenger, + pigeonVar_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; - final BinaryMessenger? __pigeon_binaryMessenger; + final BinaryMessenger? pigeonVar_binaryMessenger; static const MessageCodec pigeonChannelCodec = _PigeonCodec(); - final String __pigeon_messageChannelSuffix; + final String pigeonVar_messageChannelSuffix; Future areBuildingsEnabled() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_ios.MapsInspectorApi.areBuildingsEnabled$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_ios.MapsInspectorApi.areBuildingsEnabled$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as bool?)!; + return (pigeonVar_replyList[0] as bool?)!; } } Future areRotateGesturesEnabled() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_ios.MapsInspectorApi.areRotateGesturesEnabled$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_ios.MapsInspectorApi.areRotateGesturesEnabled$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as bool?)!; + return (pigeonVar_replyList[0] as bool?)!; } } Future areScrollGesturesEnabled() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_ios.MapsInspectorApi.areScrollGesturesEnabled$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_ios.MapsInspectorApi.areScrollGesturesEnabled$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as bool?)!; + return (pigeonVar_replyList[0] as bool?)!; } } Future areTiltGesturesEnabled() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_ios.MapsInspectorApi.areTiltGesturesEnabled$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_ios.MapsInspectorApi.areTiltGesturesEnabled$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as bool?)!; + return (pigeonVar_replyList[0] as bool?)!; } } Future areZoomGesturesEnabled() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_ios.MapsInspectorApi.areZoomGesturesEnabled$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_ios.MapsInspectorApi.areZoomGesturesEnabled$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as bool?)!; + return (pigeonVar_replyList[0] as bool?)!; } } Future isCompassEnabled() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_ios.MapsInspectorApi.isCompassEnabled$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_ios.MapsInspectorApi.isCompassEnabled$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as bool?)!; + return (pigeonVar_replyList[0] as bool?)!; } } Future isMyLocationButtonEnabled() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_ios.MapsInspectorApi.isMyLocationButtonEnabled$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_ios.MapsInspectorApi.isMyLocationButtonEnabled$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as bool?)!; + return (pigeonVar_replyList[0] as bool?)!; } } Future isTrafficEnabled() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_ios.MapsInspectorApi.isTrafficEnabled$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_ios.MapsInspectorApi.isTrafficEnabled$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as bool?)!; + return (pigeonVar_replyList[0] as bool?)!; } } Future getTileOverlayInfo(String tileOverlayId) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_ios.MapsInspectorApi.getTileOverlayInfo$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_ios.MapsInspectorApi.getTileOverlayInfo$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([tileOverlayId]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = await pigeonVar_channel + .send([tileOverlayId]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { - return (__pigeon_replyList[0] as PlatformTileLayer?); + return (pigeonVar_replyList[0] as PlatformTileLayer?); } } Future getHeatmapInfo(String heatmapId) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_ios.MapsInspectorApi.getHeatmapInfo$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_ios.MapsInspectorApi.getHeatmapInfo$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([heatmapId]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([heatmapId]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { - return (__pigeon_replyList[0] as PlatformHeatmap?); + return (pigeonVar_replyList[0] as PlatformHeatmap?); } } Future getZoomRange() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_ios.MapsInspectorApi.getZoomRange$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_ios.MapsInspectorApi.getZoomRange$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as PlatformZoomRange?)!; + return (pigeonVar_replyList[0] as PlatformZoomRange?)!; } } - Future> getClusters(String clusterManagerId) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.google_maps_flutter_ios.MapsInspectorApi.getClusters$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + Future> getClusters(String clusterManagerId) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_maps_flutter_ios.MapsInspectorApi.getClusters$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel + final List? pigeonVar_replyList = await pigeonVar_channel .send([clusterManagerId]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as List?)! - .cast(); + return (pigeonVar_replyList[0] as List?)! + .cast(); } } } diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/pigeons/messages.dart b/packages/google_maps_flutter/google_maps_flutter_ios/pigeons/messages.dart index d2b2a6c82234..8cc612c684c7 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios/pigeons/messages.dart +++ b/packages/google_maps_flutter/google_maps_flutter_ios/pigeons/messages.dart @@ -87,10 +87,7 @@ class PlatformCluster { final String clusterManagerId; final PlatformLatLng position; final PlatformLatLngBounds bounds; - // TODO(stuartmorgan): Make the generic type non-nullable once supported. - // https://github.com/flutter/flutter/issues/97848 - // The consuming code treats the entries as non-nullable. - final List markerIds; + final List markerIds; } /// Pigeon equivalent of the ClusterManager class. @@ -214,16 +211,13 @@ class PlatformMapViewCreationParams { final PlatformCameraPosition initialCameraPosition; final PlatformMapConfiguration mapConfiguration; - // TODO(stuartmorgan): Make the generic types non-nullable once supported. - // https://github.com/flutter/flutter/issues/97848 - // The consuming code treats the entries as non-nullable. - final List initialCircles; - final List initialMarkers; - final List initialPolygons; - final List initialPolylines; - final List initialHeatmaps; - final List initialTileOverlays; - final List initialClusterManagers; + final List initialCircles; + final List initialMarkers; + final List initialPolygons; + final List initialPolylines; + final List initialHeatmaps; + final List initialTileOverlays; + final List initialClusterManagers; } /// Pigeon equivalent of MapConfiguration. @@ -314,60 +308,39 @@ abstract class MapsApi { void updateMapConfiguration(PlatformMapConfiguration configuration); /// Updates the set of circles on the map. - // TODO(stuartmorgan): Make the generic type non-nullable once supported. - // https://github.com/flutter/flutter/issues/97848 - // The consuming code treats the entries as non-nullable. @ObjCSelector('updateCirclesByAdding:changing:removing:') - void updateCircles(List toAdd, - List toChange, List idsToRemove); + void updateCircles(List toAdd, List toChange, + List idsToRemove); /// Updates the set of heatmaps on the map. - // TODO(stuartmorgan): Make the generic type non-nullable once supported. - // https://github.com/flutter/flutter/issues/97848 - // The consuming code treats the entries as non-nullable. @ObjCSelector('updateHeatmapsByAdding:changing:removing:') - void updateHeatmaps(List toAdd, - List toChange, List idsToRemove); + void updateHeatmaps(List toAdd, + List toChange, List idsToRemove); /// Updates the set of custer managers for clusters on the map. - // TODO(stuartmorgan): Make the generic type non-nullable once supported. - // https://github.com/flutter/flutter/issues/97848 - // The consuming code treats the entries as non-nullable. @ObjCSelector('updateClusterManagersByAdding:removing:') void updateClusterManagers( - List toAdd, List idsToRemove); + List toAdd, List idsToRemove); /// Updates the set of markers on the map. - // TODO(stuartmorgan): Make the generic type non-nullable once supported. - // https://github.com/flutter/flutter/issues/97848 - // The consuming code treats the entries as non-nullable. @ObjCSelector('updateMarkersByAdding:changing:removing:') - void updateMarkers(List toAdd, - List toChange, List idsToRemove); + void updateMarkers(List toAdd, List toChange, + List idsToRemove); /// Updates the set of polygonss on the map. - // TODO(stuartmorgan): Make the generic type non-nullable once supported. - // https://github.com/flutter/flutter/issues/97848 - // The consuming code treats the entries as non-nullable. @ObjCSelector('updatePolygonsByAdding:changing:removing:') - void updatePolygons(List toAdd, - List toChange, List idsToRemove); + void updatePolygons(List toAdd, + List toChange, List idsToRemove); /// Updates the set of polylines on the map. - // TODO(stuartmorgan): Make the generic type non-nullable once supported. - // https://github.com/flutter/flutter/issues/97848 - // The consuming code treats the entries as non-nullable. @ObjCSelector('updatePolylinesByAdding:changing:removing:') - void updatePolylines(List toAdd, - List toChange, List idsToRemove); + void updatePolylines(List toAdd, + List toChange, List idsToRemove); /// Updates the set of tile overlays on the map. - // TODO(stuartmorgan): Make the generic type non-nullable once supported. - // https://github.com/flutter/flutter/issues/97848 - // The consuming code treats the entries as non-nullable. @ObjCSelector('updateTileOverlaysByAdding:changing:removing:') - void updateTileOverlays(List toAdd, - List toChange, List idsToRemove); + void updateTileOverlays(List toAdd, + List toChange, List idsToRemove); /// Gets the screen coordinate for the given map location. @ObjCSelector('screenCoordinatesForLatLng:') @@ -523,9 +496,6 @@ abstract class MapsInspectorApi { PlatformHeatmap? getHeatmapInfo(String heatmapId); @ObjCSelector('zoomRange') PlatformZoomRange getZoomRange(); - // TODO(stuartmorgan): Make the generic type non-nullable once supported. - // https://github.com/flutter/flutter/issues/97848 - // The consuming code treats the entries as non-nullable. @ObjCSelector('clustersWithIdentifier:') - List getClusters(String clusterManagerId); + List getClusters(String clusterManagerId); } 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 6014b6eb6acd..9d727a0c46fa 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.13.0 +version: 2.13.1 environment: sdk: ^3.3.0 @@ -27,8 +27,8 @@ dev_dependencies: build_runner: ^2.4.11 flutter_test: sdk: flutter - mockito: 5.4.4 - pigeon: ^20.0.1 + mockito: ^5.4.4 + pigeon: ^22.4.2 plugin_platform_interface: ^2.1.7 topics: diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/test/google_maps_flutter_ios_test.mocks.dart b/packages/google_maps_flutter/google_maps_flutter_ios/test/google_maps_flutter_ios_test.mocks.dart index c82012987a0a..e94375876150 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios/test/google_maps_flutter_ios_test.mocks.dart +++ b/packages/google_maps_flutter/google_maps_flutter_ios/test/google_maps_flutter_ios_test.mocks.dart @@ -3,11 +3,12 @@ // Do not manually edit this file. // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:async' as _i3; -import 'dart:typed_data' as _i4; +import 'dart:async' as _i4; +import 'dart:typed_data' as _i5; import 'package:google_maps_flutter_ios/src/messages.g.dart' as _i2; import 'package:mockito/mockito.dart' as _i1; +import 'package:mockito/src/dummies.dart' as _i3; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values @@ -59,32 +60,45 @@ class _FakePlatformLatLngBounds_2 extends _i1.SmartFake /// See the documentation for Mockito's code generation for more information. class MockMapsApi extends _i1.Mock implements _i2.MapsApi { @override - _i3.Future waitForMap() => (super.noSuchMethod( + String get pigeonVar_messageChannelSuffix => (super.noSuchMethod( + Invocation.getter(#pigeonVar_messageChannelSuffix), + returnValue: _i3.dummyValue( + this, + Invocation.getter(#pigeonVar_messageChannelSuffix), + ), + returnValueForMissingStub: _i3.dummyValue( + this, + Invocation.getter(#pigeonVar_messageChannelSuffix), + ), + ) as String); + + @override + _i4.Future waitForMap() => (super.noSuchMethod( Invocation.method( #waitForMap, [], ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i3.Future updateMapConfiguration( + _i4.Future updateMapConfiguration( _i2.PlatformMapConfiguration? configuration) => (super.noSuchMethod( Invocation.method( #updateMapConfiguration, [configuration], ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i3.Future updateCircles( - List<_i2.PlatformCircle?>? toAdd, - List<_i2.PlatformCircle?>? toChange, - List? idsToRemove, + _i4.Future updateCircles( + List<_i2.PlatformCircle>? toAdd, + List<_i2.PlatformCircle>? toChange, + List? idsToRemove, ) => (super.noSuchMethod( Invocation.method( @@ -95,15 +109,15 @@ class MockMapsApi extends _i1.Mock implements _i2.MapsApi { idsToRemove, ], ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i3.Future updateHeatmaps( - List<_i2.PlatformHeatmap?>? toAdd, - List<_i2.PlatformHeatmap?>? toChange, - List? idsToRemove, + _i4.Future updateHeatmaps( + List<_i2.PlatformHeatmap>? toAdd, + List<_i2.PlatformHeatmap>? toChange, + List? idsToRemove, ) => (super.noSuchMethod( Invocation.method( @@ -114,14 +128,14 @@ class MockMapsApi extends _i1.Mock implements _i2.MapsApi { idsToRemove, ], ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i3.Future updateClusterManagers( - List<_i2.PlatformClusterManager?>? toAdd, - List? idsToRemove, + _i4.Future updateClusterManagers( + List<_i2.PlatformClusterManager>? toAdd, + List? idsToRemove, ) => (super.noSuchMethod( Invocation.method( @@ -131,15 +145,15 @@ class MockMapsApi extends _i1.Mock implements _i2.MapsApi { idsToRemove, ], ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i3.Future updateMarkers( - List<_i2.PlatformMarker?>? toAdd, - List<_i2.PlatformMarker?>? toChange, - List? idsToRemove, + _i4.Future updateMarkers( + List<_i2.PlatformMarker>? toAdd, + List<_i2.PlatformMarker>? toChange, + List? idsToRemove, ) => (super.noSuchMethod( Invocation.method( @@ -150,15 +164,15 @@ class MockMapsApi extends _i1.Mock implements _i2.MapsApi { idsToRemove, ], ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i3.Future updatePolygons( - List<_i2.PlatformPolygon?>? toAdd, - List<_i2.PlatformPolygon?>? toChange, - List? idsToRemove, + _i4.Future updatePolygons( + List<_i2.PlatformPolygon>? toAdd, + List<_i2.PlatformPolygon>? toChange, + List? idsToRemove, ) => (super.noSuchMethod( Invocation.method( @@ -169,15 +183,15 @@ class MockMapsApi extends _i1.Mock implements _i2.MapsApi { idsToRemove, ], ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i3.Future updatePolylines( - List<_i2.PlatformPolyline?>? toAdd, - List<_i2.PlatformPolyline?>? toChange, - List? idsToRemove, + _i4.Future updatePolylines( + List<_i2.PlatformPolyline>? toAdd, + List<_i2.PlatformPolyline>? toChange, + List? idsToRemove, ) => (super.noSuchMethod( Invocation.method( @@ -188,15 +202,15 @@ class MockMapsApi extends _i1.Mock implements _i2.MapsApi { idsToRemove, ], ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i3.Future updateTileOverlays( - List<_i2.PlatformTileOverlay?>? toAdd, - List<_i2.PlatformTileOverlay?>? toChange, - List? idsToRemove, + _i4.Future updateTileOverlays( + List<_i2.PlatformTileOverlay>? toAdd, + List<_i2.PlatformTileOverlay>? toChange, + List? idsToRemove, ) => (super.noSuchMethod( Invocation.method( @@ -207,19 +221,19 @@ class MockMapsApi extends _i1.Mock implements _i2.MapsApi { idsToRemove, ], ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i3.Future<_i2.PlatformPoint> getScreenCoordinate( + _i4.Future<_i2.PlatformPoint> getScreenCoordinate( _i2.PlatformLatLng? latLng) => (super.noSuchMethod( Invocation.method( #getScreenCoordinate, [latLng], ), - returnValue: _i3.Future<_i2.PlatformPoint>.value(_FakePlatformPoint_0( + returnValue: _i4.Future<_i2.PlatformPoint>.value(_FakePlatformPoint_0( this, Invocation.method( #getScreenCoordinate, @@ -227,24 +241,24 @@ class MockMapsApi extends _i1.Mock implements _i2.MapsApi { ), )), returnValueForMissingStub: - _i3.Future<_i2.PlatformPoint>.value(_FakePlatformPoint_0( + _i4.Future<_i2.PlatformPoint>.value(_FakePlatformPoint_0( this, Invocation.method( #getScreenCoordinate, [latLng], ), )), - ) as _i3.Future<_i2.PlatformPoint>); + ) as _i4.Future<_i2.PlatformPoint>); @override - _i3.Future<_i2.PlatformLatLng> getLatLng( + _i4.Future<_i2.PlatformLatLng> getLatLng( _i2.PlatformPoint? screenCoordinate) => (super.noSuchMethod( Invocation.method( #getLatLng, [screenCoordinate], ), - returnValue: _i3.Future<_i2.PlatformLatLng>.value(_FakePlatformLatLng_1( + returnValue: _i4.Future<_i2.PlatformLatLng>.value(_FakePlatformLatLng_1( this, Invocation.method( #getLatLng, @@ -252,23 +266,23 @@ class MockMapsApi extends _i1.Mock implements _i2.MapsApi { ), )), returnValueForMissingStub: - _i3.Future<_i2.PlatformLatLng>.value(_FakePlatformLatLng_1( + _i4.Future<_i2.PlatformLatLng>.value(_FakePlatformLatLng_1( this, Invocation.method( #getLatLng, [screenCoordinate], ), )), - ) as _i3.Future<_i2.PlatformLatLng>); + ) as _i4.Future<_i2.PlatformLatLng>); @override - _i3.Future<_i2.PlatformLatLngBounds> getVisibleRegion() => + _i4.Future<_i2.PlatformLatLngBounds> getVisibleRegion() => (super.noSuchMethod( Invocation.method( #getVisibleRegion, [], ), - returnValue: _i3.Future<_i2.PlatformLatLngBounds>.value( + returnValue: _i4.Future<_i2.PlatformLatLngBounds>.value( _FakePlatformLatLngBounds_2( this, Invocation.method( @@ -276,7 +290,7 @@ class MockMapsApi extends _i1.Mock implements _i2.MapsApi { [], ), )), - returnValueForMissingStub: _i3.Future<_i2.PlatformLatLngBounds>.value( + returnValueForMissingStub: _i4.Future<_i2.PlatformLatLngBounds>.value( _FakePlatformLatLngBounds_2( this, Invocation.method( @@ -284,107 +298,107 @@ class MockMapsApi extends _i1.Mock implements _i2.MapsApi { [], ), )), - ) as _i3.Future<_i2.PlatformLatLngBounds>); + ) as _i4.Future<_i2.PlatformLatLngBounds>); @override - _i3.Future moveCamera(_i2.PlatformCameraUpdate? cameraUpdate) => + _i4.Future moveCamera(_i2.PlatformCameraUpdate? cameraUpdate) => (super.noSuchMethod( Invocation.method( #moveCamera, [cameraUpdate], ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i3.Future animateCamera(_i2.PlatformCameraUpdate? cameraUpdate) => + _i4.Future animateCamera(_i2.PlatformCameraUpdate? cameraUpdate) => (super.noSuchMethod( Invocation.method( #animateCamera, [cameraUpdate], ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i3.Future getZoomLevel() => (super.noSuchMethod( + _i4.Future getZoomLevel() => (super.noSuchMethod( Invocation.method( #getZoomLevel, [], ), - returnValue: _i3.Future.value(0.0), - returnValueForMissingStub: _i3.Future.value(0.0), - ) as _i3.Future); + returnValue: _i4.Future.value(0.0), + returnValueForMissingStub: _i4.Future.value(0.0), + ) as _i4.Future); @override - _i3.Future showInfoWindow(String? markerId) => (super.noSuchMethod( + _i4.Future showInfoWindow(String? markerId) => (super.noSuchMethod( Invocation.method( #showInfoWindow, [markerId], ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i3.Future hideInfoWindow(String? markerId) => (super.noSuchMethod( + _i4.Future hideInfoWindow(String? markerId) => (super.noSuchMethod( Invocation.method( #hideInfoWindow, [markerId], ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i3.Future isInfoWindowShown(String? markerId) => (super.noSuchMethod( + _i4.Future isInfoWindowShown(String? markerId) => (super.noSuchMethod( Invocation.method( #isInfoWindowShown, [markerId], ), - returnValue: _i3.Future.value(false), - returnValueForMissingStub: _i3.Future.value(false), - ) as _i3.Future); + returnValue: _i4.Future.value(false), + returnValueForMissingStub: _i4.Future.value(false), + ) as _i4.Future); @override - _i3.Future setStyle(String? style) => (super.noSuchMethod( + _i4.Future setStyle(String? style) => (super.noSuchMethod( Invocation.method( #setStyle, [style], ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i3.Future getLastStyleError() => (super.noSuchMethod( + _i4.Future getLastStyleError() => (super.noSuchMethod( Invocation.method( #getLastStyleError, [], ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i3.Future clearTileCache(String? tileOverlayId) => (super.noSuchMethod( + _i4.Future clearTileCache(String? tileOverlayId) => (super.noSuchMethod( Invocation.method( #clearTileCache, [tileOverlayId], ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i3.Future<_i4.Uint8List?> takeSnapshot() => (super.noSuchMethod( + _i4.Future<_i5.Uint8List?> takeSnapshot() => (super.noSuchMethod( Invocation.method( #takeSnapshot, [], ), - returnValue: _i3.Future<_i4.Uint8List?>.value(), - returnValueForMissingStub: _i3.Future<_i4.Uint8List?>.value(), - ) as _i3.Future<_i4.Uint8List?>); + returnValue: _i4.Future<_i5.Uint8List?>.value(), + returnValueForMissingStub: _i4.Future<_i5.Uint8List?>.value(), + ) as _i4.Future<_i5.Uint8List?>); } diff --git a/packages/google_maps_flutter/google_maps_flutter_platform_interface/CHANGELOG.md b/packages/google_maps_flutter/google_maps_flutter_platform_interface/CHANGELOG.md index 25d015dc3852..49c12ebbbdab 100644 --- a/packages/google_maps_flutter/google_maps_flutter_platform_interface/CHANGELOG.md +++ b/packages/google_maps_flutter/google_maps_flutter_platform_interface/CHANGELOG.md @@ -1,5 +1,23 @@ -## NEXT +## 2.9.5 +* Converts `BitmapDescriptor` to typesafe structures. + +## 2.9.4 + +* Converts `PatternItem` to typesafe structure. +* Converts `Cap` to typesafe structure. + +## 2.9.3 + +* Corrects an incorrect comment in polyline.dart file. + +## 2.9.2 + +* Corrects JSON tag for `CameraUpdateNewLatLngBounds`. + +## 2.9.1 + +* Splits CameraUpdate into dervied classes for different update cases. * Updates minimum supported SDK version to Flutter 3.19/Dart 3.3. ## 2.9.0 diff --git a/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/bitmap.dart b/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/bitmap.dart index 71b5e267f643..e25d3c7a2c57 100644 --- a/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/bitmap.dart +++ b/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/bitmap.dart @@ -5,7 +5,7 @@ import 'dart:async' show Future; import 'dart:typed_data' show Uint8List; -import 'package:flutter/foundation.dart' show kIsWeb; +import 'package:flutter/foundation.dart' show kIsWeb, visibleForTesting; import 'package:flutter/material.dart' show AssetBundleImageKey, @@ -29,6 +29,14 @@ enum MapBitmapScaling { none, } +/// Convert a string from provided JSON to a MapBitmapScaling enum. +@visibleForTesting +MapBitmapScaling mapBitmapScalingFromString(String mode) => switch (mode) { + 'auto' => MapBitmapScaling.auto, + 'none' => MapBitmapScaling.none, + _ => throw ArgumentError('Unrecognized MapBitmapScaling $mode', 'mode'), + }; + // The default pixel ratio for custom bitmaps. const double _naturalPixelRatio = 1.0; @@ -44,14 +52,14 @@ const double _naturalPixelRatio = 1.0; /// a default marker icon. /// Use the [BitmapDescriptor.defaultMarkerWithHue] to create a /// [BitmapDescriptor] for a default marker icon with a hue value. -class BitmapDescriptor { - const BitmapDescriptor._(this._json); +abstract class BitmapDescriptor { + const BitmapDescriptor._(); /// The inverse of .toJson. // TODO(stuartmorgan): Remove this in the next breaking change. @Deprecated('No longer supported') - BitmapDescriptor.fromJson(Object json) : _json = json { - assert(_json is List); + static BitmapDescriptor fromJson(Object json) { + assert(json is List); final List jsonList = json as List; assert(_validTypes.contains(jsonList[0])); switch (jsonList[0]) { @@ -61,11 +69,14 @@ class BitmapDescriptor { assert(jsonList[1] is num); final num secondElement = jsonList[1] as num; assert(0 <= secondElement && secondElement < 360); + return DefaultMarker(hue: secondElement); } + return const DefaultMarker(); case _fromBytes: assert(jsonList.length == 2); assert(jsonList[1] != null && jsonList[1] is List); assert((jsonList[1] as List).isNotEmpty); + return BytesBitmap(byteData: jsonList[1] as Uint8List); case _fromAsset: assert(jsonList.length <= 3); assert(jsonList[1] != null && jsonList[1] is String); @@ -73,7 +84,10 @@ class BitmapDescriptor { if (jsonList.length == 3) { assert(jsonList[2] != null && jsonList[2] is String); assert((jsonList[2] as String).isNotEmpty); + return AssetBitmap( + name: jsonList[1] as String, package: jsonList[2] as String); } + return AssetBitmap(name: jsonList[1] as String); case _fromAssetImage: assert(jsonList.length <= 4); assert(jsonList[1] != null && jsonList[1] is String); @@ -82,7 +96,15 @@ class BitmapDescriptor { if (jsonList.length == 4) { assert(jsonList[3] != null && jsonList[3] is List); assert((jsonList[3] as List).length == 2); + final List sizeList = jsonList[3] as List; + return AssetImageBitmap( + name: jsonList[1] as String, + scale: jsonList[2] as double, + size: Size((sizeList[0] as num).toDouble(), + (sizeList[1] as num).toDouble())); } + return AssetImageBitmap( + name: jsonList[1] as String, scale: jsonList[2] as double); case AssetMapBitmap.type: assert(jsonList.length == 2); assert(jsonList[1] != null && jsonList[1] is Map); @@ -96,6 +118,16 @@ class BitmapDescriptor { assert(jsonMap['imagePixelRatio'] is double); assert(!jsonMap.containsKey('width') || jsonMap['width'] is double); assert(!jsonMap.containsKey('height') || jsonMap['height'] is double); + final double? width = + jsonMap.containsKey('width') ? jsonMap['width'] as double : null; + final double? height = + jsonMap.containsKey('height') ? jsonMap['height'] as double : null; + return AssetMapBitmap(jsonMap['assetName'] as String, + bitmapScaling: + mapBitmapScalingFromString(jsonMap['bitmapScaling'] as String), + imagePixelRatio: jsonMap['imagePixelRatio'] as double, + width: width, + height: height); case BytesMapBitmap.type: assert(jsonList.length == 2); assert(jsonList[1] != null && jsonList[1] is Map); @@ -109,9 +141,20 @@ class BitmapDescriptor { assert(jsonMap['imagePixelRatio'] is double); assert(!jsonMap.containsKey('width') || jsonMap['width'] is double); assert(!jsonMap.containsKey('height') || jsonMap['height'] is double); + final double? width = + jsonMap.containsKey('width') ? jsonMap['width'] as double : null; + final double? height = + jsonMap.containsKey('height') ? jsonMap['height'] as double : null; + return BytesMapBitmap(jsonMap['byteData'] as Uint8List, + bitmapScaling: + mapBitmapScalingFromString(jsonMap['bitmapScaling'] as String), + width: width, + height: height, + imagePixelRatio: jsonMap['imagePixelRatio'] as double); default: break; } + throw ArgumentError('Unrecognized BitmapDescriptor type ${jsonList[0]}'); } static const String _defaultMarker = 'defaultMarker'; @@ -160,15 +203,14 @@ class BitmapDescriptor { static const double hueRose = 330.0; /// Creates a BitmapDescriptor that refers to the default marker image. - static const BitmapDescriptor defaultMarker = - BitmapDescriptor._([_defaultMarker]); + static const BitmapDescriptor defaultMarker = DefaultMarker(); /// Creates a BitmapDescriptor that refers to a colorization of the default /// marker image. For convenience, there is a predefined set of hue values. /// See e.g. [hueYellow]. static BitmapDescriptor defaultMarkerWithHue(double hue) { assert(0.0 <= hue && hue < 360.0); - return BitmapDescriptor._([_defaultMarker, hue]); + return DefaultMarker(hue: hue); } /// Creates a [BitmapDescriptor] from an asset image. @@ -189,27 +231,17 @@ class BitmapDescriptor { }) async { final double? devicePixelRatio = configuration.devicePixelRatio; if (!mipmaps && devicePixelRatio != null) { - return BitmapDescriptor._([ - _fromAssetImage, - assetName, - devicePixelRatio, - ]); + return AssetImageBitmap(name: assetName, scale: devicePixelRatio); } final AssetImage assetImage = AssetImage(assetName, package: package, bundle: bundle); final AssetBundleImageKey assetBundleImageKey = await assetImage.obtainKey(configuration); - final Size? size = configuration.size; - return BitmapDescriptor._([ - _fromAssetImage, - assetBundleImageKey.name, - assetBundleImageKey.scale, - if (kIsWeb && size != null) - [ - size.width, - size.height, - ], - ]); + final Size? size = kIsWeb ? configuration.size : null; + return AssetImageBitmap( + name: assetBundleImageKey.name, + scale: assetBundleImageKey.scale, + size: size); } /// Creates a BitmapDescriptor using an array of bytes that must be encoded @@ -222,15 +254,7 @@ class BitmapDescriptor { static BitmapDescriptor fromBytes(Uint8List byteData, {Size? size}) { assert(byteData.isNotEmpty, 'Cannot create BitmapDescriptor with empty byteData'); - return BitmapDescriptor._([ - _fromBytes, - byteData, - if (kIsWeb && size != null) - [ - size.width, - size.height, - ] - ]); + return BytesBitmap(byteData: byteData, size: size); } /// Creates a [BitmapDescriptor] from an asset using [AssetMapBitmap]. @@ -306,10 +330,100 @@ class BitmapDescriptor { ); } - final Object _json; - /// Convert the object to a Json format. - Object toJson() => _json; + Object toJson(); +} + +/// A BitmapDescriptor using the default marker. +class DefaultMarker extends BitmapDescriptor { + /// Provide an optional [hue] for the default marker. + const DefaultMarker({this.hue}) : super._(); + + /// Optional hue of the colorization of the default marker. + final num? hue; + + @override + Object toJson() => (hue == null) + ? const [BitmapDescriptor._defaultMarker] + : [BitmapDescriptor._defaultMarker, hue!]; +} + +/// A BitmapDescriptor using an array of bytes that must be encoded +/// as PNG. +@Deprecated('Use BytesMapBitmap instead') +class BytesBitmap extends BitmapDescriptor { + /// On the web, the [size] parameter represents the *physical size* of the + /// bitmap, regardless of the actual resolution of the encoded PNG. + /// This helps the browser to render High-DPI images at the correct size. + /// `size` is not required (and ignored, if passed) in other platforms. + @Deprecated('Use BytesMapBitmap instead') + const BytesBitmap({required Uint8List byteData, Size? size}) + : this._(byteData, kIsWeb ? size : null); + + @Deprecated('Use BytesMapBitmap instead') + const BytesBitmap._(this.byteData, this.size) : super._(); + + /// Array of bytes encoding a PNG. + final Uint8List byteData; + + /// On web, the physical size of the bitmap. Null on all other platforms. + final Size? size; + + @override + Object toJson() => [ + BitmapDescriptor._fromBytes, + byteData, + if (size != null) [size!.width, size!.height] + ]; +} + +/// A bitmap specified by a name and optional package. +class AssetBitmap extends BitmapDescriptor { + /// Provides an asset name with [name] and optionally a [package]. + const AssetBitmap({required this.name, this.package}) : super._(); + + /// Name of the asset backing the bitmap. + final String name; + + /// Optional package of the asset. + final String? package; + + @override + Object toJson() => [ + BitmapDescriptor._fromAsset, + name, + if (package != null) package! + ]; +} + +/// A [BitmapDescriptor] from an asset image. +@Deprecated('Use AssetMapBitmap instead') +class AssetImageBitmap extends BitmapDescriptor { + /// Creates a [BitmapDescriptor] from an asset image with specified [name] and [scale], and an optional [size]. + /// Asset images in flutter are stored per: + /// https://flutter.dev/to/resolution-aware-images + /// This method takes into consideration various asset resolutions + /// and scales the images to the right resolution depending on the dpi. + @Deprecated('Use AssetMapBitmap instead') + const AssetImageBitmap({required this.name, required this.scale, this.size}) + : super._(); + + /// Name of the image asset. + final String name; + + /// Scaling factor for the asset image. + final double scale; + + /// Size of the image if using mipmaps. + final Size? size; + + @override + Object toJson() => [ + BitmapDescriptor._fromAssetImage, + name, + scale, + if (size != null) [size!.width, size!.height] + ]; } /// Represents a [BitmapDescriptor] base class for map bitmaps. @@ -344,7 +458,7 @@ abstract class MapBitmap extends BitmapDescriptor { required this.imagePixelRatio, this.width, this.height, - }) : super._(const []); + }) : super._(); /// The scaling method of the bitmap. final MapBitmapScaling bitmapScaling; diff --git a/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/camera.dart b/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/camera.dart index 01126afb869e..a251d2bba8d8 100644 --- a/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/camera.dart +++ b/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/camera.dart @@ -110,22 +110,53 @@ class CameraPosition { 'CameraPosition(bearing: $bearing, target: $target, tilt: $tilt, zoom: $zoom)'; } +/// Indicates which type of camera update this instance represents. +enum CameraUpdateType { + /// New position for camera + newCameraPosition, + + /// New coordinates for camera + newLatLng, + + /// New coordinates bounding box + newLatLngBounds, + + /// New coordinate with zoom level + newLatLngZoom, + + /// Move by a scroll delta + scrollBy, + + /// Zoom by a relative change + zoomBy, + + /// Zoom to an absolute level + zoomTo, + + /// Zoom in + zoomIn, + + /// Zoom out + zoomOut, +} + /// Defines a camera move, supporting absolute moves as well as moves relative /// the current position. -class CameraUpdate { - const CameraUpdate._(this._json); +abstract class CameraUpdate { + const CameraUpdate._(this.updateType); + + /// Indicates which type of camera update this instance represents. + final CameraUpdateType updateType; /// Returns a camera update that moves the camera to the specified position. static CameraUpdate newCameraPosition(CameraPosition cameraPosition) { - return CameraUpdate._( - ['newCameraPosition', cameraPosition.toMap()], - ); + return CameraUpdateNewCameraPosition(cameraPosition); } /// Returns a camera update that moves the camera target to the specified /// geographical location. static CameraUpdate newLatLng(LatLng latLng) { - return CameraUpdate._(['newLatLng', latLng.toJson()]); + return CameraUpdateNewLatLng(latLng); } /// Returns a camera update that transforms the camera so that the specified @@ -133,19 +164,13 @@ class CameraUpdate { /// possible zoom level. A non-zero [padding] insets the bounding box from the /// map view's edges. The camera's new tilt and bearing will both be 0.0. static CameraUpdate newLatLngBounds(LatLngBounds bounds, double padding) { - return CameraUpdate._([ - 'newLatLngBounds', - bounds.toJson(), - padding, - ]); + return CameraUpdateNewLatLngBounds(bounds, padding); } /// Returns a camera update that moves the camera target to the specified /// geographical location and zoom level. static CameraUpdate newLatLngZoom(LatLng latLng, double zoom) { - return CameraUpdate._( - ['newLatLngZoom', latLng.toJson(), zoom], - ); + return CameraUpdateNewLatLngZoom(latLng, zoom); } /// Returns a camera update that moves the camera target the specified screen @@ -155,24 +180,14 @@ class CameraUpdate { /// the camera's target to a geographical location that is 50 to the east and /// 75 to the south of the current location, measured in screen coordinates. static CameraUpdate scrollBy(double dx, double dy) { - return CameraUpdate._( - ['scrollBy', dx, dy], - ); + return CameraUpdateScrollBy(dx, dy); } /// Returns a camera update that modifies the camera zoom level by the /// specified amount. The optional [focus] is a screen point whose underlying /// geographical location should be invariant, if possible, by the movement. static CameraUpdate zoomBy(double amount, [Offset? focus]) { - if (focus == null) { - return CameraUpdate._(['zoomBy', amount]); - } else { - return CameraUpdate._([ - 'zoomBy', - amount, - [focus.dx, focus.dy], - ]); - } + return CameraUpdateZoomBy(amount, focus); } /// Returns a camera update that zooms the camera in, bringing the camera @@ -180,7 +195,7 @@ class CameraUpdate { /// /// Equivalent to the result of calling `zoomBy(1.0)`. static CameraUpdate zoomIn() { - return const CameraUpdate._(['zoomIn']); + return const CameraUpdateZoomIn(); } /// Returns a camera update that zooms the camera out, bringing the camera @@ -188,16 +203,131 @@ class CameraUpdate { /// /// Equivalent to the result of calling `zoomBy(-1.0)`. static CameraUpdate zoomOut() { - return const CameraUpdate._(['zoomOut']); + return const CameraUpdateZoomOut(); } /// Returns a camera update that sets the camera zoom level. static CameraUpdate zoomTo(double zoom) { - return CameraUpdate._(['zoomTo', zoom]); + return CameraUpdateZoomTo(zoom); } - final Object _json; - /// Converts this object to something serializable in JSON. - Object toJson() => _json; + Object toJson(); +} + +/// Defines a camera move to a new position. +class CameraUpdateNewCameraPosition extends CameraUpdate { + /// Creates a camera move. + const CameraUpdateNewCameraPosition(this.cameraPosition) + : super._(CameraUpdateType.newCameraPosition); + + /// The new camera position. + final CameraPosition cameraPosition; + @override + Object toJson() => ['newCameraPosition', cameraPosition.toMap()]; +} + +/// Defines a camera move to a latitude and longitude. +class CameraUpdateNewLatLng extends CameraUpdate { + /// Creates a camera move to latitude and longitude. + const CameraUpdateNewLatLng(this.latLng) + : super._(CameraUpdateType.newLatLng); + + /// New latitude and longitude of the camera.. + final LatLng latLng; + @override + Object toJson() => ['newLatLng', latLng.toJson()]; +} + +/// Defines a camera move to a new bounding latitude and longitude range. +class CameraUpdateNewLatLngBounds extends CameraUpdate { + /// Creates a camera move to a bounding range. + const CameraUpdateNewLatLngBounds(this.bounds, this.padding) + : super._(CameraUpdateType.newLatLngBounds); + + /// The northeast and southwest bounding coordinates. + final LatLngBounds bounds; + + /// The amount of padding by which the view is inset. + final double padding; + @override + Object toJson() => ['newLatLngBounds', bounds.toJson(), padding]; +} + +/// Defines a camera move to new coordinates with a zoom level. +class CameraUpdateNewLatLngZoom extends CameraUpdate { + /// Creates a camera move with coordinates and zoom level. + const CameraUpdateNewLatLngZoom(this.latLng, this.zoom) + : super._(CameraUpdateType.newLatLngZoom); + + /// New coordinates of the camera. + final LatLng latLng; + + /// New zoom level of the camera. + final double zoom; + @override + Object toJson() => ['newLatLngZoom', latLng.toJson(), zoom]; +} + +/// Defines a camera scroll by a certain delta. +class CameraUpdateScrollBy extends CameraUpdate { + /// Creates a camera scroll. + const CameraUpdateScrollBy(this.dx, this.dy) + : super._(CameraUpdateType.scrollBy); + + /// Scroll delta x. + final double dx; + + /// Scroll delta y. + final double dy; + @override + Object toJson() => ['scrollBy', dx, dy]; +} + +/// Defines a relative camera zoom. +class CameraUpdateZoomBy extends CameraUpdate { + /// Creates a relative camera zoom. + const CameraUpdateZoomBy(this.amount, [this.focus]) + : super._(CameraUpdateType.zoomBy); + + /// Change in camera zoom amount. + final double amount; + + /// Optional point around which the zoom is focused. + final Offset? focus; + @override + Object toJson() => (focus == null) + ? ['zoomBy', amount] + : [ + 'zoomBy', + amount, + [focus!.dx, focus!.dy] + ]; +} + +/// Defines a camera zoom in. +class CameraUpdateZoomIn extends CameraUpdate { + /// Zooms in the camera. + const CameraUpdateZoomIn() : super._(CameraUpdateType.zoomIn); + @override + Object toJson() => ['zoomIn']; +} + +/// Defines a camera zoom out. +class CameraUpdateZoomOut extends CameraUpdate { + /// Zooms out the camera. + const CameraUpdateZoomOut() : super._(CameraUpdateType.zoomOut); + @override + Object toJson() => ['zoomOut']; +} + +/// Defines a camera zoom to an absolute zoom. +class CameraUpdateZoomTo extends CameraUpdate { + /// Creates a zoom to an absolute zoom level. + const CameraUpdateZoomTo(this.zoom) : super._(CameraUpdateType.zoomTo); + + /// New zoom level of the camera. + final double zoom; + @override + Object toJson() => ['zoomTo', zoom]; } diff --git a/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/cap.dart b/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/cap.dart index 3ca79583d12a..c67439e3e310 100644 --- a/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/cap.dart +++ b/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/cap.dart @@ -6,10 +6,39 @@ import 'package:flutter/foundation.dart' show immutable; import 'types.dart'; +/// Enumeration of possible types of caps. +enum CapType { + /// Cap that is squared off exactly at the start or end vertex of a [Polyline] + /// with solid stroke pattern, equivalent to having no additional cap beyond + /// the start or end vertex. + butt, + + /// Cap that is a semicircle with radius equal to half the stroke width, + /// centered at the start or end vertex of a [Polyline] with solid stroke + /// pattern. + round, + + /// Cap that is squared off after extending half the stroke width beyond the + /// start or end vertex of a [Polyline] with solid stroke pattern. + square, + + /// CustomCap with a bitmap overlay centered at the start or + /// end vertex of a [Polyline], orientated according to the direction of the line's + /// first or last edge and scaled with respect to the line's stroke width. + custom, +} + +String _capTypeToJson(CapType capType) => switch (capType) { + CapType.butt => 'buttCap', + CapType.round => 'roundCap', + CapType.square => 'squareCap', + CapType.custom => 'customCap', + }; + /// Cap that can be applied at the start or end vertex of a [Polyline]. @immutable class Cap { - const Cap._(this._json); + const Cap._(this.type); /// Cap that is squared off exactly at the start or end vertex of a [Polyline] /// with solid stroke pattern, equivalent to having no additional cap beyond @@ -17,16 +46,16 @@ class Cap { /// /// This is the default cap type at start and end vertices of Polylines with /// solid stroke pattern. - static const Cap buttCap = Cap._(['buttCap']); + static const Cap buttCap = Cap._(CapType.butt); /// Cap that is a semicircle with radius equal to half the stroke width, /// centered at the start or end vertex of a [Polyline] with solid stroke /// pattern. - static const Cap roundCap = Cap._(['roundCap']); + static const Cap roundCap = Cap._(CapType.round); /// Cap that is squared off after extending half the stroke width beyond the /// start or end vertex of a [Polyline] with solid stroke pattern. - static const Cap squareCap = Cap._(['squareCap']); + static const Cap squareCap = Cap._(CapType.square); /// Constructs a new CustomCap with a bitmap overlay centered at the start or /// end vertex of a [Polyline], orientated according to the direction of the line's @@ -44,11 +73,37 @@ class Cap { double refWidth = 10, }) { assert(refWidth > 0.0); - return Cap._(['customCap', bitmapDescriptor.toJson(), refWidth]); + return CustomCap(bitmapDescriptor, refWidth: refWidth); } - final Object _json; + /// The type of rendering used for the cap at a start or end vertex of a + /// [Polyline]. + final CapType type; /// Converts this object to something serializable in JSON. - Object toJson() => _json; + Object toJson() => [_capTypeToJson(type)]; +} + +/// CustomCap with a bitmap overlay centered at the start or +/// end vertex of a [Polyline], orientated according to the direction of the line's +/// first or last edge and scaled with respect to the line's stroke width. +class CustomCap extends Cap { + /// [bitmapDescriptor] must not be null. + /// + /// [refWidth] is the reference stroke width (in pixels) - the stroke width for which + /// the cap bitmap at its native dimension is designed. Must be positive. Default value + /// is 10 pixels. + const CustomCap(this.bitmapDescriptor, {this.refWidth = 10}) + : super._(CapType.custom); + + /// Bitmap overlay centered at the start or end vertex of a [Polyline]. + final BitmapDescriptor bitmapDescriptor; + + /// Reference stroke width in screen pixels. See + /// https://developers.google.com/maps/documentation/android-sdk/reference/com/google/android/libraries/maps/model/CustomCap#refWidth + final double refWidth; + + @override + Object toJson() => + [_capTypeToJson(type), bitmapDescriptor.toJson(), refWidth]; } diff --git a/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/pattern_item.dart b/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/pattern_item.dart index 033210b8c5ae..90adfbc84c6a 100644 --- a/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/pattern_item.dart +++ b/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/pattern_item.dart @@ -4,20 +4,39 @@ import 'package:flutter/foundation.dart' show immutable; +/// Enumeration of types of pattern items. +enum PatternItemType { + /// A dot used in the stroke pattern for a [Polyline]. + dot, + + /// A dash used in the stroke pattern for a [Polyline]. + dash, + + /// A gap used in the stroke pattern for a [Polyline]. + gap, +} + +String _patternItemTypeToJson(PatternItemType itemType) => switch (itemType) { + PatternItemType.dot => 'dot', + PatternItemType.dash => 'dash', + PatternItemType.gap => 'gap', + }; + /// Item used in the stroke pattern for a Polyline. @immutable class PatternItem { - const PatternItem._(this._json); + const PatternItem._(this.type); /// A dot used in the stroke pattern for a [Polyline]. - static const PatternItem dot = PatternItem._(['dot']); + static const PatternItem dot = PatternItem._(PatternItemType.dot); /// A dash used in the stroke pattern for a [Polyline]. /// /// [length] has to be non-negative. static PatternItem dash(double length) { assert(length >= 0.0); - return PatternItem._(['dash', length]); + return VariableLengthPatternItem._( + patternItemType: PatternItemType.dash, length: length); } /// A gap used in the stroke pattern for a [Polyline]. @@ -25,11 +44,33 @@ class PatternItem { /// [length] has to be non-negative. static PatternItem gap(double length) { assert(length >= 0.0); - return PatternItem._(['gap', length]); + return VariableLengthPatternItem._( + patternItemType: PatternItemType.gap, length: length); } - final Object _json; + /// The type of rendering used for an item in a pattern. + final PatternItemType type; + + /// Converts this object to something serializable in JSON. + Object toJson() => [ + _patternItemTypeToJson(type), + ]; +} + +/// A pattern item with a length, i.e. a dash or gap. +@immutable +class VariableLengthPatternItem extends PatternItem { + const VariableLengthPatternItem._( + {required PatternItemType patternItemType, required this.length}) + : super._(patternItemType); + + /// The length in pixels of a dash or gap. + final double length; /// Converts this object to something serializable in JSON. - Object toJson() => _json; + @override + Object toJson() => [ + _patternItemTypeToJson(type), + length, + ]; } diff --git a/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/polyline.dart b/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/polyline.dart index d526375cfca3..e590671419e6 100644 --- a/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/polyline.dart +++ b/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/polyline.dart @@ -96,7 +96,7 @@ class Polyline implements MapsObject { /// Supported on Android only. final Cap endCap; - /// True if the marker is visible. + /// True if the polyline is visible. final bool visible; /// Width of the polyline, used to define the width of the line segment to be drawn. 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 70705df49d07..67e6a64f1c0f 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 @@ -4,7 +4,7 @@ repository: https://github.com/flutter/packages/tree/main/packages/google_maps_f issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+maps%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.9.5 environment: sdk: ^3.3.0 @@ -21,7 +21,7 @@ dev_dependencies: async: ^2.5.0 flutter_test: sdk: flutter - mockito: 5.4.4 + mockito: ^5.4.4 topics: - google-maps diff --git a/packages/google_maps_flutter/google_maps_flutter_platform_interface/test/types/bitmap_test.dart b/packages/google_maps_flutter/google_maps_flutter_platform_interface/test/types/bitmap_test.dart index 15a6833e9354..001dbe755e3b 100644 --- a/packages/google_maps_flutter/google_maps_flutter_platform_interface/test/types/bitmap_test.dart +++ b/packages/google_maps_flutter/google_maps_flutter_platform_interface/test/types/bitmap_test.dart @@ -21,10 +21,17 @@ void main() { BitmapDescriptor.fromJson(json); expect(descriptorFromJson, isNot(descriptor)); // New instance - expect(identical(descriptorFromJson.toJson(), json), isTrue); // Same JSON + expect(descriptorFromJson.toJson(), json); }); group('fromBytes constructor', () { + test('returns BytesBitmap', () { + final BitmapDescriptor descriptor = BitmapDescriptor.fromBytes( + Uint8List.fromList([1, 2, 3]), + ); + expect(descriptor, isA()); + }); + test('with empty byte array, throws assertion error', () { expect(() { BitmapDescriptor.fromBytes(Uint8List.fromList([])); @@ -35,13 +42,15 @@ void main() { final BitmapDescriptor descriptor = BitmapDescriptor.fromBytes( Uint8List.fromList([1, 2, 3]), ); - expect(descriptor, isA()); + expect(descriptor, isA()); expect( descriptor.toJson(), equals([ 'fromBytes', [1, 2, 3], ])); + descriptor as BytesBitmap; + expect(descriptor.byteData, Uint8List.fromList([1, 2, 3])); }); test('with size, not on the web, size is ignored', () { @@ -56,6 +65,9 @@ void main() { 'fromBytes', [1, 2, 3], ])); + descriptor as BytesBitmap; + expect(descriptor.byteData, Uint8List.fromList([1, 2, 3])); + expect(descriptor.size, null); }, skip: kIsWeb); test('with size, on the web, size is preserved', () { @@ -71,6 +83,9 @@ void main() { [1, 2, 3], [40, 20], ])); + descriptor as BytesBitmap; + expect(descriptor.byteData, Uint8List.fromList([1, 2, 3])); + expect(descriptor.size, const Size(40, 20)); }, skip: !kIsWeb); }); @@ -78,7 +93,7 @@ void main() { group('type validation', () { test('correct type', () { expect(BitmapDescriptor.fromJson(['defaultMarker']), - isA()); + isA()); }); test('wrong type', () { @@ -90,12 +105,12 @@ void main() { group('defaultMarker', () { test('hue is null', () { expect(BitmapDescriptor.fromJson(['defaultMarker']), - isA()); + isA()); }); test('hue is number', () { expect(BitmapDescriptor.fromJson(['defaultMarker', 158]), - isA()); + isA()); }); test('hue is not number', () { @@ -120,7 +135,7 @@ void main() { 'fromBytes', Uint8List.fromList([1, 2, 3]) ]), - isA()); + isA()); }); test('without bytes', () { @@ -137,7 +152,7 @@ void main() { expect( BitmapDescriptor.fromJson( ['fromAsset', 'some/path.png']), - isA()); + isA()); }); test('name cannot be null or empty', () { @@ -153,7 +168,7 @@ void main() { expect( BitmapDescriptor.fromJson( ['fromAsset', 'some/path.png', 'some_package']), - isA()); + isA()); }); test('package cannot be null or empty', () { @@ -172,7 +187,7 @@ void main() { expect( BitmapDescriptor.fromJson( ['fromAssetImage', 'some/path.png', 1.0]), - isA()); + isA()); }); test('mipmaps determines dpi', () async { @@ -224,7 +239,7 @@ void main() { 1.0, [640, 480] ]), - isA()); + isA()); }); test( @@ -262,7 +277,7 @@ void main() { 'height': 1.0, } ]), - isA()); + isA()); }); test('without bytes', () { @@ -288,7 +303,7 @@ void main() { 'imagePixelRatio': 1.0, } ]), - isA()); + isA()); }); test('name cannot be null or empty', () { @@ -345,7 +360,7 @@ void main() { 'height': 1.0, } ]), - isA()); + isA()); }); test('optional width and height parameters must be in proper format', @@ -428,6 +443,10 @@ void main() { 'imagePixelRatio': 1.0, } ])); + descriptor as AssetMapBitmap; + expect(descriptor.assetName, 'red_square.png'); + expect(descriptor.bitmapScaling, MapBitmapScaling.auto); + expect(descriptor.imagePixelRatio, 1.0); }); test('construct with imagePixelRatio', () async { @@ -435,6 +454,7 @@ void main() { AssetMapBitmap('red_square.png', imagePixelRatio: 1.2345); expect(descriptor, isA()); + expect(descriptor, isA()); expect( descriptor.toJson(), equals([ @@ -445,6 +465,10 @@ void main() { 'imagePixelRatio': 1.2345, } ])); + descriptor as AssetMapBitmap; + expect(descriptor.assetName, 'red_square.png'); + expect(descriptor.bitmapScaling, MapBitmapScaling.auto); + expect(descriptor.imagePixelRatio, 1.2345); }); test('construct with width', () async { @@ -453,6 +477,7 @@ void main() { AssetMapBitmap('red_square.png', width: width); expect(descriptor, isA()); + expect(descriptor, isA()); expect( descriptor.toJson(), equals([ @@ -464,6 +489,11 @@ void main() { 'width': width, } ])); + descriptor as AssetMapBitmap; + expect(descriptor.assetName, 'red_square.png'); + expect(descriptor.bitmapScaling, MapBitmapScaling.auto); + expect(descriptor.imagePixelRatio, 1.0); + expect(descriptor.width, width); }); test('create', () async { @@ -481,6 +511,10 @@ void main() { 'imagePixelRatio': 1.0 } ])); + descriptor as AssetMapBitmap; + expect(descriptor.assetName, 'red_square.png'); + expect(descriptor.bitmapScaling, MapBitmapScaling.auto); + expect(descriptor.imagePixelRatio, 1.0); }, // TODO(stuartmorgan): Investigate timeout on web. skip: kIsWeb); @@ -493,6 +527,7 @@ void main() { await AssetMapBitmap.create(imageConfiguration, 'red_square.png'); expect(descriptor, isA()); + expect(descriptor, isA()); expect( descriptor.toJson(), equals([ @@ -505,7 +540,14 @@ void main() { 'height': 200.0 } ])); + descriptor as AssetMapBitmap; + expect(descriptor.assetName, 'red_square.png'); + expect(descriptor.bitmapScaling, MapBitmapScaling.auto); + expect(descriptor.imagePixelRatio, 1.0); + expect(descriptor.width, 100.0); + expect(descriptor.height, 200.0); }); + test('create with width', () async { const ImageConfiguration imageConfiguration = ImageConfiguration.empty; final BitmapDescriptor descriptor = await AssetMapBitmap.create( @@ -513,6 +555,7 @@ void main() { width: 100); expect(descriptor, isA()); + expect(descriptor, isA()); expect( descriptor.toJson(), equals([ @@ -524,7 +567,13 @@ void main() { 'width': 100.0, } ])); + descriptor as AssetMapBitmap; + expect(descriptor.assetName, 'red_square.png'); + expect(descriptor.bitmapScaling, MapBitmapScaling.auto); + expect(descriptor.imagePixelRatio, 1.0); + expect(descriptor.width, 100.0); }); + test('create with height', () async { const ImageConfiguration imageConfiguration = ImageConfiguration.empty; final BitmapDescriptor descriptor = await AssetMapBitmap.create( @@ -532,6 +581,7 @@ void main() { height: 200); expect(descriptor, isA()); + expect(descriptor, isA()); expect( descriptor.toJson(), equals([ @@ -543,6 +593,11 @@ void main() { 'height': 200.0 } ])); + descriptor as AssetMapBitmap; + expect(descriptor.assetName, 'red_square.png'); + expect(descriptor.bitmapScaling, MapBitmapScaling.auto); + expect(descriptor.imagePixelRatio, 1.0); + expect(descriptor.height, 200.0); }); }, // TODO(stuartmorgan): Investigate timeout on web. @@ -560,6 +615,7 @@ void main() { Uint8List.fromList([1, 2, 3]), ); expect(descriptor, isA()); + expect(descriptor, isA()); expect( descriptor.toJson(), equals([ @@ -570,6 +626,10 @@ void main() { 'imagePixelRatio': 1.0, } ])); + descriptor as BytesMapBitmap; + expect(descriptor.byteData, Uint8List.fromList([1, 2, 3])); + expect(descriptor.bitmapScaling, MapBitmapScaling.auto); + expect(descriptor.imagePixelRatio, 1.0); }); test('construct with width', () { @@ -579,6 +639,7 @@ void main() { width: width, ); + expect(descriptor, isA()); expect( descriptor.toJson(), equals([ @@ -590,6 +651,11 @@ void main() { 'width': 100.0 } ])); + descriptor as BytesMapBitmap; + expect(descriptor.byteData, Uint8List.fromList([1, 2, 3])); + expect(descriptor.bitmapScaling, MapBitmapScaling.auto); + expect(descriptor.imagePixelRatio, 1.0); + expect(descriptor.width, 100.0); }); test('construct with imagePixelRatio', () { @@ -598,6 +664,7 @@ void main() { imagePixelRatio: 1.2345, ); + expect(descriptor, isA()); expect( descriptor.toJson(), equals([ @@ -608,6 +675,16 @@ void main() { 'imagePixelRatio': 1.2345 } ])); + descriptor as BytesMapBitmap; + expect(descriptor.byteData, Uint8List.fromList([1, 2, 3])); + expect(descriptor.bitmapScaling, MapBitmapScaling.auto); + expect(descriptor.imagePixelRatio, 1.2345); }); }); + + test('mapBitmapScaling from String', () { + expect(mapBitmapScalingFromString('auto'), MapBitmapScaling.auto); + expect(mapBitmapScalingFromString('none'), MapBitmapScaling.none); + expect(() => mapBitmapScalingFromString('invalid'), throwsArgumentError); + }); } diff --git a/packages/google_maps_flutter/google_maps_flutter_platform_interface/test/types/camera_test.dart b/packages/google_maps_flutter/google_maps_flutter_platform_interface/test/types/camera_test.dart index 70e57aa67ac9..4c4214b2609a 100644 --- a/packages/google_maps_flutter/google_maps_flutter_platform_interface/test/types/camera_test.dart +++ b/packages/google_maps_flutter/google_maps_flutter_platform_interface/test/types/camera_test.dart @@ -20,4 +20,98 @@ void main() { expect(cameraPosition, cameraPositionFromJson); }); + + test('CameraUpdate.newCameraPosition', () { + const CameraPosition cameraPosition = CameraPosition( + target: LatLng(10.0, 15.0), bearing: 0.5, tilt: 30.0, zoom: 1.5); + final CameraUpdate cameraUpdate = + CameraUpdate.newCameraPosition(cameraPosition); + expect(cameraUpdate.runtimeType, CameraUpdateNewCameraPosition); + expect(cameraUpdate.updateType, CameraUpdateType.newCameraPosition); + cameraUpdate as CameraUpdateNewCameraPosition; + expect(cameraUpdate.cameraPosition, cameraPosition); + final List jsonList = cameraUpdate.toJson() as List; + expect(jsonList[0], 'newCameraPosition'); + }); + + test('CameraUpdate.newLatLng', () { + const LatLng latLng = LatLng(1.0, 2.0); + final CameraUpdate cameraUpdate = CameraUpdate.newLatLng(latLng); + expect(cameraUpdate.runtimeType, CameraUpdateNewLatLng); + expect(cameraUpdate.updateType, CameraUpdateType.newLatLng); + cameraUpdate as CameraUpdateNewLatLng; + expect(cameraUpdate.latLng, latLng); + final List jsonList = cameraUpdate.toJson() as List; + expect(jsonList[0], 'newLatLng'); + }); + + test('CameraUpdate.newLatLngBounds', () { + final LatLngBounds latLngBounds = LatLngBounds( + northeast: const LatLng(1.0, 2.0), southwest: const LatLng(-2.0, -3.0)); + const double padding = 1.0; + final CameraUpdate cameraUpdate = + CameraUpdate.newLatLngBounds(latLngBounds, padding); + expect(cameraUpdate.runtimeType, CameraUpdateNewLatLngBounds); + expect(cameraUpdate.updateType, CameraUpdateType.newLatLngBounds); + cameraUpdate as CameraUpdateNewLatLngBounds; + expect(cameraUpdate.bounds, latLngBounds); + expect(cameraUpdate.padding, padding); + final List jsonList = cameraUpdate.toJson() as List; + expect(jsonList[0], 'newLatLngBounds'); + }); + + test('CameraUpdate.newLatLngZoom', () { + const LatLng latLng = LatLng(1.0, 2.0); + const double zoom = 2.0; + final CameraUpdate cameraUpdate = CameraUpdate.newLatLngZoom(latLng, zoom); + expect(cameraUpdate.runtimeType, CameraUpdateNewLatLngZoom); + expect(cameraUpdate.updateType, CameraUpdateType.newLatLngZoom); + cameraUpdate as CameraUpdateNewLatLngZoom; + expect(cameraUpdate.latLng, latLng); + expect(cameraUpdate.zoom, zoom); + final List jsonList = cameraUpdate.toJson() as List; + expect(jsonList[0], 'newLatLngZoom'); + }); + + test('CameraUpdate.scrollBy', () { + const double dx = 2.0; + const double dy = 5.0; + final CameraUpdate cameraUpdate = CameraUpdate.scrollBy(dx, dy); + expect(cameraUpdate.runtimeType, CameraUpdateScrollBy); + expect(cameraUpdate.updateType, CameraUpdateType.scrollBy); + cameraUpdate as CameraUpdateScrollBy; + expect(cameraUpdate.dx, dx); + expect(cameraUpdate.dy, dy); + final List jsonList = cameraUpdate.toJson() as List; + expect(jsonList[0], 'scrollBy'); + }); + + test('CameraUpdate.zoomBy', () { + const double amount = 1.5; + const Offset focus = Offset(-1.0, -2.0); + final CameraUpdate cameraUpdate = CameraUpdate.zoomBy(amount, focus); + expect(cameraUpdate.runtimeType, CameraUpdateZoomBy); + expect(cameraUpdate.updateType, CameraUpdateType.zoomBy); + cameraUpdate as CameraUpdateZoomBy; + expect(cameraUpdate.amount, amount); + expect(cameraUpdate.focus, focus); + final List jsonList = cameraUpdate.toJson() as List; + expect(jsonList[0], 'zoomBy'); + }); + + test('CameraUpdate.zoomIn', () { + final CameraUpdate cameraUpdate = CameraUpdate.zoomIn(); + expect(cameraUpdate.runtimeType, CameraUpdateZoomIn); + expect(cameraUpdate.updateType, CameraUpdateType.zoomIn); + final List jsonList = cameraUpdate.toJson() as List; + expect(jsonList[0], 'zoomIn'); + }); + + test('CameraUpdate.zoomOut', () { + final CameraUpdate cameraUpdate = CameraUpdate.zoomOut(); + expect(cameraUpdate.runtimeType, CameraUpdateZoomOut); + expect(cameraUpdate.updateType, CameraUpdateType.zoomOut); + final List jsonList = cameraUpdate.toJson() as List; + expect(jsonList[0], 'zoomOut'); + }); } diff --git a/packages/google_maps_flutter/google_maps_flutter_platform_interface/test/types/cap_test.dart b/packages/google_maps_flutter/google_maps_flutter_platform_interface/test/types/cap_test.dart new file mode 100644 index 000000000000..bdd94018f9a4 --- /dev/null +++ b/packages/google_maps_flutter/google_maps_flutter_platform_interface/test/types/cap_test.dart @@ -0,0 +1,48 @@ +// 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_maps_flutter_platform_interface/google_maps_flutter_platform_interface.dart'; + +void main() { + TestWidgetsFlutterBinding.ensureInitialized(); + + test('buttCap', () { + const Cap cap = Cap.buttCap; + expect(cap.toJson(), equals(['buttCap'])); + }); + + test('roundCap', () { + const Cap cap = Cap.roundCap; + expect(cap.toJson(), equals(['roundCap'])); + }); + + test('squareCap', () { + const Cap cap = Cap.squareCap; + expect(cap.toJson(), equals(['squareCap'])); + }); + + test('customCap', () { + final Cap cap = Cap.customCapFromBitmap(BitmapDescriptor.defaultMarker); + expect( + cap.toJson(), + equals([ + 'customCap', + ['defaultMarker'], + 10.0 + ])); + }); + + test('customCapWithWidth', () { + final Cap cap = + Cap.customCapFromBitmap(BitmapDescriptor.defaultMarker, refWidth: 100); + expect( + cap.toJson(), + equals([ + 'customCap', + ['defaultMarker'], + 100.0 + ])); + }); +} diff --git a/packages/google_maps_flutter/google_maps_flutter_platform_interface/test/types/pattern_item_test.dart b/packages/google_maps_flutter/google_maps_flutter_platform_interface/test/types/pattern_item_test.dart new file mode 100644 index 000000000000..ebd65a44f3ff --- /dev/null +++ b/packages/google_maps_flutter/google_maps_flutter_platform_interface/test/types/pattern_item_test.dart @@ -0,0 +1,27 @@ +// 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_maps_flutter_platform_interface/google_maps_flutter_platform_interface.dart'; + +void main() { + TestWidgetsFlutterBinding.ensureInitialized(); + + test('dot', () { + const PatternItem item = PatternItem.dot; + expect(item.toJson(), equals(['dot'])); + }); + + test('dash', () { + final PatternItem item = PatternItem.dash(10.0); + expect(item, isA()); + expect(item.toJson(), equals(['dash', 10.0])); + }); + + test('gap', () { + final PatternItem item = PatternItem.gap(20.0); + expect(item, isA()); + expect(item.toJson(), equals(['gap', 20.0])); + }); +} 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 6058f663d192..e4c0cfabb962 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: ^1.2.2 integration_test: sdk: flutter - mockito: 5.4.4 + mockito: ^5.4.4 flutter: assets: 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..d951fac2bf31 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-8.7-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/packages/google_sign_in/google_sign_in/example/android/build.gradle b/packages/google_sign_in/google_sign_in/example/android/build.gradle index cec92de922cf..0bed8906c094 100644 --- a/packages/google_sign_in/google_sign_in/example/android/build.gradle +++ b/packages/google_sign_in/google_sign_in/example/android/build.gradle @@ -5,7 +5,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:7.4.2' + classpath 'com.android.tools.build:gradle:8.5.2' } } 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..3c85cfe057a1 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-8.7-all.zip 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 8405dcf67c6e..e4fe3eae18f2 100644 --- a/packages/google_sign_in/google_sign_in/example/pubspec.yaml +++ b/packages/google_sign_in/google_sign_in/example/pubspec.yaml @@ -20,7 +20,7 @@ dependencies: http: ">=0.13.0 <2.0.0" dev_dependencies: - espresso: ^0.2.0 + espresso: ^0.4.0 flutter_test: sdk: flutter integration_test: diff --git a/packages/google_sign_in/google_sign_in/pubspec.yaml b/packages/google_sign_in/google_sign_in/pubspec.yaml index d1e9b9edf06f..4161121f6853 100644 --- a/packages/google_sign_in/google_sign_in/pubspec.yaml +++ b/packages/google_sign_in/google_sign_in/pubspec.yaml @@ -36,7 +36,7 @@ dev_dependencies: http: ">=0.13.0 <2.0.0" integration_test: sdk: flutter - mockito: 5.4.4 + mockito: ^5.4.4 topics: - authentication diff --git a/packages/google_sign_in/google_sign_in_android/CHANGELOG.md b/packages/google_sign_in/google_sign_in_android/CHANGELOG.md index c60f181f54a2..35af262af528 100644 --- a/packages/google_sign_in/google_sign_in_android/CHANGELOG.md +++ b/packages/google_sign_in/google_sign_in_android/CHANGELOG.md @@ -1,3 +1,24 @@ +## 6.1.33 + +* Updates Pigeon for non-nullable collection type support. + +## 6.1.32 + +* Updates Java compatibility version to 11. +* Updates minimum supported SDK version to Flutter 3.24/Dart 3.5. + +## 6.1.31 + +* Bumps `com.google.guava:guava` from `32.0.1` to `33.3.1`. + +## 6.1.30 + +* Temporarily downgrades Guava from version 33.3.0 to 32.0.1 to fix an R8 related error. + +## 6.1.29 + +* Updates Guava to version 33.3.0. + ## 6.1.28 * Updates lint checks to ignore NewerVersionAvailable. diff --git a/packages/google_sign_in/google_sign_in_android/android/build.gradle b/packages/google_sign_in/google_sign_in_android/android/build.gradle index bac55d2a870a..11fb6c7a7101 100644 --- a/packages/google_sign_in/google_sign_in_android/android/build.gradle +++ b/packages/google_sign_in/google_sign_in_android/android/build.gradle @@ -22,10 +22,7 @@ rootProject.allprojects { apply plugin: 'com.android.library' android { - // Conditional for compatibility with AGP <4.2. - if (project.android.hasProperty("namespace")) { - namespace 'io.flutter.plugins.googlesignin' - } + namespace 'io.flutter.plugins.googlesignin' compileSdk 34 defaultConfig { @@ -34,8 +31,8 @@ android { } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_11 + targetCompatibility JavaVersion.VERSION_11 } lintOptions { @@ -60,7 +57,7 @@ android { dependencies { implementation 'com.google.android.gms:play-services-auth:21.0.0' - implementation 'com.google.guava:guava:33.2.1-android' + implementation 'com.google.guava:guava:33.3.1-android' testImplementation 'junit:junit:4.13.2' testImplementation 'org.mockito:mockito-inline:5.0.0' } diff --git a/packages/google_sign_in/google_sign_in_android/android/src/main/java/io/flutter/plugins/googlesignin/GoogleSignInPlugin.java b/packages/google_sign_in/google_sign_in_android/android/src/main/java/io/flutter/plugins/googlesignin/GoogleSignInPlugin.java index c3f03ab2e90e..301642bce1e8 100644 --- a/packages/google_sign_in/google_sign_in_android/android/src/main/java/io/flutter/plugins/googlesignin/GoogleSignInPlugin.java +++ b/packages/google_sign_in/google_sign_in_android/android/src/main/java/io/flutter/plugins/googlesignin/GoogleSignInPlugin.java @@ -56,13 +56,13 @@ public void initInstance( @NonNull GoogleSignInWrapper googleSignInWrapper) { this.messenger = messenger; delegate = new Delegate(context, googleSignInWrapper); - GoogleSignInApi.setup(messenger, delegate); + GoogleSignInApi.setUp(messenger, delegate); } private void dispose() { delegate = null; if (messenger != null) { - GoogleSignInApi.setup(messenger, null); + GoogleSignInApi.setUp(messenger, null); messenger = null; } } @@ -241,6 +241,30 @@ void requestScopes( final @NonNull MethodChannel.Result result, final @NonNull List scopes); } + /** + * Helper class for supporting the legacy IDelegate interface based on raw method channels, which + * handles converting any FlutterErrors (or other {@code Throwable}s in case any non- FlutterError + * exceptions slip through) thrown by the new code paths into {@code error} callbacks. + */ + private abstract static class ErrorConvertingMethodChannelVoidResult + implements Messages.VoidResult { + final @NonNull MethodChannel.Result result; + + public ErrorConvertingMethodChannelVoidResult(@NonNull MethodChannel.Result result) { + this.result = result; + } + + @Override + public void error(@NonNull Throwable error) { + if (error instanceof FlutterError) { + FlutterError flutterError = (FlutterError) error; + result.error(flutterError.code, flutterError.getMessage(), flutterError.details); + } else { + result.error("exception", error.getMessage(), null); + } + } + } + /** * Helper class for supporting the legacy IDelegate interface based on raw method channels, which * handles converting any FlutterErrors (or other {@code Throwable}s in case any non- FlutterError @@ -296,13 +320,13 @@ public void success(Messages.UserData data) { * Helper class for supporting the legacy IDelegate interface based on raw method channels, which * handles converting responses from methods that return {@code Void}. */ - private static class VoidMethodChannelResult extends ErrorConvertingMethodChannelResult { + private static class VoidMethodChannelResult extends ErrorConvertingMethodChannelVoidResult { public VoidMethodChannelResult(MethodChannel.Result result) { super(result); } @Override - public void success(Void unused) { + public void success() { result.success(null); } } @@ -367,7 +391,7 @@ public void setActivity(@Nullable Activity activity) { private void checkAndSetPendingOperation( String method, Messages.Result userDataResult, - Messages.Result voidResult, + Messages.VoidResult voidResult, Messages.Result boolResult, Messages.Result stringResult, Object data) { @@ -385,7 +409,7 @@ private void checkAndSetPendingSignInOperation( } private void checkAndSetPendingVoidOperation( - String method, @NonNull Messages.Result result) { + String method, @NonNull Messages.VoidResult result) { checkAndSetPendingOperation(method, null, result, null, null, null); } @@ -557,7 +581,7 @@ public void signIn(@NonNull MethodChannel.Result result) { * sign back in. */ @Override - public void signOut(@NonNull Messages.Result result) { + public void signOut(@NonNull Messages.VoidResult result) { checkAndSetPendingVoidOperation("signOut", result); signInClient @@ -580,7 +604,7 @@ public void signOut(@NonNull MethodChannel.Result result) { /** Signs the user out, and revokes their credentials. */ @Override - public void disconnect(@NonNull Messages.Result result) { + public void disconnect(@NonNull Messages.VoidResult result) { checkAndSetPendingVoidOperation("disconnect", result); signInClient @@ -705,7 +729,7 @@ private String errorCodeForStatus(int statusCode) { } private void finishWithSuccess() { - Objects.requireNonNull(pendingOperation.voidResult).success(null); + Objects.requireNonNull(pendingOperation.voidResult).success(); pendingOperation = null; } @@ -720,24 +744,27 @@ private void finishWithUserData(Messages.UserData data) { } private void finishWithError(String errorCode, String errorMessage) { - Messages.Result result; - if (pendingOperation.userDataResult != null) { - result = pendingOperation.userDataResult; - } else if (pendingOperation.boolResult != null) { - result = pendingOperation.boolResult; - } else if (pendingOperation.stringResult != null) { - result = pendingOperation.stringResult; + if (pendingOperation.voidResult != null) { + Objects.requireNonNull(pendingOperation.voidResult) + .error(new FlutterError(errorCode, errorMessage, null)); } else { - result = pendingOperation.voidResult; + Messages.Result result; + if (pendingOperation.userDataResult != null) { + result = pendingOperation.userDataResult; + } else if (pendingOperation.boolResult != null) { + result = pendingOperation.boolResult; + } else { + result = pendingOperation.stringResult; + } + Objects.requireNonNull(result).error(new FlutterError(errorCode, errorMessage, null)); } - Objects.requireNonNull(result).error(new FlutterError(errorCode, errorMessage, null)); pendingOperation = null; } private static class PendingOperation { final @NonNull String method; final @Nullable Messages.Result userDataResult; - final @Nullable Messages.Result voidResult; + final @Nullable Messages.VoidResult voidResult; final @Nullable Messages.Result boolResult; final @Nullable Messages.Result stringResult; final @Nullable Object data; @@ -745,7 +772,7 @@ private static class PendingOperation { PendingOperation( @NonNull String method, @Nullable Messages.Result userDataResult, - @Nullable Messages.Result voidResult, + @Nullable Messages.VoidResult voidResult, @Nullable Messages.Result boolResult, @Nullable Messages.Result stringResult, @Nullable Object data) { @@ -764,7 +791,7 @@ private static class PendingOperation { /** Clears the token kept in the client side cache. */ @Override - public void clearAuthCache(@NonNull String token, @NonNull Messages.Result result) { + public void clearAuthCache(@NonNull String token, @NonNull Messages.VoidResult result) { Callable clearTokenTask = () -> { GoogleAuthUtil.clearToken(context, token); @@ -775,7 +802,8 @@ public void clearAuthCache(@NonNull String token, @NonNull Messages.Result clearTokenTask, clearTokenFuture -> { try { - result.success(clearTokenFuture.get()); + clearTokenFuture.get(); + result.success(); } catch (ExecutionException e) { @Nullable Throwable cause = e.getCause(); result.error( diff --git a/packages/google_sign_in/google_sign_in_android/android/src/main/java/io/flutter/plugins/googlesignin/Messages.java b/packages/google_sign_in/google_sign_in_android/android/src/main/java/io/flutter/plugins/googlesignin/Messages.java index aa94bbbf7244..2bf6b6c1e06a 100644 --- a/packages/google_sign_in/google_sign_in_android/android/src/main/java/io/flutter/plugins/googlesignin/Messages.java +++ b/packages/google_sign_in/google_sign_in_android/android/src/main/java/io/flutter/plugins/googlesignin/Messages.java @@ -1,11 +1,14 @@ // 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 (v10.1.0), do not edit directly. +// Autogenerated from Pigeon (v22.4.2), do not edit directly. // See also: https://pub.dev/packages/pigeon package io.flutter.plugins.googlesignin; +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; @@ -14,9 +17,12 @@ 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.List; +import java.util.Objects; /** Generated class from Pigeon. */ @SuppressWarnings({"unused", "unchecked", "CodeBlock2Expr", "RedundantSuppression", "serial"}) @@ -40,7 +46,7 @@ public FlutterError(@NonNull String code, @Nullable String message, @Nullable Ob @NonNull protected static ArrayList wrapError(@NonNull Throwable exception) { - ArrayList errorList = new ArrayList(3); + ArrayList errorList = new ArrayList<>(3); if (exception instanceof FlutterError) { FlutterError error = (FlutterError) exception; errorList.add(error.code); @@ -55,6 +61,10 @@ protected static ArrayList wrapError(@NonNull Throwable exception) { return errorList; } + @Target(METHOD) + @Retention(CLASS) + @interface CanIgnoreReturnValue {} + /** Pigeon version of SignInOption. */ public enum SignInType { /** Default configuration. */ @@ -64,7 +74,7 @@ public enum SignInType { final int index; - private SignInType(final int index) { + SignInType(final int index) { this.index = index; } } @@ -149,10 +159,34 @@ public void setForceCodeForRefreshToken(@NonNull Boolean setterArg) { /** Constructor is non-public to enforce null safety; use Builder. */ InitParams() {} + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InitParams that = (InitParams) o; + return scopes.equals(that.scopes) + && signInType.equals(that.signInType) + && Objects.equals(hostedDomain, that.hostedDomain) + && Objects.equals(clientId, that.clientId) + && Objects.equals(serverClientId, that.serverClientId) + && forceCodeForRefreshToken.equals(that.forceCodeForRefreshToken); + } + + @Override + public int hashCode() { + return Objects.hash( + scopes, signInType, hostedDomain, clientId, serverClientId, forceCodeForRefreshToken); + } + public static final class Builder { private @Nullable List scopes; + @CanIgnoreReturnValue public @NonNull Builder setScopes(@NonNull List setterArg) { this.scopes = setterArg; return this; @@ -160,6 +194,7 @@ public static final class Builder { private @Nullable SignInType signInType; + @CanIgnoreReturnValue public @NonNull Builder setSignInType(@NonNull SignInType setterArg) { this.signInType = setterArg; return this; @@ -167,6 +202,7 @@ public static final class Builder { private @Nullable String hostedDomain; + @CanIgnoreReturnValue public @NonNull Builder setHostedDomain(@Nullable String setterArg) { this.hostedDomain = setterArg; return this; @@ -174,6 +210,7 @@ public static final class Builder { private @Nullable String clientId; + @CanIgnoreReturnValue public @NonNull Builder setClientId(@Nullable String setterArg) { this.clientId = setterArg; return this; @@ -181,6 +218,7 @@ public static final class Builder { private @Nullable String serverClientId; + @CanIgnoreReturnValue public @NonNull Builder setServerClientId(@Nullable String setterArg) { this.serverClientId = setterArg; return this; @@ -188,6 +226,7 @@ public static final class Builder { private @Nullable Boolean forceCodeForRefreshToken; + @CanIgnoreReturnValue public @NonNull Builder setForceCodeForRefreshToken(@NonNull Boolean setterArg) { this.forceCodeForRefreshToken = setterArg; return this; @@ -207,9 +246,9 @@ public static final class Builder { @NonNull ArrayList toList() { - ArrayList toListResult = new ArrayList(6); + ArrayList toListResult = new ArrayList<>(6); toListResult.add(scopes); - toListResult.add(signInType == null ? null : signInType.index); + toListResult.add(signInType); toListResult.add(hostedDomain); toListResult.add(clientId); toListResult.add(serverClientId); @@ -217,19 +256,19 @@ ArrayList toList() { return toListResult; } - static @NonNull InitParams fromList(@NonNull ArrayList list) { + static @NonNull InitParams fromList(@NonNull ArrayList pigeonVar_list) { InitParams pigeonResult = new InitParams(); - Object scopes = list.get(0); + Object scopes = pigeonVar_list.get(0); pigeonResult.setScopes((List) scopes); - Object signInType = list.get(1); - pigeonResult.setSignInType(signInType == null ? null : SignInType.values()[(int) signInType]); - Object hostedDomain = list.get(2); + Object signInType = pigeonVar_list.get(1); + pigeonResult.setSignInType((SignInType) signInType); + Object hostedDomain = pigeonVar_list.get(2); pigeonResult.setHostedDomain((String) hostedDomain); - Object clientId = list.get(3); + Object clientId = pigeonVar_list.get(3); pigeonResult.setClientId((String) clientId); - Object serverClientId = list.get(4); + Object serverClientId = pigeonVar_list.get(4); pigeonResult.setServerClientId((String) serverClientId); - Object forceCodeForRefreshToken = list.get(5); + Object forceCodeForRefreshToken = pigeonVar_list.get(5); pigeonResult.setForceCodeForRefreshToken((Boolean) forceCodeForRefreshToken); return pigeonResult; } @@ -312,10 +351,33 @@ public void setServerAuthCode(@Nullable String setterArg) { /** Constructor is non-public to enforce null safety; use Builder. */ UserData() {} + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserData that = (UserData) o; + return Objects.equals(displayName, that.displayName) + && email.equals(that.email) + && id.equals(that.id) + && Objects.equals(photoUrl, that.photoUrl) + && Objects.equals(idToken, that.idToken) + && Objects.equals(serverAuthCode, that.serverAuthCode); + } + + @Override + public int hashCode() { + return Objects.hash(displayName, email, id, photoUrl, idToken, serverAuthCode); + } + public static final class Builder { private @Nullable String displayName; + @CanIgnoreReturnValue public @NonNull Builder setDisplayName(@Nullable String setterArg) { this.displayName = setterArg; return this; @@ -323,6 +385,7 @@ public static final class Builder { private @Nullable String email; + @CanIgnoreReturnValue public @NonNull Builder setEmail(@NonNull String setterArg) { this.email = setterArg; return this; @@ -330,6 +393,7 @@ public static final class Builder { private @Nullable String id; + @CanIgnoreReturnValue public @NonNull Builder setId(@NonNull String setterArg) { this.id = setterArg; return this; @@ -337,6 +401,7 @@ public static final class Builder { private @Nullable String photoUrl; + @CanIgnoreReturnValue public @NonNull Builder setPhotoUrl(@Nullable String setterArg) { this.photoUrl = setterArg; return this; @@ -344,6 +409,7 @@ public static final class Builder { private @Nullable String idToken; + @CanIgnoreReturnValue public @NonNull Builder setIdToken(@Nullable String setterArg) { this.idToken = setterArg; return this; @@ -351,6 +417,7 @@ public static final class Builder { private @Nullable String serverAuthCode; + @CanIgnoreReturnValue public @NonNull Builder setServerAuthCode(@Nullable String setterArg) { this.serverAuthCode = setterArg; return this; @@ -370,7 +437,7 @@ public static final class Builder { @NonNull ArrayList toList() { - ArrayList toListResult = new ArrayList(6); + ArrayList toListResult = new ArrayList<>(6); toListResult.add(displayName); toListResult.add(email); toListResult.add(id); @@ -380,42 +447,40 @@ ArrayList toList() { return toListResult; } - static @NonNull UserData fromList(@NonNull ArrayList list) { + static @NonNull UserData fromList(@NonNull ArrayList pigeonVar_list) { UserData pigeonResult = new UserData(); - Object displayName = list.get(0); + Object displayName = pigeonVar_list.get(0); pigeonResult.setDisplayName((String) displayName); - Object email = list.get(1); + Object email = pigeonVar_list.get(1); pigeonResult.setEmail((String) email); - Object id = list.get(2); + Object id = pigeonVar_list.get(2); pigeonResult.setId((String) id); - Object photoUrl = list.get(3); + Object photoUrl = pigeonVar_list.get(3); pigeonResult.setPhotoUrl((String) photoUrl); - Object idToken = list.get(4); + Object idToken = pigeonVar_list.get(4); pigeonResult.setIdToken((String) idToken); - Object serverAuthCode = list.get(5); + Object serverAuthCode = pigeonVar_list.get(5); pigeonResult.setServerAuthCode((String) serverAuthCode); return pigeonResult; } } - public interface Result { - @SuppressWarnings("UnknownNullness") - void success(T result); + private static class PigeonCodec extends StandardMessageCodec { + public static final PigeonCodec INSTANCE = new PigeonCodec(); - void error(@NonNull Throwable error); - } - - private static class GoogleSignInApiCodec extends StandardMessageCodec { - public static final GoogleSignInApiCodec INSTANCE = new GoogleSignInApiCodec(); - - private GoogleSignInApiCodec() {} + private PigeonCodec() {} @Override protected Object readValueOfType(byte type, @NonNull ByteBuffer buffer) { switch (type) { - case (byte) 128: - return InitParams.fromList((ArrayList) readValue(buffer)); case (byte) 129: + { + Object value = readValue(buffer); + return value == null ? null : SignInType.values()[((Long) value).intValue()]; + } + case (byte) 130: + return InitParams.fromList((ArrayList) readValue(buffer)); + case (byte) 131: return UserData.fromList((ArrayList) readValue(buffer)); default: return super.readValueOfType(type, buffer); @@ -424,11 +489,14 @@ protected Object readValueOfType(byte type, @NonNull ByteBuffer buffer) { @Override protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { - if (value instanceof InitParams) { - stream.write(128); + if (value instanceof SignInType) { + stream.write(129); + writeValue(stream, value == null ? null : ((SignInType) value).index); + } else if (value instanceof InitParams) { + stream.write(130); writeValue(stream, ((InitParams) value).toList()); } else if (value instanceof UserData) { - stream.write(129); + stream.write(131); writeValue(stream, ((UserData) value).toList()); } else { super.writeValue(stream, value); @@ -436,6 +504,30 @@ protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { } } + /** Asynchronous error handling return type for non-nullable API method returns. */ + public interface Result { + /** Success case callback method for handling returns. */ + void success(@NonNull T result); + + /** Failure case callback method for handling errors. */ + void error(@NonNull Throwable error); + } + /** Asynchronous error handling return type for nullable API method returns. */ + public interface NullableResult { + /** Success case callback method for handling returns. */ + void success(@Nullable T result); + + /** Failure case callback method for handling errors. */ + void error(@NonNull Throwable error); + } + /** Asynchronous error handling return type for void API method returns. */ + public interface VoidResult { + /** Success case callback method for handling returns. */ + void success(); + + /** Failure case callback method for handling errors. */ + void error(@NonNull Throwable error); + } /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface GoogleSignInApi { /** Initializes a sign in request with the given parameters. */ @@ -448,41 +540,51 @@ public interface GoogleSignInApi { void getAccessToken( @NonNull String email, @NonNull Boolean shouldRecoverAuth, @NonNull Result result); /** Signs out the current user. */ - void signOut(@NonNull Result result); + void signOut(@NonNull VoidResult result); /** Revokes scope grants to the application. */ - void disconnect(@NonNull Result result); + void disconnect(@NonNull VoidResult result); /** Returns whether the user is currently signed in. */ @NonNull Boolean isSignedIn(); /** Clears the authentication caching for the given token, requiring a new sign in. */ - void clearAuthCache(@NonNull String token, @NonNull Result result); + void clearAuthCache(@NonNull String token, @NonNull VoidResult result); /** Requests access to the given scopes. */ void requestScopes(@NonNull List scopes, @NonNull Result result); /** The codec used by GoogleSignInApi. */ static @NonNull MessageCodec getCodec() { - return GoogleSignInApiCodec.INSTANCE; + return PigeonCodec.INSTANCE; } /** * Sets up an instance of `GoogleSignInApi` to handle messages through the `binaryMessenger`. */ - static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable GoogleSignInApi api) { + static void setUp(@NonNull BinaryMessenger binaryMessenger, @Nullable GoogleSignInApi api) { + setUp(binaryMessenger, "", api); + } + + static void setUp( + @NonNull BinaryMessenger binaryMessenger, + @NonNull String messageChannelSuffix, + @Nullable GoogleSignInApi api) { + messageChannelSuffix = messageChannelSuffix.isEmpty() ? "" : "." + messageChannelSuffix; { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.GoogleSignInApi.init", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.google_sign_in_android.GoogleSignInApi.init" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; InitParams paramsArg = (InitParams) args.get(0); try { api.init(paramsArg); wrapped.add(0, null); } catch (Throwable exception) { - ArrayList wrappedError = wrapError(exception); - wrapped = wrappedError; + wrapped = wrapError(exception); } reply.reply(wrapped); }); @@ -493,11 +595,14 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable GoogleSign { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.GoogleSignInApi.signInSilently", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.google_sign_in_android.GoogleSignInApi.signInSilently" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); Result resultCallback = new Result() { public void success(UserData result) { @@ -520,11 +625,14 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.GoogleSignInApi.signIn", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.google_sign_in_android.GoogleSignInApi.signIn" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); Result resultCallback = new Result() { public void success(UserData result) { @@ -547,11 +655,14 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.GoogleSignInApi.getAccessToken", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.google_sign_in_android.GoogleSignInApi.getAccessToken" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; String emailArg = (String) args.get(0); Boolean shouldRecoverAuthArg = (Boolean) args.get(1); @@ -577,14 +688,17 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.GoogleSignInApi.signOut", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.google_sign_in_android.GoogleSignInApi.signOut" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); - Result resultCallback = - new Result() { - public void success(Void result) { + ArrayList wrapped = new ArrayList<>(); + VoidResult resultCallback = + new VoidResult() { + public void success() { wrapped.add(0, null); reply.reply(wrapped); } @@ -604,14 +718,17 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.GoogleSignInApi.disconnect", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.google_sign_in_android.GoogleSignInApi.disconnect" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); - Result resultCallback = - new Result() { - public void success(Void result) { + ArrayList wrapped = new ArrayList<>(); + VoidResult resultCallback = + new VoidResult() { + public void success() { wrapped.add(0, null); reply.reply(wrapped); } @@ -631,17 +748,19 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.GoogleSignInApi.isSignedIn", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.google_sign_in_android.GoogleSignInApi.isSignedIn" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); try { Boolean output = api.isSignedIn(); wrapped.add(0, output); } catch (Throwable exception) { - ArrayList wrappedError = wrapError(exception); - wrapped = wrappedError; + wrapped = wrapError(exception); } reply.reply(wrapped); }); @@ -652,16 +771,19 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.GoogleSignInApi.clearAuthCache", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.google_sign_in_android.GoogleSignInApi.clearAuthCache" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; String tokenArg = (String) args.get(0); - Result resultCallback = - new Result() { - public void success(Void result) { + VoidResult resultCallback = + new VoidResult() { + public void success() { wrapped.add(0, null); reply.reply(wrapped); } @@ -681,11 +803,14 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.GoogleSignInApi.requestScopes", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.google_sign_in_android.GoogleSignInApi.requestScopes" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; List scopesArg = (List) args.get(0); Result resultCallback = diff --git a/packages/google_sign_in/google_sign_in_android/android/src/test/java/io/flutter/plugins/googlesignin/GoogleSignInTest.java b/packages/google_sign_in/google_sign_in_android/android/src/test/java/io/flutter/plugins/googlesignin/GoogleSignInTest.java index 6089a81b3547..45dbae355008 100644 --- a/packages/google_sign_in/google_sign_in_android/android/src/test/java/io/flutter/plugins/googlesignin/GoogleSignInTest.java +++ b/packages/google_sign_in/google_sign_in_android/android/src/test/java/io/flutter/plugins/googlesignin/GoogleSignInTest.java @@ -41,7 +41,7 @@ public class GoogleSignInTest { @Mock Resources mockResources; @Mock Activity mockActivity; @Mock BinaryMessenger mockMessenger; - @Spy Messages.Result voidResult; + @Spy Messages.VoidResult voidResult; @Spy Messages.Result boolResult; @Spy Messages.Result userDataResult; @Mock GoogleSignInWrapper mockGoogleSignIn; diff --git a/packages/google_sign_in/google_sign_in_android/example/android/app/build.gradle b/packages/google_sign_in/google_sign_in_android/example/android/app/build.gradle index 422b58cc5199..a92aa744a44c 100644 --- a/packages/google_sign_in/google_sign_in_android/example/android/app/build.gradle +++ b/packages/google_sign_in/google_sign_in_android/example/android/app/build.gradle @@ -32,7 +32,7 @@ android { defaultConfig { applicationId "io.flutter.plugins.googlesigninexample" minSdkVersion flutter.minSdkVersion - targetSdkVersion 28 + targetSdkVersion 34 multiDexEnabled true versionCode flutterVersionCode.toInteger() versionName flutterVersionName 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..d951fac2bf31 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-8.7-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/packages/google_sign_in/google_sign_in_android/example/android/app/src/main/AndroidManifest.xml b/packages/google_sign_in/google_sign_in_android/example/android/app/src/main/AndroidManifest.xml index 22a34d7218f7..750ce3cef5fd 100644 --- a/packages/google_sign_in/google_sign_in_android/example/android/app/src/main/AndroidManifest.xml +++ b/packages/google_sign_in/google_sign_in_android/example/android/app/src/main/AndroidManifest.xml @@ -5,7 +5,8 @@ diff --git a/packages/google_sign_in/google_sign_in_android/example/android/build.gradle b/packages/google_sign_in/google_sign_in_android/example/android/build.gradle index dc46ed04d80d..ba8a335002e2 100644 --- a/packages/google_sign_in/google_sign_in_android/example/android/build.gradle +++ b/packages/google_sign_in/google_sign_in_android/example/android/build.gradle @@ -5,7 +5,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:7.4.2' + classpath 'com.android.tools.build:gradle:8.5.1' } } 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..3c85cfe057a1 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-8.7-all.zip diff --git a/packages/google_sign_in/google_sign_in_android/example/pubspec.yaml b/packages/google_sign_in/google_sign_in_android/example/pubspec.yaml index 11b6f0742725..0adb6d9f80fc 100644 --- a/packages/google_sign_in/google_sign_in_android/example/pubspec.yaml +++ b/packages/google_sign_in/google_sign_in_android/example/pubspec.yaml @@ -3,8 +3,8 @@ description: Example of Google Sign-In plugin. publish_to: none environment: - sdk: ^3.4.0 - flutter: ">=3.22.0" + sdk: ^3.5.0 + flutter: ">=3.24.0" dependencies: flutter: @@ -20,7 +20,7 @@ dependencies: http: ">=0.13.0 <2.0.0" dev_dependencies: - espresso: ^0.2.0 + espresso: ^0.4.0 flutter_test: sdk: flutter integration_test: diff --git a/packages/google_sign_in/google_sign_in_android/lib/src/messages.g.dart b/packages/google_sign_in/google_sign_in_android/lib/src/messages.g.dart index 14d8cb5fdc90..c5a7367318cd 100644 --- a/packages/google_sign_in/google_sign_in_android/lib/src/messages.g.dart +++ b/packages/google_sign_in/google_sign_in_android/lib/src/messages.g.dart @@ -1,9 +1,9 @@ // 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 (v10.1.0), do not edit directly. +// Autogenerated from Pigeon (v22.4.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 +// 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, no_leading_underscores_for_local_identifiers import 'dart:async'; import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List; @@ -11,6 +11,13 @@ import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List; import 'package:flutter/foundation.dart' show ReadBuffer, WriteBuffer; import 'package:flutter/services.dart'; +PlatformException _createConnectionError(String channelName) { + return PlatformException( + code: 'channel-error', + message: 'Unable to establish connection on channel: "$channelName".', + ); +} + /// Pigeon version of SignInOption. enum SignInType { /// Default configuration. @@ -25,15 +32,15 @@ enum SignInType { /// See SignInInitParams for details. class InitParams { InitParams({ - required this.scopes, - required this.signInType, + this.scopes = const [], + this.signInType = SignInType.standard, this.hostedDomain, this.clientId, this.serverClientId, - required this.forceCodeForRefreshToken, + this.forceCodeForRefreshToken = false, }); - List scopes; + List scopes; SignInType signInType; @@ -48,7 +55,7 @@ class InitParams { Object encode() { return [ scopes, - signInType.index, + signInType, hostedDomain, clientId, serverClientId, @@ -59,8 +66,8 @@ class InitParams { static InitParams decode(Object result) { result as List; return InitParams( - scopes: (result[0] as List?)!.cast(), - signInType: SignInType.values[result[1]! as int], + scopes: (result[0] as List?)!.cast(), + signInType: result[1]! as SignInType, hostedDomain: result[2] as String?, clientId: result[3] as String?, serverClientId: result[4] as String?, @@ -118,15 +125,21 @@ class UserData { } } -class _GoogleSignInApiCodec extends StandardMessageCodec { - const _GoogleSignInApiCodec(); +class _PigeonCodec extends StandardMessageCodec { + const _PigeonCodec(); @override void writeValue(WriteBuffer buffer, Object? value) { - if (value is InitParams) { - buffer.putUint8(128); + if (value is int) { + buffer.putUint8(4); + buffer.putInt64(value); + } else if (value is SignInType) { + buffer.putUint8(129); + writeValue(buffer, value.index); + } else if (value is InitParams) { + buffer.putUint8(130); writeValue(buffer, value.encode()); } else if (value is UserData) { - buffer.putUint8(129); + buffer.putUint8(131); writeValue(buffer, value.encode()); } else { super.writeValue(buffer, value); @@ -136,9 +149,12 @@ class _GoogleSignInApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: - return InitParams.decode(readValue(buffer)!); case 129: + final int? value = readValue(buffer) as int?; + return value == null ? null : SignInType.values[value]; + case 130: + return InitParams.decode(readValue(buffer)!); + case 131: return UserData.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -150,29 +166,36 @@ class GoogleSignInApi { /// Constructor for [GoogleSignInApi]. The [binaryMessenger] named argument is /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. - GoogleSignInApi({BinaryMessenger? binaryMessenger}) - : _binaryMessenger = binaryMessenger; - final BinaryMessenger? _binaryMessenger; + GoogleSignInApi( + {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) + : pigeonVar_binaryMessenger = binaryMessenger, + pigeonVar_messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + final BinaryMessenger? pigeonVar_binaryMessenger; + + static const MessageCodec pigeonChannelCodec = _PigeonCodec(); - static const MessageCodec codec = _GoogleSignInApiCodec(); + final String pigeonVar_messageChannelSuffix; /// Initializes a sign in request with the given parameters. - Future init(InitParams arg_params) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.GoogleSignInApi.init', codec, - binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_params]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + Future init(InitParams params) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_sign_in_android.GoogleSignInApi.init$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([params]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -181,103 +204,113 @@ class GoogleSignInApi { /// Starts a silent sign in. Future signInSilently() async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.GoogleSignInApi.signInSilently', codec, - binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send(null) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_sign_in_android.GoogleSignInApi.signInSilently$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (replyList[0] as UserData?)!; + return (pigeonVar_replyList[0] as UserData?)!; } } /// Starts a sign in with user interaction. Future signIn() async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.GoogleSignInApi.signIn', codec, - binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send(null) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_sign_in_android.GoogleSignInApi.signIn$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (replyList[0] as UserData?)!; + return (pigeonVar_replyList[0] as UserData?)!; } } /// Requests the access token for the current sign in. - Future getAccessToken( - String arg_email, bool arg_shouldRecoverAuth) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.GoogleSignInApi.getAccessToken', codec, - binaryMessenger: _binaryMessenger); - final List? replyList = await channel - .send([arg_email, arg_shouldRecoverAuth]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + Future getAccessToken(String email, bool shouldRecoverAuth) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_sign_in_android.GoogleSignInApi.getAccessToken$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = await pigeonVar_channel + .send([email, shouldRecoverAuth]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (replyList[0] as String?)!; + return (pigeonVar_replyList[0] as String?)!; } } /// Signs out the current user. Future signOut() async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.GoogleSignInApi.signOut', codec, - binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send(null) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_sign_in_android.GoogleSignInApi.signOut$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -286,20 +319,23 @@ class GoogleSignInApi { /// Revokes scope grants to the application. Future disconnect() async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.GoogleSignInApi.disconnect', codec, - binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send(null) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_sign_in_android.GoogleSignInApi.disconnect$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -308,49 +344,54 @@ class GoogleSignInApi { /// Returns whether the user is currently signed in. Future isSignedIn() async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.GoogleSignInApi.isSignedIn', codec, - binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send(null) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_sign_in_android.GoogleSignInApi.isSignedIn$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (replyList[0] == null) { + } else if (pigeonVar_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 (pigeonVar_replyList[0] as bool?)!; } } /// Clears the authentication caching for the given token, requiring a /// new sign in. - Future clearAuthCache(String arg_token) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.GoogleSignInApi.clearAuthCache', codec, - binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_token]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + Future clearAuthCache(String token) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_sign_in_android.GoogleSignInApi.clearAuthCache$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([token]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -358,30 +399,32 @@ class GoogleSignInApi { } /// Requests access to the given scopes. - Future requestScopes(List arg_scopes) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.GoogleSignInApi.requestScopes', codec, - binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_scopes]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + Future requestScopes(List scopes) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.google_sign_in_android.GoogleSignInApi.requestScopes$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([scopes]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (replyList[0] == null) { + } else if (pigeonVar_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 (pigeonVar_replyList[0] as bool?)!; } } } diff --git a/packages/google_sign_in/google_sign_in_android/pigeons/messages.dart b/packages/google_sign_in/google_sign_in_android/pigeons/messages.dart index 4804d43eac5c..69a452277dfe 100644 --- a/packages/google_sign_in/google_sign_in_android/pigeons/messages.dart +++ b/packages/google_sign_in/google_sign_in_android/pigeons/messages.dart @@ -35,10 +35,7 @@ class InitParams { this.forceCodeForRefreshToken = false, }); - // TODO(stuartmorgan): Make the generic type non-nullable once supported. - // https://github.com/flutter/flutter/issues/97848 - // The Java code treats the values as non-nullable. - final List scopes; + final List scopes; final SignInType signInType; final String? hostedDomain; final String? clientId; 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 da1ef5b458be..598eeb91a9df 100644 --- a/packages/google_sign_in/google_sign_in_android/pubspec.yaml +++ b/packages/google_sign_in/google_sign_in_android/pubspec.yaml @@ -2,11 +2,11 @@ name: google_sign_in_android description: Android implementation of the google_sign_in plugin. repository: https://github.com/flutter/packages/tree/main/packages/google_sign_in/google_sign_in_android issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+google_sign_in%22 -version: 6.1.28 +version: 6.1.33 environment: - sdk: ^3.4.0 - flutter: ">=3.22.0" + sdk: ^3.5.0 + flutter: ">=3.24.0" flutter: plugin: @@ -28,8 +28,8 @@ dev_dependencies: sdk: flutter integration_test: sdk: flutter - mockito: 5.4.4 - pigeon: ^10.1.0 + mockito: ^5.4.4 + pigeon: ^22.4.2 topics: - authentication 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 88ed91b01746..d6ab31e98763 100644 --- a/packages/google_sign_in/google_sign_in_ios/CHANGELOG.md +++ b/packages/google_sign_in/google_sign_in_ios/CHANGELOG.md @@ -1,5 +1,10 @@ -## NEXT +## 5.7.8 +* Updates Pigeon for non-nullable collection type support. + +## 5.7.7 + +* Fixes "callee requires a non-null parameter" analyzer warning. * Updates minimum supported SDK version to Flutter 3.19/Dart 3.3. ## 5.7.6 diff --git a/packages/google_sign_in/google_sign_in_ios/darwin/Classes/FLTGoogleSignInPlugin.m b/packages/google_sign_in/google_sign_in_ios/darwin/Classes/FLTGoogleSignInPlugin.m index 99ee0348f518..7ba4db916089 100644 --- a/packages/google_sign_in/google_sign_in_ios/darwin/Classes/FLTGoogleSignInPlugin.m +++ b/packages/google_sign_in/google_sign_in_ios/darwin/Classes/FLTGoogleSignInPlugin.m @@ -124,7 +124,12 @@ - (void)signInSilentlyWithCompletion:(nonnull void (^)(FSIUserData *_Nullable, FlutterError *_Nullable))completion { [self.signIn restorePreviousSignInWithCompletion:^(GIDGoogleUser *_Nullable user, NSError *_Nullable error) { - [self didSignInForUser:user withServerAuthCode:nil completion:completion error:error]; + if (user != nil) { + [self didSignInForUser:user withServerAuthCode:nil completion:completion]; + } else { + // Forward all errors and let Dart side decide how to handle. + completion(nil, getFlutterError(error)); + } }]; } @@ -152,17 +157,14 @@ - (void)signInWithCompletion:(nonnull void (^)(FSIUserData *_Nullable, [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:signInResult.user + withServerAuthCode:signInResult.serverAuthCode + completion:completion]; + } else { + // Forward all errors and let Dart side decide how to handle. + completion(nil, getFlutterError(error)); } - - [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]); @@ -291,30 +293,21 @@ - (GIDConfiguration *)configurationWithClientIdentifier:(NSString *)runtimeClien - (void)didSignInForUser:(GIDGoogleUser *)user withServerAuthCode:(NSString *_Nullable)serverAuthCode - completion:(nonnull void (^)(FSIUserData *_Nullable, - FlutterError *_Nullable))completion - error:(NSError *)error { - if (error != nil) { - // Forward all errors and let Dart side decide how to handle. - completion(nil, getFlutterError(error)); - } else { - NSURL *photoUrl; - if (user.profile.hasImage) { - // Placeholder that will be replaced by on the Dart side based on screen size. - photoUrl = [user.profile imageURLWithDimension:1337]; - } - NSString *idToken; - if (user.idToken) { - idToken = user.idToken.tokenString; - } - completion([FSIUserData makeWithDisplayName:user.profile.name - email:user.profile.email - userId:user.userID - photoUrl:[photoUrl absoluteString] - serverAuthCode:serverAuthCode - idToken:idToken], - nil); + completion: + (nonnull void (^)(FSIUserData *_Nullable, FlutterError *_Nullable))completion { + NSURL *photoUrl; + if (user.profile.hasImage) { + // Placeholder that will be replaced by on the Dart side based on screen size. + photoUrl = [user.profile imageURLWithDimension:1337]; } + + completion([FSIUserData makeWithDisplayName:user.profile.name + email:user.profile.email + userId:user.userID + photoUrl:photoUrl.absoluteString + serverAuthCode:serverAuthCode + idToken:user.idToken.tokenString], + nil); } #if TARGET_OS_IOS 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..822d06a03a2d 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 @@ -24,10 +24,7 @@ class InitParams { this.serverClientId, }); - // TODO(stuartmorgan): Make the generic type non-nullable once supported. - // https://github.com/flutter/flutter/issues/97848 - // The Obj-C code treats the values as non-nullable. - final List scopes; + final List scopes; final String? hostedDomain; final String? clientId; final String? serverClientId; 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 c86af4d3f0e0..b4d782f97a98 100644 --- a/packages/google_sign_in/google_sign_in_ios/pubspec.yaml +++ b/packages/google_sign_in/google_sign_in_ios/pubspec.yaml @@ -2,7 +2,7 @@ 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.6 +version: 5.7.8 environment: sdk: ^3.3.0 @@ -32,8 +32,8 @@ dev_dependencies: sdk: flutter integration_test: sdk: flutter - mockito: 5.4.4 - pigeon: ^11.0.1 + mockito: ^5.4.4 + pigeon: ^22.4.2 topics: - authentication 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 679d4c8a330a..7826912ca88d 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 @@ -18,7 +18,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - mockito: 5.4.4 + mockito: ^5.4.4 topics: - authentication 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 682fb8a063bb..756f725fe74d 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 @@ -21,7 +21,7 @@ dev_dependencies: http: ">=0.13.0 <2.0.0" integration_test: sdk: flutter - mockito: 5.4.4 + mockito: ^5.4.4 web: ^1.0.0 flutter: 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..d951fac2bf31 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-8.7-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/packages/image_picker/image_picker/example/android/build.gradle b/packages/image_picker/image_picker/example/android/build.gradle index cec92de922cf..0bed8906c094 100755 --- a/packages/image_picker/image_picker/example/android/build.gradle +++ b/packages/image_picker/image_picker/example/android/build.gradle @@ -5,7 +5,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:7.4.2' + classpath 'com.android.tools.build:gradle:8.5.2' } } 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..3c85cfe057a1 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-8.7-all.zip diff --git a/packages/image_picker/image_picker/example/pubspec.yaml b/packages/image_picker/image_picker/example/pubspec.yaml index b7ca08c97156..12e6350a9523 100644 --- a/packages/image_picker/image_picker/example/pubspec.yaml +++ b/packages/image_picker/image_picker/example/pubspec.yaml @@ -23,7 +23,7 @@ dependencies: dev_dependencies: build_runner: ^2.1.10 - espresso: ^0.2.0 + espresso: ^0.4.0 flutter_test: sdk: flutter integration_test: diff --git a/packages/image_picker/image_picker/pubspec.yaml b/packages/image_picker/image_picker/pubspec.yaml index ee854ea43ad5..6c5676a60e0d 100755 --- a/packages/image_picker/image_picker/pubspec.yaml +++ b/packages/image_picker/image_picker/pubspec.yaml @@ -41,7 +41,7 @@ dev_dependencies: cross_file: ^0.3.1+1 # Mockito generates a direct include. flutter_test: sdk: flutter - mockito: 5.4.4 + mockito: ^5.4.4 plugin_platform_interface: ^2.1.7 topics: diff --git a/packages/image_picker/image_picker_android/CHANGELOG.md b/packages/image_picker/image_picker_android/CHANGELOG.md index 248b06ffe9cb..7616f8f6dce4 100644 --- a/packages/image_picker/image_picker_android/CHANGELOG.md +++ b/packages/image_picker/image_picker_android/CHANGELOG.md @@ -1,3 +1,24 @@ +## 0.8.12+17 + +* Bumps androidx.annotation:annotation from 1.8.2 to 1.9.0. + +## 0.8.12+16 + +* Updates Pigeon for non-nullable collection type support. + +## 0.8.12+15 + +* Updates Java compatibility version to 11. + +## 0.8.12+14 + +* Bumps androidx.activity:activity from 1.9.1 to 1.9.2. + +## 0.8.12+13 + +* Removes dependency on org.jetbrains.kotlin:kotlin-bom. +* Updates minimum supported SDK version to Flutter 3.24/Dart 3.5. + ## 0.8.12+12 * Bumps androidx.annotation:annotation from 1.8.1 to 1.8.2. diff --git a/packages/image_picker/image_picker_android/android/build.gradle b/packages/image_picker/image_picker_android/android/build.gradle index 498e4eabb445..e1d46ee3340c 100644 --- a/packages/image_picker/image_picker_android/android/build.gradle +++ b/packages/image_picker/image_picker_android/android/build.gradle @@ -22,10 +22,7 @@ rootProject.allprojects { apply plugin: 'com.android.library' android { - // Conditional for compatibility with AGP <4.2. - if (project.android.hasProperty("namespace")) { - namespace 'io.flutter.plugins.imagepicker' - } + namespace 'io.flutter.plugins.imagepicker' compileSdk 34 defaultConfig { @@ -39,12 +36,9 @@ android { } dependencies { implementation 'androidx.core:core:1.13.1' - implementation 'androidx.annotation:annotation:1.8.2' + implementation 'androidx.annotation:annotation:1.9.0' implementation 'androidx.exifinterface:exifinterface:1.3.7' - implementation 'androidx.activity:activity:1.9.1' - // org.jetbrains.kotlin:kotlin-bom artifact purpose is to align kotlin stdlib and related code versions. - // See: https://youtrack.jetbrains.com/issue/KT-55297/kotlin-stdlib-should-declare-constraints-on-kotlin-stdlib-jdk8-and-kotlin-stdlib-jdk7 - implementation(platform("org.jetbrains.kotlin:kotlin-bom:1.8.22")) + implementation 'androidx.activity:activity:1.9.2' testImplementation 'junit:junit:4.13.2' testImplementation 'org.mockito:mockito-core:5.1.1' @@ -53,8 +47,8 @@ android { } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_11 + targetCompatibility JavaVersion.VERSION_11 } testOptions { 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 deleted file mode 100644 index 068cdb2dc260..000000000000 --- a/packages/image_picker/image_picker_android/android/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,5 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-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/Messages.java b/packages/image_picker/image_picker_android/android/src/main/java/io/flutter/plugins/imagepicker/Messages.java index b987a2284a8e..c11f20e228d4 100644 --- a/packages/image_picker/image_picker_android/android/src/main/java/io/flutter/plugins/imagepicker/Messages.java +++ b/packages/image_picker/image_picker_android/android/src/main/java/io/flutter/plugins/imagepicker/Messages.java @@ -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 (v17.0.0), do not edit directly. +// Autogenerated from Pigeon (v22.4.1), do not edit directly. // See also: https://pub.dev/packages/pigeon package io.flutter.plugins.imagepicker; @@ -22,6 +22,7 @@ import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.List; +import java.util.Objects; /** Generated class from Pigeon. */ @SuppressWarnings({"unused", "unchecked", "CodeBlock2Expr", "RedundantSuppression", "serial"}) @@ -45,7 +46,7 @@ public FlutterError(@NonNull String code, @Nullable String message, @Nullable Ob @NonNull protected static ArrayList wrapError(@NonNull Throwable exception) { - ArrayList errorList = new ArrayList(3); + ArrayList errorList = new ArrayList<>(3); if (exception instanceof FlutterError) { FlutterError error = (FlutterError) exception; errorList.add(error.code); @@ -70,7 +71,7 @@ public enum SourceCamera { final int index; - private SourceCamera(final int index) { + SourceCamera(final int index) { this.index = index; } } @@ -81,7 +82,7 @@ public enum SourceType { final int index; - private SourceType(final int index) { + SourceType(final int index) { this.index = index; } } @@ -92,7 +93,7 @@ public enum CacheRetrievalType { final int index; - private CacheRetrievalType(final int index) { + CacheRetrievalType(final int index) { this.index = index; } } @@ -138,6 +139,25 @@ public void setLimit(@Nullable Long setterArg) { /** Constructor is non-public to enforce null safety; use Builder. */ GeneralOptions() {} + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GeneralOptions that = (GeneralOptions) o; + return allowMultiple.equals(that.allowMultiple) + && usePhotoPicker.equals(that.usePhotoPicker) + && Objects.equals(limit, that.limit); + } + + @Override + public int hashCode() { + return Objects.hash(allowMultiple, usePhotoPicker, limit); + } + public static final class Builder { private @Nullable Boolean allowMultiple; @@ -175,22 +195,21 @@ public static final class Builder { @NonNull ArrayList toList() { - ArrayList toListResult = new ArrayList(3); + ArrayList toListResult = new ArrayList<>(3); toListResult.add(allowMultiple); toListResult.add(usePhotoPicker); toListResult.add(limit); return toListResult; } - static @NonNull GeneralOptions fromList(@NonNull ArrayList list) { + static @NonNull GeneralOptions fromList(@NonNull ArrayList pigeonVar_list) { GeneralOptions pigeonResult = new GeneralOptions(); - Object allowMultiple = list.get(0); + Object allowMultiple = pigeonVar_list.get(0); pigeonResult.setAllowMultiple((Boolean) allowMultiple); - Object usePhotoPicker = list.get(1); + Object usePhotoPicker = pigeonVar_list.get(1); pigeonResult.setUsePhotoPicker((Boolean) usePhotoPicker); - Object limit = list.get(2); - pigeonResult.setLimit( - (limit == null) ? null : ((limit instanceof Integer) ? (Integer) limit : (Long) limit)); + Object limit = pigeonVar_list.get(2); + pigeonResult.setLimit((Long) limit); return pigeonResult; } } @@ -244,6 +263,25 @@ public void setQuality(@NonNull Long setterArg) { /** Constructor is non-public to enforce null safety; use Builder. */ ImageSelectionOptions() {} + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ImageSelectionOptions that = (ImageSelectionOptions) o; + return Objects.equals(maxWidth, that.maxWidth) + && Objects.equals(maxHeight, that.maxHeight) + && quality.equals(that.quality); + } + + @Override + public int hashCode() { + return Objects.hash(maxWidth, maxHeight, quality); + } + public static final class Builder { private @Nullable Double maxWidth; @@ -281,24 +319,21 @@ public static final class Builder { @NonNull ArrayList toList() { - ArrayList toListResult = new ArrayList(3); + ArrayList toListResult = new ArrayList<>(3); toListResult.add(maxWidth); toListResult.add(maxHeight); toListResult.add(quality); return toListResult; } - static @NonNull ImageSelectionOptions fromList(@NonNull ArrayList list) { + static @NonNull ImageSelectionOptions fromList(@NonNull ArrayList pigeonVar_list) { ImageSelectionOptions pigeonResult = new ImageSelectionOptions(); - Object maxWidth = list.get(0); + Object maxWidth = pigeonVar_list.get(0); pigeonResult.setMaxWidth((Double) maxWidth); - Object maxHeight = list.get(1); + Object maxHeight = pigeonVar_list.get(1); pigeonResult.setMaxHeight((Double) maxHeight); - Object quality = list.get(2); - pigeonResult.setQuality( - (quality == null) - ? null - : ((quality instanceof Integer) ? (Integer) quality : (Long) quality)); + Object quality = pigeonVar_list.get(2); + pigeonResult.setQuality((Long) quality); return pigeonResult; } } @@ -321,6 +356,23 @@ public void setImageSelectionOptions(@NonNull ImageSelectionOptions setterArg) { /** Constructor is non-public to enforce null safety; use Builder. */ MediaSelectionOptions() {} + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MediaSelectionOptions that = (MediaSelectionOptions) o; + return imageSelectionOptions.equals(that.imageSelectionOptions); + } + + @Override + public int hashCode() { + return Objects.hash(imageSelectionOptions); + } + public static final class Builder { private @Nullable ImageSelectionOptions imageSelectionOptions; @@ -340,18 +392,15 @@ public static final class Builder { @NonNull ArrayList toList() { - ArrayList toListResult = new ArrayList(1); - toListResult.add((imageSelectionOptions == null) ? null : imageSelectionOptions.toList()); + ArrayList toListResult = new ArrayList<>(1); + toListResult.add(imageSelectionOptions); return toListResult; } - static @NonNull MediaSelectionOptions fromList(@NonNull ArrayList list) { + static @NonNull MediaSelectionOptions fromList(@NonNull ArrayList pigeonVar_list) { MediaSelectionOptions pigeonResult = new MediaSelectionOptions(); - Object imageSelectionOptions = list.get(0); - pigeonResult.setImageSelectionOptions( - (imageSelectionOptions == null) - ? null - : ImageSelectionOptions.fromList((ArrayList) imageSelectionOptions)); + Object imageSelectionOptions = pigeonVar_list.get(0); + pigeonResult.setImageSelectionOptions((ImageSelectionOptions) imageSelectionOptions); return pigeonResult; } } @@ -373,6 +422,23 @@ public void setMaxDurationSeconds(@Nullable Long setterArg) { this.maxDurationSeconds = setterArg; } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VideoSelectionOptions that = (VideoSelectionOptions) o; + return Objects.equals(maxDurationSeconds, that.maxDurationSeconds); + } + + @Override + public int hashCode() { + return Objects.hash(maxDurationSeconds); + } + public static final class Builder { private @Nullable Long maxDurationSeconds; @@ -392,20 +458,15 @@ public static final class Builder { @NonNull ArrayList toList() { - ArrayList toListResult = new ArrayList(1); + ArrayList toListResult = new ArrayList<>(1); toListResult.add(maxDurationSeconds); return toListResult; } - static @NonNull VideoSelectionOptions fromList(@NonNull ArrayList list) { + static @NonNull VideoSelectionOptions fromList(@NonNull ArrayList pigeonVar_list) { VideoSelectionOptions pigeonResult = new VideoSelectionOptions(); - Object maxDurationSeconds = list.get(0); - pigeonResult.setMaxDurationSeconds( - (maxDurationSeconds == null) - ? null - : ((maxDurationSeconds instanceof Integer) - ? (Integer) maxDurationSeconds - : (Long) maxDurationSeconds)); + Object maxDurationSeconds = pigeonVar_list.get(0); + pigeonResult.setMaxDurationSeconds((Long) maxDurationSeconds); return pigeonResult; } } @@ -442,6 +503,23 @@ public void setCamera(@Nullable SourceCamera setterArg) { /** Constructor is non-public to enforce null safety; use Builder. */ SourceSpecification() {} + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SourceSpecification that = (SourceSpecification) o; + return type.equals(that.type) && Objects.equals(camera, that.camera); + } + + @Override + public int hashCode() { + return Objects.hash(type, camera); + } + public static final class Builder { private @Nullable SourceType type; @@ -470,18 +548,18 @@ public static final class Builder { @NonNull ArrayList toList() { - ArrayList toListResult = new ArrayList(2); - toListResult.add(type == null ? null : type.index); - toListResult.add(camera == null ? null : camera.index); + ArrayList toListResult = new ArrayList<>(2); + toListResult.add(type); + toListResult.add(camera); return toListResult; } - static @NonNull SourceSpecification fromList(@NonNull ArrayList list) { + static @NonNull SourceSpecification fromList(@NonNull ArrayList pigeonVar_list) { SourceSpecification pigeonResult = new SourceSpecification(); - Object type = list.get(0); - pigeonResult.setType(SourceType.values()[(int) type]); - Object camera = list.get(1); - pigeonResult.setCamera(camera == null ? null : SourceCamera.values()[(int) camera]); + Object type = pigeonVar_list.get(0); + pigeonResult.setType((SourceType) type); + Object camera = pigeonVar_list.get(1); + pigeonResult.setCamera((SourceCamera) camera); return pigeonResult; } } @@ -520,6 +598,23 @@ public void setMessage(@Nullable String setterArg) { /** Constructor is non-public to enforce null safety; use Builder. */ CacheRetrievalError() {} + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CacheRetrievalError that = (CacheRetrievalError) o; + return code.equals(that.code) && Objects.equals(message, that.message); + } + + @Override + public int hashCode() { + return Objects.hash(code, message); + } + public static final class Builder { private @Nullable String code; @@ -548,17 +643,17 @@ public static final class Builder { @NonNull ArrayList toList() { - ArrayList toListResult = new ArrayList(2); + ArrayList toListResult = new ArrayList<>(2); toListResult.add(code); toListResult.add(message); return toListResult; } - static @NonNull CacheRetrievalError fromList(@NonNull ArrayList list) { + static @NonNull CacheRetrievalError fromList(@NonNull ArrayList pigeonVar_list) { CacheRetrievalError pigeonResult = new CacheRetrievalError(); - Object code = list.get(0); + Object code = pigeonVar_list.get(0); pigeonResult.setCode((String) code); - Object message = list.get(1); + Object message = pigeonVar_list.get(1); pigeonResult.setMessage((String) message); return pigeonResult; } @@ -595,12 +690,7 @@ public void setError(@Nullable CacheRetrievalError setterArg) { this.error = setterArg; } - /** - * The results from the last selection, if any. - * - *

Elements must not be null, by convention. See - * https://github.com/flutter/flutter/issues/97848 - */ + /** The results from the last selection, if any. */ private @NonNull List paths; public @NonNull List getPaths() { @@ -617,6 +707,25 @@ public void setPaths(@NonNull List setterArg) { /** Constructor is non-public to enforce null safety; use Builder. */ CacheRetrievalResult() {} + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CacheRetrievalResult that = (CacheRetrievalResult) o; + return type.equals(that.type) + && Objects.equals(error, that.error) + && paths.equals(that.paths); + } + + @Override + public int hashCode() { + return Objects.hash(type, error, paths); + } + public static final class Builder { private @Nullable CacheRetrievalType type; @@ -654,73 +763,62 @@ public static final class Builder { @NonNull ArrayList toList() { - ArrayList toListResult = new ArrayList(3); - toListResult.add(type == null ? null : type.index); - toListResult.add((error == null) ? null : error.toList()); + ArrayList toListResult = new ArrayList<>(3); + toListResult.add(type); + toListResult.add(error); toListResult.add(paths); return toListResult; } - static @NonNull CacheRetrievalResult fromList(@NonNull ArrayList list) { + static @NonNull CacheRetrievalResult fromList(@NonNull ArrayList pigeonVar_list) { CacheRetrievalResult pigeonResult = new CacheRetrievalResult(); - Object type = list.get(0); - pigeonResult.setType(CacheRetrievalType.values()[(int) type]); - Object error = list.get(1); - pigeonResult.setError( - (error == null) ? null : CacheRetrievalError.fromList((ArrayList) error)); - Object paths = list.get(2); + Object type = pigeonVar_list.get(0); + pigeonResult.setType((CacheRetrievalType) type); + Object error = pigeonVar_list.get(1); + pigeonResult.setError((CacheRetrievalError) error); + Object paths = pigeonVar_list.get(2); pigeonResult.setPaths((List) paths); return pigeonResult; } } - /** Asynchronous error handling return type for non-nullable API method returns. */ - public interface Result { - /** Success case callback method for handling returns. */ - void success(@NonNull T result); + private static class PigeonCodec extends StandardMessageCodec { + public static final PigeonCodec INSTANCE = new PigeonCodec(); - /** Failure case callback method for handling errors. */ - void error(@NonNull Throwable error); - } - /** Asynchronous error handling return type for nullable API method returns. */ - public interface NullableResult { - /** Success case callback method for handling returns. */ - void success(@Nullable T result); - - /** Failure case callback method for handling errors. */ - void error(@NonNull Throwable error); - } - /** Asynchronous error handling return type for void API method returns. */ - public interface VoidResult { - /** Success case callback method for handling returns. */ - void success(); - - /** Failure case callback method for handling errors. */ - void error(@NonNull Throwable error); - } - - private static class ImagePickerApiCodec extends StandardMessageCodec { - public static final ImagePickerApiCodec INSTANCE = new ImagePickerApiCodec(); - - private ImagePickerApiCodec() {} + private PigeonCodec() {} @Override protected Object readValueOfType(byte type, @NonNull ByteBuffer buffer) { switch (type) { - case (byte) 128: - return CacheRetrievalError.fromList((ArrayList) readValue(buffer)); case (byte) 129: - return CacheRetrievalResult.fromList((ArrayList) readValue(buffer)); + { + Object value = readValue(buffer); + return value == null ? null : SourceCamera.values()[((Long) value).intValue()]; + } case (byte) 130: - return GeneralOptions.fromList((ArrayList) readValue(buffer)); + { + Object value = readValue(buffer); + return value == null ? null : SourceType.values()[((Long) value).intValue()]; + } case (byte) 131: - return ImageSelectionOptions.fromList((ArrayList) readValue(buffer)); + { + Object value = readValue(buffer); + return value == null ? null : CacheRetrievalType.values()[((Long) value).intValue()]; + } case (byte) 132: - return MediaSelectionOptions.fromList((ArrayList) readValue(buffer)); + return GeneralOptions.fromList((ArrayList) readValue(buffer)); case (byte) 133: - return SourceSpecification.fromList((ArrayList) readValue(buffer)); + return ImageSelectionOptions.fromList((ArrayList) readValue(buffer)); case (byte) 134: + return MediaSelectionOptions.fromList((ArrayList) readValue(buffer)); + case (byte) 135: return VideoSelectionOptions.fromList((ArrayList) readValue(buffer)); + case (byte) 136: + return SourceSpecification.fromList((ArrayList) readValue(buffer)); + case (byte) 137: + return CacheRetrievalError.fromList((ArrayList) readValue(buffer)); + case (byte) 138: + return CacheRetrievalResult.fromList((ArrayList) readValue(buffer)); default: return super.readValueOfType(type, buffer); } @@ -728,63 +826,81 @@ protected Object readValueOfType(byte type, @NonNull ByteBuffer buffer) { @Override protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { - if (value instanceof CacheRetrievalError) { - stream.write(128); - writeValue(stream, ((CacheRetrievalError) value).toList()); - } else if (value instanceof CacheRetrievalResult) { + if (value instanceof SourceCamera) { stream.write(129); - writeValue(stream, ((CacheRetrievalResult) value).toList()); - } else if (value instanceof GeneralOptions) { + writeValue(stream, value == null ? null : ((SourceCamera) value).index); + } else if (value instanceof SourceType) { stream.write(130); + writeValue(stream, value == null ? null : ((SourceType) value).index); + } else if (value instanceof CacheRetrievalType) { + stream.write(131); + writeValue(stream, value == null ? null : ((CacheRetrievalType) value).index); + } else if (value instanceof GeneralOptions) { + stream.write(132); writeValue(stream, ((GeneralOptions) value).toList()); } else if (value instanceof ImageSelectionOptions) { - stream.write(131); + stream.write(133); writeValue(stream, ((ImageSelectionOptions) value).toList()); } else if (value instanceof MediaSelectionOptions) { - stream.write(132); + stream.write(134); writeValue(stream, ((MediaSelectionOptions) value).toList()); - } else if (value instanceof SourceSpecification) { - stream.write(133); - writeValue(stream, ((SourceSpecification) value).toList()); } else if (value instanceof VideoSelectionOptions) { - stream.write(134); + stream.write(135); writeValue(stream, ((VideoSelectionOptions) value).toList()); + } else if (value instanceof SourceSpecification) { + stream.write(136); + writeValue(stream, ((SourceSpecification) value).toList()); + } else if (value instanceof CacheRetrievalError) { + stream.write(137); + writeValue(stream, ((CacheRetrievalError) value).toList()); + } else if (value instanceof CacheRetrievalResult) { + stream.write(138); + writeValue(stream, ((CacheRetrievalResult) value).toList()); } else { super.writeValue(stream, value); } } } + /** Asynchronous error handling return type for non-nullable API method returns. */ + public interface Result { + /** Success case callback method for handling returns. */ + void success(@NonNull T result); + + /** Failure case callback method for handling errors. */ + void error(@NonNull Throwable error); + } + /** Asynchronous error handling return type for nullable API method returns. */ + public interface NullableResult { + /** Success case callback method for handling returns. */ + void success(@Nullable T result); + + /** Failure case callback method for handling errors. */ + void error(@NonNull Throwable error); + } + /** Asynchronous error handling return type for void API method returns. */ + public interface VoidResult { + /** Success case callback method for handling returns. */ + void success(); + + /** Failure case callback method for handling errors. */ + void error(@NonNull Throwable error); + } /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface ImagePickerApi { - /** - * Selects images and returns their paths. - * - *

Elements must not be null, by convention. See - * https://github.com/flutter/flutter/issues/97848 - */ + /** Selects images and returns their paths. */ void pickImages( @NonNull SourceSpecification source, @NonNull ImageSelectionOptions options, @NonNull GeneralOptions generalOptions, @NonNull Result> result); - /** - * Selects video and returns their paths. - * - *

Elements must not be null, by convention. See - * https://github.com/flutter/flutter/issues/97848 - */ + /** Selects video and returns their paths. */ void pickVideos( @NonNull SourceSpecification source, @NonNull VideoSelectionOptions options, @NonNull GeneralOptions generalOptions, @NonNull Result> result); - /** - * Selects images and videos and returns their paths. - * - *

Elements must not be null, by convention. See - * https://github.com/flutter/flutter/issues/97848 - */ + /** Selects images and videos and returns their paths. */ void pickMedia( @NonNull MediaSelectionOptions mediaSelectionOptions, @NonNull GeneralOptions generalOptions, @@ -795,22 +911,31 @@ void pickMedia( /** The codec used by ImagePickerApi. */ static @NonNull MessageCodec getCodec() { - return ImagePickerApiCodec.INSTANCE; + return PigeonCodec.INSTANCE; } /** Sets up an instance of `ImagePickerApi` to handle messages through the `binaryMessenger`. */ static void setUp(@NonNull BinaryMessenger binaryMessenger, @Nullable ImagePickerApi api) { + setUp(binaryMessenger, "", api); + } + + static void setUp( + @NonNull BinaryMessenger binaryMessenger, + @NonNull String messageChannelSuffix, + @Nullable ImagePickerApi api) { + messageChannelSuffix = messageChannelSuffix.isEmpty() ? "" : "." + messageChannelSuffix; { BinaryMessenger.TaskQueue taskQueue = binaryMessenger.makeBackgroundTaskQueue(); BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.image_picker_android.ImagePickerApi.pickImages", + "dev.flutter.pigeon.image_picker_android.ImagePickerApi.pickImages" + + messageChannelSuffix, getCodec(), taskQueue); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; SourceSpecification sourceArg = (SourceSpecification) args.get(0); ImageSelectionOptions optionsArg = (ImageSelectionOptions) args.get(1); @@ -839,13 +964,14 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.image_picker_android.ImagePickerApi.pickVideos", + "dev.flutter.pigeon.image_picker_android.ImagePickerApi.pickVideos" + + messageChannelSuffix, getCodec(), taskQueue); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; SourceSpecification sourceArg = (SourceSpecification) args.get(0); VideoSelectionOptions optionsArg = (VideoSelectionOptions) args.get(1); @@ -873,12 +999,13 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.image_picker_android.ImagePickerApi.pickMedia", + "dev.flutter.pigeon.image_picker_android.ImagePickerApi.pickMedia" + + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; MediaSelectionOptions mediaSelectionOptionsArg = (MediaSelectionOptions) args.get(0); @@ -907,19 +1034,19 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.image_picker_android.ImagePickerApi.retrieveLostResults", + "dev.flutter.pigeon.image_picker_android.ImagePickerApi.retrieveLostResults" + + messageChannelSuffix, getCodec(), taskQueue); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); try { CacheRetrievalResult output = api.retrieveLostResults(); wrapped.add(0, output); } catch (Throwable exception) { - ArrayList wrappedError = wrapError(exception); - wrapped = wrappedError; + wrapped = wrapError(exception); } reply.reply(wrapped); }); diff --git a/packages/image_picker/image_picker_android/example/android/app/build.gradle b/packages/image_picker/image_picker_android/example/android/app/build.gradle index 1be93f0fa346..9582952de9f3 100755 --- a/packages/image_picker/image_picker_android/example/android/app/build.gradle +++ b/packages/image_picker/image_picker_android/example/android/app/build.gradle @@ -33,7 +33,7 @@ android { defaultConfig { applicationId "io.flutter.plugins.imagepicker.example" minSdkVersion flutter.minSdkVersion - targetSdkVersion 33 + targetSdkVersion 34 multiDexEnabled true versionCode flutterVersionCode.toInteger() versionName flutterVersionName 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..d951fac2bf31 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-8.7-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/packages/image_picker/image_picker_android/example/android/build.gradle b/packages/image_picker/image_picker_android/example/android/build.gradle index facf61d83e68..7f029821ad3d 100755 --- a/packages/image_picker/image_picker_android/example/android/build.gradle +++ b/packages/image_picker/image_picker_android/example/android/build.gradle @@ -5,7 +5,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:7.4.2' + classpath 'com.android.tools.build:gradle:8.5.1' } } 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..3c85cfe057a1 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-8.7-all.zip diff --git a/packages/image_picker/image_picker_android/example/pubspec.yaml b/packages/image_picker/image_picker_android/example/pubspec.yaml index 0c7181f68abe..b3e2931c6986 100644 --- a/packages/image_picker/image_picker_android/example/pubspec.yaml +++ b/packages/image_picker/image_picker_android/example/pubspec.yaml @@ -3,8 +3,8 @@ description: Demonstrates how to use the image_picker plugin. publish_to: none environment: - sdk: ^3.4.0 - flutter: ">=3.22.0" + sdk: ^3.5.0 + flutter: ">=3.24.0" dependencies: flutter: @@ -20,12 +20,12 @@ dependencies: # the parent directory to use the current plugin's version. path: ../ image_picker_platform_interface: ^2.10.0 - mime: ^1.0.4 + mime: ^2.0.0 video_player: ^2.1.4 dev_dependencies: build_runner: ^2.1.10 - espresso: ^0.2.0 + espresso: ^0.4.0 flutter_test: sdk: flutter integration_test: diff --git a/packages/image_picker/image_picker_android/lib/image_picker_android.dart b/packages/image_picker/image_picker_android/lib/image_picker_android.dart index 2bcebe268027..5fa164b2d0f1 100644 --- a/packages/image_picker/image_picker_android/lib/image_picker_android.dart +++ b/packages/image_picker/image_picker_android/lib/image_picker_android.dart @@ -51,7 +51,7 @@ class ImagePickerAndroid extends ImagePickerPlatform { double? maxHeight, int? imageQuality, }) async { - final List paths = await _getMultiImagePath( + final List paths = await _getMultiImagePath( maxWidth: maxWidth, maxHeight: maxHeight, imageQuality: imageQuality, @@ -60,10 +60,10 @@ class ImagePickerAndroid extends ImagePickerPlatform { return null; } - return paths.map((dynamic path) => PickedFile(path as String)).toList(); + return paths.map((String path) => PickedFile(path)).toList(); } - Future> _getMultiImagePath({ + Future> _getMultiImagePath({ double? maxWidth, double? maxHeight, int? imageQuality, @@ -121,7 +121,7 @@ class ImagePickerAndroid extends ImagePickerPlatform { throw ArgumentError.value(maxHeight, 'maxHeight', 'cannot be negative'); } - final List paths = await _hostApi.pickImages( + final List paths = await _hostApi.pickImages( _buildSourceSpec(source, preferredCameraDevice), ImageSelectionOptions( maxWidth: maxWidth, @@ -154,7 +154,7 @@ class ImagePickerAndroid extends ImagePickerPlatform { CameraDevice preferredCameraDevice = CameraDevice.rear, Duration? maxDuration, }) async { - final List paths = await _hostApi.pickVideos( + final List paths = await _hostApi.pickVideos( _buildSourceSpec(source, preferredCameraDevice), VideoSelectionOptions(maxDurationSeconds: maxDuration?.inSeconds), GeneralOptions( @@ -205,7 +205,7 @@ class ImagePickerAndroid extends ImagePickerPlatform { double? maxHeight, int? imageQuality, }) async { - final List paths = await _getMultiImagePath( + final List paths = await _getMultiImagePath( maxWidth: maxWidth, maxHeight: maxHeight, imageQuality: imageQuality, @@ -214,14 +214,14 @@ class ImagePickerAndroid extends ImagePickerPlatform { return null; } - return paths.map((dynamic path) => XFile(path as String)).toList(); + return paths.map((String path) => XFile(path)).toList(); } @override Future> getMultiImageWithOptions({ MultiImagePickerOptions options = const MultiImagePickerOptions(), }) async { - final List paths = await _getMultiImagePath( + final List paths = await _getMultiImagePath( maxWidth: options.imageOptions.maxWidth, maxHeight: options.imageOptions.maxHeight, imageQuality: options.imageOptions.imageQuality, @@ -232,7 +232,7 @@ class ImagePickerAndroid extends ImagePickerPlatform { return []; } - return paths.map((dynamic path) => XFile(path as String)).toList(); + return paths.map((String path) => XFile(path)).toList(); } @override diff --git a/packages/image_picker/image_picker_android/lib/src/messages.g.dart b/packages/image_picker/image_picker_android/lib/src/messages.g.dart index 1466b15aee85..e221123fd800 100644 --- a/packages/image_picker/image_picker_android/lib/src/messages.g.dart +++ b/packages/image_picker/image_picker_android/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 (v17.0.0), do not edit directly. +// Autogenerated from Pigeon (v22.4.1), 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, no_leading_underscores_for_local_identifiers @@ -121,15 +121,14 @@ class MediaSelectionOptions { Object encode() { return [ - imageSelectionOptions.encode(), + imageSelectionOptions, ]; } static MediaSelectionOptions decode(Object result) { result as List; return MediaSelectionOptions( - imageSelectionOptions: - ImageSelectionOptions.decode(result[0]! as List), + imageSelectionOptions: result[0]! as ImageSelectionOptions, ); } } @@ -170,16 +169,16 @@ class SourceSpecification { Object encode() { return [ - type.index, - camera?.index, + type, + camera, ]; } static SourceSpecification decode(Object result) { result as List; return SourceSpecification( - type: SourceType.values[result[0]! as int], - camera: result[1] != null ? SourceCamera.values[result[1]! as int] : null, + type: result[0]! as SourceType, + camera: result[1] as SourceCamera?, ); } } @@ -228,15 +227,12 @@ class CacheRetrievalResult { CacheRetrievalError? error; /// The results from the last selection, if any. - /// - /// Elements must not be null, by convention. See - /// https://github.com/flutter/flutter/issues/97848 - List paths; + List paths; Object encode() { return [ - type.index, - error?.encode(), + type, + error, paths, ]; } @@ -244,39 +240,49 @@ class CacheRetrievalResult { static CacheRetrievalResult decode(Object result) { result as List; return CacheRetrievalResult( - type: CacheRetrievalType.values[result[0]! as int], - error: result[1] != null - ? CacheRetrievalError.decode(result[1]! as List) - : null, - paths: (result[2] as List?)!.cast(), + type: result[0]! as CacheRetrievalType, + error: result[1] as CacheRetrievalError?, + paths: (result[2] as List?)!.cast(), ); } } -class _ImagePickerApiCodec extends StandardMessageCodec { - const _ImagePickerApiCodec(); +class _PigeonCodec extends StandardMessageCodec { + const _PigeonCodec(); @override void writeValue(WriteBuffer buffer, Object? value) { - if (value is CacheRetrievalError) { - buffer.putUint8(128); - writeValue(buffer, value.encode()); - } else if (value is CacheRetrievalResult) { + if (value is int) { + buffer.putUint8(4); + buffer.putInt64(value); + } else if (value is SourceCamera) { buffer.putUint8(129); - writeValue(buffer, value.encode()); - } else if (value is GeneralOptions) { + writeValue(buffer, value.index); + } else if (value is SourceType) { buffer.putUint8(130); + writeValue(buffer, value.index); + } else if (value is CacheRetrievalType) { + buffer.putUint8(131); + writeValue(buffer, value.index); + } else if (value is GeneralOptions) { + buffer.putUint8(132); writeValue(buffer, value.encode()); } else if (value is ImageSelectionOptions) { - buffer.putUint8(131); + buffer.putUint8(133); writeValue(buffer, value.encode()); } else if (value is MediaSelectionOptions) { - buffer.putUint8(132); + buffer.putUint8(134); + writeValue(buffer, value.encode()); + } else if (value is VideoSelectionOptions) { + buffer.putUint8(135); writeValue(buffer, value.encode()); } else if (value is SourceSpecification) { - buffer.putUint8(133); + buffer.putUint8(136); writeValue(buffer, value.encode()); - } else if (value is VideoSelectionOptions) { - buffer.putUint8(134); + } else if (value is CacheRetrievalError) { + buffer.putUint8(137); + writeValue(buffer, value.encode()); + } else if (value is CacheRetrievalResult) { + buffer.putUint8(138); writeValue(buffer, value.encode()); } else { super.writeValue(buffer, value); @@ -286,20 +292,29 @@ class _ImagePickerApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: - return CacheRetrievalError.decode(readValue(buffer)!); case 129: - return CacheRetrievalResult.decode(readValue(buffer)!); + final int? value = readValue(buffer) as int?; + return value == null ? null : SourceCamera.values[value]; case 130: - return GeneralOptions.decode(readValue(buffer)!); + final int? value = readValue(buffer) as int?; + return value == null ? null : SourceType.values[value]; case 131: - return ImageSelectionOptions.decode(readValue(buffer)!); + final int? value = readValue(buffer) as int?; + return value == null ? null : CacheRetrievalType.values[value]; case 132: - return MediaSelectionOptions.decode(readValue(buffer)!); + return GeneralOptions.decode(readValue(buffer)!); case 133: - return SourceSpecification.decode(readValue(buffer)!); + return ImageSelectionOptions.decode(readValue(buffer)!); case 134: + return MediaSelectionOptions.decode(readValue(buffer)!); + case 135: return VideoSelectionOptions.decode(readValue(buffer)!); + case 136: + return SourceSpecification.decode(readValue(buffer)!); + case 137: + return CacheRetrievalError.decode(readValue(buffer)!); + case 138: + return CacheRetrievalResult.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); } @@ -310,138 +325,133 @@ class ImagePickerApi { /// Constructor for [ImagePickerApi]. The [binaryMessenger] named argument is /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. - ImagePickerApi({BinaryMessenger? binaryMessenger}) - : __pigeon_binaryMessenger = binaryMessenger; - final BinaryMessenger? __pigeon_binaryMessenger; + ImagePickerApi( + {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) + : pigeonVar_binaryMessenger = binaryMessenger, + pigeonVar_messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + final BinaryMessenger? pigeonVar_binaryMessenger; - static const MessageCodec pigeonChannelCodec = - _ImagePickerApiCodec(); + static const MessageCodec pigeonChannelCodec = _PigeonCodec(); + + final String pigeonVar_messageChannelSuffix; /// Selects images and returns their paths. - /// - /// Elements must not be null, by convention. See - /// https://github.com/flutter/flutter/issues/97848 - Future> pickImages(SourceSpecification source, + Future> pickImages(SourceSpecification source, ImageSelectionOptions options, GeneralOptions generalOptions) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.image_picker_android.ImagePickerApi.pickImages'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.image_picker_android.ImagePickerApi.pickImages$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel + final List? pigeonVar_replyList = await pigeonVar_channel .send([source, options, generalOptions]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as List?)!.cast(); + return (pigeonVar_replyList[0] as List?)!.cast(); } } /// Selects video and returns their paths. - /// - /// Elements must not be null, by convention. See - /// https://github.com/flutter/flutter/issues/97848 - Future> pickVideos(SourceSpecification source, + Future> pickVideos(SourceSpecification source, VideoSelectionOptions options, GeneralOptions generalOptions) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.image_picker_android.ImagePickerApi.pickVideos'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.image_picker_android.ImagePickerApi.pickVideos$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel + final List? pigeonVar_replyList = await pigeonVar_channel .send([source, options, generalOptions]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as List?)!.cast(); + return (pigeonVar_replyList[0] as List?)!.cast(); } } /// Selects images and videos and returns their paths. - /// - /// Elements must not be null, by convention. See - /// https://github.com/flutter/flutter/issues/97848 - Future> pickMedia(MediaSelectionOptions mediaSelectionOptions, + Future> pickMedia(MediaSelectionOptions mediaSelectionOptions, GeneralOptions generalOptions) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.image_picker_android.ImagePickerApi.pickMedia'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.image_picker_android.ImagePickerApi.pickMedia$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel + final List? pigeonVar_replyList = await pigeonVar_channel .send([mediaSelectionOptions, generalOptions]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as List?)!.cast(); + return (pigeonVar_replyList[0] as List?)!.cast(); } } /// Returns results from a previous app session, if any. Future retrieveLostResults() async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.image_picker_android.ImagePickerApi.retrieveLostResults'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.image_picker_android.ImagePickerApi.retrieveLostResults$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { - return (__pigeon_replyList[0] as CacheRetrievalResult?); + return (pigeonVar_replyList[0] as CacheRetrievalResult?); } } } diff --git a/packages/image_picker/image_picker_android/pigeons/messages.dart b/packages/image_picker/image_picker_android/pigeons/messages.dart index 7f39ae501b62..2d124eb12fdb 100644 --- a/packages/image_picker/image_picker_android/pigeons/messages.dart +++ b/packages/image_picker/image_picker_android/pigeons/messages.dart @@ -89,44 +89,32 @@ class CacheRetrievalResult { final CacheRetrievalError? error; /// The results from the last selection, if any. - /// - /// Elements must not be null, by convention. See - /// https://github.com/flutter/flutter/issues/97848 - final List paths; + final List paths; } @HostApi(dartHostTestHandler: 'TestHostImagePickerApi') abstract class ImagePickerApi { /// Selects images and returns their paths. - /// - /// Elements must not be null, by convention. See - /// https://github.com/flutter/flutter/issues/97848 @TaskQueue(type: TaskQueueType.serialBackgroundThread) @async - List pickImages( + List pickImages( SourceSpecification source, ImageSelectionOptions options, GeneralOptions generalOptions, ); /// Selects video and returns their paths. - /// - /// Elements must not be null, by convention. See - /// https://github.com/flutter/flutter/issues/97848 @TaskQueue(type: TaskQueueType.serialBackgroundThread) @async - List pickVideos( + List pickVideos( SourceSpecification source, VideoSelectionOptions options, GeneralOptions generalOptions, ); /// Selects images and videos and returns their paths. - /// - /// Elements must not be null, by convention. See - /// https://github.com/flutter/flutter/issues/97848 @async - List pickMedia( + List pickMedia( MediaSelectionOptions mediaSelectionOptions, GeneralOptions generalOptions, ); diff --git a/packages/image_picker/image_picker_android/pubspec.yaml b/packages/image_picker/image_picker_android/pubspec.yaml index ba01eb058c05..605dc0c1585a 100755 --- a/packages/image_picker/image_picker_android/pubspec.yaml +++ b/packages/image_picker/image_picker_android/pubspec.yaml @@ -2,11 +2,11 @@ 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.12+12 +version: 0.8.12+17 environment: - sdk: ^3.4.0 - flutter: ">=3.22.0" + sdk: ^3.5.0 + flutter: ">=3.24.0" flutter: plugin: @@ -26,8 +26,8 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - mockito: 5.4.4 - pigeon: ^17.0.0 + mockito: ^5.4.4 + pigeon: ^22.4.1 topics: - camera diff --git a/packages/image_picker/image_picker_android/test/image_picker_android_test.dart b/packages/image_picker/image_picker_android/test/image_picker_android_test.dart index 172b135ac0ac..75dc312226b7 100644 --- a/packages/image_picker/image_picker_android/test/image_picker_android_test.dart +++ b/packages/image_picker/image_picker_android/test/image_picker_android_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 'package:flutter/src/services/binary_messenger.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:image_picker_android/image_picker_android.dart'; @@ -966,7 +967,7 @@ class _FakeImagePickerApi implements ImagePickerApi { _LastPickType? lastCall; @override - Future> pickImages( + Future> pickImages( SourceSpecification source, ImageSelectionOptions options, GeneralOptions generalOptions, @@ -977,11 +978,11 @@ class _FakeImagePickerApi implements ImagePickerApi { passedAllowMultiple = generalOptions.allowMultiple; passedPhotoPickerFlag = generalOptions.usePhotoPicker; limit = generalOptions.limit; - return returnValue as List? ?? []; + return returnValue as List? ?? []; } @override - Future> pickMedia( + Future> pickMedia( MediaSelectionOptions options, GeneralOptions generalOptions, ) async { @@ -990,11 +991,11 @@ class _FakeImagePickerApi implements ImagePickerApi { passedPhotoPickerFlag = generalOptions.usePhotoPicker; passedAllowMultiple = generalOptions.allowMultiple; limit = generalOptions.limit; - return returnValue as List? ?? []; + return returnValue as List? ?? []; } @override - Future> pickVideos( + Future> pickVideos( SourceSpecification source, VideoSelectionOptions options, GeneralOptions generalOptions, @@ -1004,11 +1005,19 @@ class _FakeImagePickerApi implements ImagePickerApi { passedVideoOptions = options; passedAllowMultiple = generalOptions.allowMultiple; passedPhotoPickerFlag = generalOptions.usePhotoPicker; - return returnValue as List? ?? []; + return returnValue as List? ?? []; } @override Future retrieveLostResults() async { return returnValue as CacheRetrievalResult?; } + + @override + // ignore: non_constant_identifier_names + BinaryMessenger? get pigeonVar_binaryMessenger => null; + + @override + // ignore: non_constant_identifier_names + String get pigeonVar_messageChannelSuffix => ''; } diff --git a/packages/image_picker/image_picker_android/test/test_api.g.dart b/packages/image_picker/image_picker_android/test/test_api.g.dart index 52aefcd0faab..4343c4958436 100644 --- a/packages/image_picker/image_picker_android/test/test_api.g.dart +++ b/packages/image_picker/image_picker_android/test/test_api.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 (v17.0.0), do not edit directly. +// Autogenerated from Pigeon (v22.4.1), 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, unnecessary_import, no_leading_underscores_for_local_identifiers // ignore_for_file: avoid_relative_lib_imports @@ -13,30 +13,42 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:image_picker_android/src/messages.g.dart'; -class _TestHostImagePickerApiCodec extends StandardMessageCodec { - const _TestHostImagePickerApiCodec(); +class _PigeonCodec extends StandardMessageCodec { + const _PigeonCodec(); @override void writeValue(WriteBuffer buffer, Object? value) { - if (value is CacheRetrievalError) { - buffer.putUint8(128); - writeValue(buffer, value.encode()); - } else if (value is CacheRetrievalResult) { + if (value is int) { + buffer.putUint8(4); + buffer.putInt64(value); + } else if (value is SourceCamera) { buffer.putUint8(129); - writeValue(buffer, value.encode()); - } else if (value is GeneralOptions) { + writeValue(buffer, value.index); + } else if (value is SourceType) { buffer.putUint8(130); + writeValue(buffer, value.index); + } else if (value is CacheRetrievalType) { + buffer.putUint8(131); + writeValue(buffer, value.index); + } else if (value is GeneralOptions) { + buffer.putUint8(132); writeValue(buffer, value.encode()); } else if (value is ImageSelectionOptions) { - buffer.putUint8(131); + buffer.putUint8(133); writeValue(buffer, value.encode()); } else if (value is MediaSelectionOptions) { - buffer.putUint8(132); + buffer.putUint8(134); + writeValue(buffer, value.encode()); + } else if (value is VideoSelectionOptions) { + buffer.putUint8(135); writeValue(buffer, value.encode()); } else if (value is SourceSpecification) { - buffer.putUint8(133); + buffer.putUint8(136); writeValue(buffer, value.encode()); - } else if (value is VideoSelectionOptions) { - buffer.putUint8(134); + } else if (value is CacheRetrievalError) { + buffer.putUint8(137); + writeValue(buffer, value.encode()); + } else if (value is CacheRetrievalResult) { + buffer.putUint8(138); writeValue(buffer, value.encode()); } else { super.writeValue(buffer, value); @@ -46,20 +58,29 @@ class _TestHostImagePickerApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: - return CacheRetrievalError.decode(readValue(buffer)!); case 129: - return CacheRetrievalResult.decode(readValue(buffer)!); + final int? value = readValue(buffer) as int?; + return value == null ? null : SourceCamera.values[value]; case 130: - return GeneralOptions.decode(readValue(buffer)!); + final int? value = readValue(buffer) as int?; + return value == null ? null : SourceType.values[value]; case 131: - return ImageSelectionOptions.decode(readValue(buffer)!); + final int? value = readValue(buffer) as int?; + return value == null ? null : CacheRetrievalType.values[value]; case 132: - return MediaSelectionOptions.decode(readValue(buffer)!); + return GeneralOptions.decode(readValue(buffer)!); case 133: - return SourceSpecification.decode(readValue(buffer)!); + return ImageSelectionOptions.decode(readValue(buffer)!); case 134: + return MediaSelectionOptions.decode(readValue(buffer)!); + case 135: return VideoSelectionOptions.decode(readValue(buffer)!); + case 136: + return SourceSpecification.decode(readValue(buffer)!); + case 137: + return CacheRetrievalError.decode(readValue(buffer)!); + case 138: + return CacheRetrievalResult.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); } @@ -69,47 +90,43 @@ class _TestHostImagePickerApiCodec extends StandardMessageCodec { abstract class TestHostImagePickerApi { static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; - static const MessageCodec pigeonChannelCodec = - _TestHostImagePickerApiCodec(); + static const MessageCodec pigeonChannelCodec = _PigeonCodec(); /// Selects images and returns their paths. - /// - /// Elements must not be null, by convention. See - /// https://github.com/flutter/flutter/issues/97848 - Future> pickImages(SourceSpecification source, + Future> pickImages(SourceSpecification source, ImageSelectionOptions options, GeneralOptions generalOptions); /// Selects video and returns their paths. - /// - /// Elements must not be null, by convention. See - /// https://github.com/flutter/flutter/issues/97848 - Future> pickVideos(SourceSpecification source, + Future> pickVideos(SourceSpecification source, VideoSelectionOptions options, GeneralOptions generalOptions); /// Selects images and videos and returns their paths. - /// - /// Elements must not be null, by convention. See - /// https://github.com/flutter/flutter/issues/97848 - Future> pickMedia(MediaSelectionOptions mediaSelectionOptions, + Future> pickMedia(MediaSelectionOptions mediaSelectionOptions, GeneralOptions generalOptions); /// Returns results from a previous app session, if any. CacheRetrievalResult? retrieveLostResults(); - static void setup(TestHostImagePickerApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setUp( + TestHostImagePickerApi? api, { + BinaryMessenger? binaryMessenger, + String messageChannelSuffix = '', + }) { + messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.image_picker_android.ImagePickerApi.pickImages', + 'dev.flutter.pigeon.image_picker_android.ImagePickerApi.pickImages$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.image_picker_android.ImagePickerApi.pickImages was null.'); @@ -127,7 +144,7 @@ abstract class TestHostImagePickerApi { assert(arg_generalOptions != null, 'Argument for dev.flutter.pigeon.image_picker_android.ImagePickerApi.pickImages was null, expected non-null GeneralOptions.'); try { - final List output = await api.pickImages( + final List output = await api.pickImages( arg_source!, arg_options!, arg_generalOptions!); return [output]; } on PlatformException catch (e) { @@ -140,17 +157,18 @@ abstract class TestHostImagePickerApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.image_picker_android.ImagePickerApi.pickVideos', + 'dev.flutter.pigeon.image_picker_android.ImagePickerApi.pickVideos$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.image_picker_android.ImagePickerApi.pickVideos was null.'); @@ -168,7 +186,7 @@ abstract class TestHostImagePickerApi { assert(arg_generalOptions != null, 'Argument for dev.flutter.pigeon.image_picker_android.ImagePickerApi.pickVideos was null, expected non-null GeneralOptions.'); try { - final List output = await api.pickVideos( + final List output = await api.pickVideos( arg_source!, arg_options!, arg_generalOptions!); return [output]; } on PlatformException catch (e) { @@ -181,17 +199,18 @@ abstract class TestHostImagePickerApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.image_picker_android.ImagePickerApi.pickMedia', + 'dev.flutter.pigeon.image_picker_android.ImagePickerApi.pickMedia$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.image_picker_android.ImagePickerApi.pickMedia was null.'); @@ -205,7 +224,7 @@ abstract class TestHostImagePickerApi { assert(arg_generalOptions != null, 'Argument for dev.flutter.pigeon.image_picker_android.ImagePickerApi.pickMedia was null, expected non-null GeneralOptions.'); try { - final List output = await api.pickMedia( + final List output = await api.pickMedia( arg_mediaSelectionOptions!, arg_generalOptions!); return [output]; } on PlatformException catch (e) { @@ -218,17 +237,18 @@ abstract class TestHostImagePickerApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.image_picker_android.ImagePickerApi.retrieveLostResults', + 'dev.flutter.pigeon.image_picker_android.ImagePickerApi.retrieveLostResults$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { try { final CacheRetrievalResult? output = api.retrieveLostResults(); diff --git a/packages/image_picker/image_picker_for_web/CHANGELOG.md b/packages/image_picker/image_picker_for_web/CHANGELOG.md index aeb37a216403..8770e322a3dc 100644 --- a/packages/image_picker/image_picker_for_web/CHANGELOG.md +++ b/packages/image_picker/image_picker_for_web/CHANGELOG.md @@ -1,6 +1,7 @@ -## NEXT +## 3.0.6 * Updates minimum supported SDK version to Flutter 3.22/Dart 3.4. +* Extends the `mime` package version constraint from `^1.0.4` to `>=1.0.4 <3.0.0`. ## 3.0.5 diff --git a/packages/image_picker/image_picker_for_web/pubspec.yaml b/packages/image_picker/image_picker_for_web/pubspec.yaml index af3cf9f92e87..89ccc2337762 100644 --- a/packages/image_picker/image_picker_for_web/pubspec.yaml +++ b/packages/image_picker/image_picker_for_web/pubspec.yaml @@ -2,7 +2,7 @@ name: image_picker_for_web description: Web platform implementation of image_picker repository: https://github.com/flutter/packages/tree/main/packages/image_picker/image_picker_for_web issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+image_picker%22 -version: 3.0.5 +version: 3.0.6 environment: sdk: ^3.4.0 @@ -22,7 +22,7 @@ dependencies: flutter_web_plugins: sdk: flutter image_picker_platform_interface: ^2.9.0 - mime: ^1.0.4 + mime: ">=1.0.4 <3.0.0" web: ">=0.5.1 <2.0.0" dev_dependencies: diff --git a/packages/image_picker/image_picker_ios/CHANGELOG.md b/packages/image_picker/image_picker_ios/CHANGELOG.md index 9fed2bfe128b..f31aa5c36662 100644 --- a/packages/image_picker/image_picker_ios/CHANGELOG.md +++ b/packages/image_picker/image_picker_ios/CHANGELOG.md @@ -1,5 +1,6 @@ -## NEXT +## 0.8.12+1 +* Updates Pigeon for non-nullable collection type support. * Updates UI test photo element query for iOS 18. ## 0.8.12 diff --git a/packages/image_picker/image_picker_ios/example/pubspec.yaml b/packages/image_picker/image_picker_ios/example/pubspec.yaml index 57c9e2d83fc4..dbfe54d4420f 100755 --- a/packages/image_picker/image_picker_ios/example/pubspec.yaml +++ b/packages/image_picker/image_picker_ios/example/pubspec.yaml @@ -17,7 +17,7 @@ dependencies: # the parent directory to use the current plugin's version. path: ../ image_picker_platform_interface: ^2.10.0 - mime: ^1.0.4 + mime: ^2.0.0 video_player: ^2.1.4 dev_dependencies: diff --git a/packages/image_picker/image_picker_ios/ios/image_picker_ios/Sources/image_picker_ios/include/image_picker_ios/messages.g.h b/packages/image_picker/image_picker_ios/ios/image_picker_ios/Sources/image_picker_ios/include/image_picker_ios/messages.g.h index de9a8200b82f..ccf843795064 100644 --- a/packages/image_picker/image_picker_ios/ios/image_picker_ios/Sources/image_picker_ios/include/image_picker_ios/messages.g.h +++ b/packages/image_picker/image_picker_ios/ios/image_picker_ios/Sources/image_picker_ios/include/image_picker_ios/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 (v17.0.0), do not edit directly. +// Autogenerated from Pigeon (v22.4.1), do not edit directly. // See also: https://pub.dev/packages/pigeon #import @@ -68,8 +68,8 @@ typedef NS_ENUM(NSUInteger, FLTSourceType) { @property(nonatomic, assign) FLTSourceCamera camera; @end -/// The codec used by FLTImagePickerApi. -NSObject *FLTImagePickerApiGetCodec(void); +/// The codec used by all APIs. +NSObject *FLTGetMessagesCodec(void); @protocol FLTImagePickerApi - (void)pickImageWithSource:(FLTSourceSpecification *)source @@ -95,4 +95,8 @@ NSObject *FLTImagePickerApiGetCodec(void); extern void SetUpFLTImagePickerApi(id binaryMessenger, NSObject *_Nullable api); +extern void SetUpFLTImagePickerApiWithSuffix(id binaryMessenger, + NSObject *_Nullable api, + NSString *messageChannelSuffix); + NS_ASSUME_NONNULL_END diff --git a/packages/image_picker/image_picker_ios/ios/image_picker_ios/Sources/image_picker_ios/messages.g.m b/packages/image_picker/image_picker_ios/ios/image_picker_ios/Sources/image_picker_ios/messages.g.m index 0588aa932665..f2d8395cafff 100644 --- a/packages/image_picker/image_picker_ios/ios/image_picker_ios/Sources/image_picker_ios/messages.g.m +++ b/packages/image_picker/image_picker_ios/ios/image_picker_ios/Sources/image_picker_ios/messages.g.m @@ -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 (v17.0.0), do not edit directly. +// Autogenerated from Pigeon (v22.4.1), do not edit directly. // See also: https://pub.dev/packages/pigeon #import "./include/image_picker_ios/messages.g.h" @@ -16,7 +16,7 @@ #error File requires ARC to be enabled. #endif -static NSArray *wrapResult(id result, FlutterError *error) { +static NSArray *wrapResult(id result, FlutterError *error) { if (error) { return @[ error.code ?: [NSNull null], error.message ?: [NSNull null], error.details ?: [NSNull null] @@ -25,7 +25,7 @@ return @[ result ?: [NSNull null] ]; } -static id GetNullableObjectAtIndex(NSArray *array, NSInteger key) { +static id GetNullableObjectAtIndex(NSArray *array, NSInteger key) { id result = array[key]; return (result == [NSNull null]) ? nil : result; } @@ -51,21 +51,21 @@ - (instancetype)initWithValue:(FLTSourceType)value { @end @interface FLTMaxSize () -+ (FLTMaxSize *)fromList:(NSArray *)list; -+ (nullable FLTMaxSize *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; ++ (FLTMaxSize *)fromList:(NSArray *)list; ++ (nullable FLTMaxSize *)nullableFromList:(NSArray *)list; +- (NSArray *)toList; @end @interface FLTMediaSelectionOptions () -+ (FLTMediaSelectionOptions *)fromList:(NSArray *)list; -+ (nullable FLTMediaSelectionOptions *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; ++ (FLTMediaSelectionOptions *)fromList:(NSArray *)list; ++ (nullable FLTMediaSelectionOptions *)nullableFromList:(NSArray *)list; +- (NSArray *)toList; @end @interface FLTSourceSpecification () -+ (FLTSourceSpecification *)fromList:(NSArray *)list; -+ (nullable FLTSourceSpecification *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; ++ (FLTSourceSpecification *)fromList:(NSArray *)list; ++ (nullable FLTSourceSpecification *)nullableFromList:(NSArray *)list; +- (NSArray *)toList; @end @implementation FLTMaxSize @@ -75,16 +75,16 @@ + (instancetype)makeWithWidth:(nullable NSNumber *)width height:(nullable NSNumb pigeonResult.height = height; return pigeonResult; } -+ (FLTMaxSize *)fromList:(NSArray *)list { ++ (FLTMaxSize *)fromList:(NSArray *)list { FLTMaxSize *pigeonResult = [[FLTMaxSize alloc] init]; pigeonResult.width = GetNullableObjectAtIndex(list, 0); pigeonResult.height = GetNullableObjectAtIndex(list, 1); return pigeonResult; } -+ (nullable FLTMaxSize *)nullableFromList:(NSArray *)list { ++ (nullable FLTMaxSize *)nullableFromList:(NSArray *)list { return (list) ? [FLTMaxSize fromList:list] : nil; } -- (NSArray *)toList { +- (NSArray *)toList { return @[ self.width ?: [NSNull null], self.height ?: [NSNull null], @@ -106,21 +106,21 @@ + (instancetype)makeWithMaxSize:(FLTMaxSize *)maxSize pigeonResult.limit = limit; return pigeonResult; } -+ (FLTMediaSelectionOptions *)fromList:(NSArray *)list { ++ (FLTMediaSelectionOptions *)fromList:(NSArray *)list { FLTMediaSelectionOptions *pigeonResult = [[FLTMediaSelectionOptions alloc] init]; - pigeonResult.maxSize = [FLTMaxSize nullableFromList:(GetNullableObjectAtIndex(list, 0))]; + pigeonResult.maxSize = GetNullableObjectAtIndex(list, 0); pigeonResult.imageQuality = GetNullableObjectAtIndex(list, 1); pigeonResult.requestFullMetadata = [GetNullableObjectAtIndex(list, 2) boolValue]; pigeonResult.allowMultiple = [GetNullableObjectAtIndex(list, 3) boolValue]; pigeonResult.limit = GetNullableObjectAtIndex(list, 4); return pigeonResult; } -+ (nullable FLTMediaSelectionOptions *)nullableFromList:(NSArray *)list { ++ (nullable FLTMediaSelectionOptions *)nullableFromList:(NSArray *)list { return (list) ? [FLTMediaSelectionOptions fromList:list] : nil; } -- (NSArray *)toList { +- (NSArray *)toList { return @[ - (self.maxSize ? [self.maxSize toList] : [NSNull null]), + self.maxSize ?: [NSNull null], self.imageQuality ?: [NSNull null], @(self.requestFullMetadata), @(self.allowMultiple), @@ -136,33 +136,47 @@ + (instancetype)makeWithType:(FLTSourceType)type camera:(FLTSourceCamera)camera pigeonResult.camera = camera; return pigeonResult; } -+ (FLTSourceSpecification *)fromList:(NSArray *)list { ++ (FLTSourceSpecification *)fromList:(NSArray *)list { FLTSourceSpecification *pigeonResult = [[FLTSourceSpecification alloc] init]; - pigeonResult.type = [GetNullableObjectAtIndex(list, 0) integerValue]; - pigeonResult.camera = [GetNullableObjectAtIndex(list, 1) integerValue]; + FLTSourceTypeBox *boxedFLTSourceType = GetNullableObjectAtIndex(list, 0); + pigeonResult.type = boxedFLTSourceType.value; + FLTSourceCameraBox *boxedFLTSourceCamera = GetNullableObjectAtIndex(list, 1); + pigeonResult.camera = boxedFLTSourceCamera.value; return pigeonResult; } -+ (nullable FLTSourceSpecification *)nullableFromList:(NSArray *)list { ++ (nullable FLTSourceSpecification *)nullableFromList:(NSArray *)list { return (list) ? [FLTSourceSpecification fromList:list] : nil; } -- (NSArray *)toList { +- (NSArray *)toList { return @[ - @(self.type), - @(self.camera), + [[FLTSourceTypeBox alloc] initWithValue:self.type], + [[FLTSourceCameraBox alloc] initWithValue:self.camera], ]; } @end -@interface FLTImagePickerApiCodecReader : FlutterStandardReader +@interface FLTMessagesPigeonCodecReader : FlutterStandardReader @end -@implementation FLTImagePickerApiCodecReader +@implementation FLTMessagesPigeonCodecReader - (nullable id)readValueOfType:(UInt8)type { switch (type) { - case 128: + case 129: { + NSNumber *enumAsNumber = [self readValue]; + return enumAsNumber == nil + ? nil + : [[FLTSourceCameraBox alloc] initWithValue:[enumAsNumber integerValue]]; + } + case 130: { + NSNumber *enumAsNumber = [self readValue]; + return enumAsNumber == nil + ? nil + : [[FLTSourceTypeBox alloc] initWithValue:[enumAsNumber integerValue]]; + } + case 131: return [FLTMaxSize fromList:[self readValue]]; - case 129: + case 132: return [FLTMediaSelectionOptions fromList:[self readValue]]; - case 130: + case 133: return [FLTSourceSpecification fromList:[self readValue]]; default: return [super readValueOfType:type]; @@ -170,18 +184,26 @@ - (nullable id)readValueOfType:(UInt8)type { } @end -@interface FLTImagePickerApiCodecWriter : FlutterStandardWriter +@interface FLTMessagesPigeonCodecWriter : FlutterStandardWriter @end -@implementation FLTImagePickerApiCodecWriter +@implementation FLTMessagesPigeonCodecWriter - (void)writeValue:(id)value { - if ([value isKindOfClass:[FLTMaxSize class]]) { - [self writeByte:128]; + if ([value isKindOfClass:[FLTSourceCameraBox class]]) { + FLTSourceCameraBox *box = (FLTSourceCameraBox *)value; + [self writeByte:129]; + [self writeValue:(value == nil ? [NSNull null] : [NSNumber numberWithInteger:box.value])]; + } else if ([value isKindOfClass:[FLTSourceTypeBox class]]) { + FLTSourceTypeBox *box = (FLTSourceTypeBox *)value; + [self writeByte:130]; + [self writeValue:(value == nil ? [NSNull null] : [NSNumber numberWithInteger:box.value])]; + } else if ([value isKindOfClass:[FLTMaxSize class]]) { + [self writeByte:131]; [self writeValue:[value toList]]; } else if ([value isKindOfClass:[FLTMediaSelectionOptions class]]) { - [self writeByte:129]; + [self writeByte:132]; [self writeValue:[value toList]]; } else if ([value isKindOfClass:[FLTSourceSpecification class]]) { - [self writeByte:130]; + [self writeByte:133]; [self writeValue:[value toList]]; } else { [super writeValue:value]; @@ -189,35 +211,47 @@ - (void)writeValue:(id)value { } @end -@interface FLTImagePickerApiCodecReaderWriter : FlutterStandardReaderWriter +@interface FLTMessagesPigeonCodecReaderWriter : FlutterStandardReaderWriter @end -@implementation FLTImagePickerApiCodecReaderWriter +@implementation FLTMessagesPigeonCodecReaderWriter - (FlutterStandardWriter *)writerWithData:(NSMutableData *)data { - return [[FLTImagePickerApiCodecWriter alloc] initWithData:data]; + return [[FLTMessagesPigeonCodecWriter alloc] initWithData:data]; } - (FlutterStandardReader *)readerWithData:(NSData *)data { - return [[FLTImagePickerApiCodecReader alloc] initWithData:data]; + return [[FLTMessagesPigeonCodecReader alloc] initWithData:data]; } @end -NSObject *FLTImagePickerApiGetCodec(void) { +NSObject *FLTGetMessagesCodec(void) { static FlutterStandardMessageCodec *sSharedObject = nil; static dispatch_once_t sPred = 0; dispatch_once(&sPred, ^{ - FLTImagePickerApiCodecReaderWriter *readerWriter = - [[FLTImagePickerApiCodecReaderWriter alloc] init]; + FLTMessagesPigeonCodecReaderWriter *readerWriter = + [[FLTMessagesPigeonCodecReaderWriter alloc] init]; sSharedObject = [FlutterStandardMessageCodec codecWithReaderWriter:readerWriter]; }); return sSharedObject; } - void SetUpFLTImagePickerApi(id binaryMessenger, NSObject *api) { + SetUpFLTImagePickerApiWithSuffix(binaryMessenger, api, @""); +} + +void SetUpFLTImagePickerApiWithSuffix(id binaryMessenger, + NSObject *api, + NSString *messageChannelSuffix) { + messageChannelSuffix = messageChannelSuffix.length > 0 + ? [NSString stringWithFormat:@".%@", messageChannelSuffix] + : @""; { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.image_picker_ios.ImagePickerApi.pickImage" + initWithName: + [NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.image_picker_ios.ImagePickerApi.pickImage", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTImagePickerApiGetCodec()]; + codec:FLTGetMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector (pickImageWithSource:maxSize:quality:fullMetadata:completion:)], @@ -225,7 +259,7 @@ void SetUpFLTImagePickerApi(id binaryMessenger, @"@selector(pickImageWithSource:maxSize:quality:fullMetadata:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; FLTSourceSpecification *arg_source = GetNullableObjectAtIndex(args, 0); FLTMaxSize *arg_maxSize = GetNullableObjectAtIndex(args, 1); NSNumber *arg_imageQuality = GetNullableObjectAtIndex(args, 2); @@ -244,9 +278,12 @@ void SetUpFLTImagePickerApi(id binaryMessenger, } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.image_picker_ios.ImagePickerApi.pickMultiImage" + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.image_picker_ios." + @"ImagePickerApi.pickMultiImage", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTImagePickerApiGetCodec()]; + codec:FLTGetMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector (pickMultiImageWithMaxSize:quality:fullMetadata:limit:completion:)], @@ -254,7 +291,7 @@ void SetUpFLTImagePickerApi(id binaryMessenger, @"@selector(pickMultiImageWithMaxSize:quality:fullMetadata:limit:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; FLTMaxSize *arg_maxSize = GetNullableObjectAtIndex(args, 0); NSNumber *arg_imageQuality = GetNullableObjectAtIndex(args, 1); BOOL arg_requestFullMetadata = [GetNullableObjectAtIndex(args, 2) boolValue]; @@ -274,16 +311,20 @@ void SetUpFLTImagePickerApi(id binaryMessenger, } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.image_picker_ios.ImagePickerApi.pickVideo" + initWithName: + [NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.image_picker_ios.ImagePickerApi.pickVideo", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTImagePickerApiGetCodec()]; + codec:FLTGetMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(pickVideoWithSource:maxDuration:completion:)], @"FLTImagePickerApi api (%@) doesn't respond to " @"@selector(pickVideoWithSource:maxDuration:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; FLTSourceSpecification *arg_source = GetNullableObjectAtIndex(args, 0); NSNumber *arg_maxDurationSeconds = GetNullableObjectAtIndex(args, 1); [api pickVideoWithSource:arg_source @@ -299,16 +340,20 @@ void SetUpFLTImagePickerApi(id binaryMessenger, /// Selects images and videos and returns their paths. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.image_picker_ios.ImagePickerApi.pickMedia" + initWithName: + [NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.image_picker_ios.ImagePickerApi.pickMedia", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTImagePickerApiGetCodec()]; + codec:FLTGetMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(pickMediaWithMediaSelectionOptions:completion:)], @"FLTImagePickerApi api (%@) doesn't respond to " @"@selector(pickMediaWithMediaSelectionOptions:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; FLTMediaSelectionOptions *arg_mediaSelectionOptions = GetNullableObjectAtIndex(args, 0); [api pickMediaWithMediaSelectionOptions:arg_mediaSelectionOptions completion:^(NSArray *_Nullable output, diff --git a/packages/image_picker/image_picker_ios/lib/image_picker_ios.dart b/packages/image_picker/image_picker_ios/lib/image_picker_ios.dart index 96166130797d..ea188cb4ad63 100644 --- a/packages/image_picker/image_picker_ios/lib/image_picker_ios.dart +++ b/packages/image_picker/image_picker_ios/lib/image_picker_ios.dart @@ -88,7 +88,7 @@ class ImagePickerIOS extends ImagePickerPlatform { double? maxHeight, int? imageQuality, }) async { - final List paths = await _pickMultiImageAsPath( + final List paths = await _pickMultiImageAsPath( options: MultiImagePickerOptions( imageOptions: ImageOptions( maxWidth: maxWidth, @@ -103,7 +103,7 @@ class ImagePickerIOS extends ImagePickerPlatform { return null; } - return paths.map((dynamic path) => PickedFile(path as String)).toList(); + return paths.map((String path) => PickedFile(path)).toList(); } @override @@ -138,15 +138,12 @@ class ImagePickerIOS extends ImagePickerPlatform { throw ArgumentError.value(limit, 'limit', 'cannot be lower than 2'); } - // TODO(stuartmorgan): Remove the cast once Pigeon supports non-nullable - // generics, https://github.com/flutter/flutter/issues/97848 - return (await _hostApi.pickMultiImage( + return _hostApi.pickMultiImage( MaxSize(width: maxWidth, height: maxHeight), imageQuality, options.imageOptions.requestFullMetadata, limit, - )) - .cast(); + ); } Future _pickImageAsPath({ diff --git a/packages/image_picker/image_picker_ios/lib/src/messages.g.dart b/packages/image_picker/image_picker_ios/lib/src/messages.g.dart index b3e785a09dff..63a245a1a673 100644 --- a/packages/image_picker/image_picker_ios/lib/src/messages.g.dart +++ b/packages/image_picker/image_picker_ios/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 (v17.0.0), do not edit directly. +// Autogenerated from Pigeon (v22.4.1), 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, no_leading_underscores_for_local_identifiers @@ -86,7 +86,7 @@ class MediaSelectionOptions { Object encode() { return [ - maxSize.encode(), + maxSize, imageQuality, requestFullMetadata, allowMultiple, @@ -97,7 +97,7 @@ class MediaSelectionOptions { static MediaSelectionOptions decode(Object result) { result as List; return MediaSelectionOptions( - maxSize: MaxSize.decode(result[0]! as List), + maxSize: result[0]! as MaxSize, imageQuality: result[1] as int?, requestFullMetadata: result[2]! as bool, allowMultiple: result[3]! as bool, @@ -118,32 +118,41 @@ class SourceSpecification { Object encode() { return [ - type.index, - camera.index, + type, + camera, ]; } static SourceSpecification decode(Object result) { result as List; return SourceSpecification( - type: SourceType.values[result[0]! as int], - camera: SourceCamera.values[result[1]! as int], + type: result[0]! as SourceType, + camera: result[1]! as SourceCamera, ); } } -class _ImagePickerApiCodec extends StandardMessageCodec { - const _ImagePickerApiCodec(); +class _PigeonCodec extends StandardMessageCodec { + const _PigeonCodec(); @override void writeValue(WriteBuffer buffer, Object? value) { - if (value is MaxSize) { - buffer.putUint8(128); + if (value is int) { + buffer.putUint8(4); + buffer.putInt64(value); + } else if (value is SourceCamera) { + buffer.putUint8(129); + writeValue(buffer, value.index); + } else if (value is SourceType) { + buffer.putUint8(130); + writeValue(buffer, value.index); + } else if (value is MaxSize) { + buffer.putUint8(131); writeValue(buffer, value.encode()); } else if (value is MediaSelectionOptions) { - buffer.putUint8(129); + buffer.putUint8(132); writeValue(buffer, value.encode()); } else if (value is SourceSpecification) { - buffer.putUint8(130); + buffer.putUint8(133); writeValue(buffer, value.encode()); } else { super.writeValue(buffer, value); @@ -153,11 +162,17 @@ class _ImagePickerApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: - return MaxSize.decode(readValue(buffer)!); case 129: - return MediaSelectionOptions.decode(readValue(buffer)!); + final int? value = readValue(buffer) as int?; + return value == null ? null : SourceCamera.values[value]; case 130: + final int? value = readValue(buffer) as int?; + return value == null ? null : SourceType.values[value]; + case 131: + return MaxSize.decode(readValue(buffer)!); + case 132: + return MediaSelectionOptions.decode(readValue(buffer)!); + case 133: return SourceSpecification.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -169,123 +184,127 @@ class ImagePickerApi { /// Constructor for [ImagePickerApi]. The [binaryMessenger] named argument is /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. - ImagePickerApi({BinaryMessenger? binaryMessenger}) - : __pigeon_binaryMessenger = binaryMessenger; - final BinaryMessenger? __pigeon_binaryMessenger; + ImagePickerApi( + {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) + : pigeonVar_binaryMessenger = binaryMessenger, + pigeonVar_messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + final BinaryMessenger? pigeonVar_binaryMessenger; + + static const MessageCodec pigeonChannelCodec = _PigeonCodec(); - static const MessageCodec pigeonChannelCodec = - _ImagePickerApiCodec(); + final String pigeonVar_messageChannelSuffix; Future pickImage(SourceSpecification source, MaxSize maxSize, int? imageQuality, bool requestFullMetadata) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.image_picker_ios.ImagePickerApi.pickImage'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.image_picker_ios.ImagePickerApi.pickImage$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel + final List? pigeonVar_replyList = await pigeonVar_channel .send([source, maxSize, imageQuality, requestFullMetadata]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { - return (__pigeon_replyList[0] as String?); + return (pigeonVar_replyList[0] as String?); } } - Future> pickMultiImage(MaxSize maxSize, int? imageQuality, + Future> pickMultiImage(MaxSize maxSize, int? imageQuality, bool requestFullMetadata, int? limit) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.image_picker_ios.ImagePickerApi.pickMultiImage'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.image_picker_ios.ImagePickerApi.pickMultiImage$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel + final List? pigeonVar_replyList = await pigeonVar_channel .send([maxSize, imageQuality, requestFullMetadata, limit]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as List?)!.cast(); + return (pigeonVar_replyList[0] as List?)!.cast(); } } Future pickVideo( SourceSpecification source, int? maxDurationSeconds) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.image_picker_ios.ImagePickerApi.pickVideo'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.image_picker_ios.ImagePickerApi.pickVideo$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel + final List? pigeonVar_replyList = await pigeonVar_channel .send([source, maxDurationSeconds]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { - return (__pigeon_replyList[0] as String?); + return (pigeonVar_replyList[0] as String?); } } /// Selects images and videos and returns their paths. - Future> pickMedia( + Future> pickMedia( MediaSelectionOptions mediaSelectionOptions) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.image_picker_ios.ImagePickerApi.pickMedia'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.image_picker_ios.ImagePickerApi.pickMedia$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel + final List? pigeonVar_replyList = await pigeonVar_channel .send([mediaSelectionOptions]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as List?)!.cast(); + return (pigeonVar_replyList[0] as List?)!.cast(); } } } diff --git a/packages/image_picker/image_picker_ios/pigeons/messages.dart b/packages/image_picker/image_picker_ios/pigeons/messages.dart index 4a31ae0b6c32..c8dd34fa5697 100644 --- a/packages/image_picker/image_picker_ios/pigeons/messages.dart +++ b/packages/image_picker/image_picker_ios/pigeons/messages.dart @@ -58,7 +58,7 @@ abstract class ImagePickerApi { int? imageQuality, bool requestFullMetadata); @async @ObjCSelector('pickMultiImageWithMaxSize:quality:fullMetadata:limit:') - List pickMultiImage( + List pickMultiImage( MaxSize maxSize, int? imageQuality, bool requestFullMetadata, int? limit); @async @ObjCSelector('pickVideoWithSource:maxDuration:') @@ -67,5 +67,5 @@ abstract class ImagePickerApi { /// Selects images and videos and returns their paths. @async @ObjCSelector('pickMediaWithMediaSelectionOptions:') - List pickMedia(MediaSelectionOptions mediaSelectionOptions); + List pickMedia(MediaSelectionOptions mediaSelectionOptions); } diff --git a/packages/image_picker/image_picker_ios/pubspec.yaml b/packages/image_picker/image_picker_ios/pubspec.yaml index bbc99bc79f31..a1f752f33bce 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.12 +version: 0.8.12+1 environment: sdk: ^3.3.0 @@ -24,11 +24,11 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - mockito: 5.4.4 - pigeon: ^17.0.0 + mockito: ^5.4.4 + pigeon: ^22.4.1 topics: - camera - image-picker - files - - file-selection \ No newline at end of file + - file-selection diff --git a/packages/image_picker/image_picker_ios/test/image_picker_ios_test.dart b/packages/image_picker/image_picker_ios/test/image_picker_ios_test.dart index c2e5f74763f2..c84b2554301d 100644 --- a/packages/image_picker/image_picker_ios/test/image_picker_ios_test.dart +++ b/packages/image_picker/image_picker_ios/test/image_picker_ios_test.dart @@ -57,7 +57,7 @@ class _ApiLogger implements TestHostImagePickerApi { } @override - Future> pickMultiImage( + Future> pickMultiImage( MaxSize maxSize, int? imageQuality, bool requestFullMetadata, @@ -70,11 +70,11 @@ class _ApiLogger implements TestHostImagePickerApi { 'requestFullMetadata': requestFullMetadata, 'limit': limit, })); - return returnValue as List; + return returnValue as List; } @override - Future> pickMedia( + Future> pickMedia( MediaSelectionOptions mediaSelectionOptions) async { calls.add(_LoggedMethodCall('pickMedia', arguments: { 'maxWidth': mediaSelectionOptions.maxSize.width, @@ -84,7 +84,7 @@ class _ApiLogger implements TestHostImagePickerApi { 'allowMultiple': mediaSelectionOptions.allowMultiple, 'limit': mediaSelectionOptions.limit, })); - return returnValue as List; + return returnValue as List; } @override @@ -107,7 +107,7 @@ void main() { setUp(() { log = _ApiLogger(); - TestHostImagePickerApi.setup(log); + TestHostImagePickerApi.setUp(log); }); test('registration', () async { diff --git a/packages/image_picker/image_picker_ios/test/test_api.g.dart b/packages/image_picker/image_picker_ios/test/test_api.g.dart index 4208c68e32f2..46dc4e4e85d8 100644 --- a/packages/image_picker/image_picker_ios/test/test_api.g.dart +++ b/packages/image_picker/image_picker_ios/test/test_api.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 (v17.0.0), do not edit directly. +// Autogenerated from Pigeon (v22.4.1), 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, unnecessary_import, no_leading_underscores_for_local_identifiers // ignore_for_file: avoid_relative_lib_imports @@ -13,18 +13,27 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:image_picker_ios/src/messages.g.dart'; -class _TestHostImagePickerApiCodec extends StandardMessageCodec { - const _TestHostImagePickerApiCodec(); +class _PigeonCodec extends StandardMessageCodec { + const _PigeonCodec(); @override void writeValue(WriteBuffer buffer, Object? value) { - if (value is MaxSize) { - buffer.putUint8(128); + if (value is int) { + buffer.putUint8(4); + buffer.putInt64(value); + } else if (value is SourceCamera) { + buffer.putUint8(129); + writeValue(buffer, value.index); + } else if (value is SourceType) { + buffer.putUint8(130); + writeValue(buffer, value.index); + } else if (value is MaxSize) { + buffer.putUint8(131); writeValue(buffer, value.encode()); } else if (value is MediaSelectionOptions) { - buffer.putUint8(129); + buffer.putUint8(132); writeValue(buffer, value.encode()); } else if (value is SourceSpecification) { - buffer.putUint8(130); + buffer.putUint8(133); writeValue(buffer, value.encode()); } else { super.writeValue(buffer, value); @@ -34,11 +43,17 @@ class _TestHostImagePickerApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: - return MaxSize.decode(readValue(buffer)!); case 129: - return MediaSelectionOptions.decode(readValue(buffer)!); + final int? value = readValue(buffer) as int?; + return value == null ? null : SourceCamera.values[value]; case 130: + final int? value = readValue(buffer) as int?; + return value == null ? null : SourceType.values[value]; + case 131: + return MaxSize.decode(readValue(buffer)!); + case 132: + return MediaSelectionOptions.decode(readValue(buffer)!); + case 133: return SourceSpecification.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -49,35 +64,40 @@ class _TestHostImagePickerApiCodec extends StandardMessageCodec { abstract class TestHostImagePickerApi { static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; - static const MessageCodec pigeonChannelCodec = - _TestHostImagePickerApiCodec(); + static const MessageCodec pigeonChannelCodec = _PigeonCodec(); Future pickImage(SourceSpecification source, MaxSize maxSize, int? imageQuality, bool requestFullMetadata); - Future> pickMultiImage( + Future> pickMultiImage( MaxSize maxSize, int? imageQuality, bool requestFullMetadata, int? limit); Future pickVideo( SourceSpecification source, int? maxDurationSeconds); /// Selects images and videos and returns their paths. - Future> pickMedia(MediaSelectionOptions mediaSelectionOptions); + Future> pickMedia(MediaSelectionOptions mediaSelectionOptions); - static void setup(TestHostImagePickerApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setUp( + TestHostImagePickerApi? api, { + BinaryMessenger? binaryMessenger, + String messageChannelSuffix = '', + }) { + messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( - 'dev.flutter.pigeon.image_picker_ios.ImagePickerApi.pickImage', - pigeonChannelCodec, - binaryMessenger: binaryMessenger); + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.image_picker_ios.ImagePickerApi.pickImage$messageChannelSuffix', + pigeonChannelCodec, + binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.image_picker_ios.ImagePickerApi.pickImage was null.'); @@ -107,17 +127,18 @@ abstract class TestHostImagePickerApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.image_picker_ios.ImagePickerApi.pickMultiImage', + 'dev.flutter.pigeon.image_picker_ios.ImagePickerApi.pickMultiImage$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.image_picker_ios.ImagePickerApi.pickMultiImage was null.'); @@ -131,7 +152,7 @@ abstract class TestHostImagePickerApi { 'Argument for dev.flutter.pigeon.image_picker_ios.ImagePickerApi.pickMultiImage was null, expected non-null bool.'); final int? arg_limit = (args[3] as int?); try { - final List output = await api.pickMultiImage(arg_maxSize!, + final List output = await api.pickMultiImage(arg_maxSize!, arg_imageQuality, arg_requestFullMetadata!, arg_limit); return [output]; } on PlatformException catch (e) { @@ -144,17 +165,18 @@ abstract class TestHostImagePickerApi { } } { - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( - 'dev.flutter.pigeon.image_picker_ios.ImagePickerApi.pickVideo', - pigeonChannelCodec, - binaryMessenger: binaryMessenger); + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.image_picker_ios.ImagePickerApi.pickVideo$messageChannelSuffix', + pigeonChannelCodec, + binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.image_picker_ios.ImagePickerApi.pickVideo was null.'); @@ -178,17 +200,18 @@ abstract class TestHostImagePickerApi { } } { - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( - 'dev.flutter.pigeon.image_picker_ios.ImagePickerApi.pickMedia', - pigeonChannelCodec, - binaryMessenger: binaryMessenger); + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.image_picker_ios.ImagePickerApi.pickMedia$messageChannelSuffix', + pigeonChannelCodec, + binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.image_picker_ios.ImagePickerApi.pickMedia was null.'); @@ -198,7 +221,7 @@ abstract class TestHostImagePickerApi { assert(arg_mediaSelectionOptions != null, 'Argument for dev.flutter.pigeon.image_picker_ios.ImagePickerApi.pickMedia was null, expected non-null MediaSelectionOptions.'); try { - final List output = + final List output = await api.pickMedia(arg_mediaSelectionOptions!); return [output]; } on PlatformException catch (e) { diff --git a/packages/image_picker/image_picker_linux/example/pubspec.yaml b/packages/image_picker/image_picker_linux/example/pubspec.yaml index 6f1bbca79bd9..5db5fb085f8c 100644 --- a/packages/image_picker/image_picker_linux/example/pubspec.yaml +++ b/packages/image_picker/image_picker_linux/example/pubspec.yaml @@ -18,7 +18,7 @@ dependencies: # the parent directory to use the current plugin's version. path: .. image_picker_platform_interface: ^2.8.0 - mime: ^1.0.4 + mime: ^2.0.0 video_player: ^2.1.4 dev_dependencies: diff --git a/packages/image_picker/image_picker_linux/pubspec.yaml b/packages/image_picker/image_picker_linux/pubspec.yaml index 07b09e5d2951..8e44fac8d48a 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.4 + mockito: ^5.4.4 topics: - image-picker diff --git a/packages/image_picker/image_picker_macos/example/pubspec.yaml b/packages/image_picker/image_picker_macos/example/pubspec.yaml index e7e359d7529a..ab0d82bbc305 100644 --- a/packages/image_picker/image_picker_macos/example/pubspec.yaml +++ b/packages/image_picker/image_picker_macos/example/pubspec.yaml @@ -18,7 +18,7 @@ dependencies: # the parent directory to use the current plugin's version. path: .. image_picker_platform_interface: ^2.8.0 - mime: ^1.0.4 + mime: ^2.0.0 video_player: ^2.1.4 dev_dependencies: diff --git a/packages/image_picker/image_picker_macos/pubspec.yaml b/packages/image_picker/image_picker_macos/pubspec.yaml index 2dbe3c05712f..3b11740e8d86 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.4 + mockito: ^5.4.4 topics: - image-picker diff --git a/packages/image_picker/image_picker_windows/example/pubspec.yaml b/packages/image_picker/image_picker_windows/example/pubspec.yaml index c91f2fb4555e..744a9e61ba0f 100644 --- a/packages/image_picker/image_picker_windows/example/pubspec.yaml +++ b/packages/image_picker/image_picker_windows/example/pubspec.yaml @@ -18,7 +18,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: .. - mime: ^1.0.4 + mime: ^2.0.0 video_player: ^2.1.4 dev_dependencies: diff --git a/packages/image_picker/image_picker_windows/pubspec.yaml b/packages/image_picker/image_picker_windows/pubspec.yaml index 066204e3d56e..51d9a94ee6e4 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.4 + mockito: ^5.4.4 topics: - image-picker 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..d951fac2bf31 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-8.7-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/packages/in_app_purchase/in_app_purchase/example/android/build.gradle b/packages/in_app_purchase/in_app_purchase/example/android/build.gradle index cec92de922cf..0bed8906c094 100644 --- a/packages/in_app_purchase/in_app_purchase/example/android/build.gradle +++ b/packages/in_app_purchase/in_app_purchase/example/android/build.gradle @@ -5,7 +5,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:7.4.2' + classpath 'com.android.tools.build:gradle:8.5.2' } } 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..7aeeb11c6ee5 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-8.7-all.zip diff --git a/packages/in_app_purchase/in_app_purchase_android/CHANGELOG.md b/packages/in_app_purchase/in_app_purchase_android/CHANGELOG.md index 7c363cffc4e8..e3084fe05632 100644 --- a/packages/in_app_purchase/in_app_purchase_android/CHANGELOG.md +++ b/packages/in_app_purchase/in_app_purchase_android/CHANGELOG.md @@ -1,3 +1,24 @@ +## 0.3.6+11 + +* Bumps androidx.annotation:annotation from 1.8.2 to 1.9.0. + +## 0.3.6+10 + +* Updates Pigeon for non-nullable collection type support. + +## 0.3.6+9 + +* Updates Java compatibility version to 11. + +## 0.3.6+8 + +* Removes dependency on org.jetbrains.kotlin:kotlin-bom. +* Updates minimum supported SDK version to Flutter 3.24/Dart 3.5. + +## 0.3.6+7 + +* Sets `android.buildFeatures.buildConfig` to true for compatibility with AGP 8.0+. + ## 0.3.6+6 * Bumps androidx.annotation:annotation from 1.8.1 to 1.8.2. diff --git a/packages/in_app_purchase/in_app_purchase_android/android/build.gradle b/packages/in_app_purchase/in_app_purchase_android/android/build.gradle index 2738b2c768c4..7a790d8d8406 100644 --- a/packages/in_app_purchase/in_app_purchase_android/android/build.gradle +++ b/packages/in_app_purchase/in_app_purchase_android/android/build.gradle @@ -22,10 +22,11 @@ rootProject.allprojects { apply plugin: 'com.android.library' android { - // Conditional for compatibility with AGP <4.2. - if (project.android.hasProperty("namespace")) { - namespace 'io.flutter.plugins.inapppurchase' + buildFeatures { + buildConfig true } + + namespace 'io.flutter.plugins.inapppurchase' compileSdk 34 @@ -39,8 +40,8 @@ android { disable 'AndroidGradlePluginVersion', 'InvalidPackage', 'GradleDependency', 'NewerVersionAvailable' } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_11 + targetCompatibility JavaVersion.VERSION_11 } @@ -58,10 +59,7 @@ android { } dependencies { - implementation 'androidx.annotation:annotation:1.8.2' - // org.jetbrains.kotlin:kotlin-bom artifact purpose is to align kotlin stdlib and related code versions. - // See: https://youtrack.jetbrains.com/issue/KT-55297/kotlin-stdlib-should-declare-constraints-on-kotlin-stdlib-jdk8-and-kotlin-stdlib-jdk7 - implementation(platform("org.jetbrains.kotlin:kotlin-bom:1.8.22")) + implementation 'androidx.annotation:annotation:1.9.0' implementation 'com.android.billingclient:billing:6.2.0' testImplementation 'junit:junit:4.13.2' testImplementation 'org.json:json:20240303' diff --git a/packages/in_app_purchase/in_app_purchase_android/android/src/main/java/io/flutter/plugins/inapppurchase/Messages.java b/packages/in_app_purchase/in_app_purchase_android/android/src/main/java/io/flutter/plugins/inapppurchase/Messages.java index 0602260e72f4..cef3e316c3d6 100644 --- a/packages/in_app_purchase/in_app_purchase_android/android/src/main/java/io/flutter/plugins/inapppurchase/Messages.java +++ b/packages/in_app_purchase/in_app_purchase_android/android/src/main/java/io/flutter/plugins/inapppurchase/Messages.java @@ -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 (v17.3.0), do not edit directly. +// Autogenerated from Pigeon (v22.4.2), do not edit directly. // See also: https://pub.dev/packages/pigeon package io.flutter.plugins.inapppurchase; @@ -23,6 +23,7 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; +import java.util.Objects; /** Generated class from Pigeon. */ @SuppressWarnings({"unused", "unchecked", "CodeBlock2Expr", "RedundantSuppression", "serial"}) @@ -46,7 +47,7 @@ public FlutterError(@NonNull String code, @Nullable String message, @Nullable Ob @NonNull protected static ArrayList wrapError(@NonNull Throwable exception) { - ArrayList errorList = new ArrayList(3); + ArrayList errorList = new ArrayList<>(3); if (exception instanceof FlutterError) { FlutterError error = (FlutterError) exception; errorList.add(error.code); @@ -78,7 +79,7 @@ public enum PlatformProductType { final int index; - private PlatformProductType(final int index) { + PlatformProductType(final int index) { this.index = index; } } @@ -98,7 +99,7 @@ public enum PlatformBillingChoiceMode { final int index; - private PlatformBillingChoiceMode(final int index) { + PlatformBillingChoiceMode(final int index) { this.index = index; } } @@ -111,7 +112,7 @@ public enum PlatformPurchaseState { final int index; - private PlatformPurchaseState(final int index) { + PlatformPurchaseState(final int index) { this.index = index; } } @@ -124,7 +125,7 @@ public enum PlatformRecurrenceMode { final int index; - private PlatformRecurrenceMode(final int index) { + PlatformRecurrenceMode(final int index) { this.index = index; } } @@ -164,6 +165,23 @@ public void setProductType(@NonNull PlatformProductType setterArg) { /** Constructor is non-public to enforce null safety; use Builder. */ PlatformQueryProduct() {} + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlatformQueryProduct that = (PlatformQueryProduct) o; + return productId.equals(that.productId) && productType.equals(that.productType); + } + + @Override + public int hashCode() { + return Objects.hash(productId, productType); + } + public static final class Builder { private @Nullable String productId; @@ -192,18 +210,18 @@ public static final class Builder { @NonNull ArrayList toList() { - ArrayList toListResult = new ArrayList(2); + ArrayList toListResult = new ArrayList<>(2); toListResult.add(productId); - toListResult.add(productType == null ? null : productType.index); + toListResult.add(productType); return toListResult; } - static @NonNull PlatformQueryProduct fromList(@NonNull ArrayList list) { + static @NonNull PlatformQueryProduct fromList(@NonNull ArrayList pigeonVar_list) { PlatformQueryProduct pigeonResult = new PlatformQueryProduct(); - Object productId = list.get(0); + Object productId = pigeonVar_list.get(0); pigeonResult.setProductId((String) productId); - Object productType = list.get(1); - pigeonResult.setProductType(PlatformProductType.values()[(int) productType]); + Object productType = pigeonVar_list.get(1); + pigeonResult.setProductType((PlatformProductType) productType); return pigeonResult; } } @@ -234,6 +252,24 @@ public void setObfuscatedProfileId(@Nullable String setterArg) { this.obfuscatedProfileId = setterArg; } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlatformAccountIdentifiers that = (PlatformAccountIdentifiers) o; + return Objects.equals(obfuscatedAccountId, that.obfuscatedAccountId) + && Objects.equals(obfuscatedProfileId, that.obfuscatedProfileId); + } + + @Override + public int hashCode() { + return Objects.hash(obfuscatedAccountId, obfuscatedProfileId); + } + public static final class Builder { private @Nullable String obfuscatedAccountId; @@ -262,17 +298,17 @@ public static final class Builder { @NonNull ArrayList toList() { - ArrayList toListResult = new ArrayList(2); + ArrayList toListResult = new ArrayList<>(2); toListResult.add(obfuscatedAccountId); toListResult.add(obfuscatedProfileId); return toListResult; } - static @NonNull PlatformAccountIdentifiers fromList(@NonNull ArrayList list) { + static @NonNull PlatformAccountIdentifiers fromList(@NonNull ArrayList pigeonVar_list) { PlatformAccountIdentifiers pigeonResult = new PlatformAccountIdentifiers(); - Object obfuscatedAccountId = list.get(0); + Object obfuscatedAccountId = pigeonVar_list.get(0); pigeonResult.setObfuscatedAccountId((String) obfuscatedAccountId); - Object obfuscatedProfileId = list.get(1); + Object obfuscatedProfileId = pigeonVar_list.get(1); pigeonResult.setObfuscatedProfileId((String) obfuscatedProfileId); return pigeonResult; } @@ -313,6 +349,23 @@ public void setDebugMessage(@NonNull String setterArg) { /** Constructor is non-public to enforce null safety; use Builder. */ PlatformBillingResult() {} + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlatformBillingResult that = (PlatformBillingResult) o; + return responseCode.equals(that.responseCode) && debugMessage.equals(that.debugMessage); + } + + @Override + public int hashCode() { + return Objects.hash(responseCode, debugMessage); + } + public static final class Builder { private @Nullable Long responseCode; @@ -341,20 +394,17 @@ public static final class Builder { @NonNull ArrayList toList() { - ArrayList toListResult = new ArrayList(2); + ArrayList toListResult = new ArrayList<>(2); toListResult.add(responseCode); toListResult.add(debugMessage); return toListResult; } - static @NonNull PlatformBillingResult fromList(@NonNull ArrayList list) { + static @NonNull PlatformBillingResult fromList(@NonNull ArrayList pigeonVar_list) { PlatformBillingResult pigeonResult = new PlatformBillingResult(); - Object responseCode = list.get(0); - pigeonResult.setResponseCode( - (responseCode == null) - ? null - : ((responseCode instanceof Integer) ? (Integer) responseCode : (Long) responseCode)); - Object debugMessage = list.get(1); + Object responseCode = pigeonVar_list.get(0); + pigeonResult.setResponseCode((Long) responseCode); + Object debugMessage = pigeonVar_list.get(1); pigeonResult.setDebugMessage((String) debugMessage); return pigeonResult; } @@ -408,6 +458,25 @@ public void setPriceCurrencyCode(@NonNull String setterArg) { /** Constructor is non-public to enforce null safety; use Builder. */ PlatformOneTimePurchaseOfferDetails() {} + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlatformOneTimePurchaseOfferDetails that = (PlatformOneTimePurchaseOfferDetails) o; + return priceAmountMicros.equals(that.priceAmountMicros) + && formattedPrice.equals(that.formattedPrice) + && priceCurrencyCode.equals(that.priceCurrencyCode); + } + + @Override + public int hashCode() { + return Objects.hash(priceAmountMicros, formattedPrice, priceCurrencyCode); + } + public static final class Builder { private @Nullable Long priceAmountMicros; @@ -446,25 +515,21 @@ public static final class Builder { @NonNull ArrayList toList() { - ArrayList toListResult = new ArrayList(3); + ArrayList toListResult = new ArrayList<>(3); toListResult.add(priceAmountMicros); toListResult.add(formattedPrice); toListResult.add(priceCurrencyCode); return toListResult; } - static @NonNull PlatformOneTimePurchaseOfferDetails fromList(@NonNull ArrayList list) { + static @NonNull PlatformOneTimePurchaseOfferDetails fromList( + @NonNull ArrayList pigeonVar_list) { PlatformOneTimePurchaseOfferDetails pigeonResult = new PlatformOneTimePurchaseOfferDetails(); - Object priceAmountMicros = list.get(0); - pigeonResult.setPriceAmountMicros( - (priceAmountMicros == null) - ? null - : ((priceAmountMicros instanceof Integer) - ? (Integer) priceAmountMicros - : (Long) priceAmountMicros)); - Object formattedPrice = list.get(1); + Object priceAmountMicros = pigeonVar_list.get(0); + pigeonResult.setPriceAmountMicros((Long) priceAmountMicros); + Object formattedPrice = pigeonVar_list.get(1); pigeonResult.setFormattedPrice((String) formattedPrice); - Object priceCurrencyCode = list.get(2); + Object priceCurrencyCode = pigeonVar_list.get(2); pigeonResult.setPriceCurrencyCode((String) priceCurrencyCode); return pigeonResult; } @@ -566,6 +631,36 @@ public void setSubscriptionOfferDetails( /** Constructor is non-public to enforce null safety; use Builder. */ PlatformProductDetails() {} + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlatformProductDetails that = (PlatformProductDetails) o; + return description.equals(that.description) + && name.equals(that.name) + && productId.equals(that.productId) + && productType.equals(that.productType) + && title.equals(that.title) + && Objects.equals(oneTimePurchaseOfferDetails, that.oneTimePurchaseOfferDetails) + && Objects.equals(subscriptionOfferDetails, that.subscriptionOfferDetails); + } + + @Override + public int hashCode() { + return Objects.hash( + description, + name, + productId, + productType, + title, + oneTimePurchaseOfferDetails, + subscriptionOfferDetails); + } + public static final class Builder { private @Nullable String description; @@ -641,37 +736,33 @@ public static final class Builder { @NonNull ArrayList toList() { - ArrayList toListResult = new ArrayList(7); + ArrayList toListResult = new ArrayList<>(7); toListResult.add(description); toListResult.add(name); toListResult.add(productId); - toListResult.add(productType == null ? null : productType.index); + toListResult.add(productType); toListResult.add(title); - toListResult.add( - (oneTimePurchaseOfferDetails == null) ? null : oneTimePurchaseOfferDetails.toList()); + toListResult.add(oneTimePurchaseOfferDetails); toListResult.add(subscriptionOfferDetails); return toListResult; } - static @NonNull PlatformProductDetails fromList(@NonNull ArrayList list) { + static @NonNull PlatformProductDetails fromList(@NonNull ArrayList pigeonVar_list) { PlatformProductDetails pigeonResult = new PlatformProductDetails(); - Object description = list.get(0); + Object description = pigeonVar_list.get(0); pigeonResult.setDescription((String) description); - Object name = list.get(1); + Object name = pigeonVar_list.get(1); pigeonResult.setName((String) name); - Object productId = list.get(2); + Object productId = pigeonVar_list.get(2); pigeonResult.setProductId((String) productId); - Object productType = list.get(3); - pigeonResult.setProductType(PlatformProductType.values()[(int) productType]); - Object title = list.get(4); + Object productType = pigeonVar_list.get(3); + pigeonResult.setProductType((PlatformProductType) productType); + Object title = pigeonVar_list.get(4); pigeonResult.setTitle((String) title); - Object oneTimePurchaseOfferDetails = list.get(5); + Object oneTimePurchaseOfferDetails = pigeonVar_list.get(5); pigeonResult.setOneTimePurchaseOfferDetails( - (oneTimePurchaseOfferDetails == null) - ? null - : PlatformOneTimePurchaseOfferDetails.fromList( - (ArrayList) oneTimePurchaseOfferDetails)); - Object subscriptionOfferDetails = list.get(6); + (PlatformOneTimePurchaseOfferDetails) oneTimePurchaseOfferDetails); + Object subscriptionOfferDetails = pigeonVar_list.get(6); pigeonResult.setSubscriptionOfferDetails( (List) subscriptionOfferDetails); return pigeonResult; @@ -714,6 +805,23 @@ public void setProductDetails(@NonNull List setterArg) { /** Constructor is non-public to enforce null safety; use Builder. */ PlatformProductDetailsResponse() {} + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlatformProductDetailsResponse that = (PlatformProductDetailsResponse) o; + return billingResult.equals(that.billingResult) && productDetails.equals(that.productDetails); + } + + @Override + public int hashCode() { + return Objects.hash(billingResult, productDetails); + } + public static final class Builder { private @Nullable PlatformBillingResult billingResult; @@ -742,20 +850,18 @@ public static final class Builder { @NonNull ArrayList toList() { - ArrayList toListResult = new ArrayList(2); - toListResult.add((billingResult == null) ? null : billingResult.toList()); + ArrayList toListResult = new ArrayList<>(2); + toListResult.add(billingResult); toListResult.add(productDetails); return toListResult; } - static @NonNull PlatformProductDetailsResponse fromList(@NonNull ArrayList list) { + static @NonNull PlatformProductDetailsResponse fromList( + @NonNull ArrayList pigeonVar_list) { PlatformProductDetailsResponse pigeonResult = new PlatformProductDetailsResponse(); - Object billingResult = list.get(0); - pigeonResult.setBillingResult( - (billingResult == null) - ? null - : PlatformBillingResult.fromList((ArrayList) billingResult)); - Object productDetails = list.get(1); + Object billingResult = pigeonVar_list.get(0); + pigeonResult.setBillingResult((PlatformBillingResult) billingResult); + Object productDetails = pigeonVar_list.get(1); pigeonResult.setProductDetails((List) productDetails); return pigeonResult; } @@ -797,6 +903,25 @@ public void setExternalTransactionToken(@NonNull String setterArg) { /** Constructor is non-public to enforce null safety; use Builder. */ PlatformAlternativeBillingOnlyReportingDetailsResponse() {} + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlatformAlternativeBillingOnlyReportingDetailsResponse that = + (PlatformAlternativeBillingOnlyReportingDetailsResponse) o; + return billingResult.equals(that.billingResult) + && externalTransactionToken.equals(that.externalTransactionToken); + } + + @Override + public int hashCode() { + return Objects.hash(billingResult, externalTransactionToken); + } + public static final class Builder { private @Nullable PlatformBillingResult billingResult; @@ -826,22 +951,19 @@ public static final class Builder { @NonNull ArrayList toList() { - ArrayList toListResult = new ArrayList(2); - toListResult.add((billingResult == null) ? null : billingResult.toList()); + ArrayList toListResult = new ArrayList<>(2); + toListResult.add(billingResult); toListResult.add(externalTransactionToken); return toListResult; } static @NonNull PlatformAlternativeBillingOnlyReportingDetailsResponse fromList( - @NonNull ArrayList list) { + @NonNull ArrayList pigeonVar_list) { PlatformAlternativeBillingOnlyReportingDetailsResponse pigeonResult = new PlatformAlternativeBillingOnlyReportingDetailsResponse(); - Object billingResult = list.get(0); - pigeonResult.setBillingResult( - (billingResult == null) - ? null - : PlatformBillingResult.fromList((ArrayList) billingResult)); - Object externalTransactionToken = list.get(1); + Object billingResult = pigeonVar_list.get(0); + pigeonResult.setBillingResult((PlatformBillingResult) billingResult); + Object externalTransactionToken = pigeonVar_list.get(1); pigeonResult.setExternalTransactionToken((String) externalTransactionToken); return pigeonResult; } @@ -883,6 +1005,23 @@ public void setCountryCode(@NonNull String setterArg) { /** Constructor is non-public to enforce null safety; use Builder. */ PlatformBillingConfigResponse() {} + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlatformBillingConfigResponse that = (PlatformBillingConfigResponse) o; + return billingResult.equals(that.billingResult) && countryCode.equals(that.countryCode); + } + + @Override + public int hashCode() { + return Objects.hash(billingResult, countryCode); + } + public static final class Builder { private @Nullable PlatformBillingResult billingResult; @@ -911,20 +1050,18 @@ public static final class Builder { @NonNull ArrayList toList() { - ArrayList toListResult = new ArrayList(2); - toListResult.add((billingResult == null) ? null : billingResult.toList()); + ArrayList toListResult = new ArrayList<>(2); + toListResult.add(billingResult); toListResult.add(countryCode); return toListResult; } - static @NonNull PlatformBillingConfigResponse fromList(@NonNull ArrayList list) { + static @NonNull PlatformBillingConfigResponse fromList( + @NonNull ArrayList pigeonVar_list) { PlatformBillingConfigResponse pigeonResult = new PlatformBillingConfigResponse(); - Object billingResult = list.get(0); - pigeonResult.setBillingResult( - (billingResult == null) - ? null - : PlatformBillingResult.fromList((ArrayList) billingResult)); - Object countryCode = list.get(1); + Object billingResult = pigeonVar_list.get(0); + pigeonResult.setBillingResult((PlatformBillingResult) billingResult); + Object countryCode = pigeonVar_list.get(1); pigeonResult.setCountryCode((String) countryCode); return pigeonResult; } @@ -1028,6 +1165,38 @@ public void setPurchaseToken(@Nullable String setterArg) { /** Constructor is non-public to enforce null safety; use Builder. */ PlatformBillingFlowParams() {} + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlatformBillingFlowParams that = (PlatformBillingFlowParams) o; + return product.equals(that.product) + && prorationMode.equals(that.prorationMode) + && replacementMode.equals(that.replacementMode) + && Objects.equals(offerToken, that.offerToken) + && Objects.equals(accountId, that.accountId) + && Objects.equals(obfuscatedProfileId, that.obfuscatedProfileId) + && Objects.equals(oldProduct, that.oldProduct) + && Objects.equals(purchaseToken, that.purchaseToken); + } + + @Override + public int hashCode() { + return Objects.hash( + product, + prorationMode, + replacementMode, + offerToken, + accountId, + obfuscatedProfileId, + oldProduct, + purchaseToken); + } + public static final class Builder { private @Nullable String product; @@ -1110,7 +1279,7 @@ public static final class Builder { @NonNull ArrayList toList() { - ArrayList toListResult = new ArrayList(8); + ArrayList toListResult = new ArrayList<>(8); toListResult.add(product); toListResult.add(prorationMode); toListResult.add(replacementMode); @@ -1122,33 +1291,23 @@ ArrayList toList() { return toListResult; } - static @NonNull PlatformBillingFlowParams fromList(@NonNull ArrayList list) { + static @NonNull PlatformBillingFlowParams fromList(@NonNull ArrayList pigeonVar_list) { PlatformBillingFlowParams pigeonResult = new PlatformBillingFlowParams(); - Object product = list.get(0); + Object product = pigeonVar_list.get(0); pigeonResult.setProduct((String) product); - Object prorationMode = list.get(1); - pigeonResult.setProrationMode( - (prorationMode == null) - ? null - : ((prorationMode instanceof Integer) - ? (Integer) prorationMode - : (Long) prorationMode)); - Object replacementMode = list.get(2); - pigeonResult.setReplacementMode( - (replacementMode == null) - ? null - : ((replacementMode instanceof Integer) - ? (Integer) replacementMode - : (Long) replacementMode)); - Object offerToken = list.get(3); + Object prorationMode = pigeonVar_list.get(1); + pigeonResult.setProrationMode((Long) prorationMode); + Object replacementMode = pigeonVar_list.get(2); + pigeonResult.setReplacementMode((Long) replacementMode); + Object offerToken = pigeonVar_list.get(3); pigeonResult.setOfferToken((String) offerToken); - Object accountId = list.get(4); + Object accountId = pigeonVar_list.get(4); pigeonResult.setAccountId((String) accountId); - Object obfuscatedProfileId = list.get(5); + Object obfuscatedProfileId = pigeonVar_list.get(5); pigeonResult.setObfuscatedProfileId((String) obfuscatedProfileId); - Object oldProduct = list.get(6); + Object oldProduct = pigeonVar_list.get(6); pigeonResult.setOldProduct((String) oldProduct); - Object purchaseToken = list.get(7); + Object purchaseToken = pigeonVar_list.get(7); pigeonResult.setPurchaseToken((String) purchaseToken); return pigeonResult; } @@ -1241,6 +1400,34 @@ public void setPriceCurrencyCode(@NonNull String setterArg) { /** Constructor is non-public to enforce null safety; use Builder. */ PlatformPricingPhase() {} + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlatformPricingPhase that = (PlatformPricingPhase) o; + return billingCycleCount.equals(that.billingCycleCount) + && recurrenceMode.equals(that.recurrenceMode) + && priceAmountMicros.equals(that.priceAmountMicros) + && billingPeriod.equals(that.billingPeriod) + && formattedPrice.equals(that.formattedPrice) + && priceCurrencyCode.equals(that.priceCurrencyCode); + } + + @Override + public int hashCode() { + return Objects.hash( + billingCycleCount, + recurrenceMode, + priceAmountMicros, + billingPeriod, + formattedPrice, + priceCurrencyCode); + } + public static final class Builder { private @Nullable Long billingCycleCount; @@ -1305,9 +1492,9 @@ public static final class Builder { @NonNull ArrayList toList() { - ArrayList toListResult = new ArrayList(6); + ArrayList toListResult = new ArrayList<>(6); toListResult.add(billingCycleCount); - toListResult.add(recurrenceMode == null ? null : recurrenceMode.index); + toListResult.add(recurrenceMode); toListResult.add(priceAmountMicros); toListResult.add(billingPeriod); toListResult.add(formattedPrice); @@ -1315,29 +1502,19 @@ ArrayList toList() { return toListResult; } - static @NonNull PlatformPricingPhase fromList(@NonNull ArrayList list) { + static @NonNull PlatformPricingPhase fromList(@NonNull ArrayList pigeonVar_list) { PlatformPricingPhase pigeonResult = new PlatformPricingPhase(); - Object billingCycleCount = list.get(0); - pigeonResult.setBillingCycleCount( - (billingCycleCount == null) - ? null - : ((billingCycleCount instanceof Integer) - ? (Integer) billingCycleCount - : (Long) billingCycleCount)); - Object recurrenceMode = list.get(1); - pigeonResult.setRecurrenceMode(PlatformRecurrenceMode.values()[(int) recurrenceMode]); - Object priceAmountMicros = list.get(2); - pigeonResult.setPriceAmountMicros( - (priceAmountMicros == null) - ? null - : ((priceAmountMicros instanceof Integer) - ? (Integer) priceAmountMicros - : (Long) priceAmountMicros)); - Object billingPeriod = list.get(3); + Object billingCycleCount = pigeonVar_list.get(0); + pigeonResult.setBillingCycleCount((Long) billingCycleCount); + Object recurrenceMode = pigeonVar_list.get(1); + pigeonResult.setRecurrenceMode((PlatformRecurrenceMode) recurrenceMode); + Object priceAmountMicros = pigeonVar_list.get(2); + pigeonResult.setPriceAmountMicros((Long) priceAmountMicros); + Object billingPeriod = pigeonVar_list.get(3); pigeonResult.setBillingPeriod((String) billingPeriod); - Object formattedPrice = list.get(4); + Object formattedPrice = pigeonVar_list.get(4); pigeonResult.setFormattedPrice((String) formattedPrice); - Object priceCurrencyCode = list.get(5); + Object priceCurrencyCode = pigeonVar_list.get(5); pigeonResult.setPriceCurrencyCode((String) priceCurrencyCode); return pigeonResult; } @@ -1517,6 +1694,48 @@ public void setAccountIdentifiers(@Nullable PlatformAccountIdentifiers setterArg /** Constructor is non-public to enforce null safety; use Builder. */ PlatformPurchase() {} + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlatformPurchase that = (PlatformPurchase) o; + return Objects.equals(orderId, that.orderId) + && packageName.equals(that.packageName) + && purchaseTime.equals(that.purchaseTime) + && purchaseToken.equals(that.purchaseToken) + && signature.equals(that.signature) + && products.equals(that.products) + && isAutoRenewing.equals(that.isAutoRenewing) + && originalJson.equals(that.originalJson) + && developerPayload.equals(that.developerPayload) + && isAcknowledged.equals(that.isAcknowledged) + && quantity.equals(that.quantity) + && purchaseState.equals(that.purchaseState) + && Objects.equals(accountIdentifiers, that.accountIdentifiers); + } + + @Override + public int hashCode() { + return Objects.hash( + orderId, + packageName, + purchaseTime, + purchaseToken, + signature, + products, + isAutoRenewing, + originalJson, + developerPayload, + isAcknowledged, + quantity, + purchaseState, + accountIdentifiers); + } + public static final class Builder { private @Nullable String orderId; @@ -1645,7 +1864,7 @@ public static final class Builder { @NonNull ArrayList toList() { - ArrayList toListResult = new ArrayList(13); + ArrayList toListResult = new ArrayList<>(13); toListResult.add(orderId); toListResult.add(packageName); toListResult.add(purchaseTime); @@ -1657,48 +1876,39 @@ ArrayList toList() { toListResult.add(developerPayload); toListResult.add(isAcknowledged); toListResult.add(quantity); - toListResult.add(purchaseState == null ? null : purchaseState.index); - toListResult.add((accountIdentifiers == null) ? null : accountIdentifiers.toList()); + toListResult.add(purchaseState); + toListResult.add(accountIdentifiers); return toListResult; } - static @NonNull PlatformPurchase fromList(@NonNull ArrayList list) { + static @NonNull PlatformPurchase fromList(@NonNull ArrayList pigeonVar_list) { PlatformPurchase pigeonResult = new PlatformPurchase(); - Object orderId = list.get(0); + Object orderId = pigeonVar_list.get(0); pigeonResult.setOrderId((String) orderId); - Object packageName = list.get(1); + Object packageName = pigeonVar_list.get(1); pigeonResult.setPackageName((String) packageName); - Object purchaseTime = list.get(2); - pigeonResult.setPurchaseTime( - (purchaseTime == null) - ? null - : ((purchaseTime instanceof Integer) ? (Integer) purchaseTime : (Long) purchaseTime)); - Object purchaseToken = list.get(3); + Object purchaseTime = pigeonVar_list.get(2); + pigeonResult.setPurchaseTime((Long) purchaseTime); + Object purchaseToken = pigeonVar_list.get(3); pigeonResult.setPurchaseToken((String) purchaseToken); - Object signature = list.get(4); + Object signature = pigeonVar_list.get(4); pigeonResult.setSignature((String) signature); - Object products = list.get(5); + Object products = pigeonVar_list.get(5); pigeonResult.setProducts((List) products); - Object isAutoRenewing = list.get(6); + Object isAutoRenewing = pigeonVar_list.get(6); pigeonResult.setIsAutoRenewing((Boolean) isAutoRenewing); - Object originalJson = list.get(7); + Object originalJson = pigeonVar_list.get(7); pigeonResult.setOriginalJson((String) originalJson); - Object developerPayload = list.get(8); + Object developerPayload = pigeonVar_list.get(8); pigeonResult.setDeveloperPayload((String) developerPayload); - Object isAcknowledged = list.get(9); + Object isAcknowledged = pigeonVar_list.get(9); pigeonResult.setIsAcknowledged((Boolean) isAcknowledged); - Object quantity = list.get(10); - pigeonResult.setQuantity( - (quantity == null) - ? null - : ((quantity instanceof Integer) ? (Integer) quantity : (Long) quantity)); - Object purchaseState = list.get(11); - pigeonResult.setPurchaseState(PlatformPurchaseState.values()[(int) purchaseState]); - Object accountIdentifiers = list.get(12); - pigeonResult.setAccountIdentifiers( - (accountIdentifiers == null) - ? null - : PlatformAccountIdentifiers.fromList((ArrayList) accountIdentifiers)); + Object quantity = pigeonVar_list.get(10); + pigeonResult.setQuantity((Long) quantity); + Object purchaseState = pigeonVar_list.get(11); + pigeonResult.setPurchaseState((PlatformPurchaseState) purchaseState); + Object accountIdentifiers = pigeonVar_list.get(12); + pigeonResult.setAccountIdentifiers((PlatformAccountIdentifiers) accountIdentifiers); return pigeonResult; } } @@ -1802,6 +2012,36 @@ public void setProducts(@NonNull List setterArg) { /** Constructor is non-public to enforce null safety; use Builder. */ PlatformPurchaseHistoryRecord() {} + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlatformPurchaseHistoryRecord that = (PlatformPurchaseHistoryRecord) o; + return quantity.equals(that.quantity) + && purchaseTime.equals(that.purchaseTime) + && Objects.equals(developerPayload, that.developerPayload) + && originalJson.equals(that.originalJson) + && purchaseToken.equals(that.purchaseToken) + && signature.equals(that.signature) + && products.equals(that.products); + } + + @Override + public int hashCode() { + return Objects.hash( + quantity, + purchaseTime, + developerPayload, + originalJson, + purchaseToken, + signature, + products); + } + public static final class Builder { private @Nullable Long quantity; @@ -1875,7 +2115,7 @@ public static final class Builder { @NonNull ArrayList toList() { - ArrayList toListResult = new ArrayList(7); + ArrayList toListResult = new ArrayList<>(7); toListResult.add(quantity); toListResult.add(purchaseTime); toListResult.add(developerPayload); @@ -1886,27 +2126,22 @@ ArrayList toList() { return toListResult; } - static @NonNull PlatformPurchaseHistoryRecord fromList(@NonNull ArrayList list) { + static @NonNull PlatformPurchaseHistoryRecord fromList( + @NonNull ArrayList pigeonVar_list) { PlatformPurchaseHistoryRecord pigeonResult = new PlatformPurchaseHistoryRecord(); - Object quantity = list.get(0); - pigeonResult.setQuantity( - (quantity == null) - ? null - : ((quantity instanceof Integer) ? (Integer) quantity : (Long) quantity)); - Object purchaseTime = list.get(1); - pigeonResult.setPurchaseTime( - (purchaseTime == null) - ? null - : ((purchaseTime instanceof Integer) ? (Integer) purchaseTime : (Long) purchaseTime)); - Object developerPayload = list.get(2); + Object quantity = pigeonVar_list.get(0); + pigeonResult.setQuantity((Long) quantity); + Object purchaseTime = pigeonVar_list.get(1); + pigeonResult.setPurchaseTime((Long) purchaseTime); + Object developerPayload = pigeonVar_list.get(2); pigeonResult.setDeveloperPayload((String) developerPayload); - Object originalJson = list.get(3); + Object originalJson = pigeonVar_list.get(3); pigeonResult.setOriginalJson((String) originalJson); - Object purchaseToken = list.get(4); + Object purchaseToken = pigeonVar_list.get(4); pigeonResult.setPurchaseToken((String) purchaseToken); - Object signature = list.get(5); + Object signature = pigeonVar_list.get(5); pigeonResult.setSignature((String) signature); - Object products = list.get(6); + Object products = pigeonVar_list.get(6); pigeonResult.setProducts((List) products); return pigeonResult; } @@ -1948,6 +2183,23 @@ public void setPurchases(@NonNull List setterArg) /** Constructor is non-public to enforce null safety; use Builder. */ PlatformPurchaseHistoryResponse() {} + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlatformPurchaseHistoryResponse that = (PlatformPurchaseHistoryResponse) o; + return billingResult.equals(that.billingResult) && purchases.equals(that.purchases); + } + + @Override + public int hashCode() { + return Objects.hash(billingResult, purchases); + } + public static final class Builder { private @Nullable PlatformBillingResult billingResult; @@ -1976,20 +2228,18 @@ public static final class Builder { @NonNull ArrayList toList() { - ArrayList toListResult = new ArrayList(2); - toListResult.add((billingResult == null) ? null : billingResult.toList()); + ArrayList toListResult = new ArrayList<>(2); + toListResult.add(billingResult); toListResult.add(purchases); return toListResult; } - static @NonNull PlatformPurchaseHistoryResponse fromList(@NonNull ArrayList list) { + static @NonNull PlatformPurchaseHistoryResponse fromList( + @NonNull ArrayList pigeonVar_list) { PlatformPurchaseHistoryResponse pigeonResult = new PlatformPurchaseHistoryResponse(); - Object billingResult = list.get(0); - pigeonResult.setBillingResult( - (billingResult == null) - ? null - : PlatformBillingResult.fromList((ArrayList) billingResult)); - Object purchases = list.get(1); + Object billingResult = pigeonVar_list.get(0); + pigeonResult.setBillingResult((PlatformBillingResult) billingResult); + Object purchases = pigeonVar_list.get(1); pigeonResult.setPurchases((List) purchases); return pigeonResult; } @@ -2031,6 +2281,23 @@ public void setPurchases(@NonNull List setterArg) { /** Constructor is non-public to enforce null safety; use Builder. */ PlatformPurchasesResponse() {} + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlatformPurchasesResponse that = (PlatformPurchasesResponse) o; + return billingResult.equals(that.billingResult) && purchases.equals(that.purchases); + } + + @Override + public int hashCode() { + return Objects.hash(billingResult, purchases); + } + public static final class Builder { private @Nullable PlatformBillingResult billingResult; @@ -2059,20 +2326,17 @@ public static final class Builder { @NonNull ArrayList toList() { - ArrayList toListResult = new ArrayList(2); - toListResult.add((billingResult == null) ? null : billingResult.toList()); + ArrayList toListResult = new ArrayList<>(2); + toListResult.add(billingResult); toListResult.add(purchases); return toListResult; } - static @NonNull PlatformPurchasesResponse fromList(@NonNull ArrayList list) { + static @NonNull PlatformPurchasesResponse fromList(@NonNull ArrayList pigeonVar_list) { PlatformPurchasesResponse pigeonResult = new PlatformPurchasesResponse(); - Object billingResult = list.get(0); - pigeonResult.setBillingResult( - (billingResult == null) - ? null - : PlatformBillingResult.fromList((ArrayList) billingResult)); - Object purchases = list.get(1); + Object billingResult = pigeonVar_list.get(0); + pigeonResult.setBillingResult((PlatformBillingResult) billingResult); + Object purchases = pigeonVar_list.get(1); pigeonResult.setPurchases((List) purchases); return pigeonResult; } @@ -2149,6 +2413,27 @@ public void setPricingPhases(@NonNull List setterArg) { /** Constructor is non-public to enforce null safety; use Builder. */ PlatformSubscriptionOfferDetails() {} + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlatformSubscriptionOfferDetails that = (PlatformSubscriptionOfferDetails) o; + return basePlanId.equals(that.basePlanId) + && Objects.equals(offerId, that.offerId) + && offerToken.equals(that.offerToken) + && offerTags.equals(that.offerTags) + && pricingPhases.equals(that.pricingPhases); + } + + @Override + public int hashCode() { + return Objects.hash(basePlanId, offerId, offerToken, offerTags, pricingPhases); + } + public static final class Builder { private @Nullable String basePlanId; @@ -2204,7 +2489,7 @@ public static final class Builder { @NonNull ArrayList toList() { - ArrayList toListResult = new ArrayList(5); + ArrayList toListResult = new ArrayList<>(5); toListResult.add(basePlanId); toListResult.add(offerId); toListResult.add(offerToken); @@ -2213,17 +2498,18 @@ ArrayList toList() { return toListResult; } - static @NonNull PlatformSubscriptionOfferDetails fromList(@NonNull ArrayList list) { + static @NonNull PlatformSubscriptionOfferDetails fromList( + @NonNull ArrayList pigeonVar_list) { PlatformSubscriptionOfferDetails pigeonResult = new PlatformSubscriptionOfferDetails(); - Object basePlanId = list.get(0); + Object basePlanId = pigeonVar_list.get(0); pigeonResult.setBasePlanId((String) basePlanId); - Object offerId = list.get(1); + Object offerId = pigeonVar_list.get(1); pigeonResult.setOfferId((String) offerId); - Object offerToken = list.get(2); + Object offerToken = pigeonVar_list.get(2); pigeonResult.setOfferToken((String) offerToken); - Object offerTags = list.get(3); + Object offerTags = pigeonVar_list.get(3); pigeonResult.setOfferTags((List) offerTags); - Object pricingPhases = list.get(4); + Object pricingPhases = pigeonVar_list.get(4); pigeonResult.setPricingPhases((List) pricingPhases); return pigeonResult; } @@ -2274,6 +2560,25 @@ public void setProducts(@NonNull List setterArg) { /** Constructor is non-public to enforce null safety; use Builder. */ PlatformUserChoiceDetails() {} + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlatformUserChoiceDetails that = (PlatformUserChoiceDetails) o; + return Objects.equals(originalExternalTransactionId, that.originalExternalTransactionId) + && externalTransactionToken.equals(that.externalTransactionToken) + && products.equals(that.products); + } + + @Override + public int hashCode() { + return Objects.hash(originalExternalTransactionId, externalTransactionToken, products); + } + public static final class Builder { private @Nullable String originalExternalTransactionId; @@ -2311,20 +2616,20 @@ public static final class Builder { @NonNull ArrayList toList() { - ArrayList toListResult = new ArrayList(3); + ArrayList toListResult = new ArrayList<>(3); toListResult.add(originalExternalTransactionId); toListResult.add(externalTransactionToken); toListResult.add(products); return toListResult; } - static @NonNull PlatformUserChoiceDetails fromList(@NonNull ArrayList list) { + static @NonNull PlatformUserChoiceDetails fromList(@NonNull ArrayList pigeonVar_list) { PlatformUserChoiceDetails pigeonResult = new PlatformUserChoiceDetails(); - Object originalExternalTransactionId = list.get(0); + Object originalExternalTransactionId = pigeonVar_list.get(0); pigeonResult.setOriginalExternalTransactionId((String) originalExternalTransactionId); - Object externalTransactionToken = list.get(1); + Object externalTransactionToken = pigeonVar_list.get(1); pigeonResult.setExternalTransactionToken((String) externalTransactionToken); - Object products = list.get(2); + Object products = pigeonVar_list.get(2); pigeonResult.setProducts((List) products); return pigeonResult; } @@ -2375,6 +2680,25 @@ public void setType(@NonNull PlatformProductType setterArg) { /** Constructor is non-public to enforce null safety; use Builder. */ PlatformUserChoiceProduct() {} + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlatformUserChoiceProduct that = (PlatformUserChoiceProduct) o; + return id.equals(that.id) + && Objects.equals(offerToken, that.offerToken) + && type.equals(that.type); + } + + @Override + public int hashCode() { + return Objects.hash(id, offerToken, type); + } + public static final class Builder { private @Nullable String id; @@ -2412,90 +2736,93 @@ public static final class Builder { @NonNull ArrayList toList() { - ArrayList toListResult = new ArrayList(3); + ArrayList toListResult = new ArrayList<>(3); toListResult.add(id); toListResult.add(offerToken); - toListResult.add(type == null ? null : type.index); + toListResult.add(type); return toListResult; } - static @NonNull PlatformUserChoiceProduct fromList(@NonNull ArrayList list) { + static @NonNull PlatformUserChoiceProduct fromList(@NonNull ArrayList pigeonVar_list) { PlatformUserChoiceProduct pigeonResult = new PlatformUserChoiceProduct(); - Object id = list.get(0); + Object id = pigeonVar_list.get(0); pigeonResult.setId((String) id); - Object offerToken = list.get(1); + Object offerToken = pigeonVar_list.get(1); pigeonResult.setOfferToken((String) offerToken); - Object type = list.get(2); - pigeonResult.setType(PlatformProductType.values()[(int) type]); + Object type = pigeonVar_list.get(2); + pigeonResult.setType((PlatformProductType) type); return pigeonResult; } } - /** Asynchronous error handling return type for non-nullable API method returns. */ - public interface Result { - /** Success case callback method for handling returns. */ - void success(@NonNull T result); - - /** Failure case callback method for handling errors. */ - void error(@NonNull Throwable error); - } - /** Asynchronous error handling return type for nullable API method returns. */ - public interface NullableResult { - /** Success case callback method for handling returns. */ - void success(@Nullable T result); - - /** Failure case callback method for handling errors. */ - void error(@NonNull Throwable error); - } - /** Asynchronous error handling return type for void API method returns. */ - public interface VoidResult { - /** Success case callback method for handling returns. */ - void success(); - - /** Failure case callback method for handling errors. */ - void error(@NonNull Throwable error); - } - - private static class InAppPurchaseApiCodec extends StandardMessageCodec { - public static final InAppPurchaseApiCodec INSTANCE = new InAppPurchaseApiCodec(); + private static class PigeonCodec extends StandardMessageCodec { + public static final PigeonCodec INSTANCE = new PigeonCodec(); - private InAppPurchaseApiCodec() {} + private PigeonCodec() {} @Override protected Object readValueOfType(byte type, @NonNull ByteBuffer buffer) { switch (type) { - case (byte) 128: - return PlatformAccountIdentifiers.fromList((ArrayList) readValue(buffer)); case (byte) 129: - return PlatformAlternativeBillingOnlyReportingDetailsResponse.fromList( - (ArrayList) readValue(buffer)); + { + Object value = readValue(buffer); + return value == null ? null : PlatformProductType.values()[((Long) value).intValue()]; + } case (byte) 130: - return PlatformBillingConfigResponse.fromList((ArrayList) readValue(buffer)); + { + Object value = readValue(buffer); + return value == null + ? null + : PlatformBillingChoiceMode.values()[((Long) value).intValue()]; + } case (byte) 131: - return PlatformBillingFlowParams.fromList((ArrayList) readValue(buffer)); + { + Object value = readValue(buffer); + return value == null ? null : PlatformPurchaseState.values()[((Long) value).intValue()]; + } case (byte) 132: - return PlatformBillingResult.fromList((ArrayList) readValue(buffer)); + { + Object value = readValue(buffer); + return value == null + ? null + : PlatformRecurrenceMode.values()[((Long) value).intValue()]; + } case (byte) 133: - return PlatformOneTimePurchaseOfferDetails.fromList( - (ArrayList) readValue(buffer)); + return PlatformQueryProduct.fromList((ArrayList) readValue(buffer)); case (byte) 134: - return PlatformPricingPhase.fromList((ArrayList) readValue(buffer)); + return PlatformAccountIdentifiers.fromList((ArrayList) readValue(buffer)); case (byte) 135: - return PlatformProductDetails.fromList((ArrayList) readValue(buffer)); + return PlatformBillingResult.fromList((ArrayList) readValue(buffer)); case (byte) 136: - return PlatformProductDetailsResponse.fromList((ArrayList) readValue(buffer)); + return PlatformOneTimePurchaseOfferDetails.fromList( + (ArrayList) readValue(buffer)); case (byte) 137: - return PlatformPurchase.fromList((ArrayList) readValue(buffer)); + return PlatformProductDetails.fromList((ArrayList) readValue(buffer)); case (byte) 138: - return PlatformPurchaseHistoryRecord.fromList((ArrayList) readValue(buffer)); + return PlatformProductDetailsResponse.fromList((ArrayList) readValue(buffer)); case (byte) 139: - return PlatformPurchaseHistoryResponse.fromList((ArrayList) readValue(buffer)); + return PlatformAlternativeBillingOnlyReportingDetailsResponse.fromList( + (ArrayList) readValue(buffer)); case (byte) 140: - return PlatformPurchasesResponse.fromList((ArrayList) readValue(buffer)); + return PlatformBillingConfigResponse.fromList((ArrayList) readValue(buffer)); case (byte) 141: - return PlatformQueryProduct.fromList((ArrayList) readValue(buffer)); + return PlatformBillingFlowParams.fromList((ArrayList) readValue(buffer)); case (byte) 142: + return PlatformPricingPhase.fromList((ArrayList) readValue(buffer)); + case (byte) 143: + return PlatformPurchase.fromList((ArrayList) readValue(buffer)); + case (byte) 144: + return PlatformPurchaseHistoryRecord.fromList((ArrayList) readValue(buffer)); + case (byte) 145: + return PlatformPurchaseHistoryResponse.fromList((ArrayList) readValue(buffer)); + case (byte) 146: + return PlatformPurchasesResponse.fromList((ArrayList) readValue(buffer)); + case (byte) 147: return PlatformSubscriptionOfferDetails.fromList((ArrayList) readValue(buffer)); + case (byte) 148: + return PlatformUserChoiceDetails.fromList((ArrayList) readValue(buffer)); + case (byte) 149: + return PlatformUserChoiceProduct.fromList((ArrayList) readValue(buffer)); default: return super.readValueOfType(type, buffer); } @@ -2503,58 +2830,100 @@ protected Object readValueOfType(byte type, @NonNull ByteBuffer buffer) { @Override protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { - if (value instanceof PlatformAccountIdentifiers) { - stream.write(128); - writeValue(stream, ((PlatformAccountIdentifiers) value).toList()); - } else if (value instanceof PlatformAlternativeBillingOnlyReportingDetailsResponse) { + if (value instanceof PlatformProductType) { stream.write(129); - writeValue( - stream, ((PlatformAlternativeBillingOnlyReportingDetailsResponse) value).toList()); - } else if (value instanceof PlatformBillingConfigResponse) { + writeValue(stream, value == null ? null : ((PlatformProductType) value).index); + } else if (value instanceof PlatformBillingChoiceMode) { stream.write(130); - writeValue(stream, ((PlatformBillingConfigResponse) value).toList()); - } else if (value instanceof PlatformBillingFlowParams) { + writeValue(stream, value == null ? null : ((PlatformBillingChoiceMode) value).index); + } else if (value instanceof PlatformPurchaseState) { stream.write(131); - writeValue(stream, ((PlatformBillingFlowParams) value).toList()); - } else if (value instanceof PlatformBillingResult) { + writeValue(stream, value == null ? null : ((PlatformPurchaseState) value).index); + } else if (value instanceof PlatformRecurrenceMode) { stream.write(132); + writeValue(stream, value == null ? null : ((PlatformRecurrenceMode) value).index); + } else if (value instanceof PlatformQueryProduct) { + stream.write(133); + writeValue(stream, ((PlatformQueryProduct) value).toList()); + } else if (value instanceof PlatformAccountIdentifiers) { + stream.write(134); + writeValue(stream, ((PlatformAccountIdentifiers) value).toList()); + } else if (value instanceof PlatformBillingResult) { + stream.write(135); writeValue(stream, ((PlatformBillingResult) value).toList()); } else if (value instanceof PlatformOneTimePurchaseOfferDetails) { - stream.write(133); + stream.write(136); writeValue(stream, ((PlatformOneTimePurchaseOfferDetails) value).toList()); - } else if (value instanceof PlatformPricingPhase) { - stream.write(134); - writeValue(stream, ((PlatformPricingPhase) value).toList()); } else if (value instanceof PlatformProductDetails) { - stream.write(135); + stream.write(137); writeValue(stream, ((PlatformProductDetails) value).toList()); } else if (value instanceof PlatformProductDetailsResponse) { - stream.write(136); + stream.write(138); writeValue(stream, ((PlatformProductDetailsResponse) value).toList()); + } else if (value instanceof PlatformAlternativeBillingOnlyReportingDetailsResponse) { + stream.write(139); + writeValue( + stream, ((PlatformAlternativeBillingOnlyReportingDetailsResponse) value).toList()); + } else if (value instanceof PlatformBillingConfigResponse) { + stream.write(140); + writeValue(stream, ((PlatformBillingConfigResponse) value).toList()); + } else if (value instanceof PlatformBillingFlowParams) { + stream.write(141); + writeValue(stream, ((PlatformBillingFlowParams) value).toList()); + } else if (value instanceof PlatformPricingPhase) { + stream.write(142); + writeValue(stream, ((PlatformPricingPhase) value).toList()); } else if (value instanceof PlatformPurchase) { - stream.write(137); + stream.write(143); writeValue(stream, ((PlatformPurchase) value).toList()); } else if (value instanceof PlatformPurchaseHistoryRecord) { - stream.write(138); + stream.write(144); writeValue(stream, ((PlatformPurchaseHistoryRecord) value).toList()); } else if (value instanceof PlatformPurchaseHistoryResponse) { - stream.write(139); + stream.write(145); writeValue(stream, ((PlatformPurchaseHistoryResponse) value).toList()); } else if (value instanceof PlatformPurchasesResponse) { - stream.write(140); + stream.write(146); writeValue(stream, ((PlatformPurchasesResponse) value).toList()); - } else if (value instanceof PlatformQueryProduct) { - stream.write(141); - writeValue(stream, ((PlatformQueryProduct) value).toList()); } else if (value instanceof PlatformSubscriptionOfferDetails) { - stream.write(142); + stream.write(147); writeValue(stream, ((PlatformSubscriptionOfferDetails) value).toList()); + } else if (value instanceof PlatformUserChoiceDetails) { + stream.write(148); + writeValue(stream, ((PlatformUserChoiceDetails) value).toList()); + } else if (value instanceof PlatformUserChoiceProduct) { + stream.write(149); + writeValue(stream, ((PlatformUserChoiceProduct) value).toList()); } else { super.writeValue(stream, value); } } } + /** Asynchronous error handling return type for non-nullable API method returns. */ + public interface Result { + /** Success case callback method for handling returns. */ + void success(@NonNull T result); + + /** Failure case callback method for handling errors. */ + void error(@NonNull Throwable error); + } + /** Asynchronous error handling return type for nullable API method returns. */ + public interface NullableResult { + /** Success case callback method for handling returns. */ + void success(@Nullable T result); + + /** Failure case callback method for handling errors. */ + void error(@NonNull Throwable error); + } + /** Asynchronous error handling return type for void API method returns. */ + public interface VoidResult { + /** Success case callback method for handling returns. */ + void success(); + + /** Failure case callback method for handling errors. */ + void error(@NonNull Throwable error); + } /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface InAppPurchaseApi { /** Wraps BillingClient#isReady. */ @@ -2617,28 +2986,36 @@ void createAlternativeBillingOnlyReportingDetailsAsync( /** The codec used by InAppPurchaseApi. */ static @NonNull MessageCodec getCodec() { - return InAppPurchaseApiCodec.INSTANCE; + return PigeonCodec.INSTANCE; } /** * Sets up an instance of `InAppPurchaseApi` to handle messages through the `binaryMessenger`. */ static void setUp(@NonNull BinaryMessenger binaryMessenger, @Nullable InAppPurchaseApi api) { + setUp(binaryMessenger, "", api); + } + + static void setUp( + @NonNull BinaryMessenger binaryMessenger, + @NonNull String messageChannelSuffix, + @Nullable InAppPurchaseApi api) { + messageChannelSuffix = messageChannelSuffix.isEmpty() ? "" : "." + messageChannelSuffix; { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.isReady", + "dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.isReady" + + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); try { Boolean output = api.isReady(); wrapped.add(0, output); } catch (Throwable exception) { - ArrayList wrappedError = wrapError(exception); - wrapped = wrappedError; + wrapped = wrapError(exception); } reply.reply(wrapped); }); @@ -2650,16 +3027,16 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @Nullable InAppPurch BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.startConnection", + "dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.startConnection" + + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - Number callbackHandleArg = (Number) args.get(0); - PlatformBillingChoiceMode billingModeArg = - PlatformBillingChoiceMode.values()[(int) args.get(1)]; + Long callbackHandleArg = (Long) args.get(0); + PlatformBillingChoiceMode billingModeArg = (PlatformBillingChoiceMode) args.get(1); Result resultCallback = new Result() { public void success(PlatformBillingResult result) { @@ -2673,10 +3050,7 @@ public void error(Throwable error) { } }; - api.startConnection( - (callbackHandleArg == null) ? null : callbackHandleArg.longValue(), - billingModeArg, - resultCallback); + api.startConnection(callbackHandleArg, billingModeArg, resultCallback); }); } else { channel.setMessageHandler(null); @@ -2686,18 +3060,18 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.endConnection", + "dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.endConnection" + + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); try { api.endConnection(); wrapped.add(0, null); } catch (Throwable exception) { - ArrayList wrappedError = wrapError(exception); - wrapped = wrappedError; + wrapped = wrapError(exception); } reply.reply(wrapped); }); @@ -2709,12 +3083,13 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.getBillingConfigAsync", + "dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.getBillingConfigAsync" + + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); Result resultCallback = new Result() { public void success(PlatformBillingConfigResponse result) { @@ -2738,20 +3113,20 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.launchBillingFlow", + "dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.launchBillingFlow" + + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; PlatformBillingFlowParams paramsArg = (PlatformBillingFlowParams) args.get(0); try { PlatformBillingResult output = api.launchBillingFlow(paramsArg); wrapped.add(0, output); } catch (Throwable exception) { - ArrayList wrappedError = wrapError(exception); - wrapped = wrappedError; + wrapped = wrapError(exception); } reply.reply(wrapped); }); @@ -2763,12 +3138,13 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.acknowledgePurchase", + "dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.acknowledgePurchase" + + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; String purchaseTokenArg = (String) args.get(0); Result resultCallback = @@ -2794,12 +3170,13 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.consumeAsync", + "dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.consumeAsync" + + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; String purchaseTokenArg = (String) args.get(0); Result resultCallback = @@ -2825,15 +3202,15 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.queryPurchasesAsync", + "dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.queryPurchasesAsync" + + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - PlatformProductType productTypeArg = - PlatformProductType.values()[(int) args.get(0)]; + PlatformProductType productTypeArg = (PlatformProductType) args.get(0); Result resultCallback = new Result() { public void success(PlatformPurchasesResponse result) { @@ -2857,15 +3234,15 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.queryPurchaseHistoryAsync", + "dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.queryPurchaseHistoryAsync" + + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - PlatformProductType productTypeArg = - PlatformProductType.values()[(int) args.get(0)]; + PlatformProductType productTypeArg = (PlatformProductType) args.get(0); Result resultCallback = new Result() { public void success(PlatformPurchaseHistoryResponse result) { @@ -2889,12 +3266,13 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.queryProductDetailsAsync", + "dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.queryProductDetailsAsync" + + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; List productsArg = (List) args.get(0); Result resultCallback = @@ -2920,20 +3298,20 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.isFeatureSupported", + "dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.isFeatureSupported" + + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; String featureArg = (String) args.get(0); try { Boolean output = api.isFeatureSupported(featureArg); wrapped.add(0, output); } catch (Throwable exception) { - ArrayList wrappedError = wrapError(exception); - wrapped = wrappedError; + wrapped = wrapError(exception); } reply.reply(wrapped); }); @@ -2945,12 +3323,13 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.isAlternativeBillingOnlyAvailableAsync", + "dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.isAlternativeBillingOnlyAvailableAsync" + + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); Result resultCallback = new Result() { public void success(PlatformBillingResult result) { @@ -2974,12 +3353,13 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.showAlternativeBillingOnlyInformationDialog", + "dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.showAlternativeBillingOnlyInformationDialog" + + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); Result resultCallback = new Result() { public void success(PlatformBillingResult result) { @@ -3003,12 +3383,13 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.createAlternativeBillingOnlyReportingDetailsAsync", + "dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.createAlternativeBillingOnlyReportingDetailsAsync" + + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); Result resultCallback = new Result() { public void success( @@ -3031,90 +3412,42 @@ public void error(Throwable error) { } } } - - private static class InAppPurchaseCallbackApiCodec extends StandardMessageCodec { - public static final InAppPurchaseCallbackApiCodec INSTANCE = - new InAppPurchaseCallbackApiCodec(); - - private InAppPurchaseCallbackApiCodec() {} - - @Override - protected Object readValueOfType(byte type, @NonNull ByteBuffer buffer) { - switch (type) { - case (byte) 128: - return PlatformAccountIdentifiers.fromList((ArrayList) readValue(buffer)); - case (byte) 129: - return PlatformBillingResult.fromList((ArrayList) readValue(buffer)); - case (byte) 130: - return PlatformPurchase.fromList((ArrayList) readValue(buffer)); - case (byte) 131: - return PlatformPurchasesResponse.fromList((ArrayList) readValue(buffer)); - case (byte) 132: - return PlatformUserChoiceDetails.fromList((ArrayList) readValue(buffer)); - case (byte) 133: - return PlatformUserChoiceProduct.fromList((ArrayList) readValue(buffer)); - default: - return super.readValueOfType(type, buffer); - } - } - - @Override - protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { - if (value instanceof PlatformAccountIdentifiers) { - stream.write(128); - writeValue(stream, ((PlatformAccountIdentifiers) value).toList()); - } else if (value instanceof PlatformBillingResult) { - stream.write(129); - writeValue(stream, ((PlatformBillingResult) value).toList()); - } else if (value instanceof PlatformPurchase) { - stream.write(130); - writeValue(stream, ((PlatformPurchase) value).toList()); - } else if (value instanceof PlatformPurchasesResponse) { - stream.write(131); - writeValue(stream, ((PlatformPurchasesResponse) value).toList()); - } else if (value instanceof PlatformUserChoiceDetails) { - stream.write(132); - writeValue(stream, ((PlatformUserChoiceDetails) value).toList()); - } else if (value instanceof PlatformUserChoiceProduct) { - stream.write(133); - writeValue(stream, ((PlatformUserChoiceProduct) value).toList()); - } else { - super.writeValue(stream, value); - } - } - } - /** Generated class from Pigeon that represents Flutter messages that can be called from Java. */ public static class InAppPurchaseCallbackApi { private final @NonNull BinaryMessenger binaryMessenger; + private final String messageChannelSuffix; public InAppPurchaseCallbackApi(@NonNull BinaryMessenger argBinaryMessenger) { + this(argBinaryMessenger, ""); + } + + public InAppPurchaseCallbackApi( + @NonNull BinaryMessenger argBinaryMessenger, @NonNull String messageChannelSuffix) { this.binaryMessenger = argBinaryMessenger; + this.messageChannelSuffix = messageChannelSuffix.isEmpty() ? "" : "." + messageChannelSuffix; } - /** Public interface for sending reply. */ - /** The codec used by InAppPurchaseCallbackApi. */ + /** Public interface for sending reply. The codec used by InAppPurchaseCallbackApi. */ static @NonNull MessageCodec getCodec() { - return InAppPurchaseCallbackApiCodec.INSTANCE; + return PigeonCodec.INSTANCE; } /** Called for BillingClientStateListener#onBillingServiceDisconnected(). */ public void onBillingServiceDisconnected( @NonNull Long callbackHandleArg, @NonNull VoidResult result) { final String channelName = - "dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseCallbackApi.onBillingServiceDisconnected"; + "dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseCallbackApi.onBillingServiceDisconnected" + + messageChannelSuffix; BasicMessageChannel channel = new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( - new ArrayList(Collections.singletonList(callbackHandleArg)), + new ArrayList<>(Collections.singletonList(callbackHandleArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { result.error( new FlutterError( - (String) listReply.get(0), - (String) listReply.get(1), - (String) listReply.get(2))); + (String) listReply.get(0), (String) listReply.get(1), listReply.get(2))); } else { result.success(); } @@ -3127,20 +3460,19 @@ public void onBillingServiceDisconnected( public void onPurchasesUpdated( @NonNull PlatformPurchasesResponse updateArg, @NonNull VoidResult result) { final String channelName = - "dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseCallbackApi.onPurchasesUpdated"; + "dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseCallbackApi.onPurchasesUpdated" + + messageChannelSuffix; BasicMessageChannel channel = new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( - new ArrayList(Collections.singletonList(updateArg)), + new ArrayList<>(Collections.singletonList(updateArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { result.error( new FlutterError( - (String) listReply.get(0), - (String) listReply.get(1), - (String) listReply.get(2))); + (String) listReply.get(0), (String) listReply.get(1), listReply.get(2))); } else { result.success(); } @@ -3153,20 +3485,19 @@ public void onPurchasesUpdated( public void userSelectedalternativeBilling( @NonNull PlatformUserChoiceDetails detailsArg, @NonNull VoidResult result) { final String channelName = - "dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseCallbackApi.userSelectedalternativeBilling"; + "dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseCallbackApi.userSelectedalternativeBilling" + + messageChannelSuffix; BasicMessageChannel channel = new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( - new ArrayList(Collections.singletonList(detailsArg)), + new ArrayList<>(Collections.singletonList(detailsArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { result.error( new FlutterError( - (String) listReply.get(0), - (String) listReply.get(1), - (String) listReply.get(2))); + (String) listReply.get(0), (String) listReply.get(1), listReply.get(2))); } else { result.success(); } 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..d951fac2bf31 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-8.7-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/packages/in_app_purchase/in_app_purchase_android/example/android/build.gradle b/packages/in_app_purchase/in_app_purchase_android/example/android/build.gradle index bde7e79aa948..bb2a63600c80 100644 --- a/packages/in_app_purchase/in_app_purchase_android/example/android/build.gradle +++ b/packages/in_app_purchase/in_app_purchase_android/example/android/build.gradle @@ -5,7 +5,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:7.4.2' + classpath 'com.android.tools.build:gradle:8.5.1' } } 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..7aeeb11c6ee5 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-8.7-all.zip diff --git a/packages/in_app_purchase/in_app_purchase_android/example/pubspec.yaml b/packages/in_app_purchase/in_app_purchase_android/example/pubspec.yaml index a22c81be11fc..31258d0f3ce5 100644 --- a/packages/in_app_purchase/in_app_purchase_android/example/pubspec.yaml +++ b/packages/in_app_purchase/in_app_purchase_android/example/pubspec.yaml @@ -3,8 +3,8 @@ description: Demonstrates how to use the in_app_purchase_android plugin. publish_to: none environment: - sdk: ^3.4.0 - flutter: ">=3.22.0" + sdk: ^3.5.0 + flutter: ">=3.24.0" dependencies: flutter: diff --git a/packages/in_app_purchase/in_app_purchase_android/lib/src/billing_client_wrappers/alternative_billing_only_reporting_details_wrapper.g.dart b/packages/in_app_purchase/in_app_purchase_android/lib/src/billing_client_wrappers/alternative_billing_only_reporting_details_wrapper.g.dart index 46b82645de0f..04578fb4a45b 100644 --- a/packages/in_app_purchase/in_app_purchase_android/lib/src/billing_client_wrappers/alternative_billing_only_reporting_details_wrapper.g.dart +++ b/packages/in_app_purchase/in_app_purchase_android/lib/src/billing_client_wrappers/alternative_billing_only_reporting_details_wrapper.g.dart @@ -10,7 +10,7 @@ AlternativeBillingOnlyReportingDetailsWrapper _$AlternativeBillingOnlyReportingDetailsWrapperFromJson(Map json) => AlternativeBillingOnlyReportingDetailsWrapper( responseCode: const BillingResponseConverter() - .fromJson(json['responseCode'] as int?), + .fromJson((json['responseCode'] as num?)?.toInt()), debugMessage: json['debugMessage'] as String? ?? '', externalTransactionToken: json['externalTransactionToken'] as String? ?? '', diff --git a/packages/in_app_purchase/in_app_purchase_android/lib/src/billing_client_wrappers/billing_client_wrapper.dart b/packages/in_app_purchase/in_app_purchase_android/lib/src/billing_client_wrappers/billing_client_wrapper.dart index 3f7bd499bbf1..1f46c3f1de20 100644 --- a/packages/in_app_purchase/in_app_purchase_android/lib/src/billing_client_wrappers/billing_client_wrapper.dart +++ b/packages/in_app_purchase/in_app_purchase_android/lib/src/billing_client_wrappers/billing_client_wrapper.dart @@ -64,7 +64,7 @@ class BillingClient { }) : _hostApi = api ?? InAppPurchaseApi(), hostCallbackHandler = HostBillingClientCallbackHandler( onPurchasesUpdated, alternativeBillingListener) { - InAppPurchaseCallbackApi.setup(hostCallbackHandler); + InAppPurchaseCallbackApi.setUp(hostCallbackHandler); } /// Interface for calling host-side code. diff --git a/packages/in_app_purchase/in_app_purchase_android/lib/src/billing_client_wrappers/billing_config_wrapper.g.dart b/packages/in_app_purchase/in_app_purchase_android/lib/src/billing_client_wrappers/billing_config_wrapper.g.dart index 21f98577d91e..fc8328aec176 100644 --- a/packages/in_app_purchase/in_app_purchase_android/lib/src/billing_client_wrappers/billing_config_wrapper.g.dart +++ b/packages/in_app_purchase/in_app_purchase_android/lib/src/billing_client_wrappers/billing_config_wrapper.g.dart @@ -9,7 +9,7 @@ part of 'billing_config_wrapper.dart'; BillingConfigWrapper _$BillingConfigWrapperFromJson(Map json) => BillingConfigWrapper( responseCode: const BillingResponseConverter() - .fromJson(json['responseCode'] as int?), + .fromJson((json['responseCode'] as num?)?.toInt()), debugMessage: json['debugMessage'] as String? ?? '', countryCode: json['countryCode'] as String? ?? '', ); diff --git a/packages/in_app_purchase/in_app_purchase_android/lib/src/billing_client_wrappers/billing_response_wrapper.g.dart b/packages/in_app_purchase/in_app_purchase_android/lib/src/billing_client_wrappers/billing_response_wrapper.g.dart index bff62ae85744..a3b28403983e 100644 --- a/packages/in_app_purchase/in_app_purchase_android/lib/src/billing_client_wrappers/billing_response_wrapper.g.dart +++ b/packages/in_app_purchase/in_app_purchase_android/lib/src/billing_client_wrappers/billing_response_wrapper.g.dart @@ -9,6 +9,6 @@ part of 'billing_response_wrapper.dart'; BillingResultWrapper _$BillingResultWrapperFromJson(Map json) => BillingResultWrapper( responseCode: const BillingResponseConverter() - .fromJson(json['responseCode'] as int?), + .fromJson((json['responseCode'] as num?)?.toInt()), debugMessage: json['debugMessage'] as String?, ); diff --git a/packages/in_app_purchase/in_app_purchase_android/lib/src/billing_client_wrappers/one_time_purchase_offer_details_wrapper.g.dart b/packages/in_app_purchase/in_app_purchase_android/lib/src/billing_client_wrappers/one_time_purchase_offer_details_wrapper.g.dart index 19e57e80157b..f26a38162fcd 100644 --- a/packages/in_app_purchase/in_app_purchase_android/lib/src/billing_client_wrappers/one_time_purchase_offer_details_wrapper.g.dart +++ b/packages/in_app_purchase/in_app_purchase_android/lib/src/billing_client_wrappers/one_time_purchase_offer_details_wrapper.g.dart @@ -10,6 +10,6 @@ OneTimePurchaseOfferDetailsWrapper _$OneTimePurchaseOfferDetailsWrapperFromJson( Map json) => OneTimePurchaseOfferDetailsWrapper( formattedPrice: json['formattedPrice'] as String? ?? '', - priceAmountMicros: json['priceAmountMicros'] as int? ?? 0, + priceAmountMicros: (json['priceAmountMicros'] as num?)?.toInt() ?? 0, priceCurrencyCode: json['priceCurrencyCode'] as String? ?? '', ); diff --git a/packages/in_app_purchase/in_app_purchase_android/lib/src/billing_client_wrappers/purchase_wrapper.g.dart b/packages/in_app_purchase/in_app_purchase_android/lib/src/billing_client_wrappers/purchase_wrapper.g.dart index 0270d610eb68..b97afce0f628 100644 --- a/packages/in_app_purchase/in_app_purchase_android/lib/src/billing_client_wrappers/purchase_wrapper.g.dart +++ b/packages/in_app_purchase/in_app_purchase_android/lib/src/billing_client_wrappers/purchase_wrapper.g.dart @@ -9,7 +9,7 @@ part of 'purchase_wrapper.dart'; PurchaseWrapper _$PurchaseWrapperFromJson(Map json) => PurchaseWrapper( orderId: json['orderId'] as String? ?? '', packageName: json['packageName'] as String? ?? '', - purchaseTime: json['purchaseTime'] as int? ?? 0, + purchaseTime: (json['purchaseTime'] as num?)?.toInt() ?? 0, purchaseToken: json['purchaseToken'] as String? ?? '', signature: json['signature'] as String? ?? '', products: (json['products'] as List?) @@ -21,14 +21,14 @@ PurchaseWrapper _$PurchaseWrapperFromJson(Map json) => PurchaseWrapper( developerPayload: json['developerPayload'] as String?, isAcknowledged: json['isAcknowledged'] as bool? ?? false, purchaseState: const PurchaseStateConverter() - .fromJson(json['purchaseState'] as int?), + .fromJson((json['purchaseState'] as num?)?.toInt()), obfuscatedAccountId: json['obfuscatedAccountId'] as String?, obfuscatedProfileId: json['obfuscatedProfileId'] as String?, ); PurchaseHistoryRecordWrapper _$PurchaseHistoryRecordWrapperFromJson(Map json) => PurchaseHistoryRecordWrapper( - purchaseTime: json['purchaseTime'] as int? ?? 0, + purchaseTime: (json['purchaseTime'] as num?)?.toInt() ?? 0, purchaseToken: json['purchaseToken'] as String? ?? '', signature: json['signature'] as String? ?? '', products: (json['products'] as List?) @@ -42,7 +42,7 @@ PurchaseHistoryRecordWrapper _$PurchaseHistoryRecordWrapperFromJson(Map json) => PurchasesResultWrapper _$PurchasesResultWrapperFromJson(Map json) => PurchasesResultWrapper( responseCode: const BillingResponseConverter() - .fromJson(json['responseCode'] as int?), + .fromJson((json['responseCode'] as num?)?.toInt()), billingResult: BillingResultWrapper.fromJson((json['billingResult'] as Map?)?.map( (k, e) => MapEntry(k as String, e), diff --git a/packages/in_app_purchase/in_app_purchase_android/lib/src/billing_client_wrappers/subscription_offer_details_wrapper.g.dart b/packages/in_app_purchase/in_app_purchase_android/lib/src/billing_client_wrappers/subscription_offer_details_wrapper.g.dart index eca645340fe5..46973ed7d427 100644 --- a/packages/in_app_purchase/in_app_purchase_android/lib/src/billing_client_wrappers/subscription_offer_details_wrapper.g.dart +++ b/packages/in_app_purchase/in_app_purchase_android/lib/src/billing_client_wrappers/subscription_offer_details_wrapper.g.dart @@ -25,13 +25,13 @@ SubscriptionOfferDetailsWrapper _$SubscriptionOfferDetailsWrapperFromJson( PricingPhaseWrapper _$PricingPhaseWrapperFromJson(Map json) => PricingPhaseWrapper( - billingCycleCount: json['billingCycleCount'] as int? ?? 0, + billingCycleCount: (json['billingCycleCount'] as num?)?.toInt() ?? 0, billingPeriod: json['billingPeriod'] as String? ?? '', formattedPrice: json['formattedPrice'] as String? ?? '', - priceAmountMicros: json['priceAmountMicros'] as int? ?? 0, + priceAmountMicros: (json['priceAmountMicros'] as num?)?.toInt() ?? 0, priceCurrencyCode: json['priceCurrencyCode'] as String? ?? '', recurrenceMode: json['recurrenceMode'] == null ? RecurrenceMode.nonRecurring : const RecurrenceModeConverter() - .fromJson(json['recurrenceMode'] as int?), + .fromJson((json['recurrenceMode'] as num?)?.toInt()), ); diff --git a/packages/in_app_purchase/in_app_purchase_android/lib/src/messages.g.dart b/packages/in_app_purchase/in_app_purchase_android/lib/src/messages.g.dart index e6444b8d9b64..1e6cca2ccbd3 100644 --- a/packages/in_app_purchase/in_app_purchase_android/lib/src/messages.g.dart +++ b/packages/in_app_purchase/in_app_purchase_android/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 (v17.3.0), do not edit directly. +// Autogenerated from Pigeon (v22.4.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, no_leading_underscores_for_local_identifiers @@ -77,7 +77,7 @@ class PlatformQueryProduct { Object encode() { return [ productId, - productType.index, + productType, ]; } @@ -85,7 +85,7 @@ class PlatformQueryProduct { result as List; return PlatformQueryProduct( productId: result[0]! as String, - productType: PlatformProductType.values[result[1]! as int], + productType: result[1]! as PlatformProductType, ); } } @@ -200,16 +200,16 @@ class PlatformProductDetails { PlatformOneTimePurchaseOfferDetails? oneTimePurchaseOfferDetails; - List? subscriptionOfferDetails; + List? subscriptionOfferDetails; Object encode() { return [ description, name, productId, - productType.index, + productType, title, - oneTimePurchaseOfferDetails?.encode(), + oneTimePurchaseOfferDetails, subscriptionOfferDetails, ]; } @@ -220,14 +220,12 @@ class PlatformProductDetails { description: result[0]! as String, name: result[1]! as String, productId: result[2]! as String, - productType: PlatformProductType.values[result[3]! as int], + productType: result[3]! as PlatformProductType, title: result[4]! as String, - oneTimePurchaseOfferDetails: result[5] != null - ? PlatformOneTimePurchaseOfferDetails.decode( - result[5]! as List) - : null, + oneTimePurchaseOfferDetails: + result[5] as PlatformOneTimePurchaseOfferDetails?, subscriptionOfferDetails: (result[6] as List?) - ?.cast(), + ?.cast(), ); } } @@ -242,11 +240,11 @@ class PlatformProductDetailsResponse { PlatformBillingResult billingResult; - List productDetails; + List productDetails; Object encode() { return [ - billingResult.encode(), + billingResult, productDetails, ]; } @@ -254,9 +252,9 @@ class PlatformProductDetailsResponse { static PlatformProductDetailsResponse decode(Object result) { result as List; return PlatformProductDetailsResponse( - billingResult: PlatformBillingResult.decode(result[0]! as List), + billingResult: result[0]! as PlatformBillingResult, productDetails: - (result[1] as List?)!.cast(), + (result[1] as List?)!.cast(), ); } } @@ -276,7 +274,7 @@ class PlatformAlternativeBillingOnlyReportingDetailsResponse { Object encode() { return [ - billingResult.encode(), + billingResult, externalTransactionToken, ]; } @@ -285,7 +283,7 @@ class PlatformAlternativeBillingOnlyReportingDetailsResponse { Object result) { result as List; return PlatformAlternativeBillingOnlyReportingDetailsResponse( - billingResult: PlatformBillingResult.decode(result[0]! as List), + billingResult: result[0]! as PlatformBillingResult, externalTransactionToken: result[1]! as String, ); } @@ -305,7 +303,7 @@ class PlatformBillingConfigResponse { Object encode() { return [ - billingResult.encode(), + billingResult, countryCode, ]; } @@ -313,7 +311,7 @@ class PlatformBillingConfigResponse { static PlatformBillingConfigResponse decode(Object result) { result as List; return PlatformBillingConfigResponse( - billingResult: PlatformBillingResult.decode(result[0]! as List), + billingResult: result[0]! as PlatformBillingResult, countryCode: result[1]! as String, ); } @@ -402,7 +400,7 @@ class PlatformPricingPhase { Object encode() { return [ billingCycleCount, - recurrenceMode.index, + recurrenceMode, priceAmountMicros, billingPeriod, formattedPrice, @@ -414,7 +412,7 @@ class PlatformPricingPhase { result as List; return PlatformPricingPhase( billingCycleCount: result[0]! as int, - recurrenceMode: PlatformRecurrenceMode.values[result[1]! as int], + recurrenceMode: result[1]! as PlatformRecurrenceMode, priceAmountMicros: result[2]! as int, billingPeriod: result[3]! as String, formattedPrice: result[4]! as String, @@ -453,7 +451,7 @@ class PlatformPurchase { String signature; - List products; + List products; bool isAutoRenewing; @@ -482,8 +480,8 @@ class PlatformPurchase { developerPayload, isAcknowledged, quantity, - purchaseState.index, - accountIdentifiers?.encode(), + purchaseState, + accountIdentifiers, ]; } @@ -495,16 +493,14 @@ class PlatformPurchase { purchaseTime: result[2]! as int, purchaseToken: result[3]! as String, signature: result[4]! as String, - products: (result[5] as List?)!.cast(), + products: (result[5] as List?)!.cast(), isAutoRenewing: result[6]! as bool, originalJson: result[7]! as String, developerPayload: result[8]! as String, isAcknowledged: result[9]! as bool, quantity: result[10]! as int, - purchaseState: PlatformPurchaseState.values[result[11]! as int], - accountIdentifiers: result[12] != null - ? PlatformAccountIdentifiers.decode(result[12]! as List) - : null, + purchaseState: result[11]! as PlatformPurchaseState, + accountIdentifiers: result[12] as PlatformAccountIdentifiers?, ); } } @@ -535,7 +531,7 @@ class PlatformPurchaseHistoryRecord { String signature; - List products; + List products; Object encode() { return [ @@ -558,7 +554,7 @@ class PlatformPurchaseHistoryRecord { originalJson: result[3]! as String, purchaseToken: result[4]! as String, signature: result[5]! as String, - products: (result[6] as List?)!.cast(), + products: (result[6] as List?)!.cast(), ); } } @@ -573,11 +569,11 @@ class PlatformPurchaseHistoryResponse { PlatformBillingResult billingResult; - List purchases; + List purchases; Object encode() { return [ - billingResult.encode(), + billingResult, purchases, ]; } @@ -585,9 +581,9 @@ class PlatformPurchaseHistoryResponse { static PlatformPurchaseHistoryResponse decode(Object result) { result as List; return PlatformPurchaseHistoryResponse( - billingResult: PlatformBillingResult.decode(result[0]! as List), + billingResult: result[0]! as PlatformBillingResult, purchases: - (result[1] as List?)!.cast(), + (result[1] as List?)!.cast(), ); } } @@ -602,11 +598,11 @@ class PlatformPurchasesResponse { PlatformBillingResult billingResult; - List purchases; + List purchases; Object encode() { return [ - billingResult.encode(), + billingResult, purchases, ]; } @@ -614,8 +610,8 @@ class PlatformPurchasesResponse { static PlatformPurchasesResponse decode(Object result) { result as List; return PlatformPurchasesResponse( - billingResult: PlatformBillingResult.decode(result[0]! as List), - purchases: (result[1] as List?)!.cast(), + billingResult: result[0]! as PlatformBillingResult, + purchases: (result[1] as List?)!.cast(), ); } } @@ -636,9 +632,9 @@ class PlatformSubscriptionOfferDetails { String offerToken; - List offerTags; + List offerTags; - List pricingPhases; + List pricingPhases; Object encode() { return [ @@ -656,9 +652,9 @@ class PlatformSubscriptionOfferDetails { basePlanId: result[0]! as String, offerId: result[1] as String?, offerToken: result[2]! as String, - offerTags: (result[3] as List?)!.cast(), + offerTags: (result[3] as List?)!.cast(), pricingPhases: - (result[4] as List?)!.cast(), + (result[4] as List?)!.cast(), ); } } @@ -675,7 +671,7 @@ class PlatformUserChoiceDetails { String externalTransactionToken; - List products; + List products; Object encode() { return [ @@ -691,7 +687,7 @@ class PlatformUserChoiceDetails { originalExternalTransactionId: result[0] as String?, externalTransactionToken: result[1]! as String, products: - (result[2] as List?)!.cast(), + (result[2] as List?)!.cast(), ); } } @@ -714,7 +710,7 @@ class PlatformUserChoiceProduct { return [ id, offerToken, - type.index, + type, ]; } @@ -723,61 +719,82 @@ class PlatformUserChoiceProduct { return PlatformUserChoiceProduct( id: result[0]! as String, offerToken: result[1] as String?, - type: PlatformProductType.values[result[2]! as int], + type: result[2]! as PlatformProductType, ); } } -class _InAppPurchaseApiCodec extends StandardMessageCodec { - const _InAppPurchaseApiCodec(); +class _PigeonCodec extends StandardMessageCodec { + const _PigeonCodec(); @override void writeValue(WriteBuffer buffer, Object? value) { - if (value is PlatformAccountIdentifiers) { - buffer.putUint8(128); - writeValue(buffer, value.encode()); - } else if (value - is PlatformAlternativeBillingOnlyReportingDetailsResponse) { + if (value is int) { + buffer.putUint8(4); + buffer.putInt64(value); + } else if (value is PlatformProductType) { buffer.putUint8(129); - writeValue(buffer, value.encode()); - } else if (value is PlatformBillingConfigResponse) { + writeValue(buffer, value.index); + } else if (value is PlatformBillingChoiceMode) { buffer.putUint8(130); - writeValue(buffer, value.encode()); - } else if (value is PlatformBillingFlowParams) { + writeValue(buffer, value.index); + } else if (value is PlatformPurchaseState) { buffer.putUint8(131); - writeValue(buffer, value.encode()); - } else if (value is PlatformBillingResult) { + writeValue(buffer, value.index); + } else if (value is PlatformRecurrenceMode) { buffer.putUint8(132); - writeValue(buffer, value.encode()); - } else if (value is PlatformOneTimePurchaseOfferDetails) { + writeValue(buffer, value.index); + } else if (value is PlatformQueryProduct) { buffer.putUint8(133); writeValue(buffer, value.encode()); - } else if (value is PlatformPricingPhase) { + } else if (value is PlatformAccountIdentifiers) { buffer.putUint8(134); writeValue(buffer, value.encode()); - } else if (value is PlatformProductDetails) { + } else if (value is PlatformBillingResult) { buffer.putUint8(135); writeValue(buffer, value.encode()); - } else if (value is PlatformProductDetailsResponse) { + } else if (value is PlatformOneTimePurchaseOfferDetails) { buffer.putUint8(136); writeValue(buffer, value.encode()); - } else if (value is PlatformPurchase) { + } else if (value is PlatformProductDetails) { buffer.putUint8(137); writeValue(buffer, value.encode()); - } else if (value is PlatformPurchaseHistoryRecord) { + } else if (value is PlatformProductDetailsResponse) { buffer.putUint8(138); writeValue(buffer, value.encode()); - } else if (value is PlatformPurchaseHistoryResponse) { + } else if (value + is PlatformAlternativeBillingOnlyReportingDetailsResponse) { buffer.putUint8(139); writeValue(buffer, value.encode()); - } else if (value is PlatformPurchasesResponse) { + } else if (value is PlatformBillingConfigResponse) { buffer.putUint8(140); writeValue(buffer, value.encode()); - } else if (value is PlatformQueryProduct) { + } else if (value is PlatformBillingFlowParams) { buffer.putUint8(141); writeValue(buffer, value.encode()); - } else if (value is PlatformSubscriptionOfferDetails) { + } else if (value is PlatformPricingPhase) { buffer.putUint8(142); writeValue(buffer, value.encode()); + } else if (value is PlatformPurchase) { + buffer.putUint8(143); + writeValue(buffer, value.encode()); + } else if (value is PlatformPurchaseHistoryRecord) { + buffer.putUint8(144); + writeValue(buffer, value.encode()); + } else if (value is PlatformPurchaseHistoryResponse) { + buffer.putUint8(145); + writeValue(buffer, value.encode()); + } else if (value is PlatformPurchasesResponse) { + buffer.putUint8(146); + writeValue(buffer, value.encode()); + } else if (value is PlatformSubscriptionOfferDetails) { + buffer.putUint8(147); + writeValue(buffer, value.encode()); + } else if (value is PlatformUserChoiceDetails) { + buffer.putUint8(148); + writeValue(buffer, value.encode()); + } else if (value is PlatformUserChoiceProduct) { + buffer.putUint8(149); + writeValue(buffer, value.encode()); } else { super.writeValue(buffer, value); } @@ -786,37 +803,53 @@ class _InAppPurchaseApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: - return PlatformAccountIdentifiers.decode(readValue(buffer)!); case 129: - return PlatformAlternativeBillingOnlyReportingDetailsResponse.decode( - readValue(buffer)!); + final int? value = readValue(buffer) as int?; + return value == null ? null : PlatformProductType.values[value]; case 130: - return PlatformBillingConfigResponse.decode(readValue(buffer)!); + final int? value = readValue(buffer) as int?; + return value == null ? null : PlatformBillingChoiceMode.values[value]; case 131: - return PlatformBillingFlowParams.decode(readValue(buffer)!); + final int? value = readValue(buffer) as int?; + return value == null ? null : PlatformPurchaseState.values[value]; case 132: - return PlatformBillingResult.decode(readValue(buffer)!); + final int? value = readValue(buffer) as int?; + return value == null ? null : PlatformRecurrenceMode.values[value]; case 133: - return PlatformOneTimePurchaseOfferDetails.decode(readValue(buffer)!); + return PlatformQueryProduct.decode(readValue(buffer)!); case 134: - return PlatformPricingPhase.decode(readValue(buffer)!); + return PlatformAccountIdentifiers.decode(readValue(buffer)!); case 135: - return PlatformProductDetails.decode(readValue(buffer)!); + return PlatformBillingResult.decode(readValue(buffer)!); case 136: - return PlatformProductDetailsResponse.decode(readValue(buffer)!); + return PlatformOneTimePurchaseOfferDetails.decode(readValue(buffer)!); case 137: - return PlatformPurchase.decode(readValue(buffer)!); + return PlatformProductDetails.decode(readValue(buffer)!); case 138: - return PlatformPurchaseHistoryRecord.decode(readValue(buffer)!); + return PlatformProductDetailsResponse.decode(readValue(buffer)!); case 139: - return PlatformPurchaseHistoryResponse.decode(readValue(buffer)!); + return PlatformAlternativeBillingOnlyReportingDetailsResponse.decode( + readValue(buffer)!); case 140: - return PlatformPurchasesResponse.decode(readValue(buffer)!); + return PlatformBillingConfigResponse.decode(readValue(buffer)!); case 141: - return PlatformQueryProduct.decode(readValue(buffer)!); + return PlatformBillingFlowParams.decode(readValue(buffer)!); case 142: + return PlatformPricingPhase.decode(readValue(buffer)!); + case 143: + return PlatformPurchase.decode(readValue(buffer)!); + case 144: + return PlatformPurchaseHistoryRecord.decode(readValue(buffer)!); + case 145: + return PlatformPurchaseHistoryResponse.decode(readValue(buffer)!); + case 146: + return PlatformPurchasesResponse.decode(readValue(buffer)!); + case 147: return PlatformSubscriptionOfferDetails.decode(readValue(buffer)!); + case 148: + return PlatformUserChoiceDetails.decode(readValue(buffer)!); + case 149: + return PlatformUserChoiceProduct.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); } @@ -827,93 +860,97 @@ class InAppPurchaseApi { /// Constructor for [InAppPurchaseApi]. The [binaryMessenger] named argument is /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. - InAppPurchaseApi({BinaryMessenger? binaryMessenger}) - : __pigeon_binaryMessenger = binaryMessenger; - final BinaryMessenger? __pigeon_binaryMessenger; + InAppPurchaseApi( + {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) + : pigeonVar_binaryMessenger = binaryMessenger, + pigeonVar_messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + final BinaryMessenger? pigeonVar_binaryMessenger; + + static const MessageCodec pigeonChannelCodec = _PigeonCodec(); - static const MessageCodec pigeonChannelCodec = - _InAppPurchaseApiCodec(); + final String pigeonVar_messageChannelSuffix; /// Wraps BillingClient#isReady. Future isReady() async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.isReady'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.isReady$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as bool?)!; + return (pigeonVar_replyList[0] as bool?)!; } } /// Wraps BillingClient#startConnection(BillingClientStateListener). Future startConnection( int callbackHandle, PlatformBillingChoiceMode billingMode) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.startConnection'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.startConnection$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([callbackHandle, billingMode.index]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = await pigeonVar_channel + .send([callbackHandle, billingMode]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as PlatformBillingResult?)!; + return (pigeonVar_replyList[0] as PlatformBillingResult?)!; } } /// Wraps BillingClient#endConnection(BillingClientStateListener). Future endConnection() async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.endConnection'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.endConnection$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -922,394 +959,345 @@ class InAppPurchaseApi { /// Wraps BillingClient#getBillingConfigAsync(GetBillingConfigParams, BillingConfigResponseListener). Future getBillingConfigAsync() async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.getBillingConfigAsync'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.getBillingConfigAsync$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as PlatformBillingConfigResponse?)!; + return (pigeonVar_replyList[0] as PlatformBillingConfigResponse?)!; } } /// Wraps BillingClient#launchBillingFlow(Activity, BillingFlowParams). Future launchBillingFlow( PlatformBillingFlowParams params) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.launchBillingFlow'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.launchBillingFlow$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([params]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([params]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as PlatformBillingResult?)!; + return (pigeonVar_replyList[0] as PlatformBillingResult?)!; } } /// Wraps BillingClient#acknowledgePurchase(AcknowledgePurchaseParams, AcknowledgePurchaseResponseListener). Future acknowledgePurchase( String purchaseToken) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.acknowledgePurchase'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.acknowledgePurchase$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([purchaseToken]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = await pigeonVar_channel + .send([purchaseToken]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as PlatformBillingResult?)!; + return (pigeonVar_replyList[0] as PlatformBillingResult?)!; } } /// Wraps BillingClient#consumeAsync(ConsumeParams, ConsumeResponseListener). Future consumeAsync(String purchaseToken) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.consumeAsync'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.consumeAsync$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([purchaseToken]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = await pigeonVar_channel + .send([purchaseToken]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as PlatformBillingResult?)!; + return (pigeonVar_replyList[0] as PlatformBillingResult?)!; } } /// Wraps BillingClient#queryPurchasesAsync(QueryPurchaseParams, PurchaseResponseListener). Future queryPurchasesAsync( PlatformProductType productType) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.queryPurchasesAsync'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.queryPurchasesAsync$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([productType.index]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([productType]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as PlatformPurchasesResponse?)!; + return (pigeonVar_replyList[0] as PlatformPurchasesResponse?)!; } } /// Wraps BillingClient#queryPurchaseHistoryAsync(QueryPurchaseHistoryParams, PurchaseHistoryResponseListener). Future queryPurchaseHistoryAsync( PlatformProductType productType) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.queryPurchaseHistoryAsync'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.queryPurchaseHistoryAsync$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([productType.index]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([productType]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as PlatformPurchaseHistoryResponse?)!; + return (pigeonVar_replyList[0] as PlatformPurchaseHistoryResponse?)!; } } /// Wraps BillingClient#queryProductDetailsAsync(QueryProductDetailsParams, ProductDetailsResponseListener). Future queryProductDetailsAsync( - List products) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.queryProductDetailsAsync'; - final BasicMessageChannel __pigeon_channel = + List products) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.queryProductDetailsAsync$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([products]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([products]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as PlatformProductDetailsResponse?)!; + return (pigeonVar_replyList[0] as PlatformProductDetailsResponse?)!; } } /// Wraps BillingClient#isFeatureSupported(String). Future isFeatureSupported(String feature) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.isFeatureSupported'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.isFeatureSupported$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([feature]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([feature]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as bool?)!; + return (pigeonVar_replyList[0] as bool?)!; } } /// Wraps BillingClient#isAlternativeBillingOnlyAvailableAsync(). Future isAlternativeBillingOnlyAvailableAsync() async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.isAlternativeBillingOnlyAvailableAsync'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.isAlternativeBillingOnlyAvailableAsync$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as PlatformBillingResult?)!; + return (pigeonVar_replyList[0] as PlatformBillingResult?)!; } } /// Wraps BillingClient#showAlternativeBillingOnlyInformationDialog(). Future showAlternativeBillingOnlyInformationDialog() async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.showAlternativeBillingOnlyInformationDialog'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.showAlternativeBillingOnlyInformationDialog$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as PlatformBillingResult?)!; + return (pigeonVar_replyList[0] as PlatformBillingResult?)!; } } /// Wraps BillingClient#createAlternativeBillingOnlyReportingDetailsAsync(AlternativeBillingOnlyReportingDetailsListener). Future createAlternativeBillingOnlyReportingDetailsAsync() async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.createAlternativeBillingOnlyReportingDetailsAsync'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseApi.createAlternativeBillingOnlyReportingDetailsAsync$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] + return (pigeonVar_replyList[0] as PlatformAlternativeBillingOnlyReportingDetailsResponse?)!; } } } -class _InAppPurchaseCallbackApiCodec extends StandardMessageCodec { - const _InAppPurchaseCallbackApiCodec(); - @override - void writeValue(WriteBuffer buffer, Object? value) { - if (value is PlatformAccountIdentifiers) { - buffer.putUint8(128); - writeValue(buffer, value.encode()); - } else if (value is PlatformBillingResult) { - buffer.putUint8(129); - writeValue(buffer, value.encode()); - } else if (value is PlatformPurchase) { - buffer.putUint8(130); - writeValue(buffer, value.encode()); - } else if (value is PlatformPurchasesResponse) { - buffer.putUint8(131); - writeValue(buffer, value.encode()); - } else if (value is PlatformUserChoiceDetails) { - buffer.putUint8(132); - writeValue(buffer, value.encode()); - } else if (value is PlatformUserChoiceProduct) { - buffer.putUint8(133); - writeValue(buffer, value.encode()); - } else { - super.writeValue(buffer, value); - } - } - - @override - Object? readValueOfType(int type, ReadBuffer buffer) { - switch (type) { - case 128: - return PlatformAccountIdentifiers.decode(readValue(buffer)!); - case 129: - return PlatformBillingResult.decode(readValue(buffer)!); - case 130: - return PlatformPurchase.decode(readValue(buffer)!); - case 131: - return PlatformPurchasesResponse.decode(readValue(buffer)!); - case 132: - return PlatformUserChoiceDetails.decode(readValue(buffer)!); - case 133: - return PlatformUserChoiceProduct.decode(readValue(buffer)!); - default: - return super.readValueOfType(type, buffer); - } - } -} - abstract class InAppPurchaseCallbackApi { - static const MessageCodec pigeonChannelCodec = - _InAppPurchaseCallbackApiCodec(); + static const MessageCodec pigeonChannelCodec = _PigeonCodec(); /// Called for BillingClientStateListener#onBillingServiceDisconnected(). void onBillingServiceDisconnected(int callbackHandle); @@ -1320,18 +1308,24 @@ abstract class InAppPurchaseCallbackApi { /// Called for UserChoiceBillingListener#userSelectedAlternativeBilling(UserChoiceDetails). void userSelectedalternativeBilling(PlatformUserChoiceDetails details); - static void setup(InAppPurchaseCallbackApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setUp( + InAppPurchaseCallbackApi? api, { + BinaryMessenger? binaryMessenger, + String messageChannelSuffix = '', + }) { + messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseCallbackApi.onBillingServiceDisconnected', + 'dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseCallbackApi.onBillingServiceDisconnected$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseCallbackApi.onBillingServiceDisconnected was null.'); final List args = (message as List?)!; @@ -1351,15 +1345,16 @@ abstract class InAppPurchaseCallbackApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseCallbackApi.onPurchasesUpdated', + 'dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseCallbackApi.onPurchasesUpdated$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseCallbackApi.onPurchasesUpdated was null.'); final List args = (message as List?)!; @@ -1380,15 +1375,16 @@ abstract class InAppPurchaseCallbackApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseCallbackApi.userSelectedalternativeBilling', + 'dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseCallbackApi.userSelectedalternativeBilling$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.in_app_purchase_android.InAppPurchaseCallbackApi.userSelectedalternativeBilling was null.'); final List args = (message as List?)!; diff --git a/packages/in_app_purchase/in_app_purchase_android/lib/src/pigeon_converters.dart b/packages/in_app_purchase/in_app_purchase_android/lib/src/pigeon_converters.dart index 7fe8a3c92f21..bc93f614704f 100644 --- a/packages/in_app_purchase/in_app_purchase_android/lib/src/pigeon_converters.dart +++ b/packages/in_app_purchase/in_app_purchase_android/lib/src/pigeon_converters.dart @@ -32,8 +32,6 @@ ProductDetailsResponseWrapper productDetailsResponseWrapperFromPlatform( return ProductDetailsResponseWrapper( billingResult: resultWrapperFromPlatform(response.billingResult), productDetailsList: response.productDetails - // See TODOs in messages.dart for why casting away nullability is safe. - .map((PlatformProductDetails? p) => p!) .map(productDetailsWrapperFromPlatform) .toList()); } @@ -50,9 +48,7 @@ ProductDetailsWrapper productDetailsWrapperFromPlatform( oneTimePurchaseOfferDetails: oneTimePurchaseOfferDetailsWrapperFromPlatform( product.oneTimePurchaseOfferDetails), subscriptionOfferDetails: product.subscriptionOfferDetails - // See comment in messages.dart for why casting away nullability is safe. - ?.map((PlatformSubscriptionOfferDetails? o) => o!) - .map(subscriptionOfferDetailsWrapperFromPlatform) + ?.map(subscriptionOfferDetailsWrapperFromPlatform) .toList(), ); } @@ -77,8 +73,6 @@ PurchasesHistoryResult purchaseHistoryResultFromPlatform( return PurchasesHistoryResult( billingResult: resultWrapperFromPlatform(response.billingResult), purchaseHistoryRecordList: response.purchases - // See comment in messages.dart for why casting away nullability is safe. - .map((PlatformPurchaseHistoryRecord? r) => r!) .map(purchaseHistoryRecordWrapperFromPlatform) .toList(), ); @@ -91,8 +85,7 @@ PurchaseHistoryRecordWrapper purchaseHistoryRecordWrapperFromPlatform( purchaseTime: record.purchaseTime, purchaseToken: record.purchaseToken, signature: record.signature, - // See comment in messages.dart for why casting away nullability is safe. - products: record.products.map((String? s) => s!).toList(), + products: record.products, originalJson: record.originalJson, developerPayload: record.developerPayload, ); @@ -104,11 +97,7 @@ PurchasesResultWrapper purchasesResultWrapperFromPlatform( {bool forceOkResponseCode = false}) { return PurchasesResultWrapper( billingResult: resultWrapperFromPlatform(response.billingResult), - purchasesList: response.purchases - // See TODOs in messages.dart for why casting away nullability is safe. - .map((PlatformPurchase? p) => p!) - .map(purchaseWrapperFromPlatform) - .toList(), + purchasesList: response.purchases.map(purchaseWrapperFromPlatform).toList(), responseCode: forceOkResponseCode ? BillingResponse.ok : const BillingResponseConverter() @@ -185,8 +174,7 @@ PurchaseWrapper purchaseWrapperFromPlatform(PlatformPurchase purchase) { purchaseTime: purchase.purchaseTime, purchaseToken: purchase.purchaseToken, signature: purchase.signature, - // See comment in messages.dart for why casting away nullability is safe. - products: purchase.products.map((String? s) => s!).toList(), + products: purchase.products, isAutoRenewing: purchase.isAutoRenewing, originalJson: purchase.originalJson, isAcknowledged: purchase.isAcknowledged, @@ -223,14 +211,10 @@ SubscriptionOfferDetailsWrapper subscriptionOfferDetailsWrapperFromPlatform( return SubscriptionOfferDetailsWrapper( basePlanId: offer.basePlanId, offerId: offer.offerId, - // See comment in messages.dart for why casting away nullability is safe. - offerTags: offer.offerTags.map((String? s) => s!).toList(), + offerTags: offer.offerTags, offerIdToken: offer.offerToken, - pricingPhases: offer.pricingPhases - // See comment in messages.dart for why casting away nullability is safe. - .map((PlatformPricingPhase? p) => p!) - .map(pricingPhaseWrapperFromPlatform) - .toList(), + pricingPhases: + offer.pricingPhases.map(pricingPhaseWrapperFromPlatform).toList(), ); } @@ -240,11 +224,8 @@ UserChoiceDetailsWrapper userChoiceDetailsFromPlatform( return UserChoiceDetailsWrapper( originalExternalTransactionId: details.originalExternalTransactionId ?? '', externalTransactionToken: details.externalTransactionToken, - products: details.products - // See comment in messages.dart for why casting away nullability is safe. - .map((PlatformUserChoiceProduct? p) => p!) - .map(userChoiceDetailsProductFromPlatform) - .toList(), + products: + details.products.map(userChoiceDetailsProductFromPlatform).toList(), ); } diff --git a/packages/in_app_purchase/in_app_purchase_android/pigeons/messages.dart b/packages/in_app_purchase/in_app_purchase_android/pigeons/messages.dart index d0bbc51e973e..3c15cc4750a9 100644 --- a/packages/in_app_purchase/in_app_purchase_android/pigeons/messages.dart +++ b/packages/in_app_purchase/in_app_purchase_android/pigeons/messages.dart @@ -70,11 +70,7 @@ class PlatformProductDetails { final PlatformProductType productType; final String title; final PlatformOneTimePurchaseOfferDetails? oneTimePurchaseOfferDetails; - // TODO(stuartmorgan): Make the generic type non-nullable once supported. - // https://github.com/flutter/flutter/issues/97848 - // The consuming code treats it (the entries, not the list itself) as - // non-nullable. - final List? subscriptionOfferDetails; + final List? subscriptionOfferDetails; } /// Pigeon version of ProductDetailsResponseWrapper, which contains the @@ -86,10 +82,7 @@ class PlatformProductDetailsResponse { }); final PlatformBillingResult billingResult; - // TODO(stuartmorgan): Make the generic type non-nullable once supported. - // https://github.com/flutter/flutter/issues/97848 - // The consuming code treats it as non-nullable. - final List productDetails; + final List productDetails; } /// Pigeon version of AlternativeBillingOnlyReportingDetailsWrapper, which @@ -183,10 +176,7 @@ class PlatformPurchase { final int purchaseTime; final String purchaseToken; final String signature; - // TODO(stuartmorgan): Make the type non-nullable once supported. - // https://github.com/flutter/flutter/issues/97848 - // The consuming code treats it as non-nullable. - final List products; + final List products; final bool isAutoRenewing; final String originalJson; final String developerPayload; @@ -216,10 +206,7 @@ class PlatformPurchaseHistoryRecord { final String originalJson; final String purchaseToken; final String signature; - // TODO(stuartmorgan): Make the type non-nullable once supported. - // https://github.com/flutter/flutter/issues/97848 - // The consuming code treats it as non-nullable. - final List products; + final List products; } /// Pigeon version of PurchasesHistoryResult, which contains the components of @@ -231,10 +218,7 @@ class PlatformPurchaseHistoryResponse { }); final PlatformBillingResult billingResult; - // TODO(stuartmorgan): Make the type non-nullable once supported. - // https://github.com/flutter/flutter/issues/97848 - // The consuming code treats it as non-nullable. - final List purchases; + final List purchases; } /// Pigeon version of PurchasesResultWrapper, which contains the components of @@ -246,10 +230,7 @@ class PlatformPurchasesResponse { }); final PlatformBillingResult billingResult; - // TODO(stuartmorgan): Make the generic type non-nullable once supported. - // https://github.com/flutter/flutter/issues/97848 - // The consuming code treats it as non-nullable. - final List purchases; + final List purchases; } /// Pigeon version of Java ProductDetails.SubscriptionOfferDetails. @@ -265,18 +246,12 @@ class PlatformSubscriptionOfferDetails { final String basePlanId; final String? offerId; final String offerToken; - // TODO(stuartmorgan): Make the generic type non-nullable once supported. - // https://github.com/flutter/flutter/issues/97848 - // The consuming code treats it as non-nullable. - final List offerTags; + final List offerTags; // On the native side this is actually a class called PricingPhases, // which contains nothing but a List. Since this is an // internal API, we can always add that indirection later if we need it, // so for now this bypasses that unnecessary wrapper. - // TODO(stuartmorgan): Make the generic type non-nullable once supported. - // https://github.com/flutter/flutter/issues/97848 - // The consuming code treats it as non-nullable. - final List pricingPhases; + final List pricingPhases; } /// Pigeon version of UserChoiceDetailsWrapper and Java UserChoiceDetails. @@ -289,10 +264,7 @@ class PlatformUserChoiceDetails { final String? originalExternalTransactionId; final String externalTransactionToken; - // TODO(stuartmorgan): Make the generic type non-nullable once supported. - // https://github.com/flutter/flutter/issues/97848 - // The consuming code treats it as non-nullable. - final List products; + final List products; } /// Pigeon version of UserChoiseDetails.Product. 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 ada1431e51a7..dfd6878462d8 100644 --- a/packages/in_app_purchase/in_app_purchase_android/pubspec.yaml +++ b/packages/in_app_purchase/in_app_purchase_android/pubspec.yaml @@ -2,11 +2,11 @@ name: in_app_purchase_android description: An implementation for the Android platform of the Flutter `in_app_purchase` plugin. This uses the Android BillingClient APIs. repository: https://github.com/flutter/packages/tree/main/packages/in_app_purchase/in_app_purchase_android issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+in_app_purchase%22 -version: 0.3.6+6 +version: 0.3.6+11 environment: - sdk: ^3.4.0 - flutter: ">=3.22.0" + sdk: ^3.5.0 + flutter: ">=3.24.0" flutter: plugin: @@ -28,8 +28,8 @@ dev_dependencies: flutter_test: sdk: flutter json_serializable: ^6.3.1 - mockito: 5.4.4 - pigeon: ^17.1.1 + mockito: ^5.4.4 + pigeon: ^22.4.2 test: ^1.16.0 topics: diff --git a/packages/in_app_purchase/in_app_purchase_android/test/billing_client_wrappers/billing_client_wrapper_test.mocks.dart b/packages/in_app_purchase/in_app_purchase_android/test/billing_client_wrappers/billing_client_wrapper_test.mocks.dart index 1fd6c3382453..5a93a96f9754 100644 --- a/packages/in_app_purchase/in_app_purchase_android/test/billing_client_wrappers/billing_client_wrapper_test.mocks.dart +++ b/packages/in_app_purchase/in_app_purchase_android/test/billing_client_wrappers/billing_client_wrapper_test.mocks.dart @@ -3,10 +3,11 @@ // Do not manually edit this file. // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:async' as _i3; +import 'dart:async' as _i4; import 'package:in_app_purchase_android/src/messages.g.dart' as _i2; import 'package:mockito/mockito.dart' as _i1; +import 'package:mockito/src/dummies.dart' as _i3; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values @@ -93,17 +94,30 @@ class _FakePlatformAlternativeBillingOnlyReportingDetailsResponse_5 /// See the documentation for Mockito's code generation for more information. class MockInAppPurchaseApi extends _i1.Mock implements _i2.InAppPurchaseApi { @override - _i3.Future isReady() => (super.noSuchMethod( + String get pigeonVar_messageChannelSuffix => (super.noSuchMethod( + Invocation.getter(#pigeonVar_messageChannelSuffix), + returnValue: _i3.dummyValue( + this, + Invocation.getter(#pigeonVar_messageChannelSuffix), + ), + returnValueForMissingStub: _i3.dummyValue( + this, + Invocation.getter(#pigeonVar_messageChannelSuffix), + ), + ) as String); + + @override + _i4.Future isReady() => (super.noSuchMethod( Invocation.method( #isReady, [], ), - returnValue: _i3.Future.value(false), - returnValueForMissingStub: _i3.Future.value(false), - ) as _i3.Future); + returnValue: _i4.Future.value(false), + returnValueForMissingStub: _i4.Future.value(false), + ) as _i4.Future); @override - _i3.Future<_i2.PlatformBillingResult> startConnection( + _i4.Future<_i2.PlatformBillingResult> startConnection( int? callbackHandle, _i2.PlatformBillingChoiceMode? billingMode, ) => @@ -115,7 +129,7 @@ class MockInAppPurchaseApi extends _i1.Mock implements _i2.InAppPurchaseApi { billingMode, ], ), - returnValue: _i3.Future<_i2.PlatformBillingResult>.value( + returnValue: _i4.Future<_i2.PlatformBillingResult>.value( _FakePlatformBillingResult_0( this, Invocation.method( @@ -126,7 +140,7 @@ class MockInAppPurchaseApi extends _i1.Mock implements _i2.InAppPurchaseApi { ], ), )), - returnValueForMissingStub: _i3.Future<_i2.PlatformBillingResult>.value( + returnValueForMissingStub: _i4.Future<_i2.PlatformBillingResult>.value( _FakePlatformBillingResult_0( this, Invocation.method( @@ -137,26 +151,26 @@ class MockInAppPurchaseApi extends _i1.Mock implements _i2.InAppPurchaseApi { ], ), )), - ) as _i3.Future<_i2.PlatformBillingResult>); + ) as _i4.Future<_i2.PlatformBillingResult>); @override - _i3.Future endConnection() => (super.noSuchMethod( + _i4.Future endConnection() => (super.noSuchMethod( Invocation.method( #endConnection, [], ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i3.Future<_i2.PlatformBillingConfigResponse> getBillingConfigAsync() => + _i4.Future<_i2.PlatformBillingConfigResponse> getBillingConfigAsync() => (super.noSuchMethod( Invocation.method( #getBillingConfigAsync, [], ), - returnValue: _i3.Future<_i2.PlatformBillingConfigResponse>.value( + returnValue: _i4.Future<_i2.PlatformBillingConfigResponse>.value( _FakePlatformBillingConfigResponse_1( this, Invocation.method( @@ -165,7 +179,7 @@ class MockInAppPurchaseApi extends _i1.Mock implements _i2.InAppPurchaseApi { ), )), returnValueForMissingStub: - _i3.Future<_i2.PlatformBillingConfigResponse>.value( + _i4.Future<_i2.PlatformBillingConfigResponse>.value( _FakePlatformBillingConfigResponse_1( this, Invocation.method( @@ -173,17 +187,17 @@ class MockInAppPurchaseApi extends _i1.Mock implements _i2.InAppPurchaseApi { [], ), )), - ) as _i3.Future<_i2.PlatformBillingConfigResponse>); + ) as _i4.Future<_i2.PlatformBillingConfigResponse>); @override - _i3.Future<_i2.PlatformBillingResult> launchBillingFlow( + _i4.Future<_i2.PlatformBillingResult> launchBillingFlow( _i2.PlatformBillingFlowParams? params) => (super.noSuchMethod( Invocation.method( #launchBillingFlow, [params], ), - returnValue: _i3.Future<_i2.PlatformBillingResult>.value( + returnValue: _i4.Future<_i2.PlatformBillingResult>.value( _FakePlatformBillingResult_0( this, Invocation.method( @@ -191,7 +205,7 @@ class MockInAppPurchaseApi extends _i1.Mock implements _i2.InAppPurchaseApi { [params], ), )), - returnValueForMissingStub: _i3.Future<_i2.PlatformBillingResult>.value( + returnValueForMissingStub: _i4.Future<_i2.PlatformBillingResult>.value( _FakePlatformBillingResult_0( this, Invocation.method( @@ -199,17 +213,17 @@ class MockInAppPurchaseApi extends _i1.Mock implements _i2.InAppPurchaseApi { [params], ), )), - ) as _i3.Future<_i2.PlatformBillingResult>); + ) as _i4.Future<_i2.PlatformBillingResult>); @override - _i3.Future<_i2.PlatformBillingResult> acknowledgePurchase( + _i4.Future<_i2.PlatformBillingResult> acknowledgePurchase( String? purchaseToken) => (super.noSuchMethod( Invocation.method( #acknowledgePurchase, [purchaseToken], ), - returnValue: _i3.Future<_i2.PlatformBillingResult>.value( + returnValue: _i4.Future<_i2.PlatformBillingResult>.value( _FakePlatformBillingResult_0( this, Invocation.method( @@ -217,7 +231,7 @@ class MockInAppPurchaseApi extends _i1.Mock implements _i2.InAppPurchaseApi { [purchaseToken], ), )), - returnValueForMissingStub: _i3.Future<_i2.PlatformBillingResult>.value( + returnValueForMissingStub: _i4.Future<_i2.PlatformBillingResult>.value( _FakePlatformBillingResult_0( this, Invocation.method( @@ -225,16 +239,16 @@ class MockInAppPurchaseApi extends _i1.Mock implements _i2.InAppPurchaseApi { [purchaseToken], ), )), - ) as _i3.Future<_i2.PlatformBillingResult>); + ) as _i4.Future<_i2.PlatformBillingResult>); @override - _i3.Future<_i2.PlatformBillingResult> consumeAsync(String? purchaseToken) => + _i4.Future<_i2.PlatformBillingResult> consumeAsync(String? purchaseToken) => (super.noSuchMethod( Invocation.method( #consumeAsync, [purchaseToken], ), - returnValue: _i3.Future<_i2.PlatformBillingResult>.value( + returnValue: _i4.Future<_i2.PlatformBillingResult>.value( _FakePlatformBillingResult_0( this, Invocation.method( @@ -242,7 +256,7 @@ class MockInAppPurchaseApi extends _i1.Mock implements _i2.InAppPurchaseApi { [purchaseToken], ), )), - returnValueForMissingStub: _i3.Future<_i2.PlatformBillingResult>.value( + returnValueForMissingStub: _i4.Future<_i2.PlatformBillingResult>.value( _FakePlatformBillingResult_0( this, Invocation.method( @@ -250,17 +264,17 @@ class MockInAppPurchaseApi extends _i1.Mock implements _i2.InAppPurchaseApi { [purchaseToken], ), )), - ) as _i3.Future<_i2.PlatformBillingResult>); + ) as _i4.Future<_i2.PlatformBillingResult>); @override - _i3.Future<_i2.PlatformPurchasesResponse> queryPurchasesAsync( + _i4.Future<_i2.PlatformPurchasesResponse> queryPurchasesAsync( _i2.PlatformProductType? productType) => (super.noSuchMethod( Invocation.method( #queryPurchasesAsync, [productType], ), - returnValue: _i3.Future<_i2.PlatformPurchasesResponse>.value( + returnValue: _i4.Future<_i2.PlatformPurchasesResponse>.value( _FakePlatformPurchasesResponse_2( this, Invocation.method( @@ -269,7 +283,7 @@ class MockInAppPurchaseApi extends _i1.Mock implements _i2.InAppPurchaseApi { ), )), returnValueForMissingStub: - _i3.Future<_i2.PlatformPurchasesResponse>.value( + _i4.Future<_i2.PlatformPurchasesResponse>.value( _FakePlatformPurchasesResponse_2( this, Invocation.method( @@ -277,17 +291,17 @@ class MockInAppPurchaseApi extends _i1.Mock implements _i2.InAppPurchaseApi { [productType], ), )), - ) as _i3.Future<_i2.PlatformPurchasesResponse>); + ) as _i4.Future<_i2.PlatformPurchasesResponse>); @override - _i3.Future<_i2.PlatformPurchaseHistoryResponse> queryPurchaseHistoryAsync( + _i4.Future<_i2.PlatformPurchaseHistoryResponse> queryPurchaseHistoryAsync( _i2.PlatformProductType? productType) => (super.noSuchMethod( Invocation.method( #queryPurchaseHistoryAsync, [productType], ), - returnValue: _i3.Future<_i2.PlatformPurchaseHistoryResponse>.value( + returnValue: _i4.Future<_i2.PlatformPurchaseHistoryResponse>.value( _FakePlatformPurchaseHistoryResponse_3( this, Invocation.method( @@ -296,7 +310,7 @@ class MockInAppPurchaseApi extends _i1.Mock implements _i2.InAppPurchaseApi { ), )), returnValueForMissingStub: - _i3.Future<_i2.PlatformPurchaseHistoryResponse>.value( + _i4.Future<_i2.PlatformPurchaseHistoryResponse>.value( _FakePlatformPurchaseHistoryResponse_3( this, Invocation.method( @@ -304,17 +318,17 @@ class MockInAppPurchaseApi extends _i1.Mock implements _i2.InAppPurchaseApi { [productType], ), )), - ) as _i3.Future<_i2.PlatformPurchaseHistoryResponse>); + ) as _i4.Future<_i2.PlatformPurchaseHistoryResponse>); @override - _i3.Future<_i2.PlatformProductDetailsResponse> queryProductDetailsAsync( - List<_i2.PlatformQueryProduct?>? products) => + _i4.Future<_i2.PlatformProductDetailsResponse> queryProductDetailsAsync( + List<_i2.PlatformQueryProduct>? products) => (super.noSuchMethod( Invocation.method( #queryProductDetailsAsync, [products], ), - returnValue: _i3.Future<_i2.PlatformProductDetailsResponse>.value( + returnValue: _i4.Future<_i2.PlatformProductDetailsResponse>.value( _FakePlatformProductDetailsResponse_4( this, Invocation.method( @@ -323,7 +337,7 @@ class MockInAppPurchaseApi extends _i1.Mock implements _i2.InAppPurchaseApi { ), )), returnValueForMissingStub: - _i3.Future<_i2.PlatformProductDetailsResponse>.value( + _i4.Future<_i2.PlatformProductDetailsResponse>.value( _FakePlatformProductDetailsResponse_4( this, Invocation.method( @@ -331,26 +345,26 @@ class MockInAppPurchaseApi extends _i1.Mock implements _i2.InAppPurchaseApi { [products], ), )), - ) as _i3.Future<_i2.PlatformProductDetailsResponse>); + ) as _i4.Future<_i2.PlatformProductDetailsResponse>); @override - _i3.Future isFeatureSupported(String? feature) => (super.noSuchMethod( + _i4.Future isFeatureSupported(String? feature) => (super.noSuchMethod( Invocation.method( #isFeatureSupported, [feature], ), - returnValue: _i3.Future.value(false), - returnValueForMissingStub: _i3.Future.value(false), - ) as _i3.Future); + returnValue: _i4.Future.value(false), + returnValueForMissingStub: _i4.Future.value(false), + ) as _i4.Future); @override - _i3.Future<_i2.PlatformBillingResult> + _i4.Future<_i2.PlatformBillingResult> isAlternativeBillingOnlyAvailableAsync() => (super.noSuchMethod( Invocation.method( #isAlternativeBillingOnlyAvailableAsync, [], ), - returnValue: _i3.Future<_i2.PlatformBillingResult>.value( + returnValue: _i4.Future<_i2.PlatformBillingResult>.value( _FakePlatformBillingResult_0( this, Invocation.method( @@ -359,7 +373,7 @@ class MockInAppPurchaseApi extends _i1.Mock implements _i2.InAppPurchaseApi { ), )), returnValueForMissingStub: - _i3.Future<_i2.PlatformBillingResult>.value( + _i4.Future<_i2.PlatformBillingResult>.value( _FakePlatformBillingResult_0( this, Invocation.method( @@ -367,16 +381,16 @@ class MockInAppPurchaseApi extends _i1.Mock implements _i2.InAppPurchaseApi { [], ), )), - ) as _i3.Future<_i2.PlatformBillingResult>); + ) as _i4.Future<_i2.PlatformBillingResult>); @override - _i3.Future<_i2.PlatformBillingResult> + _i4.Future<_i2.PlatformBillingResult> showAlternativeBillingOnlyInformationDialog() => (super.noSuchMethod( Invocation.method( #showAlternativeBillingOnlyInformationDialog, [], ), - returnValue: _i3.Future<_i2.PlatformBillingResult>.value( + returnValue: _i4.Future<_i2.PlatformBillingResult>.value( _FakePlatformBillingResult_0( this, Invocation.method( @@ -385,7 +399,7 @@ class MockInAppPurchaseApi extends _i1.Mock implements _i2.InAppPurchaseApi { ), )), returnValueForMissingStub: - _i3.Future<_i2.PlatformBillingResult>.value( + _i4.Future<_i2.PlatformBillingResult>.value( _FakePlatformBillingResult_0( this, Invocation.method( @@ -393,17 +407,17 @@ class MockInAppPurchaseApi extends _i1.Mock implements _i2.InAppPurchaseApi { [], ), )), - ) as _i3.Future<_i2.PlatformBillingResult>); + ) as _i4.Future<_i2.PlatformBillingResult>); @override - _i3.Future<_i2.PlatformAlternativeBillingOnlyReportingDetailsResponse> + _i4.Future<_i2.PlatformAlternativeBillingOnlyReportingDetailsResponse> createAlternativeBillingOnlyReportingDetailsAsync() => (super.noSuchMethod( Invocation.method( #createAlternativeBillingOnlyReportingDetailsAsync, [], ), - returnValue: _i3.Future< + returnValue: _i4.Future< _i2 .PlatformAlternativeBillingOnlyReportingDetailsResponse>.value( _FakePlatformAlternativeBillingOnlyReportingDetailsResponse_5( @@ -413,7 +427,7 @@ class MockInAppPurchaseApi extends _i1.Mock implements _i2.InAppPurchaseApi { [], ), )), - returnValueForMissingStub: _i3.Future< + returnValueForMissingStub: _i4.Future< _i2 .PlatformAlternativeBillingOnlyReportingDetailsResponse>.value( _FakePlatformAlternativeBillingOnlyReportingDetailsResponse_5( @@ -423,6 +437,6 @@ class MockInAppPurchaseApi extends _i1.Mock implements _i2.InAppPurchaseApi { [], ), )), - ) as _i3.Future< + ) as _i4.Future< _i2.PlatformAlternativeBillingOnlyReportingDetailsResponse>); } 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 f2873b6e1d3d..9de0b0133408 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.4 + mockito: ^5.4.4 topics: - in-app-purchase diff --git a/packages/in_app_purchase/in_app_purchase_storekit/CHANGELOG.md b/packages/in_app_purchase/in_app_purchase_storekit/CHANGELOG.md index cfb4faa74074..e34d332e942f 100644 --- a/packages/in_app_purchase/in_app_purchase_storekit/CHANGELOG.md +++ b/packages/in_app_purchase/in_app_purchase_storekit/CHANGELOG.md @@ -1,6 +1,19 @@ -## NEXT +## 0.3.18+3 + +* Updates Pigeon for non-nullable collection type support. + +## 0.3.18+2 + +* Adds support for StoreKit2's `purchase` and `transactions` + +## 0.3.18+1 + +* Adds support for StoreKit2's `canMakePayments` and `products` + +## 0.3.18 * Updates minimum supported SDK version to Flutter 3.19/Dart 3.3. +* Changes the `localizedDescription` field of `SKProductMessage` to allow for null values ## 0.3.17+3 @@ -44,7 +57,7 @@ ## 0.3.12 -* Converts `refreshReceipt()`, `startObservingPaymentQueue()`, `stopObservingPaymentQueue()`, +* Converts `refreshReceipt()`, `startObservingPaymentQueue()`, `stopObservingPaymentQueue()`, `registerPaymentQueueDelegate()`, `removePaymentQueueDelegate()`, `showPriceConsentIfNeeded()` to pigeon. ## 0.3.11 @@ -71,7 +84,7 @@ ## 0.3.7 -* Adds `Future storefront()` in SKPaymentQueueWrapper class. +* Adds `Future storefront()` in SKPaymentQueueWrapper class. ## 0.3.6+7 diff --git a/packages/in_app_purchase/in_app_purchase_storekit/darwin/Classes/FIAObjectTranslator.h b/packages/in_app_purchase/in_app_purchase_storekit/darwin/Classes/FIAObjectTranslator.h index ffb0f1fe9588..bca07a586535 100644 --- a/packages/in_app_purchase/in_app_purchase_storekit/darwin/Classes/FIAObjectTranslator.h +++ b/packages/in_app_purchase/in_app_purchase_storekit/darwin/Classes/FIAObjectTranslator.h @@ -57,33 +57,33 @@ NS_ASSUME_NONNULL_BEGIN withError:(NSString *_Nullable *_Nullable)error API_AVAILABLE(ios(12.2)); -+ (nullable SKPaymentTransactionMessage *)convertTransactionToPigeon: ++ (nullable FIASKPaymentTransactionMessage *)convertTransactionToPigeon: (nullable SKPaymentTransaction *)transaction; -+ (nullable SKStorefrontMessage *)convertStorefrontToPigeon:(nullable SKStorefront *)storefront ++ (nullable FIASKStorefrontMessage *)convertStorefrontToPigeon:(nullable SKStorefront *)storefront API_AVAILABLE(ios(13.0)); -+ (nullable SKPaymentDiscountMessage *)convertPaymentDiscountToPigeon: ++ (nullable FIASKPaymentDiscountMessage *)convertPaymentDiscountToPigeon: (nullable SKPaymentDiscount *)discount API_AVAILABLE(ios(12.2)); -+ (nullable SKPaymentMessage *)convertPaymentToPigeon:(nullable SKPayment *)payment ++ (nullable FIASKPaymentMessage *)convertPaymentToPigeon:(nullable SKPayment *)payment API_AVAILABLE(ios(12.2)); -+ (nullable SKErrorMessage *)convertSKErrorToPigeon:(nullable NSError *)error; ++ (nullable FIASKErrorMessage *)convertSKErrorToPigeon:(nullable NSError *)error; -+ (nullable SKProductsResponseMessage *)convertProductsResponseToPigeon: ++ (nullable FIASKProductsResponseMessage *)convertProductsResponseToPigeon: (nullable SKProductsResponse *)payment; -+ (nullable SKProductMessage *)convertProductToPigeon:(nullable SKProduct *)product ++ (nullable FIASKProductMessage *)convertProductToPigeon:(nullable SKProduct *)product API_AVAILABLE(ios(12.2)); -+ (nullable SKProductDiscountMessage *)convertProductDiscountToPigeon: ++ (nullable FIASKProductDiscountMessage *)convertProductDiscountToPigeon: (nullable SKProductDiscount *)productDiscount API_AVAILABLE(ios(12.2)); -+ (nullable SKPriceLocaleMessage *)convertNSLocaleToPigeon:(nullable NSLocale *)locale ++ (nullable FIASKPriceLocaleMessage *)convertNSLocaleToPigeon:(nullable NSLocale *)locale API_AVAILABLE(ios(12.2)); -+ (nullable SKProductSubscriptionPeriodMessage *)convertSKProductSubscriptionPeriodToPigeon: ++ (nullable FIASKProductSubscriptionPeriodMessage *)convertSKProductSubscriptionPeriodToPigeon: (nullable SKProductSubscriptionPeriod *)period API_AVAILABLE(ios(12.2)); @end diff --git a/packages/in_app_purchase/in_app_purchase_storekit/darwin/Classes/FIAObjectTranslator.m b/packages/in_app_purchase/in_app_purchase_storekit/darwin/Classes/FIAObjectTranslator.m index bf05976534b9..04f9817250b5 100644 --- a/packages/in_app_purchase/in_app_purchase_storekit/darwin/Classes/FIAObjectTranslator.m +++ b/packages/in_app_purchase/in_app_purchase_storekit/darwin/Classes/FIAObjectTranslator.m @@ -291,12 +291,12 @@ + (SKPaymentDiscount *)getSKPaymentDiscountFromMap:(NSDictionary *)map return discount; } -+ (nullable SKPaymentTransactionMessage *)convertTransactionToPigeon: ++ (nullable FIASKPaymentTransactionMessage *)convertTransactionToPigeon: (nullable SKPaymentTransaction *)transaction API_AVAILABLE(ios(12.2)) { if (!transaction) { return nil; } - SKPaymentTransactionMessage *msg = [SKPaymentTransactionMessage + return [FIASKPaymentTransactionMessage makeWithPayment:[self convertPaymentToPigeon:transaction.payment] transactionState:[self convertTransactionStateToPigeon:transaction.transactionState] originalTransaction:transaction.originalTransaction @@ -306,10 +306,9 @@ + (nullable SKPaymentTransactionMessage *)convertTransactionToPigeon: timeIntervalSince1970]] transactionIdentifier:transaction.transactionIdentifier error:[self convertSKErrorToPigeon:transaction.error]]; - return msg; } -+ (nullable SKErrorMessage *)convertSKErrorToPigeon:(nullable NSError *)error { ++ (nullable FIASKErrorMessage *)convertSKErrorToPigeon:(nullable NSError *)error { if (!error) { return nil; } @@ -320,34 +319,31 @@ + (nullable SKErrorMessage *)convertSKErrorToPigeon:(nullable NSError *)error { userInfo[key] = [FIAObjectTranslator encodeNSErrorUserInfo:value]; } - SKErrorMessage *msg = [SKErrorMessage makeWithCode:error.code - domain:error.domain - userInfo:userInfo]; - return msg; + return [FIASKErrorMessage makeWithCode:error.code domain:error.domain userInfo:userInfo]; } -+ (SKPaymentTransactionStateMessage)convertTransactionStateToPigeon: ++ (FIASKPaymentTransactionStateMessage)convertTransactionStateToPigeon: (SKPaymentTransactionState)state { switch (state) { case SKPaymentTransactionStatePurchasing: - return SKPaymentTransactionStateMessagePurchasing; + return FIASKPaymentTransactionStateMessagePurchasing; case SKPaymentTransactionStatePurchased: - return SKPaymentTransactionStateMessagePurchased; + return FIASKPaymentTransactionStateMessagePurchased; case SKPaymentTransactionStateFailed: - return SKPaymentTransactionStateMessageFailed; + return FIASKPaymentTransactionStateMessageFailed; case SKPaymentTransactionStateRestored: - return SKPaymentTransactionStateMessageRestored; + return FIASKPaymentTransactionStateMessageRestored; case SKPaymentTransactionStateDeferred: - return SKPaymentTransactionStateMessageDeferred; + return FIASKPaymentTransactionStateMessageDeferred; } } -+ (nullable SKPaymentMessage *)convertPaymentToPigeon:(nullable SKPayment *)payment ++ (nullable FIASKPaymentMessage *)convertPaymentToPigeon:(nullable SKPayment *)payment API_AVAILABLE(ios(12.2)) { if (!payment) { return nil; } - SKPaymentMessage *msg = [SKPaymentMessage + return [FIASKPaymentMessage makeWithProductIdentifier:payment.productIdentifier applicationUsername:payment.applicationUsername requestData:[[NSString alloc] initWithData:payment.requestData @@ -355,92 +351,85 @@ + (nullable SKPaymentMessage *)convertPaymentToPigeon:(nullable SKPayment *)paym quantity:payment.quantity simulatesAskToBuyInSandbox:payment.simulatesAskToBuyInSandbox paymentDiscount:[self convertPaymentDiscountToPigeon:payment.paymentDiscount]]; - return msg; } -+ (nullable SKPaymentDiscountMessage *)convertPaymentDiscountToPigeon: ++ (nullable FIASKPaymentDiscountMessage *)convertPaymentDiscountToPigeon: (nullable SKPaymentDiscount *)discount API_AVAILABLE(ios(12.2)) { if (!discount) { return nil; } - SKPaymentDiscountMessage *msg = - [SKPaymentDiscountMessage makeWithIdentifier:discount.identifier - keyIdentifier:discount.keyIdentifier - nonce:[discount.nonce UUIDString] - signature:discount.signature - timestamp:[discount.timestamp intValue]]; - - return msg; + return [FIASKPaymentDiscountMessage makeWithIdentifier:discount.identifier + keyIdentifier:discount.keyIdentifier + nonce:[discount.nonce UUIDString] + signature:discount.signature + timestamp:[discount.timestamp intValue]]; } -+ (nullable SKStorefrontMessage *)convertStorefrontToPigeon:(nullable SKStorefront *)storefront ++ (nullable FIASKStorefrontMessage *)convertStorefrontToPigeon:(nullable SKStorefront *)storefront API_AVAILABLE(ios(13.0)) { if (!storefront) { return nil; } - SKStorefrontMessage *msg = [SKStorefrontMessage makeWithCountryCode:storefront.countryCode - identifier:storefront.identifier]; - return msg; + return [FIASKStorefrontMessage makeWithCountryCode:storefront.countryCode + identifier:storefront.identifier]; } -+ (nullable SKProductSubscriptionPeriodMessage *)convertSKProductSubscriptionPeriodToPigeon: ++ (nullable FIASKProductSubscriptionPeriodMessage *)convertSKProductSubscriptionPeriodToPigeon: (nullable SKProductSubscriptionPeriod *)period API_AVAILABLE(ios(12.2)) { if (!period) { return nil; } - SKSubscriptionPeriodUnitMessage unit; + FIASKSubscriptionPeriodUnitMessage unit; switch (period.unit) { case SKProductPeriodUnitDay: - unit = SKSubscriptionPeriodUnitMessageDay; + unit = FIASKSubscriptionPeriodUnitMessageDay; break; case SKProductPeriodUnitWeek: - unit = SKSubscriptionPeriodUnitMessageWeek; + unit = FIASKSubscriptionPeriodUnitMessageWeek; break; case SKProductPeriodUnitMonth: - unit = SKSubscriptionPeriodUnitMessageMonth; + unit = FIASKSubscriptionPeriodUnitMessageMonth; break; case SKProductPeriodUnitYear: - unit = SKSubscriptionPeriodUnitMessageYear; + unit = FIASKSubscriptionPeriodUnitMessageYear; break; } - SKProductSubscriptionPeriodMessage *msg = - [SKProductSubscriptionPeriodMessage makeWithNumberOfUnits:period.numberOfUnits unit:unit]; - - return msg; + return [FIASKProductSubscriptionPeriodMessage makeWithNumberOfUnits:period.numberOfUnits + unit:unit]; } -+ (nullable SKProductDiscountMessage *)convertProductDiscountToPigeon: ++ (nullable FIASKProductDiscountMessage *)convertProductDiscountToPigeon: (nullable SKProductDiscount *)productDiscount API_AVAILABLE(ios(12.2)) { if (!productDiscount) { return nil; } - SKProductDiscountPaymentModeMessage paymentMode; + FIASKProductDiscountPaymentModeMessage paymentMode; switch (productDiscount.paymentMode) { case SKProductDiscountPaymentModeFreeTrial: - paymentMode = SKProductDiscountPaymentModeMessageFreeTrial; + paymentMode = FIASKProductDiscountPaymentModeMessageFreeTrial; break; case SKProductDiscountPaymentModePayAsYouGo: - paymentMode = SKProductDiscountPaymentModeMessagePayAsYouGo; + paymentMode = FIASKProductDiscountPaymentModeMessagePayAsYouGo; break; case SKProductDiscountPaymentModePayUpFront: - paymentMode = SKProductDiscountPaymentModeMessagePayUpFront; + paymentMode = FIASKProductDiscountPaymentModeMessagePayUpFront; break; } - SKProductDiscountTypeMessage type; + FIASKProductDiscountTypeMessage type; switch (productDiscount.type) { case SKProductDiscountTypeIntroductory: - type = SKProductDiscountTypeMessageIntroductory; + type = FIASKProductDiscountTypeMessageIntroductory; break; case SKProductDiscountTypeSubscription: - type = SKProductDiscountTypeMessageSubscription; + type = FIASKProductDiscountTypeMessageSubscription; break; } - SKProductDiscountMessage *msg = [SKProductDiscountMessage + return [FIASKProductDiscountMessage makeWithPrice:productDiscount.price.description priceLocale:[self convertNSLocaleToPigeon:productDiscount.priceLocale] numberOfPeriods:productDiscount.numberOfPeriods @@ -449,37 +438,33 @@ + (nullable SKProductDiscountMessage *)convertProductDiscountToPigeon: .subscriptionPeriod] identifier:productDiscount.identifier type:type]; - - return msg; } -+ (nullable SKPriceLocaleMessage *)convertNSLocaleToPigeon:(nullable NSLocale *)locale ++ (nullable FIASKPriceLocaleMessage *)convertNSLocaleToPigeon:(nullable NSLocale *)locale API_AVAILABLE(ios(12.2)) { if (!locale) { return nil; } - SKPriceLocaleMessage *msg = [SKPriceLocaleMessage makeWithCurrencySymbol:locale.currencySymbol - currencyCode:locale.currencyCode - countryCode:locale.countryCode]; - - return msg; + return [FIASKPriceLocaleMessage makeWithCurrencySymbol:locale.currencySymbol + currencyCode:locale.currencyCode + countryCode:locale.countryCode]; } -+ (nullable SKProductMessage *)convertProductToPigeon:(nullable SKProduct *)product ++ (nullable FIASKProductMessage *)convertProductToPigeon:(nullable SKProduct *)product API_AVAILABLE(ios(12.2)) { if (!product) { return nil; } NSArray *skProductDiscounts = product.discounts; - NSMutableArray *pigeonProductDiscounts = + NSMutableArray *pigeonProductDiscounts = [NSMutableArray arrayWithCapacity:skProductDiscounts.count]; for (SKProductDiscount *productDiscount in skProductDiscounts) { [pigeonProductDiscounts addObject:[self convertProductDiscountToPigeon:productDiscount]]; }; - SKProductMessage *msg = [SKProductMessage + return [FIASKProductMessage makeWithProductIdentifier:product.productIdentifier localizedTitle:product.localizedTitle localizedDescription:product.localizedDescription @@ -490,27 +475,24 @@ + (nullable SKProductMessage *)convertProductToPigeon:(nullable SKProduct *)prod [self convertSKProductSubscriptionPeriodToPigeon:product.subscriptionPeriod] introductoryPrice:[self convertProductDiscountToPigeon:product.introductoryPrice] discounts:pigeonProductDiscounts]; - - return msg; } -+ (nullable SKProductsResponseMessage *)convertProductsResponseToPigeon: ++ (nullable FIASKProductsResponseMessage *)convertProductsResponseToPigeon: (nullable SKProductsResponse *)productsResponse API_AVAILABLE(ios(12.2)) { if (!productsResponse) { return nil; } NSArray *skProducts = productsResponse.products; - NSMutableArray *pigeonProducts = + NSMutableArray *pigeonProducts = [NSMutableArray arrayWithCapacity:skProducts.count]; for (SKProduct *product in skProducts) { [pigeonProducts addObject:[self convertProductToPigeon:product]]; }; - SKProductsResponseMessage *msg = [SKProductsResponseMessage + return [FIASKProductsResponseMessage makeWithProducts:pigeonProducts invalidProductIdentifiers:productsResponse.invalidProductIdentifiers ?: @[]]; - return msg; } @end diff --git a/packages/in_app_purchase/in_app_purchase_storekit/darwin/Classes/InAppPurchasePlugin.swift b/packages/in_app_purchase/in_app_purchase_storekit/darwin/Classes/InAppPurchasePlugin.swift index dad613571388..23b8972c96c1 100644 --- a/packages/in_app_purchase/in_app_purchase_storekit/darwin/Classes/InAppPurchasePlugin.swift +++ b/packages/in_app_purchase/in_app_purchase_storekit/darwin/Classes/InAppPurchasePlugin.swift @@ -11,7 +11,7 @@ import StoreKit import FlutterMacOS #endif -public class InAppPurchasePlugin: NSObject, FlutterPlugin, InAppPurchaseAPI { +public class InAppPurchasePlugin: NSObject, FlutterPlugin, FIAInAppPurchaseAPI { private let receiptManager: FIAPReceiptManager private var productsCache: NSMutableDictionary = [:] private var paymentQueueDelegateCallbackChannel: FlutterMethodChannel? @@ -27,6 +27,21 @@ public class InAppPurchasePlugin: NSObject, FlutterPlugin, InAppPurchaseAPI { // This property is optional, as it requires self to exist to be initialized. public var paymentQueueHandler: FLTPaymentQueueHandlerProtocol? + // This should be an Task, but Task is on available >= iOS 13 + private var _updateListenerTask: Any? + + @available(iOS 13.0, *) + var updateListenerTask: Task<(), Never> { + return self._updateListenerTask as! Task<(), Never> + } + + @available(iOS 13.0, *) + func setListenerTaskAsTask(task: Task<(), Never>) { + self._updateListenerTask = task + } + + var transactionCallbackAPI: InAppPurchase2CallbackAPI? = nil + public static func register(with registrar: FlutterPluginRegistrar) { #if os(iOS) let messenger = registrar.messenger() @@ -40,7 +55,10 @@ public class InAppPurchasePlugin: NSObject, FlutterPlugin, InAppPurchaseAPI { let instance = InAppPurchasePlugin(registrar: registrar) registrar.addMethodCallDelegate(instance, channel: channel) registrar.addApplicationDelegate(instance) - SetUpInAppPurchaseAPI(messenger, instance) + SetUpFIAInAppPurchaseAPI(messenger, instance) + if #available(iOS 15.0, macOS 12.0, *) { + InAppPurchase2APISetup.setUp(binaryMessenger: messenger, api: instance) + } } // This init is used for tests @@ -90,6 +108,7 @@ public class InAppPurchasePlugin: NSObject, FlutterPlugin, InAppPurchaseAPI { let messenger = registrar.messenger #endif setupTransactionObserverChannelIfNeeded(withMessenger: messenger) + self.transactionCallbackAPI = InAppPurchase2CallbackAPI(binaryMessenger: messenger) } // MARK: - Pigeon Functions @@ -101,7 +120,7 @@ public class InAppPurchasePlugin: NSObject, FlutterPlugin, InAppPurchaseAPI { } public func transactionsWithError(_ error: AutoreleasingUnsafeMutablePointer) - -> [SKPaymentTransactionMessage]? + -> [FIASKPaymentTransactionMessage]? { return getPaymentQueueHandler() .getUnfinishedTransactions() @@ -111,7 +130,7 @@ public class InAppPurchasePlugin: NSObject, FlutterPlugin, InAppPurchaseAPI { } public func storefrontWithError(_ error: AutoreleasingUnsafeMutablePointer) - -> SKStorefrontMessage? + -> FIASKStorefrontMessage? { if #available(iOS 13.0, *), let storefront = getPaymentQueueHandler().storefront { return FIAObjectTranslator.convertStorefront(toPigeon: storefront) @@ -121,7 +140,7 @@ public class InAppPurchasePlugin: NSObject, FlutterPlugin, InAppPurchaseAPI { public func startProductRequestProductIdentifiers( _ productIdentifiers: [String], - completion: @escaping (SKProductsResponseMessage?, FlutterError?) -> Void + completion: @escaping (FIASKProductsResponseMessage?, FlutterError?) -> Void ) { let request = getProductRequest(withIdentifiers: Set(productIdentifiers)) let handler = handlerFactory(request) diff --git a/packages/in_app_purchase/in_app_purchase_storekit/darwin/Classes/StoreKit2/InAppPurchaseStoreKit2.swift b/packages/in_app_purchase/in_app_purchase_storekit/darwin/Classes/StoreKit2/InAppPurchaseStoreKit2.swift new file mode 100644 index 000000000000..cd8e96b5d135 --- /dev/null +++ b/packages/in_app_purchase/in_app_purchase_storekit/darwin/Classes/StoreKit2/InAppPurchaseStoreKit2.swift @@ -0,0 +1,180 @@ +// 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. + +@available(iOS 15.0, macOS 12.0, *) +extension InAppPurchasePlugin: InAppPurchase2API { + + // MARK: - Pigeon Functions + + /// Wrapper method around StoreKit2's canMakePayments() method + /// https://developer.apple.com/documentation/storekit/appstore/3822277-canmakepayments + func canMakePayments() throws -> Bool { + return AppStore.canMakePayments + } + + /// Wrapper method around StoreKit2's products() method + /// https://developer.apple.com/documentation/storekit/product/3851116-products + func products( + identifiers: [String], completion: @escaping (Result<[SK2ProductMessage], Error>) -> Void + ) { + Task { + do { + let products = try await Product.products(for: identifiers) + let productMessages = products.map { + $0.convertToPigeon + } + completion(.success(productMessages)) + } catch { + completion( + .failure( + PigeonError( + code: "storekit2_products_error", + message: error.localizedDescription, + details: error.localizedDescription))) + } + } + } + + /// Gets the appropriate product, then calls purchase on it. + /// https://developer.apple.com/documentation/storekit/product/3791971-purchase + func purchase( + id: String, options: SK2ProductPurchaseOptionsMessage?, + completion: @escaping (Result) -> Void + ) { + Task { @MainActor in + do { + guard let product = try await Product.products(for: [id]).first else { + let error = PigeonError( + code: "storekit2_failed_to_fetch_product", + message: "Storekit has failed to fetch this product.", + details: "Product ID : \(id)") + return completion(.failure(error)) + } + + let result = try await product.purchase(options: []) + + switch result { + case .success(let verification): + switch verification { + case .verified(let transaction): + self.sendTransactionUpdate(transaction: transaction) + completion(.success(result.convertToPigeon())) + case .unverified(_, let error): + completion(.failure(error)) + } + case .pending: + completion( + .failure( + PigeonError( + code: "storekit2_purchase_pending", + message: + "This transaction is still pending and but may complete in the future. If it completes, it will be delivered via `purchaseStream`", + details: "Product ID : \(id)"))) + case .userCancelled: + completion( + .failure( + PigeonError( + code: "storekit2_purchase_cancelled", + message: "This transaction has been cancelled by the user.", + details: "Product ID : \(id)"))) + @unknown default: + fatalError("An unknown StoreKit PurchaseResult has been encountered.") + } + } catch { + completion(.failure(error)) + } + } + } + + /// Wrapper method around StoreKit2's transactions() method + /// https://developer.apple.com/documentation/storekit/product/3851116-products + func transactions( + completion: @escaping (Result<[SK2TransactionMessage], Error>) -> Void + ) { + Task { + @MainActor in + do { + let transactionsMsgs = await rawTransactions().map { + $0.convertToPigeon() + } + completion(.success(transactionsMsgs)) + } + } + } + + /// Wrapper method around StoreKit2's finish() method https://developer.apple.com/documentation/storekit/transaction/3749694-finish + func finish(id: Int64, completion: @escaping (Result) -> Void) { + Task { + let transaction = try await fetchTransaction(by: UInt64(id)) + if let transaction = transaction { + await transaction.finish() + } + } + } + + /// This Task listens to Transation.updates as shown here + /// https://developer.apple.com/documentation/storekit/transaction/3851206-updates + /// This function should be called as soon as the app starts to avoid missing any Transactions done outside of the app. + func startListeningToTransactions() throws { + self.setListenerTaskAsTask( + task: Task { [weak self] in + for await verificationResult in Transaction.updates { + switch verificationResult { + case .verified(let transaction): + self?.sendTransactionUpdate(transaction: transaction) + case .unverified: + break + } + } + }) + } + + /// Stop subscribing to Transaction.updates + func stopListeningToTransactions() throws { + updateListenerTask.cancel() + } + + /// Sends an transaction back to Dart. Access these transactions with `purchaseStream` + func sendTransactionUpdate(transaction: Transaction) { + let transactionMessage = transaction.convertToPigeon() + transactionCallbackAPI?.onTransactionsUpdated(newTransaction: transactionMessage) { result in + switch result { + case .success: break + case .failure(let error): + print("Failed to send transaction updates: \(error)") + } + } + } + + // MARK: - Convenience Functions + + /// Helper function that fetches and unwraps all verified transactions + private func rawTransactions() async -> [Transaction] { + var transactions: [Transaction] = [] + for await verificationResult in Transaction.all { + switch verificationResult { + case .verified(let transaction): + transactions.append(transaction) + case .unverified: + break + } + } + return transactions + } + + /// Helper function to fetch specific transaction + private func fetchTransaction(by id: UInt64) async throws -> Transaction? { + for await result in Transaction.all { + switch result { + case .verified(let transaction): + if transaction.id == id { + return transaction + } + case .unverified: + continue + } + } + return nil + } +} diff --git a/packages/in_app_purchase/in_app_purchase_storekit/darwin/Classes/StoreKit2/StoreKit2Translators.swift b/packages/in_app_purchase/in_app_purchase_storekit/darwin/Classes/StoreKit2/StoreKit2Translators.swift new file mode 100644 index 000000000000..b04caa25ae64 --- /dev/null +++ b/packages/in_app_purchase/in_app_purchase_storekit/darwin/Classes/StoreKit2/StoreKit2Translators.swift @@ -0,0 +1,204 @@ +// 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 Foundation +import StoreKit + +@available(iOS 15.0, macOS 12.0, *) +extension Product { + var convertToPigeon: SK2ProductMessage { + + return SK2ProductMessage( + id: id, + displayName: displayName, + description: description, + price: NSDecimalNumber(decimal: price).doubleValue, + displayPrice: displayPrice, + type: type.convertToPigeon, + subscription: subscription?.convertToPigeon, + priceLocale: priceFormatStyle.locale.convertToPigeon + ) + } +} + +extension SK2ProductMessage: Equatable { + static func == (lhs: SK2ProductMessage, rhs: SK2ProductMessage) -> Bool { + return lhs.id == rhs.id && lhs.displayName == rhs.displayName + && lhs.description == rhs.description && lhs.price == rhs.price + && lhs.displayPrice == rhs.displayPrice && lhs.type == rhs.type + && lhs.subscription == rhs.subscription && lhs.priceLocale == rhs.priceLocale + } +} + +@available(iOS 15.0, macOS 12.0, *) +extension Product.ProductType { + var convertToPigeon: SK2ProductTypeMessage { + switch self { + case Product.ProductType.autoRenewable: + return SK2ProductTypeMessage.autoRenewable + case Product.ProductType.consumable: + return SK2ProductTypeMessage.consumable + case Product.ProductType.nonConsumable: + return SK2ProductTypeMessage.nonConsumable + case Product.ProductType.nonRenewable: + return SK2ProductTypeMessage.nonRenewable + default: + fatalError("An unknown ProductType was passed in") + } + } +} + +@available(iOS 15.0, macOS 12.0, *) +extension Product.SubscriptionInfo { + var convertToPigeon: SK2SubscriptionInfoMessage { + return SK2SubscriptionInfoMessage( + promotionalOffers: promotionalOffers.map({ $0.convertToPigeon }), + subscriptionGroupID: subscriptionGroupID, + subscriptionPeriod: subscriptionPeriod.convertToPigeon) + } +} + +extension SK2SubscriptionInfoMessage: Equatable { + static func == (lhs: SK2SubscriptionInfoMessage, rhs: SK2SubscriptionInfoMessage) -> Bool { + return lhs.promotionalOffers == rhs.promotionalOffers + && lhs.subscriptionGroupID == rhs.subscriptionGroupID + && lhs.subscriptionPeriod == rhs.subscriptionPeriod + } +} + +@available(iOS 15.0, macOS 12.0, *) +extension Product.SubscriptionOffer { + var convertToPigeon: SK2SubscriptionOfferMessage { + return SK2SubscriptionOfferMessage( + /// ID is always `nil` for introductory offers and never `nil` for other offer types. + id: id, + price: NSDecimalNumber(decimal: price).doubleValue, + type: type.convertToPigeon, + period: period.convertToPigeon, + periodCount: Int64(periodCount), + paymentMode: paymentMode.convertToPigeon + ) + } +} + +extension SK2SubscriptionOfferMessage: Equatable { + static func == (lhs: SK2SubscriptionOfferMessage, rhs: SK2SubscriptionOfferMessage) -> Bool { + return lhs.id == rhs.id && lhs.price == rhs.price && lhs.type == rhs.type + && lhs.period == rhs.period && lhs.periodCount == rhs.periodCount + && lhs.paymentMode == rhs.paymentMode + } +} + +@available(iOS 15.0, macOS 12.0, *) +extension Product.SubscriptionOffer.OfferType { + var convertToPigeon: SK2SubscriptionOfferTypeMessage { + switch self { + case .introductory: + return SK2SubscriptionOfferTypeMessage.introductory + case .promotional: + return SK2SubscriptionOfferTypeMessage.promotional + default: + fatalError("An unknown OfferType was passed in") + } + } +} + +@available(iOS 15.0, macOS 12.0, *) +extension Product.SubscriptionPeriod { + var convertToPigeon: SK2SubscriptionPeriodMessage { + return SK2SubscriptionPeriodMessage( + value: Int64(value), + unit: unit.convertToPigeon) + } +} + +extension SK2SubscriptionPeriodMessage: Equatable { + static func == (lhs: SK2SubscriptionPeriodMessage, rhs: SK2SubscriptionPeriodMessage) -> Bool { + return lhs.value == rhs.value && lhs.unit == rhs.unit + } +} + +@available(iOS 15.0, macOS 12.0, *) +extension Product.SubscriptionPeriod.Unit { + var convertToPigeon: SK2SubscriptionPeriodUnitMessage { + switch self { + case .day: + return SK2SubscriptionPeriodUnitMessage.day + case .week: + return SK2SubscriptionPeriodUnitMessage.week + case .month: + return SK2SubscriptionPeriodUnitMessage.month + case .year: + return SK2SubscriptionPeriodUnitMessage.year + @unknown default: + fatalError("unknown SubscriptionPeriodUnit encountered") + } + } +} + +@available(iOS 15.0, macOS 12.0, *) +extension Product.SubscriptionOffer.PaymentMode { + var convertToPigeon: SK2SubscriptionOfferPaymentModeMessage { + switch self { + case .freeTrial: + return SK2SubscriptionOfferPaymentModeMessage.freeTrial + case .payUpFront: + return SK2SubscriptionOfferPaymentModeMessage.payUpFront + case .payAsYouGo: + return SK2SubscriptionOfferPaymentModeMessage.payAsYouGo + default: + fatalError("Encountered an unknown PaymentMode") + } + } +} + +extension Locale { + var convertToPigeon: SK2PriceLocaleMessage { + return SK2PriceLocaleMessage( + currencyCode: currencyCode ?? "", + currencySymbol: currencySymbol ?? "" + ) + } +} + +extension SK2PriceLocaleMessage: Equatable { + static func == (lhs: SK2PriceLocaleMessage, rhs: SK2PriceLocaleMessage) -> Bool { + return lhs.currencyCode == rhs.currencyCode && lhs.currencySymbol == rhs.currencySymbol + } +} + +@available(iOS 15.0, macOS 12.0, *) +extension Product.PurchaseResult { + func convertToPigeon() -> SK2ProductPurchaseResultMessage { + switch self { + case .success(_): + return SK2ProductPurchaseResultMessage.success + case .userCancelled: + return SK2ProductPurchaseResultMessage.userCancelled + case .pending: + return SK2ProductPurchaseResultMessage.pending + @unknown default: + fatalError() + } + } +} + +@available(iOS 15.0, macOS 12.0, *) +extension Transaction { + func convertToPigeon(restoring: Bool = false) -> SK2TransactionMessage { + + let dateFromatter: DateFormatter = DateFormatter() + dateFromatter.dateFormat = "yyyy-MM-dd HH:mm:ss" + + return SK2TransactionMessage( + id: Int64(id), + originalId: Int64(originalID), + productId: productID, + purchaseDate: dateFromatter.string(from: purchaseDate), + purchasedQuantity: Int64(purchasedQuantity), + appAccountToken: appAccountToken?.uuidString, + restoring: restoring + ) + } +} diff --git a/packages/in_app_purchase/in_app_purchase_storekit/darwin/Classes/StoreKit2/sk2_pigeon.g.swift b/packages/in_app_purchase/in_app_purchase_storekit/darwin/Classes/StoreKit2/sk2_pigeon.g.swift new file mode 100644 index 000000000000..f6ff6bfe63b3 --- /dev/null +++ b/packages/in_app_purchase/in_app_purchase_storekit/darwin/Classes/StoreKit2/sk2_pigeon.g.swift @@ -0,0 +1,689 @@ +// 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 (v22.4.2), do not edit directly. +// See also: https://pub.dev/packages/pigeon + +import Foundation + +#if os(iOS) + import Flutter +#elseif os(macOS) + import FlutterMacOS +#else + #error("Unsupported platform.") +#endif + +/// Error class for passing custom error details to Dart side. +final class PigeonError: Error { + let code: String + let message: String? + let details: Any? + + init(code: String, message: String?, details: Any?) { + self.code = code + self.message = message + self.details = details + } + + var localizedDescription: String { + return + "PigeonError(code: \(code), message: \(message ?? ""), details: \(details ?? "")" + } +} + +private func wrapResult(_ result: Any?) -> [Any?] { + return [result] +} + +private func wrapError(_ error: Any) -> [Any?] { + if let pigeonError = error as? PigeonError { + return [ + pigeonError.code, + pigeonError.message, + pigeonError.details, + ] + } + if let flutterError = error as? FlutterError { + return [ + flutterError.code, + flutterError.message, + flutterError.details, + ] + } + return [ + "\(error)", + "\(type(of: error))", + "Stacktrace: \(Thread.callStackSymbols)", + ] +} + +private func createConnectionError(withChannelName channelName: String) -> PigeonError { + return PigeonError( + code: "channel-error", message: "Unable to establish connection on channel: '\(channelName)'.", + details: "") +} + +private func isNullish(_ value: Any?) -> Bool { + return value is NSNull || value == nil +} + +private func nilOrValue(_ value: Any?) -> T? { + if value is NSNull { return nil } + return value as! T? +} + +enum SK2ProductTypeMessage: Int { + /// A consumable in-app purchase. + case consumable = 0 + /// A non-consumable in-app purchase. + case nonConsumable = 1 + /// A non-renewing subscription. + case nonRenewable = 2 + /// An auto-renewable subscription. + case autoRenewable = 3 +} + +enum SK2SubscriptionOfferTypeMessage: Int { + case introductory = 0 + case promotional = 1 +} + +enum SK2SubscriptionOfferPaymentModeMessage: Int { + case payAsYouGo = 0 + case payUpFront = 1 + case freeTrial = 2 +} + +enum SK2SubscriptionPeriodUnitMessage: Int { + case day = 0 + case week = 1 + case month = 2 + case year = 3 +} + +enum SK2ProductPurchaseResultMessage: Int { + case success = 0 + case userCancelled = 1 + case pending = 2 +} + +/// Generated class from Pigeon that represents data sent in messages. +struct SK2SubscriptionOfferMessage { + var id: String? = nil + var price: Double + var type: SK2SubscriptionOfferTypeMessage + var period: SK2SubscriptionPeriodMessage + var periodCount: Int64 + var paymentMode: SK2SubscriptionOfferPaymentModeMessage + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> SK2SubscriptionOfferMessage? { + let id: String? = nilOrValue(pigeonVar_list[0]) + let price = pigeonVar_list[1] as! Double + let type = pigeonVar_list[2] as! SK2SubscriptionOfferTypeMessage + let period = pigeonVar_list[3] as! SK2SubscriptionPeriodMessage + let periodCount = pigeonVar_list[4] as! Int64 + let paymentMode = pigeonVar_list[5] as! SK2SubscriptionOfferPaymentModeMessage + + return SK2SubscriptionOfferMessage( + id: id, + price: price, + type: type, + period: period, + periodCount: periodCount, + paymentMode: paymentMode + ) + } + func toList() -> [Any?] { + return [ + id, + price, + type, + period, + periodCount, + paymentMode, + ] + } +} + +/// Generated class from Pigeon that represents data sent in messages. +struct SK2SubscriptionPeriodMessage { + /// The number of units that the period represents. + var value: Int64 + /// The unit of time that this period represents. + var unit: SK2SubscriptionPeriodUnitMessage + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> SK2SubscriptionPeriodMessage? { + let value = pigeonVar_list[0] as! Int64 + let unit = pigeonVar_list[1] as! SK2SubscriptionPeriodUnitMessage + + return SK2SubscriptionPeriodMessage( + value: value, + unit: unit + ) + } + func toList() -> [Any?] { + return [ + value, + unit, + ] + } +} + +/// Generated class from Pigeon that represents data sent in messages. +struct SK2SubscriptionInfoMessage { + /// An array of all the promotional offers configured for this subscription. + var promotionalOffers: [SK2SubscriptionOfferMessage] + /// The group identifier for this subscription. + var subscriptionGroupID: String + /// The duration that this subscription lasts before auto-renewing. + var subscriptionPeriod: SK2SubscriptionPeriodMessage + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> SK2SubscriptionInfoMessage? { + let promotionalOffers = pigeonVar_list[0] as! [SK2SubscriptionOfferMessage] + let subscriptionGroupID = pigeonVar_list[1] as! String + let subscriptionPeriod = pigeonVar_list[2] as! SK2SubscriptionPeriodMessage + + return SK2SubscriptionInfoMessage( + promotionalOffers: promotionalOffers, + subscriptionGroupID: subscriptionGroupID, + subscriptionPeriod: subscriptionPeriod + ) + } + func toList() -> [Any?] { + return [ + promotionalOffers, + subscriptionGroupID, + subscriptionPeriod, + ] + } +} + +/// A Pigeon message class representing a Product +/// https://developer.apple.com/documentation/storekit/product +/// +/// Generated class from Pigeon that represents data sent in messages. +struct SK2ProductMessage { + /// The unique product identifier. + var id: String + /// The localized display name of the product, if it exists. + var displayName: String + /// The localized description of the product. + var description: String + /// The localized string representation of the product price, suitable for display. + var price: Double + /// The localized price of the product as a string. + var displayPrice: String + /// The types of in-app purchases. + var type: SK2ProductTypeMessage + /// The subscription information for an auto-renewable subscription. + var subscription: SK2SubscriptionInfoMessage? = nil + /// The currency and locale information for this product + var priceLocale: SK2PriceLocaleMessage + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> SK2ProductMessage? { + let id = pigeonVar_list[0] as! String + let displayName = pigeonVar_list[1] as! String + let description = pigeonVar_list[2] as! String + let price = pigeonVar_list[3] as! Double + let displayPrice = pigeonVar_list[4] as! String + let type = pigeonVar_list[5] as! SK2ProductTypeMessage + let subscription: SK2SubscriptionInfoMessage? = nilOrValue(pigeonVar_list[6]) + let priceLocale = pigeonVar_list[7] as! SK2PriceLocaleMessage + + return SK2ProductMessage( + id: id, + displayName: displayName, + description: description, + price: price, + displayPrice: displayPrice, + type: type, + subscription: subscription, + priceLocale: priceLocale + ) + } + func toList() -> [Any?] { + return [ + id, + displayName, + description, + price, + displayPrice, + type, + subscription, + priceLocale, + ] + } +} + +/// Generated class from Pigeon that represents data sent in messages. +struct SK2PriceLocaleMessage { + var currencyCode: String + var currencySymbol: String + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> SK2PriceLocaleMessage? { + let currencyCode = pigeonVar_list[0] as! String + let currencySymbol = pigeonVar_list[1] as! String + + return SK2PriceLocaleMessage( + currencyCode: currencyCode, + currencySymbol: currencySymbol + ) + } + func toList() -> [Any?] { + return [ + currencyCode, + currencySymbol, + ] + } +} + +/// Generated class from Pigeon that represents data sent in messages. +struct SK2ProductPurchaseOptionsMessage { + var appAccountToken: String? = nil + var quantity: Int64? = nil + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> SK2ProductPurchaseOptionsMessage? { + let appAccountToken: String? = nilOrValue(pigeonVar_list[0]) + let quantity: Int64? = nilOrValue(pigeonVar_list[1]) + + return SK2ProductPurchaseOptionsMessage( + appAccountToken: appAccountToken, + quantity: quantity + ) + } + func toList() -> [Any?] { + return [ + appAccountToken, + quantity, + ] + } +} + +/// Generated class from Pigeon that represents data sent in messages. +struct SK2TransactionMessage { + var id: Int64 + var originalId: Int64 + var productId: String + var purchaseDate: String + var purchasedQuantity: Int64 + var appAccountToken: String? = nil + var restoring: Bool + var error: SK2ErrorMessage? = nil + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> SK2TransactionMessage? { + let id = pigeonVar_list[0] as! Int64 + let originalId = pigeonVar_list[1] as! Int64 + let productId = pigeonVar_list[2] as! String + let purchaseDate = pigeonVar_list[3] as! String + let purchasedQuantity = pigeonVar_list[4] as! Int64 + let appAccountToken: String? = nilOrValue(pigeonVar_list[5]) + let restoring = pigeonVar_list[6] as! Bool + let error: SK2ErrorMessage? = nilOrValue(pigeonVar_list[7]) + + return SK2TransactionMessage( + id: id, + originalId: originalId, + productId: productId, + purchaseDate: purchaseDate, + purchasedQuantity: purchasedQuantity, + appAccountToken: appAccountToken, + restoring: restoring, + error: error + ) + } + func toList() -> [Any?] { + return [ + id, + originalId, + productId, + purchaseDate, + purchasedQuantity, + appAccountToken, + restoring, + error, + ] + } +} + +/// Generated class from Pigeon that represents data sent in messages. +struct SK2ErrorMessage { + var code: Int64 + var domain: String + var userInfo: [String: Any]? = nil + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> SK2ErrorMessage? { + let code = pigeonVar_list[0] as! Int64 + let domain = pigeonVar_list[1] as! String + let userInfo: [String: Any]? = nilOrValue(pigeonVar_list[2]) + + return SK2ErrorMessage( + code: code, + domain: domain, + userInfo: userInfo + ) + } + func toList() -> [Any?] { + return [ + code, + domain, + userInfo, + ] + } +} + +private class sk2_pigeonPigeonCodecReader: FlutterStandardReader { + override func readValue(ofType type: UInt8) -> Any? { + switch type { + case 129: + let enumResultAsInt: Int? = nilOrValue(self.readValue() as! Int?) + if let enumResultAsInt = enumResultAsInt { + return SK2ProductTypeMessage(rawValue: enumResultAsInt) + } + return nil + case 130: + let enumResultAsInt: Int? = nilOrValue(self.readValue() as! Int?) + if let enumResultAsInt = enumResultAsInt { + return SK2SubscriptionOfferTypeMessage(rawValue: enumResultAsInt) + } + return nil + case 131: + let enumResultAsInt: Int? = nilOrValue(self.readValue() as! Int?) + if let enumResultAsInt = enumResultAsInt { + return SK2SubscriptionOfferPaymentModeMessage(rawValue: enumResultAsInt) + } + return nil + case 132: + let enumResultAsInt: Int? = nilOrValue(self.readValue() as! Int?) + if let enumResultAsInt = enumResultAsInt { + return SK2SubscriptionPeriodUnitMessage(rawValue: enumResultAsInt) + } + return nil + case 133: + let enumResultAsInt: Int? = nilOrValue(self.readValue() as! Int?) + if let enumResultAsInt = enumResultAsInt { + return SK2ProductPurchaseResultMessage(rawValue: enumResultAsInt) + } + return nil + case 134: + return SK2SubscriptionOfferMessage.fromList(self.readValue() as! [Any?]) + case 135: + return SK2SubscriptionPeriodMessage.fromList(self.readValue() as! [Any?]) + case 136: + return SK2SubscriptionInfoMessage.fromList(self.readValue() as! [Any?]) + case 137: + return SK2ProductMessage.fromList(self.readValue() as! [Any?]) + case 138: + return SK2PriceLocaleMessage.fromList(self.readValue() as! [Any?]) + case 139: + return SK2ProductPurchaseOptionsMessage.fromList(self.readValue() as! [Any?]) + case 140: + return SK2TransactionMessage.fromList(self.readValue() as! [Any?]) + case 141: + return SK2ErrorMessage.fromList(self.readValue() as! [Any?]) + default: + return super.readValue(ofType: type) + } + } +} + +private class sk2_pigeonPigeonCodecWriter: FlutterStandardWriter { + override func writeValue(_ value: Any) { + if let value = value as? SK2ProductTypeMessage { + super.writeByte(129) + super.writeValue(value.rawValue) + } else if let value = value as? SK2SubscriptionOfferTypeMessage { + super.writeByte(130) + super.writeValue(value.rawValue) + } else if let value = value as? SK2SubscriptionOfferPaymentModeMessage { + super.writeByte(131) + super.writeValue(value.rawValue) + } else if let value = value as? SK2SubscriptionPeriodUnitMessage { + super.writeByte(132) + super.writeValue(value.rawValue) + } else if let value = value as? SK2ProductPurchaseResultMessage { + super.writeByte(133) + super.writeValue(value.rawValue) + } else if let value = value as? SK2SubscriptionOfferMessage { + super.writeByte(134) + super.writeValue(value.toList()) + } else if let value = value as? SK2SubscriptionPeriodMessage { + super.writeByte(135) + super.writeValue(value.toList()) + } else if let value = value as? SK2SubscriptionInfoMessage { + super.writeByte(136) + super.writeValue(value.toList()) + } else if let value = value as? SK2ProductMessage { + super.writeByte(137) + super.writeValue(value.toList()) + } else if let value = value as? SK2PriceLocaleMessage { + super.writeByte(138) + super.writeValue(value.toList()) + } else if let value = value as? SK2ProductPurchaseOptionsMessage { + super.writeByte(139) + super.writeValue(value.toList()) + } else if let value = value as? SK2TransactionMessage { + super.writeByte(140) + super.writeValue(value.toList()) + } else if let value = value as? SK2ErrorMessage { + super.writeByte(141) + super.writeValue(value.toList()) + } else { + super.writeValue(value) + } + } +} + +private class sk2_pigeonPigeonCodecReaderWriter: FlutterStandardReaderWriter { + override func reader(with data: Data) -> FlutterStandardReader { + return sk2_pigeonPigeonCodecReader(data: data) + } + + override func writer(with data: NSMutableData) -> FlutterStandardWriter { + return sk2_pigeonPigeonCodecWriter(data: data) + } +} + +class sk2_pigeonPigeonCodec: FlutterStandardMessageCodec, @unchecked Sendable { + static let shared = sk2_pigeonPigeonCodec(readerWriter: sk2_pigeonPigeonCodecReaderWriter()) +} + +/// Generated protocol from Pigeon that represents a handler of messages from Flutter. +protocol InAppPurchase2API { + func canMakePayments() throws -> Bool + func products( + identifiers: [String], completion: @escaping (Result<[SK2ProductMessage], Error>) -> Void) + func purchase( + id: String, options: SK2ProductPurchaseOptionsMessage?, + completion: @escaping (Result) -> Void) + func transactions(completion: @escaping (Result<[SK2TransactionMessage], Error>) -> Void) + func finish(id: Int64, completion: @escaping (Result) -> Void) + func startListeningToTransactions() throws + func stopListeningToTransactions() throws +} + +/// Generated setup class from Pigeon to handle messages through the `binaryMessenger`. +class InAppPurchase2APISetup { + static var codec: FlutterStandardMessageCodec { sk2_pigeonPigeonCodec.shared } + /// Sets up an instance of `InAppPurchase2API` to handle messages through the `binaryMessenger`. + static func setUp( + binaryMessenger: FlutterBinaryMessenger, api: InAppPurchase2API?, + messageChannelSuffix: String = "" + ) { + let channelSuffix = messageChannelSuffix.count > 0 ? ".\(messageChannelSuffix)" : "" + let canMakePaymentsChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchase2API.canMakePayments\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + canMakePaymentsChannel.setMessageHandler { _, reply in + do { + let result = try api.canMakePayments() + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + canMakePaymentsChannel.setMessageHandler(nil) + } + let productsChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchase2API.products\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + productsChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let identifiersArg = args[0] as! [String] + api.products(identifiers: identifiersArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + productsChannel.setMessageHandler(nil) + } + let purchaseChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchase2API.purchase\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + purchaseChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let idArg = args[0] as! String + let optionsArg: SK2ProductPurchaseOptionsMessage? = nilOrValue(args[1]) + api.purchase(id: idArg, options: optionsArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + purchaseChannel.setMessageHandler(nil) + } + let transactionsChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchase2API.transactions\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + transactionsChannel.setMessageHandler { _, reply in + api.transactions { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + transactionsChannel.setMessageHandler(nil) + } + let finishChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchase2API.finish\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + finishChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let idArg = args[0] as! Int64 + api.finish(id: idArg) { result in + switch result { + case .success: + reply(wrapResult(nil)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + finishChannel.setMessageHandler(nil) + } + let startListeningToTransactionsChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchase2API.startListeningToTransactions\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + startListeningToTransactionsChannel.setMessageHandler { _, reply in + do { + try api.startListeningToTransactions() + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + startListeningToTransactionsChannel.setMessageHandler(nil) + } + let stopListeningToTransactionsChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchase2API.stopListeningToTransactions\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + stopListeningToTransactionsChannel.setMessageHandler { _, reply in + do { + try api.stopListeningToTransactions() + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + stopListeningToTransactionsChannel.setMessageHandler(nil) + } + } +} +/// Generated protocol from Pigeon that represents Flutter messages that can be called from Swift. +protocol InAppPurchase2CallbackAPIProtocol { + func onTransactionsUpdated( + newTransaction newTransactionArg: SK2TransactionMessage, + completion: @escaping (Result) -> Void) +} +class InAppPurchase2CallbackAPI: InAppPurchase2CallbackAPIProtocol { + private let binaryMessenger: FlutterBinaryMessenger + private let messageChannelSuffix: String + init(binaryMessenger: FlutterBinaryMessenger, messageChannelSuffix: String = "") { + self.binaryMessenger = binaryMessenger + self.messageChannelSuffix = messageChannelSuffix.count > 0 ? ".\(messageChannelSuffix)" : "" + } + var codec: sk2_pigeonPigeonCodec { + return sk2_pigeonPigeonCodec.shared + } + func onTransactionsUpdated( + newTransaction newTransactionArg: SK2TransactionMessage, + completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchase2CallbackAPI.onTransactionsUpdated\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([newTransactionArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(Void())) + } + } + } +} diff --git a/packages/in_app_purchase/in_app_purchase_storekit/darwin/Classes/messages.g.h b/packages/in_app_purchase/in_app_purchase_storekit/darwin/Classes/messages.g.h index 79bdffc76afe..a6059f269d73 100644 --- a/packages/in_app_purchase/in_app_purchase_storekit/darwin/Classes/messages.g.h +++ b/packages/in_app_purchase/in_app_purchase_storekit/darwin/Classes/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 (v16.0.4), do not edit directly. +// Autogenerated from Pigeon (v22.4.2), do not edit directly. // See also: https://pub.dev/packages/pigeon #import @@ -13,117 +13,117 @@ NS_ASSUME_NONNULL_BEGIN -typedef NS_ENUM(NSUInteger, SKPaymentTransactionStateMessage) { +typedef NS_ENUM(NSUInteger, FIASKPaymentTransactionStateMessage) { /// Indicates the transaction is being processed in App Store. /// /// You should update your UI to indicate that you are waiting for the /// transaction to update to another state. Never complete a transaction that /// is still in a purchasing state. - SKPaymentTransactionStateMessagePurchasing = 0, + FIASKPaymentTransactionStateMessagePurchasing = 0, /// The user's payment has been succesfully processed. /// /// You should provide the user the content that they purchased. - SKPaymentTransactionStateMessagePurchased = 1, + FIASKPaymentTransactionStateMessagePurchased = 1, /// The transaction failed. /// /// Check the [PaymentTransactionWrapper.error] property from /// [PaymentTransactionWrapper] for details. - SKPaymentTransactionStateMessageFailed = 2, + FIASKPaymentTransactionStateMessageFailed = 2, /// This transaction is restoring content previously purchased by the user. /// /// The previous transaction information can be obtained in /// [PaymentTransactionWrapper.originalTransaction] from /// [PaymentTransactionWrapper]. - SKPaymentTransactionStateMessageRestored = 3, + FIASKPaymentTransactionStateMessageRestored = 3, /// The transaction is in the queue but pending external action. Wait for /// another callback to get the final state. /// /// You should update your UI to indicate that you are waiting for the /// transaction to update to another state. - SKPaymentTransactionStateMessageDeferred = 4, + FIASKPaymentTransactionStateMessageDeferred = 4, /// Indicates the transaction is in an unspecified state. - SKPaymentTransactionStateMessageUnspecified = 5, + FIASKPaymentTransactionStateMessageUnspecified = 5, }; -/// Wrapper for SKPaymentTransactionStateMessage to allow for nullability. -@interface SKPaymentTransactionStateMessageBox : NSObject -@property(nonatomic, assign) SKPaymentTransactionStateMessage value; -- (instancetype)initWithValue:(SKPaymentTransactionStateMessage)value; +/// Wrapper for FIASKPaymentTransactionStateMessage to allow for nullability. +@interface FIASKPaymentTransactionStateMessageBox : NSObject +@property(nonatomic, assign) FIASKPaymentTransactionStateMessage value; +- (instancetype)initWithValue:(FIASKPaymentTransactionStateMessage)value; @end -typedef NS_ENUM(NSUInteger, SKProductDiscountTypeMessage) { +typedef NS_ENUM(NSUInteger, FIASKProductDiscountTypeMessage) { /// A constant indicating the discount type is an introductory offer. - SKProductDiscountTypeMessageIntroductory = 0, + FIASKProductDiscountTypeMessageIntroductory = 0, /// A constant indicating the discount type is a promotional offer. - SKProductDiscountTypeMessageSubscription = 1, + FIASKProductDiscountTypeMessageSubscription = 1, }; -/// Wrapper for SKProductDiscountTypeMessage to allow for nullability. -@interface SKProductDiscountTypeMessageBox : NSObject -@property(nonatomic, assign) SKProductDiscountTypeMessage value; -- (instancetype)initWithValue:(SKProductDiscountTypeMessage)value; +/// Wrapper for FIASKProductDiscountTypeMessage to allow for nullability. +@interface FIASKProductDiscountTypeMessageBox : NSObject +@property(nonatomic, assign) FIASKProductDiscountTypeMessage value; +- (instancetype)initWithValue:(FIASKProductDiscountTypeMessage)value; @end -typedef NS_ENUM(NSUInteger, SKProductDiscountPaymentModeMessage) { +typedef NS_ENUM(NSUInteger, FIASKProductDiscountPaymentModeMessage) { /// Allows user to pay the discounted price at each payment period. - SKProductDiscountPaymentModeMessagePayAsYouGo = 0, + FIASKProductDiscountPaymentModeMessagePayAsYouGo = 0, /// Allows user to pay the discounted price upfront and receive the product for the rest of time /// that was paid for. - SKProductDiscountPaymentModeMessagePayUpFront = 1, + FIASKProductDiscountPaymentModeMessagePayUpFront = 1, /// User pays nothing during the discounted period. - SKProductDiscountPaymentModeMessageFreeTrial = 2, + FIASKProductDiscountPaymentModeMessageFreeTrial = 2, /// Unspecified mode. - SKProductDiscountPaymentModeMessageUnspecified = 3, + FIASKProductDiscountPaymentModeMessageUnspecified = 3, }; -/// Wrapper for SKProductDiscountPaymentModeMessage to allow for nullability. -@interface SKProductDiscountPaymentModeMessageBox : NSObject -@property(nonatomic, assign) SKProductDiscountPaymentModeMessage value; -- (instancetype)initWithValue:(SKProductDiscountPaymentModeMessage)value; +/// Wrapper for FIASKProductDiscountPaymentModeMessage to allow for nullability. +@interface FIASKProductDiscountPaymentModeMessageBox : NSObject +@property(nonatomic, assign) FIASKProductDiscountPaymentModeMessage value; +- (instancetype)initWithValue:(FIASKProductDiscountPaymentModeMessage)value; @end -typedef NS_ENUM(NSUInteger, SKSubscriptionPeriodUnitMessage) { - SKSubscriptionPeriodUnitMessageDay = 0, - SKSubscriptionPeriodUnitMessageWeek = 1, - SKSubscriptionPeriodUnitMessageMonth = 2, - SKSubscriptionPeriodUnitMessageYear = 3, +typedef NS_ENUM(NSUInteger, FIASKSubscriptionPeriodUnitMessage) { + FIASKSubscriptionPeriodUnitMessageDay = 0, + FIASKSubscriptionPeriodUnitMessageWeek = 1, + FIASKSubscriptionPeriodUnitMessageMonth = 2, + FIASKSubscriptionPeriodUnitMessageYear = 3, }; -/// Wrapper for SKSubscriptionPeriodUnitMessage to allow for nullability. -@interface SKSubscriptionPeriodUnitMessageBox : NSObject -@property(nonatomic, assign) SKSubscriptionPeriodUnitMessage value; -- (instancetype)initWithValue:(SKSubscriptionPeriodUnitMessage)value; +/// Wrapper for FIASKSubscriptionPeriodUnitMessage to allow for nullability. +@interface FIASKSubscriptionPeriodUnitMessageBox : NSObject +@property(nonatomic, assign) FIASKSubscriptionPeriodUnitMessage value; +- (instancetype)initWithValue:(FIASKSubscriptionPeriodUnitMessage)value; @end -@class SKPaymentTransactionMessage; -@class SKPaymentMessage; -@class SKErrorMessage; -@class SKPaymentDiscountMessage; -@class SKStorefrontMessage; -@class SKProductsResponseMessage; -@class SKProductMessage; -@class SKPriceLocaleMessage; -@class SKProductDiscountMessage; -@class SKProductSubscriptionPeriodMessage; +@class FIASKPaymentTransactionMessage; +@class FIASKPaymentMessage; +@class FIASKErrorMessage; +@class FIASKPaymentDiscountMessage; +@class FIASKStorefrontMessage; +@class FIASKProductsResponseMessage; +@class FIASKProductMessage; +@class FIASKPriceLocaleMessage; +@class FIASKProductDiscountMessage; +@class FIASKProductSubscriptionPeriodMessage; -@interface SKPaymentTransactionMessage : NSObject +@interface FIASKPaymentTransactionMessage : NSObject /// `init` unavailable to enforce nonnull fields, see the `make` class method. - (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithPayment:(SKPaymentMessage *)payment - transactionState:(SKPaymentTransactionStateMessage)transactionState - originalTransaction:(nullable SKPaymentTransactionMessage *)originalTransaction ++ (instancetype)makeWithPayment:(FIASKPaymentMessage *)payment + transactionState:(FIASKPaymentTransactionStateMessage)transactionState + originalTransaction:(nullable FIASKPaymentTransactionMessage *)originalTransaction transactionTimeStamp:(nullable NSNumber *)transactionTimeStamp transactionIdentifier:(nullable NSString *)transactionIdentifier - error:(nullable SKErrorMessage *)error; -@property(nonatomic, strong) SKPaymentMessage *payment; -@property(nonatomic, assign) SKPaymentTransactionStateMessage transactionState; -@property(nonatomic, strong, nullable) SKPaymentTransactionMessage *originalTransaction; + error:(nullable FIASKErrorMessage *)error; +@property(nonatomic, strong) FIASKPaymentMessage *payment; +@property(nonatomic, assign) FIASKPaymentTransactionStateMessage transactionState; +@property(nonatomic, strong, nullable) FIASKPaymentTransactionMessage *originalTransaction; @property(nonatomic, strong, nullable) NSNumber *transactionTimeStamp; @property(nonatomic, copy, nullable) NSString *transactionIdentifier; -@property(nonatomic, strong, nullable) SKErrorMessage *error; +@property(nonatomic, strong, nullable) FIASKErrorMessage *error; @end -@interface SKPaymentMessage : NSObject +@interface FIASKPaymentMessage : NSObject /// `init` unavailable to enforce nonnull fields, see the `make` class method. - (instancetype)init NS_UNAVAILABLE; + (instancetype)makeWithProductIdentifier:(NSString *)productIdentifier @@ -131,16 +131,16 @@ typedef NS_ENUM(NSUInteger, SKSubscriptionPeriodUnitMessage) { requestData:(nullable NSString *)requestData quantity:(NSInteger)quantity simulatesAskToBuyInSandbox:(BOOL)simulatesAskToBuyInSandbox - paymentDiscount:(nullable SKPaymentDiscountMessage *)paymentDiscount; + paymentDiscount:(nullable FIASKPaymentDiscountMessage *)paymentDiscount; @property(nonatomic, copy) NSString *productIdentifier; @property(nonatomic, copy, nullable) NSString *applicationUsername; @property(nonatomic, copy, nullable) NSString *requestData; @property(nonatomic, assign) NSInteger quantity; @property(nonatomic, assign) BOOL simulatesAskToBuyInSandbox; -@property(nonatomic, strong, nullable) SKPaymentDiscountMessage *paymentDiscount; +@property(nonatomic, strong, nullable) FIASKPaymentDiscountMessage *paymentDiscount; @end -@interface SKErrorMessage : NSObject +@interface FIASKErrorMessage : NSObject /// `init` unavailable to enforce nonnull fields, see the `make` class method. - (instancetype)init NS_UNAVAILABLE; + (instancetype)makeWithCode:(NSInteger)code @@ -151,7 +151,7 @@ typedef NS_ENUM(NSUInteger, SKSubscriptionPeriodUnitMessage) { @property(nonatomic, copy, nullable) NSDictionary *userInfo; @end -@interface SKPaymentDiscountMessage : NSObject +@interface FIASKPaymentDiscountMessage : NSObject /// `init` unavailable to enforce nonnull fields, see the `make` class method. - (instancetype)init NS_UNAVAILABLE; + (instancetype)makeWithIdentifier:(NSString *)identifier @@ -166,7 +166,7 @@ typedef NS_ENUM(NSUInteger, SKSubscriptionPeriodUnitMessage) { @property(nonatomic, assign) NSInteger timestamp; @end -@interface SKStorefrontMessage : NSObject +@interface FIASKStorefrontMessage : NSObject /// `init` unavailable to enforce nonnull fields, see the `make` class method. - (instancetype)init NS_UNAVAILABLE; + (instancetype)makeWithCountryCode:(NSString *)countryCode identifier:(NSString *)identifier; @@ -174,38 +174,38 @@ typedef NS_ENUM(NSUInteger, SKSubscriptionPeriodUnitMessage) { @property(nonatomic, copy) NSString *identifier; @end -@interface SKProductsResponseMessage : NSObject -+ (instancetype)makeWithProducts:(nullable NSArray *)products +@interface FIASKProductsResponseMessage : NSObject ++ (instancetype)makeWithProducts:(nullable NSArray *)products invalidProductIdentifiers:(nullable NSArray *)invalidProductIdentifiers; -@property(nonatomic, copy, nullable) NSArray *products; +@property(nonatomic, copy, nullable) NSArray *products; @property(nonatomic, copy, nullable) NSArray *invalidProductIdentifiers; @end -@interface SKProductMessage : NSObject +@interface FIASKProductMessage : NSObject /// `init` unavailable to enforce nonnull fields, see the `make` class method. - (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithProductIdentifier:(NSString *)productIdentifier - localizedTitle:(NSString *)localizedTitle - localizedDescription:(NSString *)localizedDescription - priceLocale:(SKPriceLocaleMessage *)priceLocale - subscriptionGroupIdentifier:(nullable NSString *)subscriptionGroupIdentifier - price:(NSString *)price - subscriptionPeriod: - (nullable SKProductSubscriptionPeriodMessage *)subscriptionPeriod - introductoryPrice:(nullable SKProductDiscountMessage *)introductoryPrice - discounts:(nullable NSArray *)discounts; ++ (instancetype) + makeWithProductIdentifier:(NSString *)productIdentifier + localizedTitle:(NSString *)localizedTitle + localizedDescription:(nullable NSString *)localizedDescription + priceLocale:(FIASKPriceLocaleMessage *)priceLocale + subscriptionGroupIdentifier:(nullable NSString *)subscriptionGroupIdentifier + price:(NSString *)price + subscriptionPeriod:(nullable FIASKProductSubscriptionPeriodMessage *)subscriptionPeriod + introductoryPrice:(nullable FIASKProductDiscountMessage *)introductoryPrice + discounts:(nullable NSArray *)discounts; @property(nonatomic, copy) NSString *productIdentifier; @property(nonatomic, copy) NSString *localizedTitle; -@property(nonatomic, copy) NSString *localizedDescription; -@property(nonatomic, strong) SKPriceLocaleMessage *priceLocale; +@property(nonatomic, copy, nullable) NSString *localizedDescription; +@property(nonatomic, strong) FIASKPriceLocaleMessage *priceLocale; @property(nonatomic, copy, nullable) NSString *subscriptionGroupIdentifier; @property(nonatomic, copy) NSString *price; -@property(nonatomic, strong, nullable) SKProductSubscriptionPeriodMessage *subscriptionPeriod; -@property(nonatomic, strong, nullable) SKProductDiscountMessage *introductoryPrice; -@property(nonatomic, copy, nullable) NSArray *discounts; +@property(nonatomic, strong, nullable) FIASKProductSubscriptionPeriodMessage *subscriptionPeriod; +@property(nonatomic, strong, nullable) FIASKProductDiscountMessage *introductoryPrice; +@property(nonatomic, copy, nullable) NSArray *discounts; @end -@interface SKPriceLocaleMessage : NSObject +@interface FIASKPriceLocaleMessage : NSObject /// `init` unavailable to enforce nonnull fields, see the `make` class method. - (instancetype)init NS_UNAVAILABLE; + (instancetype)makeWithCurrencySymbol:(NSString *)currencySymbol @@ -219,51 +219,51 @@ typedef NS_ENUM(NSUInteger, SKSubscriptionPeriodUnitMessage) { @property(nonatomic, copy) NSString *countryCode; @end -@interface SKProductDiscountMessage : NSObject +@interface FIASKProductDiscountMessage : NSObject /// `init` unavailable to enforce nonnull fields, see the `make` class method. - (instancetype)init NS_UNAVAILABLE; + (instancetype)makeWithPrice:(NSString *)price - priceLocale:(SKPriceLocaleMessage *)priceLocale + priceLocale:(FIASKPriceLocaleMessage *)priceLocale numberOfPeriods:(NSInteger)numberOfPeriods - paymentMode:(SKProductDiscountPaymentModeMessage)paymentMode - subscriptionPeriod:(SKProductSubscriptionPeriodMessage *)subscriptionPeriod + paymentMode:(FIASKProductDiscountPaymentModeMessage)paymentMode + subscriptionPeriod:(FIASKProductSubscriptionPeriodMessage *)subscriptionPeriod identifier:(nullable NSString *)identifier - type:(SKProductDiscountTypeMessage)type; + type:(FIASKProductDiscountTypeMessage)type; @property(nonatomic, copy) NSString *price; -@property(nonatomic, strong) SKPriceLocaleMessage *priceLocale; +@property(nonatomic, strong) FIASKPriceLocaleMessage *priceLocale; @property(nonatomic, assign) NSInteger numberOfPeriods; -@property(nonatomic, assign) SKProductDiscountPaymentModeMessage paymentMode; -@property(nonatomic, strong) SKProductSubscriptionPeriodMessage *subscriptionPeriod; +@property(nonatomic, assign) FIASKProductDiscountPaymentModeMessage paymentMode; +@property(nonatomic, strong) FIASKProductSubscriptionPeriodMessage *subscriptionPeriod; @property(nonatomic, copy, nullable) NSString *identifier; -@property(nonatomic, assign) SKProductDiscountTypeMessage type; +@property(nonatomic, assign) FIASKProductDiscountTypeMessage type; @end -@interface SKProductSubscriptionPeriodMessage : NSObject +@interface FIASKProductSubscriptionPeriodMessage : NSObject /// `init` unavailable to enforce nonnull fields, see the `make` class method. - (instancetype)init NS_UNAVAILABLE; + (instancetype)makeWithNumberOfUnits:(NSInteger)numberOfUnits - unit:(SKSubscriptionPeriodUnitMessage)unit; + unit:(FIASKSubscriptionPeriodUnitMessage)unit; @property(nonatomic, assign) NSInteger numberOfUnits; -@property(nonatomic, assign) SKSubscriptionPeriodUnitMessage unit; +@property(nonatomic, assign) FIASKSubscriptionPeriodUnitMessage unit; @end -/// The codec used by InAppPurchaseAPI. -NSObject *InAppPurchaseAPIGetCodec(void); +/// The codec used by all APIs. +NSObject *FIAGetMessagesCodec(void); -@protocol InAppPurchaseAPI +@protocol FIAInAppPurchaseAPI /// Returns if the current device is able to make payments /// /// @return `nil` only when `error != nil`. - (nullable NSNumber *)canMakePaymentsWithError:(FlutterError *_Nullable *_Nonnull)error; /// @return `nil` only when `error != nil`. -- (nullable NSArray *)transactionsWithError: +- (nullable NSArray *)transactionsWithError: (FlutterError *_Nullable *_Nonnull)error; /// @return `nil` only when `error != nil`. -- (nullable SKStorefrontMessage *)storefrontWithError:(FlutterError *_Nullable *_Nonnull)error; +- (nullable FIASKStorefrontMessage *)storefrontWithError:(FlutterError *_Nullable *_Nonnull)error; - (void)addPaymentPaymentMap:(NSDictionary *)paymentMap error:(FlutterError *_Nullable *_Nonnull)error; - (void)startProductRequestProductIdentifiers:(NSArray *)productIdentifiers - completion:(void (^)(SKProductsResponseMessage *_Nullable, + completion:(void (^)(FIASKProductsResponseMessage *_Nullable, FlutterError *_Nullable))completion; - (void)finishTransactionFinishMap:(NSDictionary *)finishMap error:(FlutterError *_Nullable *_Nonnull)error; @@ -280,7 +280,11 @@ NSObject *InAppPurchaseAPIGetCodec(void); - (void)showPriceConsentIfNeededWithError:(FlutterError *_Nullable *_Nonnull)error; @end -extern void SetUpInAppPurchaseAPI(id binaryMessenger, - NSObject *_Nullable api); +extern void SetUpFIAInAppPurchaseAPI(id binaryMessenger, + NSObject *_Nullable api); + +extern void SetUpFIAInAppPurchaseAPIWithSuffix(id binaryMessenger, + NSObject *_Nullable api, + NSString *messageChannelSuffix); NS_ASSUME_NONNULL_END diff --git a/packages/in_app_purchase/in_app_purchase_storekit/darwin/Classes/messages.g.m b/packages/in_app_purchase/in_app_purchase_storekit/darwin/Classes/messages.g.m index f013f720511c..62988eb04fee 100644 --- a/packages/in_app_purchase/in_app_purchase_storekit/darwin/Classes/messages.g.m +++ b/packages/in_app_purchase/in_app_purchase_storekit/darwin/Classes/messages.g.m @@ -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 (v16.0.4), do not edit directly. +// Autogenerated from Pigeon (v22.4.2), do not edit directly. // See also: https://pub.dev/packages/pigeon #import "messages.g.h" @@ -16,7 +16,7 @@ #error File requires ARC to be enabled. #endif -static NSArray *wrapResult(id result, FlutterError *error) { +static NSArray *wrapResult(id result, FlutterError *error) { if (error) { return @[ error.code ?: [NSNull null], error.message ?: [NSNull null], error.details ?: [NSNull null] @@ -25,13 +25,13 @@ return @[ result ?: [NSNull null] ]; } -static id GetNullableObjectAtIndex(NSArray *array, NSInteger key) { +static id GetNullableObjectAtIndex(NSArray *array, NSInteger key) { id result = array[key]; return (result == [NSNull null]) ? nil : result; } -@implementation SKPaymentTransactionStateMessageBox -- (instancetype)initWithValue:(SKPaymentTransactionStateMessage)value { +@implementation FIASKPaymentTransactionStateMessageBox +- (instancetype)initWithValue:(FIASKPaymentTransactionStateMessage)value { self = [super init]; if (self) { _value = value; @@ -40,8 +40,8 @@ - (instancetype)initWithValue:(SKPaymentTransactionStateMessage)value { } @end -@implementation SKProductDiscountTypeMessageBox -- (instancetype)initWithValue:(SKProductDiscountTypeMessage)value { +@implementation FIASKProductDiscountTypeMessageBox +- (instancetype)initWithValue:(FIASKProductDiscountTypeMessage)value { self = [super init]; if (self) { _value = value; @@ -50,8 +50,8 @@ - (instancetype)initWithValue:(SKProductDiscountTypeMessage)value { } @end -@implementation SKProductDiscountPaymentModeMessageBox -- (instancetype)initWithValue:(SKProductDiscountPaymentModeMessage)value { +@implementation FIASKProductDiscountPaymentModeMessageBox +- (instancetype)initWithValue:(FIASKProductDiscountPaymentModeMessage)value { self = [super init]; if (self) { _value = value; @@ -60,8 +60,8 @@ - (instancetype)initWithValue:(SKProductDiscountPaymentModeMessage)value { } @end -@implementation SKSubscriptionPeriodUnitMessageBox -- (instancetype)initWithValue:(SKSubscriptionPeriodUnitMessage)value { +@implementation FIASKSubscriptionPeriodUnitMessageBox +- (instancetype)initWithValue:(FIASKSubscriptionPeriodUnitMessage)value { self = [super init]; if (self) { _value = value; @@ -70,74 +70,74 @@ - (instancetype)initWithValue:(SKSubscriptionPeriodUnitMessage)value { } @end -@interface SKPaymentTransactionMessage () -+ (SKPaymentTransactionMessage *)fromList:(NSArray *)list; -+ (nullable SKPaymentTransactionMessage *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; +@interface FIASKPaymentTransactionMessage () ++ (FIASKPaymentTransactionMessage *)fromList:(NSArray *)list; ++ (nullable FIASKPaymentTransactionMessage *)nullableFromList:(NSArray *)list; +- (NSArray *)toList; @end -@interface SKPaymentMessage () -+ (SKPaymentMessage *)fromList:(NSArray *)list; -+ (nullable SKPaymentMessage *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; +@interface FIASKPaymentMessage () ++ (FIASKPaymentMessage *)fromList:(NSArray *)list; ++ (nullable FIASKPaymentMessage *)nullableFromList:(NSArray *)list; +- (NSArray *)toList; @end -@interface SKErrorMessage () -+ (SKErrorMessage *)fromList:(NSArray *)list; -+ (nullable SKErrorMessage *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; +@interface FIASKErrorMessage () ++ (FIASKErrorMessage *)fromList:(NSArray *)list; ++ (nullable FIASKErrorMessage *)nullableFromList:(NSArray *)list; +- (NSArray *)toList; @end -@interface SKPaymentDiscountMessage () -+ (SKPaymentDiscountMessage *)fromList:(NSArray *)list; -+ (nullable SKPaymentDiscountMessage *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; +@interface FIASKPaymentDiscountMessage () ++ (FIASKPaymentDiscountMessage *)fromList:(NSArray *)list; ++ (nullable FIASKPaymentDiscountMessage *)nullableFromList:(NSArray *)list; +- (NSArray *)toList; @end -@interface SKStorefrontMessage () -+ (SKStorefrontMessage *)fromList:(NSArray *)list; -+ (nullable SKStorefrontMessage *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; +@interface FIASKStorefrontMessage () ++ (FIASKStorefrontMessage *)fromList:(NSArray *)list; ++ (nullable FIASKStorefrontMessage *)nullableFromList:(NSArray *)list; +- (NSArray *)toList; @end -@interface SKProductsResponseMessage () -+ (SKProductsResponseMessage *)fromList:(NSArray *)list; -+ (nullable SKProductsResponseMessage *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; +@interface FIASKProductsResponseMessage () ++ (FIASKProductsResponseMessage *)fromList:(NSArray *)list; ++ (nullable FIASKProductsResponseMessage *)nullableFromList:(NSArray *)list; +- (NSArray *)toList; @end -@interface SKProductMessage () -+ (SKProductMessage *)fromList:(NSArray *)list; -+ (nullable SKProductMessage *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; +@interface FIASKProductMessage () ++ (FIASKProductMessage *)fromList:(NSArray *)list; ++ (nullable FIASKProductMessage *)nullableFromList:(NSArray *)list; +- (NSArray *)toList; @end -@interface SKPriceLocaleMessage () -+ (SKPriceLocaleMessage *)fromList:(NSArray *)list; -+ (nullable SKPriceLocaleMessage *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; +@interface FIASKPriceLocaleMessage () ++ (FIASKPriceLocaleMessage *)fromList:(NSArray *)list; ++ (nullable FIASKPriceLocaleMessage *)nullableFromList:(NSArray *)list; +- (NSArray *)toList; @end -@interface SKProductDiscountMessage () -+ (SKProductDiscountMessage *)fromList:(NSArray *)list; -+ (nullable SKProductDiscountMessage *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; +@interface FIASKProductDiscountMessage () ++ (FIASKProductDiscountMessage *)fromList:(NSArray *)list; ++ (nullable FIASKProductDiscountMessage *)nullableFromList:(NSArray *)list; +- (NSArray *)toList; @end -@interface SKProductSubscriptionPeriodMessage () -+ (SKProductSubscriptionPeriodMessage *)fromList:(NSArray *)list; -+ (nullable SKProductSubscriptionPeriodMessage *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; +@interface FIASKProductSubscriptionPeriodMessage () ++ (FIASKProductSubscriptionPeriodMessage *)fromList:(NSArray *)list; ++ (nullable FIASKProductSubscriptionPeriodMessage *)nullableFromList:(NSArray *)list; +- (NSArray *)toList; @end -@implementation SKPaymentTransactionMessage -+ (instancetype)makeWithPayment:(SKPaymentMessage *)payment - transactionState:(SKPaymentTransactionStateMessage)transactionState - originalTransaction:(nullable SKPaymentTransactionMessage *)originalTransaction +@implementation FIASKPaymentTransactionMessage ++ (instancetype)makeWithPayment:(FIASKPaymentMessage *)payment + transactionState:(FIASKPaymentTransactionStateMessage)transactionState + originalTransaction:(nullable FIASKPaymentTransactionMessage *)originalTransaction transactionTimeStamp:(nullable NSNumber *)transactionTimeStamp transactionIdentifier:(nullable NSString *)transactionIdentifier - error:(nullable SKErrorMessage *)error { - SKPaymentTransactionMessage *pigeonResult = [[SKPaymentTransactionMessage alloc] init]; + error:(nullable FIASKErrorMessage *)error { + FIASKPaymentTransactionMessage *pigeonResult = [[FIASKPaymentTransactionMessage alloc] init]; pigeonResult.payment = payment; pigeonResult.transactionState = transactionState; pigeonResult.originalTransaction = originalTransaction; @@ -146,40 +146,41 @@ + (instancetype)makeWithPayment:(SKPaymentMessage *)payment pigeonResult.error = error; return pigeonResult; } -+ (SKPaymentTransactionMessage *)fromList:(NSArray *)list { - SKPaymentTransactionMessage *pigeonResult = [[SKPaymentTransactionMessage alloc] init]; - pigeonResult.payment = [SKPaymentMessage nullableFromList:(GetNullableObjectAtIndex(list, 0))]; - pigeonResult.transactionState = [GetNullableObjectAtIndex(list, 1) integerValue]; - pigeonResult.originalTransaction = - [SKPaymentTransactionMessage nullableFromList:(GetNullableObjectAtIndex(list, 2))]; ++ (FIASKPaymentTransactionMessage *)fromList:(NSArray *)list { + FIASKPaymentTransactionMessage *pigeonResult = [[FIASKPaymentTransactionMessage alloc] init]; + pigeonResult.payment = GetNullableObjectAtIndex(list, 0); + FIASKPaymentTransactionStateMessageBox *boxedFIASKPaymentTransactionStateMessage = + GetNullableObjectAtIndex(list, 1); + pigeonResult.transactionState = boxedFIASKPaymentTransactionStateMessage.value; + pigeonResult.originalTransaction = GetNullableObjectAtIndex(list, 2); pigeonResult.transactionTimeStamp = GetNullableObjectAtIndex(list, 3); pigeonResult.transactionIdentifier = GetNullableObjectAtIndex(list, 4); - pigeonResult.error = [SKErrorMessage nullableFromList:(GetNullableObjectAtIndex(list, 5))]; + pigeonResult.error = GetNullableObjectAtIndex(list, 5); return pigeonResult; } -+ (nullable SKPaymentTransactionMessage *)nullableFromList:(NSArray *)list { - return (list) ? [SKPaymentTransactionMessage fromList:list] : nil; ++ (nullable FIASKPaymentTransactionMessage *)nullableFromList:(NSArray *)list { + return (list) ? [FIASKPaymentTransactionMessage fromList:list] : nil; } -- (NSArray *)toList { +- (NSArray *)toList { return @[ - (self.payment ? [self.payment toList] : [NSNull null]), - @(self.transactionState), - (self.originalTransaction ? [self.originalTransaction toList] : [NSNull null]), + self.payment ?: [NSNull null], + [[FIASKPaymentTransactionStateMessageBox alloc] initWithValue:self.transactionState], + self.originalTransaction ?: [NSNull null], self.transactionTimeStamp ?: [NSNull null], self.transactionIdentifier ?: [NSNull null], - (self.error ? [self.error toList] : [NSNull null]), + self.error ?: [NSNull null], ]; } @end -@implementation SKPaymentMessage +@implementation FIASKPaymentMessage + (instancetype)makeWithProductIdentifier:(NSString *)productIdentifier applicationUsername:(nullable NSString *)applicationUsername requestData:(nullable NSString *)requestData quantity:(NSInteger)quantity simulatesAskToBuyInSandbox:(BOOL)simulatesAskToBuyInSandbox - paymentDiscount:(nullable SKPaymentDiscountMessage *)paymentDiscount { - SKPaymentMessage *pigeonResult = [[SKPaymentMessage alloc] init]; + paymentDiscount:(nullable FIASKPaymentDiscountMessage *)paymentDiscount { + FIASKPaymentMessage *pigeonResult = [[FIASKPaymentMessage alloc] init]; pigeonResult.productIdentifier = productIdentifier; pigeonResult.applicationUsername = applicationUsername; pigeonResult.requestData = requestData; @@ -188,53 +189,52 @@ + (instancetype)makeWithProductIdentifier:(NSString *)productIdentifier pigeonResult.paymentDiscount = paymentDiscount; return pigeonResult; } -+ (SKPaymentMessage *)fromList:(NSArray *)list { - SKPaymentMessage *pigeonResult = [[SKPaymentMessage alloc] init]; ++ (FIASKPaymentMessage *)fromList:(NSArray *)list { + FIASKPaymentMessage *pigeonResult = [[FIASKPaymentMessage alloc] init]; pigeonResult.productIdentifier = GetNullableObjectAtIndex(list, 0); pigeonResult.applicationUsername = GetNullableObjectAtIndex(list, 1); pigeonResult.requestData = GetNullableObjectAtIndex(list, 2); pigeonResult.quantity = [GetNullableObjectAtIndex(list, 3) integerValue]; pigeonResult.simulatesAskToBuyInSandbox = [GetNullableObjectAtIndex(list, 4) boolValue]; - pigeonResult.paymentDiscount = - [SKPaymentDiscountMessage nullableFromList:(GetNullableObjectAtIndex(list, 5))]; + pigeonResult.paymentDiscount = GetNullableObjectAtIndex(list, 5); return pigeonResult; } -+ (nullable SKPaymentMessage *)nullableFromList:(NSArray *)list { - return (list) ? [SKPaymentMessage fromList:list] : nil; ++ (nullable FIASKPaymentMessage *)nullableFromList:(NSArray *)list { + return (list) ? [FIASKPaymentMessage fromList:list] : nil; } -- (NSArray *)toList { +- (NSArray *)toList { return @[ self.productIdentifier ?: [NSNull null], self.applicationUsername ?: [NSNull null], self.requestData ?: [NSNull null], @(self.quantity), @(self.simulatesAskToBuyInSandbox), - (self.paymentDiscount ? [self.paymentDiscount toList] : [NSNull null]), + self.paymentDiscount ?: [NSNull null], ]; } @end -@implementation SKErrorMessage +@implementation FIASKErrorMessage + (instancetype)makeWithCode:(NSInteger)code domain:(NSString *)domain userInfo:(nullable NSDictionary *)userInfo { - SKErrorMessage *pigeonResult = [[SKErrorMessage alloc] init]; + FIASKErrorMessage *pigeonResult = [[FIASKErrorMessage alloc] init]; pigeonResult.code = code; pigeonResult.domain = domain; pigeonResult.userInfo = userInfo; return pigeonResult; } -+ (SKErrorMessage *)fromList:(NSArray *)list { - SKErrorMessage *pigeonResult = [[SKErrorMessage alloc] init]; ++ (FIASKErrorMessage *)fromList:(NSArray *)list { + FIASKErrorMessage *pigeonResult = [[FIASKErrorMessage alloc] init]; pigeonResult.code = [GetNullableObjectAtIndex(list, 0) integerValue]; pigeonResult.domain = GetNullableObjectAtIndex(list, 1); pigeonResult.userInfo = GetNullableObjectAtIndex(list, 2); return pigeonResult; } -+ (nullable SKErrorMessage *)nullableFromList:(NSArray *)list { - return (list) ? [SKErrorMessage fromList:list] : nil; ++ (nullable FIASKErrorMessage *)nullableFromList:(NSArray *)list { + return (list) ? [FIASKErrorMessage fromList:list] : nil; } -- (NSArray *)toList { +- (NSArray *)toList { return @[ @(self.code), self.domain ?: [NSNull null], @@ -243,13 +243,13 @@ - (NSArray *)toList { } @end -@implementation SKPaymentDiscountMessage +@implementation FIASKPaymentDiscountMessage + (instancetype)makeWithIdentifier:(NSString *)identifier keyIdentifier:(NSString *)keyIdentifier nonce:(NSString *)nonce signature:(NSString *)signature timestamp:(NSInteger)timestamp { - SKPaymentDiscountMessage *pigeonResult = [[SKPaymentDiscountMessage alloc] init]; + FIASKPaymentDiscountMessage *pigeonResult = [[FIASKPaymentDiscountMessage alloc] init]; pigeonResult.identifier = identifier; pigeonResult.keyIdentifier = keyIdentifier; pigeonResult.nonce = nonce; @@ -257,8 +257,8 @@ + (instancetype)makeWithIdentifier:(NSString *)identifier pigeonResult.timestamp = timestamp; return pigeonResult; } -+ (SKPaymentDiscountMessage *)fromList:(NSArray *)list { - SKPaymentDiscountMessage *pigeonResult = [[SKPaymentDiscountMessage alloc] init]; ++ (FIASKPaymentDiscountMessage *)fromList:(NSArray *)list { + FIASKPaymentDiscountMessage *pigeonResult = [[FIASKPaymentDiscountMessage alloc] init]; pigeonResult.identifier = GetNullableObjectAtIndex(list, 0); pigeonResult.keyIdentifier = GetNullableObjectAtIndex(list, 1); pigeonResult.nonce = GetNullableObjectAtIndex(list, 2); @@ -266,10 +266,10 @@ + (SKPaymentDiscountMessage *)fromList:(NSArray *)list { pigeonResult.timestamp = [GetNullableObjectAtIndex(list, 4) integerValue]; return pigeonResult; } -+ (nullable SKPaymentDiscountMessage *)nullableFromList:(NSArray *)list { - return (list) ? [SKPaymentDiscountMessage fromList:list] : nil; ++ (nullable FIASKPaymentDiscountMessage *)nullableFromList:(NSArray *)list { + return (list) ? [FIASKPaymentDiscountMessage fromList:list] : nil; } -- (NSArray *)toList { +- (NSArray *)toList { return @[ self.identifier ?: [NSNull null], self.keyIdentifier ?: [NSNull null], @@ -280,23 +280,23 @@ - (NSArray *)toList { } @end -@implementation SKStorefrontMessage +@implementation FIASKStorefrontMessage + (instancetype)makeWithCountryCode:(NSString *)countryCode identifier:(NSString *)identifier { - SKStorefrontMessage *pigeonResult = [[SKStorefrontMessage alloc] init]; + FIASKStorefrontMessage *pigeonResult = [[FIASKStorefrontMessage alloc] init]; pigeonResult.countryCode = countryCode; pigeonResult.identifier = identifier; return pigeonResult; } -+ (SKStorefrontMessage *)fromList:(NSArray *)list { - SKStorefrontMessage *pigeonResult = [[SKStorefrontMessage alloc] init]; ++ (FIASKStorefrontMessage *)fromList:(NSArray *)list { + FIASKStorefrontMessage *pigeonResult = [[FIASKStorefrontMessage alloc] init]; pigeonResult.countryCode = GetNullableObjectAtIndex(list, 0); pigeonResult.identifier = GetNullableObjectAtIndex(list, 1); return pigeonResult; } -+ (nullable SKStorefrontMessage *)nullableFromList:(NSArray *)list { - return (list) ? [SKStorefrontMessage fromList:list] : nil; ++ (nullable FIASKStorefrontMessage *)nullableFromList:(NSArray *)list { + return (list) ? [FIASKStorefrontMessage fromList:list] : nil; } -- (NSArray *)toList { +- (NSArray *)toList { return @[ self.countryCode ?: [NSNull null], self.identifier ?: [NSNull null], @@ -304,24 +304,24 @@ - (NSArray *)toList { } @end -@implementation SKProductsResponseMessage -+ (instancetype)makeWithProducts:(nullable NSArray *)products +@implementation FIASKProductsResponseMessage ++ (instancetype)makeWithProducts:(nullable NSArray *)products invalidProductIdentifiers:(nullable NSArray *)invalidProductIdentifiers { - SKProductsResponseMessage *pigeonResult = [[SKProductsResponseMessage alloc] init]; + FIASKProductsResponseMessage *pigeonResult = [[FIASKProductsResponseMessage alloc] init]; pigeonResult.products = products; pigeonResult.invalidProductIdentifiers = invalidProductIdentifiers; return pigeonResult; } -+ (SKProductsResponseMessage *)fromList:(NSArray *)list { - SKProductsResponseMessage *pigeonResult = [[SKProductsResponseMessage alloc] init]; ++ (FIASKProductsResponseMessage *)fromList:(NSArray *)list { + FIASKProductsResponseMessage *pigeonResult = [[FIASKProductsResponseMessage alloc] init]; pigeonResult.products = GetNullableObjectAtIndex(list, 0); pigeonResult.invalidProductIdentifiers = GetNullableObjectAtIndex(list, 1); return pigeonResult; } -+ (nullable SKProductsResponseMessage *)nullableFromList:(NSArray *)list { - return (list) ? [SKProductsResponseMessage fromList:list] : nil; ++ (nullable FIASKProductsResponseMessage *)nullableFromList:(NSArray *)list { + return (list) ? [FIASKProductsResponseMessage fromList:list] : nil; } -- (NSArray *)toList { +- (NSArray *)toList { return @[ self.products ?: [NSNull null], self.invalidProductIdentifiers ?: [NSNull null], @@ -329,18 +329,18 @@ - (NSArray *)toList { } @end -@implementation SKProductMessage +@implementation FIASKProductMessage + (instancetype) makeWithProductIdentifier:(NSString *)productIdentifier localizedTitle:(NSString *)localizedTitle - localizedDescription:(NSString *)localizedDescription - priceLocale:(SKPriceLocaleMessage *)priceLocale + localizedDescription:(nullable NSString *)localizedDescription + priceLocale:(FIASKPriceLocaleMessage *)priceLocale subscriptionGroupIdentifier:(nullable NSString *)subscriptionGroupIdentifier price:(NSString *)price - subscriptionPeriod:(nullable SKProductSubscriptionPeriodMessage *)subscriptionPeriod - introductoryPrice:(nullable SKProductDiscountMessage *)introductoryPrice - discounts:(nullable NSArray *)discounts { - SKProductMessage *pigeonResult = [[SKProductMessage alloc] init]; + subscriptionPeriod:(nullable FIASKProductSubscriptionPeriodMessage *)subscriptionPeriod + introductoryPrice:(nullable FIASKProductDiscountMessage *)introductoryPrice + discounts:(nullable NSArray *)discounts { + FIASKProductMessage *pigeonResult = [[FIASKProductMessage alloc] init]; pigeonResult.productIdentifier = productIdentifier; pigeonResult.localizedTitle = localizedTitle; pigeonResult.localizedDescription = localizedDescription; @@ -352,61 +352,58 @@ @implementation SKProductMessage pigeonResult.discounts = discounts; return pigeonResult; } -+ (SKProductMessage *)fromList:(NSArray *)list { - SKProductMessage *pigeonResult = [[SKProductMessage alloc] init]; ++ (FIASKProductMessage *)fromList:(NSArray *)list { + FIASKProductMessage *pigeonResult = [[FIASKProductMessage alloc] init]; pigeonResult.productIdentifier = GetNullableObjectAtIndex(list, 0); pigeonResult.localizedTitle = GetNullableObjectAtIndex(list, 1); pigeonResult.localizedDescription = GetNullableObjectAtIndex(list, 2); - pigeonResult.priceLocale = - [SKPriceLocaleMessage nullableFromList:(GetNullableObjectAtIndex(list, 3))]; + pigeonResult.priceLocale = GetNullableObjectAtIndex(list, 3); pigeonResult.subscriptionGroupIdentifier = GetNullableObjectAtIndex(list, 4); pigeonResult.price = GetNullableObjectAtIndex(list, 5); - pigeonResult.subscriptionPeriod = - [SKProductSubscriptionPeriodMessage nullableFromList:(GetNullableObjectAtIndex(list, 6))]; - pigeonResult.introductoryPrice = - [SKProductDiscountMessage nullableFromList:(GetNullableObjectAtIndex(list, 7))]; + pigeonResult.subscriptionPeriod = GetNullableObjectAtIndex(list, 6); + pigeonResult.introductoryPrice = GetNullableObjectAtIndex(list, 7); pigeonResult.discounts = GetNullableObjectAtIndex(list, 8); return pigeonResult; } -+ (nullable SKProductMessage *)nullableFromList:(NSArray *)list { - return (list) ? [SKProductMessage fromList:list] : nil; ++ (nullable FIASKProductMessage *)nullableFromList:(NSArray *)list { + return (list) ? [FIASKProductMessage fromList:list] : nil; } -- (NSArray *)toList { +- (NSArray *)toList { return @[ self.productIdentifier ?: [NSNull null], self.localizedTitle ?: [NSNull null], self.localizedDescription ?: [NSNull null], - (self.priceLocale ? [self.priceLocale toList] : [NSNull null]), + self.priceLocale ?: [NSNull null], self.subscriptionGroupIdentifier ?: [NSNull null], self.price ?: [NSNull null], - (self.subscriptionPeriod ? [self.subscriptionPeriod toList] : [NSNull null]), - (self.introductoryPrice ? [self.introductoryPrice toList] : [NSNull null]), + self.subscriptionPeriod ?: [NSNull null], + self.introductoryPrice ?: [NSNull null], self.discounts ?: [NSNull null], ]; } @end -@implementation SKPriceLocaleMessage +@implementation FIASKPriceLocaleMessage + (instancetype)makeWithCurrencySymbol:(NSString *)currencySymbol currencyCode:(NSString *)currencyCode countryCode:(NSString *)countryCode { - SKPriceLocaleMessage *pigeonResult = [[SKPriceLocaleMessage alloc] init]; + FIASKPriceLocaleMessage *pigeonResult = [[FIASKPriceLocaleMessage alloc] init]; pigeonResult.currencySymbol = currencySymbol; pigeonResult.currencyCode = currencyCode; pigeonResult.countryCode = countryCode; return pigeonResult; } -+ (SKPriceLocaleMessage *)fromList:(NSArray *)list { - SKPriceLocaleMessage *pigeonResult = [[SKPriceLocaleMessage alloc] init]; ++ (FIASKPriceLocaleMessage *)fromList:(NSArray *)list { + FIASKPriceLocaleMessage *pigeonResult = [[FIASKPriceLocaleMessage alloc] init]; pigeonResult.currencySymbol = GetNullableObjectAtIndex(list, 0); pigeonResult.currencyCode = GetNullableObjectAtIndex(list, 1); pigeonResult.countryCode = GetNullableObjectAtIndex(list, 2); return pigeonResult; } -+ (nullable SKPriceLocaleMessage *)nullableFromList:(NSArray *)list { - return (list) ? [SKPriceLocaleMessage fromList:list] : nil; ++ (nullable FIASKPriceLocaleMessage *)nullableFromList:(NSArray *)list { + return (list) ? [FIASKPriceLocaleMessage fromList:list] : nil; } -- (NSArray *)toList { +- (NSArray *)toList { return @[ self.currencySymbol ?: [NSNull null], self.currencyCode ?: [NSNull null], @@ -415,15 +412,15 @@ - (NSArray *)toList { } @end -@implementation SKProductDiscountMessage +@implementation FIASKProductDiscountMessage + (instancetype)makeWithPrice:(NSString *)price - priceLocale:(SKPriceLocaleMessage *)priceLocale + priceLocale:(FIASKPriceLocaleMessage *)priceLocale numberOfPeriods:(NSInteger)numberOfPeriods - paymentMode:(SKProductDiscountPaymentModeMessage)paymentMode - subscriptionPeriod:(SKProductSubscriptionPeriodMessage *)subscriptionPeriod + paymentMode:(FIASKProductDiscountPaymentModeMessage)paymentMode + subscriptionPeriod:(FIASKProductSubscriptionPeriodMessage *)subscriptionPeriod identifier:(nullable NSString *)identifier - type:(SKProductDiscountTypeMessage)type { - SKProductDiscountMessage *pigeonResult = [[SKProductDiscountMessage alloc] init]; + type:(FIASKProductDiscountTypeMessage)type { + FIASKProductDiscountMessage *pigeonResult = [[FIASKProductDiscountMessage alloc] init]; pigeonResult.price = price; pigeonResult.priceLocale = priceLocale; pigeonResult.numberOfPeriods = numberOfPeriods; @@ -433,168 +430,223 @@ + (instancetype)makeWithPrice:(NSString *)price pigeonResult.type = type; return pigeonResult; } -+ (SKProductDiscountMessage *)fromList:(NSArray *)list { - SKProductDiscountMessage *pigeonResult = [[SKProductDiscountMessage alloc] init]; ++ (FIASKProductDiscountMessage *)fromList:(NSArray *)list { + FIASKProductDiscountMessage *pigeonResult = [[FIASKProductDiscountMessage alloc] init]; pigeonResult.price = GetNullableObjectAtIndex(list, 0); - pigeonResult.priceLocale = - [SKPriceLocaleMessage nullableFromList:(GetNullableObjectAtIndex(list, 1))]; + pigeonResult.priceLocale = GetNullableObjectAtIndex(list, 1); pigeonResult.numberOfPeriods = [GetNullableObjectAtIndex(list, 2) integerValue]; - pigeonResult.paymentMode = [GetNullableObjectAtIndex(list, 3) integerValue]; - pigeonResult.subscriptionPeriod = - [SKProductSubscriptionPeriodMessage nullableFromList:(GetNullableObjectAtIndex(list, 4))]; + FIASKProductDiscountPaymentModeMessageBox *boxedFIASKProductDiscountPaymentModeMessage = + GetNullableObjectAtIndex(list, 3); + pigeonResult.paymentMode = boxedFIASKProductDiscountPaymentModeMessage.value; + pigeonResult.subscriptionPeriod = GetNullableObjectAtIndex(list, 4); pigeonResult.identifier = GetNullableObjectAtIndex(list, 5); - pigeonResult.type = [GetNullableObjectAtIndex(list, 6) integerValue]; + FIASKProductDiscountTypeMessageBox *boxedFIASKProductDiscountTypeMessage = + GetNullableObjectAtIndex(list, 6); + pigeonResult.type = boxedFIASKProductDiscountTypeMessage.value; return pigeonResult; } -+ (nullable SKProductDiscountMessage *)nullableFromList:(NSArray *)list { - return (list) ? [SKProductDiscountMessage fromList:list] : nil; ++ (nullable FIASKProductDiscountMessage *)nullableFromList:(NSArray *)list { + return (list) ? [FIASKProductDiscountMessage fromList:list] : nil; } -- (NSArray *)toList { +- (NSArray *)toList { return @[ self.price ?: [NSNull null], - (self.priceLocale ? [self.priceLocale toList] : [NSNull null]), + self.priceLocale ?: [NSNull null], @(self.numberOfPeriods), - @(self.paymentMode), - (self.subscriptionPeriod ? [self.subscriptionPeriod toList] : [NSNull null]), + [[FIASKProductDiscountPaymentModeMessageBox alloc] initWithValue:self.paymentMode], + self.subscriptionPeriod ?: [NSNull null], self.identifier ?: [NSNull null], - @(self.type), + [[FIASKProductDiscountTypeMessageBox alloc] initWithValue:self.type], ]; } @end -@implementation SKProductSubscriptionPeriodMessage +@implementation FIASKProductSubscriptionPeriodMessage + (instancetype)makeWithNumberOfUnits:(NSInteger)numberOfUnits - unit:(SKSubscriptionPeriodUnitMessage)unit { - SKProductSubscriptionPeriodMessage *pigeonResult = - [[SKProductSubscriptionPeriodMessage alloc] init]; + unit:(FIASKSubscriptionPeriodUnitMessage)unit { + FIASKProductSubscriptionPeriodMessage *pigeonResult = + [[FIASKProductSubscriptionPeriodMessage alloc] init]; pigeonResult.numberOfUnits = numberOfUnits; pigeonResult.unit = unit; return pigeonResult; } -+ (SKProductSubscriptionPeriodMessage *)fromList:(NSArray *)list { - SKProductSubscriptionPeriodMessage *pigeonResult = - [[SKProductSubscriptionPeriodMessage alloc] init]; ++ (FIASKProductSubscriptionPeriodMessage *)fromList:(NSArray *)list { + FIASKProductSubscriptionPeriodMessage *pigeonResult = + [[FIASKProductSubscriptionPeriodMessage alloc] init]; pigeonResult.numberOfUnits = [GetNullableObjectAtIndex(list, 0) integerValue]; - pigeonResult.unit = [GetNullableObjectAtIndex(list, 1) integerValue]; + FIASKSubscriptionPeriodUnitMessageBox *boxedFIASKSubscriptionPeriodUnitMessage = + GetNullableObjectAtIndex(list, 1); + pigeonResult.unit = boxedFIASKSubscriptionPeriodUnitMessage.value; return pigeonResult; } -+ (nullable SKProductSubscriptionPeriodMessage *)nullableFromList:(NSArray *)list { - return (list) ? [SKProductSubscriptionPeriodMessage fromList:list] : nil; ++ (nullable FIASKProductSubscriptionPeriodMessage *)nullableFromList:(NSArray *)list { + return (list) ? [FIASKProductSubscriptionPeriodMessage fromList:list] : nil; } -- (NSArray *)toList { +- (NSArray *)toList { return @[ @(self.numberOfUnits), - @(self.unit), + [[FIASKSubscriptionPeriodUnitMessageBox alloc] initWithValue:self.unit], ]; } @end -@interface InAppPurchaseAPICodecReader : FlutterStandardReader +@interface FIAMessagesPigeonCodecReader : FlutterStandardReader @end -@implementation InAppPurchaseAPICodecReader +@implementation FIAMessagesPigeonCodecReader - (nullable id)readValueOfType:(UInt8)type { switch (type) { - case 128: - return [SKErrorMessage fromList:[self readValue]]; - case 129: - return [SKPaymentDiscountMessage fromList:[self readValue]]; - case 130: - return [SKPaymentMessage fromList:[self readValue]]; - case 131: - return [SKPaymentTransactionMessage fromList:[self readValue]]; - case 132: - return [SKPriceLocaleMessage fromList:[self readValue]]; + case 129: { + NSNumber *enumAsNumber = [self readValue]; + return enumAsNumber == nil ? nil + : [[FIASKPaymentTransactionStateMessageBox alloc] + initWithValue:[enumAsNumber integerValue]]; + } + case 130: { + NSNumber *enumAsNumber = [self readValue]; + return enumAsNumber == nil ? nil + : [[FIASKProductDiscountTypeMessageBox alloc] + initWithValue:[enumAsNumber integerValue]]; + } + case 131: { + NSNumber *enumAsNumber = [self readValue]; + return enumAsNumber == nil ? nil + : [[FIASKProductDiscountPaymentModeMessageBox alloc] + initWithValue:[enumAsNumber integerValue]]; + } + case 132: { + NSNumber *enumAsNumber = [self readValue]; + return enumAsNumber == nil ? nil + : [[FIASKSubscriptionPeriodUnitMessageBox alloc] + initWithValue:[enumAsNumber integerValue]]; + } case 133: - return [SKProductDiscountMessage fromList:[self readValue]]; + return [FIASKPaymentTransactionMessage fromList:[self readValue]]; case 134: - return [SKProductMessage fromList:[self readValue]]; + return [FIASKPaymentMessage fromList:[self readValue]]; case 135: - return [SKProductSubscriptionPeriodMessage fromList:[self readValue]]; + return [FIASKErrorMessage fromList:[self readValue]]; case 136: - return [SKProductsResponseMessage fromList:[self readValue]]; + return [FIASKPaymentDiscountMessage fromList:[self readValue]]; case 137: - return [SKStorefrontMessage fromList:[self readValue]]; + return [FIASKStorefrontMessage fromList:[self readValue]]; + case 138: + return [FIASKProductsResponseMessage fromList:[self readValue]]; + case 139: + return [FIASKProductMessage fromList:[self readValue]]; + case 140: + return [FIASKPriceLocaleMessage fromList:[self readValue]]; + case 141: + return [FIASKProductDiscountMessage fromList:[self readValue]]; + case 142: + return [FIASKProductSubscriptionPeriodMessage fromList:[self readValue]]; default: return [super readValueOfType:type]; } } @end -@interface InAppPurchaseAPICodecWriter : FlutterStandardWriter +@interface FIAMessagesPigeonCodecWriter : FlutterStandardWriter @end -@implementation InAppPurchaseAPICodecWriter +@implementation FIAMessagesPigeonCodecWriter - (void)writeValue:(id)value { - if ([value isKindOfClass:[SKErrorMessage class]]) { - [self writeByte:128]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[SKPaymentDiscountMessage class]]) { + if ([value isKindOfClass:[FIASKPaymentTransactionStateMessageBox class]]) { + FIASKPaymentTransactionStateMessageBox *box = (FIASKPaymentTransactionStateMessageBox *)value; [self writeByte:129]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[SKPaymentMessage class]]) { + [self writeValue:(value == nil ? [NSNull null] : [NSNumber numberWithInteger:box.value])]; + } else if ([value isKindOfClass:[FIASKProductDiscountTypeMessageBox class]]) { + FIASKProductDiscountTypeMessageBox *box = (FIASKProductDiscountTypeMessageBox *)value; [self writeByte:130]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[SKPaymentTransactionMessage class]]) { + [self writeValue:(value == nil ? [NSNull null] : [NSNumber numberWithInteger:box.value])]; + } else if ([value isKindOfClass:[FIASKProductDiscountPaymentModeMessageBox class]]) { + FIASKProductDiscountPaymentModeMessageBox *box = + (FIASKProductDiscountPaymentModeMessageBox *)value; [self writeByte:131]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[SKPriceLocaleMessage class]]) { + [self writeValue:(value == nil ? [NSNull null] : [NSNumber numberWithInteger:box.value])]; + } else if ([value isKindOfClass:[FIASKSubscriptionPeriodUnitMessageBox class]]) { + FIASKSubscriptionPeriodUnitMessageBox *box = (FIASKSubscriptionPeriodUnitMessageBox *)value; [self writeByte:132]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[SKProductDiscountMessage class]]) { + [self writeValue:(value == nil ? [NSNull null] : [NSNumber numberWithInteger:box.value])]; + } else if ([value isKindOfClass:[FIASKPaymentTransactionMessage class]]) { [self writeByte:133]; [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[SKProductMessage class]]) { + } else if ([value isKindOfClass:[FIASKPaymentMessage class]]) { [self writeByte:134]; [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[SKProductSubscriptionPeriodMessage class]]) { + } else if ([value isKindOfClass:[FIASKErrorMessage class]]) { [self writeByte:135]; [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[SKProductsResponseMessage class]]) { + } else if ([value isKindOfClass:[FIASKPaymentDiscountMessage class]]) { [self writeByte:136]; [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[SKStorefrontMessage class]]) { + } else if ([value isKindOfClass:[FIASKStorefrontMessage class]]) { [self writeByte:137]; [self writeValue:[value toList]]; + } else if ([value isKindOfClass:[FIASKProductsResponseMessage class]]) { + [self writeByte:138]; + [self writeValue:[value toList]]; + } else if ([value isKindOfClass:[FIASKProductMessage class]]) { + [self writeByte:139]; + [self writeValue:[value toList]]; + } else if ([value isKindOfClass:[FIASKPriceLocaleMessage class]]) { + [self writeByte:140]; + [self writeValue:[value toList]]; + } else if ([value isKindOfClass:[FIASKProductDiscountMessage class]]) { + [self writeByte:141]; + [self writeValue:[value toList]]; + } else if ([value isKindOfClass:[FIASKProductSubscriptionPeriodMessage class]]) { + [self writeByte:142]; + [self writeValue:[value toList]]; } else { [super writeValue:value]; } } @end -@interface InAppPurchaseAPICodecReaderWriter : FlutterStandardReaderWriter +@interface FIAMessagesPigeonCodecReaderWriter : FlutterStandardReaderWriter @end -@implementation InAppPurchaseAPICodecReaderWriter +@implementation FIAMessagesPigeonCodecReaderWriter - (FlutterStandardWriter *)writerWithData:(NSMutableData *)data { - return [[InAppPurchaseAPICodecWriter alloc] initWithData:data]; + return [[FIAMessagesPigeonCodecWriter alloc] initWithData:data]; } - (FlutterStandardReader *)readerWithData:(NSData *)data { - return [[InAppPurchaseAPICodecReader alloc] initWithData:data]; + return [[FIAMessagesPigeonCodecReader alloc] initWithData:data]; } @end -NSObject *InAppPurchaseAPIGetCodec(void) { +NSObject *FIAGetMessagesCodec(void) { static FlutterStandardMessageCodec *sSharedObject = nil; static dispatch_once_t sPred = 0; dispatch_once(&sPred, ^{ - InAppPurchaseAPICodecReaderWriter *readerWriter = - [[InAppPurchaseAPICodecReaderWriter alloc] init]; + FIAMessagesPigeonCodecReaderWriter *readerWriter = + [[FIAMessagesPigeonCodecReaderWriter alloc] init]; sSharedObject = [FlutterStandardMessageCodec codecWithReaderWriter:readerWriter]; }); return sSharedObject; } +void SetUpFIAInAppPurchaseAPI(id binaryMessenger, + NSObject *api) { + SetUpFIAInAppPurchaseAPIWithSuffix(binaryMessenger, api, @""); +} -void SetUpInAppPurchaseAPI(id binaryMessenger, - NSObject *api) { +void SetUpFIAInAppPurchaseAPIWithSuffix(id binaryMessenger, + NSObject *api, + NSString *messageChannelSuffix) { + messageChannelSuffix = messageChannelSuffix.length > 0 + ? [NSString stringWithFormat:@".%@", messageChannelSuffix] + : @""; /// Returns if the current device is able to make payments { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - @"dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.canMakePayments" + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.in_app_purchase_storekit." + @"InAppPurchaseAPI.canMakePayments", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:InAppPurchaseAPIGetCodec()]; + codec:FIAGetMessagesCodec()]; if (api) { NSCAssert( [api respondsToSelector:@selector(canMakePaymentsWithError:)], - @"InAppPurchaseAPI api (%@) doesn't respond to @selector(canMakePaymentsWithError:)", + @"FIAInAppPurchaseAPI api (%@) doesn't respond to @selector(canMakePaymentsWithError:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { FlutterError *error; @@ -607,16 +659,20 @@ void SetUpInAppPurchaseAPI(id binaryMessenger, } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.transactions" + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.in_app_purchase_storekit." + @"InAppPurchaseAPI.transactions", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:InAppPurchaseAPIGetCodec()]; + codec:FIAGetMessagesCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(transactionsWithError:)], - @"InAppPurchaseAPI api (%@) doesn't respond to @selector(transactionsWithError:)", - api); + NSCAssert( + [api respondsToSelector:@selector(transactionsWithError:)], + @"FIAInAppPurchaseAPI api (%@) doesn't respond to @selector(transactionsWithError:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { FlutterError *error; - NSArray *output = [api transactionsWithError:&error]; + NSArray *output = [api transactionsWithError:&error]; callback(wrapResult(output, error)); }]; } else { @@ -625,16 +681,19 @@ void SetUpInAppPurchaseAPI(id binaryMessenger, } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.storefront" + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.in_app_purchase_storekit." + @"InAppPurchaseAPI.storefront", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:InAppPurchaseAPIGetCodec()]; + codec:FIAGetMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(storefrontWithError:)], - @"InAppPurchaseAPI api (%@) doesn't respond to @selector(storefrontWithError:)", + @"FIAInAppPurchaseAPI api (%@) doesn't respond to @selector(storefrontWithError:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { FlutterError *error; - SKStorefrontMessage *output = [api storefrontWithError:&error]; + FIASKStorefrontMessage *output = [api storefrontWithError:&error]; callback(wrapResult(output, error)); }]; } else { @@ -643,16 +702,19 @@ void SetUpInAppPurchaseAPI(id binaryMessenger, } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.addPayment" + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.in_app_purchase_storekit." + @"InAppPurchaseAPI.addPayment", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:InAppPurchaseAPIGetCodec()]; + codec:FIAGetMessagesCodec()]; if (api) { NSCAssert( [api respondsToSelector:@selector(addPaymentPaymentMap:error:)], - @"InAppPurchaseAPI api (%@) doesn't respond to @selector(addPaymentPaymentMap:error:)", + @"FIAInAppPurchaseAPI api (%@) doesn't respond to @selector(addPaymentPaymentMap:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; NSDictionary *arg_paymentMap = GetNullableObjectAtIndex(args, 0); FlutterError *error; [api addPaymentPaymentMap:arg_paymentMap error:&error]; @@ -664,21 +726,23 @@ void SetUpInAppPurchaseAPI(id binaryMessenger, } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - @"dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.startProductRequest" + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.in_app_purchase_storekit." + @"InAppPurchaseAPI.startProductRequest", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:InAppPurchaseAPIGetCodec()]; + codec:FIAGetMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(startProductRequestProductIdentifiers: completion:)], - @"InAppPurchaseAPI api (%@) doesn't respond to " + @"FIAInAppPurchaseAPI api (%@) doesn't respond to " @"@selector(startProductRequestProductIdentifiers:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; NSArray *arg_productIdentifiers = GetNullableObjectAtIndex(args, 0); [api startProductRequestProductIdentifiers:arg_productIdentifiers - completion:^(SKProductsResponseMessage *_Nullable output, + completion:^(FIASKProductsResponseMessage *_Nullable output, FlutterError *_Nullable error) { callback(wrapResult(output, error)); }]; @@ -689,17 +753,19 @@ void SetUpInAppPurchaseAPI(id binaryMessenger, } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - @"dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.finishTransaction" + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.in_app_purchase_storekit." + @"InAppPurchaseAPI.finishTransaction", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:InAppPurchaseAPIGetCodec()]; + codec:FIAGetMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(finishTransactionFinishMap:error:)], - @"InAppPurchaseAPI api (%@) doesn't respond to " + @"FIAInAppPurchaseAPI api (%@) doesn't respond to " @"@selector(finishTransactionFinishMap:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; NSDictionary *arg_finishMap = GetNullableObjectAtIndex(args, 0); FlutterError *error; [api finishTransactionFinishMap:arg_finishMap error:&error]; @@ -711,17 +777,19 @@ void SetUpInAppPurchaseAPI(id binaryMessenger, } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - @"dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.restoreTransactions" + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.in_app_purchase_storekit." + @"InAppPurchaseAPI.restoreTransactions", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:InAppPurchaseAPIGetCodec()]; + codec:FIAGetMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(restoreTransactionsApplicationUserName:error:)], - @"InAppPurchaseAPI api (%@) doesn't respond to " + @"FIAInAppPurchaseAPI api (%@) doesn't respond to " @"@selector(restoreTransactionsApplicationUserName:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; NSString *arg_applicationUserName = GetNullableObjectAtIndex(args, 0); FlutterError *error; [api restoreTransactionsApplicationUserName:arg_applicationUserName error:&error]; @@ -733,13 +801,15 @@ void SetUpInAppPurchaseAPI(id binaryMessenger, } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI." - @"presentCodeRedemptionSheet" + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.in_app_purchase_storekit." + @"InAppPurchaseAPI.presentCodeRedemptionSheet", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:InAppPurchaseAPIGetCodec()]; + codec:FIAGetMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(presentCodeRedemptionSheetWithError:)], - @"InAppPurchaseAPI api (%@) doesn't respond to " + @"FIAInAppPurchaseAPI api (%@) doesn't respond to " @"@selector(presentCodeRedemptionSheetWithError:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { @@ -753,15 +823,17 @@ void SetUpInAppPurchaseAPI(id binaryMessenger, } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - @"dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.retrieveReceiptData" + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.in_app_purchase_storekit." + @"InAppPurchaseAPI.retrieveReceiptData", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:InAppPurchaseAPIGetCodec()]; + codec:FIAGetMessagesCodec()]; if (api) { - NSCAssert( - [api respondsToSelector:@selector(retrieveReceiptDataWithError:)], - @"InAppPurchaseAPI api (%@) doesn't respond to @selector(retrieveReceiptDataWithError:)", - api); + NSCAssert([api respondsToSelector:@selector(retrieveReceiptDataWithError:)], + @"FIAInAppPurchaseAPI api (%@) doesn't respond to " + @"@selector(retrieveReceiptDataWithError:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { FlutterError *error; NSString *output = [api retrieveReceiptDataWithError:&error]; @@ -773,17 +845,19 @@ void SetUpInAppPurchaseAPI(id binaryMessenger, } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - @"dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.refreshReceipt" + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.in_app_purchase_storekit." + @"InAppPurchaseAPI.refreshReceipt", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:InAppPurchaseAPIGetCodec()]; + codec:FIAGetMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(refreshReceiptReceiptProperties:completion:)], - @"InAppPurchaseAPI api (%@) doesn't respond to " + @"FIAInAppPurchaseAPI api (%@) doesn't respond to " @"@selector(refreshReceiptReceiptProperties:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; NSDictionary *arg_receiptProperties = GetNullableObjectAtIndex(args, 0); [api refreshReceiptReceiptProperties:arg_receiptProperties completion:^(FlutterError *_Nullable error) { @@ -796,13 +870,15 @@ void SetUpInAppPurchaseAPI(id binaryMessenger, } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI." - @"startObservingPaymentQueue" + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.in_app_purchase_storekit." + @"InAppPurchaseAPI.startObservingPaymentQueue", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:InAppPurchaseAPIGetCodec()]; + codec:FIAGetMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(startObservingPaymentQueueWithError:)], - @"InAppPurchaseAPI api (%@) doesn't respond to " + @"FIAInAppPurchaseAPI api (%@) doesn't respond to " @"@selector(startObservingPaymentQueueWithError:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { @@ -816,13 +892,15 @@ void SetUpInAppPurchaseAPI(id binaryMessenger, } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI." - @"stopObservingPaymentQueue" + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.in_app_purchase_storekit." + @"InAppPurchaseAPI.stopObservingPaymentQueue", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:InAppPurchaseAPIGetCodec()]; + codec:FIAGetMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(stopObservingPaymentQueueWithError:)], - @"InAppPurchaseAPI api (%@) doesn't respond to " + @"FIAInAppPurchaseAPI api (%@) doesn't respond to " @"@selector(stopObservingPaymentQueueWithError:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { @@ -836,13 +914,15 @@ void SetUpInAppPurchaseAPI(id binaryMessenger, } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI." - @"registerPaymentQueueDelegate" + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.in_app_purchase_storekit." + @"InAppPurchaseAPI.registerPaymentQueueDelegate", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:InAppPurchaseAPIGetCodec()]; + codec:FIAGetMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(registerPaymentQueueDelegateWithError:)], - @"InAppPurchaseAPI api (%@) doesn't respond to " + @"FIAInAppPurchaseAPI api (%@) doesn't respond to " @"@selector(registerPaymentQueueDelegateWithError:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { @@ -856,13 +936,15 @@ void SetUpInAppPurchaseAPI(id binaryMessenger, } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI." - @"removePaymentQueueDelegate" + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.in_app_purchase_storekit." + @"InAppPurchaseAPI.removePaymentQueueDelegate", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:InAppPurchaseAPIGetCodec()]; + codec:FIAGetMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(removePaymentQueueDelegateWithError:)], - @"InAppPurchaseAPI api (%@) doesn't respond to " + @"FIAInAppPurchaseAPI api (%@) doesn't respond to " @"@selector(removePaymentQueueDelegateWithError:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { @@ -876,13 +958,15 @@ void SetUpInAppPurchaseAPI(id binaryMessenger, } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI." - @"showPriceConsentIfNeeded" + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.in_app_purchase_storekit." + @"InAppPurchaseAPI.showPriceConsentIfNeeded", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:InAppPurchaseAPIGetCodec()]; + codec:FIAGetMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(showPriceConsentIfNeededWithError:)], - @"InAppPurchaseAPI api (%@) doesn't respond to " + @"FIAInAppPurchaseAPI api (%@) doesn't respond to " @"@selector(showPriceConsentIfNeededWithError:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { 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 c51ca4754912..9d01ee6865fe 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 @@ -18,13 +18,16 @@ C4667AA10A6BC70CE9A5007C /* libPods-RunnerTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = AB9CD9DD098BDAB3D5053EE5 /* libPods-RunnerTests.a */; }; E680BD031412EB2D02C9190B /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 21CE6E615CF661FC0E18FB0A /* libPods-Runner.a */; }; F22BF91C2BC9B40B00713878 /* SwiftStubs.swift in Sources */ = {isa = PBXBuildFile; fileRef = F22BF91B2BC9B40B00713878 /* SwiftStubs.swift */; }; + F22FD7A22CB080AE0006F28F /* StoreKit2TranslatorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F22FD7A12CB080AE0006F28F /* StoreKit2TranslatorTests.swift */; }; F24C45E22C409D42000C6C72 /* InAppPurchasePluginTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F24C45E12C409D41000C6C72 /* InAppPurchasePluginTests.swift */; }; F276940B2C47268700277144 /* ProductRequestHandlerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F276940A2C47268700277144 /* ProductRequestHandlerTests.swift */; }; F27694112C49BF6F00277144 /* FIAPPaymentQueueDeleteTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F27694102C49BF6F00277144 /* FIAPPaymentQueueDeleteTests.swift */; }; F27694172C49DBCA00277144 /* FIATransactionCacheTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F27694162C49DBCA00277144 /* FIATransactionCacheTests.swift */; }; + F2858EE82C76A4230063A092 /* Configuration.storekit in Resources */ = {isa = PBXBuildFile; fileRef = F6E5D5F926131C4800C68BED /* Configuration.storekit */; }; F295AD3A2C1256DD0067C78A /* Stubs.m in Sources */ = {isa = PBXBuildFile; fileRef = F295AD392C1256DD0067C78A /* Stubs.m */; }; - F2D5272A2C583C4A00C137C7 /* TranslatorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F2D527292C583C4A00C137C7 /* TranslatorTests.swift */; }; + F2D127492CB4A76D005FA2E5 /* InAppPurchaseStoreKit2PluginTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F2D127482CB4A76D005FA2E5 /* InAppPurchaseStoreKit2PluginTests.swift */; }; F2D5271A2C50627500C137C7 /* PaymentQueueTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F2D527192C50627500C137C7 /* PaymentQueueTests.swift */; }; + F2D5272A2C583C4A00C137C7 /* TranslatorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F2D527292C583C4A00C137C7 /* TranslatorTests.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -75,14 +78,16 @@ CC9E5595B2B9B9B90632DA75 /* 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 = ""; }; F22BF91A2BC9B40B00713878 /* RunnerTests-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "RunnerTests-Bridging-Header.h"; sourceTree = ""; }; F22BF91B2BC9B40B00713878 /* SwiftStubs.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftStubs.swift; sourceTree = ""; }; + F22FD7A12CB080AE0006F28F /* StoreKit2TranslatorTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = StoreKit2TranslatorTests.swift; path = ../shared/RunnerTests/StoreKit2TranslatorTests.swift; sourceTree = SOURCE_ROOT; }; F24C45E12C409D41000C6C72 /* InAppPurchasePluginTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = InAppPurchasePluginTests.swift; path = ../../shared/RunnerTests/InAppPurchasePluginTests.swift; sourceTree = ""; }; F276940A2C47268700277144 /* ProductRequestHandlerTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ProductRequestHandlerTests.swift; path = ../../shared/RunnerTests/ProductRequestHandlerTests.swift; sourceTree = ""; }; F27694102C49BF6F00277144 /* FIAPPaymentQueueDeleteTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = FIAPPaymentQueueDeleteTests.swift; path = ../../shared/RunnerTests/FIAPPaymentQueueDeleteTests.swift; sourceTree = ""; }; F27694162C49DBCA00277144 /* FIATransactionCacheTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = FIATransactionCacheTests.swift; path = ../../shared/RunnerTests/FIATransactionCacheTests.swift; sourceTree = ""; }; F295AD362C1251300067C78A /* Stubs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Stubs.h; path = ../../shared/RunnerTests/Stubs.h; sourceTree = ""; }; F295AD392C1256DD0067C78A /* Stubs.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Stubs.m; path = ../../shared/RunnerTests/Stubs.m; sourceTree = ""; }; - F2D527292C583C4A00C137C7 /* TranslatorTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = TranslatorTests.swift; path = ../../shared/RunnerTests/TranslatorTests.swift; sourceTree = ""; }; + F2D127482CB4A76D005FA2E5 /* InAppPurchaseStoreKit2PluginTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = InAppPurchaseStoreKit2PluginTests.swift; path = ../shared/RunnerTests/InAppPurchaseStoreKit2PluginTests.swift; sourceTree = SOURCE_ROOT; }; F2D527192C50627500C137C7 /* PaymentQueueTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = PaymentQueueTests.swift; path = ../../shared/RunnerTests/PaymentQueueTests.swift; sourceTree = ""; }; + F2D527292C583C4A00C137C7 /* TranslatorTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = TranslatorTests.swift; path = ../../shared/RunnerTests/TranslatorTests.swift; sourceTree = ""; }; F6E5D5F926131C4800C68BED /* Configuration.storekit */ = {isa = PBXFileReference; lastKnownFileType = text; path = Configuration.storekit; sourceTree = ""; }; /* End PBXFileReference section */ @@ -186,6 +191,8 @@ A59001A521E69658004A3E5E /* RunnerTests */ = { isa = PBXGroup; children = ( + F2D127482CB4A76D005FA2E5 /* InAppPurchaseStoreKit2PluginTests.swift */, + F22FD7A12CB080AE0006F28F /* StoreKit2TranslatorTests.swift */, F2D527292C583C4A00C137C7 /* TranslatorTests.swift */, F2D527192C50627500C137C7 /* PaymentQueueTests.swift */, F27694162C49DBCA00277144 /* FIATransactionCacheTests.swift */, @@ -304,6 +311,7 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + F2858EE82C76A4230063A092 /* Configuration.storekit in Resources */, 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, @@ -392,7 +400,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build\n"; }; 9AF65E7BDC9361CB3944EE9C /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; @@ -436,10 +444,12 @@ F2D5271A2C50627500C137C7 /* PaymentQueueTests.swift in Sources */, F24C45E22C409D42000C6C72 /* InAppPurchasePluginTests.swift in Sources */, F22BF91C2BC9B40B00713878 /* SwiftStubs.swift in Sources */, + F22FD7A22CB080AE0006F28F /* StoreKit2TranslatorTests.swift in Sources */, F276940B2C47268700277144 /* ProductRequestHandlerTests.swift in Sources */, F295AD3A2C1256DD0067C78A /* Stubs.m in Sources */, F2D5272A2C583C4A00C137C7 /* TranslatorTests.swift in Sources */, F27694172C49DBCA00277144 /* FIATransactionCacheTests.swift in Sources */, + F2D127492CB4A76D005FA2E5 /* InAppPurchaseStoreKit2PluginTests.swift in Sources */, F27694112C49BF6F00277144 /* FIAPPaymentQueueDeleteTests.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; 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 477131feb699..9c3ad5d54dda 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 @@ -39,6 +39,7 @@ skipped = "NO"> - - diff --git a/packages/in_app_purchase/in_app_purchase_storekit/example/shared/RunnerTests/InAppPurchaseStoreKit2PluginTests.swift b/packages/in_app_purchase/in_app_purchase_storekit/example/shared/RunnerTests/InAppPurchaseStoreKit2PluginTests.swift new file mode 100644 index 000000000000..c2fcfbdfedf0 --- /dev/null +++ b/packages/in_app_purchase/in_app_purchase_storekit/example/shared/RunnerTests/InAppPurchaseStoreKit2PluginTests.swift @@ -0,0 +1,229 @@ +// 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 StoreKitTest +import XCTest + +@testable import in_app_purchase_storekit + +@available(iOS 15.0, macOS 12.0, *) + +final class InAppPurchase2PluginTests: XCTestCase { + private var session: SKTestSession! + private var plugin: InAppPurchasePlugin! + + override func setUp() async throws { + try await super.setUp() + + session = try! SKTestSession(configurationFileNamed: "Configuration") + session.resetToDefaultState() + session.clearTransactions() + session.disableDialogs = true + + plugin = InAppPurchasePluginStub(receiptManager: FIAPReceiptManagerStub()) { request in + DefaultRequestHandler(requestHandler: FIAPRequestHandler(request: request)) + } + try plugin.startListeningToTransactions() + } + + override func tearDown() async throws { + self.session.clearTransactions() + session.disableDialogs = false + } + + func testCanMakePayments() throws { + let result = try plugin.canMakePayments() + XCTAssertTrue(result) + } + + func testGetProducts() async throws { + let expectation = self.expectation(description: "products successfully fetched") + + var fetchedProductMsg: SK2ProductMessage? + plugin.products(identifiers: ["subscription_silver"]) { result in + switch result { + case .success(let productMessages): + fetchedProductMsg = productMessages.first + expectation.fulfill() + case .failure(let error): + print("Failed to fetch products: \(error.localizedDescription)") + } + } + await fulfillment(of: [expectation], timeout: 5) + + let testProduct = try await Product.products(for: ["subscription_silver"]).first + + let testProductMsg = testProduct?.convertToPigeon + + XCTAssertNotNil(fetchedProductMsg) + XCTAssertEqual(testProductMsg, fetchedProductMsg) + } + + func testGetDiscountedProducts() async throws { + let expectation = self.expectation(description: "products successfully fetched") + + var fetchedProductMsg: SK2ProductMessage? + plugin.products(identifiers: ["subscription_silver"]) { result in + switch result { + case .success(let productMessages): + fetchedProductMsg = productMessages.first + expectation.fulfill() + case .failure(let error): print("Failed to fetch products: \(error.localizedDescription)") + } + } + await fulfillment(of: [expectation], timeout: 5) + + let testProduct = try await Product.products(for: ["subscription_silver"]).first + + let testProductMsg = testProduct?.convertToPigeon + + XCTAssertNotNil(fetchedProductMsg) + XCTAssertEqual(testProductMsg, fetchedProductMsg) + } + + func testGetInvalidProducts() async throws { + let expectation = self.expectation(description: "products successfully fetched") + + var fetchedProductMsg: [SK2ProductMessage]? + plugin.products(identifiers: ["invalid_product"]) { result in + switch result { + case .success(let productMessages): + fetchedProductMsg = productMessages + expectation.fulfill() + case .failure(_): + XCTFail("Products should be successfully fetched") + } + } + await fulfillment(of: [expectation], timeout: 5) + + XCTAssert(fetchedProductMsg?.count == 0) + } + + //TODO(louisehsu): Add testing for lower versions. + @available(iOS 17.0, macOS 14.0, *) + func testGetProductsWithStoreKitError() async throws { + try await session.setSimulatedError( + .generic(.networkError(URLError(.badURL))), forAPI: .loadProducts) + + let expectation = self.expectation(description: "products request should fail") + + plugin.products(identifiers: ["subscription_silver"]) { result in + switch result { + case .success(_): + XCTFail("This `products` call should not succeed") + case .failure(let error): + expectation.fulfill() + XCTAssert( + error.localizedDescription + == "The operation couldn’t be completed. (in_app_purchase_storekit.PigeonError error 1.)" + ) + } + } + await fulfillment(of: [expectation], timeout: 5) + } + + func testSuccessfulPurchase() async throws { + let expectation = self.expectation(description: "Purchase request should succeed") + plugin.purchase(id: "consumable", options: nil) { result in + switch result { + case .success(let purchaseResult): + expectation.fulfill() + case .failure(let error): + XCTFail("Purchase should NOT fail. Failed with \(error)") + } + } + await fulfillment(of: [expectation], timeout: 5) + } + + @available(iOS 17.0, macOS 14.0, *) + func testFailedNetworkErrorPurchase() async throws { + try await session.setSimulatedError( + .generic(.networkError(URLError(.badURL))), forAPI: .loadProducts) + let expectation = self.expectation(description: "products request should fail") + plugin.purchase(id: "consumable", options: nil) { result in + switch result { + case .success(_): + XCTFail("Purchase should NOT suceed.") + case .failure(let error): + XCTAssertEqual( + error.localizedDescription, + "The operation couldn’t be completed. (NSURLErrorDomain error -1009.)") + expectation.fulfill() + } + } + await fulfillment(of: [expectation], timeout: 5) + } + + @available(iOS 17.0, macOS 14.0, *) + func testFailedProductUnavilablePurchase() async throws { + try await session.setSimulatedError( + .purchase(.productUnavailable), forAPI: .purchase) + let expectation = self.expectation(description: "Purchase request should succeed") + plugin.purchase(id: "consumable", options: nil) { result in + switch result { + case .success(_): + XCTFail("Purchase should NOT suceed.") + case .failure(let error): + XCTAssertEqual(error.localizedDescription, "Item Unavailable") + expectation.fulfill() + } + } + await fulfillment(of: [expectation], timeout: 5) + } + + func testInvalidProductPurchase() async throws { + let expectation = self.expectation(description: "products request should fail") + plugin.purchase(id: "invalid_product", options: nil) { result in + switch result { + case .success(_): + XCTFail("Purchase should NOT suceed.") + case .failure(let error): + let pigeonError = error as! PigeonError + + XCTAssertEqual(pigeonError.code, "storekit2_failed_to_fetch_product") + expectation.fulfill() + } + } + await fulfillment(of: [expectation], timeout: 5) + } + + func testPurchaseUpgradeConsumableSuccess() async throws { + let expectation = self.expectation(description: "Purchase request should succeed") + plugin.purchase(id: "subscription_discounted", options: nil) { result in + switch result { + case .success(let purchaseResult): + expectation.fulfill() + case .failure(let error): + XCTFail("Purchase should NOT fail. Failed with \(error)") + } + } + await fulfillment(of: [expectation], timeout: 5) + } + + func testDiscountedSubscriptionSuccess() async throws { + let expectation = self.expectation(description: "Purchase request should succeed") + plugin.purchase(id: "subscription_discounted", options: nil) { result in + switch result { + case .success(let purchaseResult): + expectation.fulfill() + case .failure(let error): + XCTFail("Purchase should NOT fail. Failed with \(error)") + } + } + await fulfillment(of: [expectation], timeout: 5) + } + + func testDiscountedProductSuccess() async throws { + let expectation = self.expectation(description: "Purchase request should succeed") + plugin.purchase(id: "consumable_discounted", options: nil) { result in + switch result { + case .success(let purchaseResult): + expectation.fulfill() + case .failure(let error): + XCTFail("Purchase should NOT fail. Failed with \(error)") + } + } + await fulfillment(of: [expectation], timeout: 5) + } +} diff --git a/packages/in_app_purchase/in_app_purchase_storekit/example/shared/RunnerTests/StoreKit2TranslatorTests.swift b/packages/in_app_purchase/in_app_purchase_storekit/example/shared/RunnerTests/StoreKit2TranslatorTests.swift new file mode 100644 index 000000000000..6fbd1f8444f0 --- /dev/null +++ b/packages/in_app_purchase/in_app_purchase_storekit/example/shared/RunnerTests/StoreKit2TranslatorTests.swift @@ -0,0 +1,82 @@ +// 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 Foundation +import StoreKitTest +import XCTest + +@testable import in_app_purchase_storekit + +@available(iOS 15.0, macOS 12.0, *) +final class StoreKit2TranslatorTests: XCTestCase { + private var session: SKTestSession! + private var plugin: InAppPurchasePlugin! + private var product: Product! + + // This is transcribed from the Configuration.storekit file. + var productMessage: SK2ProductMessage = + SK2ProductMessage( + id: "subscription_silver", + displayName: "Subscription Silver", + description: "A lower level subscription.", + price: 4.99, + displayPrice: "$4.99", + type: SK2ProductTypeMessage.autoRenewable, + subscription: SK2SubscriptionInfoMessage( + promotionalOffers: [], + subscriptionGroupID: "D0FEE8D8", + subscriptionPeriod: SK2SubscriptionPeriodMessage( + value: 1, + unit: SK2SubscriptionPeriodUnitMessage.week)), + priceLocale: SK2PriceLocaleMessage(currencyCode: "USD", currencySymbol: "$")) + + override func setUp() async throws { + try await super.setUp() + + self.session = try! SKTestSession(configurationFileNamed: "Configuration") + self.session.clearTransactions() + let receiptManagerStub = FIAPReceiptManagerStub() + plugin = InAppPurchasePluginStub(receiptManager: receiptManagerStub) { request in + DefaultRequestHandler(requestHandler: FIAPRequestHandler(request: request)) + } + product = try await Product.products(for: ["subscription_silver"]).first! + + } + + func testPigeonConversionForProduct() async throws { + XCTAssertNotNil(product) + let pigeonMessage = product.convertToPigeon + XCTAssertEqual(pigeonMessage, productMessage) + } + + func testPigeonConversionForSubscriptionInfo() async throws { + guard let subscription = product.subscription else { + XCTFail("SubscriptionInfo should not be nil") + return + } + let pigeonMessage = subscription.convertToPigeon + XCTAssertEqual(pigeonMessage, productMessage.subscription) + } + + func testPigeonConversionForProductType() async throws { + let type = product.type + let pigeonMessage = type.convertToPigeon + XCTAssertEqual(pigeonMessage, productMessage.type) + } + + func testPigeonConversionForSubscriptionPeriod() async throws { + guard let period = product.subscription?.subscriptionPeriod else { + XCTFail("SubscriptionPeriod should not be nil") + return + } + let pigeonMessage = period.convertToPigeon + XCTAssertEqual(pigeonMessage, productMessage.subscription?.subscriptionPeriod) + } + + func testPigeonConversionForPriceLocale() async throws { + let locale = product.priceFormatStyle.locale + let pigeonMessage = locale.convertToPigeon + XCTAssertEqual(pigeonMessage, productMessage.priceLocale) + } +} diff --git a/packages/in_app_purchase/in_app_purchase_storekit/example/shared/RunnerTests/TranslatorTests.swift b/packages/in_app_purchase/in_app_purchase_storekit/example/shared/RunnerTests/TranslatorTests.swift index 204b2f2dbfce..f7e384804033 100644 --- a/packages/in_app_purchase/in_app_purchase_storekit/example/shared/RunnerTests/TranslatorTests.swift +++ b/packages/in_app_purchase/in_app_purchase_storekit/example/shared/RunnerTests/TranslatorTests.swift @@ -473,7 +473,7 @@ final class ObjectTranslatorTest: XCTestCase { func testSKErrorConvertToPigeon() throws { let error = NSError(domain: SKErrorDomain, code: 3, userInfo: ["key": 42]) - let msg = SKErrorMessage.make( + let msg = FIASKErrorMessage.make( withCode: 3, domain: SKErrorDomain, userInfo: ["key": 42] as [String: Any]) let skerror = try XCTUnwrap(FIAObjectTranslator.convertSKError(toPigeon: error)) @@ -507,7 +507,7 @@ final class ObjectTranslatorTest: XCTestCase { let unwrappedMsg = try XCTUnwrap(msg) let unwrappedTimeStamp = try XCTUnwrap(unwrappedMsg.transactionTimeStamp) - XCTAssertEqual(unwrappedMsg.transactionState, SKPaymentTransactionStateMessage.purchasing) + XCTAssertEqual(unwrappedMsg.transactionState, FIASKPaymentTransactionStateMessage.purchasing) XCTAssertEqual( paymentTransaction.transactionDate, Date(timeIntervalSince1970: TimeInterval(truncating: unwrappedTimeStamp))) @@ -537,13 +537,13 @@ final class ObjectTranslatorTest: XCTestCase { XCTAssertEqual(localeMsg.currencySymbol, "\u{00a4}") let subPeriod = try XCTUnwrap(productMsg.subscriptionPeriod) - XCTAssertEqual(subPeriod.unit, SKSubscriptionPeriodUnitMessage.day) + XCTAssertEqual(subPeriod.unit, FIASKSubscriptionPeriodUnitMessage.day) XCTAssertEqual(subPeriod.numberOfUnits, 0) let introDiscount = try XCTUnwrap(productMsg.introductoryPrice) XCTAssertEqual(introDiscount.price, "1") XCTAssertEqual(introDiscount.numberOfPeriods, 1) - XCTAssertEqual(introDiscount.paymentMode, SKProductDiscountPaymentModeMessage.payUpFront) + XCTAssertEqual(introDiscount.paymentMode, FIASKProductDiscountPaymentModeMessage.payUpFront) let discounts = try XCTUnwrap(productMsg.discounts) XCTAssertEqual(discounts.count, 1) diff --git a/packages/in_app_purchase/in_app_purchase_storekit/lib/src/in_app_purchase_storekit_platform.dart b/packages/in_app_purchase/in_app_purchase_storekit/lib/src/in_app_purchase_storekit_platform.dart index 713a8c909e69..f930e57a8e7a 100644 --- a/packages/in_app_purchase/in_app_purchase_storekit/lib/src/in_app_purchase_storekit_platform.dart +++ b/packages/in_app_purchase/in_app_purchase_storekit/lib/src/in_app_purchase_storekit_platform.dart @@ -9,6 +9,7 @@ import 'package:flutter/services.dart'; import 'package:in_app_purchase_platform_interface/in_app_purchase_platform_interface.dart'; import '../in_app_purchase_storekit.dart'; +import '../store_kit_2_wrappers.dart'; import '../store_kit_wrappers.dart'; /// [IAPError.code] code for failed purchases. @@ -29,16 +30,29 @@ class InAppPurchaseStoreKitPlatform extends InAppPurchasePlatform { @visibleForTesting InAppPurchaseStoreKitPlatform(); + /// Experimental flag for StoreKit2. + static bool _useStoreKit2 = false; + + /// StoreKit1 static late SKPaymentQueueWrapper _skPaymentQueueWrapper; - static late _TransactionObserver _observer; + static late _TransactionObserver _sk1transactionObserver; + + /// StoreKit2 + static late SK2TransactionObserverWrapper _sk2transactionObserver; @override - Stream> get purchaseStream => - _observer.purchaseUpdatedController.stream; + Stream> get purchaseStream => _useStoreKit2 + ? _sk2transactionObserver.transactionsCreatedController.stream + : _sk1transactionObserver.purchaseUpdatedController.stream; /// Callback handler for transaction status changes. @visibleForTesting - static SKTransactionObserverWrapper get observer => _observer; + static SKTransactionObserverWrapper get observer => _sk1transactionObserver; + + /// Callback handler for transaction status changes for StoreKit2 transactions + @visibleForTesting + static SK2TransactionObserverWrapper get sk2transactionObserver => + _sk2transactionObserver; /// Registers this class as the default instance of [InAppPurchasePlatform]. static void registerPlatform() { @@ -53,22 +67,49 @@ class InAppPurchaseStoreKitPlatform extends InAppPurchasePlatform { _skPaymentQueueWrapper = SKPaymentQueueWrapper(); - // Create a purchaseUpdatedController and notify the native side when to - // start of stop sending updates. - final StreamController> updateController = - StreamController>.broadcast( - onListen: () => _skPaymentQueueWrapper.startObservingTransactionQueue(), - onCancel: () => _skPaymentQueueWrapper.stopObservingTransactionQueue(), - ); - _observer = _TransactionObserver(updateController); - _skPaymentQueueWrapper.setTransactionObserver(observer); + if (_useStoreKit2) { + final StreamController> updateController2 = + StreamController>.broadcast( + onListen: () => SK2Transaction.startListeningToTransactions(), + onCancel: () => SK2Transaction.stopListeningToTransactions(), + ); + _sk2transactionObserver = SK2TransactionObserverWrapper( + transactionsCreatedController: updateController2); + InAppPurchase2CallbackAPI.setUp(_sk2transactionObserver); + } else { + // Create a purchaseUpdatedController and notify the native side when to + // start of stop sending updates. + final StreamController> updateController = + StreamController>.broadcast( + onListen: () => _skPaymentQueueWrapper.startObservingTransactionQueue(), + onCancel: () => _skPaymentQueueWrapper.stopObservingTransactionQueue(), + ); + _sk1transactionObserver = _TransactionObserver(updateController); + _skPaymentQueueWrapper.setTransactionObserver(observer); + } } @override - Future isAvailable() => SKPaymentQueueWrapper.canMakePayments(); + Future isAvailable() { + if (_useStoreKit2) { + return AppStore().canMakePayments(); + } + return SKPaymentQueueWrapper.canMakePayments(); + } @override Future buyNonConsumable({required PurchaseParam purchaseParam}) async { + if (_useStoreKit2) { + final SK2ProductPurchaseOptions options = SK2ProductPurchaseOptions( + quantity: purchaseParam is AppStorePurchaseParam + ? purchaseParam.quantity + : 1, + appAccountToken: purchaseParam.applicationUserName); + await SK2Product.purchase(purchaseParam.productDetails.id, + options: options); + + return true; + } await _skPaymentQueueWrapper.addPayment(SKPaymentWrapper( productIdentifier: purchaseParam.productDetails.id, quantity: @@ -93,10 +134,14 @@ class InAppPurchaseStoreKitPlatform extends InAppPurchasePlatform { @override Future completePurchase(PurchaseDetails purchase) { assert( - purchase is AppStorePurchaseDetails, + purchase is AppStorePurchaseDetails || purchase is SK2PurchaseDetails, 'On iOS, the `purchase` should always be of type `AppStorePurchaseDetails`.', ); + if (_useStoreKit2) { + return SK2Transaction.finish(int.parse(purchase.purchaseID!)); + } + return _skPaymentQueueWrapper.finishTransaction( (purchase as AppStorePurchaseDetails).skPaymentTransaction, ); @@ -104,11 +149,12 @@ class InAppPurchaseStoreKitPlatform extends InAppPurchasePlatform { @override Future restorePurchases({String? applicationUserName}) async { - return _observer + return _sk1transactionObserver .restoreTransactions( queue: _skPaymentQueueWrapper, applicationUserName: applicationUserName) - .whenComplete(() => _observer.cleanUpRestoredTransactions()); + .whenComplete( + () => _sk1transactionObserver.cleanUpRestoredTransactions()); } /// Query the product detail list. @@ -119,6 +165,38 @@ class InAppPurchaseStoreKitPlatform extends InAppPurchasePlatform { @override Future queryProductDetails( Set identifiers) async { + if (_useStoreKit2) { + List products = []; + Set invalidProductIdentifiers; + PlatformException? exception; + try { + products = await SK2Product.products(identifiers.toList()); + // Storekit 2 no longer automatically returns a list of invalid identifiers, + // so get the difference between given identifiers and returned products + invalidProductIdentifiers = identifiers.difference( + products.map((SK2Product product) => product.id).toSet()); + } on PlatformException catch (e) { + exception = e; + invalidProductIdentifiers = identifiers; + } + List productDetails; + productDetails = products + .map((SK2Product productWrapper) => + AppStoreProduct2Details.fromSK2Product(productWrapper)) + .toList(); + final ProductDetailsResponse response = ProductDetailsResponse( + productDetails: productDetails, + notFoundIDs: invalidProductIdentifiers.toList(), + error: exception == null + ? null + : IAPError( + source: kIAPSource, + code: exception.code, + message: exception.message ?? '', + details: exception.details), + ); + return response; + } final SKRequestMaker requestMaker = SKRequestMaker(); SkProductResponseWrapper response; PlatformException? exception; @@ -166,6 +244,11 @@ class InAppPurchaseStoreKitPlatform extends InAppPurchasePlatform { /// Use countryCode instead. @Deprecated('Use countryCode') Future getCountryCode() => countryCode(); + + /// Turns on StoreKit2. You cannot disable this after it is enabled. + void enableStoreKit2() { + _useStoreKit2 = true; + } } enum _TransactionRestoreState { diff --git a/packages/in_app_purchase/in_app_purchase_storekit/lib/src/messages.g.dart b/packages/in_app_purchase/in_app_purchase_storekit/lib/src/messages.g.dart index e136e05b5d1e..8679df86f749 100644 --- a/packages/in_app_purchase/in_app_purchase_storekit/lib/src/messages.g.dart +++ b/packages/in_app_purchase/in_app_purchase_storekit/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 (v16.0.5), do not edit directly. +// Autogenerated from Pigeon (v22.4.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, no_leading_underscores_for_local_identifiers @@ -119,29 +119,24 @@ class SKPaymentTransactionMessage { Object encode() { return [ - payment.encode(), - transactionState.index, - originalTransaction?.encode(), + payment, + transactionState, + originalTransaction, transactionTimeStamp, transactionIdentifier, - error?.encode(), + error, ]; } static SKPaymentTransactionMessage decode(Object result) { result as List; return SKPaymentTransactionMessage( - payment: SKPaymentMessage.decode(result[0]! as List), - transactionState: - SKPaymentTransactionStateMessage.values[result[1]! as int], - originalTransaction: result[2] != null - ? SKPaymentTransactionMessage.decode(result[2]! as List) - : null, + payment: result[0]! as SKPaymentMessage, + transactionState: result[1]! as SKPaymentTransactionStateMessage, + originalTransaction: result[2] as SKPaymentTransactionMessage?, transactionTimeStamp: result[3] as double?, transactionIdentifier: result[4] as String?, - error: result[5] != null - ? SKErrorMessage.decode(result[5]! as List) - : null, + error: result[5] as SKErrorMessage?, ); } } @@ -175,7 +170,7 @@ class SKPaymentMessage { requestData, quantity, simulatesAskToBuyInSandbox, - paymentDiscount?.encode(), + paymentDiscount, ]; } @@ -187,9 +182,7 @@ class SKPaymentMessage { requestData: result[2] as String?, quantity: result[3]! as int, simulatesAskToBuyInSandbox: result[4]! as bool, - paymentDiscount: result[5] != null - ? SKPaymentDiscountMessage.decode(result[5]! as List) - : null, + paymentDiscount: result[5] as SKPaymentDiscountMessage?, ); } } @@ -205,7 +198,7 @@ class SKErrorMessage { String domain; - Map? userInfo; + Map? userInfo; Object encode() { return [ @@ -220,7 +213,7 @@ class SKErrorMessage { return SKErrorMessage( code: result[0]! as int, domain: result[1]! as String, - userInfo: (result[2] as Map?)?.cast(), + userInfo: (result[2] as Map?)?.cast(), ); } } @@ -298,9 +291,9 @@ class SKProductsResponseMessage { this.invalidProductIdentifiers, }); - List? products; + List? products; - List? invalidProductIdentifiers; + List? invalidProductIdentifiers; Object encode() { return [ @@ -312,8 +305,8 @@ class SKProductsResponseMessage { static SKProductsResponseMessage decode(Object result) { result as List; return SKProductsResponseMessage( - products: (result[0] as List?)?.cast(), - invalidProductIdentifiers: (result[1] as List?)?.cast(), + products: (result[0] as List?)?.cast(), + invalidProductIdentifiers: (result[1] as List?)?.cast(), ); } } @@ -322,7 +315,7 @@ class SKProductMessage { SKProductMessage({ required this.productIdentifier, required this.localizedTitle, - required this.localizedDescription, + this.localizedDescription, required this.priceLocale, this.subscriptionGroupIdentifier, required this.price, @@ -335,7 +328,7 @@ class SKProductMessage { String localizedTitle; - String localizedDescription; + String? localizedDescription; SKPriceLocaleMessage priceLocale; @@ -347,18 +340,18 @@ class SKProductMessage { SKProductDiscountMessage? introductoryPrice; - List? discounts; + List? discounts; Object encode() { return [ productIdentifier, localizedTitle, localizedDescription, - priceLocale.encode(), + priceLocale, subscriptionGroupIdentifier, price, - subscriptionPeriod?.encode(), - introductoryPrice?.encode(), + subscriptionPeriod, + introductoryPrice, discounts, ]; } @@ -368,19 +361,14 @@ class SKProductMessage { return SKProductMessage( productIdentifier: result[0]! as String, localizedTitle: result[1]! as String, - localizedDescription: result[2]! as String, - priceLocale: SKPriceLocaleMessage.decode(result[3]! as List), + localizedDescription: result[2] as String?, + priceLocale: result[3]! as SKPriceLocaleMessage, subscriptionGroupIdentifier: result[4] as String?, price: result[5]! as String, - subscriptionPeriod: result[6] != null - ? SKProductSubscriptionPeriodMessage.decode( - result[6]! as List) - : null, - introductoryPrice: result[7] != null - ? SKProductDiscountMessage.decode(result[7]! as List) - : null, + subscriptionPeriod: result[6] as SKProductSubscriptionPeriodMessage?, + introductoryPrice: result[7] as SKProductDiscountMessage?, discounts: - (result[8] as List?)?.cast(), + (result[8] as List?)?.cast(), ); } } @@ -447,12 +435,12 @@ class SKProductDiscountMessage { Object encode() { return [ price, - priceLocale.encode(), + priceLocale, numberOfPeriods, - paymentMode.index, - subscriptionPeriod.encode(), + paymentMode, + subscriptionPeriod, identifier, - type.index, + type, ]; } @@ -460,14 +448,12 @@ class SKProductDiscountMessage { result as List; return SKProductDiscountMessage( price: result[0]! as String, - priceLocale: SKPriceLocaleMessage.decode(result[1]! as List), + priceLocale: result[1]! as SKPriceLocaleMessage, numberOfPeriods: result[2]! as int, - paymentMode: - SKProductDiscountPaymentModeMessage.values[result[3]! as int], - subscriptionPeriod: SKProductSubscriptionPeriodMessage.decode( - result[4]! as List), + paymentMode: result[3]! as SKProductDiscountPaymentModeMessage, + subscriptionPeriod: result[4]! as SKProductSubscriptionPeriodMessage, identifier: result[5] as String?, - type: SKProductDiscountTypeMessage.values[result[6]! as int], + type: result[6]! as SKProductDiscountTypeMessage, ); } } @@ -485,7 +471,7 @@ class SKProductSubscriptionPeriodMessage { Object encode() { return [ numberOfUnits, - unit.index, + unit, ]; } @@ -493,45 +479,60 @@ class SKProductSubscriptionPeriodMessage { result as List; return SKProductSubscriptionPeriodMessage( numberOfUnits: result[0]! as int, - unit: SKSubscriptionPeriodUnitMessage.values[result[1]! as int], + unit: result[1]! as SKSubscriptionPeriodUnitMessage, ); } } -class _InAppPurchaseAPICodec extends StandardMessageCodec { - const _InAppPurchaseAPICodec(); +class _PigeonCodec extends StandardMessageCodec { + const _PigeonCodec(); @override void writeValue(WriteBuffer buffer, Object? value) { - if (value is SKErrorMessage) { - buffer.putUint8(128); - writeValue(buffer, value.encode()); - } else if (value is SKPaymentDiscountMessage) { + if (value is int) { + buffer.putUint8(4); + buffer.putInt64(value); + } else if (value is SKPaymentTransactionStateMessage) { buffer.putUint8(129); - writeValue(buffer, value.encode()); - } else if (value is SKPaymentMessage) { + writeValue(buffer, value.index); + } else if (value is SKProductDiscountTypeMessage) { buffer.putUint8(130); - writeValue(buffer, value.encode()); - } else if (value is SKPaymentTransactionMessage) { + writeValue(buffer, value.index); + } else if (value is SKProductDiscountPaymentModeMessage) { buffer.putUint8(131); - writeValue(buffer, value.encode()); - } else if (value is SKPriceLocaleMessage) { + writeValue(buffer, value.index); + } else if (value is SKSubscriptionPeriodUnitMessage) { buffer.putUint8(132); - writeValue(buffer, value.encode()); - } else if (value is SKProductDiscountMessage) { + writeValue(buffer, value.index); + } else if (value is SKPaymentTransactionMessage) { buffer.putUint8(133); writeValue(buffer, value.encode()); - } else if (value is SKProductMessage) { + } else if (value is SKPaymentMessage) { buffer.putUint8(134); writeValue(buffer, value.encode()); - } else if (value is SKProductSubscriptionPeriodMessage) { + } else if (value is SKErrorMessage) { buffer.putUint8(135); writeValue(buffer, value.encode()); - } else if (value is SKProductsResponseMessage) { + } else if (value is SKPaymentDiscountMessage) { buffer.putUint8(136); writeValue(buffer, value.encode()); } else if (value is SKStorefrontMessage) { buffer.putUint8(137); writeValue(buffer, value.encode()); + } else if (value is SKProductsResponseMessage) { + buffer.putUint8(138); + writeValue(buffer, value.encode()); + } else if (value is SKProductMessage) { + buffer.putUint8(139); + writeValue(buffer, value.encode()); + } else if (value is SKPriceLocaleMessage) { + buffer.putUint8(140); + writeValue(buffer, value.encode()); + } else if (value is SKProductDiscountMessage) { + buffer.putUint8(141); + writeValue(buffer, value.encode()); + } else if (value is SKProductSubscriptionPeriodMessage) { + buffer.putUint8(142); + writeValue(buffer, value.encode()); } else { super.writeValue(buffer, value); } @@ -540,26 +541,46 @@ class _InAppPurchaseAPICodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: - return SKErrorMessage.decode(readValue(buffer)!); case 129: - return SKPaymentDiscountMessage.decode(readValue(buffer)!); + final int? value = readValue(buffer) as int?; + return value == null + ? null + : SKPaymentTransactionStateMessage.values[value]; case 130: - return SKPaymentMessage.decode(readValue(buffer)!); + final int? value = readValue(buffer) as int?; + return value == null + ? null + : SKProductDiscountTypeMessage.values[value]; case 131: - return SKPaymentTransactionMessage.decode(readValue(buffer)!); + final int? value = readValue(buffer) as int?; + return value == null + ? null + : SKProductDiscountPaymentModeMessage.values[value]; case 132: - return SKPriceLocaleMessage.decode(readValue(buffer)!); + final int? value = readValue(buffer) as int?; + return value == null + ? null + : SKSubscriptionPeriodUnitMessage.values[value]; case 133: - return SKProductDiscountMessage.decode(readValue(buffer)!); + return SKPaymentTransactionMessage.decode(readValue(buffer)!); case 134: - return SKProductMessage.decode(readValue(buffer)!); + return SKPaymentMessage.decode(readValue(buffer)!); case 135: - return SKProductSubscriptionPeriodMessage.decode(readValue(buffer)!); + return SKErrorMessage.decode(readValue(buffer)!); case 136: - return SKProductsResponseMessage.decode(readValue(buffer)!); + return SKPaymentDiscountMessage.decode(readValue(buffer)!); case 137: return SKStorefrontMessage.decode(readValue(buffer)!); + case 138: + return SKProductsResponseMessage.decode(readValue(buffer)!); + case 139: + return SKProductMessage.decode(readValue(buffer)!); + case 140: + return SKPriceLocaleMessage.decode(readValue(buffer)!); + case 141: + return SKProductDiscountMessage.decode(readValue(buffer)!); + case 142: + return SKProductSubscriptionPeriodMessage.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); } @@ -570,120 +591,124 @@ class InAppPurchaseAPI { /// Constructor for [InAppPurchaseAPI]. The [binaryMessenger] named argument is /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. - InAppPurchaseAPI({BinaryMessenger? binaryMessenger}) - : __pigeon_binaryMessenger = binaryMessenger; - final BinaryMessenger? __pigeon_binaryMessenger; + InAppPurchaseAPI( + {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) + : pigeonVar_binaryMessenger = binaryMessenger, + pigeonVar_messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + final BinaryMessenger? pigeonVar_binaryMessenger; + + static const MessageCodec pigeonChannelCodec = _PigeonCodec(); - static const MessageCodec pigeonChannelCodec = - _InAppPurchaseAPICodec(); + final String pigeonVar_messageChannelSuffix; /// Returns if the current device is able to make payments Future canMakePayments() async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.canMakePayments'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.canMakePayments$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as bool?)!; + return (pigeonVar_replyList[0] as bool?)!; } } - Future> transactions() async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.transactions'; - final BasicMessageChannel __pigeon_channel = + Future> transactions() async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.transactions$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as List?)! - .cast(); + return (pigeonVar_replyList[0] as List?)! + .cast(); } } Future storefront() async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.storefront'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.storefront$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as SKStorefrontMessage?)!; + return (pigeonVar_replyList[0] as SKStorefrontMessage?)!; } } - Future addPayment(Map paymentMap) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.addPayment'; - final BasicMessageChannel __pigeon_channel = + Future addPayment(Map paymentMap) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.addPayment$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([paymentMap]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([paymentMap]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -691,53 +716,53 @@ class InAppPurchaseAPI { } Future startProductRequest( - List productIdentifiers) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.startProductRequest'; - final BasicMessageChannel __pigeon_channel = + List productIdentifiers) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.startProductRequest$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel + final List? pigeonVar_replyList = await pigeonVar_channel .send([productIdentifiers]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as SKProductsResponseMessage?)!; + return (pigeonVar_replyList[0] as SKProductsResponseMessage?)!; } } - Future finishTransaction(Map finishMap) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.finishTransaction'; - final BasicMessageChannel __pigeon_channel = + Future finishTransaction(Map finishMap) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.finishTransaction$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([finishMap]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([finishMap]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -745,23 +770,23 @@ class InAppPurchaseAPI { } Future restoreTransactions(String? applicationUserName) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.restoreTransactions'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.restoreTransactions$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel + final List? pigeonVar_replyList = await pigeonVar_channel .send([applicationUserName]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -769,23 +794,23 @@ class InAppPurchaseAPI { } Future presentCodeRedemptionSheet() async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.presentCodeRedemptionSheet'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.presentCodeRedemptionSheet$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -793,48 +818,47 @@ class InAppPurchaseAPI { } Future retrieveReceiptData() async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.retrieveReceiptData'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.retrieveReceiptData$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { - return (__pigeon_replyList[0] as String?); + return (pigeonVar_replyList[0] as String?); } } - Future refreshReceipt( - {Map? receiptProperties}) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.refreshReceipt'; - final BasicMessageChannel __pigeon_channel = + Future refreshReceipt({Map? receiptProperties}) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.refreshReceipt$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel + final List? pigeonVar_replyList = await pigeonVar_channel .send([receiptProperties]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -842,23 +866,23 @@ class InAppPurchaseAPI { } Future startObservingPaymentQueue() async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.startObservingPaymentQueue'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.startObservingPaymentQueue$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -866,23 +890,23 @@ class InAppPurchaseAPI { } Future stopObservingPaymentQueue() async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.stopObservingPaymentQueue'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.stopObservingPaymentQueue$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -890,23 +914,23 @@ class InAppPurchaseAPI { } Future registerPaymentQueueDelegate() async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.registerPaymentQueueDelegate'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.registerPaymentQueueDelegate$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -914,23 +938,23 @@ class InAppPurchaseAPI { } Future removePaymentQueueDelegate() async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.removePaymentQueueDelegate'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.removePaymentQueueDelegate$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -938,23 +962,23 @@ class InAppPurchaseAPI { } Future showPriceConsentIfNeeded() async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.showPriceConsentIfNeeded'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.showPriceConsentIfNeeded$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; diff --git a/packages/in_app_purchase/in_app_purchase_storekit/lib/src/sk2_pigeon.g.dart b/packages/in_app_purchase/in_app_purchase_storekit/lib/src/sk2_pigeon.g.dart new file mode 100644 index 000000000000..8c6753fdf205 --- /dev/null +++ b/packages/in_app_purchase/in_app_purchase_storekit/lib/src/sk2_pigeon.g.dart @@ -0,0 +1,733 @@ +// 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 (v22.4.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, no_leading_underscores_for_local_identifiers + +import 'dart:async'; +import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List; + +import 'package:flutter/foundation.dart' show ReadBuffer, WriteBuffer; +import 'package:flutter/services.dart'; + +PlatformException _createConnectionError(String channelName) { + return PlatformException( + code: 'channel-error', + message: 'Unable to establish connection on channel: "$channelName".', + ); +} + +List wrapResponse( + {Object? result, PlatformException? error, bool empty = false}) { + if (empty) { + return []; + } + if (error == null) { + return [result]; + } + return [error.code, error.message, error.details]; +} + +enum SK2ProductTypeMessage { + /// A consumable in-app purchase. + consumable, + + /// A non-consumable in-app purchase. + nonConsumable, + + /// A non-renewing subscription. + nonRenewable, + + /// An auto-renewable subscription. + autoRenewable, +} + +enum SK2SubscriptionOfferTypeMessage { + introductory, + promotional, +} + +enum SK2SubscriptionOfferPaymentModeMessage { + payAsYouGo, + payUpFront, + freeTrial, +} + +enum SK2SubscriptionPeriodUnitMessage { + day, + week, + month, + year, +} + +enum SK2ProductPurchaseResultMessage { + success, + userCancelled, + pending, +} + +class SK2SubscriptionOfferMessage { + SK2SubscriptionOfferMessage({ + this.id, + required this.price, + required this.type, + required this.period, + required this.periodCount, + required this.paymentMode, + }); + + String? id; + + double price; + + SK2SubscriptionOfferTypeMessage type; + + SK2SubscriptionPeriodMessage period; + + int periodCount; + + SK2SubscriptionOfferPaymentModeMessage paymentMode; + + Object encode() { + return [ + id, + price, + type, + period, + periodCount, + paymentMode, + ]; + } + + static SK2SubscriptionOfferMessage decode(Object result) { + result as List; + return SK2SubscriptionOfferMessage( + id: result[0] as String?, + price: result[1]! as double, + type: result[2]! as SK2SubscriptionOfferTypeMessage, + period: result[3]! as SK2SubscriptionPeriodMessage, + periodCount: result[4]! as int, + paymentMode: result[5]! as SK2SubscriptionOfferPaymentModeMessage, + ); + } +} + +class SK2SubscriptionPeriodMessage { + SK2SubscriptionPeriodMessage({ + required this.value, + required this.unit, + }); + + /// The number of units that the period represents. + int value; + + /// The unit of time that this period represents. + SK2SubscriptionPeriodUnitMessage unit; + + Object encode() { + return [ + value, + unit, + ]; + } + + static SK2SubscriptionPeriodMessage decode(Object result) { + result as List; + return SK2SubscriptionPeriodMessage( + value: result[0]! as int, + unit: result[1]! as SK2SubscriptionPeriodUnitMessage, + ); + } +} + +class SK2SubscriptionInfoMessage { + SK2SubscriptionInfoMessage({ + required this.promotionalOffers, + required this.subscriptionGroupID, + required this.subscriptionPeriod, + }); + + /// An array of all the promotional offers configured for this subscription. + List promotionalOffers; + + /// The group identifier for this subscription. + String subscriptionGroupID; + + /// The duration that this subscription lasts before auto-renewing. + SK2SubscriptionPeriodMessage subscriptionPeriod; + + Object encode() { + return [ + promotionalOffers, + subscriptionGroupID, + subscriptionPeriod, + ]; + } + + static SK2SubscriptionInfoMessage decode(Object result) { + result as List; + return SK2SubscriptionInfoMessage( + promotionalOffers: + (result[0] as List?)!.cast(), + subscriptionGroupID: result[1]! as String, + subscriptionPeriod: result[2]! as SK2SubscriptionPeriodMessage, + ); + } +} + +/// A Pigeon message class representing a Product +/// https://developer.apple.com/documentation/storekit/product +class SK2ProductMessage { + SK2ProductMessage({ + required this.id, + required this.displayName, + required this.description, + required this.price, + required this.displayPrice, + required this.type, + this.subscription, + required this.priceLocale, + }); + + /// The unique product identifier. + String id; + + /// The localized display name of the product, if it exists. + String displayName; + + /// The localized description of the product. + String description; + + /// The localized string representation of the product price, suitable for display. + double price; + + /// The localized price of the product as a string. + String displayPrice; + + /// The types of in-app purchases. + SK2ProductTypeMessage type; + + /// The subscription information for an auto-renewable subscription. + SK2SubscriptionInfoMessage? subscription; + + /// The currency and locale information for this product + SK2PriceLocaleMessage priceLocale; + + Object encode() { + return [ + id, + displayName, + description, + price, + displayPrice, + type, + subscription, + priceLocale, + ]; + } + + static SK2ProductMessage decode(Object result) { + result as List; + return SK2ProductMessage( + id: result[0]! as String, + displayName: result[1]! as String, + description: result[2]! as String, + price: result[3]! as double, + displayPrice: result[4]! as String, + type: result[5]! as SK2ProductTypeMessage, + subscription: result[6] as SK2SubscriptionInfoMessage?, + priceLocale: result[7]! as SK2PriceLocaleMessage, + ); + } +} + +class SK2PriceLocaleMessage { + SK2PriceLocaleMessage({ + required this.currencyCode, + required this.currencySymbol, + }); + + String currencyCode; + + String currencySymbol; + + Object encode() { + return [ + currencyCode, + currencySymbol, + ]; + } + + static SK2PriceLocaleMessage decode(Object result) { + result as List; + return SK2PriceLocaleMessage( + currencyCode: result[0]! as String, + currencySymbol: result[1]! as String, + ); + } +} + +class SK2ProductPurchaseOptionsMessage { + SK2ProductPurchaseOptionsMessage({ + this.appAccountToken, + this.quantity = 1, + }); + + String? appAccountToken; + + int? quantity; + + Object encode() { + return [ + appAccountToken, + quantity, + ]; + } + + static SK2ProductPurchaseOptionsMessage decode(Object result) { + result as List; + return SK2ProductPurchaseOptionsMessage( + appAccountToken: result[0] as String?, + quantity: result[1] as int?, + ); + } +} + +class SK2TransactionMessage { + SK2TransactionMessage({ + required this.id, + required this.originalId, + required this.productId, + required this.purchaseDate, + this.purchasedQuantity = 1, + this.appAccountToken, + this.restoring = false, + this.error, + }); + + int id; + + int originalId; + + String productId; + + String purchaseDate; + + int purchasedQuantity; + + String? appAccountToken; + + bool restoring; + + SK2ErrorMessage? error; + + Object encode() { + return [ + id, + originalId, + productId, + purchaseDate, + purchasedQuantity, + appAccountToken, + restoring, + error, + ]; + } + + static SK2TransactionMessage decode(Object result) { + result as List; + return SK2TransactionMessage( + id: result[0]! as int, + originalId: result[1]! as int, + productId: result[2]! as String, + purchaseDate: result[3]! as String, + purchasedQuantity: result[4]! as int, + appAccountToken: result[5] as String?, + restoring: result[6]! as bool, + error: result[7] as SK2ErrorMessage?, + ); + } +} + +class SK2ErrorMessage { + SK2ErrorMessage({ + required this.code, + required this.domain, + this.userInfo, + }); + + int code; + + String domain; + + Map? userInfo; + + Object encode() { + return [ + code, + domain, + userInfo, + ]; + } + + static SK2ErrorMessage decode(Object result) { + result as List; + return SK2ErrorMessage( + code: result[0]! as int, + domain: result[1]! as String, + userInfo: (result[2] as Map?)?.cast(), + ); + } +} + +class _PigeonCodec extends StandardMessageCodec { + const _PigeonCodec(); + @override + void writeValue(WriteBuffer buffer, Object? value) { + if (value is int) { + buffer.putUint8(4); + buffer.putInt64(value); + } else if (value is SK2ProductTypeMessage) { + buffer.putUint8(129); + writeValue(buffer, value.index); + } else if (value is SK2SubscriptionOfferTypeMessage) { + buffer.putUint8(130); + writeValue(buffer, value.index); + } else if (value is SK2SubscriptionOfferPaymentModeMessage) { + buffer.putUint8(131); + writeValue(buffer, value.index); + } else if (value is SK2SubscriptionPeriodUnitMessage) { + buffer.putUint8(132); + writeValue(buffer, value.index); + } else if (value is SK2ProductPurchaseResultMessage) { + buffer.putUint8(133); + writeValue(buffer, value.index); + } else if (value is SK2SubscriptionOfferMessage) { + buffer.putUint8(134); + writeValue(buffer, value.encode()); + } else if (value is SK2SubscriptionPeriodMessage) { + buffer.putUint8(135); + writeValue(buffer, value.encode()); + } else if (value is SK2SubscriptionInfoMessage) { + buffer.putUint8(136); + writeValue(buffer, value.encode()); + } else if (value is SK2ProductMessage) { + buffer.putUint8(137); + writeValue(buffer, value.encode()); + } else if (value is SK2PriceLocaleMessage) { + buffer.putUint8(138); + writeValue(buffer, value.encode()); + } else if (value is SK2ProductPurchaseOptionsMessage) { + buffer.putUint8(139); + writeValue(buffer, value.encode()); + } else if (value is SK2TransactionMessage) { + buffer.putUint8(140); + writeValue(buffer, value.encode()); + } else if (value is SK2ErrorMessage) { + buffer.putUint8(141); + writeValue(buffer, value.encode()); + } else { + super.writeValue(buffer, value); + } + } + + @override + Object? readValueOfType(int type, ReadBuffer buffer) { + switch (type) { + case 129: + final int? value = readValue(buffer) as int?; + return value == null ? null : SK2ProductTypeMessage.values[value]; + case 130: + final int? value = readValue(buffer) as int?; + return value == null + ? null + : SK2SubscriptionOfferTypeMessage.values[value]; + case 131: + final int? value = readValue(buffer) as int?; + return value == null + ? null + : SK2SubscriptionOfferPaymentModeMessage.values[value]; + case 132: + final int? value = readValue(buffer) as int?; + return value == null + ? null + : SK2SubscriptionPeriodUnitMessage.values[value]; + case 133: + final int? value = readValue(buffer) as int?; + return value == null + ? null + : SK2ProductPurchaseResultMessage.values[value]; + case 134: + return SK2SubscriptionOfferMessage.decode(readValue(buffer)!); + case 135: + return SK2SubscriptionPeriodMessage.decode(readValue(buffer)!); + case 136: + return SK2SubscriptionInfoMessage.decode(readValue(buffer)!); + case 137: + return SK2ProductMessage.decode(readValue(buffer)!); + case 138: + return SK2PriceLocaleMessage.decode(readValue(buffer)!); + case 139: + return SK2ProductPurchaseOptionsMessage.decode(readValue(buffer)!); + case 140: + return SK2TransactionMessage.decode(readValue(buffer)!); + case 141: + return SK2ErrorMessage.decode(readValue(buffer)!); + default: + return super.readValueOfType(type, buffer); + } + } +} + +class InAppPurchase2API { + /// Constructor for [InAppPurchase2API]. The [binaryMessenger] named argument is + /// available for dependency injection. If it is left null, the default + /// BinaryMessenger will be used which routes to the host platform. + InAppPurchase2API( + {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) + : pigeonVar_binaryMessenger = binaryMessenger, + pigeonVar_messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + final BinaryMessenger? pigeonVar_binaryMessenger; + + static const MessageCodec pigeonChannelCodec = _PigeonCodec(); + + final String pigeonVar_messageChannelSuffix; + + Future canMakePayments() async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchase2API.canMakePayments$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } else { + return (pigeonVar_replyList[0] as bool?)!; + } + } + + Future> products(List identifiers) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchase2API.products$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([identifiers]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } else { + return (pigeonVar_replyList[0] as List?)! + .cast(); + } + } + + Future purchase(String id, + {SK2ProductPurchaseOptionsMessage? options}) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchase2API.purchase$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([id, options]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } else { + return (pigeonVar_replyList[0] as SK2ProductPurchaseResultMessage?)!; + } + } + + Future> transactions() async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchase2API.transactions$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } else { + return (pigeonVar_replyList[0] as List?)! + .cast(); + } + } + + Future finish(int id) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchase2API.finish$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([id]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return; + } + } + + Future startListeningToTransactions() async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchase2API.startListeningToTransactions$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return; + } + } + + Future stopListeningToTransactions() async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchase2API.stopListeningToTransactions$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return; + } + } +} + +abstract class InAppPurchase2CallbackAPI { + static const MessageCodec pigeonChannelCodec = _PigeonCodec(); + + void onTransactionsUpdated(SK2TransactionMessage newTransaction); + + static void setUp( + InAppPurchase2CallbackAPI? api, { + BinaryMessenger? binaryMessenger, + String messageChannelSuffix = '', + }) { + messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + { + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchase2CallbackAPI.onTransactionsUpdated$messageChannelSuffix', + pigeonChannelCodec, + binaryMessenger: binaryMessenger); + if (api == null) { + pigeonVar_channel.setMessageHandler(null); + } else { + pigeonVar_channel.setMessageHandler((Object? message) async { + assert(message != null, + 'Argument for dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchase2CallbackAPI.onTransactionsUpdated was null.'); + final List args = (message as List?)!; + final SK2TransactionMessage? arg_newTransaction = + (args[0] as SK2TransactionMessage?); + assert(arg_newTransaction != null, + 'Argument for dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchase2CallbackAPI.onTransactionsUpdated was null, expected non-null SK2TransactionMessage.'); + try { + api.onTransactionsUpdated(arg_newTransaction!); + return wrapResponse(empty: true); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } + }); + } + } + } +} diff --git a/packages/in_app_purchase/in_app_purchase_storekit/lib/src/store_kit_2_wrappers/sk2_appstore_wrapper.dart b/packages/in_app_purchase/in_app_purchase_storekit/lib/src/store_kit_2_wrappers/sk2_appstore_wrapper.dart new file mode 100644 index 000000000000..a57ad5611266 --- /dev/null +++ b/packages/in_app_purchase/in_app_purchase_storekit/lib/src/store_kit_2_wrappers/sk2_appstore_wrapper.dart @@ -0,0 +1,18 @@ +// 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 '../../store_kit_2_wrappers.dart'; + +InAppPurchase2API _hostApi = InAppPurchase2API(); + +/// Wrapper for StoreKit2's AppStore +/// (https://developer.apple.com/documentation/storekit/appstore) +final class AppStore { + /// Dart wrapper for StoreKit2's canMakePayments() + /// Returns a bool that indicates whether the person can make purchases. + /// (https://developer.apple.com/documentation/storekit/appstore/3822277-canmakepayments) + Future canMakePayments() { + return _hostApi.canMakePayments(); + } +} diff --git a/packages/in_app_purchase/in_app_purchase_storekit/lib/src/store_kit_2_wrappers/sk2_product_wrapper.dart b/packages/in_app_purchase/in_app_purchase_storekit/lib/src/store_kit_2_wrappers/sk2_product_wrapper.dart new file mode 100644 index 000000000000..ad5de9c5c77a --- /dev/null +++ b/packages/in_app_purchase/in_app_purchase_storekit/lib/src/store_kit_2_wrappers/sk2_product_wrapper.dart @@ -0,0 +1,407 @@ +// 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 '../../store_kit_2_wrappers.dart'; + +InAppPurchase2API _hostApi = InAppPurchase2API(); + +/// A wrapper around StoreKit2's ProductType +/// https://developer.apple.com/documentation/storekit/product/producttype +/// The types of in-app purchases. +enum SK2ProductType { + /// A consumable in-app purchase. + consumable, + + /// A non-consumable in-app purchase. + nonConsumable, + + /// A non-renewing subscription. + nonRenewable, + + /// An auto-renewable subscription. + autoRenewable; +} + +extension on SK2ProductTypeMessage { + /// Convert the equivalent pigeon class of [SK2ProductTypeMessage] into an instance of [SK2ProductType] + SK2ProductType convertFromPigeon() { + switch (this) { + case SK2ProductTypeMessage.autoRenewable: + return SK2ProductType.autoRenewable; + case SK2ProductTypeMessage.consumable: + return SK2ProductType.consumable; + case SK2ProductTypeMessage.nonConsumable: + return SK2ProductType.nonConsumable; + case SK2ProductTypeMessage.nonRenewable: + return SK2ProductType.nonRenewable; + } + } +} + +extension on SK2ProductType { + SK2ProductTypeMessage convertToPigeon() { + switch (this) { + case SK2ProductType.autoRenewable: + return SK2ProductTypeMessage.autoRenewable; + case SK2ProductType.consumable: + return SK2ProductTypeMessage.consumable; + case SK2ProductType.nonConsumable: + return SK2ProductTypeMessage.nonConsumable; + case SK2ProductType.nonRenewable: + return SK2ProductTypeMessage.nonRenewable; + } + } +} + +/// A wrapper around StoreKit2's SubscriptionOfferType +/// https://developer.apple.com/documentation/appstoreserverapi/offertype/ +/// The subscription offer types. +enum SK2SubscriptionOfferType { + /// An introductory offer. + introductory, + + /// A A promotional offer. + promotional +} + +extension on SK2SubscriptionOfferTypeMessage { + SK2SubscriptionOfferType convertFromPigeon() { + switch (this) { + case SK2SubscriptionOfferTypeMessage.introductory: + return SK2SubscriptionOfferType.introductory; + case SK2SubscriptionOfferTypeMessage.promotional: + return SK2SubscriptionOfferType.promotional; + } + } +} + +/// A wrapper around StoreKit2's SubscriptionOffer +/// https://developer.apple.com/documentation/storekit/product/subscriptionoffer +/// Information about a subscription offer on a product. +class SK2SubscriptionOffer { + /// Creates a new [SK2SubscriptionOffer] + SK2SubscriptionOffer({ + this.id, + required this.price, + required this.type, + required this.period, + required this.periodCount, + required this.paymentMode, + }); + + /// The subscription offer identifier. + final String? id; + + /// The decimal representation of the discounted price of the subscription offer. + final double price; + + /// The type of subscription offer, either introductory or promotional. + final SK2SubscriptionOfferType type; + + /// The subscription period for the subscription offer. + final SK2SubscriptionPeriod period; + + /// The number of periods that the subscription offer renews for. + final int periodCount; + + /// The payment modes for subscription offers that apply to a transaction. + final SK2SubscriptionOfferPaymentMode paymentMode; +} + +extension on SK2SubscriptionOfferMessage { + SK2SubscriptionOffer convertFromPigeon() { + return SK2SubscriptionOffer( + id: id, + price: price, + type: type.convertFromPigeon(), + period: period.convertFromPigeon(), + periodCount: periodCount, + paymentMode: paymentMode.convertFromPigeon()); + } +} + +/// A wrapper around StoreKit2's SubscriptionInfo +/// https://developer.apple.com/documentation/storekit/product/subscriptioninfo +/// Information about an auto-renewable subscription, +/// such as its status, period, subscription group, and subscription offer details. +class SK2SubscriptionInfo { + /// Creates a new instance of [SK2SubscriptionInfo] + const SK2SubscriptionInfo({ + required this.subscriptionGroupID, + required this.promotionalOffers, + required this.subscriptionPeriod, + }); + + /// An array of all the promotional offers configured for this subscription. + final List promotionalOffers; + + /// The group identifier for this subscription. + final String subscriptionGroupID; + + /// The duration that this subscription lasts before auto-renewing. + final SK2SubscriptionPeriod subscriptionPeriod; +} + +extension on SK2SubscriptionInfoMessage { + SK2SubscriptionInfo convertFromPigeon() { + return SK2SubscriptionInfo( + subscriptionGroupID: subscriptionGroupID, + promotionalOffers: promotionalOffers + .map((SK2SubscriptionOfferMessage offer) => + offer.convertFromPigeon()) + .toList(), + subscriptionPeriod: subscriptionPeriod.convertFromPigeon()); + } +} + +/// A wrapper around StoreKit2's SubscriptionPeriod +/// https://developer.apple.com/documentation/storekit/product/subscriptionperiod +/// Values that represent the duration of time between subscription renewals. +class SK2SubscriptionPeriod { + /// Creates a new instance of [SK2SubscriptionPeriod] + const SK2SubscriptionPeriod({required this.value, required this.unit}); + + /// The number of units that the period represents. + final int value; + + /// The unit of time that this period represents. + final SK2SubscriptionPeriodUnit unit; +} + +extension on SK2SubscriptionPeriodMessage { + SK2SubscriptionPeriod convertFromPigeon() { + return SK2SubscriptionPeriod(value: value, unit: unit.convertFromPigeon()); + } +} + +/// A wrapper around StoreKit2's SubscriptionPeriodUnit +/// https://developer.apple.com/documentation/storekit/product/subscriptionperiod/3749576-unit +/// The increment of time for the subscription period. +enum SK2SubscriptionPeriodUnit { + /// A subscription period unit of a day. + day, + + /// A subscription period unit of a week. + week, + + /// A subscription period unit of a month. + month, + + /// A subscription period unit of a year. + year +} + +extension on SK2SubscriptionPeriodUnitMessage { + SK2SubscriptionPeriodUnit convertFromPigeon() { + switch (this) { + case SK2SubscriptionPeriodUnitMessage.day: + return SK2SubscriptionPeriodUnit.day; + case SK2SubscriptionPeriodUnitMessage.week: + return SK2SubscriptionPeriodUnit.week; + case SK2SubscriptionPeriodUnitMessage.month: + return SK2SubscriptionPeriodUnit.month; + case SK2SubscriptionPeriodUnitMessage.year: + return SK2SubscriptionPeriodUnit.year; + } + } +} + +/// A wrapper around StoreKit2's [PaymentMode](https://developer.apple.com/documentation/storekit/product/subscriptionoffer/paymentmode) +/// The payment modes for subscription offers that apply to a transaction. +enum SK2SubscriptionOfferPaymentMode { + /// A payment mode of a product discount that applies over a single billing period or multiple billing periods. + payAsYouGo, + + /// A payment mode of a product discount that applies the discount up front. + payUpFront, + + /// A payment mode of a product discount that indicates a free trial offer. + freeTrial; +} + +extension on SK2SubscriptionOfferPaymentModeMessage { + SK2SubscriptionOfferPaymentMode convertFromPigeon() { + switch (this) { + case SK2SubscriptionOfferPaymentModeMessage.payAsYouGo: + return SK2SubscriptionOfferPaymentMode.payAsYouGo; + case SK2SubscriptionOfferPaymentModeMessage.payUpFront: + return SK2SubscriptionOfferPaymentMode.payUpFront; + case SK2SubscriptionOfferPaymentModeMessage.freeTrial: + return SK2SubscriptionOfferPaymentMode.freeTrial; + } + } +} + +/// A wrapper around StoreKit2's [Locale](https://developer.apple.com/documentation/foundation/locale) +/// The payment modes for subscription offers that apply to a transaction. +class SK2PriceLocale { + /// Creates a new instance of [SK2PriceLocale] + SK2PriceLocale({required this.currencyCode, required this.currencySymbol}); + + /// The currency code this format style uses. + final String currencyCode; + + /// The currency symbol this format style uses. + final String currencySymbol; + + /// Convert this instance of [SK2PriceLocale] to [SK2PriceLocaleMessage] + SK2PriceLocaleMessage convertToPigeon() { + return SK2PriceLocaleMessage( + currencyCode: currencyCode, currencySymbol: currencySymbol); + } +} + +extension on SK2PriceLocaleMessage { + SK2PriceLocale convertFromPigeon() { + return SK2PriceLocale( + currencyCode: currencyCode, currencySymbol: currencySymbol); + } +} + +/// Wrapper around [PurchaseResult] +/// https://developer.apple.com/documentation/storekit/product/purchaseresult +enum SK2ProductPurchaseResult { + /// The purchase succeeded and results in a transaction. + success, + + /// The user canceled the purchase. + userCancelled, + + /// The purchase is pending, and requires action from the customer. + pending +} + +/// Wrapper around [PurchaseOption] +/// https://developer.apple.com/documentation/storekit/product/purchaseoption +class SK2ProductPurchaseOptions { + /// Creates a new instance of [SK2ProductPurchaseOptions] + SK2ProductPurchaseOptions({this.appAccountToken, this.quantity}); + + /// Sets a UUID to associate the purchase with an account in your system. + final String? appAccountToken; + + /// Indicates the quantity of items the customer is purchasing. + final int? quantity; + + /// Convert to pigeon representation [SK2ProductPurchaseOptionsMessage] + SK2ProductPurchaseOptionsMessage convertToPigeon() { + return SK2ProductPurchaseOptionsMessage( + appAccountToken: appAccountToken, quantity: quantity); + } +} + +extension on SK2ProductPurchaseResultMessage { + SK2ProductPurchaseResult convertFromPigeon() { + switch (this) { + case SK2ProductPurchaseResultMessage.success: + return SK2ProductPurchaseResult.success; + case SK2ProductPurchaseResultMessage.userCancelled: + return SK2ProductPurchaseResult.userCancelled; + case SK2ProductPurchaseResultMessage.pending: + return SK2ProductPurchaseResult.pending; + } + } +} + +/// A wrapper around StoreKit2's [Product](https://developer.apple.com/documentation/storekit/product). +/// The Product type represents the in-app purchases that you configure in +/// App Store Connect and make available for purchase within your app. +class SK2Product { + /// Creates a new [SKStorefrontWrapper] with the provided information. + SK2Product({ + required this.id, + required this.displayName, + required this.displayPrice, + required this.description, + required this.price, + required this.type, + required this.priceLocale, + this.subscription, + }); + + /// The unique product identifier. + final String id; + + /// The localized display name of the product, if it exists. + final String displayName; + + /// The localized description of the product. + final String description; + + /// The localized string representation of the product price, suitable for display. + final double price; + + /// The localized price of the product as a string. + final String displayPrice; + + /// The types of in-app purchases. + final SK2ProductType type; + + /// The subscription information for an auto-renewable subscription. + final SK2SubscriptionInfo? subscription; + + /// The locale and currency information for this product. + final SK2PriceLocale priceLocale; + + /// https://developer.apple.com/documentation/storekit/product/3851116-products + /// Given a list of identifiers, return a list of products + /// If any of the identifiers are invalid or can't be found, they are excluded + /// from the returned list. + static Future> products(List identifiers) async { + final List productsMsg = + await _hostApi.products(identifiers); + if (productsMsg.isEmpty && identifiers.isNotEmpty) { + throw PlatformException( + code: 'storekit_no_response', + message: 'StoreKit: Failed to get response from platform.', + ); + } + + return productsMsg + .whereType() + .map((SK2ProductMessage product) => product.convertFromPigeon()) + .toList(); + } + + /// Wrapper for StoreKit's [Product.purchase] + /// https://developer.apple.com/documentation/storekit/product/3791971-purchase + /// Initiates a purchase for the product with the App Store and displays the confirmation sheet. + static Future purchase(String id, + {SK2ProductPurchaseOptions? options}) async { + SK2ProductPurchaseResultMessage result; + if (options != null) { + result = await _hostApi.purchase(id, options: options.convertToPigeon()); + } else { + result = await _hostApi.purchase(id); + } + return result.convertFromPigeon(); + } + + /// Converts this instance of [SK2Product] to it's pigeon representation [SK2ProductMessage] + SK2ProductMessage convertToPigeon() { + return SK2ProductMessage( + id: id, + displayName: displayName, + description: description, + price: price, + displayPrice: displayPrice, + type: type.convertToPigeon(), + priceLocale: priceLocale.convertToPigeon()); + } +} + +extension on SK2ProductMessage { + SK2Product convertFromPigeon() { + return SK2Product( + id: id, + displayName: displayName, + displayPrice: displayPrice, + price: price, + description: description, + type: type.convertFromPigeon(), + subscription: subscription?.convertFromPigeon(), + priceLocale: priceLocale.convertFromPigeon()); + } +} diff --git a/packages/in_app_purchase/in_app_purchase_storekit/lib/src/store_kit_2_wrappers/sk2_transaction_wrapper.dart b/packages/in_app_purchase/in_app_purchase_storekit/lib/src/store_kit_2_wrappers/sk2_transaction_wrapper.dart new file mode 100644 index 000000000000..5afefddba7af --- /dev/null +++ b/packages/in_app_purchase/in_app_purchase_storekit/lib/src/store_kit_2_wrappers/sk2_transaction_wrapper.dart @@ -0,0 +1,134 @@ +// 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:async'; + +import 'package:in_app_purchase_platform_interface/in_app_purchase_platform_interface.dart'; + +import '../../in_app_purchase_storekit.dart'; +import '../../store_kit_wrappers.dart'; +import '../sk2_pigeon.g.dart'; + +InAppPurchase2API _hostApi = InAppPurchase2API(); + +/// Dart wrapper around StoreKit2's [Transaction](https://developer.apple.com/documentation/storekit/transaction) +/// Note that in StoreKit2, a Transaction encompasses the data contained by +/// SKPayment and SKTransaction in StoreKit1 +class SK2Transaction { + /// Creates a new instance of [SK2Transaction] + SK2Transaction( + {required this.id, + required this.originalId, + required this.productId, + required this.purchaseDate, + this.quantity = 1, + required this.appAccountToken, + this.subscriptionGroupID, + this.price, + this.error}); + + /// The unique identifier for the transaction. + final String id; + + /// The original transaction identifier of a purchase. + /// The original transaction identifier, originalID, is identical to id except + /// when the user restores a purchase or renews a transaction. + final String originalId; + + /// The product identifier of the in-app purchase. + final String productId; + + /// The date that the App Store charged the user’s account for a purchased or + /// restored product, or for a subscription purchase or renewal after a lapse. + final String purchaseDate; + + /// The number of consumable products purchased. + final int quantity; + + /// A UUID that associates the transaction with a user on your own service. + final String? appAccountToken; + + /// The identifier of the subscription group that the subscription belongs to. + final String? subscriptionGroupID; + + /// The price of the in-app purchase that the system records in the transaction. + final double? price; + + /// Any error returned from StoreKit + final SKError? error; + + /// Wrapper around [Transaction.finish] + /// https://developer.apple.com/documentation/storekit/transaction/3749694-finish + /// Indicates to the App Store that the app delivered the purchased content + /// or enabled the service to finish the transaction. + static Future finish(int id) async { + await _hostApi.finish(id); + } + + /// A wrapper around [Transaction.all] + /// https://developer.apple.com/documentation/storekit/transaction/3851203-all + /// A sequence that emits all the customer’s transactions for your app. + static Future> transactions() async { + final List msgs = await _hostApi.transactions(); + final List transactions = + msgs.map((SK2TransactionMessage e) => e.convertFromPigeon()).toList(); + return transactions; + } + + /// Start listening to transactions. + /// Call this as soon as you can your app to avoid missing transactions. + static void startListeningToTransactions() { + _hostApi.startListeningToTransactions(); + } + + /// Stop listening to transactions. + static void stopListeningToTransactions() { + _hostApi.stopListeningToTransactions(); + } +} + +extension on SK2TransactionMessage { + SK2Transaction convertFromPigeon() { + return SK2Transaction( + id: id.toString(), + originalId: originalId.toString(), + productId: productId, + purchaseDate: purchaseDate, + appAccountToken: appAccountToken); + } + + PurchaseDetails convertToDetails() { + return SK2PurchaseDetails( + productID: productId, + // in SK2, as per Apple + // https://developer.apple.com/documentation/foundation/nsbundle/1407276-appstorereceipturl + // receipt isn’t necessary with SK2 as a Transaction can only be returned + // from validated purchases. + verificationData: PurchaseVerificationData( + localVerificationData: '', serverVerificationData: '', source: ''), + transactionDate: purchaseDate, + // Note that with SK2, any transactions that *can* be returned will + // require to be finished, and are already purchased. + // So set this as purchased for all transactions initially. + // Any failed transaction will simply not be returned. + status: restoring ? PurchaseStatus.restored : PurchaseStatus.purchased, + purchaseID: id.toString(), + ); + } +} + +/// An observer that listens to all transactions created +class SK2TransactionObserverWrapper implements InAppPurchase2CallbackAPI { + /// Creates a new instance of [SK2TransactionObserverWrapper] + SK2TransactionObserverWrapper({required this.transactionsCreatedController}); + + /// The transactions stream to listen to + final StreamController> transactionsCreatedController; + + @override + void onTransactionsUpdated(SK2TransactionMessage newTransaction) { + transactionsCreatedController + .add([newTransaction.convertToDetails()]); + } +} diff --git a/packages/in_app_purchase/in_app_purchase_storekit/lib/src/store_kit_wrappers/sk_payment_queue_wrapper.dart b/packages/in_app_purchase/in_app_purchase_storekit/lib/src/store_kit_wrappers/sk_payment_queue_wrapper.dart index 8f1af1c64049..138ecc8b7472 100644 --- a/packages/in_app_purchase/in_app_purchase_storekit/lib/src/store_kit_wrappers/sk_payment_queue_wrapper.dart +++ b/packages/in_app_purchase/in_app_purchase_storekit/lib/src/store_kit_wrappers/sk_payment_queue_wrapper.dart @@ -416,8 +416,8 @@ class SKPaymentWrapper { } /// Creates a Map object describes the payment object. - Map toMap() { - return { + Map toMap() { + return { 'productIdentifier': productIdentifier, 'applicationUsername': applicationUsername, 'requestData': requestData, diff --git a/packages/in_app_purchase/in_app_purchase_storekit/lib/src/store_kit_wrappers/sk_product_wrapper.dart b/packages/in_app_purchase/in_app_purchase_storekit/lib/src/store_kit_wrappers/sk_product_wrapper.dart index dfd8c3083fac..95698271c3ff 100644 --- a/packages/in_app_purchase/in_app_purchase_storekit/lib/src/store_kit_wrappers/sk_product_wrapper.dart +++ b/packages/in_app_purchase/in_app_purchase_storekit/lib/src/store_kit_wrappers/sk_product_wrapper.dart @@ -72,11 +72,9 @@ class SkProductResponseWrapper { SKProductsResponseMessage msg) { return SkProductResponseWrapper( products: msg.products! - .map((SKProductMessage? e) => SKProductWrapper.convertFromPigeon(e!)) + .map((SKProductMessage e) => SKProductWrapper.convertFromPigeon(e)) .toList(), - invalidProductIdentifiers: msg.invalidProductIdentifiers != null - ? msg.invalidProductIdentifiers!.cast() - : [], + invalidProductIdentifiers: msg.invalidProductIdentifiers ?? [], ); } @@ -86,10 +84,9 @@ class SkProductResponseWrapper { SkProductResponseWrapper wrapper) { return SKProductsResponseMessage( products: wrapper.products - .map((SKProductWrapper? e) => SKProductWrapper.convertToPigeon(e!)) + .map((SKProductWrapper e) => SKProductWrapper.convertToPigeon(e)) .toList(), - invalidProductIdentifiers: - wrapper.invalidProductIdentifiers.cast()); + invalidProductIdentifiers: wrapper.invalidProductIdentifiers); } } @@ -550,7 +547,7 @@ class SKProductWrapper { return SKProductWrapper( productIdentifier: msg.productIdentifier, localizedTitle: msg.localizedTitle, - localizedDescription: msg.localizedDescription, + localizedDescription: msg.localizedDescription ?? '', priceLocale: SKPriceLocaleWrapper.convertFromPigeon(msg.priceLocale), price: msg.price, subscriptionGroupIdentifier: msg.subscriptionGroupIdentifier, @@ -563,8 +560,8 @@ class SKProductWrapper { : null, discounts: msg.discounts != null ? msg.discounts! - .map((SKProductDiscountMessage? e) => - SKProductDiscountWrapper.convertFromPigeon(e!)) + .map((SKProductDiscountMessage e) => + SKProductDiscountWrapper.convertFromPigeon(e)) .toList() : []); } @@ -587,8 +584,8 @@ class SKProductWrapper { wrapper.introductoryPrice!) : null, discounts: wrapper.discounts - .map((SKProductDiscountWrapper? e) => - SKProductDiscountWrapper.convertToPigeon(e!)) + .map((SKProductDiscountWrapper e) => + SKProductDiscountWrapper.convertToPigeon(e)) .toList()); } } diff --git a/packages/in_app_purchase/in_app_purchase_storekit/lib/src/store_kit_wrappers/sk_request_maker.dart b/packages/in_app_purchase/in_app_purchase_storekit/lib/src/store_kit_wrappers/sk_request_maker.dart index 5a16f261cdd7..9075db9157ab 100644 --- a/packages/in_app_purchase/in_app_purchase_storekit/lib/src/store_kit_wrappers/sk_request_maker.dart +++ b/packages/in_app_purchase/in_app_purchase_storekit/lib/src/store_kit_wrappers/sk_request_maker.dart @@ -52,7 +52,7 @@ class SKRequestMaker { /// * isRevoked: whether the receipt has been revoked. /// * isVolumePurchase: whether the receipt is a Volume Purchase Plan receipt. Future startRefreshReceiptRequest( - {Map? receiptProperties}) { + {Map? receiptProperties}) { return _hostApi.refreshReceipt(receiptProperties: receiptProperties); } } diff --git a/packages/in_app_purchase/in_app_purchase_storekit/lib/src/types/app_store_product_details.dart b/packages/in_app_purchase/in_app_purchase_storekit/lib/src/types/app_store_product_details.dart index 47bcf616fa40..f0ab7257b375 100644 --- a/packages/in_app_purchase/in_app_purchase_storekit/lib/src/types/app_store_product_details.dart +++ b/packages/in_app_purchase/in_app_purchase_storekit/lib/src/types/app_store_product_details.dart @@ -5,6 +5,7 @@ import 'package:in_app_purchase_platform_interface/in_app_purchase_platform_interface.dart'; import '../../store_kit_wrappers.dart'; +import '../store_kit_2_wrappers/sk2_product_wrapper.dart'; /// The class represents the information of a product as registered in the Apple /// AppStore. @@ -42,3 +43,38 @@ class AppStoreProductDetails extends ProductDetails { /// this [AppStoreProductDetails] object. final SKProductWrapper skProduct; } + +/// The class represents the information of a StoreKit2 product as registered in the Apple +/// AppStore. +class AppStoreProduct2Details extends ProductDetails { + /// Creates a new AppStore specific product details object with the provided + /// details. + AppStoreProduct2Details({ + required super.id, + required super.title, + required super.description, + required super.price, + required super.rawPrice, + required super.currencyCode, + required this.sk2Product, + required super.currencySymbol, + }); + + /// Generate a [AppStoreProductDetails] object based on an iOS [SKProductWrapper] object. + factory AppStoreProduct2Details.fromSK2Product(SK2Product product) { + return AppStoreProduct2Details( + id: product.id, + title: product.displayName, + description: product.description, + price: product.priceLocale.currencySymbol + product.price.toString(), + rawPrice: product.price, + currencyCode: product.priceLocale.currencyCode, + currencySymbol: product.priceLocale.currencySymbol, + sk2Product: product, + ); + } + + /// Points back to the [SKProductWrapper] object that was used to generate + /// this [AppStoreProductDetails] object. + final SK2Product sk2Product; +} diff --git a/packages/in_app_purchase/in_app_purchase_storekit/lib/src/types/app_store_purchase_details.dart b/packages/in_app_purchase/in_app_purchase_storekit/lib/src/types/app_store_purchase_details.dart index 21a1e11116b7..335ff6ad2641 100644 --- a/packages/in_app_purchase/in_app_purchase_storekit/lib/src/types/app_store_purchase_details.dart +++ b/packages/in_app_purchase/in_app_purchase_storekit/lib/src/types/app_store_purchase_details.dart @@ -77,3 +77,18 @@ class AppStorePurchaseDetails extends PurchaseDetails { @override bool get pendingCompletePurchase => _pendingCompletePurchase; } + +/// The class represents the information of a purchase made with the Apple +/// AppStore, when using Storekit2 +class SK2PurchaseDetails extends PurchaseDetails { + /// Creates new instance of [SK2PurchaseDetails] + SK2PurchaseDetails( + {required super.productID, + required super.purchaseID, + required super.verificationData, + required super.transactionDate, + required super.status}); + + @override + bool get pendingCompletePurchase => status == PurchaseStatus.purchased; +} diff --git a/packages/in_app_purchase/in_app_purchase_storekit/lib/store_kit_2_wrappers.dart b/packages/in_app_purchase/in_app_purchase_storekit/lib/store_kit_2_wrappers.dart new file mode 100644 index 000000000000..05482180b1a1 --- /dev/null +++ b/packages/in_app_purchase/in_app_purchase_storekit/lib/store_kit_2_wrappers.dart @@ -0,0 +1,8 @@ +// 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/sk2_pigeon.g.dart'; +export 'src/store_kit_2_wrappers/sk2_appstore_wrapper.dart'; +export 'src/store_kit_2_wrappers/sk2_product_wrapper.dart'; +export 'src/store_kit_2_wrappers/sk2_transaction_wrapper.dart'; diff --git a/packages/in_app_purchase/in_app_purchase_storekit/pigeons/messages.dart b/packages/in_app_purchase/in_app_purchase_storekit/pigeons/messages.dart index 6351c889cc38..cd7b6b70a57a 100644 --- a/packages/in_app_purchase/in_app_purchase_storekit/pigeons/messages.dart +++ b/packages/in_app_purchase/in_app_purchase_storekit/pigeons/messages.dart @@ -9,6 +9,9 @@ import 'package:pigeon/pigeon.dart'; dartTestOut: 'test/test_api.g.dart', objcHeaderOut: 'darwin/Classes/messages.g.h', objcSourceOut: 'darwin/Classes/messages.g.m', + objcOptions: ObjcOptions( + prefix: 'FIA', + ), copyrightHeader: 'pigeons/copyright.txt', )) class SKPaymentTransactionMessage { @@ -91,7 +94,7 @@ class SKErrorMessage { final int code; final String domain; - final Map? userInfo; + final Map? userInfo; } class SKPaymentDiscountMessage { @@ -123,17 +126,17 @@ class SKStorefrontMessage { class SKProductsResponseMessage { const SKProductsResponseMessage( {required this.products, required this.invalidProductIdentifiers}); - final List? products; - final List? invalidProductIdentifiers; + final List? products; + final List? invalidProductIdentifiers; } class SKProductMessage { const SKProductMessage( {required this.productIdentifier, required this.localizedTitle, - required this.localizedDescription, required this.priceLocale, required this.price, + this.localizedDescription, this.subscriptionGroupIdentifier, this.subscriptionPeriod, this.introductoryPrice, @@ -141,13 +144,16 @@ class SKProductMessage { final String productIdentifier; final String localizedTitle; - final String localizedDescription; + // This field should be nullable to handle occasional nulls in the StoreKit + // object despite the the StoreKit header showing that it is nonnullable + // https://github.com/flutter/flutter/issues/154047 + final String? localizedDescription; final SKPriceLocaleMessage priceLocale; final String? subscriptionGroupIdentifier; final String price; final SKProductSubscriptionPeriodMessage? subscriptionPeriod; final SKProductDiscountMessage? introductoryPrice; - final List? discounts; + final List? discounts; } class SKPriceLocaleMessage { diff --git a/packages/in_app_purchase/in_app_purchase_storekit/pigeons/sk2_pigeon.dart b/packages/in_app_purchase/in_app_purchase_storekit/pigeons/sk2_pigeon.dart new file mode 100644 index 000000000000..fbf4c421ac1b --- /dev/null +++ b/packages/in_app_purchase/in_app_purchase_storekit/pigeons/sk2_pigeon.dart @@ -0,0 +1,197 @@ +// 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:pigeon/pigeon.dart'; + +@ConfigurePigeon(PigeonOptions( + dartOut: 'lib/src/sk2_pigeon.g.dart', + dartTestOut: 'test/sk2_test_api.g.dart', + swiftOut: 'darwin/Classes/StoreKit2/sk2_pigeon.g.swift', + copyrightHeader: 'pigeons/copyright.txt', +)) +enum SK2ProductTypeMessage { + /// A consumable in-app purchase. + consumable, + + /// A non-consumable in-app purchase. + nonConsumable, + + /// A non-renewing subscription. + nonRenewable, + + /// An auto-renewable subscription. + autoRenewable +} + +enum SK2SubscriptionOfferTypeMessage { introductory, promotional } + +enum SK2SubscriptionOfferPaymentModeMessage { + payAsYouGo, + payUpFront, + freeTrial, +} + +class SK2SubscriptionOfferMessage { + const SK2SubscriptionOfferMessage({ + this.id, + required this.price, + required this.type, + required this.period, + required this.periodCount, + required this.paymentMode, + }); + final String? id; + final double price; + final SK2SubscriptionOfferTypeMessage type; + final SK2SubscriptionPeriodMessage period; + final int periodCount; + final SK2SubscriptionOfferPaymentModeMessage paymentMode; +} + +enum SK2SubscriptionPeriodUnitMessage { day, week, month, year } + +class SK2SubscriptionPeriodMessage { + const SK2SubscriptionPeriodMessage({required this.value, required this.unit}); + + /// The number of units that the period represents. + final int value; + + /// The unit of time that this period represents. + final SK2SubscriptionPeriodUnitMessage unit; +} + +class SK2SubscriptionInfoMessage { + const SK2SubscriptionInfoMessage({ + required this.subscriptionGroupID, + required this.promotionalOffers, + required this.subscriptionPeriod, + }); + + /// An array of all the promotional offers configured for this subscription. + final List promotionalOffers; + + /// The group identifier for this subscription. + final String subscriptionGroupID; + + /// The duration that this subscription lasts before auto-renewing. + final SK2SubscriptionPeriodMessage subscriptionPeriod; +} + +/// A Pigeon message class representing a Product +/// https://developer.apple.com/documentation/storekit/product +class SK2ProductMessage { + const SK2ProductMessage( + {required this.id, + required this.displayName, + required this.displayPrice, + required this.description, + required this.price, + required this.type, + this.subscription, + required this.priceLocale}); + + /// The unique product identifier. + final String id; + + /// The localized display name of the product, if it exists. + final String displayName; + + /// The localized description of the product. + final String description; + + /// The localized string representation of the product price, suitable for display. + final double price; + + /// The localized price of the product as a string. + final String displayPrice; + + /// The types of in-app purchases. + final SK2ProductTypeMessage type; + + /// The subscription information for an auto-renewable subscription. + final SK2SubscriptionInfoMessage? subscription; + + /// The currency and locale information for this product + final SK2PriceLocaleMessage priceLocale; +} + +class SK2PriceLocaleMessage { + SK2PriceLocaleMessage({ + required this.currencyCode, + required this.currencySymbol, + }); + + final String currencyCode; + final String currencySymbol; +} + +class SK2ProductPurchaseOptionsMessage { + SK2ProductPurchaseOptionsMessage({ + this.appAccountToken, + this.quantity = 1, + }); + final String? appAccountToken; + final int? quantity; +} + +class SK2TransactionMessage { + SK2TransactionMessage( + {required this.id, + required this.originalId, + required this.productId, + required this.purchaseDate, + this.purchasedQuantity = 1, + this.appAccountToken, + this.error, + this.restoring = false}); + final int id; + final int originalId; + final String productId; + final String purchaseDate; + final int purchasedQuantity; + final String? appAccountToken; + final bool restoring; + final SK2ErrorMessage? error; +} + +class SK2ErrorMessage { + const SK2ErrorMessage( + {required this.code, required this.domain, required this.userInfo}); + + final int code; + final String domain; + final Map? userInfo; +} + +enum SK2ProductPurchaseResultMessage { success, userCancelled, pending } + +@HostApi(dartHostTestHandler: 'TestInAppPurchase2Api') +abstract class InAppPurchase2API { + // https://developer.apple.com/documentation/storekit/appstore/3822277-canmakepayments + bool canMakePayments(); + + // https://developer.apple.com/documentation/storekit/product/3851116-products + @async + List products(List identifiers); + + // https://developer.apple.com/documentation/storekit/product/3791971-purchase + @async + SK2ProductPurchaseResultMessage purchase(String id, + {SK2ProductPurchaseOptionsMessage? options}); + + @async + List transactions(); + + @async + void finish(int id); + + void startListeningToTransactions(); + + void stopListeningToTransactions(); +} + +@FlutterApi() +abstract class InAppPurchase2CallbackAPI { + void onTransactionsUpdated(SK2TransactionMessage newTransaction); +} diff --git a/packages/in_app_purchase/in_app_purchase_storekit/pubspec.yaml b/packages/in_app_purchase/in_app_purchase_storekit/pubspec.yaml index 3c2affcdb7e4..4c6da54a5a8a 100644 --- a/packages/in_app_purchase/in_app_purchase_storekit/pubspec.yaml +++ b/packages/in_app_purchase/in_app_purchase_storekit/pubspec.yaml @@ -2,7 +2,7 @@ name: in_app_purchase_storekit description: An implementation for the iOS and macOS platforms of the Flutter `in_app_purchase` plugin. This uses the StoreKit Framework. repository: https://github.com/flutter/packages/tree/main/packages/in_app_purchase/in_app_purchase_storekit issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+in_app_purchase%22 -version: 0.3.17+3 +version: 0.3.18+3 environment: sdk: ^3.3.0 @@ -31,7 +31,7 @@ dev_dependencies: flutter_test: sdk: flutter json_serializable: ^6.0.0 - pigeon: ^16.0.4 + pigeon: ^22.4.2 test: ^1.16.0 topics: diff --git a/packages/in_app_purchase/in_app_purchase_storekit/test/fakes/fake_storekit_platform.dart b/packages/in_app_purchase/in_app_purchase_storekit/test/fakes/fake_storekit_platform.dart index 082d62939d90..29932a9f8180 100644 --- a/packages/in_app_purchase/in_app_purchase_storekit/test/fakes/fake_storekit_platform.dart +++ b/packages/in_app_purchase/in_app_purchase_storekit/test/fakes/fake_storekit_platform.dart @@ -6,8 +6,12 @@ import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:in_app_purchase_storekit/in_app_purchase_storekit.dart'; import 'package:in_app_purchase_storekit/src/messages.g.dart'; +import 'package:in_app_purchase_storekit/src/sk2_pigeon.g.dart'; +import 'package:in_app_purchase_storekit/src/store_kit_2_wrappers/sk2_product_wrapper.dart'; +import 'package:in_app_purchase_storekit/src/store_kit_2_wrappers/sk2_transaction_wrapper.dart'; import 'package:in_app_purchase_storekit/store_kit_wrappers.dart'; +import '../sk2_test_api.g.dart'; import '../store_kit_wrappers/sk_test_stub_objects.dart'; import '../test_api.g.dart'; @@ -33,7 +37,7 @@ class FakeStoreKitPlatform implements TestInAppPurchaseApi { void reset() { transactionList = []; receiptData = 'dummy base64data'; - validProductIDs = {'123', '456'}; + validProductIDs = {'123', '456', '789'}; validProducts = {}; for (final String validID in validProductIDs) { final Map productWrapperMap = @@ -42,6 +46,9 @@ class FakeStoreKitPlatform implements TestInAppPurchaseApi { if (validID == '456') { productWrapperMap['priceLocale'] = buildLocaleMap(noSymbolLocale); } + if (validID == '789') { + productWrapperMap['localizedDescription'] = null; + } validProducts[validID] = SKProductWrapper.fromJson(productWrapperMap); } @@ -180,7 +187,7 @@ class FakeStoreKitPlatform implements TestInAppPurchaseApi { } @override - List transactions() { + List transactions() { throw UnimplementedError(); } @@ -274,3 +281,103 @@ class FakeStoreKitPlatform implements TestInAppPurchaseApi { queueIsActive = false; } } + +class FakeStoreKit2Platform implements TestInAppPurchase2Api { + late Set validProductIDs; + late Map validProducts; + late List transactionList; + late bool testTransactionFail; + late int testTransactionCancel; + late List finishedTransactions; + + PlatformException? queryProductException; + bool isListenerRegistered = false; + + void reset() { + validProductIDs = {'123', '456'}; + validProducts = {}; + for (final String validID in validProductIDs) { + final SK2Product product = SK2Product( + id: validID, + displayName: 'test_product', + displayPrice: '0.99', + description: 'description', + price: 0.99, + type: SK2ProductType.consumable, + priceLocale: + SK2PriceLocale(currencyCode: 'USD', currencySymbol: r'$')); + validProducts[validID] = product; + } + } + + @override + bool canMakePayments() { + return true; + } + + @override + Future> products(List identifiers) { + if (queryProductException != null) { + throw queryProductException!; + } + final List productIDS = identifiers; + final List products = []; + for (final String? productID in productIDS) { + if (validProductIDs.contains(productID)) { + products.add(validProducts[productID]!); + } + } + final List result = []; + for (final SK2Product p in products) { + result.add(p.convertToPigeon()); + } + + return Future>.value(result); + } + + @override + Future purchase(String id, + {SK2ProductPurchaseOptionsMessage? options}) { + final SK2TransactionMessage transaction = createPendingTransaction(id); + + InAppPurchaseStoreKitPlatform.sk2transactionObserver + .onTransactionsUpdated(transaction); + return Future.value( + SK2ProductPurchaseResultMessage.success); + } + + @override + Future finish(int id) { + return Future.value(); + } + + @override + Future> transactions() { + return Future>.value([ + SK2TransactionMessage( + id: 123, + originalId: 123, + productId: 'product_id', + purchaseDate: '12-12') + ]); + } + + @override + void startListeningToTransactions() { + isListenerRegistered = true; + } + + @override + void stopListeningToTransactions() { + isListenerRegistered = false; + } +} + +SK2TransactionMessage createPendingTransaction(String id, {int quantity = 1}) { + return SK2TransactionMessage( + id: 1, + originalId: 2, + productId: id, + purchaseDate: 'purchaseDate', + appAccountToken: 'appAccountToken'); +} diff --git a/packages/in_app_purchase/in_app_purchase_storekit/test/in_app_purchase_storekit_2_platform_test.dart b/packages/in_app_purchase/in_app_purchase_storekit/test/in_app_purchase_storekit_2_platform_test.dart new file mode 100644 index 000000000000..02c80b9d9bee --- /dev/null +++ b/packages/in_app_purchase/in_app_purchase_storekit/test/in_app_purchase_storekit_2_platform_test.dart @@ -0,0 +1,154 @@ +// 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:async'; + +import 'package:flutter/services.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:in_app_purchase_platform_interface/in_app_purchase_platform_interface.dart'; +import 'package:in_app_purchase_storekit/in_app_purchase_storekit.dart'; +import 'package:in_app_purchase_storekit/store_kit_2_wrappers.dart'; + +import 'fakes/fake_storekit_platform.dart'; +import 'sk2_test_api.g.dart'; + +void main() { + final SK2Product dummyProductWrapper = SK2Product( + id: '2', + displayName: 'name', + displayPrice: '0.99', + description: 'desc', + price: 0.99, + type: SK2ProductType.consumable, + priceLocale: SK2PriceLocale(currencyCode: 'USD', currencySymbol: r'$')); + + TestWidgetsFlutterBinding.ensureInitialized(); + + final FakeStoreKit2Platform fakeStoreKit2Platform = FakeStoreKit2Platform(); + late InAppPurchaseStoreKitPlatform iapStoreKitPlatform; + + setUpAll(() { + TestInAppPurchase2Api.setUp(fakeStoreKit2Platform); + }); + + setUp(() { + InAppPurchaseStoreKitPlatform.registerPlatform(); + iapStoreKitPlatform = + InAppPurchasePlatform.instance as InAppPurchaseStoreKitPlatform; + iapStoreKitPlatform.enableStoreKit2(); + fakeStoreKit2Platform.reset(); + }); + + tearDown(() => fakeStoreKit2Platform.reset()); + + group('isAvailable', () { + test('true', () async { + expect(await iapStoreKitPlatform.isAvailable(), isTrue); + }); + }); + + group('query product list', () { + test('should get product list and correct invalid identifiers', () async { + final InAppPurchaseStoreKitPlatform connection = + InAppPurchaseStoreKitPlatform(); + final ProductDetailsResponse response = + await connection.queryProductDetails({'123', '456', '789'}); + final List products = response.productDetails; + expect(products.first.id, '123'); + expect(products[1].id, '456'); + expect(response.notFoundIDs, ['789']); + expect(response.error, isNull); + expect(response.productDetails.first.currencySymbol, r'$'); + expect(response.productDetails[1].currencySymbol, r'$'); + }); + test( + 'if query products throws error, should get error object in the response', + () async { + fakeStoreKit2Platform.queryProductException = PlatformException( + code: 'error_code', + message: 'error_message', + details: {'info': 'error_info'}); + final InAppPurchaseStoreKitPlatform connection = + InAppPurchaseStoreKitPlatform(); + final ProductDetailsResponse response = + await connection.queryProductDetails({'123', '456', '789'}); + expect(response.productDetails, []); + expect(response.notFoundIDs, ['123', '456', '789']); + expect(response.error, isNotNull); + expect(response.error!.source, kIAPSource); + expect(response.error!.code, 'error_code'); + expect(response.error!.message, 'error_message'); + expect(response.error!.details, {'info': 'error_info'}); + }); + }); + + group('make payment', () { + test( + 'buying non consumable, should get purchase objects in the purchase update callback', + () async { + final List details = []; + final Completer> completer = + Completer>(); + final Stream> stream = + iapStoreKitPlatform.purchaseStream; + + late StreamSubscription> subscription; + subscription = stream.listen((List purchaseDetailsList) { + details.addAll(purchaseDetailsList); + if (purchaseDetailsList.first.status == PurchaseStatus.purchased) { + completer.complete(details); + subscription.cancel(); + } + }); + final AppStorePurchaseParam purchaseParam = AppStorePurchaseParam( + productDetails: + AppStoreProduct2Details.fromSK2Product(dummyProductWrapper), + applicationUserName: 'appName'); + await iapStoreKitPlatform.buyNonConsumable(purchaseParam: purchaseParam); + + final List result = await completer.future; + expect(result.length, 1); + expect(result.first.productID, dummyProductWrapper.id); + }); + + test( + 'buying consumable, should get purchase objects in the purchase update callback', + () async { + final List details = []; + final Completer> completer = + Completer>(); + final Stream> stream = + iapStoreKitPlatform.purchaseStream; + + late StreamSubscription> subscription; + subscription = stream.listen((List purchaseDetailsList) { + details.addAll(purchaseDetailsList); + if (purchaseDetailsList.first.status == PurchaseStatus.purchased) { + completer.complete(details); + subscription.cancel(); + } + }); + final AppStorePurchaseParam purchaseParam = AppStorePurchaseParam( + productDetails: + AppStoreProduct2Details.fromSK2Product(dummyProductWrapper), + applicationUserName: 'appName'); + await iapStoreKitPlatform.buyConsumable(purchaseParam: purchaseParam); + + final List result = await completer.future; + expect(result.length, 1); + expect(result.first.productID, dummyProductWrapper.id); + }); + + test('buying consumable, should throw when autoConsume is false', () async { + final AppStorePurchaseParam purchaseParam = AppStorePurchaseParam( + productDetails: + AppStoreProduct2Details.fromSK2Product(dummyProductWrapper), + applicationUserName: 'appName'); + expect( + () => iapStoreKitPlatform.buyConsumable( + purchaseParam: purchaseParam, autoConsume: false), + throwsA(isInstanceOf())); + }); + }); +} diff --git a/packages/in_app_purchase/in_app_purchase_storekit/test/in_app_purchase_storekit_platform_addtion_test.dart b/packages/in_app_purchase/in_app_purchase_storekit/test/in_app_purchase_storekit_platform_addtion_test.dart index 40068db75a71..dfa3c11ca6bf 100644 --- a/packages/in_app_purchase/in_app_purchase_storekit/test/in_app_purchase_storekit_platform_addtion_test.dart +++ b/packages/in_app_purchase/in_app_purchase_storekit/test/in_app_purchase_storekit_platform_addtion_test.dart @@ -15,7 +15,7 @@ void main() { final FakeStoreKitPlatform fakeStoreKitPlatform = FakeStoreKitPlatform(); setUpAll(() { - TestInAppPurchaseApi.setup(fakeStoreKitPlatform); + TestInAppPurchaseApi.setUp(fakeStoreKitPlatform); }); group('present code redemption sheet', () { diff --git a/packages/in_app_purchase/in_app_purchase_storekit/test/in_app_purchase_storekit_platform_test.dart b/packages/in_app_purchase/in_app_purchase_storekit/test/in_app_purchase_storekit_platform_test.dart index 56dc89fb190c..a255b4fa3bd2 100644 --- a/packages/in_app_purchase/in_app_purchase_storekit/test/in_app_purchase_storekit_platform_test.dart +++ b/packages/in_app_purchase/in_app_purchase_storekit/test/in_app_purchase_storekit_platform_test.dart @@ -22,7 +22,7 @@ void main() { late InAppPurchaseStoreKitPlatform iapStoreKitPlatform; setUpAll(() { - TestInAppPurchaseApi.setup(fakeStoreKitPlatform); + TestInAppPurchaseApi.setUp(fakeStoreKitPlatform); }); setUp(() { @@ -44,12 +44,14 @@ void main() { test('should get product list and correct invalid identifiers', () async { final InAppPurchaseStoreKitPlatform connection = InAppPurchaseStoreKitPlatform(); - final ProductDetailsResponse response = - await connection.queryProductDetails({'123', '456', '789'}); + final ProductDetailsResponse response = await connection + .queryProductDetails({'123', '456', '789', '999'}); final List products = response.productDetails; expect(products.first.id, '123'); expect(products[1].id, '456'); - expect(response.notFoundIDs, ['789']); + expect(products[2].id, '789'); + expect(products[2].description, ''); + expect(response.notFoundIDs, ['999']); expect(response.error, isNull); expect(response.productDetails.first.currencySymbol, r'$'); expect(response.productDetails[1].currencySymbol, 'EUR'); diff --git a/packages/in_app_purchase/in_app_purchase_storekit/test/sk2_test_api.g.dart b/packages/in_app_purchase/in_app_purchase_storekit/test/sk2_test_api.g.dart new file mode 100644 index 000000000000..58850af3ece4 --- /dev/null +++ b/packages/in_app_purchase/in_app_purchase_storekit/test/sk2_test_api.g.dart @@ -0,0 +1,348 @@ +// 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 (v22.4.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, unnecessary_import, no_leading_underscores_for_local_identifiers +// ignore_for_file: avoid_relative_lib_imports +import 'dart:async'; +import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List; +import 'package:flutter/foundation.dart' show ReadBuffer, WriteBuffer; +import 'package:flutter/services.dart'; +import 'package:flutter_test/flutter_test.dart'; + +import 'package:in_app_purchase_storekit/src/sk2_pigeon.g.dart'; + +class _PigeonCodec extends StandardMessageCodec { + const _PigeonCodec(); + @override + void writeValue(WriteBuffer buffer, Object? value) { + if (value is int) { + buffer.putUint8(4); + buffer.putInt64(value); + } else if (value is SK2ProductTypeMessage) { + buffer.putUint8(129); + writeValue(buffer, value.index); + } else if (value is SK2SubscriptionOfferTypeMessage) { + buffer.putUint8(130); + writeValue(buffer, value.index); + } else if (value is SK2SubscriptionOfferPaymentModeMessage) { + buffer.putUint8(131); + writeValue(buffer, value.index); + } else if (value is SK2SubscriptionPeriodUnitMessage) { + buffer.putUint8(132); + writeValue(buffer, value.index); + } else if (value is SK2ProductPurchaseResultMessage) { + buffer.putUint8(133); + writeValue(buffer, value.index); + } else if (value is SK2SubscriptionOfferMessage) { + buffer.putUint8(134); + writeValue(buffer, value.encode()); + } else if (value is SK2SubscriptionPeriodMessage) { + buffer.putUint8(135); + writeValue(buffer, value.encode()); + } else if (value is SK2SubscriptionInfoMessage) { + buffer.putUint8(136); + writeValue(buffer, value.encode()); + } else if (value is SK2ProductMessage) { + buffer.putUint8(137); + writeValue(buffer, value.encode()); + } else if (value is SK2PriceLocaleMessage) { + buffer.putUint8(138); + writeValue(buffer, value.encode()); + } else if (value is SK2ProductPurchaseOptionsMessage) { + buffer.putUint8(139); + writeValue(buffer, value.encode()); + } else if (value is SK2TransactionMessage) { + buffer.putUint8(140); + writeValue(buffer, value.encode()); + } else if (value is SK2ErrorMessage) { + buffer.putUint8(141); + writeValue(buffer, value.encode()); + } else { + super.writeValue(buffer, value); + } + } + + @override + Object? readValueOfType(int type, ReadBuffer buffer) { + switch (type) { + case 129: + final int? value = readValue(buffer) as int?; + return value == null ? null : SK2ProductTypeMessage.values[value]; + case 130: + final int? value = readValue(buffer) as int?; + return value == null + ? null + : SK2SubscriptionOfferTypeMessage.values[value]; + case 131: + final int? value = readValue(buffer) as int?; + return value == null + ? null + : SK2SubscriptionOfferPaymentModeMessage.values[value]; + case 132: + final int? value = readValue(buffer) as int?; + return value == null + ? null + : SK2SubscriptionPeriodUnitMessage.values[value]; + case 133: + final int? value = readValue(buffer) as int?; + return value == null + ? null + : SK2ProductPurchaseResultMessage.values[value]; + case 134: + return SK2SubscriptionOfferMessage.decode(readValue(buffer)!); + case 135: + return SK2SubscriptionPeriodMessage.decode(readValue(buffer)!); + case 136: + return SK2SubscriptionInfoMessage.decode(readValue(buffer)!); + case 137: + return SK2ProductMessage.decode(readValue(buffer)!); + case 138: + return SK2PriceLocaleMessage.decode(readValue(buffer)!); + case 139: + return SK2ProductPurchaseOptionsMessage.decode(readValue(buffer)!); + case 140: + return SK2TransactionMessage.decode(readValue(buffer)!); + case 141: + return SK2ErrorMessage.decode(readValue(buffer)!); + default: + return super.readValueOfType(type, buffer); + } + } +} + +abstract class TestInAppPurchase2Api { + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; + static const MessageCodec pigeonChannelCodec = _PigeonCodec(); + + bool canMakePayments(); + + Future> products(List identifiers); + + Future purchase(String id, + {SK2ProductPurchaseOptionsMessage? options}); + + Future> transactions(); + + Future finish(int id); + + void startListeningToTransactions(); + + void stopListeningToTransactions(); + + static void setUp( + TestInAppPurchase2Api? api, { + BinaryMessenger? binaryMessenger, + String messageChannelSuffix = '', + }) { + messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + { + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchase2API.canMakePayments$messageChannelSuffix', + pigeonChannelCodec, + binaryMessenger: binaryMessenger); + if (api == null) { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(pigeonVar_channel, null); + } else { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(pigeonVar_channel, + (Object? message) async { + try { + final bool output = api.canMakePayments(); + return [output]; + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } + }); + } + } + { + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchase2API.products$messageChannelSuffix', + pigeonChannelCodec, + binaryMessenger: binaryMessenger); + if (api == null) { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(pigeonVar_channel, null); + } else { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(pigeonVar_channel, + (Object? message) async { + assert(message != null, + 'Argument for dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchase2API.products was null.'); + final List args = (message as List?)!; + final List? arg_identifiers = + (args[0] as List?)?.cast(); + assert(arg_identifiers != null, + 'Argument for dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchase2API.products was null, expected non-null List.'); + try { + final List output = + await api.products(arg_identifiers!); + return [output]; + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } + }); + } + } + { + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchase2API.purchase$messageChannelSuffix', + pigeonChannelCodec, + binaryMessenger: binaryMessenger); + if (api == null) { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(pigeonVar_channel, null); + } else { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(pigeonVar_channel, + (Object? message) async { + assert(message != null, + 'Argument for dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchase2API.purchase was null.'); + final List args = (message as List?)!; + final String? arg_id = (args[0] as String?); + assert(arg_id != null, + 'Argument for dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchase2API.purchase was null, expected non-null String.'); + final SK2ProductPurchaseOptionsMessage? arg_options = + (args[1] as SK2ProductPurchaseOptionsMessage?); + try { + final SK2ProductPurchaseResultMessage output = + await api.purchase(arg_id!, options: arg_options); + return [output]; + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } + }); + } + } + { + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchase2API.transactions$messageChannelSuffix', + pigeonChannelCodec, + binaryMessenger: binaryMessenger); + if (api == null) { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(pigeonVar_channel, null); + } else { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(pigeonVar_channel, + (Object? message) async { + try { + final List output = await api.transactions(); + return [output]; + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } + }); + } + } + { + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchase2API.finish$messageChannelSuffix', + pigeonChannelCodec, + binaryMessenger: binaryMessenger); + if (api == null) { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(pigeonVar_channel, null); + } else { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(pigeonVar_channel, + (Object? message) async { + assert(message != null, + 'Argument for dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchase2API.finish was null.'); + final List args = (message as List?)!; + final int? arg_id = (args[0] as int?); + assert(arg_id != null, + 'Argument for dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchase2API.finish was null, expected non-null int.'); + try { + await api.finish(arg_id!); + return wrapResponse(empty: true); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } + }); + } + } + { + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchase2API.startListeningToTransactions$messageChannelSuffix', + pigeonChannelCodec, + binaryMessenger: binaryMessenger); + if (api == null) { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(pigeonVar_channel, null); + } else { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(pigeonVar_channel, + (Object? message) async { + try { + api.startListeningToTransactions(); + return wrapResponse(empty: true); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } + }); + } + } + { + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchase2API.stopListeningToTransactions$messageChannelSuffix', + pigeonChannelCodec, + binaryMessenger: binaryMessenger); + if (api == null) { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(pigeonVar_channel, null); + } else { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(pigeonVar_channel, + (Object? message) async { + try { + api.stopListeningToTransactions(); + return wrapResponse(empty: true); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } + }); + } + } + } +} diff --git a/packages/in_app_purchase/in_app_purchase_storekit/test/store_kit_wrappers/sk_methodchannel_apis_test.dart b/packages/in_app_purchase/in_app_purchase_storekit/test/store_kit_wrappers/sk_methodchannel_apis_test.dart index f7fe5283d949..b774552f84ba 100644 --- a/packages/in_app_purchase/in_app_purchase_storekit/test/store_kit_wrappers/sk_methodchannel_apis_test.dart +++ b/packages/in_app_purchase/in_app_purchase_storekit/test/store_kit_wrappers/sk_methodchannel_apis_test.dart @@ -15,7 +15,7 @@ void main() { final FakeStoreKitPlatform fakeStoreKitPlatform = FakeStoreKitPlatform(); setUpAll(() { - TestInAppPurchaseApi.setup(fakeStoreKitPlatform); + TestInAppPurchaseApi.setUp(fakeStoreKitPlatform); }); setUp(() {}); @@ -235,7 +235,7 @@ class FakeStoreKitPlatform implements TestInAppPurchaseApi { } @override - List transactions() => + List transactions() => [dummyTransactionMessage]; @override diff --git a/packages/in_app_purchase/in_app_purchase_storekit/test/store_kit_wrappers/sk_payment_queue_delegate_api_test.dart b/packages/in_app_purchase/in_app_purchase_storekit/test/store_kit_wrappers/sk_payment_queue_delegate_api_test.dart index 03c9fda381cb..f9efd427bfc5 100644 --- a/packages/in_app_purchase/in_app_purchase_storekit/test/store_kit_wrappers/sk_payment_queue_delegate_api_test.dart +++ b/packages/in_app_purchase/in_app_purchase_storekit/test/store_kit_wrappers/sk_payment_queue_delegate_api_test.dart @@ -15,7 +15,7 @@ void main() { final FakeStoreKitPlatform fakeStoreKitPlatform = FakeStoreKitPlatform(); setUpAll(() { - TestInAppPurchaseApi.setup(fakeStoreKitPlatform); + TestInAppPurchaseApi.setUp(fakeStoreKitPlatform); }); test( diff --git a/packages/in_app_purchase/in_app_purchase_storekit/test/test_api.g.dart b/packages/in_app_purchase/in_app_purchase_storekit/test/test_api.g.dart index 6b0c9a77ab46..2092930d208d 100644 --- a/packages/in_app_purchase/in_app_purchase_storekit/test/test_api.g.dart +++ b/packages/in_app_purchase/in_app_purchase_storekit/test/test_api.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 (v16.0.5), do not edit directly. +// Autogenerated from Pigeon (v22.4.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, unnecessary_import, no_leading_underscores_for_local_identifiers // ignore_for_file: avoid_relative_lib_imports @@ -13,40 +13,55 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:in_app_purchase_storekit/src/messages.g.dart'; -class _TestInAppPurchaseApiCodec extends StandardMessageCodec { - const _TestInAppPurchaseApiCodec(); +class _PigeonCodec extends StandardMessageCodec { + const _PigeonCodec(); @override void writeValue(WriteBuffer buffer, Object? value) { - if (value is SKErrorMessage) { - buffer.putUint8(128); - writeValue(buffer, value.encode()); - } else if (value is SKPaymentDiscountMessage) { + if (value is int) { + buffer.putUint8(4); + buffer.putInt64(value); + } else if (value is SKPaymentTransactionStateMessage) { buffer.putUint8(129); - writeValue(buffer, value.encode()); - } else if (value is SKPaymentMessage) { + writeValue(buffer, value.index); + } else if (value is SKProductDiscountTypeMessage) { buffer.putUint8(130); - writeValue(buffer, value.encode()); - } else if (value is SKPaymentTransactionMessage) { + writeValue(buffer, value.index); + } else if (value is SKProductDiscountPaymentModeMessage) { buffer.putUint8(131); - writeValue(buffer, value.encode()); - } else if (value is SKPriceLocaleMessage) { + writeValue(buffer, value.index); + } else if (value is SKSubscriptionPeriodUnitMessage) { buffer.putUint8(132); - writeValue(buffer, value.encode()); - } else if (value is SKProductDiscountMessage) { + writeValue(buffer, value.index); + } else if (value is SKPaymentTransactionMessage) { buffer.putUint8(133); writeValue(buffer, value.encode()); - } else if (value is SKProductMessage) { + } else if (value is SKPaymentMessage) { buffer.putUint8(134); writeValue(buffer, value.encode()); - } else if (value is SKProductSubscriptionPeriodMessage) { + } else if (value is SKErrorMessage) { buffer.putUint8(135); writeValue(buffer, value.encode()); - } else if (value is SKProductsResponseMessage) { + } else if (value is SKPaymentDiscountMessage) { buffer.putUint8(136); writeValue(buffer, value.encode()); } else if (value is SKStorefrontMessage) { buffer.putUint8(137); writeValue(buffer, value.encode()); + } else if (value is SKProductsResponseMessage) { + buffer.putUint8(138); + writeValue(buffer, value.encode()); + } else if (value is SKProductMessage) { + buffer.putUint8(139); + writeValue(buffer, value.encode()); + } else if (value is SKPriceLocaleMessage) { + buffer.putUint8(140); + writeValue(buffer, value.encode()); + } else if (value is SKProductDiscountMessage) { + buffer.putUint8(141); + writeValue(buffer, value.encode()); + } else if (value is SKProductSubscriptionPeriodMessage) { + buffer.putUint8(142); + writeValue(buffer, value.encode()); } else { super.writeValue(buffer, value); } @@ -55,26 +70,46 @@ class _TestInAppPurchaseApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: - return SKErrorMessage.decode(readValue(buffer)!); case 129: - return SKPaymentDiscountMessage.decode(readValue(buffer)!); + final int? value = readValue(buffer) as int?; + return value == null + ? null + : SKPaymentTransactionStateMessage.values[value]; case 130: - return SKPaymentMessage.decode(readValue(buffer)!); + final int? value = readValue(buffer) as int?; + return value == null + ? null + : SKProductDiscountTypeMessage.values[value]; case 131: - return SKPaymentTransactionMessage.decode(readValue(buffer)!); + final int? value = readValue(buffer) as int?; + return value == null + ? null + : SKProductDiscountPaymentModeMessage.values[value]; case 132: - return SKPriceLocaleMessage.decode(readValue(buffer)!); + final int? value = readValue(buffer) as int?; + return value == null + ? null + : SKSubscriptionPeriodUnitMessage.values[value]; case 133: - return SKProductDiscountMessage.decode(readValue(buffer)!); + return SKPaymentTransactionMessage.decode(readValue(buffer)!); case 134: - return SKProductMessage.decode(readValue(buffer)!); + return SKPaymentMessage.decode(readValue(buffer)!); case 135: - return SKProductSubscriptionPeriodMessage.decode(readValue(buffer)!); + return SKErrorMessage.decode(readValue(buffer)!); case 136: - return SKProductsResponseMessage.decode(readValue(buffer)!); + return SKPaymentDiscountMessage.decode(readValue(buffer)!); case 137: return SKStorefrontMessage.decode(readValue(buffer)!); + case 138: + return SKProductsResponseMessage.decode(readValue(buffer)!); + case 139: + return SKProductMessage.decode(readValue(buffer)!); + case 140: + return SKPriceLocaleMessage.decode(readValue(buffer)!); + case 141: + return SKProductDiscountMessage.decode(readValue(buffer)!); + case 142: + return SKProductSubscriptionPeriodMessage.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); } @@ -84,22 +119,21 @@ class _TestInAppPurchaseApiCodec extends StandardMessageCodec { abstract class TestInAppPurchaseApi { static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; - static const MessageCodec pigeonChannelCodec = - _TestInAppPurchaseApiCodec(); + static const MessageCodec pigeonChannelCodec = _PigeonCodec(); /// Returns if the current device is able to make payments bool canMakePayments(); - List transactions(); + List transactions(); SKStorefrontMessage storefront(); - void addPayment(Map paymentMap); + void addPayment(Map paymentMap); Future startProductRequest( - List productIdentifiers); + List productIdentifiers); - void finishTransaction(Map finishMap); + void finishTransaction(Map finishMap); void restoreTransactions(String? applicationUserName); @@ -107,7 +141,7 @@ abstract class TestInAppPurchaseApi { String? retrieveReceiptData(); - Future refreshReceipt({Map? receiptProperties}); + Future refreshReceipt({Map? receiptProperties}); void startObservingPaymentQueue(); @@ -119,20 +153,26 @@ abstract class TestInAppPurchaseApi { void showPriceConsentIfNeeded(); - static void setup(TestInAppPurchaseApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setUp( + TestInAppPurchaseApi? api, { + BinaryMessenger? binaryMessenger, + String messageChannelSuffix = '', + }) { + messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.canMakePayments', + 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.canMakePayments$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { try { final bool output = api.canMakePayments(); @@ -147,21 +187,21 @@ abstract class TestInAppPurchaseApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.transactions', + 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.transactions$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { try { - final List output = - api.transactions(); + final List output = api.transactions(); return [output]; } on PlatformException catch (e) { return wrapResponse(error: e); @@ -173,17 +213,18 @@ abstract class TestInAppPurchaseApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.storefront', + 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.storefront$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { try { final SKStorefrontMessage output = api.storefront(); @@ -198,25 +239,26 @@ abstract class TestInAppPurchaseApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.addPayment', + 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.addPayment$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.addPayment was null.'); final List args = (message as List?)!; - final Map? arg_paymentMap = - (args[0] as Map?)?.cast(); + final Map? arg_paymentMap = + (args[0] as Map?)?.cast(); assert(arg_paymentMap != null, - 'Argument for dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.addPayment was null, expected non-null Map.'); + 'Argument for dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.addPayment was null, expected non-null Map.'); try { api.addPayment(arg_paymentMap!); return wrapResponse(empty: true); @@ -230,25 +272,26 @@ abstract class TestInAppPurchaseApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.startProductRequest', + 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.startProductRequest$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.startProductRequest was null.'); final List args = (message as List?)!; - final List? arg_productIdentifiers = - (args[0] as List?)?.cast(); + final List? arg_productIdentifiers = + (args[0] as List?)?.cast(); assert(arg_productIdentifiers != null, - 'Argument for dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.startProductRequest was null, expected non-null List.'); + 'Argument for dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.startProductRequest was null, expected non-null List.'); try { final SKProductsResponseMessage output = await api.startProductRequest(arg_productIdentifiers!); @@ -263,25 +306,26 @@ abstract class TestInAppPurchaseApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.finishTransaction', + 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.finishTransaction$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.finishTransaction was null.'); final List args = (message as List?)!; - final Map? arg_finishMap = - (args[0] as Map?)?.cast(); + final Map? arg_finishMap = + (args[0] as Map?)?.cast(); assert(arg_finishMap != null, - 'Argument for dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.finishTransaction was null, expected non-null Map.'); + 'Argument for dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.finishTransaction was null, expected non-null Map.'); try { api.finishTransaction(arg_finishMap!); return wrapResponse(empty: true); @@ -295,17 +339,18 @@ abstract class TestInAppPurchaseApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.restoreTransactions', + 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.restoreTransactions$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.restoreTransactions was null.'); @@ -324,17 +369,18 @@ abstract class TestInAppPurchaseApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.presentCodeRedemptionSheet', + 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.presentCodeRedemptionSheet$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { try { api.presentCodeRedemptionSheet(); @@ -349,17 +395,18 @@ abstract class TestInAppPurchaseApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.retrieveReceiptData', + 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.retrieveReceiptData$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { try { final String? output = api.retrieveReceiptData(); @@ -374,23 +421,24 @@ abstract class TestInAppPurchaseApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.refreshReceipt', + 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.refreshReceipt$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.refreshReceipt was null.'); final List args = (message as List?)!; - final Map? arg_receiptProperties = - (args[0] as Map?)?.cast(); + final Map? arg_receiptProperties = + (args[0] as Map?)?.cast(); try { await api.refreshReceipt(receiptProperties: arg_receiptProperties); return wrapResponse(empty: true); @@ -404,17 +452,18 @@ abstract class TestInAppPurchaseApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.startObservingPaymentQueue', + 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.startObservingPaymentQueue$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { try { api.startObservingPaymentQueue(); @@ -429,17 +478,18 @@ abstract class TestInAppPurchaseApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.stopObservingPaymentQueue', + 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.stopObservingPaymentQueue$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { try { api.stopObservingPaymentQueue(); @@ -454,17 +504,18 @@ abstract class TestInAppPurchaseApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.registerPaymentQueueDelegate', + 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.registerPaymentQueueDelegate$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { try { api.registerPaymentQueueDelegate(); @@ -479,17 +530,18 @@ abstract class TestInAppPurchaseApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.removePaymentQueueDelegate', + 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.removePaymentQueueDelegate$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { try { api.removePaymentQueueDelegate(); @@ -504,17 +556,18 @@ abstract class TestInAppPurchaseApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.showPriceConsentIfNeeded', + 'dev.flutter.pigeon.in_app_purchase_storekit.InAppPurchaseAPI.showPriceConsentIfNeeded$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { try { api.showPriceConsentIfNeeded(); diff --git a/packages/interactive_media_ads/CHANGELOG.md b/packages/interactive_media_ads/CHANGELOG.md index b85f09593a8e..7bfcc2e6e164 100644 --- a/packages/interactive_media_ads/CHANGELOG.md +++ b/packages/interactive_media_ads/CHANGELOG.md @@ -1,3 +1,99 @@ +## 0.2.2+13 + +* Adds internal wrapper for Android native `Ad`. + +## 0.2.2+12 + +* Adds internal wrapper for iOS native `IMACompanionAd`. + +## 0.2.2+11 + +* Adds internal wrapper for Android native `UniversalAdId`. + +## 0.2.2+10 + +* Fixes bug where Android would show the last frame of the previous Ad before playing the current + one. + +## 0.2.2+9 + +* Adds internal wrapper for Android native `CompanionAd`. + +## 0.2.2+8 + +* Adds remaining methods for internal wrapper of the iOS native `IMAAdsRenderingSettings`. + +## 0.2.2+7 + +* Updates Java compatibility version to 11. +* Updates minimum supported SDK version to Flutter 3.24/Dart 3.5. + +## 0.2.2+6 + +* Bumps Android dependency `com.google.ads.interactivemedia.v3:interactivemedia` from `3.50.0` to + `3.35.1`. + +## 0.2.2+5 + +* Changes the example app to initialize the `AdsLoader` in `onContainerAdded`. + +## 0.2.2+4 + +* Adds internal wrapper for Android native `AdProgressInfo`. + +## 0.2.2+3 + +* Adds internal wrapper for iOS native `IMAFriendlyObstruction`. + +## 0.2.2+2 + +* Adds internal wrapper for Android native `AdsRenderingSettings`. + +## 0.2.2+1 + +* Bumps Android dependency `com.google.ads.interactivemedia.v3:interactivemedia` from `3.34.0` to + `3.35.0`. + +## 0.2.2 + +* Adds support for mid-roll ads. See `AdsRequest.contentProgressProvider`. + +## 0.2.1 + +* Adds internal wrapper for Android native `ContentProgressProvider`. + +## 0.2.0 + +* Adds support for pausing and resuming Ad playback. See `AdsManager.pause` and `AdsManager.resume`. +* Adds support to skip an Ad. See `AdsManager.skip` and `AdsManager.discardAdBreak`. +* **Breaking Change** To keep platform consistency, Android no longer continues playing an Ad + whenever it returns from an Ad click. Call `AdsManager.resume` to resume Ad playback. + +## 0.1.2+6 + +* Fixes bug where the ad would play when the app returned to foreground during content playback. + +## 0.1.2+5 + +* Adds internal wrapper for remaining methods of the Android native `AdsManager`. + +## 0.1.2+4 + +* Bumps androidx.annotation:annotation from 1.8.1 to 1.8.2. + +## 0.1.2+3 + +* Adds a contribution guide. See `CONTRIBUTING.md`. + +## 0.1.2+2 + +* Removes dependency on org.jetbrains.kotlin:kotlin-bom. +* Updates minimum supported SDK version to Flutter 3.24/Dart 3.5. + +## 0.1.2+1 + +* Updates README to clarify supported features and link to issues tracker. + ## 0.1.2 * Adds support for all `AdEventType`s and ad data. See `AdEvent.adData`. diff --git a/packages/interactive_media_ads/CONTRIBUTING.md b/packages/interactive_media_ads/CONTRIBUTING.md new file mode 100644 index 000000000000..0578595c34f0 --- /dev/null +++ b/packages/interactive_media_ads/CONTRIBUTING.md @@ -0,0 +1,216 @@ +# Contributing to `interactive_media_ads` + +Please start by taking a look at the general guide to contributing to the `flutter/packages` repo: +https://github.com/flutter/packages/blob/main/CONTRIBUTING.md + +## Package Structure + +The structure of this plugin is similar to a [federated plugin](https://docs.flutter.dev/packages-and-plugins/developing-packages#federated-plugins), +except the code for each package (platform interface, platform implementations, and app-facing +interface) are maintained in this single plugin. The sections below will provide an overview of how +this plugin implements each portion. + +If you are familiar with [changing federated plugin](https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#changing-federated-plugins) +in the `flutter/packages` repo, the process is similar except that all changes are made in this +plugin. Therefore, it is not necessary to run the script that makes dependencies path based. + +### Quick Overview + +This plugin uses the native [IMA SDKs] for Android and iOS. The API for the SDK of both platforms +are relatively similar, so this plugin attempts to maintain an interface that is similar to the +native SDKs. + +The app-facing interface uses delegation to interact with the underlying platform implementations. +Therefore, the platform interface is similar to the app-facing interface with the differences being +explained in the sections below. Many app-facing interface classes will contain a `platform` field +that is used to forward handling to the platform implementation: + +```dart +// App-facing class used by apps +class AdsLoader { + AdsLoader.fromPlatform(this.platform); + + final PlatformAdsLoader platform; + + Future requestAds(AdsRequest request) { + return platform.requestAds(request); + } +} + +// Platform interface class implemented by each platform +abstract base class PlatformAdsLoader { + Future requestAds(AdsRequest request); +} +``` + +The `platform` variable should also be used to provide access to platform specific methods or +platform specific creation parameters: + +```dart +final AdsLoader loader = AdsLoader(); +(loader.platform as AndroidAdsLoader).callAndroidSpecificMethod(); +``` + +The other classes/enums included in the app-facing interface are typically exported from the +platform interface. A data class being a good example of a class that is exported. + +### Platform Interface + +Code location: `lib/src/platform_interface/`. + +This declares an interface that each platform must implement to be supported by the app-facing +interface. + +The design of the platform interface should prioritize: +* Minimizing the chances of needing a breaking change when adding a new feature. +* Allowing platform implementations to easily add platform specific features. +* Being straight-forward to write unit tests. + +Each platform creates a subclass of the central [InteractiveMediaAdsPlatform](lib/src/platform_interface/interactive_media_ads_platform.dart) +class. A platform implementation is set by setting `InteractiveMediaAdsPlatform.instance` to an +instance of a platform implementation of `InteractiveMediaAdsPlatform`. + +### Platform Interface Class Types + +Below are some of the types of classes in the interface. + +#### Delegate Platform Class + +These are classes where the app-facing interface needs to delegate handling to the platform +implementation. These classes are typically prefixed with `Platform`. + +If the corresponding app-facing class can be instantiated by the app (e.g. [AdsLoader]), +the `InteractiveMediaAdsPlatform.instance` field should be used in a factory to instantiate the +correct platform implementation. See [PlatformAdsLoader] as an example. This class should should +also take a creation params class as the only constructor parameter. + +If the corresponding app-facing class can't be instantiated by the app (e.g. `AdsManager`), the +class should only have a single protected constructor. See [PlatformAdsManager]. + +If the corresponding app-facing class needs to be a `Widget` (e.g. [AdDisplayContainer]), this +should follow the same pattern as being instantiable by the app except it should contain a single +method: `Widget build(BuildContext)`. See [PlatformAdDisplayContainer]. + +**Note** + +Every method should contain no more than one parameter. This allows the platform interface and +platform implementations to add new features without requiring a breaking change. + +#### Data Classes + +These classes contain only fields and no methods. Each data class should be made `@immutable`. + +### Platform Implementations + +Code location: +* Android: `lib/src/android/` +* iOS: `lib/src/ios/` + +The platform implementations create a subclass of `InteractiveMediaAdsPlatform` and implement the +platform classes that are returned by this. + +#### SDK Wrappers + +The platform implementations use Dart wrappers of their native SDKs. The SDKs are wrapped using +using the `pigeon` package. However, the code that handles generating the wrappers for iOS is still +in the process of review, so this plugin must use a git dependency in the pubspec. + +The wrappers for the SDK of each platform can be updated and modified by changing the pigeon files: + +* Android: `pigeons/interactive_media_ads_android.dart` +* iOS: `pigeons/interactive_media_ads_ios.dart` + +The generated files are located: +* Android: + * `lib/src/android/interactive_media_ads.g.dart` + * `android/src/main/kotlin/dev/flutter/packages/interactive_media_ads/InteractiveMediaAdsLibrary.g.kt` +* iOS + * `lib/src/ios/interactive_media_ads.g.dart` + * `ios/interactive_media_ads/Sources/interactive_media_ads/InteractiveMediaAdsLibrary.g.swift` + +To update a wrapper for a platform, follow the steps: + +##### 1. Ensure the project has been built at least once + +* Android: Run `flutter build apk --debug` in `example/`. +* iOS: Run `flutter build ios --simulator` in `example/` + +##### 2. Make changes to the respective pigeon file that matches the native SDK + +* Android: + - [Android SDK] + - Pigeon file to update: `pigeons/interactive_media_ads_android.dart` +* iOS: + - [iOS SDK] + - Pigeon file to update: `pigeons/interactive_media_ads_ios.dart` + +##### 3. Run the code generator from the terminal + +* Android: `dart run pigeon --input pigeons/interactive_media_ads_android.dart` +* iOS: `dart run pigeon --input pigeons/interactive_media_ads_ios.dart` + +##### 4. Update the generated APIs in native code + +Running the `flutter build` step from step 1 again should provide build errors and indicate what +needs to be done. Alternatively, it can be easier to update native code with the platform's specific +IDE: + +* Android: Open `example/android/` in a separate Android Studio project. +* iOS: Open `example/ios/` in Xcode. + +##### 5. Write API tests + +Assuming a non-static method or constructor was added to the native wrapper, a native test will need +to be added. + +* Android native tests location: `android/src/test/kotlin/dev/flutter/packages/interactive_media_ads/` +* iOS native tests location `example/ios/RunnerTests/` + +#### Dart Unit Testing + +Tests for the platform implementations use [mockito] to generate mock objects of the native Dart +wrappers. To generate the mock objects in `test/`, run +`dart run build_runner build --delete-conflicting-outputs`. + +### App-facing Interface + +Code location: `lib/src/` + +The app-facing interface shares the same structure as the platform interface and uses delegation +to forward handling to the platform implementation. Note a few differences from the platform +interface: + +* Constructors and methods can contain more than one parameter. +* Platform classes can be instantiated with a platform implementation or creation params of + the corresponding platform interface class. See `AdsLoader.fromPlatform` and + `AdsLoader.fromPlatformCreationParams`. + +## Recommended Process for Adding a New Feature + +### 1. Create a new feature request issue in the `flutter/flutter` repo. + +See https://github.com/flutter/flutter/issues/new?assignees=&labels=&projects=&template=3_feature_request.yml + +### 2. In that issue add the specific native classes/methods that this feature requires for each platform: + +* [Android SDK] +* [iOS SDK] + +Add a note if this feature only exist for a single platform. + +### 3. Add a design where the feature can be added to the platform interface and app-facing interface. + +If this is only supported on a single platform, add where it can be added in the platform +implementation. + +### 4. Work can be started on the feature request or you can wait for feedback from a Flutter contributor. + +[IMA SDKs]: https://developers.google.com/interactive-media-ads +[AdsLoader]: lib/src/ads_loader.dart +[AdDisplayContainer]: lib/src/ad_display_container.dart +[PlatformAdsLoader]: lib/src/platform_interface/platform_ads_loader.dart +[PlatformAdsManager]: lib/src/platform_interface/platform_ads_manager.dart +[PlatformAdDisplayContainer]: lib/src/platform_interface/platform_ad_display_container.dart +[Android SDK]: https://developers.google.com/interactive-media-ads/docs/sdks/android/client-side/api/reference/com/google/ads/interactivemedia/v3/api/package-summary +[iOS SDK]: https://developers.google.com/interactive-media-ads/docs/sdks/ios/client-side/reference/Classes +[mockito]: https://pub.dev/packages/mockito diff --git a/packages/interactive_media_ads/README.md b/packages/interactive_media_ads/README.md index 4b585e746a8e..d3e1817f09ba 100644 --- a/packages/interactive_media_ads/README.md +++ b/packages/interactive_media_ads/README.md @@ -13,7 +13,9 @@ a separate video player positioned on top of the app's content video player. |-------------|---------|-------| | **Support** | SDK 21+ | 12.0+ | -**This package is still in development.** +**NOTE:** +* Companion ads, Background Audio ads and Google Dynamic Ad Insertion methods are currently not + supported. ## IMA client-side overview @@ -75,11 +77,12 @@ class AdExampleWidget extends StatefulWidget { State createState() => _AdExampleWidgetState(); } -class _AdExampleWidgetState extends State { - // IMA sample tag for a single skippable inline video ad. See more IMA sample +class _AdExampleWidgetState extends State + with WidgetsBindingObserver { + // IMA sample tag for a pre-, mid-, and post-roll, single inline video ad. See more IMA sample // tags at https://developers.google.com/interactive-media-ads/docs/sdks/html5/client-side/tags static const String _adTagUrl = - 'https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/single_preroll_skippable&sz=640x480&ciu_szs=300x250%2C728x90&gdfp_req=1&output=vast&unviewed_position_start=1&env=vp&impl=s&correlator='; + 'https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/vmap_ad_samples&sz=640x480&cust_params=sample_ar%3Dpremidpost&ciu_szs=300x250&gdfp_req=1&ad_rule=1&output=vmap&unviewed_position_start=1&env=vp&impl=s&cmsid=496&vid=short_onecue&correlator='; // The AdsLoader instance exposes the request ads method. late final AdsLoader _adsLoader; @@ -87,12 +90,22 @@ class _AdExampleWidgetState extends State { // AdsManager exposes methods to control ad playback and listen to ad events. AdsManager? _adsManager; + // ··· // Whether the widget should be displaying the content video. The content // player is hidden while Ads are playing. - bool _shouldShowContentVideo = true; + bool _shouldShowContentVideo = false; // Controls the content video player. late final VideoPlayerController _contentVideoController; + + // Periodically updates the SDK of the current playback progress of the + // content video. + Timer? _contentProgressTimer; + + // Provides the SDK with the current playback progress of the content video. + // This is required to support mid-roll ads. + final ContentProgressProvider _contentProgressProvider = + ContentProgressProvider(); // ··· @override Widget build(BuildContext context) { @@ -111,6 +124,44 @@ for playing content. ```dart late final AdDisplayContainer _adDisplayContainer = AdDisplayContainer( onContainerAdded: (AdDisplayContainer container) { + _adsLoader = AdsLoader( + container: container, + onAdsLoaded: (OnAdsLoadedData data) { + final AdsManager manager = data.manager; + _adsManager = data.manager; + + manager.setAdsManagerDelegate(AdsManagerDelegate( + onAdEvent: (AdEvent event) { + debugPrint('OnAdEvent: ${event.type} => ${event.adData}'); + switch (event.type) { + case AdEventType.loaded: + manager.start(); + case AdEventType.contentPauseRequested: + _pauseContent(); + case AdEventType.contentResumeRequested: + _resumeContent(); + case AdEventType.allAdsCompleted: + manager.destroy(); + _adsManager = null; + case AdEventType.clicked: + case AdEventType.complete: + case _: + } + }, + onAdErrorEvent: (AdErrorEvent event) { + debugPrint('AdErrorEvent: ${event.error.message}'); + _resumeContent(); + }, + )); + + manager.init(); + }, + onAdsLoadError: (AdsLoadErrorData data) { + debugPrint('OnAdsLoadError: ${data.error.message}'); + _resumeContent(); + }, + ); + // Ads can't be requested until the `AdDisplayContainer` has been added to // the native View hierarchy. _requestAds(container); @@ -120,6 +171,7 @@ late final AdDisplayContainer _adDisplayContainer = AdDisplayContainer( @override void initState() { super.initState(); + // ··· _contentVideoController = VideoPlayerController.networkUrl( Uri.parse( 'https://storage.googleapis.com/gvabox/media/samples/stock.mp4', @@ -128,8 +180,8 @@ void initState() { ..addListener(() { if (_contentVideoController.value.isCompleted) { _adsLoader.contentComplete(); - setState(() {}); } + setState(() {}); }) ..initialize().then((_) { // Ensure the first frame is shown after the video is initialized, even before the play button has been pressed. @@ -195,79 +247,70 @@ Handle requesting ads and add event listeners to handle when content should be d ```dart Future _requestAds(AdDisplayContainer container) { - _adsLoader = AdsLoader( - container: container, - onAdsLoaded: (OnAdsLoadedData data) { - final AdsManager manager = data.manager; - _adsManager = data.manager; - - manager.setAdsManagerDelegate(AdsManagerDelegate( - onAdEvent: (AdEvent event) { - debugPrint('OnAdEvent: ${event.type} => ${event.adData}'); - switch (event.type) { - case AdEventType.loaded: - manager.start(); - case AdEventType.contentPauseRequested: - _pauseContent(); - case AdEventType.contentResumeRequested: - _resumeContent(); - case AdEventType.allAdsCompleted: - manager.destroy(); - _adsManager = null; - case AdEventType.clicked: - case AdEventType.complete: - case _: - } - }, - onAdErrorEvent: (AdErrorEvent event) { - debugPrint('AdErrorEvent: ${event.error.message}'); - _resumeContent(); - }, - )); - - manager.init(); - }, - onAdsLoadError: (AdsLoadErrorData data) { - debugPrint('OnAdsLoadError: ${data.error.message}'); - _resumeContent(); - }, - ); - - return _adsLoader.requestAds(AdsRequest(adTagUrl: _adTagUrl)); + return _adsLoader.requestAds(AdsRequest( + adTagUrl: _adTagUrl, + contentProgressProvider: _contentProgressProvider, + )); } -Future _resumeContent() { +Future _resumeContent() async { setState(() { _shouldShowContentVideo = true; }); - return _contentVideoController.play(); + + if (_adsManager != null) { + _contentProgressTimer = Timer.periodic( + const Duration(milliseconds: 200), + (Timer timer) async { + if (_contentVideoController.value.isInitialized) { + final Duration? progress = await _contentVideoController.position; + if (progress != null) { + await _contentProgressProvider.setProgress( + progress: progress, + duration: _contentVideoController.value.duration, + ); + } + } + }, + ); + } + + await _contentVideoController.play(); } Future _pauseContent() { setState(() { _shouldShowContentVideo = false; }); + _contentProgressTimer?.cancel(); + _contentProgressTimer = null; return _contentVideoController.pause(); } ``` ### 7. Dispose Resources -Dispose the content player and the destroy the [AdsManager][6]. +Dispose the content player and destroy the [AdsManager][6]. ```dart @override void dispose() { super.dispose(); + _contentProgressTimer?.cancel(); _contentVideoController.dispose(); _adsManager?.destroy(); + // ··· } ``` That's it! You're now requesting and displaying ads with the IMA SDK. To learn about additional SDK features, see the [API reference](https://pub.dev/documentation/interactive_media_ads/latest/). +## Contributing + +For information on contributing to this plugin, see [`CONTRIBUTING.md`](CONTRIBUTING.md). + [1]: https://developers.google.com/interactive-media-ads [2]: https://www.iab.com/guidelines/vast/ [3]: https://pub.dev/documentation/interactive_media_ads/latest/interactive_media_ads/AdDisplayContainer-class.html diff --git a/packages/interactive_media_ads/android/build.gradle b/packages/interactive_media_ads/android/build.gradle index 5e134fd8a45b..9c57c1ff7cec 100644 --- a/packages/interactive_media_ads/android/build.gradle +++ b/packages/interactive_media_ads/android/build.gradle @@ -25,19 +25,17 @@ apply plugin: 'com.android.library' apply plugin: 'kotlin-android' android { - if (project.android.hasProperty("namespace")) { - namespace 'dev.flutter.packages.interactive_media_ads' - } + namespace 'dev.flutter.packages.interactive_media_ads' compileSdk 34 compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_11 + targetCompatibility JavaVersion.VERSION_11 } kotlinOptions { - jvmTarget = '1.8' + jvmTarget = '11' } sourceSets { @@ -50,17 +48,13 @@ android { } dependencies { - implementation 'androidx.annotation:annotation:1.8.1' - implementation 'com.google.ads.interactivemedia.v3:interactivemedia:3.34.0' + implementation 'androidx.annotation:annotation:1.8.2' + implementation 'com.google.ads.interactivemedia.v3:interactivemedia:3.35.1' testImplementation 'junit:junit:4.13.2' testImplementation 'org.jetbrains.kotlin:kotlin-test' testImplementation "org.mockito.kotlin:mockito-kotlin:4.1.0" testImplementation 'org.mockito:mockito-inline:5.1.0' testImplementation 'androidx.test:core:1.3.0' - - // org.jetbrains.kotlin:kotlin-bom artifact purpose is to align kotlin stdlib and related code versions. - // See: https://youtrack.jetbrains.com/issue/KT-55297/kotlin-stdlib-should-declare-constraints-on-kotlin-stdlib-jdk8-and-kotlin-stdlib-jdk7 - implementation(platform("org.jetbrains.kotlin:kotlin-bom:1.8.10")) } lintOptions { diff --git a/packages/interactive_media_ads/android/src/main/kotlin/dev/flutter/packages/interactive_media_ads/AdProgressInfoProxyApi.kt b/packages/interactive_media_ads/android/src/main/kotlin/dev/flutter/packages/interactive_media_ads/AdProgressInfoProxyApi.kt new file mode 100644 index 000000000000..51fbf0c54e40 --- /dev/null +++ b/packages/interactive_media_ads/android/src/main/kotlin/dev/flutter/packages/interactive_media_ads/AdProgressInfoProxyApi.kt @@ -0,0 +1,41 @@ +// 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. + +package dev.flutter.packages.interactive_media_ads + +import com.google.ads.interactivemedia.v3.api.AdProgressInfo + +/** + * ProxyApi implementation for [AdProgressInfo]. + * + *

This class may handle instantiating native object instances that are attached to a Dart + * instance or handle method calls on the associated native class or an instance of that class. + */ +class AdProgressInfoProxyApi(override val pigeonRegistrar: ProxyApiRegistrar) : + PigeonApiAdProgressInfo(pigeonRegistrar) { + + override fun adBreakDuration(pigeon_instance: AdProgressInfo): Double { + return pigeon_instance.adBreakDuration + } + + override fun adPeriodDuration(pigeon_instance: AdProgressInfo): Double { + return pigeon_instance.adPeriodDuration + } + + override fun adPosition(pigeon_instance: AdProgressInfo): Long { + return pigeon_instance.adPosition.toLong() + } + + override fun currentTime(pigeon_instance: AdProgressInfo): Double { + return pigeon_instance.currentTime + } + + override fun duration(pigeon_instance: AdProgressInfo): Double { + return pigeon_instance.duration + } + + override fun totalAds(pigeon_instance: AdProgressInfo): Long { + return pigeon_instance.totalAds.toLong() + } +} diff --git a/packages/interactive_media_ads/android/src/main/kotlin/dev/flutter/packages/interactive_media_ads/AdProxyApi.kt b/packages/interactive_media_ads/android/src/main/kotlin/dev/flutter/packages/interactive_media_ads/AdProxyApi.kt new file mode 100644 index 000000000000..11c77bce8750 --- /dev/null +++ b/packages/interactive_media_ads/android/src/main/kotlin/dev/flutter/packages/interactive_media_ads/AdProxyApi.kt @@ -0,0 +1,132 @@ +// 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. + +package dev.flutter.packages.interactive_media_ads + +import com.google.ads.interactivemedia.v3.api.Ad +import com.google.ads.interactivemedia.v3.api.AdPodInfo +import com.google.ads.interactivemedia.v3.api.CompanionAd +import com.google.ads.interactivemedia.v3.api.UniversalAdId + +/** + * ProxyApi implementation for [Ad]. + * + *

This class may handle instantiating native object instances that are attached to a Dart + * instance or handle method calls on the associated native class or an instance of that class. + */ +class AdProxyApi(override val pigeonRegistrar: ProxyApiRegistrar) : PigeonApiAd(pigeonRegistrar) { + override fun adId(pigeon_instance: Ad): String { + return pigeon_instance.adId + } + + override fun adPodInfo(pigeon_instance: Ad): AdPodInfo { + return pigeon_instance.adPodInfo + } + + override fun adSystem(pigeon_instance: Ad): String { + return pigeon_instance.adSystem + } + + override fun adWrapperCreativeIds(pigeon_instance: Ad): List { + return pigeon_instance.adWrapperCreativeIds.asList() + } + + override fun adWrapperIds(pigeon_instance: Ad): List { + return pigeon_instance.adWrapperIds.asList() + } + + override fun adWrapperSystems(pigeon_instance: Ad): List { + return pigeon_instance.adWrapperSystems.asList() + } + + override fun advertiserName(pigeon_instance: Ad): String { + return pigeon_instance.advertiserName + } + + override fun companionAds(pigeon_instance: Ad): List { + return pigeon_instance.companionAds + } + + override fun contentType(pigeon_instance: Ad): String? { + return pigeon_instance.contentType + } + + override fun creativeAdId(pigeon_instance: Ad): String { + return pigeon_instance.creativeAdId + } + + override fun creativeId(pigeon_instance: Ad): String { + return pigeon_instance.creativeId + } + + override fun dealId(pigeon_instance: Ad): String { + return pigeon_instance.dealId + } + + override fun description(pigeon_instance: Ad): String? { + return pigeon_instance.description + } + + override fun duration(pigeon_instance: Ad): Double { + return pigeon_instance.duration + } + + override fun height(pigeon_instance: Ad): Long { + return pigeon_instance.height.toLong() + } + + override fun skipTimeOffset(pigeon_instance: Ad): Double { + return pigeon_instance.skipTimeOffset + } + + override fun surveyUrl(pigeon_instance: Ad): String? { + return pigeon_instance.surveyUrl + } + + override fun title(pigeon_instance: Ad): String? { + return pigeon_instance.title + } + + override fun traffickingParameters(pigeon_instance: Ad): String { + return pigeon_instance.traffickingParameters + } + + override fun uiElements(pigeon_instance: Ad): List { + return pigeon_instance.uiElements.map { + when (it) { + com.google.ads.interactivemedia.v3.api.UiElement.AD_ATTRIBUTION -> UiElement.AD_ATTRIBUTION + com.google.ads.interactivemedia.v3.api.UiElement.COUNTDOWN -> UiElement.COUNTDOWN + else -> UiElement.UNKNOWN + } + } + } + + override fun universalAdIds(pigeon_instance: Ad): List { + return pigeon_instance.universalAdIds.toList() + } + + override fun vastMediaBitrate(pigeon_instance: Ad): Long { + return pigeon_instance.vastMediaBitrate.toLong() + } + + override fun vastMediaHeight(pigeon_instance: Ad): Long { + return pigeon_instance.vastMediaHeight.toLong() + } + + override fun vastMediaWidth(pigeon_instance: Ad): Long { + return pigeon_instance.vastMediaWidth.toLong() + } + + override fun width(pigeon_instance: Ad): Long { + return pigeon_instance.width.toLong() + } + + override fun isLinear(pigeon_instance: Ad): Boolean { + return pigeon_instance.isLinear + } + + override fun isSkippable(pigeon_instance: Ad): Boolean { + return pigeon_instance.isSkippable + } +} diff --git a/packages/interactive_media_ads/android/src/main/kotlin/dev/flutter/packages/interactive_media_ads/AdsManagerProxyApi.kt b/packages/interactive_media_ads/android/src/main/kotlin/dev/flutter/packages/interactive_media_ads/AdsManagerProxyApi.kt index 022a81417e2a..11d7250c88c1 100644 --- a/packages/interactive_media_ads/android/src/main/kotlin/dev/flutter/packages/interactive_media_ads/AdsManagerProxyApi.kt +++ b/packages/interactive_media_ads/android/src/main/kotlin/dev/flutter/packages/interactive_media_ads/AdsManagerProxyApi.kt @@ -25,4 +25,16 @@ class AdsManagerProxyApi(override val pigeonRegistrar: ProxyApiRegistrar) : override fun start(pigeon_instance: AdsManager) { pigeon_instance.start() } + + override fun getAdCuePoints(pigeon_instance: AdsManager): List { + return pigeon_instance.adCuePoints.map { it.toDouble() } + } + + override fun resume(pigeon_instance: AdsManager) { + pigeon_instance.resume() + } + + override fun skip(pigeon_instance: AdsManager) { + pigeon_instance.skip() + } } diff --git a/packages/interactive_media_ads/android/src/main/kotlin/dev/flutter/packages/interactive_media_ads/AdsRenderingSettingsProxyApi.kt b/packages/interactive_media_ads/android/src/main/kotlin/dev/flutter/packages/interactive_media_ads/AdsRenderingSettingsProxyApi.kt new file mode 100644 index 000000000000..d924ad43f783 --- /dev/null +++ b/packages/interactive_media_ads/android/src/main/kotlin/dev/flutter/packages/interactive_media_ads/AdsRenderingSettingsProxyApi.kt @@ -0,0 +1,91 @@ +// 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. + +package dev.flutter.packages.interactive_media_ads + +import com.google.ads.interactivemedia.v3.api.AdsRenderingSettings +import com.google.ads.interactivemedia.v3.api.UiElement + +/** + * ProxyApi implementation for [AdsRenderingSettings]. + * + *

This class may handle instantiating native object instances that are attached to a Dart + * instance or handle method calls on the associated native class or an instance of that class. + */ +class AdsRenderingSettingsProxyApi(override val pigeonRegistrar: ProxyApiRegistrar) : + PigeonApiAdsRenderingSettings(pigeonRegistrar) { + override fun getBitrateKbps(pigeon_instance: AdsRenderingSettings): Long { + return pigeon_instance.bitrateKbps.toLong() + } + + override fun getEnableCustomTabs(pigeon_instance: AdsRenderingSettings): Boolean { + return pigeon_instance.enableCustomTabs + } + + override fun getEnablePreloading(pigeon_instance: AdsRenderingSettings): Boolean { + return pigeon_instance.enablePreloading + } + + override fun getFocusSkipButtonWhenAvailable(pigeon_instance: AdsRenderingSettings): Boolean { + return pigeon_instance.focusSkipButtonWhenAvailable + } + + override fun getMimeTypes(pigeon_instance: AdsRenderingSettings): List { + return pigeon_instance.mimeTypes + } + + override fun setBitrateKbps(pigeon_instance: AdsRenderingSettings, bitrate: Long) { + pigeon_instance.bitrateKbps = bitrate.toInt() + } + + override fun setEnableCustomTabs( + pigeon_instance: AdsRenderingSettings, + enableCustomTabs: Boolean + ) { + pigeon_instance.enableCustomTabs = enableCustomTabs + } + + override fun setEnablePreloading( + pigeon_instance: AdsRenderingSettings, + enablePreloading: Boolean + ) { + pigeon_instance.enablePreloading = enablePreloading + } + + override fun setFocusSkipButtonWhenAvailable( + pigeon_instance: AdsRenderingSettings, + enableFocusSkipButton: Boolean + ) { + pigeon_instance.focusSkipButtonWhenAvailable = enableFocusSkipButton + } + + override fun setLoadVideoTimeout(pigeon_instance: AdsRenderingSettings, loadVideoTimeout: Long) { + pigeon_instance.setLoadVideoTimeout(loadVideoTimeout.toInt()) + } + + override fun setMimeTypes(pigeon_instance: AdsRenderingSettings, mimeTypes: List) { + pigeon_instance.mimeTypes = mimeTypes + } + + override fun setPlayAdsAfterTime(pigeon_instance: AdsRenderingSettings, time: Double) { + pigeon_instance.setPlayAdsAfterTime(time) + } + + override fun setUiElements( + pigeon_instance: AdsRenderingSettings, + uiElements: List + ) { + val nativeUiElements = + uiElements.map { + when (it) { + dev.flutter.packages.interactive_media_ads.UiElement.AD_ATTRIBUTION -> + UiElement.AD_ATTRIBUTION + dev.flutter.packages.interactive_media_ads.UiElement.COUNTDOWN -> UiElement.COUNTDOWN + dev.flutter.packages.interactive_media_ads.UiElement.UNKNOWN -> + throw UnsupportedOperationException("$it is not supported.") + } + } + pigeon_instance.setUiElements(nativeUiElements.toSet()) + } +} diff --git a/packages/interactive_media_ads/android/src/main/kotlin/dev/flutter/packages/interactive_media_ads/AdsRequestProxyApi.kt b/packages/interactive_media_ads/android/src/main/kotlin/dev/flutter/packages/interactive_media_ads/AdsRequestProxyApi.kt index 295adef3dcbc..469848956ca2 100644 --- a/packages/interactive_media_ads/android/src/main/kotlin/dev/flutter/packages/interactive_media_ads/AdsRequestProxyApi.kt +++ b/packages/interactive_media_ads/android/src/main/kotlin/dev/flutter/packages/interactive_media_ads/AdsRequestProxyApi.kt @@ -21,7 +21,7 @@ class AdsRequestProxyApi(override val pigeonRegistrar: ProxyApiRegistrar) : * * This must match the version in pubspec.yaml. */ - const val pluginVersion = "0.1.2" + const val pluginVersion = "0.2.2+13" } override fun setAdTagUrl(pigeon_instance: AdsRequest, adTagUrl: String) { diff --git a/packages/interactive_media_ads/android/src/main/kotlin/dev/flutter/packages/interactive_media_ads/CompanionAdProxyApi.kt b/packages/interactive_media_ads/android/src/main/kotlin/dev/flutter/packages/interactive_media_ads/CompanionAdProxyApi.kt new file mode 100644 index 000000000000..06b805c840f5 --- /dev/null +++ b/packages/interactive_media_ads/android/src/main/kotlin/dev/flutter/packages/interactive_media_ads/CompanionAdProxyApi.kt @@ -0,0 +1,32 @@ +// 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. + +package dev.flutter.packages.interactive_media_ads + +import com.google.ads.interactivemedia.v3.api.CompanionAd + +/** + * ProxyApi implementation for [CompanionAd]. + * + *

This class may handle instantiating native object instances that are attached to a Dart + * instance or handle method calls on the associated native class or an instance of that class. + */ +class CompanionAdProxyApi(override val pigeonRegistrar: ProxyApiRegistrar) : + PigeonApiCompanionAd(pigeonRegistrar) { + override fun apiFramework(pigeon_instance: CompanionAd): String? { + return pigeon_instance.apiFramework + } + + override fun height(pigeon_instance: CompanionAd): Long { + return pigeon_instance.height.toLong() + } + + override fun resourceValue(pigeon_instance: CompanionAd): String { + return pigeon_instance.resourceValue + } + + override fun width(pigeon_instance: CompanionAd): Long { + return pigeon_instance.width.toLong() + } +} diff --git a/packages/interactive_media_ads/android/src/main/kotlin/dev/flutter/packages/interactive_media_ads/ContentProgressProviderProxyApi.kt b/packages/interactive_media_ads/android/src/main/kotlin/dev/flutter/packages/interactive_media_ads/ContentProgressProviderProxyApi.kt index 0fa1308d1383..de942c05aa3c 100644 --- a/packages/interactive_media_ads/android/src/main/kotlin/dev/flutter/packages/interactive_media_ads/ContentProgressProviderProxyApi.kt +++ b/packages/interactive_media_ads/android/src/main/kotlin/dev/flutter/packages/interactive_media_ads/ContentProgressProviderProxyApi.kt @@ -4,12 +4,34 @@ package dev.flutter.packages.interactive_media_ads +import com.google.ads.interactivemedia.v3.api.player.ContentProgressProvider +import com.google.ads.interactivemedia.v3.api.player.VideoProgressUpdate + /** - * ProxyApi implementation for - * [com.google.ads.interactivemedia.v3.api.player.ContentProgressProvider]. + * ProxyApi implementation for [ContentProgressProvider]. * *

This class may handle instantiating native object instances that are attached to a Dart * instance or handle method calls on the associated native class or an instance of that class. */ class ContentProgressProviderProxyApi(override val pigeonRegistrar: ProxyApiRegistrar) : - PigeonApiContentProgressProvider(pigeonRegistrar) + PigeonApiContentProgressProvider(pigeonRegistrar) { + internal class ContentProgressProviderImpl(val api: ContentProgressProviderProxyApi) : + ContentProgressProvider { + var currentProgress = VideoProgressUpdate.VIDEO_TIME_NOT_READY + + override fun getContentProgress(): VideoProgressUpdate { + return currentProgress + } + } + + override fun pigeon_defaultConstructor(): ContentProgressProvider { + return ContentProgressProviderImpl(this) + } + + override fun setContentProgress( + pigeon_instance: ContentProgressProvider, + update: VideoProgressUpdate + ) { + (pigeon_instance as ContentProgressProviderImpl).currentProgress = update + } +} diff --git a/packages/interactive_media_ads/android/src/main/kotlin/dev/flutter/packages/interactive_media_ads/InteractiveMediaAdsLibrary.g.kt b/packages/interactive_media_ads/android/src/main/kotlin/dev/flutter/packages/interactive_media_ads/InteractiveMediaAdsLibrary.g.kt index b88f1ba596cf..5547ada0db20 100644 --- a/packages/interactive_media_ads/android/src/main/kotlin/dev/flutter/packages/interactive_media_ads/InteractiveMediaAdsLibrary.g.kt +++ b/packages/interactive_media_ads/android/src/main/kotlin/dev/flutter/packages/interactive_media_ads/InteractiveMediaAdsLibrary.g.kt @@ -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 (v21.2.0), do not edit directly. +// Autogenerated from Pigeon (v22.5.0), do not edit directly. // See also: https://pub.dev/packages/pigeon @file:Suppress("UNCHECKED_CAST", "ArrayInDataClass", "SyntheticAccessor") @@ -258,13 +258,13 @@ class InteractiveMediaAdsLibraryPigeonInstanceManager( } } -/** Generated API for managing the Dart and native `PigeonInstanceManager`s. */ +/** Generated API for managing the Dart and native `InstanceManager`s. */ private class InteractiveMediaAdsLibraryPigeonInstanceManagerApi( val binaryMessenger: BinaryMessenger ) { companion object { /** The codec used by InteractiveMediaAdsLibraryPigeonInstanceManagerApi. */ - val codec: MessageCodec by lazy { StandardMessageCodec() } + val codec: MessageCodec by lazy { InteractiveMediaAdsLibraryPigeonCodec() } /** * Sets up an instance of `InteractiveMediaAdsLibraryPigeonInstanceManagerApi` to handle @@ -278,12 +278,12 @@ private class InteractiveMediaAdsLibraryPigeonInstanceManagerApi( val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.interactive_media_ads.PigeonInstanceManagerApi.removeStrongReference", + "dev.flutter.pigeon.interactive_media_ads.PigeonInternalInstanceManager.removeStrongReference", codec) if (instanceManager != null) { channel.setMessageHandler { message, reply -> val args = message as List - val identifierArg = args[0].let { num -> if (num is Int) num.toLong() else num as Long } + val identifierArg = args[0] as Long val wrapped: List = try { instanceManager.remove(identifierArg) @@ -301,7 +301,7 @@ private class InteractiveMediaAdsLibraryPigeonInstanceManagerApi( val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.interactive_media_ads.PigeonInstanceManagerApi.clear", + "dev.flutter.pigeon.interactive_media_ads.PigeonInternalInstanceManager.clear", codec) if (instanceManager != null) { channel.setMessageHandler { _, reply -> @@ -323,7 +323,7 @@ private class InteractiveMediaAdsLibraryPigeonInstanceManagerApi( fun removeStrongReference(identifierArg: Long, callback: (Result) -> Unit) { val channelName = - "dev.flutter.pigeon.interactive_media_ads.PigeonInstanceManagerApi.removeStrongReference" + "dev.flutter.pigeon.interactive_media_ads.PigeonInternalInstanceManager.removeStrongReference" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(identifierArg)) { if (it is List<*>) { @@ -348,8 +348,8 @@ abstract class InteractiveMediaAdsLibraryPigeonProxyApiRegistrar( /** Whether APIs should ignore calling to Dart. */ public var ignoreCallsToDart = false val instanceManager: InteractiveMediaAdsLibraryPigeonInstanceManager - private var _codec: StandardMessageCodec? = null - val codec: StandardMessageCodec + private var _codec: MessageCodec? = null + val codec: MessageCodec get() { if (_codec == null) { _codec = InteractiveMediaAdsLibraryPigeonProxyApiBaseCodec(this) @@ -423,9 +423,7 @@ abstract class InteractiveMediaAdsLibraryPigeonProxyApiRegistrar( * An implementation of [PigeonApiContentProgressProvider] used to add a new Dart instance of * `ContentProgressProvider` to the Dart `InstanceManager`. */ - open fun getPigeonApiContentProgressProvider(): PigeonApiContentProgressProvider { - return PigeonApiContentProgressProvider(this) - } + abstract fun getPigeonApiContentProgressProvider(): PigeonApiContentProgressProvider /** * An implementation of [PigeonApiAdsManager] used to add a new Dart instance of `AdsManager` to @@ -539,11 +537,43 @@ abstract class InteractiveMediaAdsLibraryPigeonProxyApiRegistrar( */ abstract fun getPigeonApiAdEventListener(): PigeonApiAdEventListener + /** + * An implementation of [PigeonApiAdsRenderingSettings] used to add a new Dart instance of + * `AdsRenderingSettings` to the Dart `InstanceManager`. + */ + abstract fun getPigeonApiAdsRenderingSettings(): PigeonApiAdsRenderingSettings + + /** + * An implementation of [PigeonApiAdProgressInfo] used to add a new Dart instance of + * `AdProgressInfo` to the Dart `InstanceManager`. + */ + abstract fun getPigeonApiAdProgressInfo(): PigeonApiAdProgressInfo + + /** + * An implementation of [PigeonApiCompanionAd] used to add a new Dart instance of `CompanionAd` to + * the Dart `InstanceManager`. + */ + abstract fun getPigeonApiCompanionAd(): PigeonApiCompanionAd + + /** + * An implementation of [PigeonApiUniversalAdId] used to add a new Dart instance of + * `UniversalAdId` to the Dart `InstanceManager`. + */ + abstract fun getPigeonApiUniversalAdId(): PigeonApiUniversalAdId + + /** + * An implementation of [PigeonApiAd] used to add a new Dart instance of `Ad` to the Dart + * `InstanceManager`. + */ + abstract fun getPigeonApiAd(): PigeonApiAd + fun setUp() { InteractiveMediaAdsLibraryPigeonInstanceManagerApi.setUpMessageHandlers( binaryMessenger, instanceManager) PigeonApiAdsLoader.setUpMessageHandlers(binaryMessenger, getPigeonApiAdsLoader()) PigeonApiAdsRequest.setUpMessageHandlers(binaryMessenger, getPigeonApiAdsRequest()) + PigeonApiContentProgressProvider.setUpMessageHandlers( + binaryMessenger, getPigeonApiContentProgressProvider()) PigeonApiAdsManager.setUpMessageHandlers(binaryMessenger, getPigeonApiAdsManager()) PigeonApiBaseManager.setUpMessageHandlers(binaryMessenger, getPigeonApiBaseManager()) PigeonApiImaSdkFactory.setUpMessageHandlers(binaryMessenger, getPigeonApiImaSdkFactory()) @@ -560,12 +590,15 @@ abstract class InteractiveMediaAdsLibraryPigeonProxyApiRegistrar( binaryMessenger, getPigeonApiAdsLoadedListener()) PigeonApiAdErrorListener.setUpMessageHandlers(binaryMessenger, getPigeonApiAdErrorListener()) PigeonApiAdEventListener.setUpMessageHandlers(binaryMessenger, getPigeonApiAdEventListener()) + PigeonApiAdsRenderingSettings.setUpMessageHandlers( + binaryMessenger, getPigeonApiAdsRenderingSettings()) } fun tearDown() { InteractiveMediaAdsLibraryPigeonInstanceManagerApi.setUpMessageHandlers(binaryMessenger, null) PigeonApiAdsLoader.setUpMessageHandlers(binaryMessenger, null) PigeonApiAdsRequest.setUpMessageHandlers(binaryMessenger, null) + PigeonApiContentProgressProvider.setUpMessageHandlers(binaryMessenger, null) PigeonApiAdsManager.setUpMessageHandlers(binaryMessenger, null) PigeonApiBaseManager.setUpMessageHandlers(binaryMessenger, null) PigeonApiImaSdkFactory.setUpMessageHandlers(binaryMessenger, null) @@ -579,6 +612,7 @@ abstract class InteractiveMediaAdsLibraryPigeonProxyApiRegistrar( PigeonApiAdsLoadedListener.setUpMessageHandlers(binaryMessenger, null) PigeonApiAdErrorListener.setUpMessageHandlers(binaryMessenger, null) PigeonApiAdEventListener.setUpMessageHandlers(binaryMessenger, null) + PigeonApiAdsRenderingSettings.setUpMessageHandlers(binaryMessenger, null) } } @@ -588,8 +622,7 @@ private class InteractiveMediaAdsLibraryPigeonProxyApiBaseCodec( override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { return when (type) { 128.toByte() -> { - return registrar.instanceManager.getInstance( - readValue(buffer).let { if (it is Int) it.toLong() else it as Long }) + return registrar.instanceManager.getInstance(readValue(buffer) as Long) } else -> super.readValueOfType(type, buffer) } @@ -611,6 +644,7 @@ private class InteractiveMediaAdsLibraryPigeonProxyApiBaseCodec( value is AdErrorCode || value is AdErrorType || value is AdEventType || + value is UiElement || value == null) { super.writeValue(stream, value) return @@ -669,6 +703,16 @@ private class InteractiveMediaAdsLibraryPigeonProxyApiBaseCodec( registrar.getPigeonApiAdErrorListener().pigeon_newInstance(value) {} } else if (value is com.google.ads.interactivemedia.v3.api.AdEvent.AdEventListener) { registrar.getPigeonApiAdEventListener().pigeon_newInstance(value) {} + } else if (value is com.google.ads.interactivemedia.v3.api.AdsRenderingSettings) { + registrar.getPigeonApiAdsRenderingSettings().pigeon_newInstance(value) {} + } else if (value is com.google.ads.interactivemedia.v3.api.AdProgressInfo) { + registrar.getPigeonApiAdProgressInfo().pigeon_newInstance(value) {} + } else if (value is com.google.ads.interactivemedia.v3.api.CompanionAd) { + registrar.getPigeonApiCompanionAd().pigeon_newInstance(value) {} + } else if (value is com.google.ads.interactivemedia.v3.api.UniversalAdId) { + registrar.getPigeonApiUniversalAdId().pigeon_newInstance(value) {} + } else if (value is com.google.ads.interactivemedia.v3.api.Ad) { + registrar.getPigeonApiAd().pigeon_newInstance(value) {} } when { @@ -854,17 +898,41 @@ enum class AdEventType(val raw: Int) { } } +/** + * Describes an element of the ad UI, to be requested or rendered by the SDK. + * + * See + * https://developers.google.com/interactive-media-ads/docs/sdks/android/client-side/api/reference/com/google/ads/interactivemedia/v3/api/UiElement.html. + */ +enum class UiElement(val raw: Int) { + /** The ad attribution UI element, for example, "Ad". */ + AD_ATTRIBUTION(0), + /** Ad attribution is required for a countdown timer to be displayed. */ + COUNTDOWN(1), + /** The element is not recognized by this wrapper. */ + UNKNOWN(2); + + companion object { + fun ofRaw(raw: Int): UiElement? { + return values().firstOrNull { it.raw == raw } + } + } +} + private open class InteractiveMediaAdsLibraryPigeonCodec : StandardMessageCodec() { override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { return when (type) { 129.toByte() -> { - return (readValue(buffer) as Int?)?.let { AdErrorCode.ofRaw(it) } + return (readValue(buffer) as Long?)?.let { AdErrorCode.ofRaw(it.toInt()) } } 130.toByte() -> { - return (readValue(buffer) as Int?)?.let { AdErrorType.ofRaw(it) } + return (readValue(buffer) as Long?)?.let { AdErrorType.ofRaw(it.toInt()) } } 131.toByte() -> { - return (readValue(buffer) as Int?)?.let { AdEventType.ofRaw(it) } + return (readValue(buffer) as Long?)?.let { AdEventType.ofRaw(it.toInt()) } + } + 132.toByte() -> { + return (readValue(buffer) as Long?)?.let { UiElement.ofRaw(it.toInt()) } } else -> super.readValueOfType(type, buffer) } @@ -884,6 +952,10 @@ private open class InteractiveMediaAdsLibraryPigeonCodec : StandardMessageCodec( stream.write(131) writeValue(stream, value.raw) } + is UiElement -> { + stream.write(132) + writeValue(stream, value.raw) + } else -> super.writeValue(stream, value) } } @@ -1019,7 +1091,7 @@ abstract class PigeonApiAdsLoader( companion object { @Suppress("LocalVariableName") fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiAdsLoader?) { - val codec = api?.pigeonRegistrar?.codec ?: StandardMessageCodec() + val codec = api?.pigeonRegistrar?.codec ?: InteractiveMediaAdsLibraryPigeonCodec() run { val channel = BasicMessageChannel( @@ -1335,7 +1407,7 @@ abstract class PigeonApiAdsRequest( companion object { @Suppress("LocalVariableName") fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiAdsRequest?) { - val codec = api?.pigeonRegistrar?.codec ?: StandardMessageCodec() + val codec = api?.pigeonRegistrar?.codec ?: InteractiveMediaAdsLibraryPigeonCodec() run { val channel = BasicMessageChannel( @@ -1430,9 +1502,83 @@ abstract class PigeonApiAdsRequest( * https://developers.google.com/ad-manager/dynamic-ad-insertion/sdk/android/api/reference/com/google/ads/interactivemedia/v3/api/player/ContentProgressProvider.html. */ @Suppress("UNCHECKED_CAST") -open class PigeonApiContentProgressProvider( +abstract class PigeonApiContentProgressProvider( open val pigeonRegistrar: InteractiveMediaAdsLibraryPigeonProxyApiRegistrar ) { + abstract fun pigeon_defaultConstructor(): + com.google.ads.interactivemedia.v3.api.player.ContentProgressProvider + + /** + * Sets an update on the progress of the video. + * + * This is a custom method added to the native class because the native method + * `getContentProgress` requires a synchronous return value. + */ + abstract fun setContentProgress( + pigeon_instance: com.google.ads.interactivemedia.v3.api.player.ContentProgressProvider, + update: com.google.ads.interactivemedia.v3.api.player.VideoProgressUpdate + ) + + companion object { + @Suppress("LocalVariableName") + fun setUpMessageHandlers( + binaryMessenger: BinaryMessenger, + api: PigeonApiContentProgressProvider? + ) { + val codec = api?.pigeonRegistrar?.codec ?: InteractiveMediaAdsLibraryPigeonCodec() + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.interactive_media_ads.ContentProgressProvider.pigeon_defaultConstructor", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_identifierArg = args[0] as Long + val wrapped: List = + try { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + api.pigeon_defaultConstructor(), pigeon_identifierArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.interactive_media_ads.ContentProgressProvider.setContentProgress", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = + args[0] as com.google.ads.interactivemedia.v3.api.player.ContentProgressProvider + val updateArg = + args[1] as com.google.ads.interactivemedia.v3.api.player.VideoProgressUpdate + val wrapped: List = + try { + api.setContentProgress(pigeon_instanceArg, updateArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + } + } + @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of ContentProgressProvider and attaches it to [pigeon_instanceArg]. */ fun pigeon_newInstance( @@ -1488,10 +1634,29 @@ abstract class PigeonApiAdsManager( /** Starts playing the ads. */ abstract fun start(pigeon_instance: com.google.ads.interactivemedia.v3.api.AdsManager) + /** + * List of content time offsets in seconds at which ad breaks are scheduled. + * + * The list will be empty if no ad breaks are scheduled. + */ + abstract fun getAdCuePoints( + pigeon_instance: com.google.ads.interactivemedia.v3.api.AdsManager + ): List + + /** Resumes the current ad. */ + abstract fun resume(pigeon_instance: com.google.ads.interactivemedia.v3.api.AdsManager) + + /** + * Skips the current ad. + * + * `AdsManager.skip()` only skips ads if IMA does not render the 'Skip ad' button. + */ + abstract fun skip(pigeon_instance: com.google.ads.interactivemedia.v3.api.AdsManager) + companion object { @Suppress("LocalVariableName") fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiAdsManager?) { - val codec = api?.pigeonRegistrar?.codec ?: StandardMessageCodec() + val codec = api?.pigeonRegistrar?.codec ?: InteractiveMediaAdsLibraryPigeonCodec() run { val channel = BasicMessageChannel( @@ -1557,6 +1722,72 @@ abstract class PigeonApiAdsManager( channel.setMessageHandler(null) } } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.interactive_media_ads.AdsManager.getAdCuePoints", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as com.google.ads.interactivemedia.v3.api.AdsManager + val wrapped: List = + try { + listOf(api.getAdCuePoints(pigeon_instanceArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.interactive_media_ads.AdsManager.resume", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as com.google.ads.interactivemedia.v3.api.AdsManager + val wrapped: List = + try { + api.resume(pigeon_instanceArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, "dev.flutter.pigeon.interactive_media_ads.AdsManager.skip", codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as com.google.ads.interactivemedia.v3.api.AdsManager + val wrapped: List = + try { + api.skip(pigeon_instanceArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } } } @@ -1636,7 +1867,7 @@ abstract class PigeonApiBaseManager( companion object { @Suppress("LocalVariableName") fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiBaseManager?) { - val codec = api?.pigeonRegistrar?.codec ?: StandardMessageCodec() + val codec = api?.pigeonRegistrar?.codec ?: InteractiveMediaAdsLibraryPigeonCodec() run { val channel = BasicMessageChannel( @@ -1861,7 +2092,7 @@ abstract class PigeonApiImaSdkFactory( companion object { @Suppress("LocalVariableName") fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiImaSdkFactory?) { - val codec = api?.pigeonRegistrar?.codec ?: StandardMessageCodec() + val codec = api?.pigeonRegistrar?.codec ?: InteractiveMediaAdsLibraryPigeonCodec() run { val channel = BasicMessageChannel( @@ -1871,8 +2102,7 @@ abstract class PigeonApiImaSdkFactory( if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val pigeon_identifierArg = - args[0].let { num -> if (num is Int) num.toLong() else num as Long } + val pigeon_identifierArg = args[0] as Long val wrapped: List = try { api.pigeonRegistrar.instanceManager.addDartCreatedInstance( @@ -2083,7 +2313,7 @@ abstract class PigeonApiVideoProgressUpdate( companion object { @Suppress("LocalVariableName") fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiVideoProgressUpdate?) { - val codec = api?.pigeonRegistrar?.codec ?: StandardMessageCodec() + val codec = api?.pigeonRegistrar?.codec ?: InteractiveMediaAdsLibraryPigeonCodec() run { val channel = BasicMessageChannel( @@ -2093,11 +2323,9 @@ abstract class PigeonApiVideoProgressUpdate( if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val pigeon_identifierArg = - args[0].let { num -> if (num is Int) num.toLong() else num as Long } - val currentTimeMsArg = - args[1].let { num -> if (num is Int) num.toLong() else num as Long } - val durationMsArg = args[2].let { num -> if (num is Int) num.toLong() else num as Long } + val pigeon_identifierArg = args[0] as Long + val currentTimeMsArg = args[1] as Long + val durationMsArg = args[2] as Long val wrapped: List = try { api.pigeonRegistrar.instanceManager.addDartCreatedInstance( @@ -2122,8 +2350,7 @@ abstract class PigeonApiVideoProgressUpdate( if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val pigeon_identifierArg = - args[0].let { num -> if (num is Int) num.toLong() else num as Long } + val pigeon_identifierArg = args[0] as Long val wrapped: List = try { api.pigeonRegistrar.instanceManager.addDartCreatedInstance( @@ -2336,7 +2563,7 @@ abstract class PigeonApiFrameLayout( companion object { @Suppress("LocalVariableName") fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiFrameLayout?) { - val codec = api?.pigeonRegistrar?.codec ?: StandardMessageCodec() + val codec = api?.pigeonRegistrar?.codec ?: InteractiveMediaAdsLibraryPigeonCodec() run { val channel = BasicMessageChannel( @@ -2346,8 +2573,7 @@ abstract class PigeonApiFrameLayout( if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val pigeon_identifierArg = - args[0].let { num -> if (num is Int) num.toLong() else num as Long } + val pigeon_identifierArg = args[0] as Long val wrapped: List = try { api.pigeonRegistrar.instanceManager.addDartCreatedInstance( @@ -2415,12 +2641,19 @@ abstract class PigeonApiFrameLayout( abstract class PigeonApiViewGroup( open val pigeonRegistrar: InteractiveMediaAdsLibraryPigeonProxyApiRegistrar ) { + /** Adds a child view. */ abstract fun addView(pigeon_instance: android.view.ViewGroup, view: android.view.View) + /** + * Called by a ViewGroup subclass to remove child views from itself, when it must first know its + * size on screen before it can calculate how many child views it will render. + */ + abstract fun removeView(pigeon_instance: android.view.ViewGroup, view: android.view.View) + companion object { @Suppress("LocalVariableName") fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiViewGroup?) { - val codec = api?.pigeonRegistrar?.codec ?: StandardMessageCodec() + val codec = api?.pigeonRegistrar?.codec ?: InteractiveMediaAdsLibraryPigeonCodec() run { val channel = BasicMessageChannel( @@ -2445,6 +2678,30 @@ abstract class PigeonApiViewGroup( channel.setMessageHandler(null) } } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.interactive_media_ads.ViewGroup.removeView", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as android.view.ViewGroup + val viewArg = args[1] as android.view.View + val wrapped: List = + try { + api.removeView(pigeon_instanceArg, viewArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } } } @@ -2501,7 +2758,7 @@ abstract class PigeonApiVideoView( abstract fun pigeon_defaultConstructor(): android.widget.VideoView /** Sets the URI of the video. */ - abstract fun setVideoUri(pigeon_instance: android.widget.VideoView, uri: String) + abstract fun setVideoUri(pigeon_instance: android.widget.VideoView, uri: String?) /** * The current position of the playing video. @@ -2513,7 +2770,7 @@ abstract class PigeonApiVideoView( companion object { @Suppress("LocalVariableName") fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiVideoView?) { - val codec = api?.pigeonRegistrar?.codec ?: StandardMessageCodec() + val codec = api?.pigeonRegistrar?.codec ?: InteractiveMediaAdsLibraryPigeonCodec() run { val channel = BasicMessageChannel( @@ -2523,8 +2780,7 @@ abstract class PigeonApiVideoView( if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val pigeon_identifierArg = - args[0].let { num -> if (num is Int) num.toLong() else num as Long } + val pigeon_identifierArg = args[0] as Long val wrapped: List = try { api.pigeonRegistrar.instanceManager.addDartCreatedInstance( @@ -2549,7 +2805,7 @@ abstract class PigeonApiVideoView( channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.widget.VideoView - val uriArg = args[1] as String + val uriArg = args[1] as String? val wrapped: List = try { api.setVideoUri(pigeon_instanceArg, uriArg) @@ -2771,7 +3027,7 @@ abstract class PigeonApiMediaPlayer( companion object { @Suppress("LocalVariableName") fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiMediaPlayer?) { - val codec = api?.pigeonRegistrar?.codec ?: StandardMessageCodec() + val codec = api?.pigeonRegistrar?.codec ?: InteractiveMediaAdsLibraryPigeonCodec() run { val channel = BasicMessageChannel( @@ -2804,7 +3060,7 @@ abstract class PigeonApiMediaPlayer( channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as android.media.MediaPlayer - val mSecArg = args[1].let { num -> if (num is Int) num.toLong() else num as Long } + val mSecArg = args[1] as Long val wrapped: List = try { api.seekTo(pigeon_instanceArg, mSecArg) @@ -3010,7 +3266,7 @@ abstract class PigeonApiVideoAdPlayerCallback( binaryMessenger: BinaryMessenger, api: PigeonApiVideoAdPlayerCallback? ) { - val codec = api?.pigeonRegistrar?.codec ?: StandardMessageCodec() + val codec = api?.pigeonRegistrar?.codec ?: InteractiveMediaAdsLibraryPigeonCodec() run { val channel = BasicMessageChannel( @@ -3278,7 +3534,7 @@ abstract class PigeonApiVideoAdPlayerCallback( com.google.ads.interactivemedia.v3.api.player.VideoAdPlayer.VideoAdPlayerCallback val adMediaInfoArg = args[1] as com.google.ads.interactivemedia.v3.api.player.AdMediaInfo - val percentageArg = args[2].let { num -> if (num is Int) num.toLong() else num as Long } + val percentageArg = args[2] as Long val wrapped: List = try { api.onVolumeChanged(pigeon_instanceArg, adMediaInfoArg, percentageArg) @@ -3361,7 +3617,7 @@ abstract class PigeonApiVideoAdPlayer( companion object { @Suppress("LocalVariableName") fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiVideoAdPlayer?) { - val codec = api?.pigeonRegistrar?.codec ?: StandardMessageCodec() + val codec = api?.pigeonRegistrar?.codec ?: InteractiveMediaAdsLibraryPigeonCodec() run { val channel = BasicMessageChannel( @@ -3371,8 +3627,7 @@ abstract class PigeonApiVideoAdPlayer( if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val pigeon_identifierArg = - args[0].let { num -> if (num is Int) num.toLong() else num as Long } + val pigeon_identifierArg = args[0] as Long val wrapped: List = try { api.pigeonRegistrar.instanceManager.addDartCreatedInstance( @@ -3398,7 +3653,7 @@ abstract class PigeonApiVideoAdPlayer( val args = message as List val pigeon_instanceArg = args[0] as com.google.ads.interactivemedia.v3.api.player.VideoAdPlayer - val valueArg = args[1].let { num -> if (num is Int) num.toLong() else num as Long } + val valueArg = args[1] as Long val wrapped: List = try { api.setVolume(pigeon_instanceArg, valueArg) @@ -3685,7 +3940,7 @@ abstract class PigeonApiAdsLoadedListener( companion object { @Suppress("LocalVariableName") fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiAdsLoadedListener?) { - val codec = api?.pigeonRegistrar?.codec ?: StandardMessageCodec() + val codec = api?.pigeonRegistrar?.codec ?: InteractiveMediaAdsLibraryPigeonCodec() run { val channel = BasicMessageChannel( @@ -3695,8 +3950,7 @@ abstract class PigeonApiAdsLoadedListener( if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val pigeon_identifierArg = - args[0].let { num -> if (num is Int) num.toLong() else num as Long } + val pigeon_identifierArg = args[0] as Long val wrapped: List = try { api.pigeonRegistrar.instanceManager.addDartCreatedInstance( @@ -3780,7 +4034,7 @@ abstract class PigeonApiAdErrorListener( companion object { @Suppress("LocalVariableName") fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiAdErrorListener?) { - val codec = api?.pigeonRegistrar?.codec ?: StandardMessageCodec() + val codec = api?.pigeonRegistrar?.codec ?: InteractiveMediaAdsLibraryPigeonCodec() run { val channel = BasicMessageChannel( @@ -3790,8 +4044,7 @@ abstract class PigeonApiAdErrorListener( if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val pigeon_identifierArg = - args[0].let { num -> if (num is Int) num.toLong() else num as Long } + val pigeon_identifierArg = args[0] as Long val wrapped: List = try { api.pigeonRegistrar.instanceManager.addDartCreatedInstance( @@ -3874,7 +4127,7 @@ abstract class PigeonApiAdEventListener( companion object { @Suppress("LocalVariableName") fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiAdEventListener?) { - val codec = api?.pigeonRegistrar?.codec ?: StandardMessageCodec() + val codec = api?.pigeonRegistrar?.codec ?: InteractiveMediaAdsLibraryPigeonCodec() run { val channel = BasicMessageChannel( @@ -3884,8 +4137,7 @@ abstract class PigeonApiAdEventListener( if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val pigeon_identifierArg = - args[0].let { num -> if (num is Int) num.toLong() else num as Long } + val pigeon_identifierArg = args[0] as Long val wrapped: List = try { api.pigeonRegistrar.instanceManager.addDartCreatedInstance( @@ -3952,3 +4204,918 @@ abstract class PigeonApiAdEventListener( } } } +/** + * Defines parameters that control the rendering of ads. + * + * See + * https://developers.google.com/interactive-media-ads/docs/sdks/android/client-side/api/reference/com/google/ads/interactivemedia/v3/api/AdsRenderingSettings.html. + */ +@Suppress("UNCHECKED_CAST") +abstract class PigeonApiAdsRenderingSettings( + open val pigeonRegistrar: InteractiveMediaAdsLibraryPigeonProxyApiRegistrar +) { + /** Maximum recommended bitrate. */ + abstract fun getBitrateKbps( + pigeon_instance: com.google.ads.interactivemedia.v3.api.AdsRenderingSettings + ): Long + + /** Returns whether the click-through URL will be opened using Custom Tabs feature. */ + abstract fun getEnableCustomTabs( + pigeon_instance: com.google.ads.interactivemedia.v3.api.AdsRenderingSettings + ): Boolean + + /** + * Whether the SDK will instruct the player to load the creative in response to + * `BaseManager.init()`. + */ + abstract fun getEnablePreloading( + pigeon_instance: com.google.ads.interactivemedia.v3.api.AdsRenderingSettings + ): Boolean + + /** + * Whether to focus on the skip button when the skippable ad can be skipped on Android TV. + * + * This is a no-op on non-Android TV devices. + */ + abstract fun getFocusSkipButtonWhenAvailable( + pigeon_instance: com.google.ads.interactivemedia.v3.api.AdsRenderingSettings + ): Boolean + + /** The SDK will prioritize the media with MIME type on the list. */ + abstract fun getMimeTypes( + pigeon_instance: com.google.ads.interactivemedia.v3.api.AdsRenderingSettings + ): List + + /** + * Maximum recommended bitrate. + * + * The value is in kbit/s. Default value, -1, means the bitrate will be selected by the SDK. + */ + abstract fun setBitrateKbps( + pigeon_instance: com.google.ads.interactivemedia.v3.api.AdsRenderingSettings, + bitrate: Long + ) + + /** + * Notifies the SDK whether to launch the click-through URL using Custom Tabs feature. + * + * Default is false. + */ + abstract fun setEnableCustomTabs( + pigeon_instance: com.google.ads.interactivemedia.v3.api.AdsRenderingSettings, + enableCustomTabs: Boolean + ) + + /** + * If set, the SDK will instruct the player to load the creative in response to + * `BaseManager.init()`. + * + * This allows the player to preload the ad at any point before calling `AdsManager.start()`. + */ + abstract fun setEnablePreloading( + pigeon_instance: com.google.ads.interactivemedia.v3.api.AdsRenderingSettings, + enablePreloading: Boolean + ) + + /** + * Set whether to focus on the skip button when the skippable ad can be skipped on Android TV. + * + * This is a no-op on non-Android TV devices. + * + * Default is true. + */ + abstract fun setFocusSkipButtonWhenAvailable( + pigeon_instance: com.google.ads.interactivemedia.v3.api.AdsRenderingSettings, + enableFocusSkipButton: Boolean + ) + + /** + * Specifies a non-default amount of time to wait for media to load before timing out, in + * milliseconds. + * + * This only applies to the IMA client-side SDK. + * + * Default time is 8000 ms. + */ + abstract fun setLoadVideoTimeout( + pigeon_instance: com.google.ads.interactivemedia.v3.api.AdsRenderingSettings, + loadVideoTimeout: Long + ) + + /** If specified, the SDK will prioritize the media with MIME type on the list. */ + abstract fun setMimeTypes( + pigeon_instance: com.google.ads.interactivemedia.v3.api.AdsRenderingSettings, + mimeTypes: List + ) + + /** + * For VMAP and ad rules playlists, only play ad breaks scheduled after this time (in seconds). + */ + abstract fun setPlayAdsAfterTime( + pigeon_instance: com.google.ads.interactivemedia.v3.api.AdsRenderingSettings, + time: Double + ) + + /** Sets the ad UI elements to be rendered by the IMA SDK. */ + abstract fun setUiElements( + pigeon_instance: com.google.ads.interactivemedia.v3.api.AdsRenderingSettings, + uiElements: List + ) + + companion object { + @Suppress("LocalVariableName") + fun setUpMessageHandlers( + binaryMessenger: BinaryMessenger, + api: PigeonApiAdsRenderingSettings? + ) { + val codec = api?.pigeonRegistrar?.codec ?: InteractiveMediaAdsLibraryPigeonCodec() + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.interactive_media_ads.AdsRenderingSettings.getBitrateKbps", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = + args[0] as com.google.ads.interactivemedia.v3.api.AdsRenderingSettings + val wrapped: List = + try { + listOf(api.getBitrateKbps(pigeon_instanceArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.interactive_media_ads.AdsRenderingSettings.getEnableCustomTabs", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = + args[0] as com.google.ads.interactivemedia.v3.api.AdsRenderingSettings + val wrapped: List = + try { + listOf(api.getEnableCustomTabs(pigeon_instanceArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.interactive_media_ads.AdsRenderingSettings.getEnablePreloading", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = + args[0] as com.google.ads.interactivemedia.v3.api.AdsRenderingSettings + val wrapped: List = + try { + listOf(api.getEnablePreloading(pigeon_instanceArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.interactive_media_ads.AdsRenderingSettings.getFocusSkipButtonWhenAvailable", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = + args[0] as com.google.ads.interactivemedia.v3.api.AdsRenderingSettings + val wrapped: List = + try { + listOf(api.getFocusSkipButtonWhenAvailable(pigeon_instanceArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.interactive_media_ads.AdsRenderingSettings.getMimeTypes", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = + args[0] as com.google.ads.interactivemedia.v3.api.AdsRenderingSettings + val wrapped: List = + try { + listOf(api.getMimeTypes(pigeon_instanceArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.interactive_media_ads.AdsRenderingSettings.setBitrateKbps", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = + args[0] as com.google.ads.interactivemedia.v3.api.AdsRenderingSettings + val bitrateArg = args[1] as Long + val wrapped: List = + try { + api.setBitrateKbps(pigeon_instanceArg, bitrateArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.interactive_media_ads.AdsRenderingSettings.setEnableCustomTabs", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = + args[0] as com.google.ads.interactivemedia.v3.api.AdsRenderingSettings + val enableCustomTabsArg = args[1] as Boolean + val wrapped: List = + try { + api.setEnableCustomTabs(pigeon_instanceArg, enableCustomTabsArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.interactive_media_ads.AdsRenderingSettings.setEnablePreloading", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = + args[0] as com.google.ads.interactivemedia.v3.api.AdsRenderingSettings + val enablePreloadingArg = args[1] as Boolean + val wrapped: List = + try { + api.setEnablePreloading(pigeon_instanceArg, enablePreloadingArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.interactive_media_ads.AdsRenderingSettings.setFocusSkipButtonWhenAvailable", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = + args[0] as com.google.ads.interactivemedia.v3.api.AdsRenderingSettings + val enableFocusSkipButtonArg = args[1] as Boolean + val wrapped: List = + try { + api.setFocusSkipButtonWhenAvailable(pigeon_instanceArg, enableFocusSkipButtonArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.interactive_media_ads.AdsRenderingSettings.setLoadVideoTimeout", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = + args[0] as com.google.ads.interactivemedia.v3.api.AdsRenderingSettings + val loadVideoTimeoutArg = args[1] as Long + val wrapped: List = + try { + api.setLoadVideoTimeout(pigeon_instanceArg, loadVideoTimeoutArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.interactive_media_ads.AdsRenderingSettings.setMimeTypes", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = + args[0] as com.google.ads.interactivemedia.v3.api.AdsRenderingSettings + val mimeTypesArg = args[1] as List + val wrapped: List = + try { + api.setMimeTypes(pigeon_instanceArg, mimeTypesArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.interactive_media_ads.AdsRenderingSettings.setPlayAdsAfterTime", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = + args[0] as com.google.ads.interactivemedia.v3.api.AdsRenderingSettings + val timeArg = args[1] as Double + val wrapped: List = + try { + api.setPlayAdsAfterTime(pigeon_instanceArg, timeArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.interactive_media_ads.AdsRenderingSettings.setUiElements", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = + args[0] as com.google.ads.interactivemedia.v3.api.AdsRenderingSettings + val uiElementsArg = args[1] as List + val wrapped: List = + try { + api.setUiElements(pigeon_instanceArg, uiElementsArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + } + } + + @Suppress("LocalVariableName", "FunctionName") + /** Creates a Dart instance of AdsRenderingSettings and attaches it to [pigeon_instanceArg]. */ + fun pigeon_newInstance( + pigeon_instanceArg: com.google.ads.interactivemedia.v3.api.AdsRenderingSettings, + callback: (Result) -> Unit + ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + FlutterError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } + if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + Result.success(Unit) + return + } + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = + "dev.flutter.pigeon.interactive_media_ads.AdsRenderingSettings.pigeon_newInstance" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_identifierArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } +} +/** + * Represents the progress within this ad break. + * + * See + * https://developers.google.com/interactive-media-ads/docs/sdks/android/client-side/api/reference/com/google/ads/interactivemedia/v3/api/AdProgressInfo.html. + */ +@Suppress("UNCHECKED_CAST") +abstract class PigeonApiAdProgressInfo( + open val pigeonRegistrar: InteractiveMediaAdsLibraryPigeonProxyApiRegistrar +) { + /** Total ad break duration (in seconds). */ + abstract fun adBreakDuration( + pigeon_instance: com.google.ads.interactivemedia.v3.api.AdProgressInfo + ): Double + + /** Total ad period duration (in seconds). */ + abstract fun adPeriodDuration( + pigeon_instance: com.google.ads.interactivemedia.v3.api.AdProgressInfo + ): Double + + /** The position of current ad within the ad break, starting with 1. */ + abstract fun adPosition( + pigeon_instance: com.google.ads.interactivemedia.v3.api.AdProgressInfo + ): Long + + /** Current time within the ad (in seconds). */ + abstract fun currentTime( + pigeon_instance: com.google.ads.interactivemedia.v3.api.AdProgressInfo + ): Double + + /** Duration of current ad (in seconds). */ + abstract fun duration( + pigeon_instance: com.google.ads.interactivemedia.v3.api.AdProgressInfo + ): Double + + /** The total number of ads in this ad break. */ + abstract fun totalAds( + pigeon_instance: com.google.ads.interactivemedia.v3.api.AdProgressInfo + ): Long + + @Suppress("LocalVariableName", "FunctionName") + /** Creates a Dart instance of AdProgressInfo and attaches it to [pigeon_instanceArg]. */ + fun pigeon_newInstance( + pigeon_instanceArg: com.google.ads.interactivemedia.v3.api.AdProgressInfo, + callback: (Result) -> Unit + ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + FlutterError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } + if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + Result.success(Unit) + return + } + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val adBreakDurationArg = adBreakDuration(pigeon_instanceArg) + val adPeriodDurationArg = adPeriodDuration(pigeon_instanceArg) + val adPositionArg = adPosition(pigeon_instanceArg) + val currentTimeArg = currentTime(pigeon_instanceArg) + val durationArg = duration(pigeon_instanceArg) + val totalAdsArg = totalAds(pigeon_instanceArg) + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = "dev.flutter.pigeon.interactive_media_ads.AdProgressInfo.pigeon_newInstance" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send( + listOf( + pigeon_identifierArg, + adBreakDurationArg, + adPeriodDurationArg, + adPositionArg, + currentTimeArg, + durationArg, + totalAdsArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } +} +/** + * An object that holds data corresponding to the companion Ad. + * + * See + * https://developers.google.com/interactive-media-ads/docs/sdks/android/client-side/api/reference/com/google/ads/interactivemedia/v3/api/CompanionAd.html. + */ +@Suppress("UNCHECKED_CAST") +abstract class PigeonApiCompanionAd( + open val pigeonRegistrar: InteractiveMediaAdsLibraryPigeonProxyApiRegistrar +) { + /** The API needed to execute this ad, or null if unavailable. */ + abstract fun apiFramework( + pigeon_instance: com.google.ads.interactivemedia.v3.api.CompanionAd + ): String? + + /** + * The height of the companion in pixels. + * + * 0 if unavailable. + */ + abstract fun height(pigeon_instance: com.google.ads.interactivemedia.v3.api.CompanionAd): Long + + /** The URL for the static resource of this companion. */ + abstract fun resourceValue( + pigeon_instance: com.google.ads.interactivemedia.v3.api.CompanionAd + ): String + + /** + * The width of the companion in pixels. + * + * 0 if unavailable. + */ + abstract fun width(pigeon_instance: com.google.ads.interactivemedia.v3.api.CompanionAd): Long + + @Suppress("LocalVariableName", "FunctionName") + /** Creates a Dart instance of CompanionAd and attaches it to [pigeon_instanceArg]. */ + fun pigeon_newInstance( + pigeon_instanceArg: com.google.ads.interactivemedia.v3.api.CompanionAd, + callback: (Result) -> Unit + ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + FlutterError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } + if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + Result.success(Unit) + return + } + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val apiFrameworkArg = apiFramework(pigeon_instanceArg) + val heightArg = height(pigeon_instanceArg) + val resourceValueArg = resourceValue(pigeon_instanceArg) + val widthArg = width(pigeon_instanceArg) + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = "dev.flutter.pigeon.interactive_media_ads.CompanionAd.pigeon_newInstance" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send( + listOf(pigeon_identifierArg, apiFrameworkArg, heightArg, resourceValueArg, widthArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } +} +/** + * This object exposes information about the universal ad ID. + * + * See + * https://developers.google.com/interactive-media-ads/docs/sdks/android/client-side/api/reference/com/google/ads/interactivemedia/v3/api/UniversalAdId.html. + */ +@Suppress("UNCHECKED_CAST") +abstract class PigeonApiUniversalAdId( + open val pigeonRegistrar: InteractiveMediaAdsLibraryPigeonProxyApiRegistrar +) { + /** + * Returns the ad ID registry associated with the ad ID value. + * + * Returns "unknown" if the registry is not known. + */ + abstract fun adIdRegistry( + pigeon_instance: com.google.ads.interactivemedia.v3.api.UniversalAdId + ): String + + /** + * Returns the universal ad ID value. + * + * Returns "unknown" if the value is not known. + */ + abstract fun adIdValue( + pigeon_instance: com.google.ads.interactivemedia.v3.api.UniversalAdId + ): String + + @Suppress("LocalVariableName", "FunctionName") + /** Creates a Dart instance of UniversalAdId and attaches it to [pigeon_instanceArg]. */ + fun pigeon_newInstance( + pigeon_instanceArg: com.google.ads.interactivemedia.v3.api.UniversalAdId, + callback: (Result) -> Unit + ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + FlutterError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } + if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + Result.success(Unit) + return + } + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val adIdRegistryArg = adIdRegistry(pigeon_instanceArg) + val adIdValueArg = adIdValue(pigeon_instanceArg) + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = "dev.flutter.pigeon.interactive_media_ads.UniversalAdId.pigeon_newInstance" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_identifierArg, adIdRegistryArg, adIdValueArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } +} +/** + * An object that holds data corresponding to the main Ad. + * + * See + * https://developers.google.com/interactive-media-ads/docs/sdks/android/client-side/api/reference/com/google/ads/interactivemedia/v3/api/Ad.html. + */ +@Suppress("UNCHECKED_CAST") +abstract class PigeonApiAd( + open val pigeonRegistrar: InteractiveMediaAdsLibraryPigeonProxyApiRegistrar +) { + /** The ad ID as specified in the VAST response. */ + abstract fun adId(pigeon_instance: com.google.ads.interactivemedia.v3.api.Ad): String + + /** The pod metadata object. */ + abstract fun adPodInfo( + pigeon_instance: com.google.ads.interactivemedia.v3.api.Ad + ): com.google.ads.interactivemedia.v3.api.AdPodInfo + + /** The ad system as specified in the VAST response. */ + abstract fun adSystem(pigeon_instance: com.google.ads.interactivemedia.v3.api.Ad): String + + /** The IDs of the ads' creatives, starting with the first wrapper ad. */ + abstract fun adWrapperCreativeIds( + pigeon_instance: com.google.ads.interactivemedia.v3.api.Ad + ): List + + /** The wrapper ad IDs as specified in the VAST response. */ + abstract fun adWrapperIds( + pigeon_instance: com.google.ads.interactivemedia.v3.api.Ad + ): List + + /** The wrapper ad systems as specified in the VAST response. */ + abstract fun adWrapperSystems( + pigeon_instance: com.google.ads.interactivemedia.v3.api.Ad + ): List + + /** The advertiser name as defined by the serving party. */ + abstract fun advertiserName(pigeon_instance: com.google.ads.interactivemedia.v3.api.Ad): String + + /** + * The companions for the current ad while using DAI. + * + * Returns an empty list in any other scenario. + */ + abstract fun companionAds( + pigeon_instance: com.google.ads.interactivemedia.v3.api.Ad + ): List + + /** + * The content type of the currently selected creative, or null if no creative is selected or the + * content type is unavailable. + */ + abstract fun contentType(pigeon_instance: com.google.ads.interactivemedia.v3.api.Ad): String? + + /** The ISCI (Industry Standard Commercial Identifier) code for an ad. */ + abstract fun creativeAdId(pigeon_instance: com.google.ads.interactivemedia.v3.api.Ad): String + + /** The ID of the selected creative for the ad, */ + abstract fun creativeId(pigeon_instance: com.google.ads.interactivemedia.v3.api.Ad): String + + /** The first deal ID present in the wrapper chain for the current ad, starting from the top. */ + abstract fun dealId(pigeon_instance: com.google.ads.interactivemedia.v3.api.Ad): String + + /** The description of this ad from the VAST response. */ + abstract fun description(pigeon_instance: com.google.ads.interactivemedia.v3.api.Ad): String? + + /** The duration of the ad in seconds, -1 if not available. */ + abstract fun duration(pigeon_instance: com.google.ads.interactivemedia.v3.api.Ad): Double + + /** The height of the selected creative if non-linear, else returns 0. */ + abstract fun height(pigeon_instance: com.google.ads.interactivemedia.v3.api.Ad): Long + + /** The number of seconds of playback before the ad becomes skippable. */ + abstract fun skipTimeOffset(pigeon_instance: com.google.ads.interactivemedia.v3.api.Ad): Double + + /** The URL associated with the survey for the given ad. */ + abstract fun surveyUrl(pigeon_instance: com.google.ads.interactivemedia.v3.api.Ad): String? + + /** The title of this ad from the VAST response. */ + abstract fun title(pigeon_instance: com.google.ads.interactivemedia.v3.api.Ad): String? + + /** The custom parameters associated with the ad at the time of ad trafficking. */ + abstract fun traffickingParameters( + pigeon_instance: com.google.ads.interactivemedia.v3.api.Ad + ): String + + /** Te set of ad UI elements rendered by the IMA SDK for this ad. */ + abstract fun uiElements( + pigeon_instance: com.google.ads.interactivemedia.v3.api.Ad + ): List + + /** The list of all universal ad IDs for this ad. */ + abstract fun universalAdIds( + pigeon_instance: com.google.ads.interactivemedia.v3.api.Ad + ): List + + /** The VAST bitrate in Kbps of the selected creative. */ + abstract fun vastMediaBitrate(pigeon_instance: com.google.ads.interactivemedia.v3.api.Ad): Long + + /** The VAST media height in pixels of the selected creative. */ + abstract fun vastMediaHeight(pigeon_instance: com.google.ads.interactivemedia.v3.api.Ad): Long + + /** The VAST media width in pixels of the selected creative. */ + abstract fun vastMediaWidth(pigeon_instance: com.google.ads.interactivemedia.v3.api.Ad): Long + + /** The width of the selected creative if non-linear, else returns 0. */ + abstract fun width(pigeon_instance: com.google.ads.interactivemedia.v3.api.Ad): Long + + /** Indicates whether the ad’s current mode of operation is linear or non-linear. */ + abstract fun isLinear(pigeon_instance: com.google.ads.interactivemedia.v3.api.Ad): Boolean + + /** Indicates whether the ad can be skipped by the user. */ + abstract fun isSkippable(pigeon_instance: com.google.ads.interactivemedia.v3.api.Ad): Boolean + + @Suppress("LocalVariableName", "FunctionName") + /** Creates a Dart instance of Ad and attaches it to [pigeon_instanceArg]. */ + fun pigeon_newInstance( + pigeon_instanceArg: com.google.ads.interactivemedia.v3.api.Ad, + callback: (Result) -> Unit + ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + FlutterError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } + if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + Result.success(Unit) + return + } + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val adIdArg = adId(pigeon_instanceArg) + val adPodInfoArg = adPodInfo(pigeon_instanceArg) + val adSystemArg = adSystem(pigeon_instanceArg) + val adWrapperCreativeIdsArg = adWrapperCreativeIds(pigeon_instanceArg) + val adWrapperIdsArg = adWrapperIds(pigeon_instanceArg) + val adWrapperSystemsArg = adWrapperSystems(pigeon_instanceArg) + val advertiserNameArg = advertiserName(pigeon_instanceArg) + val companionAdsArg = companionAds(pigeon_instanceArg) + val contentTypeArg = contentType(pigeon_instanceArg) + val creativeAdIdArg = creativeAdId(pigeon_instanceArg) + val creativeIdArg = creativeId(pigeon_instanceArg) + val dealIdArg = dealId(pigeon_instanceArg) + val descriptionArg = description(pigeon_instanceArg) + val durationArg = duration(pigeon_instanceArg) + val heightArg = height(pigeon_instanceArg) + val skipTimeOffsetArg = skipTimeOffset(pigeon_instanceArg) + val surveyUrlArg = surveyUrl(pigeon_instanceArg) + val titleArg = title(pigeon_instanceArg) + val traffickingParametersArg = traffickingParameters(pigeon_instanceArg) + val uiElementsArg = uiElements(pigeon_instanceArg) + val universalAdIdsArg = universalAdIds(pigeon_instanceArg) + val vastMediaBitrateArg = vastMediaBitrate(pigeon_instanceArg) + val vastMediaHeightArg = vastMediaHeight(pigeon_instanceArg) + val vastMediaWidthArg = vastMediaWidth(pigeon_instanceArg) + val widthArg = width(pigeon_instanceArg) + val isLinearArg = isLinear(pigeon_instanceArg) + val isSkippableArg = isSkippable(pigeon_instanceArg) + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = "dev.flutter.pigeon.interactive_media_ads.Ad.pigeon_newInstance" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send( + listOf( + pigeon_identifierArg, + adIdArg, + adPodInfoArg, + adSystemArg, + adWrapperCreativeIdsArg, + adWrapperIdsArg, + adWrapperSystemsArg, + advertiserNameArg, + companionAdsArg, + contentTypeArg, + creativeAdIdArg, + creativeIdArg, + dealIdArg, + descriptionArg, + durationArg, + heightArg, + skipTimeOffsetArg, + surveyUrlArg, + titleArg, + traffickingParametersArg, + uiElementsArg, + universalAdIdsArg, + vastMediaBitrateArg, + vastMediaHeightArg, + vastMediaWidthArg, + widthArg, + isLinearArg, + isSkippableArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } +} diff --git a/packages/interactive_media_ads/android/src/main/kotlin/dev/flutter/packages/interactive_media_ads/ProxyApiRegistrar.kt b/packages/interactive_media_ads/android/src/main/kotlin/dev/flutter/packages/interactive_media_ads/ProxyApiRegistrar.kt index ff1190eb9fc7..d1cfda322bea 100644 --- a/packages/interactive_media_ads/android/src/main/kotlin/dev/flutter/packages/interactive_media_ads/ProxyApiRegistrar.kt +++ b/packages/interactive_media_ads/android/src/main/kotlin/dev/flutter/packages/interactive_media_ads/ProxyApiRegistrar.kt @@ -125,4 +125,24 @@ open class ProxyApiRegistrar(binaryMessenger: BinaryMessenger, var context: Cont override fun getPigeonApiMediaPlayer(): PigeonApiMediaPlayer { return MediaPlayerProxyApi(this) } + + override fun getPigeonApiAdsRenderingSettings(): PigeonApiAdsRenderingSettings { + return AdsRenderingSettingsProxyApi(this) + } + + override fun getPigeonApiAdProgressInfo(): PigeonApiAdProgressInfo { + return AdProgressInfoProxyApi(this) + } + + override fun getPigeonApiCompanionAd(): PigeonApiCompanionAd { + return CompanionAdProxyApi(this) + } + + override fun getPigeonApiUniversalAdId(): PigeonApiUniversalAdId { + return UniversalAdIdProxyApi(this) + } + + override fun getPigeonApiAd(): PigeonApiAd { + return AdProxyApi(this) + } } diff --git a/packages/interactive_media_ads/android/src/main/kotlin/dev/flutter/packages/interactive_media_ads/UniversalAdIdProxyApi.kt b/packages/interactive_media_ads/android/src/main/kotlin/dev/flutter/packages/interactive_media_ads/UniversalAdIdProxyApi.kt new file mode 100644 index 000000000000..237ee69e93d9 --- /dev/null +++ b/packages/interactive_media_ads/android/src/main/kotlin/dev/flutter/packages/interactive_media_ads/UniversalAdIdProxyApi.kt @@ -0,0 +1,24 @@ +// 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. + +package dev.flutter.packages.interactive_media_ads + +import com.google.ads.interactivemedia.v3.api.UniversalAdId + +/** + * ProxyApi implementation for [UniversalAdId]. + * + *

This class may handle instantiating native object instances that are attached to a Dart + * instance or handle method calls on the associated native class or an instance of that class. + */ +class UniversalAdIdProxyApi(override val pigeonRegistrar: ProxyApiRegistrar) : + PigeonApiUniversalAdId(pigeonRegistrar) { + override fun adIdRegistry(pigeon_instance: UniversalAdId): String { + return pigeon_instance.adIdRegistry + } + + override fun adIdValue(pigeon_instance: UniversalAdId): String { + return pigeon_instance.adIdValue + } +} diff --git a/packages/interactive_media_ads/android/src/main/kotlin/dev/flutter/packages/interactive_media_ads/VideoViewProxyApi.kt b/packages/interactive_media_ads/android/src/main/kotlin/dev/flutter/packages/interactive_media_ads/VideoViewProxyApi.kt index 983f97e7f775..a9634cb44f4f 100644 --- a/packages/interactive_media_ads/android/src/main/kotlin/dev/flutter/packages/interactive_media_ads/VideoViewProxyApi.kt +++ b/packages/interactive_media_ads/android/src/main/kotlin/dev/flutter/packages/interactive_media_ads/VideoViewProxyApi.kt @@ -28,8 +28,8 @@ class VideoViewProxyApi(override val pigeonRegistrar: ProxyApiRegistrar) : return instance } - override fun setVideoUri(pigeon_instance: VideoView, uri: String) { - pigeon_instance.setVideoURI(Uri.parse(uri)) + override fun setVideoUri(pigeon_instance: VideoView, uri: String?) { + pigeon_instance.setVideoURI(if (uri != null) Uri.parse(uri) else null) } override fun getCurrentPosition(pigeon_instance: VideoView): Long { diff --git a/packages/interactive_media_ads/android/src/main/kotlin/dev/flutter/packages/interactive_media_ads/ViewGroupProxyApi.kt b/packages/interactive_media_ads/android/src/main/kotlin/dev/flutter/packages/interactive_media_ads/ViewGroupProxyApi.kt index 5ba9fa8d58f4..8c891ad5e009 100644 --- a/packages/interactive_media_ads/android/src/main/kotlin/dev/flutter/packages/interactive_media_ads/ViewGroupProxyApi.kt +++ b/packages/interactive_media_ads/android/src/main/kotlin/dev/flutter/packages/interactive_media_ads/ViewGroupProxyApi.kt @@ -18,4 +18,8 @@ class ViewGroupProxyApi(override val pigeonRegistrar: ProxyApiRegistrar) : override fun addView(pigeon_instance: ViewGroup, view: View) { pigeon_instance.addView(view) } + + override fun removeView(pigeon_instance: ViewGroup, view: View) { + pigeon_instance.removeView(view) + } } diff --git a/packages/interactive_media_ads/android/src/test/kotlin/dev/flutter/packages/interactive_media_ads/AdProgressInfoProxyApiTest.kt b/packages/interactive_media_ads/android/src/test/kotlin/dev/flutter/packages/interactive_media_ads/AdProgressInfoProxyApiTest.kt new file mode 100644 index 000000000000..8745bbf89f75 --- /dev/null +++ b/packages/interactive_media_ads/android/src/test/kotlin/dev/flutter/packages/interactive_media_ads/AdProgressInfoProxyApiTest.kt @@ -0,0 +1,79 @@ +// 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. + +package dev.flutter.packages.interactive_media_ads + +import com.google.ads.interactivemedia.v3.api.AdProgressInfo +import kotlin.test.Test +import kotlin.test.assertEquals +import org.mockito.kotlin.mock +import org.mockito.kotlin.whenever + +class AdProgressInfoProxyApiTest { + @Test + fun adBreakDuration() { + val api = TestProxyApiRegistrar().getPigeonApiAdProgressInfo() + + val instance = mock() + val value = 1.0 + whenever(instance.adBreakDuration).thenReturn(value) + + assertEquals(value, api.adBreakDuration(instance)) + } + + @Test + fun adPeriodDuration() { + val api = TestProxyApiRegistrar().getPigeonApiAdProgressInfo() + + val instance = mock() + val value = 1.0 + whenever(instance.adPeriodDuration).thenReturn(value) + + assertEquals(value, api.adPeriodDuration(instance)) + } + + @Test + fun adPosition() { + val api = TestProxyApiRegistrar().getPigeonApiAdProgressInfo() + + val instance = mock() + val value = 0 + whenever(instance.adPosition).thenReturn(value) + + assertEquals(value.toLong(), api.adPosition(instance)) + } + + @Test + fun currentTime() { + val api = TestProxyApiRegistrar().getPigeonApiAdProgressInfo() + + val instance = mock() + val value = 1.0 + whenever(instance.currentTime).thenReturn(value) + + assertEquals(value, api.currentTime(instance)) + } + + @Test + fun duration() { + val api = TestProxyApiRegistrar().getPigeonApiAdProgressInfo() + + val instance = mock() + val value = 1.0 + whenever(instance.duration).thenReturn(value) + + assertEquals(value, api.duration(instance)) + } + + @Test + fun totalAds() { + val api = TestProxyApiRegistrar().getPigeonApiAdProgressInfo() + + val instance = mock() + val value = 0 + whenever(instance.totalAds).thenReturn(value) + + assertEquals(value.toLong(), api.totalAds(instance)) + } +} diff --git a/packages/interactive_media_ads/android/src/test/kotlin/dev/flutter/packages/interactive_media_ads/AdProxyApiTest.kt b/packages/interactive_media_ads/android/src/test/kotlin/dev/flutter/packages/interactive_media_ads/AdProxyApiTest.kt new file mode 100644 index 000000000000..65e498f18c91 --- /dev/null +++ b/packages/interactive_media_ads/android/src/test/kotlin/dev/flutter/packages/interactive_media_ads/AdProxyApiTest.kt @@ -0,0 +1,316 @@ +// 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. + +package dev.flutter.packages.interactive_media_ads + +import com.google.ads.interactivemedia.v3.api.Ad +import com.google.ads.interactivemedia.v3.api.AdPodInfo +import com.google.ads.interactivemedia.v3.api.CompanionAd +import com.google.ads.interactivemedia.v3.api.UiElement +import com.google.ads.interactivemedia.v3.api.UniversalAdId +import kotlin.test.Test +import kotlin.test.assertEquals +import org.mockito.kotlin.mock +import org.mockito.kotlin.whenever + +class AdProxyApiTest { + @Test + fun adId() { + val api = TestProxyApiRegistrar().getPigeonApiAd() + + val instance = mock() + val value = "myString" + whenever(instance.adId).thenReturn(value) + + assertEquals(value, api.adId(instance)) + } + + @Test + fun adPodInfo() { + val api = TestProxyApiRegistrar().getPigeonApiAd() + + val instance = mock() + val value = mock() + whenever(instance.adPodInfo).thenReturn(value) + + assertEquals(value, api.adPodInfo(instance)) + } + + @Test + fun adSystem() { + val api = TestProxyApiRegistrar().getPigeonApiAd() + + val instance = mock() + val value = "myString" + whenever(instance.adSystem).thenReturn(value) + + assertEquals(value, api.adSystem(instance)) + } + + @Test + fun adWrapperCreativeIds() { + val api = TestProxyApiRegistrar().getPigeonApiAd() + + val instance = mock() + val value = listOf("myString") + whenever(instance.adWrapperCreativeIds).thenReturn(arrayOf("myString")) + + assertEquals(value, api.adWrapperCreativeIds(instance)) + } + + @Test + fun adWrapperIds() { + val api = TestProxyApiRegistrar().getPigeonApiAd() + + val instance = mock() + val value = listOf("myString") + whenever(instance.adWrapperIds).thenReturn(arrayOf("myString")) + + assertEquals(value, api.adWrapperIds(instance)) + } + + @Test + fun adWrapperSystems() { + val api = TestProxyApiRegistrar().getPigeonApiAd() + + val instance = mock() + val value = listOf("myString") + whenever(instance.adWrapperSystems).thenReturn(arrayOf("myString")) + + assertEquals(value, api.adWrapperSystems(instance)) + } + + @Test + fun advertiserName() { + val api = TestProxyApiRegistrar().getPigeonApiAd() + + val instance = mock() + val value = "myString" + whenever(instance.advertiserName).thenReturn(value) + + assertEquals(value, api.advertiserName(instance)) + } + + @Test + fun companionAds() { + val api = TestProxyApiRegistrar().getPigeonApiAd() + + val instance = mock() + val value = listOf(mock()) + whenever(instance.companionAds).thenReturn(value) + + assertEquals(value, api.companionAds(instance)) + } + + @Test + fun contentType() { + val api = TestProxyApiRegistrar().getPigeonApiAd() + + val instance = mock() + val value = "myString" + whenever(instance.contentType).thenReturn(value) + + assertEquals(value, api.contentType(instance)) + } + + @Test + fun creativeAdId() { + val api = TestProxyApiRegistrar().getPigeonApiAd() + + val instance = mock() + val value = "myString" + whenever(instance.creativeAdId).thenReturn(value) + + assertEquals(value, api.creativeAdId(instance)) + } + + @Test + fun creativeId() { + val api = TestProxyApiRegistrar().getPigeonApiAd() + + val instance = mock() + val value = "myString" + whenever(instance.creativeId).thenReturn(value) + + assertEquals(value, api.creativeId(instance)) + } + + @Test + fun dealId() { + val api = TestProxyApiRegistrar().getPigeonApiAd() + + val instance = mock() + val value = "myString" + whenever(instance.dealId).thenReturn(value) + + assertEquals(value, api.dealId(instance)) + } + + @Test + fun description() { + val api = TestProxyApiRegistrar().getPigeonApiAd() + + val instance = mock() + val value = "myString" + whenever(instance.description).thenReturn(value) + + assertEquals(value, api.description(instance)) + } + + @Test + fun duration() { + val api = TestProxyApiRegistrar().getPigeonApiAd() + + val instance = mock() + val value = 1.0 + whenever(instance.duration).thenReturn(value) + + assertEquals(value, api.duration(instance)) + } + + @Test + fun height() { + val api = TestProxyApiRegistrar().getPigeonApiAd() + + val instance = mock() + val value = 0 + whenever(instance.height).thenReturn(value) + + assertEquals(value.toLong(), api.height(instance)) + } + + @Test + fun skipTimeOffset() { + val api = TestProxyApiRegistrar().getPigeonApiAd() + + val instance = mock() + val value = 1.0 + whenever(instance.skipTimeOffset).thenReturn(value) + + assertEquals(value, api.skipTimeOffset(instance)) + } + + @Test + fun surveyUrl() { + val api = TestProxyApiRegistrar().getPigeonApiAd() + + val instance = mock() + val value = "myString" + whenever(instance.surveyUrl).thenReturn(value) + + assertEquals(value, api.surveyUrl(instance)) + } + + @Test + fun title() { + val api = TestProxyApiRegistrar().getPigeonApiAd() + + val instance = mock() + val value = "myString" + whenever(instance.title).thenReturn(value) + + assertEquals(value, api.title(instance)) + } + + @Test + fun traffickingParameters() { + val api = TestProxyApiRegistrar().getPigeonApiAd() + + val instance = mock() + val value = "myString" + whenever(instance.traffickingParameters).thenReturn(value) + + assertEquals(value, api.traffickingParameters(instance)) + } + + @Test + fun uiElements() { + val api = TestProxyApiRegistrar().getPigeonApiAd() + + val instance = mock() + val value = listOf(UiElement.AD_ATTRIBUTION) + whenever(instance.uiElements).thenReturn(value.toSet()) + + assertEquals( + listOf(dev.flutter.packages.interactive_media_ads.UiElement.AD_ATTRIBUTION), + api.uiElements(instance)) + } + + @Test + fun universalAdIds() { + val api = TestProxyApiRegistrar().getPigeonApiAd() + + val instance = mock() + val value = listOf(mock()) + whenever(instance.universalAdIds).thenReturn(value.toTypedArray()) + + assertEquals(value, api.universalAdIds(instance)) + } + + @Test + fun vastMediaBitrate() { + val api = TestProxyApiRegistrar().getPigeonApiAd() + + val instance = mock() + val value = 0 + whenever(instance.vastMediaBitrate).thenReturn(value) + + assertEquals(value.toLong(), api.vastMediaBitrate(instance)) + } + + @Test + fun vastMediaHeight() { + val api = TestProxyApiRegistrar().getPigeonApiAd() + + val instance = mock() + val value = 0 + whenever(instance.vastMediaHeight).thenReturn(value) + + assertEquals(value.toLong(), api.vastMediaHeight(instance)) + } + + @Test + fun vastMediaWidth() { + val api = TestProxyApiRegistrar().getPigeonApiAd() + + val instance = mock() + val value = 0 + whenever(instance.vastMediaWidth).thenReturn(value) + + assertEquals(value.toLong(), api.vastMediaWidth(instance)) + } + + @Test + fun width() { + val api = TestProxyApiRegistrar().getPigeonApiAd() + + val instance = mock() + val value = 0 + whenever(instance.width).thenReturn(value) + + assertEquals(value.toLong(), api.width(instance)) + } + + @Test + fun isLinear() { + val api = TestProxyApiRegistrar().getPigeonApiAd() + + val instance = mock() + val value = true + whenever(instance.isLinear).thenReturn(value) + + assertEquals(value, api.isLinear(instance)) + } + + @Test + fun isSkippable() { + val api = TestProxyApiRegistrar().getPigeonApiAd() + + val instance = mock() + val value = true + whenever(instance.isSkippable).thenReturn(value) + + assertEquals(value, api.isSkippable(instance)) + } +} diff --git a/packages/interactive_media_ads/android/src/test/kotlin/dev/flutter/packages/interactive_media_ads/AdsManagerProxyApiTest.kt b/packages/interactive_media_ads/android/src/test/kotlin/dev/flutter/packages/interactive_media_ads/AdsManagerProxyApiTest.kt index 8dc78843ef75..e394e4761b80 100644 --- a/packages/interactive_media_ads/android/src/test/kotlin/dev/flutter/packages/interactive_media_ads/AdsManagerProxyApiTest.kt +++ b/packages/interactive_media_ads/android/src/test/kotlin/dev/flutter/packages/interactive_media_ads/AdsManagerProxyApiTest.kt @@ -6,8 +6,10 @@ package dev.flutter.packages.interactive_media_ads import com.google.ads.interactivemedia.v3.api.AdsManager import kotlin.test.Test +import kotlin.test.assertEquals import org.mockito.kotlin.mock import org.mockito.kotlin.verify +import org.mockito.kotlin.whenever class AdsManagerProxyApiTest { @Test @@ -39,4 +41,35 @@ class AdsManagerProxyApiTest { verify(instance).start() } + + @Test + fun getAdCuePoints() { + val api = TestProxyApiRegistrar().getPigeonApiAdsManager() + + val instance = mock() + val value = listOf(1.0) + whenever(instance.adCuePoints).thenReturn(listOf(1.0f)) + + assertEquals(value, api.getAdCuePoints(instance)) + } + + @Test + fun resume() { + val api = TestProxyApiRegistrar().getPigeonApiAdsManager() + + val instance = mock() + api.resume(instance) + + verify(instance).resume() + } + + @Test + fun skip() { + val api = TestProxyApiRegistrar().getPigeonApiAdsManager() + + val instance = mock() + api.skip(instance) + + verify(instance).skip() + } } diff --git a/packages/interactive_media_ads/android/src/test/kotlin/dev/flutter/packages/interactive_media_ads/AdsRenderingSettingsProxyApiTest.kt b/packages/interactive_media_ads/android/src/test/kotlin/dev/flutter/packages/interactive_media_ads/AdsRenderingSettingsProxyApiTest.kt new file mode 100644 index 000000000000..f7585858a8e4 --- /dev/null +++ b/packages/interactive_media_ads/android/src/test/kotlin/dev/flutter/packages/interactive_media_ads/AdsRenderingSettingsProxyApiTest.kt @@ -0,0 +1,158 @@ +// 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. + +package dev.flutter.packages.interactive_media_ads + +import com.google.ads.interactivemedia.v3.api.AdsRenderingSettings +import com.google.ads.interactivemedia.v3.api.UiElement +import kotlin.test.Test +import kotlin.test.assertEquals +import org.mockito.kotlin.mock +import org.mockito.kotlin.verify +import org.mockito.kotlin.whenever + +class AdsRenderingSettingsProxyApiTest { + @Test + fun getBitrateKbps() { + val api = TestProxyApiRegistrar().getPigeonApiAdsRenderingSettings() + + val instance = mock() + val value = 0 + whenever(instance.bitrateKbps).thenReturn(value) + + assertEquals(value.toLong(), api.getBitrateKbps(instance)) + } + + @Test + fun getEnableCustomTabs() { + val api = TestProxyApiRegistrar().getPigeonApiAdsRenderingSettings() + + val instance = mock() + val value = true + whenever(instance.enableCustomTabs).thenReturn(value) + + assertEquals(value, api.getEnableCustomTabs(instance)) + } + + @Test + fun getEnablePreloading() { + val api = TestProxyApiRegistrar().getPigeonApiAdsRenderingSettings() + + val instance = mock() + val value = true + whenever(instance.enablePreloading).thenReturn(value) + + assertEquals(value, api.getEnablePreloading(instance)) + } + + @Test + fun getFocusSkipButtonWhenAvailable() { + val api = TestProxyApiRegistrar().getPigeonApiAdsRenderingSettings() + + val instance = mock() + val value = true + whenever(instance.focusSkipButtonWhenAvailable).thenReturn(value) + + assertEquals(value, api.getFocusSkipButtonWhenAvailable(instance)) + } + + @Test + fun getMimeTypes() { + val api = TestProxyApiRegistrar().getPigeonApiAdsRenderingSettings() + + val instance = mock() + val value = listOf("myString") + whenever(instance.mimeTypes).thenReturn(value) + + assertEquals(value, api.getMimeTypes(instance)) + } + + @Test + fun setBitrateKbps() { + val api = TestProxyApiRegistrar().getPigeonApiAdsRenderingSettings() + + val instance = mock() + val bitrate = 0L + api.setBitrateKbps(instance, bitrate) + + verify(instance).bitrateKbps = bitrate.toInt() + } + + @Test + fun setEnableCustomTabs() { + val api = TestProxyApiRegistrar().getPigeonApiAdsRenderingSettings() + + val instance = mock() + val enableCustomTabs = true + api.setEnableCustomTabs(instance, enableCustomTabs) + + verify(instance).enableCustomTabs = enableCustomTabs + } + + @Test + fun setEnablePreloading() { + val api = TestProxyApiRegistrar().getPigeonApiAdsRenderingSettings() + + val instance = mock() + val enablePreloading = true + api.setEnablePreloading(instance, enablePreloading) + + verify(instance).enablePreloading = enablePreloading + } + + @Test + fun setFocusSkipButtonWhenAvailable() { + val api = TestProxyApiRegistrar().getPigeonApiAdsRenderingSettings() + + val instance = mock() + val enableFocusSkipButton = true + api.setFocusSkipButtonWhenAvailable(instance, enableFocusSkipButton) + + verify(instance).focusSkipButtonWhenAvailable = enableFocusSkipButton + } + + @Test + fun setLoadVideoTimeout() { + val api = TestProxyApiRegistrar().getPigeonApiAdsRenderingSettings() + + val instance = mock() + val loadVideoTimeout = 0L + api.setLoadVideoTimeout(instance, loadVideoTimeout) + + verify(instance).setLoadVideoTimeout(loadVideoTimeout.toInt()) + } + + @Test + fun setMimeTypes() { + val api = TestProxyApiRegistrar().getPigeonApiAdsRenderingSettings() + + val instance = mock() + val mimeTypes = listOf("myString") + api.setMimeTypes(instance, mimeTypes) + + verify(instance).mimeTypes = mimeTypes + } + + @Test + fun setPlayAdsAfterTime() { + val api = TestProxyApiRegistrar().getPigeonApiAdsRenderingSettings() + + val instance = mock() + val time = 1.0 + api.setPlayAdsAfterTime(instance, time) + + verify(instance).setPlayAdsAfterTime(time) + } + + @Test + fun setUiElements() { + val api = TestProxyApiRegistrar().getPigeonApiAdsRenderingSettings() + + val instance = mock() + val uiElements = listOf(dev.flutter.packages.interactive_media_ads.UiElement.AD_ATTRIBUTION) + api.setUiElements(instance, uiElements) + + verify(instance).setUiElements(setOf(UiElement.AD_ATTRIBUTION)) + } +} diff --git a/packages/interactive_media_ads/android/src/test/kotlin/dev/flutter/packages/interactive_media_ads/CompanionAdProxyApiTest.kt b/packages/interactive_media_ads/android/src/test/kotlin/dev/flutter/packages/interactive_media_ads/CompanionAdProxyApiTest.kt new file mode 100644 index 000000000000..dbc6aaf1e7c2 --- /dev/null +++ b/packages/interactive_media_ads/android/src/test/kotlin/dev/flutter/packages/interactive_media_ads/CompanionAdProxyApiTest.kt @@ -0,0 +1,57 @@ +// 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. + +package dev.flutter.packages.interactive_media_ads + +import com.google.ads.interactivemedia.v3.api.CompanionAd +import kotlin.test.Test +import kotlin.test.assertEquals +import org.mockito.kotlin.mock +import org.mockito.kotlin.whenever + +class CompanionAdProxyApiTest { + @Test + fun apiFramework() { + val api = TestProxyApiRegistrar().getPigeonApiCompanionAd() + + val instance = mock() + val value = "myString" + whenever(instance.apiFramework).thenReturn(value) + + assertEquals(value, api.apiFramework(instance)) + } + + @Test + fun height() { + val api = TestProxyApiRegistrar().getPigeonApiCompanionAd() + + val instance = mock() + val value = 0 + whenever(instance.height).thenReturn(value) + + assertEquals(value.toLong(), api.height(instance)) + } + + @Test + fun resourceValue() { + val api = TestProxyApiRegistrar().getPigeonApiCompanionAd() + + val instance = mock() + val value = "myString" + whenever(instance.resourceValue).thenReturn(value) + + assertEquals(value, api.resourceValue(instance)) + } + + @Test + fun width() { + val api = TestProxyApiRegistrar().getPigeonApiCompanionAd() + + val instance = mock() + val value = 0 + whenever(instance.width).thenReturn(value) + + assertEquals(value.toLong(), api.width(instance)) + } +} diff --git a/packages/interactive_media_ads/android/src/test/kotlin/dev/flutter/packages/interactive_media_ads/ContentProgressProviderProxyApiTest.kt b/packages/interactive_media_ads/android/src/test/kotlin/dev/flutter/packages/interactive_media_ads/ContentProgressProviderProxyApiTest.kt new file mode 100644 index 000000000000..55c8accb055e --- /dev/null +++ b/packages/interactive_media_ads/android/src/test/kotlin/dev/flutter/packages/interactive_media_ads/ContentProgressProviderProxyApiTest.kt @@ -0,0 +1,36 @@ +// 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. + +package dev.flutter.packages.interactive_media_ads + +import com.google.ads.interactivemedia.v3.api.player.VideoProgressUpdate +import kotlin.test.Test +import kotlin.test.assertEquals +import kotlin.test.assertTrue +import org.mockito.kotlin.mock + +class ContentProgressProviderProxyApiTest { + @Test + fun pigeon_defaultConstructor() { + val api = TestProxyApiRegistrar().getPigeonApiContentProgressProvider() + + assertTrue( + api.pigeon_defaultConstructor() + is ContentProgressProviderProxyApi.ContentProgressProviderImpl) + } + + @Test + fun setContentProgress() { + val api = TestProxyApiRegistrar().getPigeonApiContentProgressProvider() + + val instance = + ContentProgressProviderProxyApi.ContentProgressProviderImpl( + api as ContentProgressProviderProxyApi) + val mockProgressUpdate = mock() + api.setContentProgress(instance, mockProgressUpdate) + + assertEquals(mockProgressUpdate, instance.currentProgress) + assertEquals(mockProgressUpdate, instance.contentProgress) + } +} diff --git a/packages/interactive_media_ads/android/src/test/kotlin/dev/flutter/packages/interactive_media_ads/UniversalAdIdProxyApiTest.kt b/packages/interactive_media_ads/android/src/test/kotlin/dev/flutter/packages/interactive_media_ads/UniversalAdIdProxyApiTest.kt new file mode 100644 index 000000000000..5161cc687f4b --- /dev/null +++ b/packages/interactive_media_ads/android/src/test/kotlin/dev/flutter/packages/interactive_media_ads/UniversalAdIdProxyApiTest.kt @@ -0,0 +1,35 @@ +// 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. + +package dev.flutter.packages.interactive_media_ads + +import com.google.ads.interactivemedia.v3.api.UniversalAdId +import kotlin.test.Test +import kotlin.test.assertEquals +import org.mockito.kotlin.mock +import org.mockito.kotlin.whenever + +class UniversalAdIdProxyApiTest { + @Test + fun adIdRegistry() { + val api = TestProxyApiRegistrar().getPigeonApiUniversalAdId() + + val instance = mock() + val value = "myString" + whenever(instance.adIdRegistry).thenReturn(value) + + assertEquals(value, api.adIdRegistry(instance)) + } + + @Test + fun adIdValue() { + val api = TestProxyApiRegistrar().getPigeonApiUniversalAdId() + + val instance = mock() + val value = "myString" + whenever(instance.adIdValue).thenReturn(value) + + assertEquals(value, api.adIdValue(instance)) + } +} diff --git a/packages/interactive_media_ads/android/src/test/kotlin/dev/flutter/packages/interactive_media_ads/ViewGroupProxyApiTest.kt b/packages/interactive_media_ads/android/src/test/kotlin/dev/flutter/packages/interactive_media_ads/ViewGroupProxyApiTest.kt index e73e29ed8ea8..19b5c38c2155 100644 --- a/packages/interactive_media_ads/android/src/test/kotlin/dev/flutter/packages/interactive_media_ads/ViewGroupProxyApiTest.kt +++ b/packages/interactive_media_ads/android/src/test/kotlin/dev/flutter/packages/interactive_media_ads/ViewGroupProxyApiTest.kt @@ -21,4 +21,15 @@ class ViewGroupProxyApiTest { verify(instance).addView(mockView) } + + @Test + fun removeView() { + val api = TestProxyApiRegistrar().getPigeonApiViewGroup() + + val instance = mock() + val mockView = mock() + api.removeView(instance, mockView) + + verify(instance).removeView(mockView) + } } diff --git a/packages/interactive_media_ads/example/android/app/build.gradle b/packages/interactive_media_ads/example/android/app/build.gradle index f3018aafa7a5..97e8ae9a06dc 100644 --- a/packages/interactive_media_ads/example/android/app/build.gradle +++ b/packages/interactive_media_ads/example/android/app/build.gradle @@ -28,12 +28,12 @@ android { ndkVersion flutter.ndkVersion compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_11 + targetCompatibility JavaVersion.VERSION_11 } kotlinOptions { - jvmTarget = '1.8' + jvmTarget = '11' } sourceSets { diff --git a/packages/interactive_media_ads/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/interactive_media_ads/example/android/gradle/wrapper/gradle-wrapper.properties index e1ca574ef017..3c85cfe057a1 100644 --- a/packages/interactive_media_ads/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/packages/interactive_media_ads/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-8.7-all.zip diff --git a/packages/interactive_media_ads/example/android/settings.gradle b/packages/interactive_media_ads/example/android/settings.gradle index 730a32721d2c..b766503aa369 100644 --- a/packages/interactive_media_ads/example/android/settings.gradle +++ b/packages/interactive_media_ads/example/android/settings.gradle @@ -30,7 +30,7 @@ buildscript { plugins { id "dev.flutter.flutter-plugin-loader" version "1.0.0" - id "com.android.application" version "7.3.0" apply false + id "com.android.application" version "8.5.1" apply false id "org.jetbrains.kotlin.android" version "1.7.10" apply false } diff --git a/packages/interactive_media_ads/example/ios/Runner.xcodeproj/project.pbxproj b/packages/interactive_media_ads/example/ios/Runner.xcodeproj/project.pbxproj index 65f90052507b..545e2e91598f 100644 --- a/packages/interactive_media_ads/example/ios/Runner.xcodeproj/project.pbxproj +++ b/packages/interactive_media_ads/example/ios/Runner.xcodeproj/project.pbxproj @@ -20,12 +20,14 @@ 8F599BBB2C332C010090A0DF /* AdsRequestTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F599BBA2C332C010090A0DF /* AdsRequestTests.swift */; }; 8F599BBD2C332CFE0090A0DF /* ContentPlayheadTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F599BBC2C332CFE0090A0DF /* ContentPlayheadTests.swift */; }; 8F599BBF2C3335B40090A0DF /* ViewControllerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F599BBE2C3335B40090A0DF /* ViewControllerTests.swift */; }; + 8F8382A32CBDB4A4007F28E0 /* CompanionAdProxyApiTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F8382A22CBDB4A4007F28E0 /* CompanionAdProxyApiTests.swift */; }; 8F977DCF2C2B99C600A90D4B /* AdDisplayContainerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F977DCE2C2B99C600A90D4B /* AdDisplayContainerTests.swift */; }; 8F977DD32C2BA15100A90D4B /* TestProxyApiRegistrar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F977DD22C2BA15100A90D4B /* TestProxyApiRegistrar.swift */; }; 8F977DD52C2C777600A90D4B /* AdErrorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F977DD42C2C777600A90D4B /* AdErrorTests.swift */; }; 8F977DD72C2C89A600A90D4B /* AdEventTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F977DD62C2C89A600A90D4B /* AdEventTests.swift */; }; 8F977DD92C2C8C6A00A90D4B /* AdLoadingErrorDataTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F977DD82C2C8C6A00A90D4B /* AdLoadingErrorDataTests.swift */; }; 8F977DDB2C2C8D2E00A90D4B /* AdsLoadedDataTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F977DDA2C2C8D2E00A90D4B /* AdsLoadedDataTests.swift */; }; + 8FC919922CA5D86F00188068 /* FriendlyObstructionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8FC919912CA5D86F00188068 /* FriendlyObstructionTests.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 */; }; @@ -77,12 +79,14 @@ 8F599BBA2C332C010090A0DF /* AdsRequestTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdsRequestTests.swift; sourceTree = ""; }; 8F599BBC2C332CFE0090A0DF /* ContentPlayheadTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentPlayheadTests.swift; sourceTree = ""; }; 8F599BBE2C3335B40090A0DF /* ViewControllerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewControllerTests.swift; sourceTree = ""; }; + 8F8382A22CBDB4A4007F28E0 /* CompanionAdProxyApiTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CompanionAdProxyApiTests.swift; sourceTree = ""; }; 8F977DCE2C2B99C600A90D4B /* AdDisplayContainerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdDisplayContainerTests.swift; sourceTree = ""; }; 8F977DD22C2BA15100A90D4B /* TestProxyApiRegistrar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestProxyApiRegistrar.swift; sourceTree = ""; }; 8F977DD42C2C777600A90D4B /* AdErrorTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdErrorTests.swift; sourceTree = ""; }; 8F977DD62C2C89A600A90D4B /* AdEventTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdEventTests.swift; sourceTree = ""; }; 8F977DD82C2C8C6A00A90D4B /* AdLoadingErrorDataTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdLoadingErrorDataTests.swift; sourceTree = ""; }; 8F977DDA2C2C8D2E00A90D4B /* AdsLoadedDataTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdsLoadedDataTests.swift; sourceTree = ""; }; + 8FC919912CA5D86F00188068 /* FriendlyObstructionTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FriendlyObstructionTests.swift; 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; }; @@ -116,6 +120,7 @@ 331C8082294A63A400263BE5 /* RunnerTests */ = { isa = PBXGroup; children = ( + 8FC919912CA5D86F00188068 /* FriendlyObstructionTests.swift */, 8F977DCE2C2B99C600A90D4B /* AdDisplayContainerTests.swift */, 8F977DD22C2BA15100A90D4B /* TestProxyApiRegistrar.swift */, 8F977DD42C2C777600A90D4B /* AdErrorTests.swift */, @@ -130,6 +135,7 @@ 8F599BBA2C332C010090A0DF /* AdsRequestTests.swift */, 8F599BBC2C332CFE0090A0DF /* ContentPlayheadTests.swift */, 8F599BBE2C3335B40090A0DF /* ViewControllerTests.swift */, + 8F8382A22CBDB4A4007F28E0 /* CompanionAdProxyApiTests.swift */, ); path = RunnerTests; sourceTree = ""; @@ -408,6 +414,8 @@ buildActionMask = 2147483647; files = ( 8F599BBF2C3335B40090A0DF /* ViewControllerTests.swift in Sources */, + 8F8382A32CBDB4A4007F28E0 /* CompanionAdProxyApiTests.swift in Sources */, + 8FC919922CA5D86F00188068 /* FriendlyObstructionTests.swift in Sources */, 8F977DD92C2C8C6A00A90D4B /* AdLoadingErrorDataTests.swift in Sources */, 8F599BB32C2DD87D0090A0DF /* AdsLoaderTests.swift in Sources */, 8F977DD72C2C89A600A90D4B /* AdEventTests.swift in Sources */, diff --git a/packages/interactive_media_ads/example/ios/RunnerTests/AdsRenderingSettingsTests.swift b/packages/interactive_media_ads/example/ios/RunnerTests/AdsRenderingSettingsTests.swift index 5964ac4b8661..2c49b859eb01 100644 --- a/packages/interactive_media_ads/example/ios/RunnerTests/AdsRenderingSettingsTests.swift +++ b/packages/interactive_media_ads/example/ios/RunnerTests/AdsRenderingSettingsTests.swift @@ -18,4 +18,87 @@ final class AdsRenderingSettingsTests: XCTestCase { XCTAssertTrue(instance != nil) } + + func testSetMimeTypes() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiIMAAdsRenderingSettings(registrar) + + let instance = IMAAdsRenderingSettings() + let types = ["myString"] + try? api.pigeonDelegate.setMimeTypes(pigeonApi: api, pigeonInstance: instance, types: types) + + XCTAssertEqual(instance.mimeTypes, types) + } + + func testSetBitrate() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiIMAAdsRenderingSettings(registrar) + + let instance = IMAAdsRenderingSettings() + let bitrate = 0 + try? api.pigeonDelegate.setBitrate( + pigeonApi: api, pigeonInstance: instance, bitrate: Int64(bitrate)) + + XCTAssertEqual(instance.bitrate, bitrate) + } + + func testSetLoadVideoTimeout() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiIMAAdsRenderingSettings(registrar) + + let instance = IMAAdsRenderingSettings() + let seconds = 1.0 + try? api.pigeonDelegate.setLoadVideoTimeout( + pigeonApi: api, pigeonInstance: instance, seconds: seconds) + + XCTAssertEqual(instance.loadVideoTimeout, seconds) + } + + func testSetPlayAdsAfterTime() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiIMAAdsRenderingSettings(registrar) + + let instance = IMAAdsRenderingSettings() + let seconds = 1.0 + try? api.pigeonDelegate.setPlayAdsAfterTime( + pigeonApi: api, pigeonInstance: instance, seconds: seconds) + + XCTAssertEqual(instance.playAdsAfterTime, seconds) + } + + func testSetUIElements() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiIMAAdsRenderingSettings(registrar) + + let instance = IMAAdsRenderingSettings() + let types = [UIElementType.adAttribution] + try? api.pigeonDelegate.setUIElements(pigeonApi: api, pigeonInstance: instance, types: types) + + XCTAssertEqual( + instance.uiElements, [IMAUiElementType.elements_AD_ATTRIBUTION.rawValue as NSNumber]) + } + + func testSetEnablePreloading() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiIMAAdsRenderingSettings(registrar) + + let instance = IMAAdsRenderingSettings() + let enable = true + try? api.pigeonDelegate.setEnablePreloading( + pigeonApi: api, pigeonInstance: instance, enable: enable) + + XCTAssertTrue(instance.enablePreloading) + } + + func testSetLinkOpenerPresentingController() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiIMAAdsRenderingSettings(registrar) + + let instance = IMAAdsRenderingSettings() + let controller = UIViewController() + try? api.pigeonDelegate.setLinkOpenerPresentingController( + pigeonApi: api, pigeonInstance: instance, controller: controller) + + XCTAssertEqual(instance.linkOpenerPresentingController, controller) + } } diff --git a/packages/interactive_media_ads/example/ios/RunnerTests/CompanionAdProxyApiTests.swift b/packages/interactive_media_ads/example/ios/RunnerTests/CompanionAdProxyApiTests.swift new file mode 100644 index 000000000000..59391c3d5ec6 --- /dev/null +++ b/packages/interactive_media_ads/example/ios/RunnerTests/CompanionAdProxyApiTests.swift @@ -0,0 +1,77 @@ +// 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 GoogleInteractiveMediaAds +import XCTest + +@testable import interactive_media_ads + +class CompanionAdProxyApiTests: XCTestCase { + func testResourceValue() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiIMACompanionAd(registrar) + + let instance = TestCompanionAd.customInit() + let value = try? api.pigeonDelegate.resourceValue(pigeonApi: api, pigeonInstance: instance) + + XCTAssertEqual(value, instance.resourceValue) + } + + func testApiFramework() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiIMACompanionAd(registrar) + + let instance = TestCompanionAd.customInit() + let value = try? api.pigeonDelegate.apiFramework(pigeonApi: api, pigeonInstance: instance) + + XCTAssertEqual(value, instance.apiFramework) + } + + func testWidth() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiIMACompanionAd(registrar) + + let instance = TestCompanionAd.customInit() + let value = try? api.pigeonDelegate.width(pigeonApi: api, pigeonInstance: instance) + + XCTAssertEqual(value, Int64(instance.width)) + } + + func testHeight() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiIMACompanionAd(registrar) + + let instance = TestCompanionAd.customInit() + let value = try? api.pigeonDelegate.height(pigeonApi: api, pigeonInstance: instance) + + XCTAssertEqual(value, Int64(instance.height)) + } + +} + +class TestCompanionAd: IMACompanionAd { + // Workaround to subclass an Objective-C class that has an `init` constructor with NS_UNAVAILABLE + static func customInit() -> TestCompanionAd { + let instance = + TestCompanionAd.perform(NSSelectorFromString("new")).takeRetainedValue() as! TestCompanionAd + return instance + } + + override var resourceValue: String? { + return "resourceValue" + } + + override var apiFramework: String? { + return "apiFramework" + } + + override var width: Int { + return 0 + } + + override var height: Int { + return 1 + } +} diff --git a/packages/interactive_media_ads/example/ios/RunnerTests/FriendlyObstructionTests.swift b/packages/interactive_media_ads/example/ios/RunnerTests/FriendlyObstructionTests.swift new file mode 100644 index 000000000000..7fab9c42f83e --- /dev/null +++ b/packages/interactive_media_ads/example/ios/RunnerTests/FriendlyObstructionTests.swift @@ -0,0 +1,66 @@ +// 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 GoogleInteractiveMediaAds +import UIKit +import XCTest + +@testable import interactive_media_ads + +class FriendlyObstructionProxyApiTests: XCTestCase { + func testPigeonDefaultConstructor() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiIMAFriendlyObstruction(registrar) + + let instance = try? api.pigeonDelegate.pigeonDefaultConstructor( + pigeonApi: api, view: UIView(), purpose: .mediaControls, detailedReason: "myString") + XCTAssertNotNil(instance) + } + + func testPigeonDefaultConstructorWithUnknownPurpose() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiIMAFriendlyObstruction(registrar) + + XCTAssertThrowsError( + try api.pigeonDelegate.pigeonDefaultConstructor( + pigeonApi: api, view: UIView(), purpose: .unknown, detailedReason: "myString") + ) { error in + XCTAssertTrue(error is PigeonError) + } + } + + func testView() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiIMAFriendlyObstruction(registrar) + + let instance = IMAFriendlyObstruction( + view: UIView(), purpose: IMAFriendlyObstructionPurpose.closeAd, detailedReason: "reason") + let value = try? api.pigeonDelegate.view(pigeonApi: api, pigeonInstance: instance) + + XCTAssertEqual(value, instance.view) + } + + func testPurpose() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiIMAFriendlyObstruction(registrar) + + let instance = IMAFriendlyObstruction( + view: UIView(), purpose: IMAFriendlyObstructionPurpose.closeAd, detailedReason: "reason") + let value = try? api.pigeonDelegate.purpose(pigeonApi: api, pigeonInstance: instance) + + XCTAssertEqual(value, FriendlyObstructionPurpose.closeAd) + } + + func testDetailedReason() { + let registrar = TestProxyApiRegistrar() + let api = registrar.apiDelegate.pigeonApiIMAFriendlyObstruction(registrar) + + let instance = IMAFriendlyObstruction( + view: UIView(), purpose: IMAFriendlyObstructionPurpose.closeAd, detailedReason: "reason") + let value = try? api.pigeonDelegate.detailedReason(pigeonApi: api, pigeonInstance: instance) + + XCTAssertEqual(value, instance.detailedReason) + } +} diff --git a/packages/interactive_media_ads/example/lib/main.dart b/packages/interactive_media_ads/example/lib/main.dart index 13d6efff9c34..01cdb603dc01 100644 --- a/packages/interactive_media_ads/example/lib/main.dart +++ b/packages/interactive_media_ads/example/lib/main.dart @@ -32,11 +32,12 @@ class AdExampleWidget extends StatefulWidget { State createState() => _AdExampleWidgetState(); } -class _AdExampleWidgetState extends State { - // IMA sample tag for a single skippable inline video ad. See more IMA sample +class _AdExampleWidgetState extends State + with WidgetsBindingObserver { + // IMA sample tag for a pre-, mid-, and post-roll, single inline video ad. See more IMA sample // tags at https://developers.google.com/interactive-media-ads/docs/sdks/html5/client-side/tags static const String _adTagUrl = - 'https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/single_preroll_skippable&sz=640x480&ciu_szs=300x250%2C728x90&gdfp_req=1&output=vast&unviewed_position_start=1&env=vp&impl=s&correlator='; + 'https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/vmap_ad_samples&sz=640x480&cust_params=sample_ar%3Dpremidpost&ciu_szs=300x250&gdfp_req=1&ad_rule=1&output=vmap&unviewed_position_start=1&env=vp&impl=s&cmsid=496&vid=short_onecue&correlator='; // The AdsLoader instance exposes the request ads method. late final AdsLoader _adsLoader; @@ -44,17 +45,69 @@ class _AdExampleWidgetState extends State { // AdsManager exposes methods to control ad playback and listen to ad events. AdsManager? _adsManager; + // #enddocregion example_widget + // Last state received in `didChangeAppLifecycleState`. + AppLifecycleState _lastLifecycleState = AppLifecycleState.resumed; + + // #docregion example_widget // Whether the widget should be displaying the content video. The content // player is hidden while Ads are playing. - bool _shouldShowContentVideo = true; + bool _shouldShowContentVideo = false; // Controls the content video player. late final VideoPlayerController _contentVideoController; + + // Periodically updates the SDK of the current playback progress of the + // content video. + Timer? _contentProgressTimer; + + // Provides the SDK with the current playback progress of the content video. + // This is required to support mid-roll ads. + final ContentProgressProvider _contentProgressProvider = + ContentProgressProvider(); // #enddocregion example_widget // #docregion ad_and_content_players late final AdDisplayContainer _adDisplayContainer = AdDisplayContainer( onContainerAdded: (AdDisplayContainer container) { + _adsLoader = AdsLoader( + container: container, + onAdsLoaded: (OnAdsLoadedData data) { + final AdsManager manager = data.manager; + _adsManager = data.manager; + + manager.setAdsManagerDelegate(AdsManagerDelegate( + onAdEvent: (AdEvent event) { + debugPrint('OnAdEvent: ${event.type} => ${event.adData}'); + switch (event.type) { + case AdEventType.loaded: + manager.start(); + case AdEventType.contentPauseRequested: + _pauseContent(); + case AdEventType.contentResumeRequested: + _resumeContent(); + case AdEventType.allAdsCompleted: + manager.destroy(); + _adsManager = null; + case AdEventType.clicked: + case AdEventType.complete: + case _: + } + }, + onAdErrorEvent: (AdErrorEvent event) { + debugPrint('AdErrorEvent: ${event.error.message}'); + _resumeContent(); + }, + )); + + manager.init(); + }, + onAdsLoadError: (AdsLoadErrorData data) { + debugPrint('OnAdsLoadError: ${data.error.message}'); + _resumeContent(); + }, + ); + // Ads can't be requested until the `AdDisplayContainer` has been added to // the native View hierarchy. _requestAds(container); @@ -64,6 +117,11 @@ class _AdExampleWidgetState extends State { @override void initState() { super.initState(); + // #enddocregion ad_and_content_players + // Adds this instance as an observer for `AppLifecycleState` changes. + WidgetsBinding.instance.addObserver(this); + + // #docregion ad_and_content_players _contentVideoController = VideoPlayerController.networkUrl( Uri.parse( 'https://storage.googleapis.com/gvabox/media/samples/stock.mp4', @@ -72,8 +130,8 @@ class _AdExampleWidgetState extends State { ..addListener(() { if (_contentVideoController.value.isCompleted) { _adsLoader.contentComplete(); - setState(() {}); } + setState(() {}); }) ..initialize().then((_) { // Ensure the first frame is shown after the video is initialized, even before the play button has been pressed. @@ -82,60 +140,68 @@ class _AdExampleWidgetState extends State { } // #enddocregion ad_and_content_players + @override + void didChangeAppLifecycleState(AppLifecycleState state) { + switch (state) { + case AppLifecycleState.resumed: + if (!_shouldShowContentVideo) { + _adsManager?.resume(); + } + case AppLifecycleState.inactive: + // Pausing the Ad video player on Android can only be done in this state + // because it corresponds to `Activity.onPause`. This state is also + // triggered before resume, so this will only pause the Ad if the app is + // in the process of being sent to the background. + if (!_shouldShowContentVideo && + _lastLifecycleState == AppLifecycleState.resumed) { + _adsManager?.pause(); + } + case AppLifecycleState.hidden: + case AppLifecycleState.paused: + case AppLifecycleState.detached: + } + _lastLifecycleState = state; + } + // #docregion request_ads Future _requestAds(AdDisplayContainer container) { - _adsLoader = AdsLoader( - container: container, - onAdsLoaded: (OnAdsLoadedData data) { - final AdsManager manager = data.manager; - _adsManager = data.manager; - - manager.setAdsManagerDelegate(AdsManagerDelegate( - onAdEvent: (AdEvent event) { - debugPrint('OnAdEvent: ${event.type} => ${event.adData}'); - switch (event.type) { - case AdEventType.loaded: - manager.start(); - case AdEventType.contentPauseRequested: - _pauseContent(); - case AdEventType.contentResumeRequested: - _resumeContent(); - case AdEventType.allAdsCompleted: - manager.destroy(); - _adsManager = null; - case AdEventType.clicked: - case AdEventType.complete: - case _: - } - }, - onAdErrorEvent: (AdErrorEvent event) { - debugPrint('AdErrorEvent: ${event.error.message}'); - _resumeContent(); - }, - )); - - manager.init(); - }, - onAdsLoadError: (AdsLoadErrorData data) { - debugPrint('OnAdsLoadError: ${data.error.message}'); - _resumeContent(); - }, - ); - - return _adsLoader.requestAds(AdsRequest(adTagUrl: _adTagUrl)); + return _adsLoader.requestAds(AdsRequest( + adTagUrl: _adTagUrl, + contentProgressProvider: _contentProgressProvider, + )); } - Future _resumeContent() { + Future _resumeContent() async { setState(() { _shouldShowContentVideo = true; }); - return _contentVideoController.play(); + + if (_adsManager != null) { + _contentProgressTimer = Timer.periodic( + const Duration(milliseconds: 200), + (Timer timer) async { + if (_contentVideoController.value.isInitialized) { + final Duration? progress = await _contentVideoController.position; + if (progress != null) { + await _contentProgressProvider.setProgress( + progress: progress, + duration: _contentVideoController.value.duration, + ); + } + } + }, + ); + } + + await _contentVideoController.play(); } Future _pauseContent() { setState(() { _shouldShowContentVideo = false; }); + _contentProgressTimer?.cancel(); + _contentProgressTimer = null; return _contentVideoController.pause(); } // #enddocregion request_ads @@ -144,8 +210,12 @@ class _AdExampleWidgetState extends State { @override void dispose() { super.dispose(); + _contentProgressTimer?.cancel(); _contentVideoController.dispose(); _adsManager?.destroy(); + // #enddocregion dispose + WidgetsBinding.instance.removeObserver(this); + // #docregion dispose } // #enddocregion dispose diff --git a/packages/interactive_media_ads/example/pubspec.yaml b/packages/interactive_media_ads/example/pubspec.yaml index c271e4730c2f..bf8ce6d5a487 100644 --- a/packages/interactive_media_ads/example/pubspec.yaml +++ b/packages/interactive_media_ads/example/pubspec.yaml @@ -3,8 +3,8 @@ description: "Demonstrates how to use the interactive_media_ads plugin." publish_to: 'none' # Remove this line if you wish to publish to pub.dev environment: - sdk: ^3.3.0 - flutter: ">=3.19.0" + sdk: ^3.5.0 + flutter: ">=3.24.0" dependencies: flutter: @@ -16,7 +16,7 @@ dependencies: video_player: ^2.8.6 dev_dependencies: - espresso: ^0.2.0 + espresso: ^0.4.0 flutter_test: sdk: flutter integration_test: diff --git a/packages/interactive_media_ads/ios/interactive_media_ads/Sources/interactive_media_ads/AdsRenderingSettingsProxyAPIDelegate.swift b/packages/interactive_media_ads/ios/interactive_media_ads/Sources/interactive_media_ads/AdsRenderingSettingsProxyAPIDelegate.swift index 8567aded6b29..bf63b7ecdb8b 100644 --- a/packages/interactive_media_ads/ios/interactive_media_ads/Sources/interactive_media_ads/AdsRenderingSettingsProxyAPIDelegate.swift +++ b/packages/interactive_media_ads/ios/interactive_media_ads/Sources/interactive_media_ads/AdsRenderingSettingsProxyAPIDelegate.swift @@ -15,4 +15,65 @@ class AdsRenderingSettingsProxyAPIDelegate: PigeonApiDelegateIMAAdsRenderingSett { return IMAAdsRenderingSettings() } + + func setMimeTypes( + pigeonApi: PigeonApiIMAAdsRenderingSettings, pigeonInstance: IMAAdsRenderingSettings, + types: [String]? + ) throws { + pigeonInstance.mimeTypes = types + } + + func setBitrate( + pigeonApi: PigeonApiIMAAdsRenderingSettings, pigeonInstance: IMAAdsRenderingSettings, + bitrate: Int64 + ) throws { + pigeonInstance.bitrate = Int(bitrate) + } + + func setLoadVideoTimeout( + pigeonApi: PigeonApiIMAAdsRenderingSettings, pigeonInstance: IMAAdsRenderingSettings, + seconds: Double + ) throws { + pigeonInstance.loadVideoTimeout = seconds + } + + func setPlayAdsAfterTime( + pigeonApi: PigeonApiIMAAdsRenderingSettings, pigeonInstance: IMAAdsRenderingSettings, + seconds: Double + ) throws { + pigeonInstance.playAdsAfterTime = seconds + } + + func setUIElements( + pigeonApi: PigeonApiIMAAdsRenderingSettings, pigeonInstance: IMAAdsRenderingSettings, + types: [UIElementType]? + ) throws { + let nativeUiElementTypes: [NSNumber]? = try types?.map { type in + switch type { + case .adAttribution: + return IMAUiElementType.elements_AD_ATTRIBUTION.rawValue as NSNumber + case .countdown: + return IMAUiElementType.elements_COUNTDOWN.rawValue as NSNumber + case .unknown: + throw (pigeonApi.pigeonRegistrar.apiDelegate as! ProxyApiDelegate).createUnknownEnumError( + withEnum: type) + } + } + + pigeonInstance.uiElements = nativeUiElementTypes + } + + func setEnablePreloading( + pigeonApi: PigeonApiIMAAdsRenderingSettings, pigeonInstance: IMAAdsRenderingSettings, + enable: Bool + ) throws { + pigeonInstance.enablePreloading = enable + } + + func setLinkOpenerPresentingController( + pigeonApi: PigeonApiIMAAdsRenderingSettings, pigeonInstance: IMAAdsRenderingSettings, + controller: UIViewController + ) throws { + pigeonInstance.linkOpenerPresentingController = controller + } } diff --git a/packages/interactive_media_ads/ios/interactive_media_ads/Sources/interactive_media_ads/AdsRequestProxyAPIDelegate.swift b/packages/interactive_media_ads/ios/interactive_media_ads/Sources/interactive_media_ads/AdsRequestProxyAPIDelegate.swift index 429393dda5c5..c451d574ab23 100644 --- a/packages/interactive_media_ads/ios/interactive_media_ads/Sources/interactive_media_ads/AdsRequestProxyAPIDelegate.swift +++ b/packages/interactive_media_ads/ios/interactive_media_ads/Sources/interactive_media_ads/AdsRequestProxyAPIDelegate.swift @@ -13,7 +13,7 @@ class AdsRequestProxyAPIDelegate: PigeonApiDelegateIMAAdsRequest { /// The current version of the `interactive_media_ads` plugin. /// /// This must match the version in pubspec.yaml. - static let pluginVersion = "0.1.2" + static let pluginVersion = "0.2.2+13" func pigeonDefaultConstructor( pigeonApi: PigeonApiIMAAdsRequest, adTagUrl: String, adDisplayContainer: IMAAdDisplayContainer, diff --git a/packages/interactive_media_ads/ios/interactive_media_ads/Sources/interactive_media_ads/CompanionAdProxyAPIDelegate.swift b/packages/interactive_media_ads/ios/interactive_media_ads/Sources/interactive_media_ads/CompanionAdProxyAPIDelegate.swift new file mode 100644 index 000000000000..b58ad8b9055e --- /dev/null +++ b/packages/interactive_media_ads/ios/interactive_media_ads/Sources/interactive_media_ads/CompanionAdProxyAPIDelegate.swift @@ -0,0 +1,32 @@ +// 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 Foundation +import GoogleInteractiveMediaAds + +/// ProxyApi implementation for [IMACompanionAd]. +/// +/// This class may handle instantiating native object instances that are attached to a Dart instance +/// or handle method calls on the associated native class or an instance of that class. +class CompanionAdProxyAPIDelegate: PigeonApiDelegateIMACompanionAd { + func resourceValue(pigeonApi: PigeonApiIMACompanionAd, pigeonInstance: IMACompanionAd) throws + -> String? + { + return pigeonInstance.resourceValue + } + + func apiFramework(pigeonApi: PigeonApiIMACompanionAd, pigeonInstance: IMACompanionAd) throws + -> String? + { + return pigeonInstance.apiFramework + } + + func width(pigeonApi: PigeonApiIMACompanionAd, pigeonInstance: IMACompanionAd) throws -> Int64 { + return Int64(pigeonInstance.width) + } + + func height(pigeonApi: PigeonApiIMACompanionAd, pigeonInstance: IMACompanionAd) throws -> Int64 { + return Int64(pigeonInstance.height) + } +} diff --git a/packages/interactive_media_ads/ios/interactive_media_ads/Sources/interactive_media_ads/FriendlyObstructionAPIDelegate.swift b/packages/interactive_media_ads/ios/interactive_media_ads/Sources/interactive_media_ads/FriendlyObstructionAPIDelegate.swift new file mode 100644 index 000000000000..e03843bc2992 --- /dev/null +++ b/packages/interactive_media_ads/ios/interactive_media_ads/Sources/interactive_media_ads/FriendlyObstructionAPIDelegate.swift @@ -0,0 +1,64 @@ +// 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 Foundation +import GoogleInteractiveMediaAds +import UIKit + +/// ProxyApi implementation for [IMAFriendlyObstruction]. +/// +/// This class may handle instantiating native object instances that are attached to a Dart instance +/// or handle method calls on the associated native class or an instance of that class. +class FriendlyObstructionProxyAPIDelegate: PigeonApiDelegateIMAFriendlyObstruction { + func pigeonDefaultConstructor( + pigeonApi: PigeonApiIMAFriendlyObstruction, view: UIView, purpose: FriendlyObstructionPurpose, + detailedReason: String? + ) throws -> IMAFriendlyObstruction { + var nativePurpose: IMAFriendlyObstructionPurpose + switch purpose { + case .mediaControls: + nativePurpose = IMAFriendlyObstructionPurpose.mediaControls + case .closeAd: + nativePurpose = IMAFriendlyObstructionPurpose.closeAd + case .notVisible: + nativePurpose = IMAFriendlyObstructionPurpose.notVisible + case .other: + nativePurpose = IMAFriendlyObstructionPurpose.other + case .unknown: + throw (pigeonApi.pigeonRegistrar.apiDelegate as! ProxyApiDelegate).createUnknownEnumError( + withEnum: purpose) + } + return IMAFriendlyObstruction( + view: view, purpose: nativePurpose, detailedReason: detailedReason) + } + + func view(pigeonApi: PigeonApiIMAFriendlyObstruction, pigeonInstance: IMAFriendlyObstruction) + throws -> UIView + { + return pigeonInstance.view + } + + func purpose(pigeonApi: PigeonApiIMAFriendlyObstruction, pigeonInstance: IMAFriendlyObstruction) + throws -> FriendlyObstructionPurpose + { + switch pigeonInstance.purpose { + case .mediaControls: + return .mediaControls + case .closeAd: + return .closeAd + case .notVisible: + return .notVisible + case .other: + return .other + @unknown default: + return .unknown + } + } + + func detailedReason( + pigeonApi: PigeonApiIMAFriendlyObstruction, pigeonInstance: IMAFriendlyObstruction + ) throws -> String? { + return pigeonInstance.detailedReason + } +} diff --git a/packages/interactive_media_ads/ios/interactive_media_ads/Sources/interactive_media_ads/InteractiveMediaAdsLibrary.g.swift b/packages/interactive_media_ads/ios/interactive_media_ads/Sources/interactive_media_ads/InteractiveMediaAdsLibrary.g.swift index 4ceb8ad33802..3100f774490d 100644 --- a/packages/interactive_media_ads/ios/interactive_media_ads/Sources/interactive_media_ads/InteractiveMediaAdsLibrary.g.swift +++ b/packages/interactive_media_ads/ios/interactive_media_ads/Sources/interactive_media_ads/InteractiveMediaAdsLibrary.g.swift @@ -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 (v21.2.0), do not edit directly. +// Autogenerated from Pigeon (v22.5.0), do not edit directly. // See also: https://pub.dev/packages/pigeon import Foundation @@ -75,30 +75,32 @@ private func nilOrValue(_ value: Any?) -> T? { return value as! T? } /// Handles the callback when an object is deallocated. -protocol InteractiveMediaAdsLibraryPigeonFinalizerDelegate: AnyObject { +protocol InteractiveMediaAdsLibraryPigeonInternalFinalizerDelegate: AnyObject { /// Invoked when the strong reference of an object is deallocated in an `InstanceManager`. func onDeinit(identifier: Int64) } // Attaches to an object to receive a callback when the object is deallocated. -internal final class InteractiveMediaAdsLibraryPigeonFinalizer { +internal final class InteractiveMediaAdsLibraryPigeonInternalFinalizer { private static let associatedObjectKey = malloc(1)! private let identifier: Int64 // Reference to the delegate is weak because the callback should be ignored if the // `InstanceManager` is deallocated. - private weak var delegate: InteractiveMediaAdsLibraryPigeonFinalizerDelegate? + private weak var delegate: InteractiveMediaAdsLibraryPigeonInternalFinalizerDelegate? - private init(identifier: Int64, delegate: InteractiveMediaAdsLibraryPigeonFinalizerDelegate) { + private init( + identifier: Int64, delegate: InteractiveMediaAdsLibraryPigeonInternalFinalizerDelegate + ) { self.identifier = identifier self.delegate = delegate } internal static func attach( to instance: AnyObject, identifier: Int64, - delegate: InteractiveMediaAdsLibraryPigeonFinalizerDelegate + delegate: InteractiveMediaAdsLibraryPigeonInternalFinalizerDelegate ) { - let finalizer = InteractiveMediaAdsLibraryPigeonFinalizer( + let finalizer = InteractiveMediaAdsLibraryPigeonInternalFinalizer( identifier: identifier, delegate: delegate) objc_setAssociatedObject(instance, associatedObjectKey, finalizer, .OBJC_ASSOCIATION_RETAIN) } @@ -120,7 +122,7 @@ internal final class InteractiveMediaAdsLibraryPigeonFinalizer { /// When an instance is added with an identifier, either can be used to retrieve the other. /// /// Added instances are added as a weak reference and a strong reference. When the strong -/// reference is removed and the weak reference is deallocated,`InteractiveMediaAdsLibraryPigeonFinalizerDelegate.onDeinit` +/// reference is removed and the weak reference is deallocated,`InteractiveMediaAdsLibraryPigeonInternalFinalizerDelegate.onDeinit` /// is called with the instance's identifier. However, if the strong reference is removed and then the identifier is /// retrieved with the intention to pass the identifier to Dart (e.g. by calling `identifierWithStrongReference`), /// the strong reference to the instance is re-added. The strong reference will then need to be removed manually @@ -141,10 +143,10 @@ final class InteractiveMediaAdsLibraryPigeonInstanceManager { keyOptions: .strongMemory, valueOptions: [.weakMemory, .objectPointerPersonality]) private let strongInstances: NSMapTable = NSMapTable( keyOptions: .strongMemory, valueOptions: [.strongMemory, .objectPointerPersonality]) - private let finalizerDelegate: InteractiveMediaAdsLibraryPigeonFinalizerDelegate + private let finalizerDelegate: InteractiveMediaAdsLibraryPigeonInternalFinalizerDelegate private var nextIdentifier: Int64 = minHostCreatedIdentifier - public init(finalizerDelegate: InteractiveMediaAdsLibraryPigeonFinalizerDelegate) { + public init(finalizerDelegate: InteractiveMediaAdsLibraryPigeonInternalFinalizerDelegate) { self.finalizerDelegate = finalizerDelegate } @@ -215,7 +217,7 @@ final class InteractiveMediaAdsLibraryPigeonInstanceManager { identifiers.setObject(NSNumber(value: identifier), forKey: instance) weakInstances.setObject(instance, forKey: NSNumber(value: identifier)) strongInstances.setObject(instance, forKey: NSNumber(value: identifier)) - InteractiveMediaAdsLibraryPigeonFinalizer.attach( + InteractiveMediaAdsLibraryPigeonInternalFinalizer.attach( to: instance, identifier: identifier, delegate: finalizerDelegate) } @@ -295,7 +297,7 @@ final class InteractiveMediaAdsLibraryPigeonInstanceManager { private class InteractiveMediaAdsLibraryPigeonInstanceManagerApi { /// The codec used for serializing messages. - let codec = FlutterStandardMessageCodec.sharedInstance() + var codec: FlutterStandardMessageCodec { InteractiveMediaAdsLibraryPigeonCodec.shared } /// Handles sending and receiving messages with Dart. unowned let binaryMessenger: FlutterBinaryMessenger @@ -309,15 +311,15 @@ private class InteractiveMediaAdsLibraryPigeonInstanceManagerApi { binaryMessenger: FlutterBinaryMessenger, instanceManager: InteractiveMediaAdsLibraryPigeonInstanceManager? ) { - let codec = FlutterStandardMessageCodec.sharedInstance() + let codec = InteractiveMediaAdsLibraryPigeonCodec.shared let removeStrongReferenceChannel = FlutterBasicMessageChannel( name: - "dev.flutter.pigeon.interactive_media_ads.PigeonInstanceManagerApi.removeStrongReference", + "dev.flutter.pigeon.interactive_media_ads.PigeonInternalInstanceManager.removeStrongReference", binaryMessenger: binaryMessenger, codec: codec) if let instanceManager = instanceManager { removeStrongReferenceChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let identifierArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) + let identifierArg = args[0] as! Int64 do { let _: AnyObject? = try instanceManager.removeInstance(withIdentifier: identifierArg) reply(wrapResult(nil)) @@ -329,7 +331,7 @@ private class InteractiveMediaAdsLibraryPigeonInstanceManagerApi { removeStrongReferenceChannel.setMessageHandler(nil) } let clearChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.interactive_media_ads.PigeonInstanceManagerApi.clear", + name: "dev.flutter.pigeon.interactive_media_ads.PigeonInternalInstanceManager.clear", binaryMessenger: binaryMessenger, codec: codec) if let instanceManager = instanceManager { clearChannel.setMessageHandler { _, reply in @@ -350,7 +352,7 @@ private class InteractiveMediaAdsLibraryPigeonInstanceManagerApi { identifier identifierArg: Int64, completion: @escaping (Result) -> Void ) { let channelName: String = - "dev.flutter.pigeon.interactive_media_ads.PigeonInstanceManagerApi.removeStrongReference" + "dev.flutter.pigeon.interactive_media_ads.PigeonInternalInstanceManager.removeStrongReference" let channel = FlutterBasicMessageChannel( name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([identifierArg] as [Any?]) { response in @@ -438,6 +440,15 @@ protocol InteractiveMediaAdsLibraryPigeonProxyApiDelegate { /// `NSObject` to the Dart `InstanceManager` and make calls to Dart. func pigeonApiNSObject(_ registrar: InteractiveMediaAdsLibraryPigeonProxyApiRegistrar) -> PigeonApiNSObject + /// An implementation of [PigeonApiIMAFriendlyObstruction] used to add a new Dart instance of + /// `IMAFriendlyObstruction` to the Dart `InstanceManager` and make calls to Dart. + func pigeonApiIMAFriendlyObstruction( + _ registrar: InteractiveMediaAdsLibraryPigeonProxyApiRegistrar + ) -> PigeonApiIMAFriendlyObstruction + /// An implementation of [PigeonApiIMACompanionAd] used to add a new Dart instance of + /// `IMACompanionAd` to the Dart `InstanceManager` and make calls to Dart. + func pigeonApiIMACompanionAd(_ registrar: InteractiveMediaAdsLibraryPigeonProxyApiRegistrar) + -> PigeonApiIMACompanionAd } extension InteractiveMediaAdsLibraryPigeonProxyApiDelegate { @@ -469,14 +480,14 @@ open class InteractiveMediaAdsLibraryPigeonProxyApiRegistrar { var codec: FlutterStandardMessageCodec { if _codec == nil { _codec = FlutterStandardMessageCodec( - readerWriter: InteractiveMediaAdsLibraryPigeonProxyApiCodecReaderWriter( + readerWriter: InteractiveMediaAdsLibraryPigeonInternalProxyApiCodecReaderWriter( pigeonRegistrar: self)) } return _codec! } private class InstanceManagerApiFinalizerDelegate: - InteractiveMediaAdsLibraryPigeonFinalizerDelegate + InteractiveMediaAdsLibraryPigeonInternalFinalizerDelegate { let api: InteractiveMediaAdsLibraryPigeonInstanceManagerApi @@ -523,6 +534,8 @@ open class InteractiveMediaAdsLibraryPigeonProxyApiRegistrar { binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiIMAAdsManagerDelegate(self)) PigeonApiIMAAdsRenderingSettings.setUpMessageHandlers( binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiIMAAdsRenderingSettings(self)) + PigeonApiIMAFriendlyObstruction.setUpMessageHandlers( + binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiIMAFriendlyObstruction(self)) } func tearDown() { InteractiveMediaAdsLibraryPigeonInstanceManagerApi.setUpMessageHandlers( @@ -537,13 +550,15 @@ open class InteractiveMediaAdsLibraryPigeonProxyApiRegistrar { PigeonApiIMAAdsManagerDelegate.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) PigeonApiIMAAdsRenderingSettings.setUpMessageHandlers( binaryMessenger: binaryMessenger, api: nil) + PigeonApiIMAFriendlyObstruction.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) } } -private class InteractiveMediaAdsLibraryPigeonProxyApiCodecReaderWriter: FlutterStandardReaderWriter +private class InteractiveMediaAdsLibraryPigeonInternalProxyApiCodecReaderWriter: + FlutterStandardReaderWriter { unowned let pigeonRegistrar: InteractiveMediaAdsLibraryPigeonProxyApiRegistrar - private class InteractiveMediaAdsLibraryPigeonProxyApiCodecReader: + private class InteractiveMediaAdsLibraryPigeonInternalProxyApiCodecReader: InteractiveMediaAdsLibraryPigeonCodecReader { unowned let pigeonRegistrar: InteractiveMediaAdsLibraryPigeonProxyApiRegistrar @@ -566,7 +581,7 @@ private class InteractiveMediaAdsLibraryPigeonProxyApiCodecReaderWriter: Flutter } } - private class InteractiveMediaAdsLibraryPigeonProxyApiCodecWriter: + private class InteractiveMediaAdsLibraryPigeonInternalProxyApiCodecWriter: InteractiveMediaAdsLibraryPigeonCodecWriter { unowned let pigeonRegistrar: InteractiveMediaAdsLibraryPigeonProxyApiRegistrar @@ -581,7 +596,8 @@ private class InteractiveMediaAdsLibraryPigeonProxyApiCodecReaderWriter: Flutter || value is Double || value is FlutterStandardTypedData || value is Int64 || value is String || value is AdErrorType || value is AdErrorCode || value is AdEventType || value is KeyValueObservingOptions || value is KeyValueChange - || value is KeyValueChangeKey + || value is KeyValueChangeKey || value is FriendlyObstructionPurpose + || value is UIElementType { super.writeValue(value) return @@ -757,6 +773,29 @@ private class InteractiveMediaAdsLibraryPigeonProxyApiCodecReaderWriter: Flutter return } + if let instance = value as? IMAFriendlyObstruction { + pigeonRegistrar.apiDelegate.pigeonApiIMAFriendlyObstruction(pigeonRegistrar) + .pigeonNewInstance( + pigeonInstance: instance + ) { _ in } + super.writeByte(128) + super.writeValue( + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) + return + } + + if let instance = value as? IMACompanionAd { + pigeonRegistrar.apiDelegate.pigeonApiIMACompanionAd(pigeonRegistrar).pigeonNewInstance( + pigeonInstance: instance + ) { _ in } + super.writeByte(128) + super.writeValue( + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) + return + } + if let instance = value as? NSObject { pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar).pigeonNewInstance( pigeonInstance: instance @@ -776,7 +815,9 @@ private class InteractiveMediaAdsLibraryPigeonProxyApiCodecReaderWriter: Flutter pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance)!) } else { print("Unsupported value: \(value) of \(type(of: value))") - assert(false, "Unsupported value for InteractiveMediaAdsLibraryPigeonProxyApiCodecWriter") + assert( + false, "Unsupported value for InteractiveMediaAdsLibraryPigeonInternalProxyApiCodecWriter" + ) } } @@ -787,12 +828,12 @@ private class InteractiveMediaAdsLibraryPigeonProxyApiCodecReaderWriter: Flutter } override func reader(with data: Data) -> FlutterStandardReader { - return InteractiveMediaAdsLibraryPigeonProxyApiCodecReader( + return InteractiveMediaAdsLibraryPigeonInternalProxyApiCodecReader( data: data, pigeonRegistrar: pigeonRegistrar) } override func writer(with data: NSMutableData) -> FlutterStandardWriter { - return InteractiveMediaAdsLibraryPigeonProxyApiCodecWriter( + return InteractiveMediaAdsLibraryPigeonInternalProxyApiCodecWriter( data: data, pigeonRegistrar: pigeonRegistrar) } } @@ -992,51 +1033,82 @@ enum KeyValueChangeKey: Int { /// The key is not recognized by this wrapper. case unknown = 5 } + +/// A list of purposes for which an obstruction would be registered as friendly. +/// +/// See https://developers.google.com/ad-manager/dynamic-ad-insertion/sdk/ios/reference/Enums/IMAFriendlyObstructionPurpose.html. +enum FriendlyObstructionPurpose: Int { + case mediaControls = 0 + case closeAd = 1 + case notVisible = 2 + case other = 3 + /// The purpose type is not recognized by this wrapper. + case unknown = 4 +} + +/// Different UI elements that can be customized. +/// +/// See https://developers.google.com/ad-manager/dynamic-ad-insertion/sdk/ios/reference/Enums/IMAUiElementType.html. +enum UIElementType: Int { + /// Ad attribution UI element. + case adAttribution = 0 + /// Ad countdown element. + case countdown = 1 + /// The element is not recognized by this wrapper. + case unknown = 2 +} + private class InteractiveMediaAdsLibraryPigeonCodecReader: FlutterStandardReader { override func readValue(ofType type: UInt8) -> Any? { switch type { case 129: - var enumResult: AdErrorType? = nil - let enumResultAsInt: Int? = nilOrValue(self.readValue() as? Int) + let enumResultAsInt: Int? = nilOrValue(self.readValue() as! Int?) if let enumResultAsInt = enumResultAsInt { - enumResult = AdErrorType(rawValue: enumResultAsInt) + return AdErrorType(rawValue: enumResultAsInt) } - return enumResult + return nil case 130: - var enumResult: AdErrorCode? = nil - let enumResultAsInt: Int? = nilOrValue(self.readValue() as? Int) + let enumResultAsInt: Int? = nilOrValue(self.readValue() as! Int?) if let enumResultAsInt = enumResultAsInt { - enumResult = AdErrorCode(rawValue: enumResultAsInt) + return AdErrorCode(rawValue: enumResultAsInt) } - return enumResult + return nil case 131: - var enumResult: AdEventType? = nil - let enumResultAsInt: Int? = nilOrValue(self.readValue() as? Int) + let enumResultAsInt: Int? = nilOrValue(self.readValue() as! Int?) if let enumResultAsInt = enumResultAsInt { - enumResult = AdEventType(rawValue: enumResultAsInt) + return AdEventType(rawValue: enumResultAsInt) } - return enumResult + return nil case 132: - var enumResult: KeyValueObservingOptions? = nil - let enumResultAsInt: Int? = nilOrValue(self.readValue() as? Int) + let enumResultAsInt: Int? = nilOrValue(self.readValue() as! Int?) if let enumResultAsInt = enumResultAsInt { - enumResult = KeyValueObservingOptions(rawValue: enumResultAsInt) + return KeyValueObservingOptions(rawValue: enumResultAsInt) } - return enumResult + return nil case 133: - var enumResult: KeyValueChange? = nil - let enumResultAsInt: Int? = nilOrValue(self.readValue() as? Int) + let enumResultAsInt: Int? = nilOrValue(self.readValue() as! Int?) if let enumResultAsInt = enumResultAsInt { - enumResult = KeyValueChange(rawValue: enumResultAsInt) + return KeyValueChange(rawValue: enumResultAsInt) } - return enumResult + return nil case 134: - var enumResult: KeyValueChangeKey? = nil - let enumResultAsInt: Int? = nilOrValue(self.readValue() as? Int) + let enumResultAsInt: Int? = nilOrValue(self.readValue() as! Int?) + if let enumResultAsInt = enumResultAsInt { + return KeyValueChangeKey(rawValue: enumResultAsInt) + } + return nil + case 135: + let enumResultAsInt: Int? = nilOrValue(self.readValue() as! Int?) + if let enumResultAsInt = enumResultAsInt { + return FriendlyObstructionPurpose(rawValue: enumResultAsInt) + } + return nil + case 136: + let enumResultAsInt: Int? = nilOrValue(self.readValue() as! Int?) if let enumResultAsInt = enumResultAsInt { - enumResult = KeyValueChangeKey(rawValue: enumResultAsInt) + return UIElementType(rawValue: enumResultAsInt) } - return enumResult + return nil default: return super.readValue(ofType: type) } @@ -1063,6 +1135,12 @@ private class InteractiveMediaAdsLibraryPigeonCodecWriter: FlutterStandardWriter } else if let value = value as? KeyValueChangeKey { super.writeByte(134) super.writeValue(value.rawValue) + } else if let value = value as? FriendlyObstructionPurpose { + super.writeByte(135) + super.writeValue(value.rawValue) + } else if let value = value as? UIElementType { + super.writeByte(136) + super.writeValue(value.rawValue) } else { super.writeValue(value) } @@ -1115,7 +1193,7 @@ final class PigeonApiIMAAdDisplayContainer: PigeonApiProtocolIMAAdDisplayContain let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: InteractiveMediaAdsLibraryPigeonProxyApiCodecReaderWriter( + readerWriter: InteractiveMediaAdsLibraryPigeonInternalProxyApiCodecReaderWriter( pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( @@ -1125,7 +1203,7 @@ final class PigeonApiIMAAdDisplayContainer: PigeonApiProtocolIMAAdDisplayContain if let api = api { pigeonDefaultConstructorChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let pigeonIdentifierArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) + let pigeonIdentifierArg = args[0] as! Int64 let adContainerArg = args[1] as! UIView let adContainerViewControllerArg: UIViewController? = nilOrValue(args[2]) do { @@ -1283,7 +1361,7 @@ final class PigeonApiUIViewController: PigeonApiProtocolUIViewController { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: InteractiveMediaAdsLibraryPigeonProxyApiCodecReaderWriter( + readerWriter: InteractiveMediaAdsLibraryPigeonInternalProxyApiCodecReaderWriter( pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( @@ -1292,7 +1370,7 @@ final class PigeonApiUIViewController: PigeonApiProtocolUIViewController { if let api = api { pigeonDefaultConstructorChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let pigeonIdentifierArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) + let pigeonIdentifierArg = args[0] as! Int64 do { api.pigeonRegistrar.instanceManager.addDartCreatedInstance( try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api), @@ -1312,7 +1390,7 @@ final class PigeonApiUIViewController: PigeonApiProtocolUIViewController { viewChannel.setMessageHandler { message, reply in let args = message as! [Any?] let pigeonInstanceArg = args[0] as! UIViewController - let pigeonIdentifierArg = args[1] is Int64 ? args[1] as! Int64 : Int64(args[1] as! Int32) + let pigeonIdentifierArg = args[1] as! Int64 do { api.pigeonRegistrar.instanceManager.addDartCreatedInstance( try api.pigeonDelegate.view(pigeonApi: api, pigeonInstance: pigeonInstanceArg), @@ -1434,7 +1512,7 @@ final class PigeonApiIMAContentPlayhead: PigeonApiProtocolIMAContentPlayhead { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: InteractiveMediaAdsLibraryPigeonProxyApiCodecReaderWriter( + readerWriter: InteractiveMediaAdsLibraryPigeonInternalProxyApiCodecReaderWriter( pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( @@ -1443,7 +1521,7 @@ final class PigeonApiIMAContentPlayhead: PigeonApiProtocolIMAContentPlayhead { if let api = api { pigeonDefaultConstructorChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let pigeonIdentifierArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) + let pigeonIdentifierArg = args[0] as! Int64 do { api.pigeonRegistrar.instanceManager.addDartCreatedInstance( try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api), @@ -1557,7 +1635,7 @@ final class PigeonApiIMAAdsLoader: PigeonApiProtocolIMAAdsLoader { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: InteractiveMediaAdsLibraryPigeonProxyApiCodecReaderWriter( + readerWriter: InteractiveMediaAdsLibraryPigeonInternalProxyApiCodecReaderWriter( pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( @@ -1566,7 +1644,7 @@ final class PigeonApiIMAAdsLoader: PigeonApiProtocolIMAAdsLoader { if let api = api { pigeonDefaultConstructorChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let pigeonIdentifierArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) + let pigeonIdentifierArg = args[0] as! Int64 let settingsArg: IMASettings? = nilOrValue(args[1]) do { api.pigeonRegistrar.instanceManager.addDartCreatedInstance( @@ -1771,7 +1849,7 @@ final class PigeonApiIMAAdsRequest: PigeonApiProtocolIMAAdsRequest { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: InteractiveMediaAdsLibraryPigeonProxyApiCodecReaderWriter( + readerWriter: InteractiveMediaAdsLibraryPigeonInternalProxyApiCodecReaderWriter( pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( @@ -1780,7 +1858,7 @@ final class PigeonApiIMAAdsRequest: PigeonApiProtocolIMAAdsRequest { if let api = api { pigeonDefaultConstructorChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let pigeonIdentifierArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) + let pigeonIdentifierArg = args[0] as! Int64 let adTagUrlArg = args[1] as! String let adDisplayContainerArg = args[2] as! IMAAdDisplayContainer let contentPlayheadArg: IMAContentPlayhead? = nilOrValue(args[3]) @@ -1879,7 +1957,7 @@ final class PigeonApiIMAAdsLoaderDelegate: PigeonApiProtocolIMAAdsLoaderDelegate let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: InteractiveMediaAdsLibraryPigeonProxyApiCodecReaderWriter( + readerWriter: InteractiveMediaAdsLibraryPigeonInternalProxyApiCodecReaderWriter( pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( @@ -1889,7 +1967,7 @@ final class PigeonApiIMAAdsLoaderDelegate: PigeonApiProtocolIMAAdsLoaderDelegate if let api = api { pigeonDefaultConstructorChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let pigeonIdentifierArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) + let pigeonIdentifierArg = args[0] as! Int64 do { api.pigeonRegistrar.instanceManager.addDartCreatedInstance( try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api), @@ -2248,7 +2326,7 @@ final class PigeonApiIMAAdsManager: PigeonApiProtocolIMAAdsManager { let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: InteractiveMediaAdsLibraryPigeonProxyApiCodecReaderWriter( + readerWriter: InteractiveMediaAdsLibraryPigeonInternalProxyApiCodecReaderWriter( pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() let setDelegateChannel = FlutterBasicMessageChannel( @@ -2483,7 +2561,7 @@ final class PigeonApiIMAAdsManagerDelegate: PigeonApiProtocolIMAAdsManagerDelega let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: InteractiveMediaAdsLibraryPigeonProxyApiCodecReaderWriter( + readerWriter: InteractiveMediaAdsLibraryPigeonInternalProxyApiCodecReaderWriter( pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( @@ -2493,7 +2571,7 @@ final class PigeonApiIMAAdsManagerDelegate: PigeonApiProtocolIMAAdsManagerDelega if let api = api { pigeonDefaultConstructorChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let pigeonIdentifierArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) + let pigeonIdentifierArg = args[0] as! Int64 do { api.pigeonRegistrar.instanceManager.addDartCreatedInstance( try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api), @@ -2748,6 +2826,42 @@ final class PigeonApiIMAAdEvent: PigeonApiProtocolIMAAdEvent { protocol PigeonApiDelegateIMAAdsRenderingSettings { func pigeonDefaultConstructor(pigeonApi: PigeonApiIMAAdsRenderingSettings) throws -> IMAAdsRenderingSettings + /// If specified, the SDK will play the media with MIME type on the list. + func setMimeTypes( + pigeonApi: PigeonApiIMAAdsRenderingSettings, pigeonInstance: IMAAdsRenderingSettings, + types: [String]?) throws + /// Maximum recommended bitrate. + /// + /// The value is in kbit/s. + func setBitrate( + pigeonApi: PigeonApiIMAAdsRenderingSettings, pigeonInstance: IMAAdsRenderingSettings, + bitrate: Int64) throws + /// Timeout (in seconds) when loading a video ad media file. + /// + /// Use -1 for the default of 8 seconds. + func setLoadVideoTimeout( + pigeonApi: PigeonApiIMAAdsRenderingSettings, pigeonInstance: IMAAdsRenderingSettings, + seconds: Double) throws + /// For VMAP and ad rules playlists, only play ad breaks scheduled after this + /// time (in seconds). + func setPlayAdsAfterTime( + pigeonApi: PigeonApiIMAAdsRenderingSettings, pigeonInstance: IMAAdsRenderingSettings, + seconds: Double) throws + /// Specifies the list of UI elements that should be visible. + func setUIElements( + pigeonApi: PigeonApiIMAAdsRenderingSettings, pigeonInstance: IMAAdsRenderingSettings, + types: [UIElementType]?) throws + /// Whether or not the SDK will preload ad media. + /// + /// Default is YES. + func setEnablePreloading( + pigeonApi: PigeonApiIMAAdsRenderingSettings, pigeonInstance: IMAAdsRenderingSettings, + enable: Bool) throws + /// Specifies the optional UIViewController that will be used to open links + /// in-app. + func setLinkOpenerPresentingController( + pigeonApi: PigeonApiIMAAdsRenderingSettings, pigeonInstance: IMAAdsRenderingSettings, + controller: UIViewController) throws } protocol PigeonApiProtocolIMAAdsRenderingSettings { @@ -2774,7 +2888,7 @@ final class PigeonApiIMAAdsRenderingSettings: PigeonApiProtocolIMAAdsRenderingSe let codec: FlutterStandardMessageCodec = api != nil ? FlutterStandardMessageCodec( - readerWriter: InteractiveMediaAdsLibraryPigeonProxyApiCodecReaderWriter( + readerWriter: InteractiveMediaAdsLibraryPigeonInternalProxyApiCodecReaderWriter( pigeonRegistrar: api!.pigeonRegistrar)) : FlutterStandardMessageCodec.sharedInstance() let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( @@ -2784,7 +2898,7 @@ final class PigeonApiIMAAdsRenderingSettings: PigeonApiProtocolIMAAdsRenderingSe if let api = api { pigeonDefaultConstructorChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let pigeonIdentifierArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) + let pigeonIdentifierArg = args[0] as! Int64 do { api.pigeonRegistrar.instanceManager.addDartCreatedInstance( try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api), @@ -2797,6 +2911,140 @@ final class PigeonApiIMAAdsRenderingSettings: PigeonApiProtocolIMAAdsRenderingSe } else { pigeonDefaultConstructorChannel.setMessageHandler(nil) } + let setMimeTypesChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.interactive_media_ads.IMAAdsRenderingSettings.setMimeTypes", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setMimeTypesChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! IMAAdsRenderingSettings + let typesArg: [String]? = nilOrValue(args[1]) + do { + try api.pigeonDelegate.setMimeTypes( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, types: typesArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + setMimeTypesChannel.setMessageHandler(nil) + } + let setBitrateChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.interactive_media_ads.IMAAdsRenderingSettings.setBitrate", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setBitrateChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! IMAAdsRenderingSettings + let bitrateArg = args[1] as! Int64 + do { + try api.pigeonDelegate.setBitrate( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, bitrate: bitrateArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + setBitrateChannel.setMessageHandler(nil) + } + let setLoadVideoTimeoutChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.interactive_media_ads.IMAAdsRenderingSettings.setLoadVideoTimeout", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setLoadVideoTimeoutChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! IMAAdsRenderingSettings + let secondsArg = args[1] as! Double + do { + try api.pigeonDelegate.setLoadVideoTimeout( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, seconds: secondsArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + setLoadVideoTimeoutChannel.setMessageHandler(nil) + } + let setPlayAdsAfterTimeChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.interactive_media_ads.IMAAdsRenderingSettings.setPlayAdsAfterTime", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setPlayAdsAfterTimeChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! IMAAdsRenderingSettings + let secondsArg = args[1] as! Double + do { + try api.pigeonDelegate.setPlayAdsAfterTime( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, seconds: secondsArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + setPlayAdsAfterTimeChannel.setMessageHandler(nil) + } + let setUIElementsChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.interactive_media_ads.IMAAdsRenderingSettings.setUIElements", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setUIElementsChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! IMAAdsRenderingSettings + let typesArg: [UIElementType]? = nilOrValue(args[1]) + do { + try api.pigeonDelegate.setUIElements( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, types: typesArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + setUIElementsChannel.setMessageHandler(nil) + } + let setEnablePreloadingChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.interactive_media_ads.IMAAdsRenderingSettings.setEnablePreloading", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setEnablePreloadingChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! IMAAdsRenderingSettings + let enableArg = args[1] as! Bool + do { + try api.pigeonDelegate.setEnablePreloading( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, enable: enableArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + setEnablePreloadingChannel.setMessageHandler(nil) + } + let setLinkOpenerPresentingControllerChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.interactive_media_ads.IMAAdsRenderingSettings.setLinkOpenerPresentingController", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setLinkOpenerPresentingControllerChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! IMAAdsRenderingSettings + let controllerArg = args[1] as! UIViewController + do { + try api.pigeonDelegate.setLinkOpenerPresentingController( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, controller: controllerArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + setLinkOpenerPresentingControllerChannel.setMessageHandler(nil) + } } ///Creates a Dart instance of IMAAdsRenderingSettings and attaches it to [pigeonInstance]. @@ -2895,3 +3143,207 @@ final class PigeonApiNSObject: PigeonApiProtocolNSObject { } } } +protocol PigeonApiDelegateIMAFriendlyObstruction { + /// Initializes a friendly obstruction. + func pigeonDefaultConstructor( + pigeonApi: PigeonApiIMAFriendlyObstruction, view: UIView, purpose: FriendlyObstructionPurpose, + detailedReason: String? + ) throws -> IMAFriendlyObstruction + /// The view causing the obstruction. + func view(pigeonApi: PigeonApiIMAFriendlyObstruction, pigeonInstance: IMAFriendlyObstruction) + throws -> UIView + /// The purpose for registering the obstruction as friendly. + func purpose(pigeonApi: PigeonApiIMAFriendlyObstruction, pigeonInstance: IMAFriendlyObstruction) + throws -> FriendlyObstructionPurpose + /// Optional, detailed reasoning for registering this obstruction as friendly. + /// + /// If the detailedReason is not null, it must follow the IAB standard by + /// being 50 characters or less and only containing characters A-z, 0-9, or + /// spaces. + func detailedReason( + pigeonApi: PigeonApiIMAFriendlyObstruction, pigeonInstance: IMAFriendlyObstruction + ) throws -> String? +} + +protocol PigeonApiProtocolIMAFriendlyObstruction { +} + +final class PigeonApiIMAFriendlyObstruction: PigeonApiProtocolIMAFriendlyObstruction { + unowned let pigeonRegistrar: InteractiveMediaAdsLibraryPigeonProxyApiRegistrar + let pigeonDelegate: PigeonApiDelegateIMAFriendlyObstruction + ///An implementation of [NSObject] used to access callback methods + var pigeonApiNSObject: PigeonApiNSObject { + return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) + } + + init( + pigeonRegistrar: InteractiveMediaAdsLibraryPigeonProxyApiRegistrar, + delegate: PigeonApiDelegateIMAFriendlyObstruction + ) { + self.pigeonRegistrar = pigeonRegistrar + self.pigeonDelegate = delegate + } + static func setUpMessageHandlers( + binaryMessenger: FlutterBinaryMessenger, api: PigeonApiIMAFriendlyObstruction? + ) { + let codec: FlutterStandardMessageCodec = + api != nil + ? FlutterStandardMessageCodec( + readerWriter: InteractiveMediaAdsLibraryPigeonInternalProxyApiCodecReaderWriter( + pigeonRegistrar: api!.pigeonRegistrar)) + : FlutterStandardMessageCodec.sharedInstance() + let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.interactive_media_ads.IMAFriendlyObstruction.pigeon_defaultConstructor", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + pigeonDefaultConstructorChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonIdentifierArg = args[0] as! Int64 + let viewArg = args[1] as! UIView + let purposeArg = args[2] as! FriendlyObstructionPurpose + let detailedReasonArg: String? = nilOrValue(args[3]) + do { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + try api.pigeonDelegate.pigeonDefaultConstructor( + pigeonApi: api, view: viewArg, purpose: purposeArg, detailedReason: detailedReasonArg), + withIdentifier: pigeonIdentifierArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + pigeonDefaultConstructorChannel.setMessageHandler(nil) + } + } + + ///Creates a Dart instance of IMAFriendlyObstruction and attaches it to [pigeonInstance]. + func pigeonNewInstance( + pigeonInstance: IMAFriendlyObstruction, + completion: @escaping (Result) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + PigeonError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { + completion(.success(Void())) + return + } + let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( + pigeonInstance as AnyObject) + let viewArg = try! pigeonDelegate.view(pigeonApi: self, pigeonInstance: pigeonInstance) + let purposeArg = try! pigeonDelegate.purpose(pigeonApi: self, pigeonInstance: pigeonInstance) + let detailedReasonArg = try! pigeonDelegate.detailedReason( + pigeonApi: self, pigeonInstance: pigeonInstance) + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.interactive_media_ads.IMAFriendlyObstruction.pigeon_newInstance" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonIdentifierArg, viewArg, purposeArg, detailedReasonArg] as [Any?]) { + response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(Void())) + } + } + } +} +protocol PigeonApiDelegateIMACompanionAd { + /// The value for the resource of this companion. + func resourceValue(pigeonApi: PigeonApiIMACompanionAd, pigeonInstance: IMACompanionAd) throws + -> String? + /// The API needed to execute this ad, or nil if unavailable. + func apiFramework(pigeonApi: PigeonApiIMACompanionAd, pigeonInstance: IMACompanionAd) throws + -> String? + /// The width of the companion in pixels. + /// + /// 0 if unavailable. + func width(pigeonApi: PigeonApiIMACompanionAd, pigeonInstance: IMACompanionAd) throws -> Int64 + /// The height of the companion in pixels. + /// + /// 0 if unavailable. + func height(pigeonApi: PigeonApiIMACompanionAd, pigeonInstance: IMACompanionAd) throws -> Int64 +} + +protocol PigeonApiProtocolIMACompanionAd { +} + +final class PigeonApiIMACompanionAd: PigeonApiProtocolIMACompanionAd { + unowned let pigeonRegistrar: InteractiveMediaAdsLibraryPigeonProxyApiRegistrar + let pigeonDelegate: PigeonApiDelegateIMACompanionAd + ///An implementation of [NSObject] used to access callback methods + var pigeonApiNSObject: PigeonApiNSObject { + return pigeonRegistrar.apiDelegate.pigeonApiNSObject(pigeonRegistrar) + } + + init( + pigeonRegistrar: InteractiveMediaAdsLibraryPigeonProxyApiRegistrar, + delegate: PigeonApiDelegateIMACompanionAd + ) { + self.pigeonRegistrar = pigeonRegistrar + self.pigeonDelegate = delegate + } + ///Creates a Dart instance of IMACompanionAd and attaches it to [pigeonInstance]. + func pigeonNewInstance( + pigeonInstance: IMACompanionAd, completion: @escaping (Result) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + PigeonError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { + completion(.success(Void())) + return + } + let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( + pigeonInstance as AnyObject) + let resourceValueArg = try! pigeonDelegate.resourceValue( + pigeonApi: self, pigeonInstance: pigeonInstance) + let apiFrameworkArg = try! pigeonDelegate.apiFramework( + pigeonApi: self, pigeonInstance: pigeonInstance) + let widthArg = try! pigeonDelegate.width(pigeonApi: self, pigeonInstance: pigeonInstance) + let heightArg = try! pigeonDelegate.height(pigeonApi: self, pigeonInstance: pigeonInstance) + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.interactive_media_ads.IMACompanionAd.pigeon_newInstance" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage( + [pigeonIdentifierArg, resourceValueArg, apiFrameworkArg, widthArg, heightArg] as [Any?] + ) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(Void())) + } + } + } +} diff --git a/packages/interactive_media_ads/ios/interactive_media_ads/Sources/interactive_media_ads/ProxyApiDelegate.swift b/packages/interactive_media_ads/ios/interactive_media_ads/Sources/interactive_media_ads/ProxyApiDelegate.swift index fc3a28cc7f77..3c9a26c6a4fc 100644 --- a/packages/interactive_media_ads/ios/interactive_media_ads/Sources/interactive_media_ads/ProxyApiDelegate.swift +++ b/packages/interactive_media_ads/ios/interactive_media_ads/Sources/interactive_media_ads/ProxyApiDelegate.swift @@ -8,6 +8,12 @@ import GoogleInteractiveMediaAds /// Implementation of `PigeonProxyApiDelegate` that provides each ProxyApi delegate implementation /// and any additional resources needed by an implementation. open class ProxyApiDelegate: InteractiveMediaAdsLibraryPigeonProxyApiDelegate { + func createUnknownEnumError(withEnum enumValue: Any) -> PigeonError { + return PigeonError( + code: "UnknownEnumError", message: "\(enumValue) doesn't represent a native value.", + details: nil) + } + func pigeonApiUIView(_ registrar: InteractiveMediaAdsLibraryPigeonProxyApiRegistrar) -> PigeonApiUIView { @@ -106,7 +112,23 @@ open class ProxyApiDelegate: InteractiveMediaAdsLibraryPigeonProxyApiDelegate { ) -> PigeonApiIMAAdsRenderingSettings { - PigeonApiIMAAdsRenderingSettings( + return PigeonApiIMAAdsRenderingSettings( pigeonRegistrar: registrar, delegate: AdsRenderingSettingsProxyAPIDelegate()) } + + func pigeonApiIMAFriendlyObstruction( + _ registrar: InteractiveMediaAdsLibraryPigeonProxyApiRegistrar + ) + -> PigeonApiIMAFriendlyObstruction + { + return PigeonApiIMAFriendlyObstruction( + pigeonRegistrar: registrar, delegate: FriendlyObstructionProxyAPIDelegate()) + } + + func pigeonApiIMACompanionAd(_ registrar: InteractiveMediaAdsLibraryPigeonProxyApiRegistrar) + -> PigeonApiIMACompanionAd + { + return PigeonApiIMACompanionAd( + pigeonRegistrar: registrar, delegate: CompanionAdProxyAPIDelegate()) + } } diff --git a/packages/interactive_media_ads/lib/interactive_media_ads.dart b/packages/interactive_media_ads/lib/interactive_media_ads.dart index 954a27c9049a..06c180248410 100644 --- a/packages/interactive_media_ads/lib/interactive_media_ads.dart +++ b/packages/interactive_media_ads/lib/interactive_media_ads.dart @@ -5,8 +5,10 @@ export 'src/ad_display_container.dart'; export 'src/ads_loader.dart'; export 'src/ads_manager_delegate.dart'; +export 'src/ads_request.dart'; export 'src/android/android_interactive_media_ads.dart' show AndroidInteractiveMediaAds; +export 'src/content_progress_provider.dart'; export 'src/ios/ios_interactive_media_ads.dart' show IOSInteractiveMediaAds; export 'src/platform_interface/platform_interface.dart' show @@ -16,5 +18,4 @@ export 'src/platform_interface/platform_interface.dart' AdErrorType, AdEvent, AdEventType, - AdsLoadErrorData, - AdsRequest; + AdsLoadErrorData; diff --git a/packages/interactive_media_ads/lib/src/ads_loader.dart b/packages/interactive_media_ads/lib/src/ads_loader.dart index 4ab3a97c1477..9863d4c01293 100644 --- a/packages/interactive_media_ads/lib/src/ads_loader.dart +++ b/packages/interactive_media_ads/lib/src/ads_loader.dart @@ -6,6 +6,7 @@ import 'package:flutter/foundation.dart'; import 'ad_display_container.dart'; import 'ads_manager_delegate.dart'; +import 'ads_request.dart'; import 'platform_interface/platform_interface.dart'; /// Allows publishers to request ads from ad servers or a dynamic ad insertion @@ -97,7 +98,7 @@ class AdsLoader { /// Ads cannot be requested until the `AdDisplayContainer` has been added to /// the native View hierarchy. See [AdDisplayContainer.onContainerAdded]. Future requestAds(AdsRequest request) { - return platform.requestAds(request); + return platform.requestAds(request.platform); } } @@ -158,6 +159,30 @@ class AdsManager { return platform.setAdsManagerDelegate(delegate.platform); } + /// Pauses the current ad. + Future pause() { + return platform.pause(); + } + + /// Resumes the current ad. + Future resume() { + return platform.resume(); + } + + /// Skips the current ad. + /// + /// This only skips ads if IMA does not render the 'Skip ad' button. + Future skip() { + return platform.skip(); + } + + /// Discards current ad break and resumes content. + /// + /// If there is no current ad then the next ad break is discarded. + Future discardAdBreak() { + return platform.discardAdBreak(); + } + /// Stops the ad and all tracking, then releases all assets that were loaded /// to play the ad. Future destroy() { diff --git a/packages/interactive_media_ads/lib/src/ads_request.dart b/packages/interactive_media_ads/lib/src/ads_request.dart new file mode 100644 index 000000000000..ecc8e2f2ccc5 --- /dev/null +++ b/packages/interactive_media_ads/lib/src/ads_request.dart @@ -0,0 +1,37 @@ +// 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 'content_progress_provider.dart'; +import 'platform_interface/platform_interface.dart'; + +/// An object containing the data used to request ads from the server. +class AdsRequest { + /// Creates an [AdsRequest]. + AdsRequest({ + required String adTagUrl, + ContentProgressProvider? contentProgressProvider, + }) : this.fromPlatform( + PlatformAdsRequest( + adTagUrl: adTagUrl, + contentProgressProvider: contentProgressProvider?.platform, + ), + ); + + /// Constructs an [AdsRequest] from a specific platform implementation. + AdsRequest.fromPlatform(this.platform); + + /// Implementation of [PlatformAdsRequest] for the current platform. + final PlatformAdsRequest platform; + + /// The URL from which ads will be requested. + String get adTagUrl => platform.adTagUrl; + + /// A [ContentProgressProvider] instance to allow scheduling of ad breaks + /// based on content progress (cue points). + ContentProgressProvider? get contentProgressProvider => platform + .contentProgressProvider != + null + ? ContentProgressProvider.fromPlatform(platform.contentProgressProvider!) + : null; +} diff --git a/packages/interactive_media_ads/lib/src/android/android_ad_display_container.dart b/packages/interactive_media_ads/lib/src/android/android_ad_display_container.dart index 2c5f2c8eb809..1c3a63dd9650 100644 --- a/packages/interactive_media_ads/lib/src/android/android_ad_display_container.dart +++ b/packages/interactive_media_ads/lib/src/android/android_ad_display_container.dart @@ -80,7 +80,7 @@ base class AndroidAdDisplayContainer extends PlatformAdDisplayContainer { _androidParams._imaProxy.newFrameLayout(); // Handles loading and displaying an ad. - late final ima.VideoView _videoView; + late ima.VideoView _videoView; // After an ad is loaded in the `VideoView`, this is used to control // playback. @@ -120,6 +120,11 @@ base class AndroidAdDisplayContainer extends PlatformAdDisplayContainer { int? _adDuration; + // Whether MediaPlayer.start() should be called whenever the VideoView + // `onPrepared` callback is triggered. `onPrepared` is triggered whenever the + // app is resumed after being inactive. + bool _startPlayerWhenVideoIsPrepared = true; + late final AndroidAdDisplayContainerCreationParams _androidParams = params is AndroidAdDisplayContainerCreationParams ? params as AndroidAdDisplayContainerCreationParams @@ -217,10 +222,12 @@ base class AndroidAdDisplayContainer extends PlatformAdDisplayContainer { if (container._savedAdPosition > 0) { await player.seekTo(container._savedAdPosition); } - } - await player.start(); - container?._startAdProgressTracking(); + if (container._startPlayerWhenVideoIsPrepared) { + await player.start(); + container._startAdProgressTracking(); + } + } }, onError: (_, __, ___, ____) { final AndroidAdDisplayContainer? container = weakThis.target; @@ -256,6 +263,9 @@ base class AndroidAdDisplayContainer extends PlatformAdDisplayContainer { pauseAd: (_, __) async { final AndroidAdDisplayContainer? container = weakThis.target; if (container != null) { + // Setting this to false ensures the ad doesn't start playing if an + // app is returned to the foreground. + container._startPlayerWhenVideoIsPrepared = false; await container._mediaPlayer!.pause(); container._savedAdPosition = await container._videoView.getCurrentPosition(); @@ -263,16 +273,29 @@ base class AndroidAdDisplayContainer extends PlatformAdDisplayContainer { } }, playAd: (_, ima.AdMediaInfo adMediaInfo) { - weakThis.target?._videoView.setVideoUri(adMediaInfo.url); + final AndroidAdDisplayContainer? container = weakThis.target; + if (container != null) { + container._startPlayerWhenVideoIsPrepared = true; + container._videoView.setVideoUri(adMediaInfo.url); + } }, release: (_) {}, stopAd: (_, __) { final AndroidAdDisplayContainer? container = weakThis.target; if (container != null) { + // Clear and reset all state. container._stopAdProgressTracking(); + + container._frameLayout.removeView(container._videoView); + container._videoView = _setUpVideoView( + WeakReference(container), + ); + container._frameLayout.addView(container._videoView); + container._clearMediaPlayer(); container._loadedAdMediaInfo = null; container._adDuration = null; + container._startPlayerWhenVideoIsPrepared = true; } }, ); diff --git a/packages/interactive_media_ads/lib/src/android/android_ads_loader.dart b/packages/interactive_media_ads/lib/src/android/android_ads_loader.dart index 58fe19c0bdc8..2ccbd4b62e04 100644 --- a/packages/interactive_media_ads/lib/src/android/android_ads_loader.dart +++ b/packages/interactive_media_ads/lib/src/android/android_ads_loader.dart @@ -9,6 +9,7 @@ import 'package:flutter/widgets.dart'; import '../platform_interface/platform_interface.dart'; import 'android_ad_display_container.dart'; import 'android_ads_manager.dart'; +import 'android_content_progress_provider.dart'; import 'enum_converter_utils.dart'; import 'interactive_media_ads.g.dart' as ima; import 'interactive_media_ads_proxy.dart'; @@ -79,13 +80,18 @@ base class AndroidAdsLoader extends PlatformAdsLoader { } @override - Future requestAds(AdsRequest request) async { + Future requestAds(PlatformAdsRequest request) async { final ima.AdsLoader adsLoader = await _adsLoaderFuture; final ima.AdsRequest androidRequest = await _sdkFactory.createAdsRequest(); await Future.wait(>[ androidRequest.setAdTagUrl(request.adTagUrl), + if (request.contentProgressProvider != null) + androidRequest.setContentProgressProvider( + (request.contentProgressProvider! as AndroidContentProgressProvider) + .progressProvider, + ), adsLoader.requestAds(androidRequest), ]); } diff --git a/packages/interactive_media_ads/lib/src/android/android_ads_manager.dart b/packages/interactive_media_ads/lib/src/android/android_ads_manager.dart index 0c0943c46f7f..4ec075838b97 100644 --- a/packages/interactive_media_ads/lib/src/android/android_ads_manager.dart +++ b/packages/interactive_media_ads/lib/src/android/android_ads_manager.dart @@ -49,6 +49,26 @@ class AndroidAdsManager extends PlatformAdsManager { return _manager.start(); } + @override + Future discardAdBreak() { + return _manager.discardAdBreak(); + } + + @override + Future pause() { + return _manager.pause(); + } + + @override + Future resume() { + return _manager.resume(); + } + + @override + Future skip() { + return _manager.skip(); + } + // This value is created in a static method because the callback methods for // any wrapped classes must not reference the encapsulating object. This is to // prevent a circular reference that prevents garbage collection. diff --git a/packages/interactive_media_ads/lib/src/android/android_content_progress_provider.dart b/packages/interactive_media_ads/lib/src/android/android_content_progress_provider.dart new file mode 100644 index 000000000000..e3f4d57c2955 --- /dev/null +++ b/packages/interactive_media_ads/lib/src/android/android_content_progress_provider.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. + +import 'dart:async'; + +import 'package:meta/meta.dart'; + +import '../platform_interface/platform_content_progress_provider.dart'; +import 'interactive_media_ads.g.dart' as ima; +import 'interactive_media_ads_proxy.dart'; + +/// Android implementation of [PlatformContentProgressProviderCreationParams]. +final class AndroidContentProgressProviderCreationParams + extends PlatformContentProgressProviderCreationParams { + /// Constructs a [AndroidContentProgressProviderCreationParams]. + const AndroidContentProgressProviderCreationParams({ + @visibleForTesting InteractiveMediaAdsProxy? proxy, + }) : _proxy = proxy ?? const InteractiveMediaAdsProxy(), + super(); + + /// Creates a [AndroidContentProgressProviderCreationParams] from an instance of + /// [PlatformContentProgressProviderCreationParams]. + factory AndroidContentProgressProviderCreationParams.fromPlatformContentProgressProviderCreationParams( + // Placeholder to prevent requiring a breaking change if params are added to + // PlatformContentProgressProviderCreationParams. + // ignore: avoid_unused_constructor_parameters + PlatformContentProgressProviderCreationParams params, { + @visibleForTesting InteractiveMediaAdsProxy? proxy, + }) { + return AndroidContentProgressProviderCreationParams(proxy: proxy); + } + + final InteractiveMediaAdsProxy _proxy; +} + +/// Android implementation of [PlatformContentProgressProvider]. +base class AndroidContentProgressProvider + extends PlatformContentProgressProvider { + /// Constructs an [AndroidContentProgressProvider]. + AndroidContentProgressProvider(super.params) : super.implementation(); + + /// The native Android ContentProgressProvider. + /// + /// This allows the SDK to track progress of the content video. + @internal + late final ima.ContentProgressProvider progressProvider = + _androidParams._proxy.newContentProgressProvider(); + + late final AndroidContentProgressProviderCreationParams _androidParams = + params is AndroidContentProgressProviderCreationParams + ? params as AndroidContentProgressProviderCreationParams + : AndroidContentProgressProviderCreationParams + .fromPlatformContentProgressProviderCreationParams( + params, + ); + + @override + Future setProgress({ + required Duration progress, + required Duration duration, + }) async { + return progressProvider.setContentProgress( + _androidParams._proxy.newVideoProgressUpdate( + currentTimeMs: progress.inMilliseconds, + durationMs: duration.inMilliseconds, + ), + ); + } +} diff --git a/packages/interactive_media_ads/lib/src/android/android_interactive_media_ads.dart b/packages/interactive_media_ads/lib/src/android/android_interactive_media_ads.dart index 2406520d5531..0f05362a6919 100644 --- a/packages/interactive_media_ads/lib/src/android/android_interactive_media_ads.dart +++ b/packages/interactive_media_ads/lib/src/android/android_interactive_media_ads.dart @@ -6,9 +6,11 @@ import '../platform_interface/interactive_media_ads_platform.dart'; import '../platform_interface/platform_ad_display_container.dart'; import '../platform_interface/platform_ads_loader.dart'; import '../platform_interface/platform_ads_manager_delegate.dart'; +import '../platform_interface/platform_content_progress_provider.dart'; import 'android_ad_display_container.dart'; import 'android_ads_loader.dart'; import 'android_ads_manager_delegate.dart'; +import 'android_content_progress_provider.dart'; /// Android implementation of [InteractiveMediaAdsPlatform]. final class AndroidInteractiveMediaAds extends InteractiveMediaAdsPlatform { @@ -37,4 +39,11 @@ final class AndroidInteractiveMediaAds extends InteractiveMediaAdsPlatform { ) { return AndroidAdsManagerDelegate(params); } + + @override + PlatformContentProgressProvider createPlatformContentProgressProvider( + PlatformContentProgressProviderCreationParams params, + ) { + return AndroidContentProgressProvider(params); + } } diff --git a/packages/interactive_media_ads/lib/src/android/interactive_media_ads.g.dart b/packages/interactive_media_ads/lib/src/android/interactive_media_ads.g.dart index 1fca04f82608..be8cd0fadb28 100644 --- a/packages/interactive_media_ads/lib/src/android/interactive_media_ads.g.dart +++ b/packages/interactive_media_ads/lib/src/android/interactive_media_ads.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 (v21.2.0), do not edit directly. +// Autogenerated from Pigeon (v22.5.0), 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, no_leading_underscores_for_local_identifiers @@ -37,9 +37,9 @@ List wrapResponse( /// All implementers are expected to be [immutable] as defined by the annotation /// and override [pigeon_copy] returning an instance of itself. @immutable -abstract class PigeonProxyApiBaseClass { - /// Construct a [PigeonProxyApiBaseClass]. - PigeonProxyApiBaseClass({ +abstract class PigeonInternalProxyApiBaseClass { + /// Construct a [PigeonInternalProxyApiBaseClass]. + PigeonInternalProxyApiBaseClass({ this.pigeon_binaryMessenger, PigeonInstanceManager? pigeon_instanceManager, }) : pigeon_instanceManager = @@ -64,7 +64,7 @@ abstract class PigeonProxyApiBaseClass { /// Subclasses should always override their parent's implementation of this /// method. @protected - PigeonProxyApiBaseClass pigeon_copy(); + PigeonInternalProxyApiBaseClass pigeon_copy(); } /// Maintains instances used to communicate with the native objects they @@ -114,10 +114,10 @@ class PigeonInstanceManager { // by calling instanceManager.getIdentifier() inside of `==` while this was a // HashMap). final Expando _identifiers = Expando(); - final Map> _weakInstances = - >{}; - final Map _strongInstances = - {}; + final Map> + _weakInstances = >{}; + final Map _strongInstances = + {}; late final Finalizer _finalizer; int _nextIdentifier = 0; @@ -127,7 +127,8 @@ class PigeonInstanceManager { static PigeonInstanceManager _initInstance() { WidgetsFlutterBinding.ensureInitialized(); - final _PigeonInstanceManagerApi api = _PigeonInstanceManagerApi(); + final _PigeonInternalInstanceManagerApi api = + _PigeonInternalInstanceManagerApi(); // Clears the native `PigeonInstanceManager` on the initial use of the Dart one. api.clear(); final PigeonInstanceManager instanceManager = PigeonInstanceManager( @@ -135,7 +136,7 @@ class PigeonInstanceManager { api.removeStrongReference(identifier); }, ); - _PigeonInstanceManagerApi.setUpMessageHandlers( + _PigeonInternalInstanceManagerApi.setUpMessageHandlers( instanceManager: instanceManager); BaseDisplayContainer.pigeon_setUpMessageHandlers( pigeon_instanceManager: instanceManager); @@ -188,6 +189,15 @@ class PigeonInstanceManager { pigeon_instanceManager: instanceManager); AdEventListener.pigeon_setUpMessageHandlers( pigeon_instanceManager: instanceManager); + AdsRenderingSettings.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + AdProgressInfo.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + CompanionAd.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + UniversalAdId.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + Ad.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); return instanceManager; } @@ -199,7 +209,7 @@ class PigeonInstanceManager { /// Throws assertion error if the instance has already been added. /// /// Returns the randomly generated id of the [instance] added. - int addDartCreatedInstance(PigeonProxyApiBaseClass instance) { + int addDartCreatedInstance(PigeonInternalProxyApiBaseClass instance) { final int identifier = _nextUniqueIdentifier(); _addInstanceWithIdentifier(instance, identifier); return identifier; @@ -213,7 +223,7 @@ class PigeonInstanceManager { /// /// This does not remove the strong referenced instance associated with /// [instance]. This can be done with [remove]. - int? removeWeakReference(PigeonProxyApiBaseClass instance) { + int? removeWeakReference(PigeonInternalProxyApiBaseClass instance) { final int? identifier = getIdentifier(instance); if (identifier == null) { return null; @@ -235,7 +245,7 @@ class PigeonInstanceManager { /// /// This does not remove the weak referenced instance associated with /// [identifier]. This can be done with [removeWeakReference]. - T? remove(int identifier) { + T? remove(int identifier) { return _strongInstances.remove(identifier) as T?; } @@ -251,19 +261,20 @@ class PigeonInstanceManager { /// /// This method also expects the host `InstanceManager` to have a strong /// reference to the instance the identifier is associated with. - T? getInstanceWithWeakReference( + T? getInstanceWithWeakReference( int identifier) { - final PigeonProxyApiBaseClass? weakInstance = + final PigeonInternalProxyApiBaseClass? weakInstance = _weakInstances[identifier]?.target; if (weakInstance == null) { - final PigeonProxyApiBaseClass? strongInstance = + final PigeonInternalProxyApiBaseClass? strongInstance = _strongInstances[identifier]; if (strongInstance != null) { - final PigeonProxyApiBaseClass copy = strongInstance.pigeon_copy(); + final PigeonInternalProxyApiBaseClass copy = + strongInstance.pigeon_copy(); _identifiers[copy] = identifier; _weakInstances[identifier] = - WeakReference(copy); + WeakReference(copy); _finalizer.attach(copy, identifier, detach: copy); return copy as T; } @@ -274,7 +285,7 @@ class PigeonInstanceManager { } /// Retrieves the identifier associated with instance. - int? getIdentifier(PigeonProxyApiBaseClass instance) { + int? getIdentifier(PigeonInternalProxyApiBaseClass instance) { return _identifiers[instance]; } @@ -288,22 +299,22 @@ class PigeonInstanceManager { /// /// Returns unique identifier of the [instance] added. void addHostCreatedInstance( - PigeonProxyApiBaseClass instance, int identifier) { + PigeonInternalProxyApiBaseClass instance, int identifier) { _addInstanceWithIdentifier(instance, identifier); } void _addInstanceWithIdentifier( - PigeonProxyApiBaseClass instance, int identifier) { + PigeonInternalProxyApiBaseClass instance, int identifier) { assert(!containsIdentifier(identifier)); assert(getIdentifier(instance) == null); assert(identifier >= 0); _identifiers[instance] = identifier; _weakInstances[identifier] = - WeakReference(instance); + WeakReference(instance); _finalizer.attach(instance, identifier, detach: instance); - final PigeonProxyApiBaseClass copy = instance.pigeon_copy(); + final PigeonInternalProxyApiBaseClass copy = instance.pigeon_copy(); _identifiers[copy] = identifier; _strongInstances[identifier] = copy; } @@ -325,15 +336,14 @@ class PigeonInstanceManager { } /// Generated API for managing the Dart and native `PigeonInstanceManager`s. -class _PigeonInstanceManagerApi { - /// Constructor for [_PigeonInstanceManagerApi]. - _PigeonInstanceManagerApi({BinaryMessenger? binaryMessenger}) - : __pigeon_binaryMessenger = binaryMessenger; +class _PigeonInternalInstanceManagerApi { + /// Constructor for [_PigeonInternalInstanceManagerApi]. + _PigeonInternalInstanceManagerApi({BinaryMessenger? binaryMessenger}) + : pigeonVar_binaryMessenger = binaryMessenger; - final BinaryMessenger? __pigeon_binaryMessenger; + final BinaryMessenger? pigeonVar_binaryMessenger; - static const MessageCodec pigeonChannelCodec = - StandardMessageCodec(); + static const MessageCodec pigeonChannelCodec = _PigeonCodec(); static void setUpMessageHandlers({ bool pigeon_clearHandlers = false, @@ -341,21 +351,22 @@ class _PigeonInstanceManagerApi { PigeonInstanceManager? instanceManager, }) { { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.interactive_media_ads.PigeonInstanceManagerApi.removeStrongReference', + 'dev.flutter.pigeon.interactive_media_ads.PigeonInternalInstanceManager.removeStrongReference', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (pigeon_clearHandlers) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.interactive_media_ads.PigeonInstanceManagerApi.removeStrongReference was null.'); + 'Argument for dev.flutter.pigeon.interactive_media_ads.PigeonInternalInstanceManager.removeStrongReference was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.interactive_media_ads.PigeonInstanceManagerApi.removeStrongReference was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.interactive_media_ads.PigeonInternalInstanceManager.removeStrongReference was null, expected non-null int.'); try { (instanceManager ?? PigeonInstanceManager.instance) .remove(arg_identifier!); @@ -372,23 +383,23 @@ class _PigeonInstanceManagerApi { } Future removeStrongReference(int identifier) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.interactive_media_ads.PigeonInstanceManagerApi.removeStrongReference'; - final BasicMessageChannel __pigeon_channel = + const String pigeonVar_channelName = + 'dev.flutter.pigeon.interactive_media_ads.PigeonInternalInstanceManager.removeStrongReference'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([identifier]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([identifier]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -399,23 +410,23 @@ class _PigeonInstanceManagerApi { /// /// This is typically called after a hot restart. Future clear() async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.interactive_media_ads.PigeonInstanceManagerApi.clear'; - final BasicMessageChannel __pigeon_channel = + const String pigeonVar_channelName = + 'dev.flutter.pigeon.interactive_media_ads.PigeonInternalInstanceManager.clear'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -423,12 +434,12 @@ class _PigeonInstanceManagerApi { } } -class _PigeonProxyApiBaseCodec extends _PigeonCodec { - const _PigeonProxyApiBaseCodec(this.instanceManager); +class _PigeonInternalProxyApiBaseCodec extends _PigeonCodec { + const _PigeonInternalProxyApiBaseCodec(this.instanceManager); final PigeonInstanceManager instanceManager; @override void writeValue(WriteBuffer buffer, Object? value) { - if (value is PigeonProxyApiBaseClass) { + if (value is PigeonInternalProxyApiBaseClass) { buffer.putUint8(128); writeValue(buffer, instanceManager.getIdentifier(value)); } else { @@ -637,11 +648,28 @@ enum AdEventType { unknown, } +/// Describes an element of the ad UI, to be requested or rendered by the SDK. +/// +/// See https://developers.google.com/interactive-media-ads/docs/sdks/android/client-side/api/reference/com/google/ads/interactivemedia/v3/api/UiElement.html. +enum UiElement { + /// The ad attribution UI element, for example, "Ad". + adAttribution, + + /// Ad attribution is required for a countdown timer to be displayed. + countdown, + + /// The element is not recognized by this wrapper. + unknown, +} + class _PigeonCodec extends StandardMessageCodec { const _PigeonCodec(); @override void writeValue(WriteBuffer buffer, Object? value) { - if (value is AdErrorCode) { + if (value is int) { + buffer.putUint8(4); + buffer.putInt64(value); + } else if (value is AdErrorCode) { buffer.putUint8(129); writeValue(buffer, value.index); } else if (value is AdErrorType) { @@ -650,6 +678,9 @@ class _PigeonCodec extends StandardMessageCodec { } else if (value is AdEventType) { buffer.putUint8(131); writeValue(buffer, value.index); + } else if (value is UiElement) { + buffer.putUint8(132); + writeValue(buffer, value.index); } else { super.writeValue(buffer, value); } @@ -667,6 +698,9 @@ class _PigeonCodec extends StandardMessageCodec { case 131: final int? value = readValue(buffer) as int?; return value == null ? null : AdEventType.values[value]; + case 132: + final int? value = readValue(buffer) as int?; + return value == null ? null : UiElement.values[value]; default: return super.readValueOfType(type, buffer); } @@ -676,7 +710,7 @@ class _PigeonCodec extends StandardMessageCodec { /// A base class for more specialized container interfaces. /// /// See https://developers.google.com/interactive-media-ads/docs/sdks/android/client-side/api/reference/com/google/ads/interactivemedia/v3/api/BaseDisplayContainer.html. -class BaseDisplayContainer extends PigeonProxyApiBaseClass { +class BaseDisplayContainer extends PigeonInternalProxyApiBaseClass { /// Constructs [BaseDisplayContainer] without creating the associated native object. /// /// This should only be used by subclasses created by this library or to @@ -693,20 +727,21 @@ class BaseDisplayContainer extends PigeonProxyApiBaseClass { PigeonInstanceManager? pigeon_instanceManager, BaseDisplayContainer Function()? pigeon_newInstance, }) { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - _PigeonProxyApiBaseCodec( + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _PigeonInternalProxyApiBaseCodec( pigeon_instanceManager ?? PigeonInstanceManager.instance); final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.interactive_media_ads.BaseDisplayContainer.pigeon_newInstance', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (pigeon_clearHandlers) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.interactive_media_ads.BaseDisplayContainer.pigeon_newInstance was null.'); final List args = (message as List?)!; @@ -747,7 +782,7 @@ class BaseDisplayContainer extends PigeonProxyApiBaseClass { /// A container in which to display the ads. /// /// See https://developers.google.com/interactive-media-ads/docs/sdks/android/client-side/api/reference/com/google/ads/interactivemedia/v3/api/AdDisplayContainer. -class AdDisplayContainer extends PigeonProxyApiBaseClass +class AdDisplayContainer extends PigeonInternalProxyApiBaseClass implements BaseDisplayContainer { /// Constructs [AdDisplayContainer] without creating the associated native object. /// @@ -765,20 +800,21 @@ class AdDisplayContainer extends PigeonProxyApiBaseClass PigeonInstanceManager? pigeon_instanceManager, AdDisplayContainer Function()? pigeon_newInstance, }) { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - _PigeonProxyApiBaseCodec( + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _PigeonInternalProxyApiBaseCodec( pigeon_instanceManager ?? PigeonInstanceManager.instance); final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.interactive_media_ads.AdDisplayContainer.pigeon_newInstance', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (pigeon_clearHandlers) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.interactive_media_ads.AdDisplayContainer.pigeon_newInstance was null.'); final List args = (message as List?)!; @@ -820,7 +856,7 @@ class AdDisplayContainer extends PigeonProxyApiBaseClass /// dynamic ad insertion stream. /// /// See https://developers.google.com/interactive-media-ads/docs/sdks/android/client-side/api/reference/com/google/ads/interactivemedia/v3/api/AdsLoader. -class AdsLoader extends PigeonProxyApiBaseClass { +class AdsLoader extends PigeonInternalProxyApiBaseClass { /// Constructs [AdsLoader] without creating the associated native object. /// /// This should only be used by subclasses created by this library or to @@ -831,8 +867,8 @@ class AdsLoader extends PigeonProxyApiBaseClass { super.pigeon_instanceManager, }); - late final _PigeonProxyApiBaseCodec __pigeon_codecAdsLoader = - _PigeonProxyApiBaseCodec(pigeon_instanceManager); + late final _PigeonInternalProxyApiBaseCodec _pigeonVar_codecAdsLoader = + _PigeonInternalProxyApiBaseCodec(pigeon_instanceManager); static void pigeon_setUpMessageHandlers({ bool pigeon_clearHandlers = false, @@ -840,20 +876,21 @@ class AdsLoader extends PigeonProxyApiBaseClass { PigeonInstanceManager? pigeon_instanceManager, AdsLoader Function()? pigeon_newInstance, }) { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - _PigeonProxyApiBaseCodec( + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _PigeonInternalProxyApiBaseCodec( pigeon_instanceManager ?? PigeonInstanceManager.instance); final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.interactive_media_ads.AdsLoader.pigeon_newInstance', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (pigeon_clearHandlers) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.interactive_media_ads.AdsLoader.pigeon_newInstance was null.'); final List args = (message as List?)!; @@ -884,25 +921,26 @@ class AdsLoader extends PigeonProxyApiBaseClass { /// Registers a listener for errors that occur during the ads request. Future addAdErrorListener(AdErrorListener listener) async { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = __pigeon_codecAdsLoader; - final BinaryMessenger? __pigeon_binaryMessenger = pigeon_binaryMessenger; - const String __pigeon_channelName = + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecAdsLoader; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = 'dev.flutter.pigeon.interactive_media_ads.AdsLoader.addAdErrorListener'; - final BasicMessageChannel __pigeon_channel = + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel + final List? pigeonVar_replyList = await pigeonVar_channel .send([this, listener]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -911,25 +949,26 @@ class AdsLoader extends PigeonProxyApiBaseClass { /// Registers a listener for the ads manager loaded event. Future addAdsLoadedListener(AdsLoadedListener listener) async { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = __pigeon_codecAdsLoader; - final BinaryMessenger? __pigeon_binaryMessenger = pigeon_binaryMessenger; - const String __pigeon_channelName = + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecAdsLoader; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = 'dev.flutter.pigeon.interactive_media_ads.AdsLoader.addAdsLoadedListener'; - final BasicMessageChannel __pigeon_channel = + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel + final List? pigeonVar_replyList = await pigeonVar_channel .send([this, listener]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -938,25 +977,26 @@ class AdsLoader extends PigeonProxyApiBaseClass { /// Requests ads from a server. Future requestAds(AdsRequest request) async { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = __pigeon_codecAdsLoader; - final BinaryMessenger? __pigeon_binaryMessenger = pigeon_binaryMessenger; - const String __pigeon_channelName = + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecAdsLoader; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = 'dev.flutter.pigeon.interactive_media_ads.AdsLoader.requestAds'; - final BasicMessageChannel __pigeon_channel = + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([this, request]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = await pigeonVar_channel + .send([this, request]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -975,7 +1015,7 @@ class AdsLoader extends PigeonProxyApiBaseClass { /// An event raised when ads are successfully loaded from the ad server through an AdsLoader. /// /// See https://developers.google.com/interactive-media-ads/docs/sdks/android/client-side/api/reference/com/google/ads/interactivemedia/v3/api/AdsManagerLoadedEvent.html. -class AdsManagerLoadedEvent extends PigeonProxyApiBaseClass { +class AdsManagerLoadedEvent extends PigeonInternalProxyApiBaseClass { /// Constructs [AdsManagerLoadedEvent] without creating the associated native object. /// /// This should only be used by subclasses created by this library or to @@ -997,20 +1037,21 @@ class AdsManagerLoadedEvent extends PigeonProxyApiBaseClass { PigeonInstanceManager? pigeon_instanceManager, AdsManagerLoadedEvent Function(AdsManager manager)? pigeon_newInstance, }) { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - _PigeonProxyApiBaseCodec( + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _PigeonInternalProxyApiBaseCodec( pigeon_instanceManager ?? PigeonInstanceManager.instance); final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.interactive_media_ads.AdsManagerLoadedEvent.pigeon_newInstance', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (pigeon_clearHandlers) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.interactive_media_ads.AdsManagerLoadedEvent.pigeon_newInstance was null.'); final List args = (message as List?)!; @@ -1056,7 +1097,7 @@ class AdsManagerLoadedEvent extends PigeonProxyApiBaseClass { /// An event raised when there is an error loading or playing ads. /// /// See https://developers.google.com/interactive-media-ads/docs/sdks/android/client-side/api/reference/com/google/ads/interactivemedia/v3/api/AdErrorEvent.html. -class AdErrorEvent extends PigeonProxyApiBaseClass { +class AdErrorEvent extends PigeonInternalProxyApiBaseClass { /// Constructs [AdErrorEvent] without creating the associated native object. /// /// This should only be used by subclasses created by this library or to @@ -1077,20 +1118,21 @@ class AdErrorEvent extends PigeonProxyApiBaseClass { PigeonInstanceManager? pigeon_instanceManager, AdErrorEvent Function(AdError error)? pigeon_newInstance, }) { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - _PigeonProxyApiBaseCodec( + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _PigeonInternalProxyApiBaseCodec( pigeon_instanceManager ?? PigeonInstanceManager.instance); final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.interactive_media_ads.AdErrorEvent.pigeon_newInstance', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (pigeon_clearHandlers) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.interactive_media_ads.AdErrorEvent.pigeon_newInstance was null.'); final List args = (message as List?)!; @@ -1136,7 +1178,7 @@ class AdErrorEvent extends PigeonProxyApiBaseClass { /// An error that occurred in the SDK. /// /// See https://developers.google.com/interactive-media-ads/docs/sdks/android/client-side/api/reference/com/google/ads/interactivemedia/v3/api/AdError.html. -class AdError extends PigeonProxyApiBaseClass { +class AdError extends PigeonInternalProxyApiBaseClass { /// Constructs [AdError] without creating the associated native object. /// /// This should only be used by subclasses created by this library or to @@ -1174,20 +1216,21 @@ class AdError extends PigeonProxyApiBaseClass { String message, )? pigeon_newInstance, }) { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - _PigeonProxyApiBaseCodec( + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _PigeonInternalProxyApiBaseCodec( pigeon_instanceManager ?? PigeonInstanceManager.instance); final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.interactive_media_ads.AdError.pigeon_newInstance', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (pigeon_clearHandlers) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.interactive_media_ads.AdError.pigeon_newInstance was null.'); final List args = (message as List?)!; @@ -1249,7 +1292,7 @@ class AdError extends PigeonProxyApiBaseClass { /// An object containing the data used to request ads from the server. /// /// See https://developers.google.com/interactive-media-ads/docs/sdks/android/client-side/api/reference/com/google/ads/interactivemedia/v3/api/AdsRequest. -class AdsRequest extends PigeonProxyApiBaseClass { +class AdsRequest extends PigeonInternalProxyApiBaseClass { /// Constructs [AdsRequest] without creating the associated native object. /// /// This should only be used by subclasses created by this library or to @@ -1260,8 +1303,8 @@ class AdsRequest extends PigeonProxyApiBaseClass { super.pigeon_instanceManager, }); - late final _PigeonProxyApiBaseCodec __pigeon_codecAdsRequest = - _PigeonProxyApiBaseCodec(pigeon_instanceManager); + late final _PigeonInternalProxyApiBaseCodec _pigeonVar_codecAdsRequest = + _PigeonInternalProxyApiBaseCodec(pigeon_instanceManager); static void pigeon_setUpMessageHandlers({ bool pigeon_clearHandlers = false, @@ -1269,20 +1312,21 @@ class AdsRequest extends PigeonProxyApiBaseClass { PigeonInstanceManager? pigeon_instanceManager, AdsRequest Function()? pigeon_newInstance, }) { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - _PigeonProxyApiBaseCodec( + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _PigeonInternalProxyApiBaseCodec( pigeon_instanceManager ?? PigeonInstanceManager.instance); final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.interactive_media_ads.AdsRequest.pigeon_newInstance', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (pigeon_clearHandlers) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.interactive_media_ads.AdsRequest.pigeon_newInstance was null.'); final List args = (message as List?)!; @@ -1313,26 +1357,26 @@ class AdsRequest extends PigeonProxyApiBaseClass { /// Sets the URL from which ads will be requested. Future setAdTagUrl(String adTagUrl) async { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - __pigeon_codecAdsRequest; - final BinaryMessenger? __pigeon_binaryMessenger = pigeon_binaryMessenger; - const String __pigeon_channelName = + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecAdsRequest; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = 'dev.flutter.pigeon.interactive_media_ads.AdsRequest.setAdTagUrl'; - final BasicMessageChannel __pigeon_channel = + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel + final List? pigeonVar_replyList = await pigeonVar_channel .send([this, adTagUrl]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -1343,26 +1387,26 @@ class AdsRequest extends PigeonProxyApiBaseClass { /// based on content progress (cue points). Future setContentProgressProvider( ContentProgressProvider provider) async { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - __pigeon_codecAdsRequest; - final BinaryMessenger? __pigeon_binaryMessenger = pigeon_binaryMessenger; - const String __pigeon_channelName = + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecAdsRequest; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = 'dev.flutter.pigeon.interactive_media_ads.AdsRequest.setContentProgressProvider'; - final BasicMessageChannel __pigeon_channel = + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel + final List? pigeonVar_replyList = await pigeonVar_channel .send([this, provider]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -1381,7 +1425,41 @@ class AdsRequest extends PigeonProxyApiBaseClass { /// Defines an interface to allow SDK to track progress of the content video. /// /// See https://developers.google.com/ad-manager/dynamic-ad-insertion/sdk/android/api/reference/com/google/ads/interactivemedia/v3/api/player/ContentProgressProvider.html. -class ContentProgressProvider extends PigeonProxyApiBaseClass { +class ContentProgressProvider extends PigeonInternalProxyApiBaseClass { + ContentProgressProvider({ + super.pigeon_binaryMessenger, + super.pigeon_instanceManager, + }) { + final int pigeonVar_instanceIdentifier = + pigeon_instanceManager.addDartCreatedInstance(this); + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecContentProgressProvider; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + () async { + const String pigeonVar_channelName = + 'dev.flutter.pigeon.interactive_media_ads.ContentProgressProvider.pigeon_defaultConstructor'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = await pigeonVar_channel + .send([pigeonVar_instanceIdentifier]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return; + } + }(); + } + /// Constructs [ContentProgressProvider] without creating the associated native object. /// /// This should only be used by subclasses created by this library or to @@ -1392,26 +1470,31 @@ class ContentProgressProvider extends PigeonProxyApiBaseClass { super.pigeon_instanceManager, }); + late final _PigeonInternalProxyApiBaseCodec + _pigeonVar_codecContentProgressProvider = + _PigeonInternalProxyApiBaseCodec(pigeon_instanceManager); + static void pigeon_setUpMessageHandlers({ bool pigeon_clearHandlers = false, BinaryMessenger? pigeon_binaryMessenger, PigeonInstanceManager? pigeon_instanceManager, ContentProgressProvider Function()? pigeon_newInstance, }) { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - _PigeonProxyApiBaseCodec( + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _PigeonInternalProxyApiBaseCodec( pigeon_instanceManager ?? PigeonInstanceManager.instance); final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.interactive_media_ads.ContentProgressProvider.pigeon_newInstance', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (pigeon_clearHandlers) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.interactive_media_ads.ContentProgressProvider.pigeon_newInstance was null.'); final List args = (message as List?)!; @@ -1440,6 +1523,37 @@ class ContentProgressProvider extends PigeonProxyApiBaseClass { } } + /// Sets an update on the progress of the video. + /// + /// This is a custom method added to the native class because the native + /// method `getContentProgress` requires a synchronous return value. + Future setContentProgress(VideoProgressUpdate update) async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecContentProgressProvider; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.interactive_media_ads.ContentProgressProvider.setContentProgress'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([this, update]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return; + } + } + @override ContentProgressProvider pigeon_copy() { return ContentProgressProvider.pigeon_detached( @@ -1464,8 +1578,8 @@ class AdsManager extends BaseManager { super.pigeon_instanceManager, }) : super.pigeon_detached(); - late final _PigeonProxyApiBaseCodec __pigeon_codecAdsManager = - _PigeonProxyApiBaseCodec(pigeon_instanceManager); + late final _PigeonInternalProxyApiBaseCodec _pigeonVar_codecAdsManager = + _PigeonInternalProxyApiBaseCodec(pigeon_instanceManager); static void pigeon_setUpMessageHandlers({ bool pigeon_clearHandlers = false, @@ -1473,20 +1587,21 @@ class AdsManager extends BaseManager { PigeonInstanceManager? pigeon_instanceManager, AdsManager Function()? pigeon_newInstance, }) { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - _PigeonProxyApiBaseCodec( + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _PigeonInternalProxyApiBaseCodec( pigeon_instanceManager ?? PigeonInstanceManager.instance); final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.interactive_media_ads.AdsManager.pigeon_newInstance', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (pigeon_clearHandlers) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.interactive_media_ads.AdsManager.pigeon_newInstance was null.'); final List args = (message as List?)!; @@ -1517,26 +1632,26 @@ class AdsManager extends BaseManager { /// Discards current ad break and resumes content. Future discardAdBreak() async { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - __pigeon_codecAdsManager; - final BinaryMessenger? __pigeon_binaryMessenger = pigeon_binaryMessenger; - const String __pigeon_channelName = + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecAdsManager; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = 'dev.flutter.pigeon.interactive_media_ads.AdsManager.discardAdBreak'; - final BasicMessageChannel __pigeon_channel = + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([this]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([this]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -1545,26 +1660,26 @@ class AdsManager extends BaseManager { /// Pauses the current ad. Future pause() async { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - __pigeon_codecAdsManager; - final BinaryMessenger? __pigeon_binaryMessenger = pigeon_binaryMessenger; - const String __pigeon_channelName = + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecAdsManager; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = 'dev.flutter.pigeon.interactive_media_ads.AdsManager.pause'; - final BasicMessageChannel __pigeon_channel = + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([this]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([this]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -1573,26 +1688,120 @@ class AdsManager extends BaseManager { /// Starts playing the ads. Future start() async { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - __pigeon_codecAdsManager; - final BinaryMessenger? __pigeon_binaryMessenger = pigeon_binaryMessenger; - const String __pigeon_channelName = + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecAdsManager; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = 'dev.flutter.pigeon.interactive_media_ads.AdsManager.start'; - final BasicMessageChannel __pigeon_channel = + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([this]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return; + } + } + + /// List of content time offsets in seconds at which ad breaks are scheduled. + /// + /// The list will be empty if no ad breaks are scheduled. + Future> getAdCuePoints() async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecAdsManager; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.interactive_media_ads.AdsManager.getAdCuePoints'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([this]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } else { + return (pigeonVar_replyList[0] as List?)!.cast(); + } + } + + /// Resumes the current ad. + Future resume() async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecAdsManager; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.interactive_media_ads.AdsManager.resume'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([this]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([this]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return; + } + } + + /// Skips the current ad. + /// + /// `AdsManager.skip()` only skips ads if IMA does not render the 'Skip ad' + /// button. + Future skip() async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecAdsManager; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.interactive_media_ads.AdsManager.skip'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([this]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -1611,7 +1820,7 @@ class AdsManager extends BaseManager { /// Base interface for managing ads.. /// /// See https://developers.google.com/interactive-media-ads/docs/sdks/android/client-side/api/reference/com/google/ads/interactivemedia/v3/api/BaseManager.html. -class BaseManager extends PigeonProxyApiBaseClass { +class BaseManager extends PigeonInternalProxyApiBaseClass { /// Constructs [BaseManager] without creating the associated native object. /// /// This should only be used by subclasses created by this library or to @@ -1622,8 +1831,8 @@ class BaseManager extends PigeonProxyApiBaseClass { super.pigeon_instanceManager, }); - late final _PigeonProxyApiBaseCodec __pigeon_codecBaseManager = - _PigeonProxyApiBaseCodec(pigeon_instanceManager); + late final _PigeonInternalProxyApiBaseCodec _pigeonVar_codecBaseManager = + _PigeonInternalProxyApiBaseCodec(pigeon_instanceManager); static void pigeon_setUpMessageHandlers({ bool pigeon_clearHandlers = false, @@ -1631,20 +1840,21 @@ class BaseManager extends PigeonProxyApiBaseClass { PigeonInstanceManager? pigeon_instanceManager, BaseManager Function()? pigeon_newInstance, }) { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - _PigeonProxyApiBaseCodec( + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _PigeonInternalProxyApiBaseCodec( pigeon_instanceManager ?? PigeonInstanceManager.instance); final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.interactive_media_ads.BaseManager.pigeon_newInstance', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (pigeon_clearHandlers) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.interactive_media_ads.BaseManager.pigeon_newInstance was null.'); final List args = (message as List?)!; @@ -1676,26 +1886,26 @@ class BaseManager extends PigeonProxyApiBaseClass { /// Registers a listener for errors that occur during the ad or stream /// initialization and playback. Future addAdErrorListener(AdErrorListener errorListener) async { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - __pigeon_codecBaseManager; - final BinaryMessenger? __pigeon_binaryMessenger = pigeon_binaryMessenger; - const String __pigeon_channelName = + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecBaseManager; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = 'dev.flutter.pigeon.interactive_media_ads.BaseManager.addAdErrorListener'; - final BasicMessageChannel __pigeon_channel = + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel + final List? pigeonVar_replyList = await pigeonVar_channel .send([this, errorListener]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -1705,26 +1915,26 @@ class BaseManager extends PigeonProxyApiBaseClass { /// Registers a listener for ad events that occur during ad or stream /// initialization and playback. Future addAdEventListener(AdEventListener adEventListener) async { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - __pigeon_codecBaseManager; - final BinaryMessenger? __pigeon_binaryMessenger = pigeon_binaryMessenger; - const String __pigeon_channelName = + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecBaseManager; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = 'dev.flutter.pigeon.interactive_media_ads.BaseManager.addAdEventListener'; - final BasicMessageChannel __pigeon_channel = + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel + final List? pigeonVar_replyList = await pigeonVar_channel .send([this, adEventListener]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -1734,26 +1944,26 @@ class BaseManager extends PigeonProxyApiBaseClass { /// Stops the ad and all tracking, then releases all assets that were loaded /// to play the ad. Future destroy() async { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - __pigeon_codecBaseManager; - final BinaryMessenger? __pigeon_binaryMessenger = pigeon_binaryMessenger; - const String __pigeon_channelName = + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecBaseManager; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = 'dev.flutter.pigeon.interactive_media_ads.BaseManager.destroy'; - final BasicMessageChannel __pigeon_channel = + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([this]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([this]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -1762,26 +1972,26 @@ class BaseManager extends PigeonProxyApiBaseClass { /// Initializes the ad experience using default rendering settings Future init() async { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - __pigeon_codecBaseManager; - final BinaryMessenger? __pigeon_binaryMessenger = pigeon_binaryMessenger; - const String __pigeon_channelName = + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecBaseManager; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = 'dev.flutter.pigeon.interactive_media_ads.BaseManager.init'; - final BasicMessageChannel __pigeon_channel = + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([this]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([this]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -1800,7 +2010,7 @@ class BaseManager extends PigeonProxyApiBaseClass { /// Event to notify publisher that an event occurred with an Ad. /// /// See https://developers.google.com/interactive-media-ads/docs/sdks/android/client-side/api/reference/com/google/ads/interactivemedia/v3/api/AdEvent.html. -class AdEvent extends PigeonProxyApiBaseClass { +class AdEvent extends PigeonInternalProxyApiBaseClass { /// Constructs [AdEvent] without creating the associated native object. /// /// This should only be used by subclasses created by this library or to @@ -1817,7 +2027,7 @@ class AdEvent extends PigeonProxyApiBaseClass { final AdEventType type; /// A map containing any extra ad data for the event, if needed. - final Map? adData; + final Map? adData; static void pigeon_setUpMessageHandlers({ bool pigeon_clearHandlers = false, @@ -1825,23 +2035,24 @@ class AdEvent extends PigeonProxyApiBaseClass { PigeonInstanceManager? pigeon_instanceManager, AdEvent Function( AdEventType type, - Map? adData, + Map? adData, )? pigeon_newInstance, }) { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - _PigeonProxyApiBaseCodec( + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _PigeonInternalProxyApiBaseCodec( pigeon_instanceManager ?? PigeonInstanceManager.instance); final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.interactive_media_ads.AdEvent.pigeon_newInstance', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (pigeon_clearHandlers) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.interactive_media_ads.AdEvent.pigeon_newInstance was null.'); final List args = (message as List?)!; @@ -1851,8 +2062,8 @@ class AdEvent extends PigeonProxyApiBaseClass { final AdEventType? arg_type = (args[1] as AdEventType?); assert(arg_type != null, 'Argument for dev.flutter.pigeon.interactive_media_ads.AdEvent.pigeon_newInstance was null, expected non-null AdEventType.'); - final Map? arg_adData = - (args[2] as Map?)?.cast(); + final Map? arg_adData = + (args[2] as Map?)?.cast(); try { (pigeon_instanceManager ?? PigeonInstanceManager.instance) .addHostCreatedInstance( @@ -1891,7 +2102,7 @@ class AdEvent extends PigeonProxyApiBaseClass { /// Factory class for creating SDK objects. /// /// See https://developers.google.com/interactive-media-ads/docs/sdks/android/client-side/api/reference/com/google/ads/interactivemedia/v3/api/ImaSdkFactory. -class ImaSdkFactory extends PigeonProxyApiBaseClass { +class ImaSdkFactory extends PigeonInternalProxyApiBaseClass { /// Constructs [ImaSdkFactory] without creating the associated native object. /// /// This should only be used by subclasses created by this library or to @@ -1902,10 +2113,10 @@ class ImaSdkFactory extends PigeonProxyApiBaseClass { super.pigeon_instanceManager, }); - late final _PigeonProxyApiBaseCodec __pigeon_codecImaSdkFactory = - _PigeonProxyApiBaseCodec(pigeon_instanceManager); + late final _PigeonInternalProxyApiBaseCodec _pigeonVar_codecImaSdkFactory = + _PigeonInternalProxyApiBaseCodec(pigeon_instanceManager); - static final ImaSdkFactory instance = __pigeon_instance(); + static final ImaSdkFactory instance = pigeonVar_instance(); static void pigeon_setUpMessageHandlers({ bool pigeon_clearHandlers = false, @@ -1913,20 +2124,21 @@ class ImaSdkFactory extends PigeonProxyApiBaseClass { PigeonInstanceManager? pigeon_instanceManager, ImaSdkFactory Function()? pigeon_newInstance, }) { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - _PigeonProxyApiBaseCodec( + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _PigeonInternalProxyApiBaseCodec( pigeon_instanceManager ?? PigeonInstanceManager.instance); final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.interactive_media_ads.ImaSdkFactory.pigeon_newInstance', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (pigeon_clearHandlers) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.interactive_media_ads.ImaSdkFactory.pigeon_newInstance was null.'); final List args = (message as List?)!; @@ -1955,38 +2167,38 @@ class ImaSdkFactory extends PigeonProxyApiBaseClass { } } - static ImaSdkFactory __pigeon_instance() { - final ImaSdkFactory __pigeon_instance = ImaSdkFactory.pigeon_detached(); - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - _PigeonProxyApiBaseCodec(PigeonInstanceManager.instance); - final BinaryMessenger __pigeon_binaryMessenger = + static ImaSdkFactory pigeonVar_instance() { + final ImaSdkFactory pigeonVar_instance = ImaSdkFactory.pigeon_detached(); + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _PigeonInternalProxyApiBaseCodec(PigeonInstanceManager.instance); + final BinaryMessenger pigeonVar_binaryMessenger = ServicesBinding.instance.defaultBinaryMessenger; - final int __pigeon_instanceIdentifier = PigeonInstanceManager.instance - .addDartCreatedInstance(__pigeon_instance); + final int pigeonVar_instanceIdentifier = PigeonInstanceManager.instance + .addDartCreatedInstance(pigeonVar_instance); () async { - const String __pigeon_channelName = + const String pigeonVar_channelName = 'dev.flutter.pigeon.interactive_media_ads.ImaSdkFactory.instance'; - final BasicMessageChannel __pigeon_channel = + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([__pigeon_instanceIdentifier]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = await pigeonVar_channel + .send([pigeonVar_instanceIdentifier]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; } }(); - return __pigeon_instance; + return pigeonVar_instance; } static Future createAdDisplayContainer( @@ -1995,68 +2207,68 @@ class ImaSdkFactory extends PigeonProxyApiBaseClass { BinaryMessenger? pigeon_binaryMessenger, PigeonInstanceManager? pigeon_instanceManager, }) async { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - _PigeonProxyApiBaseCodec( + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _PigeonInternalProxyApiBaseCodec( pigeon_instanceManager ?? PigeonInstanceManager.instance); - final BinaryMessenger? __pigeon_binaryMessenger = pigeon_binaryMessenger; - const String __pigeon_channelName = + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = 'dev.flutter.pigeon.interactive_media_ads.ImaSdkFactory.createAdDisplayContainer'; - final BasicMessageChannel __pigeon_channel = + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel + final List? pigeonVar_replyList = await pigeonVar_channel .send([container, player]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as AdDisplayContainer?)!; + return (pigeonVar_replyList[0] as AdDisplayContainer?)!; } } /// Creates an `ImaSdkSettings` object for configuring the IMA SDK. Future createImaSdkSettings() async { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - __pigeon_codecImaSdkFactory; - final BinaryMessenger? __pigeon_binaryMessenger = pigeon_binaryMessenger; - const String __pigeon_channelName = + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecImaSdkFactory; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = 'dev.flutter.pigeon.interactive_media_ads.ImaSdkFactory.createImaSdkSettings'; - final BasicMessageChannel __pigeon_channel = + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([this]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([this]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as ImaSdkSettings?)!; + return (pigeonVar_replyList[0] as ImaSdkSettings?)!; } } @@ -2066,67 +2278,67 @@ class ImaSdkFactory extends PigeonProxyApiBaseClass { ImaSdkSettings settings, AdDisplayContainer container, ) async { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - __pigeon_codecImaSdkFactory; - final BinaryMessenger? __pigeon_binaryMessenger = pigeon_binaryMessenger; - const String __pigeon_channelName = + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecImaSdkFactory; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = 'dev.flutter.pigeon.interactive_media_ads.ImaSdkFactory.createAdsLoader'; - final BasicMessageChannel __pigeon_channel = + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel + final List? pigeonVar_replyList = await pigeonVar_channel .send([this, settings, container]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as AdsLoader?)!; + return (pigeonVar_replyList[0] as AdsLoader?)!; } } /// Creates an AdsRequest object to contain the data used to request ads. Future createAdsRequest() async { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - __pigeon_codecImaSdkFactory; - final BinaryMessenger? __pigeon_binaryMessenger = pigeon_binaryMessenger; - const String __pigeon_channelName = + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecImaSdkFactory; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = 'dev.flutter.pigeon.interactive_media_ads.ImaSdkFactory.createAdsRequest'; - final BasicMessageChannel __pigeon_channel = + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([this]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([this]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as AdsRequest?)!; + return (pigeonVar_replyList[0] as AdsRequest?)!; } } @@ -2142,7 +2354,7 @@ class ImaSdkFactory extends PigeonProxyApiBaseClass { /// Defines general SDK settings that are used when creating an `AdsLoader`. /// /// See https://developers.google.com/interactive-media-ads/docs/sdks/android/client-side/api/reference/com/google/ads/interactivemedia/v3/api/ImaSdkSettings.html. -class ImaSdkSettings extends PigeonProxyApiBaseClass { +class ImaSdkSettings extends PigeonInternalProxyApiBaseClass { /// Constructs [ImaSdkSettings] without creating the associated native object. /// /// This should only be used by subclasses created by this library or to @@ -2159,20 +2371,21 @@ class ImaSdkSettings extends PigeonProxyApiBaseClass { PigeonInstanceManager? pigeon_instanceManager, ImaSdkSettings Function()? pigeon_newInstance, }) { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - _PigeonProxyApiBaseCodec( + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _PigeonInternalProxyApiBaseCodec( pigeon_instanceManager ?? PigeonInstanceManager.instance); final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.interactive_media_ads.ImaSdkSettings.pigeon_newInstance', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (pigeon_clearHandlers) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.interactive_media_ads.ImaSdkSettings.pigeon_newInstance was null.'); final List args = (message as List?)!; @@ -2213,37 +2426,40 @@ class ImaSdkSettings extends PigeonProxyApiBaseClass { /// Defines an update to the video's progress. /// /// See https://developers.google.com/interactive-media-ads/docs/sdks/android/client-side/api/reference/com/google/ads/interactivemedia/v3/api/player/VideoProgressUpdate.html. -class VideoProgressUpdate extends PigeonProxyApiBaseClass { +class VideoProgressUpdate extends PigeonInternalProxyApiBaseClass { VideoProgressUpdate({ super.pigeon_binaryMessenger, super.pigeon_instanceManager, required int currentTimeMs, required int durationMs, }) { - final int __pigeon_instanceIdentifier = + final int pigeonVar_instanceIdentifier = pigeon_instanceManager.addDartCreatedInstance(this); - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - __pigeon_codecVideoProgressUpdate; - final BinaryMessenger? __pigeon_binaryMessenger = pigeon_binaryMessenger; + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecVideoProgressUpdate; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; () async { - const String __pigeon_channelName = + const String pigeonVar_channelName = 'dev.flutter.pigeon.interactive_media_ads.VideoProgressUpdate.pigeon_defaultConstructor'; - final BasicMessageChannel __pigeon_channel = + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel.send( - [__pigeon_instanceIdentifier, currentTimeMs, durationMs]) - as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = await pigeonVar_channel + .send([ + pigeonVar_instanceIdentifier, + currentTimeMs, + durationMs + ]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -2261,13 +2477,14 @@ class VideoProgressUpdate extends PigeonProxyApiBaseClass { super.pigeon_instanceManager, }); - late final _PigeonProxyApiBaseCodec __pigeon_codecVideoProgressUpdate = - _PigeonProxyApiBaseCodec(pigeon_instanceManager); + late final _PigeonInternalProxyApiBaseCodec + _pigeonVar_codecVideoProgressUpdate = + _PigeonInternalProxyApiBaseCodec(pigeon_instanceManager); /// Value to use for cases when progress is not yet defined, such as video /// initialization. static final VideoProgressUpdate videoTimeNotReady = - __pigeon_videoTimeNotReady(); + pigeonVar_videoTimeNotReady(); static void pigeon_setUpMessageHandlers({ bool pigeon_clearHandlers = false, @@ -2275,20 +2492,21 @@ class VideoProgressUpdate extends PigeonProxyApiBaseClass { PigeonInstanceManager? pigeon_instanceManager, VideoProgressUpdate Function()? pigeon_newInstance, }) { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - _PigeonProxyApiBaseCodec( + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _PigeonInternalProxyApiBaseCodec( pigeon_instanceManager ?? PigeonInstanceManager.instance); final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.interactive_media_ads.VideoProgressUpdate.pigeon_newInstance', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (pigeon_clearHandlers) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.interactive_media_ads.VideoProgressUpdate.pigeon_newInstance was null.'); final List args = (message as List?)!; @@ -2317,39 +2535,39 @@ class VideoProgressUpdate extends PigeonProxyApiBaseClass { } } - static VideoProgressUpdate __pigeon_videoTimeNotReady() { - final VideoProgressUpdate __pigeon_instance = + static VideoProgressUpdate pigeonVar_videoTimeNotReady() { + final VideoProgressUpdate pigeonVar_instance = VideoProgressUpdate.pigeon_detached(); - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - _PigeonProxyApiBaseCodec(PigeonInstanceManager.instance); - final BinaryMessenger __pigeon_binaryMessenger = + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _PigeonInternalProxyApiBaseCodec(PigeonInstanceManager.instance); + final BinaryMessenger pigeonVar_binaryMessenger = ServicesBinding.instance.defaultBinaryMessenger; - final int __pigeon_instanceIdentifier = PigeonInstanceManager.instance - .addDartCreatedInstance(__pigeon_instance); + final int pigeonVar_instanceIdentifier = PigeonInstanceManager.instance + .addDartCreatedInstance(pigeonVar_instance); () async { - const String __pigeon_channelName = + const String pigeonVar_channelName = 'dev.flutter.pigeon.interactive_media_ads.VideoProgressUpdate.videoTimeNotReady'; - final BasicMessageChannel __pigeon_channel = + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([__pigeon_instanceIdentifier]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = await pigeonVar_channel + .send([pigeonVar_instanceIdentifier]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; } }(); - return __pigeon_instance; + return pigeonVar_instance; } @override @@ -2364,7 +2582,7 @@ class VideoProgressUpdate extends PigeonProxyApiBaseClass { /// The minimal information required to play an ad. /// /// See https://developers.google.com/interactive-media-ads/docs/sdks/android/client-side/api/reference/com/google/ads/interactivemedia/v3/api/player/AdMediaInfo.html. -class AdMediaInfo extends PigeonProxyApiBaseClass { +class AdMediaInfo extends PigeonInternalProxyApiBaseClass { /// Constructs [AdMediaInfo] without creating the associated native object. /// /// This should only be used by subclasses created by this library or to @@ -2384,20 +2602,21 @@ class AdMediaInfo extends PigeonProxyApiBaseClass { PigeonInstanceManager? pigeon_instanceManager, AdMediaInfo Function(String url)? pigeon_newInstance, }) { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - _PigeonProxyApiBaseCodec( + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _PigeonInternalProxyApiBaseCodec( pigeon_instanceManager ?? PigeonInstanceManager.instance); final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.interactive_media_ads.AdMediaInfo.pigeon_newInstance', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (pigeon_clearHandlers) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.interactive_media_ads.AdMediaInfo.pigeon_newInstance was null.'); final List args = (message as List?)!; @@ -2443,7 +2662,7 @@ class AdMediaInfo extends PigeonProxyApiBaseClass { /// An ad may be part of a pod of ads. /// /// See https://developers.google.com/interactive-media-ads/docs/sdks/android/client-side/api/reference/com/google/ads/interactivemedia/v3/api/AdPodInfo.html. -class AdPodInfo extends PigeonProxyApiBaseClass { +class AdPodInfo extends PigeonInternalProxyApiBaseClass { /// Constructs [AdPodInfo] without creating the associated native object. /// /// This should only be used by subclasses created by this library or to @@ -2500,20 +2719,21 @@ class AdPodInfo extends PigeonProxyApiBaseClass { bool isBumper, )? pigeon_newInstance, }) { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - _PigeonProxyApiBaseCodec( + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _PigeonInternalProxyApiBaseCodec( pigeon_instanceManager ?? PigeonInstanceManager.instance); final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.interactive_media_ads.AdPodInfo.pigeon_newInstance', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (pigeon_clearHandlers) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.interactive_media_ads.AdPodInfo.pigeon_newInstance was null.'); final List args = (message as List?)!; @@ -2596,29 +2816,29 @@ class FrameLayout extends ViewGroup { super.pigeon_binaryMessenger, super.pigeon_instanceManager, }) : super.pigeon_detached() { - final int __pigeon_instanceIdentifier = + final int pigeonVar_instanceIdentifier = pigeon_instanceManager.addDartCreatedInstance(this); - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - __pigeon_codecFrameLayout; - final BinaryMessenger? __pigeon_binaryMessenger = pigeon_binaryMessenger; + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecFrameLayout; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; () async { - const String __pigeon_channelName = + const String pigeonVar_channelName = 'dev.flutter.pigeon.interactive_media_ads.FrameLayout.pigeon_defaultConstructor'; - final BasicMessageChannel __pigeon_channel = + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([__pigeon_instanceIdentifier]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = await pigeonVar_channel + .send([pigeonVar_instanceIdentifier]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -2636,8 +2856,8 @@ class FrameLayout extends ViewGroup { super.pigeon_instanceManager, }) : super.pigeon_detached(); - late final _PigeonProxyApiBaseCodec __pigeon_codecFrameLayout = - _PigeonProxyApiBaseCodec(pigeon_instanceManager); + late final _PigeonInternalProxyApiBaseCodec _pigeonVar_codecFrameLayout = + _PigeonInternalProxyApiBaseCodec(pigeon_instanceManager); static void pigeon_setUpMessageHandlers({ bool pigeon_clearHandlers = false, @@ -2645,20 +2865,21 @@ class FrameLayout extends ViewGroup { PigeonInstanceManager? pigeon_instanceManager, FrameLayout Function()? pigeon_newInstance, }) { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - _PigeonProxyApiBaseCodec( + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _PigeonInternalProxyApiBaseCodec( pigeon_instanceManager ?? PigeonInstanceManager.instance); final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.interactive_media_ads.FrameLayout.pigeon_newInstance', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (pigeon_clearHandlers) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.interactive_media_ads.FrameLayout.pigeon_newInstance was null.'); final List args = (message as List?)!; @@ -2710,8 +2931,8 @@ class ViewGroup extends View { super.pigeon_instanceManager, }) : super.pigeon_detached(); - late final _PigeonProxyApiBaseCodec __pigeon_codecViewGroup = - _PigeonProxyApiBaseCodec(pigeon_instanceManager); + late final _PigeonInternalProxyApiBaseCodec _pigeonVar_codecViewGroup = + _PigeonInternalProxyApiBaseCodec(pigeon_instanceManager); static void pigeon_setUpMessageHandlers({ bool pigeon_clearHandlers = false, @@ -2719,20 +2940,21 @@ class ViewGroup extends View { PigeonInstanceManager? pigeon_instanceManager, ViewGroup Function()? pigeon_newInstance, }) { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - _PigeonProxyApiBaseCodec( + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _PigeonInternalProxyApiBaseCodec( pigeon_instanceManager ?? PigeonInstanceManager.instance); final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.interactive_media_ads.ViewGroup.pigeon_newInstance', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (pigeon_clearHandlers) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.interactive_media_ads.ViewGroup.pigeon_newInstance was null.'); final List args = (message as List?)!; @@ -2761,26 +2983,58 @@ class ViewGroup extends View { } } + /// Adds a child view. Future addView(View view) async { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = __pigeon_codecViewGroup; - final BinaryMessenger? __pigeon_binaryMessenger = pigeon_binaryMessenger; - const String __pigeon_channelName = + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecViewGroup; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = 'dev.flutter.pigeon.interactive_media_ads.ViewGroup.addView'; - final BasicMessageChannel __pigeon_channel = + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([this, view]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return; + } + } + + /// Called by a ViewGroup subclass to remove child views from itself, when it + /// must first know its size on screen before it can calculate how many child + /// views it will render. + Future removeView(View view) async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecViewGroup; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.interactive_media_ads.ViewGroup.removeView'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([this, view]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([this, view]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -2807,28 +3061,29 @@ class VideoView extends View { this.onCompletion, required this.onError, }) : super.pigeon_detached() { - final int __pigeon_instanceIdentifier = + final int pigeonVar_instanceIdentifier = pigeon_instanceManager.addDartCreatedInstance(this); - final _PigeonProxyApiBaseCodec pigeonChannelCodec = __pigeon_codecVideoView; - final BinaryMessenger? __pigeon_binaryMessenger = pigeon_binaryMessenger; + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecVideoView; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; () async { - const String __pigeon_channelName = + const String pigeonVar_channelName = 'dev.flutter.pigeon.interactive_media_ads.VideoView.pigeon_defaultConstructor'; - final BasicMessageChannel __pigeon_channel = + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([__pigeon_instanceIdentifier]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = await pigeonVar_channel + .send([pigeonVar_instanceIdentifier]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -2849,8 +3104,8 @@ class VideoView extends View { required this.onError, }) : super.pigeon_detached(); - late final _PigeonProxyApiBaseCodec __pigeon_codecVideoView = - _PigeonProxyApiBaseCodec(pigeon_instanceManager); + late final _PigeonInternalProxyApiBaseCodec _pigeonVar_codecVideoView = + _PigeonInternalProxyApiBaseCodec(pigeon_instanceManager); /// Callback to be invoked when the media source is ready for playback. /// @@ -2946,20 +3201,20 @@ class VideoView extends View { int extra, )? onError, }) { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - _PigeonProxyApiBaseCodec( + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _PigeonInternalProxyApiBaseCodec( pigeon_instanceManager ?? PigeonInstanceManager.instance); final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger; { - final BasicMessageChannel __pigeon_channel = + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.interactive_media_ads.VideoView.onPrepared', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (pigeon_clearHandlers) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.interactive_media_ads.VideoView.onPrepared was null.'); final List args = (message as List?)!; @@ -2984,15 +3239,15 @@ class VideoView extends View { } { - final BasicMessageChannel __pigeon_channel = + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.interactive_media_ads.VideoView.onCompletion', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (pigeon_clearHandlers) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.interactive_media_ads.VideoView.onCompletion was null.'); final List args = (message as List?)!; @@ -3017,15 +3272,15 @@ class VideoView extends View { } { - final BasicMessageChannel __pigeon_channel = + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.interactive_media_ads.VideoView.onError', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (pigeon_clearHandlers) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.interactive_media_ads.VideoView.onError was null.'); final List args = (message as List?)!; @@ -3057,26 +3312,27 @@ class VideoView extends View { } /// Sets the URI of the video. - Future setVideoUri(String uri) async { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = __pigeon_codecVideoView; - final BinaryMessenger? __pigeon_binaryMessenger = pigeon_binaryMessenger; - const String __pigeon_channelName = + Future setVideoUri(String? uri) async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecVideoView; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = 'dev.flutter.pigeon.interactive_media_ads.VideoView.setVideoUri'; - final BasicMessageChannel __pigeon_channel = + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([this, uri]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([this, uri]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -3087,33 +3343,34 @@ class VideoView extends View { /// /// In milliseconds. Future getCurrentPosition() async { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = __pigeon_codecVideoView; - final BinaryMessenger? __pigeon_binaryMessenger = pigeon_binaryMessenger; - const String __pigeon_channelName = + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecVideoView; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = 'dev.flutter.pigeon.interactive_media_ads.VideoView.getCurrentPosition'; - final BasicMessageChannel __pigeon_channel = + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([this]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([this]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as int?)!; + return (pigeonVar_replyList[0] as int?)!; } } @@ -3132,7 +3389,7 @@ class VideoView extends View { /// This class represents the basic building block for user interface components. /// /// See https://developer.android.com/reference/android/view/View. -class View extends PigeonProxyApiBaseClass { +class View extends PigeonInternalProxyApiBaseClass { /// Constructs [View] without creating the associated native object. /// /// This should only be used by subclasses created by this library or to @@ -3149,20 +3406,21 @@ class View extends PigeonProxyApiBaseClass { PigeonInstanceManager? pigeon_instanceManager, View Function()? pigeon_newInstance, }) { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - _PigeonProxyApiBaseCodec( + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _PigeonInternalProxyApiBaseCodec( pigeon_instanceManager ?? PigeonInstanceManager.instance); final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.interactive_media_ads.View.pigeon_newInstance', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (pigeon_clearHandlers) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.interactive_media_ads.View.pigeon_newInstance was null.'); final List args = (message as List?)!; @@ -3204,7 +3462,7 @@ class View extends PigeonProxyApiBaseClass { /// streams. /// /// See https://developer.android.com/reference/android/media/MediaPlayer. -class MediaPlayer extends PigeonProxyApiBaseClass { +class MediaPlayer extends PigeonInternalProxyApiBaseClass { /// Constructs [MediaPlayer] without creating the associated native object. /// /// This should only be used by subclasses created by this library or to @@ -3215,8 +3473,8 @@ class MediaPlayer extends PigeonProxyApiBaseClass { super.pigeon_instanceManager, }); - late final _PigeonProxyApiBaseCodec __pigeon_codecMediaPlayer = - _PigeonProxyApiBaseCodec(pigeon_instanceManager); + late final _PigeonInternalProxyApiBaseCodec _pigeonVar_codecMediaPlayer = + _PigeonInternalProxyApiBaseCodec(pigeon_instanceManager); static void pigeon_setUpMessageHandlers({ bool pigeon_clearHandlers = false, @@ -3224,20 +3482,21 @@ class MediaPlayer extends PigeonProxyApiBaseClass { PigeonInstanceManager? pigeon_instanceManager, MediaPlayer Function()? pigeon_newInstance, }) { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - _PigeonProxyApiBaseCodec( + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _PigeonInternalProxyApiBaseCodec( pigeon_instanceManager ?? PigeonInstanceManager.instance); final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.interactive_media_ads.MediaPlayer.pigeon_newInstance', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (pigeon_clearHandlers) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.interactive_media_ads.MediaPlayer.pigeon_newInstance was null.'); final List args = (message as List?)!; @@ -3268,59 +3527,59 @@ class MediaPlayer extends PigeonProxyApiBaseClass { /// Gets the duration of the file. Future getDuration() async { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - __pigeon_codecMediaPlayer; - final BinaryMessenger? __pigeon_binaryMessenger = pigeon_binaryMessenger; - const String __pigeon_channelName = + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecMediaPlayer; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = 'dev.flutter.pigeon.interactive_media_ads.MediaPlayer.getDuration'; - final BasicMessageChannel __pigeon_channel = + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([this]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([this]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as int?)!; + return (pigeonVar_replyList[0] as int?)!; } } /// Seeks to specified time position. Future seekTo(int mSec) async { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - __pigeon_codecMediaPlayer; - final BinaryMessenger? __pigeon_binaryMessenger = pigeon_binaryMessenger; - const String __pigeon_channelName = + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecMediaPlayer; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = 'dev.flutter.pigeon.interactive_media_ads.MediaPlayer.seekTo'; - final BasicMessageChannel __pigeon_channel = + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([this, mSec]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([this, mSec]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -3329,26 +3588,26 @@ class MediaPlayer extends PigeonProxyApiBaseClass { /// Starts or resumes playback. Future start() async { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - __pigeon_codecMediaPlayer; - final BinaryMessenger? __pigeon_binaryMessenger = pigeon_binaryMessenger; - const String __pigeon_channelName = + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecMediaPlayer; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = 'dev.flutter.pigeon.interactive_media_ads.MediaPlayer.start'; - final BasicMessageChannel __pigeon_channel = + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([this]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([this]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -3357,26 +3616,26 @@ class MediaPlayer extends PigeonProxyApiBaseClass { /// Pauses playback. Future pause() async { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - __pigeon_codecMediaPlayer; - final BinaryMessenger? __pigeon_binaryMessenger = pigeon_binaryMessenger; - const String __pigeon_channelName = + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecMediaPlayer; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = 'dev.flutter.pigeon.interactive_media_ads.MediaPlayer.pause'; - final BasicMessageChannel __pigeon_channel = + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([this]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([this]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -3385,26 +3644,26 @@ class MediaPlayer extends PigeonProxyApiBaseClass { /// Stops playback after playback has been started or paused. Future stop() async { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - __pigeon_codecMediaPlayer; - final BinaryMessenger? __pigeon_binaryMessenger = pigeon_binaryMessenger; - const String __pigeon_channelName = + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecMediaPlayer; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = 'dev.flutter.pigeon.interactive_media_ads.MediaPlayer.stop'; - final BasicMessageChannel __pigeon_channel = + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([this]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([this]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -3423,7 +3682,7 @@ class MediaPlayer extends PigeonProxyApiBaseClass { /// Callbacks that the player must fire. /// /// See https://developers.google.com/interactive-media-ads/docs/sdks/android/client-side/api/reference/com/google/ads/interactivemedia/v3/api/player/VideoAdPlayer.VideoAdPlayerCallback.html -class VideoAdPlayerCallback extends PigeonProxyApiBaseClass { +class VideoAdPlayerCallback extends PigeonInternalProxyApiBaseClass { /// Constructs [VideoAdPlayerCallback] without creating the associated native object. /// /// This should only be used by subclasses created by this library or to @@ -3434,8 +3693,9 @@ class VideoAdPlayerCallback extends PigeonProxyApiBaseClass { super.pigeon_instanceManager, }); - late final _PigeonProxyApiBaseCodec __pigeon_codecVideoAdPlayerCallback = - _PigeonProxyApiBaseCodec(pigeon_instanceManager); + late final _PigeonInternalProxyApiBaseCodec + _pigeonVar_codecVideoAdPlayerCallback = + _PigeonInternalProxyApiBaseCodec(pigeon_instanceManager); static void pigeon_setUpMessageHandlers({ bool pigeon_clearHandlers = false, @@ -3443,20 +3703,21 @@ class VideoAdPlayerCallback extends PigeonProxyApiBaseClass { PigeonInstanceManager? pigeon_instanceManager, VideoAdPlayerCallback Function()? pigeon_newInstance, }) { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - _PigeonProxyApiBaseCodec( + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _PigeonInternalProxyApiBaseCodec( pigeon_instanceManager ?? PigeonInstanceManager.instance); final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.interactive_media_ads.VideoAdPlayerCallback.pigeon_newInstance', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (pigeon_clearHandlers) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.interactive_media_ads.VideoAdPlayerCallback.pigeon_newInstance was null.'); final List args = (message as List?)!; @@ -3490,27 +3751,27 @@ class VideoAdPlayerCallback extends PigeonProxyApiBaseClass { AdMediaInfo adMediaInfo, VideoProgressUpdate videoProgressUpdate, ) async { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - __pigeon_codecVideoAdPlayerCallback; - final BinaryMessenger? __pigeon_binaryMessenger = pigeon_binaryMessenger; - const String __pigeon_channelName = + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecVideoAdPlayerCallback; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = 'dev.flutter.pigeon.interactive_media_ads.VideoAdPlayerCallback.onAdProgress'; - final BasicMessageChannel __pigeon_channel = + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel + final List? pigeonVar_replyList = await pigeonVar_channel .send([this, adMediaInfo, videoProgressUpdate]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -3519,26 +3780,26 @@ class VideoAdPlayerCallback extends PigeonProxyApiBaseClass { /// Fire this callback when video playback stalls waiting for data. Future onBuffering(AdMediaInfo adMediaInfo) async { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - __pigeon_codecVideoAdPlayerCallback; - final BinaryMessenger? __pigeon_binaryMessenger = pigeon_binaryMessenger; - const String __pigeon_channelName = + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecVideoAdPlayerCallback; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = 'dev.flutter.pigeon.interactive_media_ads.VideoAdPlayerCallback.onBuffering'; - final BasicMessageChannel __pigeon_channel = + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel + final List? pigeonVar_replyList = await pigeonVar_channel .send([this, adMediaInfo]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -3547,26 +3808,26 @@ class VideoAdPlayerCallback extends PigeonProxyApiBaseClass { /// Fire this callback when all content has finished playing. Future onContentComplete() async { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - __pigeon_codecVideoAdPlayerCallback; - final BinaryMessenger? __pigeon_binaryMessenger = pigeon_binaryMessenger; - const String __pigeon_channelName = + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecVideoAdPlayerCallback; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = 'dev.flutter.pigeon.interactive_media_ads.VideoAdPlayerCallback.onContentComplete'; - final BasicMessageChannel __pigeon_channel = + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([this]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([this]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -3575,26 +3836,26 @@ class VideoAdPlayerCallback extends PigeonProxyApiBaseClass { /// Fire this callback when the video finishes playing. Future onEnded(AdMediaInfo adMediaInfo) async { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - __pigeon_codecVideoAdPlayerCallback; - final BinaryMessenger? __pigeon_binaryMessenger = pigeon_binaryMessenger; - const String __pigeon_channelName = + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecVideoAdPlayerCallback; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = 'dev.flutter.pigeon.interactive_media_ads.VideoAdPlayerCallback.onEnded'; - final BasicMessageChannel __pigeon_channel = + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel + final List? pigeonVar_replyList = await pigeonVar_channel .send([this, adMediaInfo]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -3603,26 +3864,26 @@ class VideoAdPlayerCallback extends PigeonProxyApiBaseClass { /// Fire this callback when the video has encountered an error. Future onError(AdMediaInfo adMediaInfo) async { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - __pigeon_codecVideoAdPlayerCallback; - final BinaryMessenger? __pigeon_binaryMessenger = pigeon_binaryMessenger; - const String __pigeon_channelName = + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecVideoAdPlayerCallback; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = 'dev.flutter.pigeon.interactive_media_ads.VideoAdPlayerCallback.onError'; - final BasicMessageChannel __pigeon_channel = + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel + final List? pigeonVar_replyList = await pigeonVar_channel .send([this, adMediaInfo]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -3631,26 +3892,26 @@ class VideoAdPlayerCallback extends PigeonProxyApiBaseClass { /// Fire this callback when the video is ready to begin playback. Future onLoaded(AdMediaInfo adMediaInfo) async { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - __pigeon_codecVideoAdPlayerCallback; - final BinaryMessenger? __pigeon_binaryMessenger = pigeon_binaryMessenger; - const String __pigeon_channelName = + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecVideoAdPlayerCallback; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = 'dev.flutter.pigeon.interactive_media_ads.VideoAdPlayerCallback.onLoaded'; - final BasicMessageChannel __pigeon_channel = + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel + final List? pigeonVar_replyList = await pigeonVar_channel .send([this, adMediaInfo]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -3659,26 +3920,26 @@ class VideoAdPlayerCallback extends PigeonProxyApiBaseClass { /// Fire this callback when the video is paused. Future onPause(AdMediaInfo adMediaInfo) async { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - __pigeon_codecVideoAdPlayerCallback; - final BinaryMessenger? __pigeon_binaryMessenger = pigeon_binaryMessenger; - const String __pigeon_channelName = + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecVideoAdPlayerCallback; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = 'dev.flutter.pigeon.interactive_media_ads.VideoAdPlayerCallback.onPause'; - final BasicMessageChannel __pigeon_channel = + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel + final List? pigeonVar_replyList = await pigeonVar_channel .send([this, adMediaInfo]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -3687,26 +3948,26 @@ class VideoAdPlayerCallback extends PigeonProxyApiBaseClass { /// Fire this callback when the player begins playing a video. Future onPlay(AdMediaInfo adMediaInfo) async { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - __pigeon_codecVideoAdPlayerCallback; - final BinaryMessenger? __pigeon_binaryMessenger = pigeon_binaryMessenger; - const String __pigeon_channelName = + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecVideoAdPlayerCallback; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = 'dev.flutter.pigeon.interactive_media_ads.VideoAdPlayerCallback.onPlay'; - final BasicMessageChannel __pigeon_channel = + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel + final List? pigeonVar_replyList = await pigeonVar_channel .send([this, adMediaInfo]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -3715,26 +3976,26 @@ class VideoAdPlayerCallback extends PigeonProxyApiBaseClass { /// Fire this callback when the video is unpaused. Future onResume(AdMediaInfo adMediaInfo) async { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - __pigeon_codecVideoAdPlayerCallback; - final BinaryMessenger? __pigeon_binaryMessenger = pigeon_binaryMessenger; - const String __pigeon_channelName = + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecVideoAdPlayerCallback; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = 'dev.flutter.pigeon.interactive_media_ads.VideoAdPlayerCallback.onResume'; - final BasicMessageChannel __pigeon_channel = + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel + final List? pigeonVar_replyList = await pigeonVar_channel .send([this, adMediaInfo]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -3746,26 +4007,26 @@ class VideoAdPlayerCallback extends PigeonProxyApiBaseClass { AdMediaInfo adMediaInfo, int percentage, ) async { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - __pigeon_codecVideoAdPlayerCallback; - final BinaryMessenger? __pigeon_binaryMessenger = pigeon_binaryMessenger; - const String __pigeon_channelName = + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecVideoAdPlayerCallback; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = 'dev.flutter.pigeon.interactive_media_ads.VideoAdPlayerCallback.onVolumeChanged'; - final BasicMessageChannel __pigeon_channel = + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel + final List? pigeonVar_replyList = await pigeonVar_channel .send([this, adMediaInfo, percentage]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -3785,7 +4046,7 @@ class VideoAdPlayerCallback extends PigeonProxyApiBaseClass { /// the IMA SDK, as well as a set of callbacks that it must fire. /// /// See https://developers.google.com/interactive-media-ads/docs/sdks/android/client-side/api/reference/com/google/ads/interactivemedia/v3/api/player/VideoAdPlayer.html. -class VideoAdPlayer extends PigeonProxyApiBaseClass { +class VideoAdPlayer extends PigeonInternalProxyApiBaseClass { VideoAdPlayer({ super.pigeon_binaryMessenger, super.pigeon_instanceManager, @@ -3797,29 +4058,29 @@ class VideoAdPlayer extends PigeonProxyApiBaseClass { required this.removeCallback, required this.stopAd, }) { - final int __pigeon_instanceIdentifier = + final int pigeonVar_instanceIdentifier = pigeon_instanceManager.addDartCreatedInstance(this); - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - __pigeon_codecVideoAdPlayer; - final BinaryMessenger? __pigeon_binaryMessenger = pigeon_binaryMessenger; + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecVideoAdPlayer; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; () async { - const String __pigeon_channelName = + const String pigeonVar_channelName = 'dev.flutter.pigeon.interactive_media_ads.VideoAdPlayer.pigeon_defaultConstructor'; - final BasicMessageChannel __pigeon_channel = + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([__pigeon_instanceIdentifier]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = await pigeonVar_channel + .send([pigeonVar_instanceIdentifier]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -3844,8 +4105,8 @@ class VideoAdPlayer extends PigeonProxyApiBaseClass { required this.stopAd, }); - late final _PigeonProxyApiBaseCodec __pigeon_codecVideoAdPlayer = - _PigeonProxyApiBaseCodec(pigeon_instanceManager); + late final _PigeonInternalProxyApiBaseCodec _pigeonVar_codecVideoAdPlayer = + _PigeonInternalProxyApiBaseCodec(pigeon_instanceManager); /// Adds a callback. /// @@ -4045,20 +4306,21 @@ class VideoAdPlayer extends PigeonProxyApiBaseClass { AdMediaInfo adMediaInfo, )? stopAd, }) { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - _PigeonProxyApiBaseCodec( + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _PigeonInternalProxyApiBaseCodec( pigeon_instanceManager ?? PigeonInstanceManager.instance); final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.interactive_media_ads.VideoAdPlayer.addCallback', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (pigeon_clearHandlers) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.interactive_media_ads.VideoAdPlayer.addCallback was null.'); final List args = (message as List?)!; @@ -4085,15 +4347,15 @@ class VideoAdPlayer extends PigeonProxyApiBaseClass { } { - final BasicMessageChannel __pigeon_channel = + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.interactive_media_ads.VideoAdPlayer.loadAd', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (pigeon_clearHandlers) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.interactive_media_ads.VideoAdPlayer.loadAd was null.'); final List args = (message as List?)!; @@ -4122,15 +4384,15 @@ class VideoAdPlayer extends PigeonProxyApiBaseClass { } { - final BasicMessageChannel __pigeon_channel = + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.interactive_media_ads.VideoAdPlayer.pauseAd', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (pigeon_clearHandlers) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.interactive_media_ads.VideoAdPlayer.pauseAd was null.'); final List args = (message as List?)!; @@ -4156,15 +4418,15 @@ class VideoAdPlayer extends PigeonProxyApiBaseClass { } { - final BasicMessageChannel __pigeon_channel = + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.interactive_media_ads.VideoAdPlayer.playAd', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (pigeon_clearHandlers) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.interactive_media_ads.VideoAdPlayer.playAd was null.'); final List args = (message as List?)!; @@ -4190,15 +4452,15 @@ class VideoAdPlayer extends PigeonProxyApiBaseClass { } { - final BasicMessageChannel __pigeon_channel = + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.interactive_media_ads.VideoAdPlayer.release', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (pigeon_clearHandlers) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.interactive_media_ads.VideoAdPlayer.release was null.'); final List args = (message as List?)!; @@ -4221,15 +4483,16 @@ class VideoAdPlayer extends PigeonProxyApiBaseClass { } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.interactive_media_ads.VideoAdPlayer.removeCallback', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (pigeon_clearHandlers) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.interactive_media_ads.VideoAdPlayer.removeCallback was null.'); final List args = (message as List?)!; @@ -4256,15 +4519,15 @@ class VideoAdPlayer extends PigeonProxyApiBaseClass { } { - final BasicMessageChannel __pigeon_channel = + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( 'dev.flutter.pigeon.interactive_media_ads.VideoAdPlayer.stopAd', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (pigeon_clearHandlers) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.interactive_media_ads.VideoAdPlayer.stopAd was null.'); final List args = (message as List?)!; @@ -4292,26 +4555,26 @@ class VideoAdPlayer extends PigeonProxyApiBaseClass { /// The volume of the player as a percentage from 0 to 100. Future setVolume(int value) async { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - __pigeon_codecVideoAdPlayer; - final BinaryMessenger? __pigeon_binaryMessenger = pigeon_binaryMessenger; - const String __pigeon_channelName = + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecVideoAdPlayer; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = 'dev.flutter.pigeon.interactive_media_ads.VideoAdPlayer.setVolume'; - final BasicMessageChannel __pigeon_channel = + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([this, value]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([this, value]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -4321,26 +4584,26 @@ class VideoAdPlayer extends PigeonProxyApiBaseClass { /// The `VideoProgressUpdate` describing playback progress of the current /// video. Future setAdProgress(VideoProgressUpdate progress) async { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - __pigeon_codecVideoAdPlayer; - final BinaryMessenger? __pigeon_binaryMessenger = pigeon_binaryMessenger; - const String __pigeon_channelName = + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecVideoAdPlayer; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = 'dev.flutter.pigeon.interactive_media_ads.VideoAdPlayer.setAdProgress'; - final BasicMessageChannel __pigeon_channel = + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel + final List? pigeonVar_replyList = await pigeonVar_channel .send([this, progress]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -4366,35 +4629,35 @@ class VideoAdPlayer extends PigeonProxyApiBaseClass { /// Listener interface for notification of ad load or stream load completion. /// /// See https://developers.google.com/interactive-media-ads/docs/sdks/android/client-side/api/reference/com/google/ads/interactivemedia/v3/api/AdsLoader.AdsLoadedListener.html. -class AdsLoadedListener extends PigeonProxyApiBaseClass { +class AdsLoadedListener extends PigeonInternalProxyApiBaseClass { AdsLoadedListener({ super.pigeon_binaryMessenger, super.pigeon_instanceManager, required this.onAdsManagerLoaded, }) { - final int __pigeon_instanceIdentifier = + final int pigeonVar_instanceIdentifier = pigeon_instanceManager.addDartCreatedInstance(this); - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - __pigeon_codecAdsLoadedListener; - final BinaryMessenger? __pigeon_binaryMessenger = pigeon_binaryMessenger; + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecAdsLoadedListener; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; () async { - const String __pigeon_channelName = + const String pigeonVar_channelName = 'dev.flutter.pigeon.interactive_media_ads.AdsLoadedListener.pigeon_defaultConstructor'; - final BasicMessageChannel __pigeon_channel = + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([__pigeon_instanceIdentifier]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = await pigeonVar_channel + .send([pigeonVar_instanceIdentifier]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -4413,8 +4676,9 @@ class AdsLoadedListener extends PigeonProxyApiBaseClass { required this.onAdsManagerLoaded, }); - late final _PigeonProxyApiBaseCodec __pigeon_codecAdsLoadedListener = - _PigeonProxyApiBaseCodec(pigeon_instanceManager); + late final _PigeonInternalProxyApiBaseCodec + _pigeonVar_codecAdsLoadedListener = + _PigeonInternalProxyApiBaseCodec(pigeon_instanceManager); /// Called once the AdsManager or StreamManager has been loaded. /// @@ -4449,20 +4713,21 @@ class AdsLoadedListener extends PigeonProxyApiBaseClass { AdsManagerLoadedEvent event, )? onAdsManagerLoaded, }) { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - _PigeonProxyApiBaseCodec( + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _PigeonInternalProxyApiBaseCodec( pigeon_instanceManager ?? PigeonInstanceManager.instance); final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.interactive_media_ads.AdsLoadedListener.onAdsManagerLoaded', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (pigeon_clearHandlers) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.interactive_media_ads.AdsLoadedListener.onAdsManagerLoaded was null.'); final List args = (message as List?)!; @@ -4502,35 +4767,35 @@ class AdsLoadedListener extends PigeonProxyApiBaseClass { /// Interface for classes that will listen to AdErrorEvents. /// /// See https://developers.google.com/interactive-media-ads/docs/sdks/android/client-side/api/reference/com/google/ads/interactivemedia/v3/api/AdErrorEvent.AdErrorListener.html. -class AdErrorListener extends PigeonProxyApiBaseClass { +class AdErrorListener extends PigeonInternalProxyApiBaseClass { AdErrorListener({ super.pigeon_binaryMessenger, super.pigeon_instanceManager, required this.onAdError, }) { - final int __pigeon_instanceIdentifier = + final int pigeonVar_instanceIdentifier = pigeon_instanceManager.addDartCreatedInstance(this); - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - __pigeon_codecAdErrorListener; - final BinaryMessenger? __pigeon_binaryMessenger = pigeon_binaryMessenger; + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecAdErrorListener; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; () async { - const String __pigeon_channelName = + const String pigeonVar_channelName = 'dev.flutter.pigeon.interactive_media_ads.AdErrorListener.pigeon_defaultConstructor'; - final BasicMessageChannel __pigeon_channel = + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([__pigeon_instanceIdentifier]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = await pigeonVar_channel + .send([pigeonVar_instanceIdentifier]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -4549,8 +4814,8 @@ class AdErrorListener extends PigeonProxyApiBaseClass { required this.onAdError, }); - late final _PigeonProxyApiBaseCodec __pigeon_codecAdErrorListener = - _PigeonProxyApiBaseCodec(pigeon_instanceManager); + late final _PigeonInternalProxyApiBaseCodec _pigeonVar_codecAdErrorListener = + _PigeonInternalProxyApiBaseCodec(pigeon_instanceManager); /// Called when an error occurs. /// @@ -4585,20 +4850,21 @@ class AdErrorListener extends PigeonProxyApiBaseClass { AdErrorEvent event, )? onAdError, }) { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - _PigeonProxyApiBaseCodec( + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _PigeonInternalProxyApiBaseCodec( pigeon_instanceManager ?? PigeonInstanceManager.instance); final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.interactive_media_ads.AdErrorListener.onAdError', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (pigeon_clearHandlers) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.interactive_media_ads.AdErrorListener.onAdError was null.'); final List args = (message as List?)!; @@ -4637,35 +4903,35 @@ class AdErrorListener extends PigeonProxyApiBaseClass { /// Listener interface for ad events. /// /// See https://developers.google.com/interactive-media-ads/docs/sdks/android/client-side/api/reference/com/google/ads/interactivemedia/v3/api/AdEvent.AdEventListener.html. -class AdEventListener extends PigeonProxyApiBaseClass { +class AdEventListener extends PigeonInternalProxyApiBaseClass { AdEventListener({ super.pigeon_binaryMessenger, super.pigeon_instanceManager, required this.onAdEvent, }) { - final int __pigeon_instanceIdentifier = + final int pigeonVar_instanceIdentifier = pigeon_instanceManager.addDartCreatedInstance(this); - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - __pigeon_codecAdEventListener; - final BinaryMessenger? __pigeon_binaryMessenger = pigeon_binaryMessenger; + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecAdEventListener; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; () async { - const String __pigeon_channelName = + const String pigeonVar_channelName = 'dev.flutter.pigeon.interactive_media_ads.AdEventListener.pigeon_defaultConstructor'; - final BasicMessageChannel __pigeon_channel = + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([__pigeon_instanceIdentifier]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = await pigeonVar_channel + .send([pigeonVar_instanceIdentifier]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -4684,8 +4950,8 @@ class AdEventListener extends PigeonProxyApiBaseClass { required this.onAdEvent, }); - late final _PigeonProxyApiBaseCodec __pigeon_codecAdEventListener = - _PigeonProxyApiBaseCodec(pigeon_instanceManager); + late final _PigeonInternalProxyApiBaseCodec _pigeonVar_codecAdEventListener = + _PigeonInternalProxyApiBaseCodec(pigeon_instanceManager); /// Respond to an occurrence of an AdEvent. /// @@ -4720,20 +4986,21 @@ class AdEventListener extends PigeonProxyApiBaseClass { AdEvent event, )? onAdEvent, }) { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - _PigeonProxyApiBaseCodec( + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _PigeonInternalProxyApiBaseCodec( pigeon_instanceManager ?? PigeonInstanceManager.instance); final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.interactive_media_ads.AdEventListener.onAdEvent', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (pigeon_clearHandlers) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.interactive_media_ads.AdEventListener.onAdEvent was null.'); final List args = (message as List?)!; @@ -4768,3 +5035,1221 @@ class AdEventListener extends PigeonProxyApiBaseClass { ); } } + +/// Defines parameters that control the rendering of ads. +/// +/// See https://developers.google.com/interactive-media-ads/docs/sdks/android/client-side/api/reference/com/google/ads/interactivemedia/v3/api/AdsRenderingSettings.html. +class AdsRenderingSettings extends PigeonInternalProxyApiBaseClass { + /// Constructs [AdsRenderingSettings] without creating the associated native object. + /// + /// This should only be used by subclasses created by this library or to + /// create copies for an [PigeonInstanceManager]. + @protected + AdsRenderingSettings.pigeon_detached({ + super.pigeon_binaryMessenger, + super.pigeon_instanceManager, + }); + + late final _PigeonInternalProxyApiBaseCodec + _pigeonVar_codecAdsRenderingSettings = + _PigeonInternalProxyApiBaseCodec(pigeon_instanceManager); + + static void pigeon_setUpMessageHandlers({ + bool pigeon_clearHandlers = false, + BinaryMessenger? pigeon_binaryMessenger, + PigeonInstanceManager? pigeon_instanceManager, + AdsRenderingSettings Function()? pigeon_newInstance, + }) { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _PigeonInternalProxyApiBaseCodec( + pigeon_instanceManager ?? PigeonInstanceManager.instance); + final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger; + { + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.interactive_media_ads.AdsRenderingSettings.pigeon_newInstance', + pigeonChannelCodec, + binaryMessenger: binaryMessenger); + if (pigeon_clearHandlers) { + pigeonVar_channel.setMessageHandler(null); + } else { + pigeonVar_channel.setMessageHandler((Object? message) async { + assert(message != null, + 'Argument for dev.flutter.pigeon.interactive_media_ads.AdsRenderingSettings.pigeon_newInstance was null.'); + final List args = (message as List?)!; + final int? arg_pigeon_instanceIdentifier = (args[0] as int?); + assert(arg_pigeon_instanceIdentifier != null, + 'Argument for dev.flutter.pigeon.interactive_media_ads.AdsRenderingSettings.pigeon_newInstance was null, expected non-null int.'); + try { + (pigeon_instanceManager ?? PigeonInstanceManager.instance) + .addHostCreatedInstance( + pigeon_newInstance?.call() ?? + AdsRenderingSettings.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + ), + arg_pigeon_instanceIdentifier!, + ); + return wrapResponse(empty: true); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } + }); + } + } + } + + /// Maximum recommended bitrate. + Future getBitrateKbps() async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecAdsRenderingSettings; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.interactive_media_ads.AdsRenderingSettings.getBitrateKbps'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([this]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } else { + return (pigeonVar_replyList[0] as int?)!; + } + } + + /// Returns whether the click-through URL will be opened using Custom Tabs + /// feature. + Future getEnableCustomTabs() async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecAdsRenderingSettings; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.interactive_media_ads.AdsRenderingSettings.getEnableCustomTabs'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([this]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } else { + return (pigeonVar_replyList[0] as bool?)!; + } + } + + /// Whether the SDK will instruct the player to load the creative in response + /// to `BaseManager.init()`. + Future getEnablePreloading() async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecAdsRenderingSettings; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.interactive_media_ads.AdsRenderingSettings.getEnablePreloading'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([this]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } else { + return (pigeonVar_replyList[0] as bool?)!; + } + } + + /// Whether to focus on the skip button when the skippable ad can be skipped + /// on Android TV. + /// + /// This is a no-op on non-Android TV devices. + Future getFocusSkipButtonWhenAvailable() async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecAdsRenderingSettings; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.interactive_media_ads.AdsRenderingSettings.getFocusSkipButtonWhenAvailable'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([this]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } else { + return (pigeonVar_replyList[0] as bool?)!; + } + } + + /// The SDK will prioritize the media with MIME type on the list. + Future> getMimeTypes() async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecAdsRenderingSettings; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.interactive_media_ads.AdsRenderingSettings.getMimeTypes'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([this]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } else { + return (pigeonVar_replyList[0] as List?)!.cast(); + } + } + + /// Maximum recommended bitrate. + /// + /// The value is in kbit/s. Default value, -1, means the bitrate will be + /// selected by the SDK. + Future setBitrateKbps(int bitrate) async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecAdsRenderingSettings; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.interactive_media_ads.AdsRenderingSettings.setBitrateKbps'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = await pigeonVar_channel + .send([this, bitrate]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return; + } + } + + /// Notifies the SDK whether to launch the click-through URL using Custom Tabs + /// feature. + /// + /// Default is false. + Future setEnableCustomTabs(bool enableCustomTabs) async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecAdsRenderingSettings; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.interactive_media_ads.AdsRenderingSettings.setEnableCustomTabs'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = await pigeonVar_channel + .send([this, enableCustomTabs]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return; + } + } + + /// If set, the SDK will instruct the player to load the creative in response + /// to `BaseManager.init()`. + /// + /// This allows the player to preload the ad at any point before calling + /// `AdsManager.start()`. + Future setEnablePreloading(bool enablePreloading) async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecAdsRenderingSettings; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.interactive_media_ads.AdsRenderingSettings.setEnablePreloading'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = await pigeonVar_channel + .send([this, enablePreloading]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return; + } + } + + /// Set whether to focus on the skip button when the skippable ad can be + /// skipped on Android TV. + /// + /// This is a no-op on non-Android TV devices. + /// + /// Default is true. + Future setFocusSkipButtonWhenAvailable( + bool enableFocusSkipButton) async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecAdsRenderingSettings; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.interactive_media_ads.AdsRenderingSettings.setFocusSkipButtonWhenAvailable'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = await pigeonVar_channel + .send([this, enableFocusSkipButton]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return; + } + } + + /// Specifies a non-default amount of time to wait for media to load before + /// timing out, in milliseconds. + /// + /// This only applies to the IMA client-side SDK. + /// + /// Default time is 8000 ms. + Future setLoadVideoTimeout(int loadVideoTimeout) async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecAdsRenderingSettings; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.interactive_media_ads.AdsRenderingSettings.setLoadVideoTimeout'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = await pigeonVar_channel + .send([this, loadVideoTimeout]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return; + } + } + + /// If specified, the SDK will prioritize the media with MIME type on the + /// list. + Future setMimeTypes(List mimeTypes) async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecAdsRenderingSettings; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.interactive_media_ads.AdsRenderingSettings.setMimeTypes'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = await pigeonVar_channel + .send([this, mimeTypes]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return; + } + } + + /// For VMAP and ad rules playlists, only play ad breaks scheduled after this + /// time (in seconds). + Future setPlayAdsAfterTime(double time) async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecAdsRenderingSettings; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.interactive_media_ads.AdsRenderingSettings.setPlayAdsAfterTime'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([this, time]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return; + } + } + + /// Sets the ad UI elements to be rendered by the IMA SDK. + Future setUiElements(List uiElements) async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecAdsRenderingSettings; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.interactive_media_ads.AdsRenderingSettings.setUiElements'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = await pigeonVar_channel + .send([this, uiElements]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return; + } + } + + @override + AdsRenderingSettings pigeon_copy() { + return AdsRenderingSettings.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + ); + } +} + +/// Represents the progress within this ad break. +/// +/// See https://developers.google.com/interactive-media-ads/docs/sdks/android/client-side/api/reference/com/google/ads/interactivemedia/v3/api/AdProgressInfo.html. +class AdProgressInfo extends PigeonInternalProxyApiBaseClass { + /// Constructs [AdProgressInfo] without creating the associated native object. + /// + /// This should only be used by subclasses created by this library or to + /// create copies for an [PigeonInstanceManager]. + @protected + AdProgressInfo.pigeon_detached({ + super.pigeon_binaryMessenger, + super.pigeon_instanceManager, + required this.adBreakDuration, + required this.adPeriodDuration, + required this.adPosition, + required this.currentTime, + required this.duration, + required this.totalAds, + }); + + /// Total ad break duration (in seconds). + final double adBreakDuration; + + /// Total ad period duration (in seconds). + final double adPeriodDuration; + + /// The position of current ad within the ad break, starting with 1. + final int adPosition; + + /// Current time within the ad (in seconds). + final double currentTime; + + /// Duration of current ad (in seconds). + final double duration; + + /// The total number of ads in this ad break. + final int totalAds; + + static void pigeon_setUpMessageHandlers({ + bool pigeon_clearHandlers = false, + BinaryMessenger? pigeon_binaryMessenger, + PigeonInstanceManager? pigeon_instanceManager, + AdProgressInfo Function( + double adBreakDuration, + double adPeriodDuration, + int adPosition, + double currentTime, + double duration, + int totalAds, + )? pigeon_newInstance, + }) { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _PigeonInternalProxyApiBaseCodec( + pigeon_instanceManager ?? PigeonInstanceManager.instance); + final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger; + { + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.interactive_media_ads.AdProgressInfo.pigeon_newInstance', + pigeonChannelCodec, + binaryMessenger: binaryMessenger); + if (pigeon_clearHandlers) { + pigeonVar_channel.setMessageHandler(null); + } else { + pigeonVar_channel.setMessageHandler((Object? message) async { + assert(message != null, + 'Argument for dev.flutter.pigeon.interactive_media_ads.AdProgressInfo.pigeon_newInstance was null.'); + final List args = (message as List?)!; + final int? arg_pigeon_instanceIdentifier = (args[0] as int?); + assert(arg_pigeon_instanceIdentifier != null, + 'Argument for dev.flutter.pigeon.interactive_media_ads.AdProgressInfo.pigeon_newInstance was null, expected non-null int.'); + final double? arg_adBreakDuration = (args[1] as double?); + assert(arg_adBreakDuration != null, + 'Argument for dev.flutter.pigeon.interactive_media_ads.AdProgressInfo.pigeon_newInstance was null, expected non-null double.'); + final double? arg_adPeriodDuration = (args[2] as double?); + assert(arg_adPeriodDuration != null, + 'Argument for dev.flutter.pigeon.interactive_media_ads.AdProgressInfo.pigeon_newInstance was null, expected non-null double.'); + final int? arg_adPosition = (args[3] as int?); + assert(arg_adPosition != null, + 'Argument for dev.flutter.pigeon.interactive_media_ads.AdProgressInfo.pigeon_newInstance was null, expected non-null int.'); + final double? arg_currentTime = (args[4] as double?); + assert(arg_currentTime != null, + 'Argument for dev.flutter.pigeon.interactive_media_ads.AdProgressInfo.pigeon_newInstance was null, expected non-null double.'); + final double? arg_duration = (args[5] as double?); + assert(arg_duration != null, + 'Argument for dev.flutter.pigeon.interactive_media_ads.AdProgressInfo.pigeon_newInstance was null, expected non-null double.'); + final int? arg_totalAds = (args[6] as int?); + assert(arg_totalAds != null, + 'Argument for dev.flutter.pigeon.interactive_media_ads.AdProgressInfo.pigeon_newInstance was null, expected non-null int.'); + try { + (pigeon_instanceManager ?? PigeonInstanceManager.instance) + .addHostCreatedInstance( + pigeon_newInstance?.call( + arg_adBreakDuration!, + arg_adPeriodDuration!, + arg_adPosition!, + arg_currentTime!, + arg_duration!, + arg_totalAds!) ?? + AdProgressInfo.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + adBreakDuration: arg_adBreakDuration!, + adPeriodDuration: arg_adPeriodDuration!, + adPosition: arg_adPosition!, + currentTime: arg_currentTime!, + duration: arg_duration!, + totalAds: arg_totalAds!, + ), + arg_pigeon_instanceIdentifier!, + ); + return wrapResponse(empty: true); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } + }); + } + } + } + + @override + AdProgressInfo pigeon_copy() { + return AdProgressInfo.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + adBreakDuration: adBreakDuration, + adPeriodDuration: adPeriodDuration, + adPosition: adPosition, + currentTime: currentTime, + duration: duration, + totalAds: totalAds, + ); + } +} + +/// An object that holds data corresponding to the companion Ad. +/// +/// See https://developers.google.com/interactive-media-ads/docs/sdks/android/client-side/api/reference/com/google/ads/interactivemedia/v3/api/CompanionAd.html. +class CompanionAd extends PigeonInternalProxyApiBaseClass { + /// Constructs [CompanionAd] without creating the associated native object. + /// + /// This should only be used by subclasses created by this library or to + /// create copies for an [PigeonInstanceManager]. + @protected + CompanionAd.pigeon_detached({ + super.pigeon_binaryMessenger, + super.pigeon_instanceManager, + this.apiFramework, + required this.height, + required this.resourceValue, + required this.width, + }); + + /// The API needed to execute this ad, or null if unavailable. + final String? apiFramework; + + /// The height of the companion in pixels. + /// + /// 0 if unavailable. + final int height; + + /// The URL for the static resource of this companion. + final String resourceValue; + + /// The width of the companion in pixels. + /// + /// 0 if unavailable. + final int width; + + static void pigeon_setUpMessageHandlers({ + bool pigeon_clearHandlers = false, + BinaryMessenger? pigeon_binaryMessenger, + PigeonInstanceManager? pigeon_instanceManager, + CompanionAd Function( + String? apiFramework, + int height, + String resourceValue, + int width, + )? pigeon_newInstance, + }) { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _PigeonInternalProxyApiBaseCodec( + pigeon_instanceManager ?? PigeonInstanceManager.instance); + final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger; + { + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.interactive_media_ads.CompanionAd.pigeon_newInstance', + pigeonChannelCodec, + binaryMessenger: binaryMessenger); + if (pigeon_clearHandlers) { + pigeonVar_channel.setMessageHandler(null); + } else { + pigeonVar_channel.setMessageHandler((Object? message) async { + assert(message != null, + 'Argument for dev.flutter.pigeon.interactive_media_ads.CompanionAd.pigeon_newInstance was null.'); + final List args = (message as List?)!; + final int? arg_pigeon_instanceIdentifier = (args[0] as int?); + assert(arg_pigeon_instanceIdentifier != null, + 'Argument for dev.flutter.pigeon.interactive_media_ads.CompanionAd.pigeon_newInstance was null, expected non-null int.'); + final String? arg_apiFramework = (args[1] as String?); + final int? arg_height = (args[2] as int?); + assert(arg_height != null, + 'Argument for dev.flutter.pigeon.interactive_media_ads.CompanionAd.pigeon_newInstance was null, expected non-null int.'); + final String? arg_resourceValue = (args[3] as String?); + assert(arg_resourceValue != null, + 'Argument for dev.flutter.pigeon.interactive_media_ads.CompanionAd.pigeon_newInstance was null, expected non-null String.'); + final int? arg_width = (args[4] as int?); + assert(arg_width != null, + 'Argument for dev.flutter.pigeon.interactive_media_ads.CompanionAd.pigeon_newInstance was null, expected non-null int.'); + try { + (pigeon_instanceManager ?? PigeonInstanceManager.instance) + .addHostCreatedInstance( + pigeon_newInstance?.call(arg_apiFramework, arg_height!, + arg_resourceValue!, arg_width!) ?? + CompanionAd.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + apiFramework: arg_apiFramework, + height: arg_height!, + resourceValue: arg_resourceValue!, + width: arg_width!, + ), + arg_pigeon_instanceIdentifier!, + ); + return wrapResponse(empty: true); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } + }); + } + } + } + + @override + CompanionAd pigeon_copy() { + return CompanionAd.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + apiFramework: apiFramework, + height: height, + resourceValue: resourceValue, + width: width, + ); + } +} + +/// This object exposes information about the universal ad ID. +/// +/// See https://developers.google.com/interactive-media-ads/docs/sdks/android/client-side/api/reference/com/google/ads/interactivemedia/v3/api/UniversalAdId.html. +class UniversalAdId extends PigeonInternalProxyApiBaseClass { + /// Constructs [UniversalAdId] without creating the associated native object. + /// + /// This should only be used by subclasses created by this library or to + /// create copies for an [PigeonInstanceManager]. + @protected + UniversalAdId.pigeon_detached({ + super.pigeon_binaryMessenger, + super.pigeon_instanceManager, + required this.adIdRegistry, + required this.adIdValue, + }); + + /// Returns the ad ID registry associated with the ad ID value. + /// + /// Returns "unknown" if the registry is not known. + final String adIdRegistry; + + /// Returns the universal ad ID value. + /// + /// Returns "unknown" if the value is not known. + final String adIdValue; + + static void pigeon_setUpMessageHandlers({ + bool pigeon_clearHandlers = false, + BinaryMessenger? pigeon_binaryMessenger, + PigeonInstanceManager? pigeon_instanceManager, + UniversalAdId Function( + String adIdRegistry, + String adIdValue, + )? pigeon_newInstance, + }) { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _PigeonInternalProxyApiBaseCodec( + pigeon_instanceManager ?? PigeonInstanceManager.instance); + final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger; + { + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.interactive_media_ads.UniversalAdId.pigeon_newInstance', + pigeonChannelCodec, + binaryMessenger: binaryMessenger); + if (pigeon_clearHandlers) { + pigeonVar_channel.setMessageHandler(null); + } else { + pigeonVar_channel.setMessageHandler((Object? message) async { + assert(message != null, + 'Argument for dev.flutter.pigeon.interactive_media_ads.UniversalAdId.pigeon_newInstance was null.'); + final List args = (message as List?)!; + final int? arg_pigeon_instanceIdentifier = (args[0] as int?); + assert(arg_pigeon_instanceIdentifier != null, + 'Argument for dev.flutter.pigeon.interactive_media_ads.UniversalAdId.pigeon_newInstance was null, expected non-null int.'); + final String? arg_adIdRegistry = (args[1] as String?); + assert(arg_adIdRegistry != null, + 'Argument for dev.flutter.pigeon.interactive_media_ads.UniversalAdId.pigeon_newInstance was null, expected non-null String.'); + final String? arg_adIdValue = (args[2] as String?); + assert(arg_adIdValue != null, + 'Argument for dev.flutter.pigeon.interactive_media_ads.UniversalAdId.pigeon_newInstance was null, expected non-null String.'); + try { + (pigeon_instanceManager ?? PigeonInstanceManager.instance) + .addHostCreatedInstance( + pigeon_newInstance?.call(arg_adIdRegistry!, arg_adIdValue!) ?? + UniversalAdId.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + adIdRegistry: arg_adIdRegistry!, + adIdValue: arg_adIdValue!, + ), + arg_pigeon_instanceIdentifier!, + ); + return wrapResponse(empty: true); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } + }); + } + } + } + + @override + UniversalAdId pigeon_copy() { + return UniversalAdId.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + adIdRegistry: adIdRegistry, + adIdValue: adIdValue, + ); + } +} + +/// An object that holds data corresponding to the main Ad. +/// +/// See https://developers.google.com/interactive-media-ads/docs/sdks/android/client-side/api/reference/com/google/ads/interactivemedia/v3/api/Ad.html. +class Ad extends PigeonInternalProxyApiBaseClass { + /// Constructs [Ad] without creating the associated native object. + /// + /// This should only be used by subclasses created by this library or to + /// create copies for an [PigeonInstanceManager]. + @protected + Ad.pigeon_detached({ + super.pigeon_binaryMessenger, + super.pigeon_instanceManager, + required this.adId, + required this.adPodInfo, + required this.adSystem, + required this.adWrapperCreativeIds, + required this.adWrapperIds, + required this.adWrapperSystems, + required this.advertiserName, + required this.companionAds, + this.contentType, + required this.creativeAdId, + required this.creativeId, + required this.dealId, + this.description, + required this.duration, + required this.height, + required this.skipTimeOffset, + this.surveyUrl, + this.title, + required this.traffickingParameters, + required this.uiElements, + required this.universalAdIds, + required this.vastMediaBitrate, + required this.vastMediaHeight, + required this.vastMediaWidth, + required this.width, + required this.isLinear, + required this.isSkippable, + }); + + /// The ad ID as specified in the VAST response. + final String adId; + + /// The pod metadata object. + final AdPodInfo adPodInfo; + + /// The ad system as specified in the VAST response. + final String adSystem; + + /// The IDs of the ads' creatives, starting with the first wrapper ad. + final List adWrapperCreativeIds; + + /// The wrapper ad IDs as specified in the VAST response. + final List adWrapperIds; + + /// The wrapper ad systems as specified in the VAST response. + final List adWrapperSystems; + + /// The advertiser name as defined by the serving party. + final String advertiserName; + + /// The companions for the current ad while using DAI. + /// + /// Returns an empty list in any other scenario. + final List companionAds; + + /// The content type of the currently selected creative, or null if no + /// creative is selected or the content type is unavailable. + final String? contentType; + + /// The ISCI (Industry Standard Commercial Identifier) code for an ad. + final String creativeAdId; + + /// The ID of the selected creative for the ad, + final String creativeId; + + /// The first deal ID present in the wrapper chain for the current ad, + /// starting from the top. + final String dealId; + + /// The description of this ad from the VAST response. + final String? description; + + /// The duration of the ad in seconds, -1 if not available. + final double duration; + + /// The height of the selected creative if non-linear, else returns 0. + final int height; + + /// The number of seconds of playback before the ad becomes skippable. + final double skipTimeOffset; + + /// The URL associated with the survey for the given ad. + final String? surveyUrl; + + /// The title of this ad from the VAST response. + final String? title; + + /// The custom parameters associated with the ad at the time of ad + /// trafficking. + final String traffickingParameters; + + /// Te set of ad UI elements rendered by the IMA SDK for this ad. + final List uiElements; + + /// The list of all universal ad IDs for this ad. + final List universalAdIds; + + /// The VAST bitrate in Kbps of the selected creative. + final int vastMediaBitrate; + + /// The VAST media height in pixels of the selected creative. + final int vastMediaHeight; + + /// The VAST media width in pixels of the selected creative. + final int vastMediaWidth; + + /// The width of the selected creative if non-linear, else returns 0. + final int width; + + /// Indicates whether the ad’s current mode of operation is linear or + /// non-linear. + final bool isLinear; + + /// Indicates whether the ad can be skipped by the user. + final bool isSkippable; + + static void pigeon_setUpMessageHandlers({ + bool pigeon_clearHandlers = false, + BinaryMessenger? pigeon_binaryMessenger, + PigeonInstanceManager? pigeon_instanceManager, + Ad Function( + String adId, + AdPodInfo adPodInfo, + String adSystem, + List adWrapperCreativeIds, + List adWrapperIds, + List adWrapperSystems, + String advertiserName, + List companionAds, + String? contentType, + String creativeAdId, + String creativeId, + String dealId, + String? description, + double duration, + int height, + double skipTimeOffset, + String? surveyUrl, + String? title, + String traffickingParameters, + List uiElements, + List universalAdIds, + int vastMediaBitrate, + int vastMediaHeight, + int vastMediaWidth, + int width, + bool isLinear, + bool isSkippable, + )? pigeon_newInstance, + }) { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _PigeonInternalProxyApiBaseCodec( + pigeon_instanceManager ?? PigeonInstanceManager.instance); + final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger; + { + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + 'dev.flutter.pigeon.interactive_media_ads.Ad.pigeon_newInstance', + pigeonChannelCodec, + binaryMessenger: binaryMessenger); + if (pigeon_clearHandlers) { + pigeonVar_channel.setMessageHandler(null); + } else { + pigeonVar_channel.setMessageHandler((Object? message) async { + assert(message != null, + 'Argument for dev.flutter.pigeon.interactive_media_ads.Ad.pigeon_newInstance was null.'); + final List args = (message as List?)!; + final int? arg_pigeon_instanceIdentifier = (args[0] as int?); + assert(arg_pigeon_instanceIdentifier != null, + 'Argument for dev.flutter.pigeon.interactive_media_ads.Ad.pigeon_newInstance was null, expected non-null int.'); + final String? arg_adId = (args[1] as String?); + assert(arg_adId != null, + 'Argument for dev.flutter.pigeon.interactive_media_ads.Ad.pigeon_newInstance was null, expected non-null String.'); + final AdPodInfo? arg_adPodInfo = (args[2] as AdPodInfo?); + assert(arg_adPodInfo != null, + 'Argument for dev.flutter.pigeon.interactive_media_ads.Ad.pigeon_newInstance was null, expected non-null AdPodInfo.'); + final String? arg_adSystem = (args[3] as String?); + assert(arg_adSystem != null, + 'Argument for dev.flutter.pigeon.interactive_media_ads.Ad.pigeon_newInstance was null, expected non-null String.'); + final List? arg_adWrapperCreativeIds = + (args[4] as List?)?.cast(); + assert(arg_adWrapperCreativeIds != null, + 'Argument for dev.flutter.pigeon.interactive_media_ads.Ad.pigeon_newInstance was null, expected non-null List.'); + final List? arg_adWrapperIds = + (args[5] as List?)?.cast(); + assert(arg_adWrapperIds != null, + 'Argument for dev.flutter.pigeon.interactive_media_ads.Ad.pigeon_newInstance was null, expected non-null List.'); + final List? arg_adWrapperSystems = + (args[6] as List?)?.cast(); + assert(arg_adWrapperSystems != null, + 'Argument for dev.flutter.pigeon.interactive_media_ads.Ad.pigeon_newInstance was null, expected non-null List.'); + final String? arg_advertiserName = (args[7] as String?); + assert(arg_advertiserName != null, + 'Argument for dev.flutter.pigeon.interactive_media_ads.Ad.pigeon_newInstance was null, expected non-null String.'); + final List? arg_companionAds = + (args[8] as List?)?.cast(); + assert(arg_companionAds != null, + 'Argument for dev.flutter.pigeon.interactive_media_ads.Ad.pigeon_newInstance was null, expected non-null List.'); + final String? arg_contentType = (args[9] as String?); + final String? arg_creativeAdId = (args[10] as String?); + assert(arg_creativeAdId != null, + 'Argument for dev.flutter.pigeon.interactive_media_ads.Ad.pigeon_newInstance was null, expected non-null String.'); + final String? arg_creativeId = (args[11] as String?); + assert(arg_creativeId != null, + 'Argument for dev.flutter.pigeon.interactive_media_ads.Ad.pigeon_newInstance was null, expected non-null String.'); + final String? arg_dealId = (args[12] as String?); + assert(arg_dealId != null, + 'Argument for dev.flutter.pigeon.interactive_media_ads.Ad.pigeon_newInstance was null, expected non-null String.'); + final String? arg_description = (args[13] as String?); + final double? arg_duration = (args[14] as double?); + assert(arg_duration != null, + 'Argument for dev.flutter.pigeon.interactive_media_ads.Ad.pigeon_newInstance was null, expected non-null double.'); + final int? arg_height = (args[15] as int?); + assert(arg_height != null, + 'Argument for dev.flutter.pigeon.interactive_media_ads.Ad.pigeon_newInstance was null, expected non-null int.'); + final double? arg_skipTimeOffset = (args[16] as double?); + assert(arg_skipTimeOffset != null, + 'Argument for dev.flutter.pigeon.interactive_media_ads.Ad.pigeon_newInstance was null, expected non-null double.'); + final String? arg_surveyUrl = (args[17] as String?); + final String? arg_title = (args[18] as String?); + final String? arg_traffickingParameters = (args[19] as String?); + assert(arg_traffickingParameters != null, + 'Argument for dev.flutter.pigeon.interactive_media_ads.Ad.pigeon_newInstance was null, expected non-null String.'); + final List? arg_uiElements = + (args[20] as List?)?.cast(); + assert(arg_uiElements != null, + 'Argument for dev.flutter.pigeon.interactive_media_ads.Ad.pigeon_newInstance was null, expected non-null List.'); + final List? arg_universalAdIds = + (args[21] as List?)?.cast(); + assert(arg_universalAdIds != null, + 'Argument for dev.flutter.pigeon.interactive_media_ads.Ad.pigeon_newInstance was null, expected non-null List.'); + final int? arg_vastMediaBitrate = (args[22] as int?); + assert(arg_vastMediaBitrate != null, + 'Argument for dev.flutter.pigeon.interactive_media_ads.Ad.pigeon_newInstance was null, expected non-null int.'); + final int? arg_vastMediaHeight = (args[23] as int?); + assert(arg_vastMediaHeight != null, + 'Argument for dev.flutter.pigeon.interactive_media_ads.Ad.pigeon_newInstance was null, expected non-null int.'); + final int? arg_vastMediaWidth = (args[24] as int?); + assert(arg_vastMediaWidth != null, + 'Argument for dev.flutter.pigeon.interactive_media_ads.Ad.pigeon_newInstance was null, expected non-null int.'); + final int? arg_width = (args[25] as int?); + assert(arg_width != null, + 'Argument for dev.flutter.pigeon.interactive_media_ads.Ad.pigeon_newInstance was null, expected non-null int.'); + final bool? arg_isLinear = (args[26] as bool?); + assert(arg_isLinear != null, + 'Argument for dev.flutter.pigeon.interactive_media_ads.Ad.pigeon_newInstance was null, expected non-null bool.'); + final bool? arg_isSkippable = (args[27] as bool?); + assert(arg_isSkippable != null, + 'Argument for dev.flutter.pigeon.interactive_media_ads.Ad.pigeon_newInstance was null, expected non-null bool.'); + try { + (pigeon_instanceManager ?? PigeonInstanceManager.instance) + .addHostCreatedInstance( + pigeon_newInstance?.call( + arg_adId!, + arg_adPodInfo!, + arg_adSystem!, + arg_adWrapperCreativeIds!, + arg_adWrapperIds!, + arg_adWrapperSystems!, + arg_advertiserName!, + arg_companionAds!, + arg_contentType, + arg_creativeAdId!, + arg_creativeId!, + arg_dealId!, + arg_description, + arg_duration!, + arg_height!, + arg_skipTimeOffset!, + arg_surveyUrl, + arg_title, + arg_traffickingParameters!, + arg_uiElements!, + arg_universalAdIds!, + arg_vastMediaBitrate!, + arg_vastMediaHeight!, + arg_vastMediaWidth!, + arg_width!, + arg_isLinear!, + arg_isSkippable!) ?? + Ad.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + adId: arg_adId!, + adPodInfo: arg_adPodInfo!, + adSystem: arg_adSystem!, + adWrapperCreativeIds: arg_adWrapperCreativeIds!, + adWrapperIds: arg_adWrapperIds!, + adWrapperSystems: arg_adWrapperSystems!, + advertiserName: arg_advertiserName!, + companionAds: arg_companionAds!, + contentType: arg_contentType, + creativeAdId: arg_creativeAdId!, + creativeId: arg_creativeId!, + dealId: arg_dealId!, + description: arg_description, + duration: arg_duration!, + height: arg_height!, + skipTimeOffset: arg_skipTimeOffset!, + surveyUrl: arg_surveyUrl, + title: arg_title, + traffickingParameters: arg_traffickingParameters!, + uiElements: arg_uiElements!, + universalAdIds: arg_universalAdIds!, + vastMediaBitrate: arg_vastMediaBitrate!, + vastMediaHeight: arg_vastMediaHeight!, + vastMediaWidth: arg_vastMediaWidth!, + width: arg_width!, + isLinear: arg_isLinear!, + isSkippable: arg_isSkippable!, + ), + arg_pigeon_instanceIdentifier!, + ); + return wrapResponse(empty: true); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } + }); + } + } + } + + @override + Ad pigeon_copy() { + return Ad.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + adId: adId, + adPodInfo: adPodInfo, + adSystem: adSystem, + adWrapperCreativeIds: adWrapperCreativeIds, + adWrapperIds: adWrapperIds, + adWrapperSystems: adWrapperSystems, + advertiserName: advertiserName, + companionAds: companionAds, + contentType: contentType, + creativeAdId: creativeAdId, + creativeId: creativeId, + dealId: dealId, + description: description, + duration: duration, + height: height, + skipTimeOffset: skipTimeOffset, + surveyUrl: surveyUrl, + title: title, + traffickingParameters: traffickingParameters, + uiElements: uiElements, + universalAdIds: universalAdIds, + vastMediaBitrate: vastMediaBitrate, + vastMediaHeight: vastMediaHeight, + vastMediaWidth: vastMediaWidth, + width: width, + isLinear: isLinear, + isSkippable: isSkippable, + ); + } +} diff --git a/packages/interactive_media_ads/lib/src/android/interactive_media_ads_proxy.dart b/packages/interactive_media_ads/lib/src/android/interactive_media_ads_proxy.dart index eff593541369..7aa120654e84 100644 --- a/packages/interactive_media_ads/lib/src/android/interactive_media_ads_proxy.dart +++ b/packages/interactive_media_ads/lib/src/android/interactive_media_ads_proxy.dart @@ -16,6 +16,7 @@ import 'interactive_media_ads.g.dart'; class InteractiveMediaAdsProxy { /// Constructs an [InteractiveMediaAdsProxy]. const InteractiveMediaAdsProxy({ + this.newContentProgressProvider = ContentProgressProvider.new, this.newVideoProgressUpdate = VideoProgressUpdate.new, this.newFrameLayout = FrameLayout.new, this.newVideoView = VideoView.new, @@ -30,6 +31,9 @@ class InteractiveMediaAdsProxy { _videoTimeNotReadyVideoProgressUpdate, }); + /// Constructs [ContentProgressProvider]. + final ContentProgressProvider Function() newContentProgressProvider; + /// Constructs [VideoProgressUpdate]. final VideoProgressUpdate Function({ required int currentTimeMs, diff --git a/packages/interactive_media_ads/lib/src/content_progress_provider.dart b/packages/interactive_media_ads/lib/src/content_progress_provider.dart new file mode 100644 index 000000000000..0b0f0e6df8b5 --- /dev/null +++ b/packages/interactive_media_ads/lib/src/content_progress_provider.dart @@ -0,0 +1,92 @@ +// 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 'platform_interface/platform_interface.dart'; + +/// Allow the SDK to track progress of the content video. +/// +/// Provides updates required to enable triggering ads at configured cue points. +/// +/// ## Platform-Specific Features +/// This class contains an underlying implementation provided by the current +/// platform. Once a platform implementation is imported, the examples below +/// can be followed to use features provided by a platform's implementation. +/// +/// {@macro interactive_media_ads.ContentProgressProvider.fromPlatformCreationParams} +/// +/// Below is an example of accessing the platform-specific implementation for +/// iOS and Android: +/// +/// ```dart +/// final ContentProgressProvider provider = ContentProgressProvider(); +/// +/// if (InteractiveMediaAdsPlatform.instance is IOSInteractiveMediaAdsPlatform) { +/// final IOSContentProgressProvider iosProvider = +/// provider.platform as IOSContentProgressProvider; +/// } else if (InteractiveMediaAdsPlatform.instance is AndroidInteractiveMediaAdsPlatform) { +/// final AndroidContentProgressProvider androidProvider = +/// provider.platform as AndroidContentProgressProvider; +/// } +/// ``` +class ContentProgressProvider { + /// Constructs an [ContentProgressProvider]. + /// + /// See [ContentProgressProvider.fromPlatformCreationParams] for setting + /// parameters for a specific platform. + ContentProgressProvider() + : this.fromPlatformCreationParams( + const PlatformContentProgressProviderCreationParams(), + ); + + /// Constructs an [ContentProgressProvider] from creation params for a + /// specific platform. + /// + /// {@template interactive_media_ads.ContentProgressProvider.fromPlatformCreationParams} + /// Below is an example of setting platform-specific creation parameters for + /// iOS and Android: + /// + /// ```dart + /// PlatformContentProgressProviderCreationParams params = + /// const PlatformContentProgressProviderCreationParams(); + /// + /// if (InteractiveMediaAdsPlatform.instance is IOSInteractiveMediaAdsPlatform) { + /// params = IOSContentProgressProviderCreationParams + /// .fromPlatformContentProgressProviderCreationParams( + /// params, + /// ); + /// } else if (InteractiveMediaAdsPlatform.instance is AndroidInteractiveMediaAdsPlatform) { + /// params = AndroidContentProgressProviderCreationParams + /// .fromPlatformContentProgressProviderCreationParams( + /// params, + /// ); + /// } + /// + /// final ContentProgressProvider provider = ContentProgressProvider.fromPlatformCreationParams( + /// params, + /// ); + /// ``` + /// {@endtemplate} + ContentProgressProvider.fromPlatformCreationParams( + PlatformContentProgressProviderCreationParams params, + ) : this.fromPlatform(PlatformContentProgressProvider(params)); + + /// Constructs a [ContentProgressProvider] from a specific platform + /// implementation. + ContentProgressProvider.fromPlatform(this.platform); + + /// Implementation of [PlatformContentProgressProvider] for the current + /// platform. + final PlatformContentProgressProvider platform; + + /// Sends an update on the progress of the content video. + /// + /// When using a `Timer` to periodically send updates through this method, an + /// interval of 200ms is recommended. + Future setProgress({ + required Duration progress, + required Duration duration, + }) { + return platform.setProgress(progress: progress, duration: duration); + } +} diff --git a/packages/interactive_media_ads/lib/src/ios/interactive_media_ads.g.dart b/packages/interactive_media_ads/lib/src/ios/interactive_media_ads.g.dart index 32368a1ddf4f..b3ac07482862 100644 --- a/packages/interactive_media_ads/lib/src/ios/interactive_media_ads.g.dart +++ b/packages/interactive_media_ads/lib/src/ios/interactive_media_ads.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 (v21.2.0), do not edit directly. +// Autogenerated from Pigeon (v22.5.0), 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, no_leading_underscores_for_local_identifiers @@ -37,9 +37,9 @@ List wrapResponse( /// All implementers are expected to be [immutable] as defined by the annotation /// and override [pigeon_copy] returning an instance of itself. @immutable -abstract class PigeonProxyApiBaseClass { - /// Construct a [PigeonProxyApiBaseClass]. - PigeonProxyApiBaseClass({ +abstract class PigeonInternalProxyApiBaseClass { + /// Construct a [PigeonInternalProxyApiBaseClass]. + PigeonInternalProxyApiBaseClass({ this.pigeon_binaryMessenger, PigeonInstanceManager? pigeon_instanceManager, }) : pigeon_instanceManager = @@ -64,7 +64,7 @@ abstract class PigeonProxyApiBaseClass { /// Subclasses should always override their parent's implementation of this /// method. @protected - PigeonProxyApiBaseClass pigeon_copy(); + PigeonInternalProxyApiBaseClass pigeon_copy(); } /// Maintains instances used to communicate with the native objects they @@ -114,10 +114,10 @@ class PigeonInstanceManager { // by calling instanceManager.getIdentifier() inside of `==` while this was a // HashMap). final Expando _identifiers = Expando(); - final Map> _weakInstances = - >{}; - final Map _strongInstances = - {}; + final Map> + _weakInstances = >{}; + final Map _strongInstances = + {}; late final Finalizer _finalizer; int _nextIdentifier = 0; @@ -127,7 +127,8 @@ class PigeonInstanceManager { static PigeonInstanceManager _initInstance() { WidgetsFlutterBinding.ensureInitialized(); - final _PigeonInstanceManagerApi api = _PigeonInstanceManagerApi(); + final _PigeonInternalInstanceManagerApi api = + _PigeonInternalInstanceManagerApi(); // Clears the native `PigeonInstanceManager` on the initial use of the Dart one. api.clear(); final PigeonInstanceManager instanceManager = PigeonInstanceManager( @@ -135,7 +136,7 @@ class PigeonInstanceManager { api.removeStrongReference(identifier); }, ); - _PigeonInstanceManagerApi.setUpMessageHandlers( + _PigeonInternalInstanceManagerApi.setUpMessageHandlers( instanceManager: instanceManager); IMAAdDisplayContainer.pigeon_setUpMessageHandlers( pigeon_instanceManager: instanceManager); @@ -168,6 +169,10 @@ class PigeonInstanceManager { pigeon_instanceManager: instanceManager); NSObject.pigeon_setUpMessageHandlers( pigeon_instanceManager: instanceManager); + IMAFriendlyObstruction.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + IMACompanionAd.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); return instanceManager; } @@ -179,7 +184,7 @@ class PigeonInstanceManager { /// Throws assertion error if the instance has already been added. /// /// Returns the randomly generated id of the [instance] added. - int addDartCreatedInstance(PigeonProxyApiBaseClass instance) { + int addDartCreatedInstance(PigeonInternalProxyApiBaseClass instance) { final int identifier = _nextUniqueIdentifier(); _addInstanceWithIdentifier(instance, identifier); return identifier; @@ -193,7 +198,7 @@ class PigeonInstanceManager { /// /// This does not remove the strong referenced instance associated with /// [instance]. This can be done with [remove]. - int? removeWeakReference(PigeonProxyApiBaseClass instance) { + int? removeWeakReference(PigeonInternalProxyApiBaseClass instance) { final int? identifier = getIdentifier(instance); if (identifier == null) { return null; @@ -215,7 +220,7 @@ class PigeonInstanceManager { /// /// This does not remove the weak referenced instance associated with /// [identifier]. This can be done with [removeWeakReference]. - T? remove(int identifier) { + T? remove(int identifier) { return _strongInstances.remove(identifier) as T?; } @@ -231,19 +236,20 @@ class PigeonInstanceManager { /// /// This method also expects the host `InstanceManager` to have a strong /// reference to the instance the identifier is associated with. - T? getInstanceWithWeakReference( + T? getInstanceWithWeakReference( int identifier) { - final PigeonProxyApiBaseClass? weakInstance = + final PigeonInternalProxyApiBaseClass? weakInstance = _weakInstances[identifier]?.target; if (weakInstance == null) { - final PigeonProxyApiBaseClass? strongInstance = + final PigeonInternalProxyApiBaseClass? strongInstance = _strongInstances[identifier]; if (strongInstance != null) { - final PigeonProxyApiBaseClass copy = strongInstance.pigeon_copy(); + final PigeonInternalProxyApiBaseClass copy = + strongInstance.pigeon_copy(); _identifiers[copy] = identifier; _weakInstances[identifier] = - WeakReference(copy); + WeakReference(copy); _finalizer.attach(copy, identifier, detach: copy); return copy as T; } @@ -254,7 +260,7 @@ class PigeonInstanceManager { } /// Retrieves the identifier associated with instance. - int? getIdentifier(PigeonProxyApiBaseClass instance) { + int? getIdentifier(PigeonInternalProxyApiBaseClass instance) { return _identifiers[instance]; } @@ -268,22 +274,22 @@ class PigeonInstanceManager { /// /// Returns unique identifier of the [instance] added. void addHostCreatedInstance( - PigeonProxyApiBaseClass instance, int identifier) { + PigeonInternalProxyApiBaseClass instance, int identifier) { _addInstanceWithIdentifier(instance, identifier); } void _addInstanceWithIdentifier( - PigeonProxyApiBaseClass instance, int identifier) { + PigeonInternalProxyApiBaseClass instance, int identifier) { assert(!containsIdentifier(identifier)); assert(getIdentifier(instance) == null); assert(identifier >= 0); _identifiers[instance] = identifier; _weakInstances[identifier] = - WeakReference(instance); + WeakReference(instance); _finalizer.attach(instance, identifier, detach: instance); - final PigeonProxyApiBaseClass copy = instance.pigeon_copy(); + final PigeonInternalProxyApiBaseClass copy = instance.pigeon_copy(); _identifiers[copy] = identifier; _strongInstances[identifier] = copy; } @@ -305,15 +311,14 @@ class PigeonInstanceManager { } /// Generated API for managing the Dart and native `PigeonInstanceManager`s. -class _PigeonInstanceManagerApi { - /// Constructor for [_PigeonInstanceManagerApi]. - _PigeonInstanceManagerApi({BinaryMessenger? binaryMessenger}) - : __pigeon_binaryMessenger = binaryMessenger; +class _PigeonInternalInstanceManagerApi { + /// Constructor for [_PigeonInternalInstanceManagerApi]. + _PigeonInternalInstanceManagerApi({BinaryMessenger? binaryMessenger}) + : pigeonVar_binaryMessenger = binaryMessenger; - final BinaryMessenger? __pigeon_binaryMessenger; + final BinaryMessenger? pigeonVar_binaryMessenger; - static const MessageCodec pigeonChannelCodec = - StandardMessageCodec(); + static const MessageCodec pigeonChannelCodec = _PigeonCodec(); static void setUpMessageHandlers({ bool pigeon_clearHandlers = false, @@ -321,21 +326,22 @@ class _PigeonInstanceManagerApi { PigeonInstanceManager? instanceManager, }) { { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.interactive_media_ads.PigeonInstanceManagerApi.removeStrongReference', + 'dev.flutter.pigeon.interactive_media_ads.PigeonInternalInstanceManager.removeStrongReference', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (pigeon_clearHandlers) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.interactive_media_ads.PigeonInstanceManagerApi.removeStrongReference was null.'); + 'Argument for dev.flutter.pigeon.interactive_media_ads.PigeonInternalInstanceManager.removeStrongReference was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.interactive_media_ads.PigeonInstanceManagerApi.removeStrongReference was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.interactive_media_ads.PigeonInternalInstanceManager.removeStrongReference was null, expected non-null int.'); try { (instanceManager ?? PigeonInstanceManager.instance) .remove(arg_identifier!); @@ -352,23 +358,23 @@ class _PigeonInstanceManagerApi { } Future removeStrongReference(int identifier) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.interactive_media_ads.PigeonInstanceManagerApi.removeStrongReference'; - final BasicMessageChannel __pigeon_channel = + const String pigeonVar_channelName = + 'dev.flutter.pigeon.interactive_media_ads.PigeonInternalInstanceManager.removeStrongReference'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([identifier]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([identifier]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -379,23 +385,23 @@ class _PigeonInstanceManagerApi { /// /// This is typically called after a hot restart. Future clear() async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.interactive_media_ads.PigeonInstanceManagerApi.clear'; - final BasicMessageChannel __pigeon_channel = + const String pigeonVar_channelName = + 'dev.flutter.pigeon.interactive_media_ads.PigeonInternalInstanceManager.clear'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -403,12 +409,12 @@ class _PigeonInstanceManagerApi { } } -class _PigeonProxyApiBaseCodec extends _PigeonCodec { - const _PigeonProxyApiBaseCodec(this.instanceManager); +class _PigeonInternalProxyApiBaseCodec extends _PigeonCodec { + const _PigeonInternalProxyApiBaseCodec(this.instanceManager); final PigeonInstanceManager instanceManager; @override void writeValue(WriteBuffer buffer, Object? value) { - if (value is PigeonProxyApiBaseClass) { + if (value is PigeonInternalProxyApiBaseClass) { buffer.putUint8(128); writeValue(buffer, instanceManager.getIdentifier(value)); } else { @@ -684,11 +690,41 @@ enum KeyValueChangeKey { unknown, } +/// A list of purposes for which an obstruction would be registered as friendly. +/// +/// See https://developers.google.com/ad-manager/dynamic-ad-insertion/sdk/ios/reference/Enums/IMAFriendlyObstructionPurpose.html. +enum FriendlyObstructionPurpose { + mediaControls, + closeAd, + notVisible, + other, + + /// The purpose type is not recognized by this wrapper. + unknown, +} + +/// Different UI elements that can be customized. +/// +/// See https://developers.google.com/ad-manager/dynamic-ad-insertion/sdk/ios/reference/Enums/IMAUiElementType.html. +enum UIElementType { + /// Ad attribution UI element. + adAttribution, + + /// Ad countdown element. + countdown, + + /// The element is not recognized by this wrapper. + unknown, +} + class _PigeonCodec extends StandardMessageCodec { const _PigeonCodec(); @override void writeValue(WriteBuffer buffer, Object? value) { - if (value is AdErrorType) { + if (value is int) { + buffer.putUint8(4); + buffer.putInt64(value); + } else if (value is AdErrorType) { buffer.putUint8(129); writeValue(buffer, value.index); } else if (value is AdErrorCode) { @@ -706,6 +742,12 @@ class _PigeonCodec extends StandardMessageCodec { } else if (value is KeyValueChangeKey) { buffer.putUint8(134); writeValue(buffer, value.index); + } else if (value is FriendlyObstructionPurpose) { + buffer.putUint8(135); + writeValue(buffer, value.index); + } else if (value is UIElementType) { + buffer.putUint8(136); + writeValue(buffer, value.index); } else { super.writeValue(buffer, value); } @@ -732,6 +774,12 @@ class _PigeonCodec extends StandardMessageCodec { case 134: final int? value = readValue(buffer) as int?; return value == null ? null : KeyValueChangeKey.values[value]; + case 135: + final int? value = readValue(buffer) as int?; + return value == null ? null : FriendlyObstructionPurpose.values[value]; + case 136: + final int? value = readValue(buffer) as int?; + return value == null ? null : UIElementType.values[value]; default: return super.readValueOfType(type, buffer); } @@ -749,33 +797,33 @@ class IMAAdDisplayContainer extends NSObject { required UIView adContainer, UIViewController? adContainerViewController, }) : super.pigeon_detached() { - final int __pigeon_instanceIdentifier = + final int pigeonVar_instanceIdentifier = pigeon_instanceManager.addDartCreatedInstance(this); - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - __pigeon_codecIMAAdDisplayContainer; - final BinaryMessenger? __pigeon_binaryMessenger = pigeon_binaryMessenger; + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecIMAAdDisplayContainer; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; () async { - const String __pigeon_channelName = + const String pigeonVar_channelName = 'dev.flutter.pigeon.interactive_media_ads.IMAAdDisplayContainer.pigeon_defaultConstructor'; - final BasicMessageChannel __pigeon_channel = + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel + final List? pigeonVar_replyList = await pigeonVar_channel .send([ - __pigeon_instanceIdentifier, + pigeonVar_instanceIdentifier, adContainer, adContainerViewController ]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -793,8 +841,9 @@ class IMAAdDisplayContainer extends NSObject { super.pigeon_instanceManager, }) : super.pigeon_detached(); - late final _PigeonProxyApiBaseCodec __pigeon_codecIMAAdDisplayContainer = - _PigeonProxyApiBaseCodec(pigeon_instanceManager); + late final _PigeonInternalProxyApiBaseCodec + _pigeonVar_codecIMAAdDisplayContainer = + _PigeonInternalProxyApiBaseCodec(pigeon_instanceManager); static void pigeon_setUpMessageHandlers({ bool pigeon_clearHandlers = false, @@ -802,20 +851,21 @@ class IMAAdDisplayContainer extends NSObject { PigeonInstanceManager? pigeon_instanceManager, IMAAdDisplayContainer Function()? pigeon_newInstance, }) { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - _PigeonProxyApiBaseCodec( + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _PigeonInternalProxyApiBaseCodec( pigeon_instanceManager ?? PigeonInstanceManager.instance); final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.interactive_media_ads.IMAAdDisplayContainer.pigeon_newInstance', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (pigeon_clearHandlers) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.interactive_media_ads.IMAAdDisplayContainer.pigeon_newInstance was null.'); final List args = (message as List?)!; @@ -873,20 +923,21 @@ class UIView extends NSObject { PigeonInstanceManager? pigeon_instanceManager, UIView Function()? pigeon_newInstance, }) { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - _PigeonProxyApiBaseCodec( + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _PigeonInternalProxyApiBaseCodec( pigeon_instanceManager ?? PigeonInstanceManager.instance); final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.interactive_media_ads.UIView.pigeon_newInstance', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (pigeon_clearHandlers) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.interactive_media_ads.UIView.pigeon_newInstance was null.'); final List args = (message as List?)!; @@ -933,29 +984,29 @@ class UIViewController extends NSObject { super.pigeon_instanceManager, this.viewDidAppear, }) : super.pigeon_detached() { - final int __pigeon_instanceIdentifier = + final int pigeonVar_instanceIdentifier = pigeon_instanceManager.addDartCreatedInstance(this); - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - __pigeon_codecUIViewController; - final BinaryMessenger? __pigeon_binaryMessenger = pigeon_binaryMessenger; + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecUIViewController; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; () async { - const String __pigeon_channelName = + const String pigeonVar_channelName = 'dev.flutter.pigeon.interactive_media_ads.UIViewController.pigeon_defaultConstructor'; - final BasicMessageChannel __pigeon_channel = + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([__pigeon_instanceIdentifier]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = await pigeonVar_channel + .send([pigeonVar_instanceIdentifier]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -974,8 +1025,8 @@ class UIViewController extends NSObject { this.viewDidAppear, }) : super.pigeon_detached(); - late final _PigeonProxyApiBaseCodec __pigeon_codecUIViewController = - _PigeonProxyApiBaseCodec(pigeon_instanceManager); + late final _PigeonInternalProxyApiBaseCodec _pigeonVar_codecUIViewController = + _PigeonInternalProxyApiBaseCodec(pigeon_instanceManager); /// Notifies the view controller that its view was added to a view hierarchy. /// @@ -1007,7 +1058,7 @@ class UIViewController extends NSObject { /// settable. Since this is not a part of the IMA SDK this is slightly changed /// for convenience. Note that this wrapper should not add the ability to set /// this property as it should not be needed anyways. - late final UIView view = __pigeon_view(); + late final UIView view = pigeonVar_view(); static void pigeon_setUpMessageHandlers({ bool pigeon_clearHandlers = false, @@ -1019,20 +1070,21 @@ class UIViewController extends NSObject { bool animated, )? viewDidAppear, }) { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - _PigeonProxyApiBaseCodec( + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _PigeonInternalProxyApiBaseCodec( pigeon_instanceManager ?? PigeonInstanceManager.instance); final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.interactive_media_ads.UIViewController.pigeon_newInstance', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (pigeon_clearHandlers) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.interactive_media_ads.UIViewController.pigeon_newInstance was null.'); final List args = (message as List?)!; @@ -1061,15 +1113,16 @@ class UIViewController extends NSObject { } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.interactive_media_ads.UIViewController.viewDidAppear', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (pigeon_clearHandlers) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.interactive_media_ads.UIViewController.viewDidAppear was null.'); final List args = (message as List?)!; @@ -1095,40 +1148,41 @@ class UIViewController extends NSObject { } } - UIView __pigeon_view() { - final UIView __pigeon_instance = UIView.pigeon_detached( + UIView pigeonVar_view() { + final UIView pigeonVar_instance = UIView.pigeon_detached( pigeon_binaryMessenger: pigeon_binaryMessenger, pigeon_instanceManager: pigeon_instanceManager, ); - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - __pigeon_codecUIViewController; - final BinaryMessenger? __pigeon_binaryMessenger = pigeon_binaryMessenger; - final int __pigeon_instanceIdentifier = - pigeon_instanceManager.addDartCreatedInstance(__pigeon_instance); + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecUIViewController; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + final int pigeonVar_instanceIdentifier = + pigeon_instanceManager.addDartCreatedInstance(pigeonVar_instance); () async { - const String __pigeon_channelName = + const String pigeonVar_channelName = 'dev.flutter.pigeon.interactive_media_ads.UIViewController.view'; - final BasicMessageChannel __pigeon_channel = + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([this, __pigeon_instanceIdentifier]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = await pigeonVar_channel + .send([this, pigeonVar_instanceIdentifier]) + as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; } }(); - return __pigeon_instance; + return pigeonVar_instance; } @override @@ -1150,29 +1204,29 @@ class IMAContentPlayhead extends NSObject { super.pigeon_binaryMessenger, super.pigeon_instanceManager, }) : super.pigeon_detached() { - final int __pigeon_instanceIdentifier = + final int pigeonVar_instanceIdentifier = pigeon_instanceManager.addDartCreatedInstance(this); - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - __pigeon_codecIMAContentPlayhead; - final BinaryMessenger? __pigeon_binaryMessenger = pigeon_binaryMessenger; + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecIMAContentPlayhead; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; () async { - const String __pigeon_channelName = + const String pigeonVar_channelName = 'dev.flutter.pigeon.interactive_media_ads.IMAContentPlayhead.pigeon_defaultConstructor'; - final BasicMessageChannel __pigeon_channel = + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([__pigeon_instanceIdentifier]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = await pigeonVar_channel + .send([pigeonVar_instanceIdentifier]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -1190,8 +1244,9 @@ class IMAContentPlayhead extends NSObject { super.pigeon_instanceManager, }) : super.pigeon_detached(); - late final _PigeonProxyApiBaseCodec __pigeon_codecIMAContentPlayhead = - _PigeonProxyApiBaseCodec(pigeon_instanceManager); + late final _PigeonInternalProxyApiBaseCodec + _pigeonVar_codecIMAContentPlayhead = + _PigeonInternalProxyApiBaseCodec(pigeon_instanceManager); static void pigeon_setUpMessageHandlers({ bool pigeon_clearHandlers = false, @@ -1199,20 +1254,21 @@ class IMAContentPlayhead extends NSObject { PigeonInstanceManager? pigeon_instanceManager, IMAContentPlayhead Function()? pigeon_newInstance, }) { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - _PigeonProxyApiBaseCodec( + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _PigeonInternalProxyApiBaseCodec( pigeon_instanceManager ?? PigeonInstanceManager.instance); final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.interactive_media_ads.IMAContentPlayhead.pigeon_newInstance', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (pigeon_clearHandlers) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.interactive_media_ads.IMAContentPlayhead.pigeon_newInstance was null.'); final List args = (message as List?)!; @@ -1243,26 +1299,26 @@ class IMAContentPlayhead extends NSObject { /// Reflects the current playback time in seconds for the content. Future setCurrentTime(double timeInterval) async { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - __pigeon_codecIMAContentPlayhead; - final BinaryMessenger? __pigeon_binaryMessenger = pigeon_binaryMessenger; - const String __pigeon_channelName = + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecIMAContentPlayhead; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = 'dev.flutter.pigeon.interactive_media_ads.IMAContentPlayhead.setCurrentTime'; - final BasicMessageChannel __pigeon_channel = + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel + final List? pigeonVar_replyList = await pigeonVar_channel .send([this, timeInterval]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -1287,30 +1343,30 @@ class IMAAdsLoader extends NSObject { super.pigeon_instanceManager, IMASettings? settings, }) : super.pigeon_detached() { - final int __pigeon_instanceIdentifier = + final int pigeonVar_instanceIdentifier = pigeon_instanceManager.addDartCreatedInstance(this); - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - __pigeon_codecIMAAdsLoader; - final BinaryMessenger? __pigeon_binaryMessenger = pigeon_binaryMessenger; + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecIMAAdsLoader; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; () async { - const String __pigeon_channelName = + const String pigeonVar_channelName = 'dev.flutter.pigeon.interactive_media_ads.IMAAdsLoader.pigeon_defaultConstructor'; - final BasicMessageChannel __pigeon_channel = + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([__pigeon_instanceIdentifier, settings]) + final List? pigeonVar_replyList = await pigeonVar_channel + .send([pigeonVar_instanceIdentifier, settings]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -1328,8 +1384,8 @@ class IMAAdsLoader extends NSObject { super.pigeon_instanceManager, }) : super.pigeon_detached(); - late final _PigeonProxyApiBaseCodec __pigeon_codecIMAAdsLoader = - _PigeonProxyApiBaseCodec(pigeon_instanceManager); + late final _PigeonInternalProxyApiBaseCodec _pigeonVar_codecIMAAdsLoader = + _PigeonInternalProxyApiBaseCodec(pigeon_instanceManager); static void pigeon_setUpMessageHandlers({ bool pigeon_clearHandlers = false, @@ -1337,20 +1393,21 @@ class IMAAdsLoader extends NSObject { PigeonInstanceManager? pigeon_instanceManager, IMAAdsLoader Function()? pigeon_newInstance, }) { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - _PigeonProxyApiBaseCodec( + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _PigeonInternalProxyApiBaseCodec( pigeon_instanceManager ?? PigeonInstanceManager.instance); final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.interactive_media_ads.IMAAdsLoader.pigeon_newInstance', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (pigeon_clearHandlers) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.interactive_media_ads.IMAAdsLoader.pigeon_newInstance was null.'); final List args = (message as List?)!; @@ -1381,26 +1438,26 @@ class IMAAdsLoader extends NSObject { /// Signal to the SDK that the content has completed. Future contentComplete() async { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - __pigeon_codecIMAAdsLoader; - final BinaryMessenger? __pigeon_binaryMessenger = pigeon_binaryMessenger; - const String __pigeon_channelName = + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecIMAAdsLoader; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = 'dev.flutter.pigeon.interactive_media_ads.IMAAdsLoader.contentComplete'; - final BasicMessageChannel __pigeon_channel = + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([this]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([this]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -1409,26 +1466,26 @@ class IMAAdsLoader extends NSObject { /// Request ads from the ad server. Future requestAds(IMAAdsRequest request) async { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - __pigeon_codecIMAAdsLoader; - final BinaryMessenger? __pigeon_binaryMessenger = pigeon_binaryMessenger; - const String __pigeon_channelName = + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecIMAAdsLoader; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = 'dev.flutter.pigeon.interactive_media_ads.IMAAdsLoader.requestAds'; - final BasicMessageChannel __pigeon_channel = + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([this, request]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = await pigeonVar_channel + .send([this, request]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -1439,26 +1496,26 @@ class IMAAdsLoader extends NSObject { /// /// Note that this sets to a `weak` property in Swift. Future setDelegate(IMAAdsLoaderDelegate? delegate) async { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - __pigeon_codecIMAAdsLoader; - final BinaryMessenger? __pigeon_binaryMessenger = pigeon_binaryMessenger; - const String __pigeon_channelName = + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecIMAAdsLoader; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = 'dev.flutter.pigeon.interactive_media_ads.IMAAdsLoader.setDelegate'; - final BasicMessageChannel __pigeon_channel = + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel + final List? pigeonVar_replyList = await pigeonVar_channel .send([this, delegate]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -1494,20 +1551,21 @@ class IMASettings extends NSObject { PigeonInstanceManager? pigeon_instanceManager, IMASettings Function()? pigeon_newInstance, }) { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - _PigeonProxyApiBaseCodec( + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _PigeonInternalProxyApiBaseCodec( pigeon_instanceManager ?? PigeonInstanceManager.instance); final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.interactive_media_ads.IMASettings.pigeon_newInstance', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (pigeon_clearHandlers) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.interactive_media_ads.IMASettings.pigeon_newInstance was null.'); final List args = (message as List?)!; @@ -1558,34 +1616,34 @@ class IMAAdsRequest extends NSObject { required IMAAdDisplayContainer adDisplayContainer, IMAContentPlayhead? contentPlayhead, }) : super.pigeon_detached() { - final int __pigeon_instanceIdentifier = + final int pigeonVar_instanceIdentifier = pigeon_instanceManager.addDartCreatedInstance(this); - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - __pigeon_codecIMAAdsRequest; - final BinaryMessenger? __pigeon_binaryMessenger = pigeon_binaryMessenger; + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecIMAAdsRequest; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; () async { - const String __pigeon_channelName = + const String pigeonVar_channelName = 'dev.flutter.pigeon.interactive_media_ads.IMAAdsRequest.pigeon_defaultConstructor'; - final BasicMessageChannel __pigeon_channel = + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel + final List? pigeonVar_replyList = await pigeonVar_channel .send([ - __pigeon_instanceIdentifier, + pigeonVar_instanceIdentifier, adTagUrl, adDisplayContainer, contentPlayhead ]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -1603,8 +1661,8 @@ class IMAAdsRequest extends NSObject { super.pigeon_instanceManager, }) : super.pigeon_detached(); - late final _PigeonProxyApiBaseCodec __pigeon_codecIMAAdsRequest = - _PigeonProxyApiBaseCodec(pigeon_instanceManager); + late final _PigeonInternalProxyApiBaseCodec _pigeonVar_codecIMAAdsRequest = + _PigeonInternalProxyApiBaseCodec(pigeon_instanceManager); static void pigeon_setUpMessageHandlers({ bool pigeon_clearHandlers = false, @@ -1612,20 +1670,21 @@ class IMAAdsRequest extends NSObject { PigeonInstanceManager? pigeon_instanceManager, IMAAdsRequest Function()? pigeon_newInstance, }) { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - _PigeonProxyApiBaseCodec( + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _PigeonInternalProxyApiBaseCodec( pigeon_instanceManager ?? PigeonInstanceManager.instance); final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.interactive_media_ads.IMAAdsRequest.pigeon_newInstance', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (pigeon_clearHandlers) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.interactive_media_ads.IMAAdsRequest.pigeon_newInstance was null.'); final List args = (message as List?)!; @@ -1673,29 +1732,29 @@ class IMAAdsLoaderDelegate extends NSObject { required this.adLoaderLoadedWith, required this.adsLoaderFailedWithErrorData, }) : super.pigeon_detached() { - final int __pigeon_instanceIdentifier = + final int pigeonVar_instanceIdentifier = pigeon_instanceManager.addDartCreatedInstance(this); - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - __pigeon_codecIMAAdsLoaderDelegate; - final BinaryMessenger? __pigeon_binaryMessenger = pigeon_binaryMessenger; + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecIMAAdsLoaderDelegate; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; () async { - const String __pigeon_channelName = + const String pigeonVar_channelName = 'dev.flutter.pigeon.interactive_media_ads.IMAAdsLoaderDelegate.pigeon_defaultConstructor'; - final BasicMessageChannel __pigeon_channel = + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([__pigeon_instanceIdentifier]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = await pigeonVar_channel + .send([pigeonVar_instanceIdentifier]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -1715,8 +1774,9 @@ class IMAAdsLoaderDelegate extends NSObject { required this.adsLoaderFailedWithErrorData, }) : super.pigeon_detached(); - late final _PigeonProxyApiBaseCodec __pigeon_codecIMAAdsLoaderDelegate = - _PigeonProxyApiBaseCodec(pigeon_instanceManager); + late final _PigeonInternalProxyApiBaseCodec + _pigeonVar_codecIMAAdsLoaderDelegate = + _PigeonInternalProxyApiBaseCodec(pigeon_instanceManager); /// Called when ads are successfully loaded from the ad servers by the loader. /// @@ -1783,20 +1843,21 @@ class IMAAdsLoaderDelegate extends NSObject { IMAAdLoadingErrorData adErrorData, )? adsLoaderFailedWithErrorData, }) { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - _PigeonProxyApiBaseCodec( + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _PigeonInternalProxyApiBaseCodec( pigeon_instanceManager ?? PigeonInstanceManager.instance); final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.interactive_media_ads.IMAAdsLoaderDelegate.adLoaderLoadedWith', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (pigeon_clearHandlers) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.interactive_media_ads.IMAAdsLoaderDelegate.adLoaderLoadedWith was null.'); final List args = (message as List?)!; @@ -1826,15 +1887,16 @@ class IMAAdsLoaderDelegate extends NSObject { } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.interactive_media_ads.IMAAdsLoaderDelegate.adsLoaderFailedWithErrorData', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (pigeon_clearHandlers) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.interactive_media_ads.IMAAdsLoaderDelegate.adsLoaderFailedWithErrorData was null.'); final List args = (message as List?)!; @@ -1902,20 +1964,21 @@ class IMAAdsLoadedData extends NSObject { PigeonInstanceManager? pigeon_instanceManager, IMAAdsLoadedData Function(IMAAdsManager? adsManager)? pigeon_newInstance, }) { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - _PigeonProxyApiBaseCodec( + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _PigeonInternalProxyApiBaseCodec( pigeon_instanceManager ?? PigeonInstanceManager.instance); final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.interactive_media_ads.IMAAdsLoadedData.pigeon_newInstance', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (pigeon_clearHandlers) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.interactive_media_ads.IMAAdsLoadedData.pigeon_newInstance was null.'); final List args = (message as List?)!; @@ -1980,20 +2043,21 @@ class IMAAdLoadingErrorData extends NSObject { PigeonInstanceManager? pigeon_instanceManager, IMAAdLoadingErrorData Function(IMAAdError adError)? pigeon_newInstance, }) { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - _PigeonProxyApiBaseCodec( + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _PigeonInternalProxyApiBaseCodec( pigeon_instanceManager ?? PigeonInstanceManager.instance); final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.interactive_media_ads.IMAAdLoadingErrorData.pigeon_newInstance', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (pigeon_clearHandlers) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.interactive_media_ads.IMAAdLoadingErrorData.pigeon_newInstance was null.'); final List args = (message as List?)!; @@ -2072,20 +2136,21 @@ class IMAAdError extends NSObject { String? message, )? pigeon_newInstance, }) { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - _PigeonProxyApiBaseCodec( + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _PigeonInternalProxyApiBaseCodec( pigeon_instanceManager ?? PigeonInstanceManager.instance); final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.interactive_media_ads.IMAAdError.pigeon_newInstance', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (pigeon_clearHandlers) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.interactive_media_ads.IMAAdError.pigeon_newInstance was null.'); final List args = (message as List?)!; @@ -2150,8 +2215,8 @@ class IMAAdsManager extends NSObject { super.pigeon_instanceManager, }) : super.pigeon_detached(); - late final _PigeonProxyApiBaseCodec __pigeon_codecIMAAdsManager = - _PigeonProxyApiBaseCodec(pigeon_instanceManager); + late final _PigeonInternalProxyApiBaseCodec _pigeonVar_codecIMAAdsManager = + _PigeonInternalProxyApiBaseCodec(pigeon_instanceManager); static void pigeon_setUpMessageHandlers({ bool pigeon_clearHandlers = false, @@ -2159,20 +2224,21 @@ class IMAAdsManager extends NSObject { PigeonInstanceManager? pigeon_instanceManager, IMAAdsManager Function()? pigeon_newInstance, }) { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - _PigeonProxyApiBaseCodec( + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _PigeonInternalProxyApiBaseCodec( pigeon_instanceManager ?? PigeonInstanceManager.instance); final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.interactive_media_ads.IMAAdsManager.pigeon_newInstance', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (pigeon_clearHandlers) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.interactive_media_ads.IMAAdsManager.pigeon_newInstance was null.'); final List args = (message as List?)!; @@ -2203,26 +2269,26 @@ class IMAAdsManager extends NSObject { /// The `IMAAdsManagerDelegate` to notify with events during ad playback. Future setDelegate(IMAAdsManagerDelegate? delegate) async { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - __pigeon_codecIMAAdsManager; - final BinaryMessenger? __pigeon_binaryMessenger = pigeon_binaryMessenger; - const String __pigeon_channelName = + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecIMAAdsManager; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = 'dev.flutter.pigeon.interactive_media_ads.IMAAdsManager.setDelegate'; - final BasicMessageChannel __pigeon_channel = + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel + final List? pigeonVar_replyList = await pigeonVar_channel .send([this, delegate]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -2231,26 +2297,26 @@ class IMAAdsManager extends NSObject { /// Initializes and loads the ad. Future initialize(IMAAdsRenderingSettings? adsRenderingSettings) async { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - __pigeon_codecIMAAdsManager; - final BinaryMessenger? __pigeon_binaryMessenger = pigeon_binaryMessenger; - const String __pigeon_channelName = + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecIMAAdsManager; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = 'dev.flutter.pigeon.interactive_media_ads.IMAAdsManager.initialize'; - final BasicMessageChannel __pigeon_channel = + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel + final List? pigeonVar_replyList = await pigeonVar_channel .send([this, adsRenderingSettings]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -2259,26 +2325,26 @@ class IMAAdsManager extends NSObject { /// Starts advertisement playback. Future start() async { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - __pigeon_codecIMAAdsManager; - final BinaryMessenger? __pigeon_binaryMessenger = pigeon_binaryMessenger; - const String __pigeon_channelName = + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecIMAAdsManager; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = 'dev.flutter.pigeon.interactive_media_ads.IMAAdsManager.start'; - final BasicMessageChannel __pigeon_channel = + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([this]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([this]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -2287,26 +2353,26 @@ class IMAAdsManager extends NSObject { /// Pauses advertisement. Future pause() async { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - __pigeon_codecIMAAdsManager; - final BinaryMessenger? __pigeon_binaryMessenger = pigeon_binaryMessenger; - const String __pigeon_channelName = + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecIMAAdsManager; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = 'dev.flutter.pigeon.interactive_media_ads.IMAAdsManager.pause'; - final BasicMessageChannel __pigeon_channel = + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([this]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([this]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -2315,26 +2381,26 @@ class IMAAdsManager extends NSObject { /// Resumes the current ad. Future resume() async { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - __pigeon_codecIMAAdsManager; - final BinaryMessenger? __pigeon_binaryMessenger = pigeon_binaryMessenger; - const String __pigeon_channelName = + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecIMAAdsManager; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = 'dev.flutter.pigeon.interactive_media_ads.IMAAdsManager.resume'; - final BasicMessageChannel __pigeon_channel = + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([this]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([this]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -2344,26 +2410,26 @@ class IMAAdsManager extends NSObject { /// Skips the advertisement if the ad is skippable and the skip offset has /// been reached. Future skip() async { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - __pigeon_codecIMAAdsManager; - final BinaryMessenger? __pigeon_binaryMessenger = pigeon_binaryMessenger; - const String __pigeon_channelName = + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecIMAAdsManager; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = 'dev.flutter.pigeon.interactive_media_ads.IMAAdsManager.skip'; - final BasicMessageChannel __pigeon_channel = + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([this]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([this]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -2372,26 +2438,26 @@ class IMAAdsManager extends NSObject { /// If an ad break is currently playing, discard it and resume content. Future discardAdBreak() async { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - __pigeon_codecIMAAdsManager; - final BinaryMessenger? __pigeon_binaryMessenger = pigeon_binaryMessenger; - const String __pigeon_channelName = + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecIMAAdsManager; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = 'dev.flutter.pigeon.interactive_media_ads.IMAAdsManager.discardAdBreak'; - final BasicMessageChannel __pigeon_channel = + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([this]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([this]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -2400,26 +2466,26 @@ class IMAAdsManager extends NSObject { /// Causes the ads manager to stop the ad and clean its internal state. Future destroy() async { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - __pigeon_codecIMAAdsManager; - final BinaryMessenger? __pigeon_binaryMessenger = pigeon_binaryMessenger; - const String __pigeon_channelName = + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecIMAAdsManager; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = 'dev.flutter.pigeon.interactive_media_ads.IMAAdsManager.destroy'; - final BasicMessageChannel __pigeon_channel = + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([this]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([this]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -2447,29 +2513,29 @@ class IMAAdsManagerDelegate extends NSObject { required this.didRequestContentPause, required this.didRequestContentResume, }) : super.pigeon_detached() { - final int __pigeon_instanceIdentifier = + final int pigeonVar_instanceIdentifier = pigeon_instanceManager.addDartCreatedInstance(this); - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - __pigeon_codecIMAAdsManagerDelegate; - final BinaryMessenger? __pigeon_binaryMessenger = pigeon_binaryMessenger; + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecIMAAdsManagerDelegate; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; () async { - const String __pigeon_channelName = + const String pigeonVar_channelName = 'dev.flutter.pigeon.interactive_media_ads.IMAAdsManagerDelegate.pigeon_defaultConstructor'; - final BasicMessageChannel __pigeon_channel = + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([__pigeon_instanceIdentifier]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = await pigeonVar_channel + .send([pigeonVar_instanceIdentifier]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -2491,8 +2557,9 @@ class IMAAdsManagerDelegate extends NSObject { required this.didRequestContentResume, }) : super.pigeon_detached(); - late final _PigeonProxyApiBaseCodec __pigeon_codecIMAAdsManagerDelegate = - _PigeonProxyApiBaseCodec(pigeon_instanceManager); + late final _PigeonInternalProxyApiBaseCodec + _pigeonVar_codecIMAAdsManagerDelegate = + _PigeonInternalProxyApiBaseCodec(pigeon_instanceManager); /// Called when there is an IMAAdEvent. /// @@ -2615,20 +2682,21 @@ class IMAAdsManagerDelegate extends NSObject { IMAAdsManager adsManager, )? didRequestContentResume, }) { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - _PigeonProxyApiBaseCodec( + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _PigeonInternalProxyApiBaseCodec( pigeon_instanceManager ?? PigeonInstanceManager.instance); final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.interactive_media_ads.IMAAdsManagerDelegate.didReceiveAdEvent', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (pigeon_clearHandlers) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.interactive_media_ads.IMAAdsManagerDelegate.didReceiveAdEvent was null.'); final List args = (message as List?)!; @@ -2657,15 +2725,16 @@ class IMAAdsManagerDelegate extends NSObject { } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.interactive_media_ads.IMAAdsManagerDelegate.didReceiveAdError', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (pigeon_clearHandlers) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.interactive_media_ads.IMAAdsManagerDelegate.didReceiveAdError was null.'); final List args = (message as List?)!; @@ -2694,15 +2763,16 @@ class IMAAdsManagerDelegate extends NSObject { } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.interactive_media_ads.IMAAdsManagerDelegate.didRequestContentPause', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (pigeon_clearHandlers) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.interactive_media_ads.IMAAdsManagerDelegate.didRequestContentPause was null.'); final List args = (message as List?)!; @@ -2729,15 +2799,16 @@ class IMAAdsManagerDelegate extends NSObject { } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.interactive_media_ads.IMAAdsManagerDelegate.didRequestContentResume', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (pigeon_clearHandlers) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.interactive_media_ads.IMAAdsManagerDelegate.didRequestContentResume was null.'); final List args = (message as List?)!; @@ -2801,7 +2872,7 @@ class IMAAdEvent extends NSObject { final String typeString; /// Extra data about the ad. - final Map? adData; + final Map? adData; static void pigeon_setUpMessageHandlers({ bool pigeon_clearHandlers = false, @@ -2810,23 +2881,24 @@ class IMAAdEvent extends NSObject { IMAAdEvent Function( AdEventType type, String typeString, - Map? adData, + Map? adData, )? pigeon_newInstance, }) { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - _PigeonProxyApiBaseCodec( + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _PigeonInternalProxyApiBaseCodec( pigeon_instanceManager ?? PigeonInstanceManager.instance); final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.interactive_media_ads.IMAAdEvent.pigeon_newInstance', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (pigeon_clearHandlers) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.interactive_media_ads.IMAAdEvent.pigeon_newInstance was null.'); final List args = (message as List?)!; @@ -2839,8 +2911,8 @@ class IMAAdEvent extends NSObject { final String? arg_typeString = (args[2] as String?); assert(arg_typeString != null, 'Argument for dev.flutter.pigeon.interactive_media_ads.IMAAdEvent.pigeon_newInstance was null, expected non-null String.'); - final Map? arg_adData = - (args[3] as Map?)?.cast(); + final Map? arg_adData = + (args[3] as Map?)?.cast(); try { (pigeon_instanceManager ?? PigeonInstanceManager.instance) .addHostCreatedInstance( @@ -2887,29 +2959,29 @@ class IMAAdsRenderingSettings extends NSObject { super.pigeon_binaryMessenger, super.pigeon_instanceManager, }) : super.pigeon_detached() { - final int __pigeon_instanceIdentifier = + final int pigeonVar_instanceIdentifier = pigeon_instanceManager.addDartCreatedInstance(this); - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - __pigeon_codecIMAAdsRenderingSettings; - final BinaryMessenger? __pigeon_binaryMessenger = pigeon_binaryMessenger; + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecIMAAdsRenderingSettings; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; () async { - const String __pigeon_channelName = + const String pigeonVar_channelName = 'dev.flutter.pigeon.interactive_media_ads.IMAAdsRenderingSettings.pigeon_defaultConstructor'; - final BasicMessageChannel __pigeon_channel = + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([__pigeon_instanceIdentifier]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = await pigeonVar_channel + .send([pigeonVar_instanceIdentifier]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -2927,8 +2999,9 @@ class IMAAdsRenderingSettings extends NSObject { super.pigeon_instanceManager, }) : super.pigeon_detached(); - late final _PigeonProxyApiBaseCodec __pigeon_codecIMAAdsRenderingSettings = - _PigeonProxyApiBaseCodec(pigeon_instanceManager); + late final _PigeonInternalProxyApiBaseCodec + _pigeonVar_codecIMAAdsRenderingSettings = + _PigeonInternalProxyApiBaseCodec(pigeon_instanceManager); static void pigeon_setUpMessageHandlers({ bool pigeon_clearHandlers = false, @@ -2936,20 +3009,21 @@ class IMAAdsRenderingSettings extends NSObject { PigeonInstanceManager? pigeon_instanceManager, IMAAdsRenderingSettings Function()? pigeon_newInstance, }) { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - _PigeonProxyApiBaseCodec( + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _PigeonInternalProxyApiBaseCodec( pigeon_instanceManager ?? PigeonInstanceManager.instance); final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.interactive_media_ads.IMAAdsRenderingSettings.pigeon_newInstance', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (pigeon_clearHandlers) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.interactive_media_ads.IMAAdsRenderingSettings.pigeon_newInstance was null.'); final List args = (message as List?)!; @@ -2978,6 +3052,211 @@ class IMAAdsRenderingSettings extends NSObject { } } + /// If specified, the SDK will play the media with MIME type on the list. + Future setMimeTypes(List? types) async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecIMAAdsRenderingSettings; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.interactive_media_ads.IMAAdsRenderingSettings.setMimeTypes'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([this, types]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return; + } + } + + /// Maximum recommended bitrate. + /// + /// The value is in kbit/s. + Future setBitrate(int bitrate) async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecIMAAdsRenderingSettings; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.interactive_media_ads.IMAAdsRenderingSettings.setBitrate'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = await pigeonVar_channel + .send([this, bitrate]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return; + } + } + + /// Timeout (in seconds) when loading a video ad media file. + /// + /// Use -1 for the default of 8 seconds. + Future setLoadVideoTimeout(double seconds) async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecIMAAdsRenderingSettings; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.interactive_media_ads.IMAAdsRenderingSettings.setLoadVideoTimeout'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = await pigeonVar_channel + .send([this, seconds]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return; + } + } + + /// For VMAP and ad rules playlists, only play ad breaks scheduled after this + /// time (in seconds). + Future setPlayAdsAfterTime(double seconds) async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecIMAAdsRenderingSettings; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.interactive_media_ads.IMAAdsRenderingSettings.setPlayAdsAfterTime'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = await pigeonVar_channel + .send([this, seconds]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return; + } + } + + /// Specifies the list of UI elements that should be visible. + Future setUIElements(List? types) async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecIMAAdsRenderingSettings; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.interactive_media_ads.IMAAdsRenderingSettings.setUIElements'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([this, types]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return; + } + } + + /// Whether or not the SDK will preload ad media. + /// + /// Default is YES. + Future setEnablePreloading(bool enable) async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecIMAAdsRenderingSettings; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.interactive_media_ads.IMAAdsRenderingSettings.setEnablePreloading'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([this, enable]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return; + } + } + + /// Specifies the optional UIViewController that will be used to open links + /// in-app. + Future setLinkOpenerPresentingController( + UIViewController controller) async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecIMAAdsRenderingSettings; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.interactive_media_ads.IMAAdsRenderingSettings.setLinkOpenerPresentingController'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = await pigeonVar_channel + .send([this, controller]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return; + } + } + @override IMAAdsRenderingSettings pigeon_copy() { return IMAAdsRenderingSettings.pigeon_detached( @@ -2992,7 +3271,7 @@ class IMAAdsRenderingSettings extends NSObject { /// Objective-C objects. /// /// See https://developer.apple.com/documentation/objectivec/nsobject. -class NSObject extends PigeonProxyApiBaseClass { +class NSObject extends PigeonInternalProxyApiBaseClass { /// Constructs [NSObject] without creating the associated native object. /// /// This should only be used by subclasses created by this library or to @@ -3009,20 +3288,21 @@ class NSObject extends PigeonProxyApiBaseClass { PigeonInstanceManager? pigeon_instanceManager, NSObject Function()? pigeon_newInstance, }) { - final _PigeonProxyApiBaseCodec pigeonChannelCodec = - _PigeonProxyApiBaseCodec( + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _PigeonInternalProxyApiBaseCodec( pigeon_instanceManager ?? PigeonInstanceManager.instance); final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.interactive_media_ads.NSObject.pigeon_newInstance', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (pigeon_clearHandlers) { - __pigeon_channel.setMessageHandler(null); + pigeonVar_channel.setMessageHandler(null); } else { - __pigeon_channel.setMessageHandler((Object? message) async { + pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.interactive_media_ads.NSObject.pigeon_newInstance was null.'); final List args = (message as List?)!; @@ -3059,3 +3339,272 @@ class NSObject extends PigeonProxyApiBaseClass { ); } } + +/// An obstruction that is marked as “friendly” for viewability measurement +/// purposes. +/// +/// See https://developers.google.com/ad-manager/dynamic-ad-insertion/sdk/ios/reference/Classes/IMAFriendlyObstruction.html. +class IMAFriendlyObstruction extends NSObject { + /// Initializes a friendly obstruction. + IMAFriendlyObstruction({ + super.pigeon_binaryMessenger, + super.pigeon_instanceManager, + required this.view, + required this.purpose, + this.detailedReason, + }) : super.pigeon_detached() { + final int pigeonVar_instanceIdentifier = + pigeon_instanceManager.addDartCreatedInstance(this); + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecIMAFriendlyObstruction; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + () async { + const String pigeonVar_channelName = + 'dev.flutter.pigeon.interactive_media_ads.IMAFriendlyObstruction.pigeon_defaultConstructor'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = await pigeonVar_channel + .send([ + pigeonVar_instanceIdentifier, + view, + purpose, + detailedReason + ]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return; + } + }(); + } + + /// Constructs [IMAFriendlyObstruction] without creating the associated native object. + /// + /// This should only be used by subclasses created by this library or to + /// create copies for an [PigeonInstanceManager]. + @protected + IMAFriendlyObstruction.pigeon_detached({ + super.pigeon_binaryMessenger, + super.pigeon_instanceManager, + required this.view, + required this.purpose, + this.detailedReason, + }) : super.pigeon_detached(); + + late final _PigeonInternalProxyApiBaseCodec + _pigeonVar_codecIMAFriendlyObstruction = + _PigeonInternalProxyApiBaseCodec(pigeon_instanceManager); + + /// The view causing the obstruction. + final UIView view; + + /// The purpose for registering the obstruction as friendly. + final FriendlyObstructionPurpose purpose; + + /// Optional, detailed reasoning for registering this obstruction as friendly. + /// + /// If the detailedReason is not null, it must follow the IAB standard by + /// being 50 characters or less and only containing characters A-z, 0-9, or + /// spaces. + final String? detailedReason; + + static void pigeon_setUpMessageHandlers({ + bool pigeon_clearHandlers = false, + BinaryMessenger? pigeon_binaryMessenger, + PigeonInstanceManager? pigeon_instanceManager, + IMAFriendlyObstruction Function( + UIView view, + FriendlyObstructionPurpose purpose, + String? detailedReason, + )? pigeon_newInstance, + }) { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _PigeonInternalProxyApiBaseCodec( + pigeon_instanceManager ?? PigeonInstanceManager.instance); + final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger; + { + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.interactive_media_ads.IMAFriendlyObstruction.pigeon_newInstance', + pigeonChannelCodec, + binaryMessenger: binaryMessenger); + if (pigeon_clearHandlers) { + pigeonVar_channel.setMessageHandler(null); + } else { + pigeonVar_channel.setMessageHandler((Object? message) async { + assert(message != null, + 'Argument for dev.flutter.pigeon.interactive_media_ads.IMAFriendlyObstruction.pigeon_newInstance was null.'); + final List args = (message as List?)!; + final int? arg_pigeon_instanceIdentifier = (args[0] as int?); + assert(arg_pigeon_instanceIdentifier != null, + 'Argument for dev.flutter.pigeon.interactive_media_ads.IMAFriendlyObstruction.pigeon_newInstance was null, expected non-null int.'); + final UIView? arg_view = (args[1] as UIView?); + assert(arg_view != null, + 'Argument for dev.flutter.pigeon.interactive_media_ads.IMAFriendlyObstruction.pigeon_newInstance was null, expected non-null UIView.'); + final FriendlyObstructionPurpose? arg_purpose = + (args[2] as FriendlyObstructionPurpose?); + assert(arg_purpose != null, + 'Argument for dev.flutter.pigeon.interactive_media_ads.IMAFriendlyObstruction.pigeon_newInstance was null, expected non-null FriendlyObstructionPurpose.'); + final String? arg_detailedReason = (args[3] as String?); + try { + (pigeon_instanceManager ?? PigeonInstanceManager.instance) + .addHostCreatedInstance( + pigeon_newInstance?.call( + arg_view!, arg_purpose!, arg_detailedReason) ?? + IMAFriendlyObstruction.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + view: arg_view!, + purpose: arg_purpose!, + detailedReason: arg_detailedReason, + ), + arg_pigeon_instanceIdentifier!, + ); + return wrapResponse(empty: true); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } + }); + } + } + } + + @override + IMAFriendlyObstruction pigeon_copy() { + return IMAFriendlyObstruction.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + view: view, + purpose: purpose, + detailedReason: detailedReason, + ); + } +} + +/// An object that holds data corresponding to the companion ad. +/// +/// See https://developers.google.com/interactive-media-ads/docs/sdks/ios/client-side/reference/Classes/IMACompanionAd. +class IMACompanionAd extends NSObject { + /// Constructs [IMACompanionAd] without creating the associated native object. + /// + /// This should only be used by subclasses created by this library or to + /// create copies for an [PigeonInstanceManager]. + @protected + IMACompanionAd.pigeon_detached({ + super.pigeon_binaryMessenger, + super.pigeon_instanceManager, + this.resourceValue, + this.apiFramework, + required this.width, + required this.height, + }) : super.pigeon_detached(); + + /// The value for the resource of this companion. + final String? resourceValue; + + /// The API needed to execute this ad, or nil if unavailable. + final String? apiFramework; + + /// The width of the companion in pixels. + /// + /// 0 if unavailable. + final int width; + + /// The height of the companion in pixels. + /// + /// 0 if unavailable. + final int height; + + static void pigeon_setUpMessageHandlers({ + bool pigeon_clearHandlers = false, + BinaryMessenger? pigeon_binaryMessenger, + PigeonInstanceManager? pigeon_instanceManager, + IMACompanionAd Function( + String? resourceValue, + String? apiFramework, + int width, + int height, + )? pigeon_newInstance, + }) { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _PigeonInternalProxyApiBaseCodec( + pigeon_instanceManager ?? PigeonInstanceManager.instance); + final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger; + { + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.interactive_media_ads.IMACompanionAd.pigeon_newInstance', + pigeonChannelCodec, + binaryMessenger: binaryMessenger); + if (pigeon_clearHandlers) { + pigeonVar_channel.setMessageHandler(null); + } else { + pigeonVar_channel.setMessageHandler((Object? message) async { + assert(message != null, + 'Argument for dev.flutter.pigeon.interactive_media_ads.IMACompanionAd.pigeon_newInstance was null.'); + final List args = (message as List?)!; + final int? arg_pigeon_instanceIdentifier = (args[0] as int?); + assert(arg_pigeon_instanceIdentifier != null, + 'Argument for dev.flutter.pigeon.interactive_media_ads.IMACompanionAd.pigeon_newInstance was null, expected non-null int.'); + final String? arg_resourceValue = (args[1] as String?); + final String? arg_apiFramework = (args[2] as String?); + final int? arg_width = (args[3] as int?); + assert(arg_width != null, + 'Argument for dev.flutter.pigeon.interactive_media_ads.IMACompanionAd.pigeon_newInstance was null, expected non-null int.'); + final int? arg_height = (args[4] as int?); + assert(arg_height != null, + 'Argument for dev.flutter.pigeon.interactive_media_ads.IMACompanionAd.pigeon_newInstance was null, expected non-null int.'); + try { + (pigeon_instanceManager ?? PigeonInstanceManager.instance) + .addHostCreatedInstance( + pigeon_newInstance?.call(arg_resourceValue, arg_apiFramework, + arg_width!, arg_height!) ?? + IMACompanionAd.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + resourceValue: arg_resourceValue, + apiFramework: arg_apiFramework, + width: arg_width!, + height: arg_height!, + ), + arg_pigeon_instanceIdentifier!, + ); + return wrapResponse(empty: true); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } + }); + } + } + } + + @override + IMACompanionAd pigeon_copy() { + return IMACompanionAd.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + resourceValue: resourceValue, + apiFramework: apiFramework, + width: width, + height: height, + ); + } +} diff --git a/packages/interactive_media_ads/lib/src/ios/interactive_media_ads_proxy.dart b/packages/interactive_media_ads/lib/src/ios/interactive_media_ads_proxy.dart index 29600d0b617c..664578c3f682 100644 --- a/packages/interactive_media_ads/lib/src/ios/interactive_media_ads_proxy.dart +++ b/packages/interactive_media_ads/lib/src/ios/interactive_media_ads_proxy.dart @@ -15,11 +15,13 @@ class InteractiveMediaAdsProxy { const InteractiveMediaAdsProxy({ this.newIMAAdDisplayContainer = IMAAdDisplayContainer.new, this.newUIViewController = UIViewController.new, + this.newIMAContentPlayhead = IMAContentPlayhead.new, this.newIMAAdsLoader = IMAAdsLoader.new, this.newIMAAdsRequest = IMAAdsRequest.new, this.newIMAAdsLoaderDelegate = IMAAdsLoaderDelegate.new, this.newIMAAdsManagerDelegate = IMAAdsManagerDelegate.new, this.newIMAAdsRenderingSettings = IMAAdsRenderingSettings.new, + this.newIMAFriendlyObstruction = IMAFriendlyObstruction.new, }); /// Constructs [IMAAdDisplayContainer]. @@ -33,6 +35,9 @@ class InteractiveMediaAdsProxy { void Function(UIViewController, bool)? viewDidAppear, }) newUIViewController; + /// Constructs [IMAContentPlayhead]. + final IMAContentPlayhead Function() newIMAContentPlayhead; + /// Constructs [IMAAdsLoader]. final IMAAdsLoader Function({IMASettings? settings}) newIMAAdsLoader; @@ -68,4 +73,11 @@ class InteractiveMediaAdsProxy { /// Constructs [IMAAdsRenderingSettings]. final IMAAdsRenderingSettings Function() newIMAAdsRenderingSettings; + + /// Constructs [IMAFriendlyObstruction]. + final IMAFriendlyObstruction Function({ + required UIView view, + required FriendlyObstructionPurpose purpose, + String? detailedReason, + }) newIMAFriendlyObstruction; } diff --git a/packages/interactive_media_ads/lib/src/ios/ios_ads_loader.dart b/packages/interactive_media_ads/lib/src/ios/ios_ads_loader.dart index d0f68646570d..606cfb6c835e 100644 --- a/packages/interactive_media_ads/lib/src/ios/ios_ads_loader.dart +++ b/packages/interactive_media_ads/lib/src/ios/ios_ads_loader.dart @@ -12,6 +12,7 @@ import 'interactive_media_ads.g.dart'; import 'interactive_media_ads_proxy.dart'; import 'ios_ad_display_container.dart'; import 'ios_ads_manager.dart'; +import 'ios_content_progress_provider.dart'; /// Implementation of [PlatformAdsLoaderCreationParams] for iOS. final class IOSAdsLoaderCreationParams extends PlatformAdsLoaderCreationParams { @@ -72,11 +73,15 @@ base class IOSAdsLoader extends PlatformAdsLoader { } @override - Future requestAds(AdsRequest request) async { + Future requestAds(PlatformAdsRequest request) async { return _adsLoader.requestAds(_iosParams._proxy.newIMAAdsRequest( adTagUrl: request.adTagUrl, adDisplayContainer: (_iosParams.container as IOSAdDisplayContainer).adDisplayContainer!, + contentPlayhead: request.contentProgressProvider != null + ? (request.contentProgressProvider! as IOSContentProgressProvider) + .contentPlayhead + : null, )); } diff --git a/packages/interactive_media_ads/lib/src/ios/ios_ads_manager.dart b/packages/interactive_media_ads/lib/src/ios/ios_ads_manager.dart index 595ccf573062..0c51bf926f14 100644 --- a/packages/interactive_media_ads/lib/src/ios/ios_ads_manager.dart +++ b/packages/interactive_media_ads/lib/src/ios/ios_ads_manager.dart @@ -48,4 +48,24 @@ class IOSAdsManager extends PlatformAdsManager { Future start(AdsManagerStartParams params) { return _manager.start(); } + + @override + Future discardAdBreak() { + return _manager.discardAdBreak(); + } + + @override + Future pause() { + return _manager.pause(); + } + + @override + Future resume() { + return _manager.resume(); + } + + @override + Future skip() { + return _manager.skip(); + } } diff --git a/packages/interactive_media_ads/lib/src/ios/ios_content_progress_provider.dart b/packages/interactive_media_ads/lib/src/ios/ios_content_progress_provider.dart new file mode 100644 index 000000000000..9b75466ae548 --- /dev/null +++ b/packages/interactive_media_ads/lib/src/ios/ios_content_progress_provider.dart @@ -0,0 +1,64 @@ +// 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:async'; + +import 'package:meta/meta.dart'; + +import '../platform_interface/platform_content_progress_provider.dart'; +import 'interactive_media_ads.g.dart' as ima; +import 'interactive_media_ads_proxy.dart'; + +/// Implementation of [PlatformContentProgressProviderCreationParams] for iOS. +final class IOSContentProgressProviderCreationParams + extends PlatformContentProgressProviderCreationParams { + /// Constructs an [IOSContentProgressProviderCreationParams]. + const IOSContentProgressProviderCreationParams({ + @visibleForTesting InteractiveMediaAdsProxy? proxy, + }) : _proxy = proxy ?? const InteractiveMediaAdsProxy(), + super(); + + /// Creates a [IOSContentProgressProviderCreationParams] from an instance of + /// [PlatformContentProgressProviderCreationParams]. + factory IOSContentProgressProviderCreationParams.fromPlatformContentProgressProviderCreationParams( + // Placeholder to prevent requiring a breaking change if params are added to + // PlatformContentProgressProviderCreationParams. + // ignore: avoid_unused_constructor_parameters + PlatformContentProgressProviderCreationParams params, { + @visibleForTesting InteractiveMediaAdsProxy? proxy, + }) { + return IOSContentProgressProviderCreationParams(proxy: proxy); + } + + final InteractiveMediaAdsProxy _proxy; +} + +/// Implementation of [PlatformContentProgressProvider] for iOS. +base class IOSContentProgressProvider extends PlatformContentProgressProvider { + /// Constructs an [IOSContentProgressProvider]. + IOSContentProgressProvider(super.params) : super.implementation(); + + /// The native iOS IMAContentPlayhead. + /// + /// This allows the SDK to track progress of the content video. + @internal + late final ima.IMAContentPlayhead contentPlayhead = + _iosParams._proxy.newIMAContentPlayhead(); + + late final IOSContentProgressProviderCreationParams _iosParams = + params is IOSContentProgressProviderCreationParams + ? params as IOSContentProgressProviderCreationParams + : IOSContentProgressProviderCreationParams + .fromPlatformContentProgressProviderCreationParams( + params, + ); + + @override + Future setProgress({ + required Duration progress, + required Duration duration, + }) async { + return contentPlayhead.setCurrentTime(progress.inSeconds.toDouble()); + } +} diff --git a/packages/interactive_media_ads/lib/src/ios/ios_interactive_media_ads.dart b/packages/interactive_media_ads/lib/src/ios/ios_interactive_media_ads.dart index 013f66451eb0..ee55ecce0c98 100644 --- a/packages/interactive_media_ads/lib/src/ios/ios_interactive_media_ads.dart +++ b/packages/interactive_media_ads/lib/src/ios/ios_interactive_media_ads.dart @@ -6,9 +6,11 @@ import '../platform_interface/interactive_media_ads_platform.dart'; import '../platform_interface/platform_ad_display_container.dart'; import '../platform_interface/platform_ads_loader.dart'; import '../platform_interface/platform_ads_manager_delegate.dart'; +import '../platform_interface/platform_content_progress_provider.dart'; import 'ios_ad_display_container.dart'; import 'ios_ads_loader.dart'; import 'ios_ads_manager_delegate.dart'; +import 'ios_content_progress_provider.dart'; /// Implementation of [InteractiveMediaAdsPlatform] for iOS. final class IOSInteractiveMediaAds extends InteractiveMediaAdsPlatform { @@ -35,4 +37,11 @@ final class IOSInteractiveMediaAds extends InteractiveMediaAdsPlatform { ) { return IOSAdsManagerDelegate(params); } + + @override + IOSContentProgressProvider createPlatformContentProgressProvider( + PlatformContentProgressProviderCreationParams params, + ) { + return IOSContentProgressProvider(params); + } } diff --git a/packages/interactive_media_ads/lib/src/platform_interface/ads_request.dart b/packages/interactive_media_ads/lib/src/platform_interface/ads_request.dart deleted file mode 100644 index 72e4dfc69b63..000000000000 --- a/packages/interactive_media_ads/lib/src/platform_interface/ads_request.dart +++ /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. - -/// An object containing the data used to request ads from the server. -class AdsRequest { - /// Creates an [AdsRequest]. - AdsRequest({required this.adTagUrl}); - - /// The URL from which ads will be requested. - final String adTagUrl; -} diff --git a/packages/interactive_media_ads/lib/src/platform_interface/interactive_media_ads_platform.dart b/packages/interactive_media_ads/lib/src/platform_interface/interactive_media_ads_platform.dart index f1dac2db7d1d..fdb8593bdcb4 100644 --- a/packages/interactive_media_ads/lib/src/platform_interface/interactive_media_ads_platform.dart +++ b/packages/interactive_media_ads/lib/src/platform_interface/interactive_media_ads_platform.dart @@ -5,6 +5,7 @@ import 'platform_ad_display_container.dart'; import 'platform_ads_loader.dart'; import 'platform_ads_manager_delegate.dart'; +import 'platform_content_progress_provider.dart'; /// Interface for a platform implementation of the Interactive Media Ads SDKs. abstract base class InteractiveMediaAdsPlatform { @@ -29,4 +30,9 @@ abstract base class InteractiveMediaAdsPlatform { PlatformAdDisplayContainer createPlatformAdDisplayContainer( PlatformAdDisplayContainerCreationParams params, ); + + /// Creates a new [PlatformContentProgressProvider]. + PlatformContentProgressProvider createPlatformContentProgressProvider( + PlatformContentProgressProviderCreationParams params, + ); } diff --git a/packages/interactive_media_ads/lib/src/platform_interface/platform_ads_loader.dart b/packages/interactive_media_ads/lib/src/platform_interface/platform_ads_loader.dart index 7dc6a57a1d22..51ed2a64e686 100644 --- a/packages/interactive_media_ads/lib/src/platform_interface/platform_ads_loader.dart +++ b/packages/interactive_media_ads/lib/src/platform_interface/platform_ads_loader.dart @@ -5,10 +5,10 @@ import 'package:flutter/foundation.dart'; import 'ad_error.dart'; -import 'ads_request.dart'; import 'interactive_media_ads_platform.dart'; import 'platform_ad_display_container.dart'; import 'platform_ads_manager.dart'; +import 'platform_ads_request.dart'; /// Object specifying creation parameters for creating a [PlatformAdsLoader]. /// @@ -94,7 +94,7 @@ abstract base class PlatformAdsLoader { Future contentComplete(); /// Requests ads from a server. - Future requestAds(AdsRequest request); + Future requestAds(PlatformAdsRequest request); } /// Data when ads are successfully loaded from the ad server through an diff --git a/packages/interactive_media_ads/lib/src/platform_interface/platform_ads_manager.dart b/packages/interactive_media_ads/lib/src/platform_interface/platform_ads_manager.dart index 85488aaa2512..0f3d7a7ea46f 100644 --- a/packages/interactive_media_ads/lib/src/platform_interface/platform_ads_manager.dart +++ b/packages/interactive_media_ads/lib/src/platform_interface/platform_ads_manager.dart @@ -28,6 +28,22 @@ abstract class PlatformAdsManager { /// /// The [AdsManagerDelegate] to notify with events during ad playback. Future setAdsManagerDelegate(PlatformAdsManagerDelegate delegate); + /// Pauses the current ad. + Future pause(); + + /// Resumes the current ad. + Future resume(); + + /// Skips the current ad. + /// + /// This only skips ads if IMA does not render the 'Skip ad' button. + Future skip(); + + /// Discards current ad break and resumes content. + /// + /// If there is no current ad then the next ad break is discarded. + Future discardAdBreak(); + /// Stops the ad and all tracking, then releases all assets that were loaded /// to play the ad. Future destroy(); diff --git a/packages/interactive_media_ads/lib/src/platform_interface/platform_ads_request.dart b/packages/interactive_media_ads/lib/src/platform_interface/platform_ads_request.dart new file mode 100644 index 000000000000..b9ef51b0ec8c --- /dev/null +++ b/packages/interactive_media_ads/lib/src/platform_interface/platform_ads_request.dart @@ -0,0 +1,21 @@ +// 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 'platform_content_progress_provider.dart'; + +/// An object containing the data used to request ads from the server. +class PlatformAdsRequest { + /// Creates an [PlatformAdsRequest]. + PlatformAdsRequest({ + required this.adTagUrl, + this.contentProgressProvider, + }); + + /// The URL from which ads will be requested. + final String adTagUrl; + + /// A [PlatformContentProgressProvider] instance to allow scheduling of ad + /// breaks based on content progress (cue points). + final PlatformContentProgressProvider? contentProgressProvider; +} diff --git a/packages/interactive_media_ads/lib/src/platform_interface/platform_content_progress_provider.dart b/packages/interactive_media_ads/lib/src/platform_interface/platform_content_progress_provider.dart new file mode 100644 index 000000000000..fb5c54a563ea --- /dev/null +++ b/packages/interactive_media_ads/lib/src/platform_interface/platform_content_progress_provider.dart @@ -0,0 +1,86 @@ +// 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'; + +import 'interactive_media_ads_platform.dart'; + +/// Object specifying creation parameters for creating a +/// [PlatformContentProgressProvider]. +/// +/// Platform specific implementations can add additional fields by extending +/// this class. +/// +/// This example demonstrates how to extend the +/// [PlatformContentProgressProviderCreationParams] to provide additional +/// platform specific parameters. +/// +/// When extending [PlatformContentProgressProviderCreationParams] additional +/// parameters should always accept `null` or have a default value to prevent +/// breaking changes. +/// +/// ```dart +/// class AndroidPlatformContentProgressProviderCreationParams +/// extends PlatformContentProgressProviderCreationParams { +/// AndroidPlatformContentProgressProviderCreationParams._( +/// PlatformContentProgressProviderCreationParams params, { +/// this.uri, +/// }) : super(); +/// +/// factory AndroidPlatformContentProgressProviderCreationParams.fromPlatformContentProgressProviderCreationParams( +/// PlatformContentProgressProviderCreationParams params, { +/// Uri? uri, +/// }) { +/// return AndroidPlatformContentProgressProviderCreationParams._(params, uri: uri); +/// } +/// +/// final Uri? uri; +/// } +/// ``` +@immutable +base class PlatformContentProgressProviderCreationParams { + /// Used by the platform implementation to create a new + /// [PlatformContentProgressProvider]. + const PlatformContentProgressProviderCreationParams(); +} + +/// Interface to allow the SDK to track progress of the content video. +/// +/// Provides updates required to enable triggering ads at configured cue points. +abstract class PlatformContentProgressProvider { + /// Creates a new [PlatformAdsManagerDelegate] + factory PlatformContentProgressProvider( + PlatformContentProgressProviderCreationParams params, + ) { + assert( + InteractiveMediaAdsPlatform.instance != null, + 'A platform implementation for `interactive_media_ads` has not been set. ' + 'Please ensure that an implementation of `InteractiveMediaAdsPlatform` ' + 'has been set to `InteractiveMediaAdsPlatform.instance` before use. For ' + 'unit testing, `InteractiveMediaAdsPlatform.instance` can be set with ' + 'your own test implementation.', + ); + final PlatformContentProgressProvider implementation = + InteractiveMediaAdsPlatform.instance! + .createPlatformContentProgressProvider(params); + return implementation; + } + + /// Used by the platform implementation to create a new + /// [PlatformContentProgressProvider]. + /// + /// Should only be used by platform implementations because they can't extend + /// a class that only contains a factory constructor. + @protected + PlatformContentProgressProvider.implementation(this.params); + + /// The parameters used to initialize the [PlatformContentProgressProvider]. + final PlatformContentProgressProviderCreationParams params; + + /// Sends an update on the progress of the content video. + Future setProgress({ + required Duration progress, + required Duration duration, + }); +} diff --git a/packages/interactive_media_ads/lib/src/platform_interface/platform_interface.dart b/packages/interactive_media_ads/lib/src/platform_interface/platform_interface.dart index ad8896480443..fad06fe592f5 100644 --- a/packages/interactive_media_ads/lib/src/platform_interface/platform_interface.dart +++ b/packages/interactive_media_ads/lib/src/platform_interface/platform_interface.dart @@ -4,9 +4,10 @@ export 'ad_error.dart'; export 'ad_event.dart'; -export 'ads_request.dart'; export 'interactive_media_ads_platform.dart'; export 'platform_ad_display_container.dart'; export 'platform_ads_loader.dart'; export 'platform_ads_manager.dart'; export 'platform_ads_manager_delegate.dart'; +export 'platform_ads_request.dart'; +export 'platform_content_progress_provider.dart'; diff --git a/packages/interactive_media_ads/pigeons/interactive_media_ads_android.dart b/packages/interactive_media_ads/pigeons/interactive_media_ads_android.dart index 0dc2201399f2..0d3aa77b5342 100644 --- a/packages/interactive_media_ads/pigeons/interactive_media_ads_android.dart +++ b/packages/interactive_media_ads/pigeons/interactive_media_ads_android.dart @@ -2,11 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// TODO(bparrishMines): Uncomment this file once -// https://github.com/flutter/packages/pull/6371 lands. This file uses the -// Kotlin ProxyApi feature from pigeon. // ignore_for_file: avoid_unused_constructor_parameters -/* + import 'package:pigeon/pigeon.dart'; @ConfigurePigeon( @@ -210,6 +207,20 @@ enum AdEventType { unknown, } +/// Describes an element of the ad UI, to be requested or rendered by the SDK. +/// +/// See https://developers.google.com/interactive-media-ads/docs/sdks/android/client-side/api/reference/com/google/ads/interactivemedia/v3/api/UiElement.html. +enum UiElement { + /// The ad attribution UI element, for example, "Ad". + adAttribution, + + /// Ad attribution is required for a countdown timer to be displayed. + countdown, + + /// The element is not recognized by this wrapper. + unknown, +} + /// A base class for more specialized container interfaces. /// /// See https://developers.google.com/interactive-media-ads/docs/sdks/android/client-side/api/reference/com/google/ads/interactivemedia/v3/api/BaseDisplayContainer.html. @@ -327,7 +338,15 @@ abstract class AdsRequest { 'com.google.ads.interactivemedia.v3.api.player.ContentProgressProvider', ), ) -abstract class ContentProgressProvider {} +abstract class ContentProgressProvider { + ContentProgressProvider(); + + /// Sets an update on the progress of the video. + /// + /// This is a custom method added to the native class because the native + /// method `getContentProgress` requires a synchronous return value. + void setContentProgress(VideoProgressUpdate update); +} /// An object which handles playing ads after they've been received from the /// server. @@ -347,6 +366,20 @@ abstract class AdsManager extends BaseManager { /// Starts playing the ads. void start(); + + /// List of content time offsets in seconds at which ad breaks are scheduled. + /// + /// The list will be empty if no ad breaks are scheduled. + List getAdCuePoints(); + + /// Resumes the current ad. + void resume(); + + /// Skips the current ad. + /// + /// `AdsManager.skip()` only skips ads if IMA does not render the 'Skip ad' + /// button. + void skip(); } /// Base interface for managing ads.. @@ -523,7 +556,13 @@ abstract class FrameLayout extends ViewGroup { ), ) abstract class ViewGroup extends View { + /// Adds a child view. void addView(View view); + + /// Called by a ViewGroup subclass to remove child views from itself, when it + /// must first know its size on screen before it can calculate how many child + /// views it will render. + void removeView(View view); } /// Displays a video file. @@ -548,7 +587,7 @@ abstract class VideoView extends View { late final void Function(MediaPlayer player, int what, int extra) onError; /// Sets the URI of the video. - void setVideoUri(String uri); + void setVideoUri(String? uri); /// The current position of the playing video. /// @@ -724,4 +763,251 @@ abstract class AdEventListener { /// Respond to an occurrence of an AdEvent. late final void Function(AdEvent event) onAdEvent; } -*/ + +/// Defines parameters that control the rendering of ads. +/// +/// See https://developers.google.com/interactive-media-ads/docs/sdks/android/client-side/api/reference/com/google/ads/interactivemedia/v3/api/AdsRenderingSettings.html. +@ProxyApi( + kotlinOptions: KotlinProxyApiOptions( + fullClassName: + 'com.google.ads.interactivemedia.v3.api.AdsRenderingSettings', + ), +) +abstract class AdsRenderingSettings { + /// Maximum recommended bitrate. + int getBitrateKbps(); + + /// Returns whether the click-through URL will be opened using Custom Tabs + /// feature. + bool getEnableCustomTabs(); + + /// Whether the SDK will instruct the player to load the creative in response + /// to `BaseManager.init()`. + bool getEnablePreloading(); + + /// Whether to focus on the skip button when the skippable ad can be skipped + /// on Android TV. + /// + /// This is a no-op on non-Android TV devices. + bool getFocusSkipButtonWhenAvailable(); + + /// The SDK will prioritize the media with MIME type on the list. + List getMimeTypes(); + + /// Maximum recommended bitrate. + /// + /// The value is in kbit/s. Default value, -1, means the bitrate will be + /// selected by the SDK. + void setBitrateKbps(int bitrate); + + /// Notifies the SDK whether to launch the click-through URL using Custom Tabs + /// feature. + /// + /// Default is false. + void setEnableCustomTabs(bool enableCustomTabs); + + /// If set, the SDK will instruct the player to load the creative in response + /// to `BaseManager.init()`. + /// + /// This allows the player to preload the ad at any point before calling + /// `AdsManager.start()`. + void setEnablePreloading(bool enablePreloading); + + /// Set whether to focus on the skip button when the skippable ad can be + /// skipped on Android TV. + /// + /// This is a no-op on non-Android TV devices. + /// + /// Default is true. + void setFocusSkipButtonWhenAvailable(bool enableFocusSkipButton); + + /// Specifies a non-default amount of time to wait for media to load before + /// timing out, in milliseconds. + /// + /// This only applies to the IMA client-side SDK. + /// + /// Default time is 8000 ms. + void setLoadVideoTimeout(int loadVideoTimeout); + + /// If specified, the SDK will prioritize the media with MIME type on the + /// list. + void setMimeTypes(List mimeTypes); + + /// For VMAP and ad rules playlists, only play ad breaks scheduled after this + /// time (in seconds). + void setPlayAdsAfterTime(double time); + + /// Sets the ad UI elements to be rendered by the IMA SDK. + void setUiElements(List uiElements); +} + +/// Represents the progress within this ad break. +/// +/// See https://developers.google.com/interactive-media-ads/docs/sdks/android/client-side/api/reference/com/google/ads/interactivemedia/v3/api/AdProgressInfo.html. +@ProxyApi( + kotlinOptions: KotlinProxyApiOptions( + fullClassName: 'com.google.ads.interactivemedia.v3.api.AdProgressInfo', + ), +) +abstract class AdProgressInfo { + /// Total ad break duration (in seconds). + late final double adBreakDuration; + + /// Total ad period duration (in seconds). + late final double adPeriodDuration; + + /// The position of current ad within the ad break, starting with 1. + late final int adPosition; + + /// Current time within the ad (in seconds). + late final double currentTime; + + /// Duration of current ad (in seconds). + late final double duration; + + /// The total number of ads in this ad break. + late final int totalAds; +} + +/// An object that holds data corresponding to the companion Ad. +/// +/// See https://developers.google.com/interactive-media-ads/docs/sdks/android/client-side/api/reference/com/google/ads/interactivemedia/v3/api/CompanionAd.html. +@ProxyApi( + kotlinOptions: KotlinProxyApiOptions( + fullClassName: 'com.google.ads.interactivemedia.v3.api.CompanionAd', + ), +) +abstract class CompanionAd { + /// The API needed to execute this ad, or null if unavailable. + late final String? apiFramework; + + /// The height of the companion in pixels. + /// + /// 0 if unavailable. + late final int height; + + /// The URL for the static resource of this companion. + late final String resourceValue; + + /// The width of the companion in pixels. + /// + /// 0 if unavailable. + late final int width; +} + +/// This object exposes information about the universal ad ID. +/// +/// See https://developers.google.com/interactive-media-ads/docs/sdks/android/client-side/api/reference/com/google/ads/interactivemedia/v3/api/UniversalAdId.html. +@ProxyApi( + kotlinOptions: KotlinProxyApiOptions( + fullClassName: 'com.google.ads.interactivemedia.v3.api.UniversalAdId', + ), +) +abstract class UniversalAdId { + /// Returns the ad ID registry associated with the ad ID value. + /// + /// Returns "unknown" if the registry is not known. + late final String adIdRegistry; + + /// Returns the universal ad ID value. + /// + /// Returns "unknown" if the value is not known. + late final String adIdValue; +} + +/// An object that holds data corresponding to the main Ad. +/// +/// See https://developers.google.com/interactive-media-ads/docs/sdks/android/client-side/api/reference/com/google/ads/interactivemedia/v3/api/Ad.html. +@ProxyApi( + kotlinOptions: KotlinProxyApiOptions( + fullClassName: 'com.google.ads.interactivemedia.v3.api.Ad', + ), +) +abstract class Ad { + /// The ad ID as specified in the VAST response. + late final String adId; + + /// The pod metadata object. + late final AdPodInfo adPodInfo; + + /// The ad system as specified in the VAST response. + late final String adSystem; + + /// The IDs of the ads' creatives, starting with the first wrapper ad. + late final List adWrapperCreativeIds; + + /// The wrapper ad IDs as specified in the VAST response. + late final List adWrapperIds; + + /// The wrapper ad systems as specified in the VAST response. + late final List adWrapperSystems; + + /// The advertiser name as defined by the serving party. + late final String advertiserName; + + /// The companions for the current ad while using DAI. + /// + /// Returns an empty list in any other scenario. + late final List companionAds; + + /// The content type of the currently selected creative, or null if no + /// creative is selected or the content type is unavailable. + late final String? contentType; + + /// The ISCI (Industry Standard Commercial Identifier) code for an ad. + late final String creativeAdId; + + /// The ID of the selected creative for the ad, + late final String creativeId; + + /// The first deal ID present in the wrapper chain for the current ad, + /// starting from the top. + late final String dealId; + + /// The description of this ad from the VAST response. + late final String? description; + + /// The duration of the ad in seconds, -1 if not available. + late final double duration; + + /// The height of the selected creative if non-linear, else returns 0. + late final int height; + + /// The number of seconds of playback before the ad becomes skippable. + late final double skipTimeOffset; + + /// The URL associated with the survey for the given ad. + late final String? surveyUrl; + + /// The title of this ad from the VAST response. + late final String? title; + + /// The custom parameters associated with the ad at the time of ad + /// trafficking. + late final String traffickingParameters; + + /// Te set of ad UI elements rendered by the IMA SDK for this ad. + late final List uiElements; + + /// The list of all universal ad IDs for this ad. + late final List universalAdIds; + + /// The VAST bitrate in Kbps of the selected creative. + late final int vastMediaBitrate; + + /// The VAST media height in pixels of the selected creative. + late final int vastMediaHeight; + + /// The VAST media width in pixels of the selected creative. + late final int vastMediaWidth; + + /// The width of the selected creative if non-linear, else returns 0. + late final int width; + + /// Indicates whether the ad’s current mode of operation is linear or + /// non-linear. + late final bool isLinear; + + /// Indicates whether the ad can be skipped by the user. + late final bool isSkippable; +} diff --git a/packages/interactive_media_ads/pigeons/interactive_media_ads_ios.dart b/packages/interactive_media_ads/pigeons/interactive_media_ads_ios.dart index 17046ad0b3a2..ff34c8ed01b8 100644 --- a/packages/interactive_media_ads/pigeons/interactive_media_ads_ios.dart +++ b/packages/interactive_media_ads/pigeons/interactive_media_ads_ios.dart @@ -2,12 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// TODO(bparrishMines): Uncomment this file once -// https://github.com/flutter/packages/pull/6602 lands. This file uses the -// Swift ProxyApi feature from pigeon. // ignore_for_file: avoid_unused_constructor_parameters -/* import 'package:pigeon/pigeon.dart'; @ConfigurePigeon( @@ -275,6 +271,36 @@ enum KeyValueChangeKey { unknown, } +/// A list of purposes for which an obstruction would be registered as friendly. +/// +/// See https://developers.google.com/ad-manager/dynamic-ad-insertion/sdk/ios/reference/Enums/IMAFriendlyObstructionPurpose.html. +enum FriendlyObstructionPurpose { + mediaControls, + + closeAd, + + notVisible, + + other, + + /// The purpose type is not recognized by this wrapper. + unknown, +} + +/// Different UI elements that can be customized. +/// +/// See https://developers.google.com/ad-manager/dynamic-ad-insertion/sdk/ios/reference/Enums/IMAUiElementType.html. +enum UIElementType { + /// Ad attribution UI element. + adAttribution, + + /// Ad countdown element. + countdown, + + /// The element is not recognized by this wrapper. + unknown, +} + /// The `IMAAdDisplayContainer` is responsible for managing the ad container /// view and companion ad slots used for ad playback. /// @@ -499,6 +525,35 @@ abstract class IMAAdEvent extends NSObject { @ProxyApi() abstract class IMAAdsRenderingSettings extends NSObject { IMAAdsRenderingSettings(); + + /// If specified, the SDK will play the media with MIME type on the list. + void setMimeTypes(List? types); + + /// Maximum recommended bitrate. + /// + /// The value is in kbit/s. + void setBitrate(int bitrate); + + /// Timeout (in seconds) when loading a video ad media file. + /// + /// Use -1 for the default of 8 seconds. + void setLoadVideoTimeout(double seconds); + + /// For VMAP and ad rules playlists, only play ad breaks scheduled after this + /// time (in seconds). + void setPlayAdsAfterTime(double seconds); + + /// Specifies the list of UI elements that should be visible. + void setUIElements(List? types); + + /// Whether or not the SDK will preload ad media. + /// + /// Default is YES. + void setEnablePreloading(bool enable); + + /// Specifies the optional UIViewController that will be used to open links + /// in-app. + void setLinkOpenerPresentingController(UIViewController controller); } /// The root class of most Objective-C class hierarchies, from which subclasses @@ -508,4 +563,48 @@ abstract class IMAAdsRenderingSettings extends NSObject { /// See https://developer.apple.com/documentation/objectivec/nsobject. @ProxyApi() abstract class NSObject {} -*/ + +/// An obstruction that is marked as “friendly” for viewability measurement +/// purposes. +/// +/// See https://developers.google.com/ad-manager/dynamic-ad-insertion/sdk/ios/reference/Classes/IMAFriendlyObstruction.html. +@ProxyApi() +abstract class IMAFriendlyObstruction extends NSObject { + /// Initializes a friendly obstruction. + IMAFriendlyObstruction(); + + /// The view causing the obstruction. + late final UIView view; + + /// The purpose for registering the obstruction as friendly. + late final FriendlyObstructionPurpose purpose; + + /// Optional, detailed reasoning for registering this obstruction as friendly. + /// + /// If the detailedReason is not null, it must follow the IAB standard by + /// being 50 characters or less and only containing characters A-z, 0-9, or + /// spaces. + late final String? detailedReason; +} + +/// An object that holds data corresponding to the companion ad. +/// +/// See https://developers.google.com/interactive-media-ads/docs/sdks/ios/client-side/reference/Classes/IMACompanionAd. +@ProxyApi() +abstract class IMACompanionAd extends NSObject { + /// The value for the resource of this companion. + late final String? resourceValue; + + /// The API needed to execute this ad, or nil if unavailable. + late final String? apiFramework; + + /// The width of the companion in pixels. + /// + /// 0 if unavailable. + late final int width; + + /// The height of the companion in pixels. + /// + /// 0 if unavailable. + late final int height; +} diff --git a/packages/interactive_media_ads/pubspec.yaml b/packages/interactive_media_ads/pubspec.yaml index a2d935ccb725..d3101f0322d7 100644 --- a/packages/interactive_media_ads/pubspec.yaml +++ b/packages/interactive_media_ads/pubspec.yaml @@ -2,13 +2,13 @@ name: interactive_media_ads description: A Flutter plugin for using the Interactive Media Ads SDKs on Android and iOS. repository: https://github.com/flutter/packages/tree/main/packages/interactive_media_ads issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+interactive_media_ads%22 -version: 0.1.2 # This must match the version in +version: 0.2.2+13 # This must match the version in # `android/src/main/kotlin/dev/flutter/packages/interactive_media_ads/AdsRequestProxyApi.kt` and # `ios/interactive_media_ads/Sources/interactive_media_ads/AdsRequestProxyAPIDelegate.swift` environment: - sdk: ^3.3.0 - flutter: ">=3.19.0" + sdk: ^3.5.0 + flutter: ">=3.24.0" flutter: plugin: @@ -30,7 +30,8 @@ dev_dependencies: build_runner: ^2.1.4 flutter_test: sdk: flutter - mockito: 5.4.4 + mockito: ^5.4.4 + pigeon: ^22.5.0 topics: - ads diff --git a/packages/interactive_media_ads/test/ad_display_container_test.dart b/packages/interactive_media_ads/test/ad_display_container_test.dart index a82a16e8c4c2..c237424a806c 100644 --- a/packages/interactive_media_ads/test/ad_display_container_test.dart +++ b/packages/interactive_media_ads/test/ad_display_container_test.dart @@ -45,6 +45,8 @@ void main() { PlatformAdsManagerDelegateCreationParams params, ) { throw UnimplementedError(); + }, onCreatePlatformContentProgressProvider: (_) { + throw UnimplementedError(); }); final AdDisplayContainer adDisplayContainer = AdDisplayContainer( diff --git a/packages/interactive_media_ads/test/ads_loader_test.dart b/packages/interactive_media_ads/test/ads_loader_test.dart index 424c86ccc1d5..c571830fc4f3 100644 --- a/packages/interactive_media_ads/test/ads_loader_test.dart +++ b/packages/interactive_media_ads/test/ads_loader_test.dart @@ -18,7 +18,7 @@ void main() { onAdsLoadError: (AdsLoadErrorData data) {}, ), onContentComplete: expectAsync0(() async {}), - onRequestAds: (AdsRequest request) async {}, + onRequestAds: (PlatformAdsRequest request) async {}, ); final AdsLoader loader = AdsLoader.fromPlatform(adsLoader); @@ -26,18 +26,27 @@ void main() { }); test('requestAds', () async { + final PlatformAdsRequest platformRequest = PlatformAdsRequest( + adTagUrl: 'adTagUrl', + contentProgressProvider: TestContentProgressProvider( + const PlatformContentProgressProviderCreationParams(), + ), + ); + final TestPlatformAdsLoader adsLoader = TestPlatformAdsLoader( PlatformAdsLoaderCreationParams( container: createTestAdDisplayContainer(), onAdsLoaded: (PlatformOnAdsLoadedData data) {}, onAdsLoadError: (AdsLoadErrorData data) {}, ), - onRequestAds: expectAsync1((AdsRequest request) async {}), + onRequestAds: expectAsync1((PlatformAdsRequest request) async { + expect(request, platformRequest); + }), onContentComplete: () async {}, ); final AdsLoader loader = AdsLoader.fromPlatform(adsLoader); - await loader.requestAds(AdsRequest(adTagUrl: '')); + await loader.requestAds(AdsRequest.fromPlatform(platformRequest)); }); } diff --git a/packages/interactive_media_ads/test/ads_manager_delegate_test.dart b/packages/interactive_media_ads/test/ads_manager_delegate_test.dart index ba6801dc41f3..a0d519864c43 100644 --- a/packages/interactive_media_ads/test/ads_manager_delegate_test.dart +++ b/packages/interactive_media_ads/test/ads_manager_delegate_test.dart @@ -22,6 +22,8 @@ void main() { (PlatformAdDisplayContainerCreationParams params) { throw UnimplementedError(); }, + onCreatePlatformContentProgressProvider: (_) => + throw UnimplementedError(), ); void onAdEvent(AdEvent event) {} diff --git a/packages/interactive_media_ads/test/ads_manager_test.dart b/packages/interactive_media_ads/test/ads_manager_test.dart index cb5f42ccb3f6..f27f37aa82c1 100644 --- a/packages/interactive_media_ads/test/ads_manager_test.dart +++ b/packages/interactive_media_ads/test/ads_manager_test.dart @@ -41,6 +41,42 @@ void main() { )); }); + test('discardAdBreak', () async { + final TestAdsManager platformManager = TestAdsManager( + onDiscardAdBreak: expectAsync0(() async {}), + ); + + final AdsManager manager = createAdsManager(platformManager); + await manager.discardAdBreak(); + }); + + test('pause', () async { + final TestAdsManager platformManager = TestAdsManager( + onPause: expectAsync0(() async {}), + ); + + final AdsManager manager = createAdsManager(platformManager); + await manager.pause(); + }); + + test('resume', () async { + final TestAdsManager platformManager = TestAdsManager( + onResume: expectAsync0(() async {}), + ); + + final AdsManager manager = createAdsManager(platformManager); + await manager.resume(); + }); + + test('skip', () async { + final TestAdsManager platformManager = TestAdsManager( + onSkip: expectAsync0(() async {}), + ); + + final AdsManager manager = createAdsManager(platformManager); + await manager.skip(); + }); + test('destroy', () async { final TestAdsManager platformManager = TestAdsManager( onDestroy: expectAsync0(() async {}), @@ -56,7 +92,7 @@ AdsManager createAdsManager(PlatformAdsManager platformManager) { onCreatePlatformAdsLoader: (PlatformAdsLoaderCreationParams params) { return TestPlatformAdsLoader(params, onContentComplete: () async {}, - onRequestAds: (AdsRequest request) async {}); + onRequestAds: (PlatformAdsRequest request) async {}); }, onCreatePlatformAdsManagerDelegate: (PlatformAdsManagerDelegateCreationParams params) { @@ -66,6 +102,7 @@ AdsManager createAdsManager(PlatformAdsManager platformManager) { (PlatformAdDisplayContainerCreationParams params) { throw UnimplementedError(); }, + onCreatePlatformContentProgressProvider: (_) => throw UnimplementedError(), ); late final AdsManager manager; diff --git a/packages/interactive_media_ads/test/android/ad_display_container_test.dart b/packages/interactive_media_ads/test/android/ad_display_container_test.dart index 83694918bf3f..5578c338986a 100644 --- a/packages/interactive_media_ads/test/android/ad_display_container_test.dart +++ b/packages/interactive_media_ads/test/android/ad_display_container_test.dart @@ -464,6 +464,115 @@ void main() { verify(mockMediaPlayer.pause()); }); + test('ad does not play automatically after calling pause', () async { + late final void Function( + ima.VideoAdPlayer, + ima.AdMediaInfo, + ima.AdPodInfo, + ) loadAdCallback; + + late final Future Function( + ima.VideoView, + ima.MediaPlayer, + ) onPreparedCallback; + + late final Future Function( + ima.VideoAdPlayer, + ima.AdMediaInfo, + ) pauseAdCallback; + + late final void Function( + ima.VideoAdPlayer, + ima.AdMediaInfo, + ) playAdCallback; + + final InteractiveMediaAdsProxy imaProxy = InteractiveMediaAdsProxy( + newFrameLayout: () => MockFrameLayout(), + newVideoView: ({ + dynamic onError, + void Function( + ima.VideoView, + ima.MediaPlayer, + )? onPrepared, + dynamic onCompletion, + }) { + // VideoView.onPrepared returns void, but the implementation uses an + // async callback method. + onPreparedCallback = onPrepared! as Future Function( + ima.VideoView, + ima.MediaPlayer, + ); + final MockVideoView mockVideoView = MockVideoView(); + when(mockVideoView.getCurrentPosition()).thenAnswer((_) async => 10); + return mockVideoView; + }, + createAdDisplayContainerImaSdkFactory: (_, __) async { + return MockAdDisplayContainer(); + }, + newVideoAdPlayer: ({ + required dynamic addCallback, + required void Function( + ima.VideoAdPlayer, + ima.AdMediaInfo, + ima.AdPodInfo, + ) loadAd, + required dynamic pauseAd, + required void Function( + ima.VideoAdPlayer, + ima.AdMediaInfo, + ) playAd, + required dynamic release, + required dynamic removeCallback, + required dynamic stopAd, + }) { + loadAdCallback = loadAd; + // VideoAdPlayer.pauseAd returns void, but the implementation uses an + // async callback method. + pauseAdCallback = pauseAd as Future Function( + ima.VideoAdPlayer, + ima.AdMediaInfo, + ); + playAdCallback = playAd; + return MockVideoAdPlayer(); + }, + newVideoProgressUpdate: ({ + required int currentTimeMs, + required int durationMs, + }) { + return MockVideoProgressUpdate(); + }, + ); + + AndroidAdDisplayContainer( + AndroidAdDisplayContainerCreationParams( + onContainerAdded: (_) {}, + imaProxy: imaProxy, + ), + ); + + final ima.AdMediaInfo mockAdMediaInfo = MockAdMediaInfo(); + when(mockAdMediaInfo.url).thenReturn('url'); + loadAdCallback(MockVideoAdPlayer(), mockAdMediaInfo, MockAdPodInfo()); + + final MockMediaPlayer mockMediaPlayer = MockMediaPlayer(); + when(mockMediaPlayer.getDuration()).thenAnswer((_) async => 100); + + await onPreparedCallback(MockVideoView(), mockMediaPlayer); + + // Pausing the ad prevents Ad from starting again automatically when it is + // prepared. + await pauseAdCallback(MockVideoAdPlayer(), mockAdMediaInfo); + reset(mockMediaPlayer); + await onPreparedCallback(MockVideoView(), mockMediaPlayer); + verifyNever(mockMediaPlayer.start()); + + // The playAd callback allows the Ad to start automatically once it is + // prepared. + playAdCallback(MockVideoAdPlayer(), mockAdMediaInfo); + await onPreparedCallback(MockVideoView(), mockMediaPlayer); + verify(mockMediaPlayer.start()); + }); + test('play ad', () async { late final void Function( ima.VideoAdPlayer, @@ -514,5 +623,63 @@ void main() { verify(mockVideoView.setVideoUri(videoUrl)); }); + + test('stop ad creates and sets a new VideoView', () async { + late final void Function( + ima.VideoAdPlayer, + ima.AdMediaInfo, + ) stopAdCallback; + + final MockFrameLayout mockFrameLayout = MockFrameLayout(); + late final MockVideoView mockVideoView = MockVideoView(); + late final MockVideoView mockVideoView2 = MockVideoView(); + int newViewVideoCallCount = 0; + final InteractiveMediaAdsProxy imaProxy = InteractiveMediaAdsProxy( + newFrameLayout: () => mockFrameLayout, + newVideoView: ({ + dynamic onError, + dynamic onPrepared, + dynamic onCompletion, + }) { + switch (newViewVideoCallCount) { + case 0: + newViewVideoCallCount++; + return mockVideoView; + case 1: + newViewVideoCallCount++; + return mockVideoView2; + default: + fail('newVideoView was called too many times'); + } + }, + createAdDisplayContainerImaSdkFactory: (_, __) async { + return MockAdDisplayContainer(); + }, + newVideoAdPlayer: ({ + required dynamic addCallback, + required dynamic loadAd, + required dynamic pauseAd, + required dynamic playAd, + required dynamic release, + required dynamic removeCallback, + required void Function(ima.VideoAdPlayer, ima.AdMediaInfo) stopAd, + }) { + stopAdCallback = stopAd; + return MockVideoAdPlayer(); + }, + ); + + AndroidAdDisplayContainer( + AndroidAdDisplayContainerCreationParams( + onContainerAdded: (_) {}, + imaProxy: imaProxy, + ), + ); + + stopAdCallback(MockVideoAdPlayer(), MockAdMediaInfo()); + + verify(mockFrameLayout.removeView(mockVideoView)); + verify(mockFrameLayout.addView(mockVideoView2)); + }); }); } diff --git a/packages/interactive_media_ads/test/android/ad_display_container_test.mocks.dart b/packages/interactive_media_ads/test/android/ad_display_container_test.mocks.dart index ef3f12b50b01..adedc00cd18b 100644 --- a/packages/interactive_media_ads/test/android/ad_display_container_test.mocks.dart +++ b/packages/interactive_media_ads/test/android/ad_display_container_test.mocks.dart @@ -397,6 +397,16 @@ class MockFrameLayout extends _i1.Mock implements _i2.FrameLayout { returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); + + @override + _i6.Future removeView(_i2.View? view) => (super.noSuchMethod( + Invocation.method( + #removeView, + [view], + ), + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); } /// A class which mocks [MediaPlayer]. diff --git a/packages/interactive_media_ads/test/android/ads_loader_test.dart b/packages/interactive_media_ads/test/android/ads_loader_test.dart index 3446c4e899ad..ae25fdde99f9 100644 --- a/packages/interactive_media_ads/test/android/ads_loader_test.dart +++ b/packages/interactive_media_ads/test/android/ads_loader_test.dart @@ -9,6 +9,7 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:interactive_media_ads/src/android/android_ad_display_container.dart'; import 'package:interactive_media_ads/src/android/android_ads_loader.dart'; +import 'package:interactive_media_ads/src/android/android_content_progress_provider.dart'; import 'package:interactive_media_ads/src/android/interactive_media_ads.g.dart' as ima; import 'package:interactive_media_ads/src/android/interactive_media_ads_proxy.dart'; @@ -94,6 +95,8 @@ void main() { final InteractiveMediaAdsProxy proxy = InteractiveMediaAdsProxy( instanceImaSdkFactory: () => mockSdkFactory, + newContentProgressProvider: () => + ima.ContentProgressProvider.pigeon_detached(), ); final AndroidAdsLoader adsLoader = AndroidAdsLoader( @@ -105,10 +108,22 @@ void main() { ), ); - await adsLoader.requestAds(AdsRequest(adTagUrl: 'url')); + final AndroidContentProgressProvider progressProvider = + AndroidContentProgressProvider( + AndroidContentProgressProviderCreationParams(proxy: proxy), + ); + await adsLoader.requestAds( + PlatformAdsRequest( + adTagUrl: 'url', + contentProgressProvider: progressProvider, + ), + ); verifyInOrder(>[ mockAdsRequest.setAdTagUrl('url'), + mockAdsRequest.setContentProgressProvider( + progressProvider.progressProvider, + ), mockAdsLoader.requestAds(mockAdsRequest), ]); }); diff --git a/packages/interactive_media_ads/test/android/ads_loader_test.mocks.dart b/packages/interactive_media_ads/test/android/ads_loader_test.mocks.dart index bdcfc1f4d54c..9956d7eabf50 100644 --- a/packages/interactive_media_ads/test/android/ads_loader_test.mocks.dart +++ b/packages/interactive_media_ads/test/android/ads_loader_test.mocks.dart @@ -569,6 +569,36 @@ class MockAdsManager extends _i1.Mock implements _i2.AdsManager { returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); + @override + _i6.Future> getAdCuePoints() => (super.noSuchMethod( + Invocation.method( + #getAdCuePoints, + [], + ), + returnValue: _i6.Future>.value([]), + returnValueForMissingStub: _i6.Future>.value([]), + ) as _i6.Future>); + + @override + _i6.Future resume() => (super.noSuchMethod( + Invocation.method( + #resume, + [], + ), + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); + + @override + _i6.Future skip() => (super.noSuchMethod( + Invocation.method( + #skip, + [], + ), + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); + @override _i2.AdsManager pigeon_copy() => (super.noSuchMethod( Invocation.method( @@ -870,6 +900,16 @@ class MockFrameLayout extends _i1.Mock implements _i2.FrameLayout { returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); + + @override + _i6.Future removeView(_i2.View? view) => (super.noSuchMethod( + Invocation.method( + #removeView, + [view], + ), + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); } /// A class which mocks [ImaSdkFactory]. diff --git a/packages/interactive_media_ads/test/android/ads_manager_test.dart b/packages/interactive_media_ads/test/android/ads_manager_test.dart index 3d9a9a5ffa8e..bfcbaeec676c 100644 --- a/packages/interactive_media_ads/test/android/ads_manager_test.dart +++ b/packages/interactive_media_ads/test/android/ads_manager_test.dart @@ -48,6 +48,38 @@ void main() { verify(mockAdsManager.start()); }); + test('discardAdBreak', () { + final MockAdsManager mockAdsManager = MockAdsManager(); + final AndroidAdsManager adsManager = AndroidAdsManager(mockAdsManager); + adsManager.discardAdBreak(); + + verify(mockAdsManager.discardAdBreak()); + }); + + test('pause', () { + final MockAdsManager mockAdsManager = MockAdsManager(); + final AndroidAdsManager adsManager = AndroidAdsManager(mockAdsManager); + adsManager.pause(); + + verify(mockAdsManager.pause()); + }); + + test('skip', () { + final MockAdsManager mockAdsManager = MockAdsManager(); + final AndroidAdsManager adsManager = AndroidAdsManager(mockAdsManager); + adsManager.skip(); + + verify(mockAdsManager.skip()); + }); + + test('resume', () { + final MockAdsManager mockAdsManager = MockAdsManager(); + final AndroidAdsManager adsManager = AndroidAdsManager(mockAdsManager); + adsManager.resume(); + + verify(mockAdsManager.resume()); + }); + test('onAdEvent', () async { final MockAdsManager mockAdsManager = MockAdsManager(); diff --git a/packages/interactive_media_ads/test/android/ads_manager_test.mocks.dart b/packages/interactive_media_ads/test/android/ads_manager_test.mocks.dart index 57069cf78e18..bb4dc3235f0e 100644 --- a/packages/interactive_media_ads/test/android/ads_manager_test.mocks.dart +++ b/packages/interactive_media_ads/test/android/ads_manager_test.mocks.dart @@ -435,6 +435,36 @@ class MockAdsManager extends _i1.Mock implements _i2.AdsManager { returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); + @override + _i4.Future> getAdCuePoints() => (super.noSuchMethod( + Invocation.method( + #getAdCuePoints, + [], + ), + returnValue: _i4.Future>.value([]), + returnValueForMissingStub: _i4.Future>.value([]), + ) as _i4.Future>); + + @override + _i4.Future resume() => (super.noSuchMethod( + Invocation.method( + #resume, + [], + ), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); + + @override + _i4.Future skip() => (super.noSuchMethod( + Invocation.method( + #skip, + [], + ), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); + @override _i2.AdsManager pigeon_copy() => (super.noSuchMethod( Invocation.method( diff --git a/packages/interactive_media_ads/test/android/content_progress_provider_test.dart b/packages/interactive_media_ads/test/android/content_progress_provider_test.dart new file mode 100644 index 000000000000..bf7885bb77c6 --- /dev/null +++ b/packages/interactive_media_ads/test/android/content_progress_provider_test.dart @@ -0,0 +1,49 @@ +// 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:interactive_media_ads/src/android/android_content_progress_provider.dart'; +import 'package:interactive_media_ads/src/android/interactive_media_ads.g.dart' + as ima; +import 'package:interactive_media_ads/src/android/interactive_media_ads_proxy.dart'; +import 'package:mockito/annotations.dart'; +import 'package:mockito/mockito.dart'; + +import 'content_progress_provider_test.mocks.dart'; + +@GenerateNiceMocks(>[ + MockSpec(), +]) +void main() { + group('AndroidContentProgressProvider', () { + test('setProgress', () async { + final MockContentProgressProvider mockContentProgressProvider = + MockContentProgressProvider(); + + final AndroidContentProgressProvider provider = + AndroidContentProgressProvider( + AndroidContentProgressProviderCreationParams( + proxy: InteractiveMediaAdsProxy( + newContentProgressProvider: () => mockContentProgressProvider, + newVideoProgressUpdate: ({ + required int currentTimeMs, + required int durationMs, + }) { + expect(currentTimeMs, 1000); + expect(durationMs, 10000); + return ima.VideoProgressUpdate.pigeon_detached(); + }, + ), + ), + ); + + await provider.setProgress( + progress: const Duration(seconds: 1), + duration: const Duration(seconds: 10), + ); + + verify(mockContentProgressProvider.setContentProgress(any)); + }); + }); +} diff --git a/packages/interactive_media_ads/test/android/content_progress_provider_test.mocks.dart b/packages/interactive_media_ads/test/android/content_progress_provider_test.mocks.dart new file mode 100644 index 000000000000..6d65d6475030 --- /dev/null +++ b/packages/interactive_media_ads/test/android/content_progress_provider_test.mocks.dart @@ -0,0 +1,97 @@ +// Mocks generated by Mockito 5.4.4 from annotations +// in interactive_media_ads/test/android/content_progress_provider_test.dart. +// Do not manually edit this file. + +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:async' as _i3; + +import 'package:interactive_media_ads/src/android/interactive_media_ads.g.dart' + as _i2; +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 _FakePigeonInstanceManager_0 extends _i1.SmartFake + implements _i2.PigeonInstanceManager { + _FakePigeonInstanceManager_0( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeContentProgressProvider_1 extends _i1.SmartFake + implements _i2.ContentProgressProvider { + _FakeContentProgressProvider_1( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +/// A class which mocks [ContentProgressProvider]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockContentProgressProvider extends _i1.Mock + implements _i2.ContentProgressProvider { + @override + _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + returnValueForMissingStub: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) as _i2.PigeonInstanceManager); + + @override + _i3.Future setContentProgress(_i2.VideoProgressUpdate? update) => + (super.noSuchMethod( + Invocation.method( + #setContentProgress, + [update], + ), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); + + @override + _i2.ContentProgressProvider pigeon_copy() => (super.noSuchMethod( + Invocation.method( + #pigeon_copy, + [], + ), + returnValue: _FakeContentProgressProvider_1( + this, + Invocation.method( + #pigeon_copy, + [], + ), + ), + returnValueForMissingStub: _FakeContentProgressProvider_1( + this, + Invocation.method( + #pigeon_copy, + [], + ), + ), + ) as _i2.ContentProgressProvider); +} diff --git a/packages/interactive_media_ads/test/content_progress_provider_test.dart b/packages/interactive_media_ads/test/content_progress_provider_test.dart new file mode 100644 index 000000000000..180d9ce0d015 --- /dev/null +++ b/packages/interactive_media_ads/test/content_progress_provider_test.dart @@ -0,0 +1,41 @@ +// 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:interactive_media_ads/src/content_progress_provider.dart'; +import 'package:interactive_media_ads/src/platform_interface/platform_content_progress_provider.dart'; + +import 'test_stubs.dart'; + +void main() { + test('setProgress', () async { + late final Duration callbackProgress; + late final Duration callbackDuration; + + final TestContentProgressProvider platformProvider = + TestContentProgressProvider( + const PlatformContentProgressProviderCreationParams(), + onSetProgress: ({ + required Duration progress, + required Duration duration, + }) async { + callbackProgress = progress; + callbackDuration = duration; + }, + ); + + final ContentProgressProvider provider = + ContentProgressProvider.fromPlatform( + platformProvider, + ); + + await provider.setProgress( + progress: const Duration(seconds: 1), + duration: const Duration(seconds: 10), + ); + + expect(callbackProgress, const Duration(seconds: 1)); + expect(callbackDuration, const Duration(seconds: 10)); + }); +} diff --git a/packages/interactive_media_ads/test/ios/ad_display_container_test.mocks.dart b/packages/interactive_media_ads/test/ios/ad_display_container_test.mocks.dart index 6d07b9fcad23..cb8c37e05dc3 100644 --- a/packages/interactive_media_ads/test/ios/ad_display_container_test.mocks.dart +++ b/packages/interactive_media_ads/test/ios/ad_display_container_test.mocks.dart @@ -174,6 +174,28 @@ class MockUIViewController extends _i1.Mock implements _i2.UIViewController { ), ) as _i2.PigeonInstanceManager); + @override + _i2.UIView pigeonVar_view() => (super.noSuchMethod( + Invocation.method( + #pigeonVar_view, + [], + ), + returnValue: _FakeUIView_2( + this, + Invocation.method( + #pigeonVar_view, + [], + ), + ), + returnValueForMissingStub: _FakeUIView_2( + this, + Invocation.method( + #pigeonVar_view, + [], + ), + ), + ) as _i2.UIView); + @override _i2.UIViewController pigeon_copy() => (super.noSuchMethod( Invocation.method( diff --git a/packages/interactive_media_ads/test/ios/ads_loader_test.dart b/packages/interactive_media_ads/test/ios/ads_loader_test.dart index 04ea706d2128..633e96e9803f 100644 --- a/packages/interactive_media_ads/test/ios/ads_loader_test.dart +++ b/packages/interactive_media_ads/test/ios/ads_loader_test.dart @@ -9,6 +9,7 @@ import 'package:interactive_media_ads/src/ios/interactive_media_ads.g.dart' import 'package:interactive_media_ads/src/ios/interactive_media_ads_proxy.dart'; import 'package:interactive_media_ads/src/ios/ios_ad_display_container.dart'; import 'package:interactive_media_ads/src/ios/ios_ads_loader.dart'; +import 'package:interactive_media_ads/src/ios/ios_content_progress_provider.dart'; import 'package:interactive_media_ads/src/platform_interface/platform_interface.dart'; import 'package:mockito/annotations.dart'; import 'package:mockito/mockito.dart'; @@ -70,6 +71,8 @@ void main() { const String adTag = 'myAdTag'; final MockIMAAdsLoader mockLoader = MockIMAAdsLoader(); + final ima.IMAContentPlayhead contentPlayheadInstance = + ima.IMAContentPlayhead(); final InteractiveMediaAdsProxy imaProxy = InteractiveMediaAdsProxy( newIMAAdsLoader: ({ima.IMASettings? settings}) => mockLoader, newIMAAdsRequest: ({ @@ -79,8 +82,10 @@ void main() { }) { expect(adTagUrl, adTag); expect(adDisplayContainer, container.adDisplayContainer); + expect(contentPlayhead, contentPlayheadInstance); return MockIMAAdsRequest(); }, + newIMAContentPlayhead: () => contentPlayheadInstance, ); final IOSAdsLoader loader = IOSAdsLoader( @@ -92,7 +97,14 @@ void main() { ), ); - await loader.requestAds(AdsRequest(adTagUrl: adTag)); + final IOSContentProgressProvider provider = IOSContentProgressProvider( + IOSContentProgressProviderCreationParams(proxy: imaProxy), + ); + + await loader.requestAds(PlatformAdsRequest( + adTagUrl: adTag, + contentProgressProvider: provider, + )); verify(mockLoader.requestAds(any)); }); diff --git a/packages/interactive_media_ads/test/ios/ads_loader_test.mocks.dart b/packages/interactive_media_ads/test/ios/ads_loader_test.mocks.dart index 2be4284c1ce1..a19db9487f11 100644 --- a/packages/interactive_media_ads/test/ios/ads_loader_test.mocks.dart +++ b/packages/interactive_media_ads/test/ios/ads_loader_test.mocks.dart @@ -539,6 +539,28 @@ class MockUIViewController extends _i1.Mock implements _i2.UIViewController { ), ) as _i2.PigeonInstanceManager); + @override + _i2.UIView pigeonVar_view() => (super.noSuchMethod( + Invocation.method( + #pigeonVar_view, + [], + ), + returnValue: _FakeUIView_6( + this, + Invocation.method( + #pigeonVar_view, + [], + ), + ), + returnValueForMissingStub: _FakeUIView_6( + this, + Invocation.method( + #pigeonVar_view, + [], + ), + ), + ) as _i2.UIView); + @override _i2.UIViewController pigeon_copy() => (super.noSuchMethod( Invocation.method( diff --git a/packages/interactive_media_ads/test/ios/ads_manager_test.dart b/packages/interactive_media_ads/test/ios/ads_manager_test.dart index 8c9c6d3a35d1..06d1e1dab51e 100644 --- a/packages/interactive_media_ads/test/ios/ads_manager_test.dart +++ b/packages/interactive_media_ads/test/ios/ads_manager_test.dart @@ -41,6 +41,38 @@ void main() { verify(mockAdsManager.start()); }); + test('discardAdBreak', () { + final MockIMAAdsManager mockAdsManager = MockIMAAdsManager(); + final IOSAdsManager adsManager = IOSAdsManager(mockAdsManager); + adsManager.discardAdBreak(); + + verify(mockAdsManager.discardAdBreak()); + }); + + test('pause', () { + final MockIMAAdsManager mockAdsManager = MockIMAAdsManager(); + final IOSAdsManager adsManager = IOSAdsManager(mockAdsManager); + adsManager.pause(); + + verify(mockAdsManager.pause()); + }); + + test('skip', () { + final MockIMAAdsManager mockAdsManager = MockIMAAdsManager(); + final IOSAdsManager adsManager = IOSAdsManager(mockAdsManager); + adsManager.skip(); + + verify(mockAdsManager.skip()); + }); + + test('resume', () { + final MockIMAAdsManager mockAdsManager = MockIMAAdsManager(); + final IOSAdsManager adsManager = IOSAdsManager(mockAdsManager); + adsManager.resume(); + + verify(mockAdsManager.resume()); + }); + test('setAdsManagerDelegate', () { final MockIMAAdsManager mockAdsManager = MockIMAAdsManager(); final IOSAdsManager adsManager = IOSAdsManager(mockAdsManager); diff --git a/packages/interactive_media_ads/test/ios/content_progress_provider_test.dart b/packages/interactive_media_ads/test/ios/content_progress_provider_test.dart new file mode 100644 index 000000000000..80975174d3aa --- /dev/null +++ b/packages/interactive_media_ads/test/ios/content_progress_provider_test.dart @@ -0,0 +1,39 @@ +// 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:interactive_media_ads/src/ios/interactive_media_ads.g.dart'; +import 'package:interactive_media_ads/src/ios/interactive_media_ads_proxy.dart'; +import 'package:interactive_media_ads/src/ios/ios_content_progress_provider.dart'; +import 'package:mockito/annotations.dart'; +import 'package:mockito/mockito.dart'; + +import 'content_progress_provider_test.mocks.dart'; + +@GenerateNiceMocks(>[ + MockSpec(), +]) +void main() { + group('IOSContentProgressProvider', () { + test('setProgress', () async { + final MockIMAContentPlayhead mockContentPlayhead = + MockIMAContentPlayhead(); + + final IOSContentProgressProvider provider = IOSContentProgressProvider( + IOSContentProgressProviderCreationParams( + proxy: InteractiveMediaAdsProxy( + newIMAContentPlayhead: () => mockContentPlayhead, + ), + ), + ); + + await provider.setProgress( + progress: const Duration(seconds: 1), + duration: const Duration(seconds: 10), + ); + + verify(mockContentPlayhead.setCurrentTime(1.0)); + }); + }); +} diff --git a/packages/interactive_media_ads/test/ios/content_progress_provider_test.mocks.dart b/packages/interactive_media_ads/test/ios/content_progress_provider_test.mocks.dart new file mode 100644 index 000000000000..a82fb3fbade8 --- /dev/null +++ b/packages/interactive_media_ads/test/ios/content_progress_provider_test.mocks.dart @@ -0,0 +1,96 @@ +// Mocks generated by Mockito 5.4.4 from annotations +// in interactive_media_ads/test/ios/content_progress_provider_test.dart. +// Do not manually edit this file. + +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:async' as _i3; + +import 'package:interactive_media_ads/src/ios/interactive_media_ads.g.dart' + as _i2; +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 _FakePigeonInstanceManager_0 extends _i1.SmartFake + implements _i2.PigeonInstanceManager { + _FakePigeonInstanceManager_0( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeIMAContentPlayhead_1 extends _i1.SmartFake + implements _i2.IMAContentPlayhead { + _FakeIMAContentPlayhead_1( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +/// A class which mocks [IMAContentPlayhead]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockIMAContentPlayhead extends _i1.Mock + implements _i2.IMAContentPlayhead { + @override + _i2.PigeonInstanceManager get pigeon_instanceManager => (super.noSuchMethod( + Invocation.getter(#pigeon_instanceManager), + returnValue: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + returnValueForMissingStub: _FakePigeonInstanceManager_0( + this, + Invocation.getter(#pigeon_instanceManager), + ), + ) as _i2.PigeonInstanceManager); + + @override + _i3.Future setCurrentTime(double? timeInterval) => (super.noSuchMethod( + Invocation.method( + #setCurrentTime, + [timeInterval], + ), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); + + @override + _i2.IMAContentPlayhead pigeon_copy() => (super.noSuchMethod( + Invocation.method( + #pigeon_copy, + [], + ), + returnValue: _FakeIMAContentPlayhead_1( + this, + Invocation.method( + #pigeon_copy, + [], + ), + ), + returnValueForMissingStub: _FakeIMAContentPlayhead_1( + this, + Invocation.method( + #pigeon_copy, + [], + ), + ), + ) as _i2.IMAContentPlayhead); +} diff --git a/packages/interactive_media_ads/test/test_stubs.dart b/packages/interactive_media_ads/test/test_stubs.dart index fd59fb3073f1..328f58f46995 100644 --- a/packages/interactive_media_ads/test/test_stubs.dart +++ b/packages/interactive_media_ads/test/test_stubs.dart @@ -11,6 +11,7 @@ final class TestInteractiveMediaAdsPlatform required this.onCreatePlatformAdsLoader, required this.onCreatePlatformAdsManagerDelegate, required this.onCreatePlatformAdDisplayContainer, + required this.onCreatePlatformContentProgressProvider, }); PlatformAdsLoader Function(PlatformAdsLoaderCreationParams params) @@ -24,6 +25,10 @@ final class TestInteractiveMediaAdsPlatform PlatformAdDisplayContainerCreationParams params, ) onCreatePlatformAdDisplayContainer; + PlatformContentProgressProvider Function( + PlatformContentProgressProviderCreationParams params, + ) onCreatePlatformContentProgressProvider; + @override PlatformAdsLoader createPlatformAdsLoader( PlatformAdsLoaderCreationParams params, @@ -44,6 +49,13 @@ final class TestInteractiveMediaAdsPlatform ) { return onCreatePlatformAdDisplayContainer(params); } + + @override + PlatformContentProgressProvider createPlatformContentProgressProvider( + PlatformContentProgressProviderCreationParams params, + ) { + return onCreatePlatformContentProgressProvider(params); + } } final class TestPlatformAdDisplayContainer extends PlatformAdDisplayContainer { @@ -69,7 +81,7 @@ final class TestPlatformAdsLoader extends PlatformAdsLoader { Future Function() onContentComplete; - Future Function(AdsRequest request) onRequestAds; + Future Function(PlatformAdsRequest request) onRequestAds; @override Future contentComplete() async { @@ -77,7 +89,7 @@ final class TestPlatformAdsLoader extends PlatformAdsLoader { } @override - Future requestAds(AdsRequest request) async { + Future requestAds(PlatformAdsRequest request) async { return onRequestAds(request); } } @@ -92,6 +104,10 @@ class TestAdsManager extends PlatformAdsManager { this.onSetAdsManagerDelegate, this.onStart, this.onDestroy, + this.onDiscardAdBreak, + this.onPause, + this.onResume, + this.onSkip, }); Future Function(AdsManagerInitParams params)? onInit; @@ -101,6 +117,14 @@ class TestAdsManager extends PlatformAdsManager { Future Function(AdsManagerStartParams params)? onStart; + Future Function()? onDiscardAdBreak; + + Future Function()? onPause; + + Future Function()? onResume; + + Future Function()? onSkip; + Future Function()? onDestroy; @override @@ -124,4 +148,44 @@ class TestAdsManager extends PlatformAdsManager { Future destroy() async { return onDestroy?.call(); } + + @override + Future discardAdBreak() async { + return onDiscardAdBreak?.call(); + } + + @override + Future pause() async { + return onPause?.call(); + } + + @override + Future resume() async { + return onResume?.call(); + } + + @override + Future skip() async { + return onSkip?.call(); + } +} + +class TestContentProgressProvider extends PlatformContentProgressProvider { + TestContentProgressProvider( + super.params, { + this.onSetProgress, + }) : super.implementation(); + + Future Function({ + required Duration progress, + required Duration duration, + })? onSetProgress; + + @override + Future setProgress({ + required Duration progress, + required Duration duration, + }) async { + return onSetProgress?.call(progress: progress, duration: duration); + } } 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..d951fac2bf31 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-8.7-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/packages/local_auth/local_auth/example/android/build.gradle b/packages/local_auth/local_auth/example/android/build.gradle index cec92de922cf..0bed8906c094 100644 --- a/packages/local_auth/local_auth/example/android/build.gradle +++ b/packages/local_auth/local_auth/example/android/build.gradle @@ -5,7 +5,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:7.4.2' + classpath 'com.android.tools.build:gradle:8.5.2' } } 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..155a12c6d657 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-8.7-all.zip diff --git a/packages/local_auth/local_auth/pubspec.yaml b/packages/local_auth/local_auth/pubspec.yaml index 98f33e861510..0ebc00c4d3d4 100644 --- a/packages/local_auth/local_auth/pubspec.yaml +++ b/packages/local_auth/local_auth/pubspec.yaml @@ -34,7 +34,7 @@ dev_dependencies: sdk: flutter integration_test: sdk: flutter - mockito: 5.4.4 + mockito: ^5.4.4 plugin_platform_interface: ^2.1.7 topics: diff --git a/packages/local_auth/local_auth_android/CHANGELOG.md b/packages/local_auth/local_auth_android/CHANGELOG.md index 5d5d640ad22b..b5bc8bc9545a 100644 --- a/packages/local_auth/local_auth_android/CHANGELOG.md +++ b/packages/local_auth/local_auth_android/CHANGELOG.md @@ -1,3 +1,16 @@ +## 1.0.46 + +* Updates Java compatibility version to 11. + +## 1.0.45 + +* Updates to the latest version of Pigeon. + +## 1.0.44 + +* Removes dependency on org.jetbrains.kotlin:kotlin-bom. +* Updates minimum supported SDK version to Flutter 3.24/Dart 3.5. + ## 1.0.43 * Updates lint checks to ignore NewerVersionAvailable. diff --git a/packages/local_auth/local_auth_android/android/build.gradle b/packages/local_auth/local_auth_android/android/build.gradle index 7d976368e712..38acc695fae9 100644 --- a/packages/local_auth/local_auth_android/android/build.gradle +++ b/packages/local_auth/local_auth_android/android/build.gradle @@ -22,10 +22,7 @@ rootProject.allprojects { apply plugin: 'com.android.library' android { - // Conditional for compatibility with AGP <4.2. - if (project.android.hasProperty("namespace")) { - namespace 'io.flutter.plugins.localauth' - } + namespace 'io.flutter.plugins.localauth' compileSdk 34 defaultConfig { @@ -34,8 +31,8 @@ android { } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_11 + targetCompatibility JavaVersion.VERSION_11 } lintOptions { @@ -68,7 +65,4 @@ dependencies { androidTestImplementation 'androidx.test:runner:1.2.0' androidTestImplementation 'androidx.test:rules:1.2.0' androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1' - // TODO(camsim99): org.jetbrains.kotlin:kotlin-bom artifact purpose is to align kotlin stdlib and related code versions. - // This should be removed when https://github.com/flutter/flutter/issues/125062 is fixed. - implementation(platform("org.jetbrains.kotlin:kotlin-bom:1.8.10")) } diff --git a/packages/local_auth/local_auth_android/android/src/main/java/io/flutter/plugins/localauth/LocalAuthPlugin.java b/packages/local_auth/local_auth_android/android/src/main/java/io/flutter/plugins/localauth/LocalAuthPlugin.java index 5d1fe195449a..09af7c6656c0 100644 --- a/packages/local_auth/local_auth_android/android/src/main/java/io/flutter/plugins/localauth/LocalAuthPlugin.java +++ b/packages/local_auth/local_auth_android/android/src/main/java/io/flutter/plugins/localauth/LocalAuthPlugin.java @@ -24,7 +24,6 @@ import io.flutter.plugin.common.PluginRegistry; import io.flutter.plugins.localauth.AuthenticationHelper.AuthCompletionHandler; import io.flutter.plugins.localauth.Messages.AuthClassification; -import io.flutter.plugins.localauth.Messages.AuthClassificationWrapper; import io.flutter.plugins.localauth.Messages.AuthOptions; import io.flutter.plugins.localauth.Messages.AuthResult; import io.flutter.plugins.localauth.Messages.AuthStrings; @@ -82,23 +81,19 @@ public LocalAuthPlugin() {} return hasBiometricHardware(); } - public @NonNull List getEnrolledBiometrics() { - ArrayList biometrics = new ArrayList<>(); + public @NonNull List getEnrolledBiometrics() { + ArrayList biometrics = new ArrayList<>(); if (biometricManager.canAuthenticate(BiometricManager.Authenticators.BIOMETRIC_WEAK) == BiometricManager.BIOMETRIC_SUCCESS) { - biometrics.add(wrappedBiometric(AuthClassification.WEAK)); + biometrics.add(AuthClassification.WEAK); } if (biometricManager.canAuthenticate(BiometricManager.Authenticators.BIOMETRIC_STRONG) == BiometricManager.BIOMETRIC_SUCCESS) { - biometrics.add(wrappedBiometric(AuthClassification.STRONG)); + biometrics.add(AuthClassification.STRONG); } return biometrics; } - private @NonNull AuthClassificationWrapper wrappedBiometric(AuthClassification value) { - return new AuthClassificationWrapper.Builder().setValue(value).build(); - } - public @NonNull Boolean stopAuthentication() { try { if (authHelper != null && authInProgress.get()) { @@ -208,12 +203,12 @@ public boolean canAuthenticateWithDeviceCredential() { @Override public void onAttachedToEngine(@NonNull FlutterPluginBinding binding) { - LocalAuthApi.setup(binding.getBinaryMessenger(), this); + LocalAuthApi.setUp(binding.getBinaryMessenger(), this); } @Override public void onDetachedFromEngine(@NonNull FlutterPluginBinding binding) { - LocalAuthApi.setup(binding.getBinaryMessenger(), null); + LocalAuthApi.setUp(binding.getBinaryMessenger(), null); } private void setServicesFromActivity(Activity activity) { diff --git a/packages/local_auth/local_auth_android/android/src/main/java/io/flutter/plugins/localauth/Messages.java b/packages/local_auth/local_auth_android/android/src/main/java/io/flutter/plugins/localauth/Messages.java index e878c481c273..e04a999a109b 100644 --- a/packages/local_auth/local_auth_android/android/src/main/java/io/flutter/plugins/localauth/Messages.java +++ b/packages/local_auth/local_auth_android/android/src/main/java/io/flutter/plugins/localauth/Messages.java @@ -1,11 +1,14 @@ // 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 (v11.0.0), do not edit directly. +// Autogenerated from Pigeon (v22.4.0), do not edit directly. // See also: https://pub.dev/packages/pigeon package io.flutter.plugins.localauth; +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; @@ -14,9 +17,12 @@ 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.List; +import java.util.Objects; /** Generated class from Pigeon. */ @SuppressWarnings({"unused", "unchecked", "CodeBlock2Expr", "RedundantSuppression", "serial"}) @@ -40,7 +46,7 @@ public FlutterError(@NonNull String code, @Nullable String message, @Nullable Ob @NonNull protected static ArrayList wrapError(@NonNull Throwable exception) { - ArrayList errorList = new ArrayList(3); + ArrayList errorList = new ArrayList<>(3); if (exception instanceof FlutterError) { FlutterError error = (FlutterError) exception; errorList.add(error.code); @@ -55,6 +61,10 @@ protected static ArrayList wrapError(@NonNull Throwable exception) { return errorList; } + @Target(METHOD) + @Retention(CLASS) + @interface CanIgnoreReturnValue {} + /** Possible outcomes of an authentication attempt. */ public enum AuthResult { /** The user authenticated successfully. */ @@ -78,7 +88,7 @@ public enum AuthResult { final int index; - private AuthResult(final int index) { + AuthResult(final int index) { this.index = index; } } @@ -90,7 +100,7 @@ public enum AuthClassification { final int index; - private AuthClassification(final int index) { + AuthClassification(final int index) { this.index = index; } } @@ -238,10 +248,47 @@ public void setSignInTitle(@NonNull String setterArg) { /** Constructor is non-public to enforce null safety; use Builder. */ AuthStrings() {} + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AuthStrings that = (AuthStrings) o; + return reason.equals(that.reason) + && biometricHint.equals(that.biometricHint) + && biometricNotRecognized.equals(that.biometricNotRecognized) + && biometricRequiredTitle.equals(that.biometricRequiredTitle) + && cancelButton.equals(that.cancelButton) + && deviceCredentialsRequiredTitle.equals(that.deviceCredentialsRequiredTitle) + && deviceCredentialsSetupDescription.equals(that.deviceCredentialsSetupDescription) + && goToSettingsButton.equals(that.goToSettingsButton) + && goToSettingsDescription.equals(that.goToSettingsDescription) + && signInTitle.equals(that.signInTitle); + } + + @Override + public int hashCode() { + return Objects.hash( + reason, + biometricHint, + biometricNotRecognized, + biometricRequiredTitle, + cancelButton, + deviceCredentialsRequiredTitle, + deviceCredentialsSetupDescription, + goToSettingsButton, + goToSettingsDescription, + signInTitle); + } + public static final class Builder { private @Nullable String reason; + @CanIgnoreReturnValue public @NonNull Builder setReason(@NonNull String setterArg) { this.reason = setterArg; return this; @@ -249,6 +296,7 @@ public static final class Builder { private @Nullable String biometricHint; + @CanIgnoreReturnValue public @NonNull Builder setBiometricHint(@NonNull String setterArg) { this.biometricHint = setterArg; return this; @@ -256,6 +304,7 @@ public static final class Builder { private @Nullable String biometricNotRecognized; + @CanIgnoreReturnValue public @NonNull Builder setBiometricNotRecognized(@NonNull String setterArg) { this.biometricNotRecognized = setterArg; return this; @@ -263,6 +312,7 @@ public static final class Builder { private @Nullable String biometricRequiredTitle; + @CanIgnoreReturnValue public @NonNull Builder setBiometricRequiredTitle(@NonNull String setterArg) { this.biometricRequiredTitle = setterArg; return this; @@ -270,6 +320,7 @@ public static final class Builder { private @Nullable String cancelButton; + @CanIgnoreReturnValue public @NonNull Builder setCancelButton(@NonNull String setterArg) { this.cancelButton = setterArg; return this; @@ -277,6 +328,7 @@ public static final class Builder { private @Nullable String deviceCredentialsRequiredTitle; + @CanIgnoreReturnValue public @NonNull Builder setDeviceCredentialsRequiredTitle(@NonNull String setterArg) { this.deviceCredentialsRequiredTitle = setterArg; return this; @@ -284,6 +336,7 @@ public static final class Builder { private @Nullable String deviceCredentialsSetupDescription; + @CanIgnoreReturnValue public @NonNull Builder setDeviceCredentialsSetupDescription(@NonNull String setterArg) { this.deviceCredentialsSetupDescription = setterArg; return this; @@ -291,6 +344,7 @@ public static final class Builder { private @Nullable String goToSettingsButton; + @CanIgnoreReturnValue public @NonNull Builder setGoToSettingsButton(@NonNull String setterArg) { this.goToSettingsButton = setterArg; return this; @@ -298,6 +352,7 @@ public static final class Builder { private @Nullable String goToSettingsDescription; + @CanIgnoreReturnValue public @NonNull Builder setGoToSettingsDescription(@NonNull String setterArg) { this.goToSettingsDescription = setterArg; return this; @@ -305,6 +360,7 @@ public static final class Builder { private @Nullable String signInTitle; + @CanIgnoreReturnValue public @NonNull Builder setSignInTitle(@NonNull String setterArg) { this.signInTitle = setterArg; return this; @@ -328,7 +384,7 @@ public static final class Builder { @NonNull ArrayList toList() { - ArrayList toListResult = new ArrayList(10); + ArrayList toListResult = new ArrayList<>(10); toListResult.add(reason); toListResult.add(biometricHint); toListResult.add(biometricNotRecognized); @@ -342,27 +398,27 @@ ArrayList toList() { return toListResult; } - static @NonNull AuthStrings fromList(@NonNull ArrayList list) { + static @NonNull AuthStrings fromList(@NonNull ArrayList pigeonVar_list) { AuthStrings pigeonResult = new AuthStrings(); - Object reason = list.get(0); + Object reason = pigeonVar_list.get(0); pigeonResult.setReason((String) reason); - Object biometricHint = list.get(1); + Object biometricHint = pigeonVar_list.get(1); pigeonResult.setBiometricHint((String) biometricHint); - Object biometricNotRecognized = list.get(2); + Object biometricNotRecognized = pigeonVar_list.get(2); pigeonResult.setBiometricNotRecognized((String) biometricNotRecognized); - Object biometricRequiredTitle = list.get(3); + Object biometricRequiredTitle = pigeonVar_list.get(3); pigeonResult.setBiometricRequiredTitle((String) biometricRequiredTitle); - Object cancelButton = list.get(4); + Object cancelButton = pigeonVar_list.get(4); pigeonResult.setCancelButton((String) cancelButton); - Object deviceCredentialsRequiredTitle = list.get(5); + Object deviceCredentialsRequiredTitle = pigeonVar_list.get(5); pigeonResult.setDeviceCredentialsRequiredTitle((String) deviceCredentialsRequiredTitle); - Object deviceCredentialsSetupDescription = list.get(6); + Object deviceCredentialsSetupDescription = pigeonVar_list.get(6); pigeonResult.setDeviceCredentialsSetupDescription((String) deviceCredentialsSetupDescription); - Object goToSettingsButton = list.get(7); + Object goToSettingsButton = pigeonVar_list.get(7); pigeonResult.setGoToSettingsButton((String) goToSettingsButton); - Object goToSettingsDescription = list.get(8); + Object goToSettingsDescription = pigeonVar_list.get(8); pigeonResult.setGoToSettingsDescription((String) goToSettingsDescription); - Object signInTitle = list.get(9); + Object signInTitle = pigeonVar_list.get(9); pigeonResult.setSignInTitle((String) signInTitle); return pigeonResult; } @@ -425,10 +481,31 @@ public void setUseErrorDialgs(@NonNull Boolean setterArg) { /** Constructor is non-public to enforce null safety; use Builder. */ AuthOptions() {} + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AuthOptions that = (AuthOptions) o; + return biometricOnly.equals(that.biometricOnly) + && sensitiveTransaction.equals(that.sensitiveTransaction) + && sticky.equals(that.sticky) + && useErrorDialgs.equals(that.useErrorDialgs); + } + + @Override + public int hashCode() { + return Objects.hash(biometricOnly, sensitiveTransaction, sticky, useErrorDialgs); + } + public static final class Builder { private @Nullable Boolean biometricOnly; + @CanIgnoreReturnValue public @NonNull Builder setBiometricOnly(@NonNull Boolean setterArg) { this.biometricOnly = setterArg; return this; @@ -436,6 +513,7 @@ public static final class Builder { private @Nullable Boolean sensitiveTransaction; + @CanIgnoreReturnValue public @NonNull Builder setSensitiveTransaction(@NonNull Boolean setterArg) { this.sensitiveTransaction = setterArg; return this; @@ -443,6 +521,7 @@ public static final class Builder { private @Nullable Boolean sticky; + @CanIgnoreReturnValue public @NonNull Builder setSticky(@NonNull Boolean setterArg) { this.sticky = setterArg; return this; @@ -450,6 +529,7 @@ public static final class Builder { private @Nullable Boolean useErrorDialgs; + @CanIgnoreReturnValue public @NonNull Builder setUseErrorDialgs(@NonNull Boolean setterArg) { this.useErrorDialgs = setterArg; return this; @@ -467,7 +547,7 @@ public static final class Builder { @NonNull ArrayList toList() { - ArrayList toListResult = new ArrayList(4); + ArrayList toListResult = new ArrayList<>(4); toListResult.add(biometricOnly); toListResult.add(sensitiveTransaction); toListResult.add(sticky); @@ -475,90 +555,42 @@ ArrayList toList() { return toListResult; } - static @NonNull AuthOptions fromList(@NonNull ArrayList list) { + static @NonNull AuthOptions fromList(@NonNull ArrayList pigeonVar_list) { AuthOptions pigeonResult = new AuthOptions(); - Object biometricOnly = list.get(0); + Object biometricOnly = pigeonVar_list.get(0); pigeonResult.setBiometricOnly((Boolean) biometricOnly); - Object sensitiveTransaction = list.get(1); + Object sensitiveTransaction = pigeonVar_list.get(1); pigeonResult.setSensitiveTransaction((Boolean) sensitiveTransaction); - Object sticky = list.get(2); + Object sticky = pigeonVar_list.get(2); pigeonResult.setSticky((Boolean) sticky); - Object useErrorDialgs = list.get(3); + Object useErrorDialgs = pigeonVar_list.get(3); pigeonResult.setUseErrorDialgs((Boolean) useErrorDialgs); return pigeonResult; } } - /** Generated class from Pigeon that represents data sent in messages. */ - public static final class AuthClassificationWrapper { - private @NonNull AuthClassification value; - - public @NonNull AuthClassification getValue() { - return value; - } - - public void setValue(@NonNull AuthClassification setterArg) { - if (setterArg == null) { - throw new IllegalStateException("Nonnull field \"value\" is null."); - } - this.value = setterArg; - } - - /** Constructor is non-public to enforce null safety; use Builder. */ - AuthClassificationWrapper() {} - - public static final class Builder { - - private @Nullable AuthClassification value; - - public @NonNull Builder setValue(@NonNull AuthClassification setterArg) { - this.value = setterArg; - return this; - } - - public @NonNull AuthClassificationWrapper build() { - AuthClassificationWrapper pigeonReturn = new AuthClassificationWrapper(); - pigeonReturn.setValue(value); - return pigeonReturn; - } - } - - @NonNull - ArrayList toList() { - ArrayList toListResult = new ArrayList(1); - toListResult.add(value == null ? null : value.index); - return toListResult; - } - - static @NonNull AuthClassificationWrapper fromList(@NonNull ArrayList list) { - AuthClassificationWrapper pigeonResult = new AuthClassificationWrapper(); - Object value = list.get(0); - pigeonResult.setValue(AuthClassification.values()[(int) value]); - return pigeonResult; - } - } - - public interface Result { - @SuppressWarnings("UnknownNullness") - void success(T result); - - void error(@NonNull Throwable error); - } + private static class PigeonCodec extends StandardMessageCodec { + public static final PigeonCodec INSTANCE = new PigeonCodec(); - private static class LocalAuthApiCodec extends StandardMessageCodec { - public static final LocalAuthApiCodec INSTANCE = new LocalAuthApiCodec(); - - private LocalAuthApiCodec() {} + private PigeonCodec() {} @Override protected Object readValueOfType(byte type, @NonNull ByteBuffer buffer) { switch (type) { - case (byte) 128: - return AuthClassificationWrapper.fromList((ArrayList) readValue(buffer)); case (byte) 129: - return AuthOptions.fromList((ArrayList) readValue(buffer)); + { + Object value = readValue(buffer); + return value == null ? null : AuthResult.values()[((Long) value).intValue()]; + } case (byte) 130: + { + Object value = readValue(buffer); + return value == null ? null : AuthClassification.values()[((Long) value).intValue()]; + } + case (byte) 131: return AuthStrings.fromList((ArrayList) readValue(buffer)); + case (byte) 132: + return AuthOptions.fromList((ArrayList) readValue(buffer)); default: return super.readValueOfType(type, buffer); } @@ -566,21 +598,48 @@ protected Object readValueOfType(byte type, @NonNull ByteBuffer buffer) { @Override protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { - if (value instanceof AuthClassificationWrapper) { - stream.write(128); - writeValue(stream, ((AuthClassificationWrapper) value).toList()); - } else if (value instanceof AuthOptions) { + if (value instanceof AuthResult) { stream.write(129); - writeValue(stream, ((AuthOptions) value).toList()); - } else if (value instanceof AuthStrings) { + writeValue(stream, value == null ? null : ((AuthResult) value).index); + } else if (value instanceof AuthClassification) { stream.write(130); + writeValue(stream, value == null ? null : ((AuthClassification) value).index); + } else if (value instanceof AuthStrings) { + stream.write(131); writeValue(stream, ((AuthStrings) value).toList()); + } else if (value instanceof AuthOptions) { + stream.write(132); + writeValue(stream, ((AuthOptions) value).toList()); } else { super.writeValue(stream, value); } } } + /** Asynchronous error handling return type for non-nullable API method returns. */ + public interface Result { + /** Success case callback method for handling returns. */ + void success(@NonNull T result); + + /** Failure case callback method for handling errors. */ + void error(@NonNull Throwable error); + } + /** Asynchronous error handling return type for nullable API method returns. */ + public interface NullableResult { + /** Success case callback method for handling returns. */ + void success(@Nullable T result); + + /** Failure case callback method for handling errors. */ + void error(@NonNull Throwable error); + } + /** Asynchronous error handling return type for void API method returns. */ + public interface VoidResult { + /** Success case callback method for handling returns. */ + void success(); + + /** Failure case callback method for handling errors. */ + void error(@NonNull Throwable error); + } /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface LocalAuthApi { /** Returns true if this device supports authentication. */ @@ -603,7 +662,7 @@ public interface LocalAuthApi { * Returns the biometric types that are enrolled, and can thus be used without additional setup. */ @NonNull - List getEnrolledBiometrics(); + List getEnrolledBiometrics(); /** * Attempts to authenticate the user with the provided [options], and using [strings] for any * UI. @@ -615,26 +674,34 @@ void authenticate( /** The codec used by LocalAuthApi. */ static @NonNull MessageCodec getCodec() { - return LocalAuthApiCodec.INSTANCE; + return PigeonCodec.INSTANCE; } /** Sets up an instance of `LocalAuthApi` to handle messages through the `binaryMessenger`. */ - static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable LocalAuthApi api) { + static void setUp(@NonNull BinaryMessenger binaryMessenger, @Nullable LocalAuthApi api) { + setUp(binaryMessenger, "", api); + } + + static void setUp( + @NonNull BinaryMessenger binaryMessenger, + @NonNull String messageChannelSuffix, + @Nullable LocalAuthApi api) { + messageChannelSuffix = messageChannelSuffix.isEmpty() ? "" : "." + messageChannelSuffix; { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.local_auth_android.LocalAuthApi.isDeviceSupported", + "dev.flutter.pigeon.local_auth_android.LocalAuthApi.isDeviceSupported" + + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); try { Boolean output = api.isDeviceSupported(); wrapped.add(0, output); } catch (Throwable exception) { - ArrayList wrappedError = wrapError(exception); - wrapped = wrappedError; + wrapped = wrapError(exception); } reply.reply(wrapped); }); @@ -646,18 +713,18 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable LocalAuthA BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.local_auth_android.LocalAuthApi.deviceCanSupportBiometrics", + "dev.flutter.pigeon.local_auth_android.LocalAuthApi.deviceCanSupportBiometrics" + + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); try { Boolean output = api.deviceCanSupportBiometrics(); wrapped.add(0, output); } catch (Throwable exception) { - ArrayList wrappedError = wrapError(exception); - wrapped = wrappedError; + wrapped = wrapError(exception); } reply.reply(wrapped); }); @@ -669,18 +736,18 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable LocalAuthA BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.local_auth_android.LocalAuthApi.stopAuthentication", + "dev.flutter.pigeon.local_auth_android.LocalAuthApi.stopAuthentication" + + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); try { Boolean output = api.stopAuthentication(); wrapped.add(0, output); } catch (Throwable exception) { - ArrayList wrappedError = wrapError(exception); - wrapped = wrappedError; + wrapped = wrapError(exception); } reply.reply(wrapped); }); @@ -692,18 +759,18 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable LocalAuthA BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.local_auth_android.LocalAuthApi.getEnrolledBiometrics", + "dev.flutter.pigeon.local_auth_android.LocalAuthApi.getEnrolledBiometrics" + + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); try { - List output = api.getEnrolledBiometrics(); + List output = api.getEnrolledBiometrics(); wrapped.add(0, output); } catch (Throwable exception) { - ArrayList wrappedError = wrapError(exception); - wrapped = wrappedError; + wrapped = wrapError(exception); } reply.reply(wrapped); }); @@ -715,19 +782,20 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable LocalAuthA BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.local_auth_android.LocalAuthApi.authenticate", + "dev.flutter.pigeon.local_auth_android.LocalAuthApi.authenticate" + + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; AuthOptions optionsArg = (AuthOptions) args.get(0); AuthStrings stringsArg = (AuthStrings) args.get(1); Result resultCallback = new Result() { public void success(AuthResult result) { - wrapped.add(0, result.index); + wrapped.add(0, result); reply.reply(wrapped); } diff --git a/packages/local_auth/local_auth_android/android/src/test/java/io/flutter/plugins/localauth/LocalAuthTest.java b/packages/local_auth/local_auth_android/android/src/test/java/io/flutter/plugins/localauth/LocalAuthTest.java index 5e7c14d68b20..1fbc20a78037 100644 --- a/packages/local_auth/local_auth_android/android/src/test/java/io/flutter/plugins/localauth/LocalAuthTest.java +++ b/packages/local_auth/local_auth_android/android/src/test/java/io/flutter/plugins/localauth/LocalAuthTest.java @@ -30,7 +30,6 @@ import io.flutter.plugin.common.BinaryMessenger; import io.flutter.plugins.localauth.AuthenticationHelper.AuthCompletionHandler; import io.flutter.plugins.localauth.Messages.AuthClassification; -import io.flutter.plugins.localauth.Messages.AuthClassificationWrapper; import io.flutter.plugins.localauth.Messages.AuthOptions; import io.flutter.plugins.localauth.Messages.AuthResult; import io.flutter.plugins.localauth.Messages.AuthStrings; @@ -291,7 +290,7 @@ public void getEnrolledBiometrics_shouldReturnEmptyList_withoutHardwarePresent() .thenReturn(BiometricManager.BIOMETRIC_ERROR_NO_HARDWARE); plugin.setBiometricManager(mockBiometricManager); - final List enrolled = plugin.getEnrolledBiometrics(); + final List enrolled = plugin.getEnrolledBiometrics(); assertTrue(enrolled.isEmpty()); } @@ -304,7 +303,7 @@ public void getEnrolledBiometrics_shouldReturnEmptyList_withNoMethodsEnrolled() .thenReturn(BiometricManager.BIOMETRIC_ERROR_NONE_ENROLLED); plugin.setBiometricManager(mockBiometricManager); - final List enrolled = plugin.getEnrolledBiometrics(); + final List enrolled = plugin.getEnrolledBiometrics(); assertTrue(enrolled.isEmpty()); } @@ -319,9 +318,9 @@ public void getEnrolledBiometrics_shouldOnlyAddEnrolledBiometrics() { .thenReturn(BiometricManager.BIOMETRIC_ERROR_NONE_ENROLLED); plugin.setBiometricManager(mockBiometricManager); - final List enrolled = plugin.getEnrolledBiometrics(); + final List enrolled = plugin.getEnrolledBiometrics(); assertEquals(1, enrolled.size()); - assertEquals(AuthClassification.WEAK, enrolled.get(0).getValue()); + assertEquals(AuthClassification.WEAK, enrolled.get(0)); } @Test @@ -335,10 +334,10 @@ public void getEnrolledBiometrics_shouldAddStrongBiometrics() { .thenReturn(BiometricManager.BIOMETRIC_SUCCESS); plugin.setBiometricManager(mockBiometricManager); - final List enrolled = plugin.getEnrolledBiometrics(); + final List enrolled = plugin.getEnrolledBiometrics(); assertEquals(2, enrolled.size()); - assertEquals(AuthClassification.WEAK, enrolled.get(0).getValue()); - assertEquals(AuthClassification.STRONG, enrolled.get(1).getValue()); + assertEquals(AuthClassification.WEAK, enrolled.get(0)); + assertEquals(AuthClassification.STRONG, enrolled.get(1)); } @Test diff --git a/packages/local_auth/local_auth_android/example/android/app/build.gradle b/packages/local_auth/local_auth_android/example/android/app/build.gradle index f075d5813cf9..2da8796f938e 100644 --- a/packages/local_auth/local_auth_android/example/android/app/build.gradle +++ b/packages/local_auth/local_auth_android/example/android/app/build.gradle @@ -32,7 +32,7 @@ android { defaultConfig { applicationId "io.flutter.plugins.localauthexample" minSdkVersion flutter.minSdkVersion - targetSdkVersion 28 + targetSdkVersion 34 versionCode flutterVersionCode.toInteger() versionName flutterVersionName testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 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..d951fac2bf31 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-8.7-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/packages/local_auth/local_auth_android/example/android/app/src/main/AndroidManifest.xml b/packages/local_auth/local_auth_android/example/android/app/src/main/AndroidManifest.xml index 4acc4eb87ed6..02d732716e62 100644 --- a/packages/local_auth/local_auth_android/example/android/app/src/main/AndroidManifest.xml +++ b/packages/local_auth/local_auth_android/example/android/app/src/main/AndroidManifest.xml @@ -6,7 +6,8 @@ =3.22.0" + sdk: ^3.5.0 + flutter: ">=3.24.0" dependencies: flutter: diff --git a/packages/local_auth/local_auth_android/lib/local_auth_android.dart b/packages/local_auth/local_auth_android/lib/local_auth_android.dart index cf117cb00667..3b1fd96059e0 100644 --- a/packages/local_auth/local_auth_android/lib/local_auth_android.dart +++ b/packages/local_auth/local_auth_android/lib/local_auth_android.dart @@ -95,12 +95,9 @@ class LocalAuthAndroid extends LocalAuthPlatform { @override Future> getEnrolledBiometrics() async { - final List result = - await _api.getEnrolledBiometrics(); - return result - .cast() - .map((AuthClassificationWrapper entry) { - switch (entry.value) { + final List result = await _api.getEnrolledBiometrics(); + return result.map((AuthClassification value) { + switch (value) { case AuthClassification.weak: return BiometricType.weak; case AuthClassification.strong: diff --git a/packages/local_auth/local_auth_android/lib/src/messages.g.dart b/packages/local_auth/local_auth_android/lib/src/messages.g.dart index 77f5215596b7..590562c03709 100644 --- a/packages/local_auth/local_auth_android/lib/src/messages.g.dart +++ b/packages/local_auth/local_auth_android/lib/src/messages.g.dart @@ -1,9 +1,9 @@ // 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 (v11.0.0), do not edit directly. +// Autogenerated from Pigeon (v22.4.0), 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 +// 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, no_leading_underscores_for_local_identifiers import 'dart:async'; import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List; @@ -11,6 +11,13 @@ import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List; import 'package:flutter/foundation.dart' show ReadBuffer, WriteBuffer; import 'package:flutter/services.dart'; +PlatformException _createConnectionError(String channelName) { + return PlatformException( + code: 'channel-error', + message: 'Unable to establish connection on channel: "$channelName".', + ); +} + /// Possible outcomes of an authentication attempt. enum AuthResult { /// The user authenticated successfully. @@ -153,39 +160,24 @@ class AuthOptions { } } -class AuthClassificationWrapper { - AuthClassificationWrapper({ - required this.value, - }); - - AuthClassification value; - - Object encode() { - return [ - value.index, - ]; - } - - static AuthClassificationWrapper decode(Object result) { - result as List; - return AuthClassificationWrapper( - value: AuthClassification.values[result[0]! as int], - ); - } -} - -class _LocalAuthApiCodec extends StandardMessageCodec { - const _LocalAuthApiCodec(); +class _PigeonCodec extends StandardMessageCodec { + const _PigeonCodec(); @override void writeValue(WriteBuffer buffer, Object? value) { - if (value is AuthClassificationWrapper) { - buffer.putUint8(128); - writeValue(buffer, value.encode()); - } else if (value is AuthOptions) { + if (value is int) { + buffer.putUint8(4); + buffer.putInt64(value); + } else if (value is AuthResult) { buffer.putUint8(129); - writeValue(buffer, value.encode()); - } else if (value is AuthStrings) { + writeValue(buffer, value.index); + } else if (value is AuthClassification) { buffer.putUint8(130); + writeValue(buffer, value.index); + } else if (value is AuthStrings) { + buffer.putUint8(131); + writeValue(buffer, value.encode()); + } else if (value is AuthOptions) { + buffer.putUint8(132); writeValue(buffer, value.encode()); } else { super.writeValue(buffer, value); @@ -195,12 +187,16 @@ class _LocalAuthApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: - return AuthClassificationWrapper.decode(readValue(buffer)!); case 129: - return AuthOptions.decode(readValue(buffer)!); + final int? value = readValue(buffer) as int?; + return value == null ? null : AuthResult.values[value]; case 130: + final int? value = readValue(buffer) as int?; + return value == null ? null : AuthClassification.values[value]; + case 131: return AuthStrings.decode(readValue(buffer)!); + case 132: + return AuthOptions.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); } @@ -211,66 +207,75 @@ class LocalAuthApi { /// Constructor for [LocalAuthApi]. The [binaryMessenger] named argument is /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. - LocalAuthApi({BinaryMessenger? binaryMessenger}) - : _binaryMessenger = binaryMessenger; - final BinaryMessenger? _binaryMessenger; + LocalAuthApi( + {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) + : pigeonVar_binaryMessenger = binaryMessenger, + pigeonVar_messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + final BinaryMessenger? pigeonVar_binaryMessenger; + + static const MessageCodec pigeonChannelCodec = _PigeonCodec(); - static const MessageCodec codec = _LocalAuthApiCodec(); + final String pigeonVar_messageChannelSuffix; /// Returns true if this device supports authentication. Future isDeviceSupported() async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.local_auth_android.LocalAuthApi.isDeviceSupported', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send(null) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.local_auth_android.LocalAuthApi.isDeviceSupported$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (replyList[0] == null) { + } else if (pigeonVar_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 (pigeonVar_replyList[0] as bool?)!; } } /// Returns true if this device can support biometric authentication, whether /// any biometrics are enrolled or not. Future deviceCanSupportBiometrics() async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.local_auth_android.LocalAuthApi.deviceCanSupportBiometrics', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send(null) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.local_auth_android.LocalAuthApi.deviceCanSupportBiometrics$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (replyList[0] == null) { + } else if (pigeonVar_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 (pigeonVar_replyList[0] as bool?)!; } } @@ -279,90 +284,95 @@ class LocalAuthApi { /// Returns true only if authentication was in progress, and was successfully /// cancelled. Future stopAuthentication() async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.local_auth_android.LocalAuthApi.stopAuthentication', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send(null) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.local_auth_android.LocalAuthApi.stopAuthentication$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (replyList[0] == null) { + } else if (pigeonVar_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 (pigeonVar_replyList[0] as bool?)!; } } /// Returns the biometric types that are enrolled, and can thus be used /// without additional setup. - Future> getEnrolledBiometrics() async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.local_auth_android.LocalAuthApi.getEnrolledBiometrics', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send(null) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + Future> getEnrolledBiometrics() async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.local_auth_android.LocalAuthApi.getEnrolledBiometrics$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (replyList[0] as List?)! - .cast(); + return (pigeonVar_replyList[0] as List?)! + .cast(); } } /// Attempts to authenticate the user with the provided [options], and using /// [strings] for any UI. Future authenticate( - AuthOptions arg_options, AuthStrings arg_strings) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.local_auth_android.LocalAuthApi.authenticate', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = await channel - .send([arg_options, arg_strings]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + AuthOptions options, AuthStrings strings) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.local_auth_android.LocalAuthApi.authenticate$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = await pigeonVar_channel + .send([options, strings]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return AuthResult.values[replyList[0]! as int]; + return (pigeonVar_replyList[0] as AuthResult?)!; } } } diff --git a/packages/local_auth/local_auth_android/pigeons/messages.dart b/packages/local_auth/local_auth_android/pigeons/messages.dart index 622c1657cd6a..b08936637e27 100644 --- a/packages/local_auth/local_auth_android/pigeons/messages.dart +++ b/packages/local_auth/local_auth_android/pigeons/messages.dart @@ -87,13 +87,6 @@ class AuthOptions { /// Pigeon equivalent of the subset of BiometricType used by Android. enum AuthClassification { weak, strong } -// TODO(stuartmorgan): Remove this when -// https://github.com/flutter/flutter/issues/87307 is implemented. -class AuthClassificationWrapper { - AuthClassificationWrapper({required this.value}); - final AuthClassification value; -} - @HostApi() abstract class LocalAuthApi { /// Returns true if this device supports authentication. @@ -111,7 +104,7 @@ abstract class LocalAuthApi { /// Returns the biometric types that are enrolled, and can thus be used /// without additional setup. - List getEnrolledBiometrics(); + List getEnrolledBiometrics(); /// Attempts to authenticate the user with the provided [options], and using /// [strings] for any UI. diff --git a/packages/local_auth/local_auth_android/pubspec.yaml b/packages/local_auth/local_auth_android/pubspec.yaml index fb1e80fd2f44..b75c2440797e 100644 --- a/packages/local_auth/local_auth_android/pubspec.yaml +++ b/packages/local_auth/local_auth_android/pubspec.yaml @@ -2,11 +2,11 @@ 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.43 +version: 1.0.46 environment: - sdk: ^3.4.0 - flutter: ">=3.22.0" + sdk: ^3.5.0 + flutter: ">=3.24.0" flutter: plugin: @@ -28,8 +28,8 @@ dev_dependencies: build_runner: ^2.3.3 flutter_test: sdk: flutter - mockito: 5.4.4 - pigeon: ^11.0.0 + mockito: ^5.4.4 + pigeon: ^22.4.0 topics: - authentication diff --git a/packages/local_auth/local_auth_android/test/local_auth_test.dart b/packages/local_auth/local_auth_android/test/local_auth_test.dart index d37898105a4b..4c3785c96721 100644 --- a/packages/local_auth/local_auth_android/test/local_auth_test.dart +++ b/packages/local_auth/local_auth_android/test/local_auth_test.dart @@ -66,9 +66,9 @@ void main() { group('getEnrolledBiometrics', () { test('translates values', () async { when(api.getEnrolledBiometrics()) - .thenAnswer((_) async => [ - AuthClassificationWrapper(value: AuthClassification.weak), - AuthClassificationWrapper(value: AuthClassification.strong), + .thenAnswer((_) async => [ + AuthClassification.weak, + AuthClassification.strong, ]); final List result = await plugin.getEnrolledBiometrics(); @@ -81,7 +81,7 @@ void main() { test('handles empty', () async { when(api.getEnrolledBiometrics()) - .thenAnswer((_) async => []); + .thenAnswer((_) async => []); final List result = await plugin.getEnrolledBiometrics(); 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 9f38167c3fd6..e09d0bda114e 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 @@ -3,10 +3,11 @@ // Do not manually edit this file. // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:async' as _i3; +import 'dart:async' as _i4; import 'package:local_auth_android/src/messages.g.dart' as _i2; import 'package:mockito/mockito.dart' as _i1; +import 'package:mockito/src/dummies.dart' as _i3; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values @@ -30,56 +31,65 @@ class MockLocalAuthApi extends _i1.Mock implements _i2.LocalAuthApi { } @override - _i3.Future isDeviceSupported() => (super.noSuchMethod( + String get pigeonVar_messageChannelSuffix => (super.noSuchMethod( + Invocation.getter(#pigeonVar_messageChannelSuffix), + returnValue: _i3.dummyValue( + this, + Invocation.getter(#pigeonVar_messageChannelSuffix), + ), + ) as String); + + @override + _i4.Future isDeviceSupported() => (super.noSuchMethod( Invocation.method( #isDeviceSupported, [], ), - returnValue: _i3.Future.value(false), - ) as _i3.Future); + returnValue: _i4.Future.value(false), + ) as _i4.Future); @override - _i3.Future deviceCanSupportBiometrics() => (super.noSuchMethod( + _i4.Future deviceCanSupportBiometrics() => (super.noSuchMethod( Invocation.method( #deviceCanSupportBiometrics, [], ), - returnValue: _i3.Future.value(false), - ) as _i3.Future); + returnValue: _i4.Future.value(false), + ) as _i4.Future); @override - _i3.Future stopAuthentication() => (super.noSuchMethod( + _i4.Future stopAuthentication() => (super.noSuchMethod( Invocation.method( #stopAuthentication, [], ), - returnValue: _i3.Future.value(false), - ) as _i3.Future); + returnValue: _i4.Future.value(false), + ) as _i4.Future); @override - _i3.Future> getEnrolledBiometrics() => + _i4.Future> getEnrolledBiometrics() => (super.noSuchMethod( Invocation.method( #getEnrolledBiometrics, [], ), - returnValue: _i3.Future>.value( - <_i2.AuthClassificationWrapper?>[]), - ) as _i3.Future>); + returnValue: _i4.Future>.value( + <_i2.AuthClassification>[]), + ) as _i4.Future>); @override - _i3.Future<_i2.AuthResult> authenticate( - _i2.AuthOptions? arg_options, - _i2.AuthStrings? arg_strings, + _i4.Future<_i2.AuthResult> authenticate( + _i2.AuthOptions? options, + _i2.AuthStrings? strings, ) => (super.noSuchMethod( Invocation.method( #authenticate, [ - arg_options, - arg_strings, + options, + strings, ], ), - returnValue: _i3.Future<_i2.AuthResult>.value(_i2.AuthResult.success), - ) as _i3.Future<_i2.AuthResult>); + returnValue: _i4.Future<_i2.AuthResult>.value(_i2.AuthResult.success), + ) as _i4.Future<_i2.AuthResult>); } diff --git a/packages/local_auth/local_auth_darwin/CHANGELOG.md b/packages/local_auth/local_auth_darwin/CHANGELOG.md index 9b2c11b62b48..1002a874e2f3 100644 --- a/packages/local_auth/local_auth_darwin/CHANGELOG.md +++ b/packages/local_auth/local_auth_darwin/CHANGELOG.md @@ -1,5 +1,6 @@ -## NEXT +## 1.4.1 +* Updates to the current version of Pigeon. * Updates minimum supported SDK version to Flutter 3.19/Dart 3.3. ## 1.4.0 diff --git a/packages/local_auth/local_auth_darwin/darwin/local_auth_darwin/Sources/local_auth_darwin/FLALocalAuthPlugin.m b/packages/local_auth/local_auth_darwin/darwin/local_auth_darwin/Sources/local_auth_darwin/FLALocalAuthPlugin.m index 00cb00eb0a9b..bc50a59a41f3 100644 --- a/packages/local_auth/local_auth_darwin/darwin/local_auth_darwin/Sources/local_auth_darwin/FLALocalAuthPlugin.m +++ b/packages/local_auth/local_auth_darwin/darwin/local_auth_darwin/Sources/local_auth_darwin/FLALocalAuthPlugin.m @@ -322,23 +322,23 @@ - (nullable NSNumber *)deviceCanSupportBiometricsWithError: return @NO; } -- (nullable NSArray *)getEnrolledBiometricsWithError: +- (nullable NSArray *)getEnrolledBiometricsWithError: (FlutterError *_Nullable __autoreleasing *_Nonnull)error { id context = [self.authContextFactory createAuthContext]; NSError *authError = nil; - NSMutableArray *biometrics = [[NSMutableArray alloc] init]; + NSMutableArray *biometrics = [[NSMutableArray alloc] init]; if ([context canEvaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics error:&authError]) { if (authError == nil) { if (@available(macOS 10.15, iOS 11.0, *)) { if (context.biometryType == LABiometryTypeFaceID) { - [biometrics addObject:[FLADAuthBiometricWrapper makeWithValue:FLADAuthBiometricFace]]; + [biometrics addObject:[[FLADAuthBiometricBox alloc] initWithValue:FLADAuthBiometricFace]]; return biometrics; } } if (context.biometryType == LABiometryTypeTouchID) { [biometrics - addObject:[FLADAuthBiometricWrapper makeWithValue:FLADAuthBiometricFingerprint]]; + addObject:[[FLADAuthBiometricBox alloc] initWithValue:FLADAuthBiometricFingerprint]]; } } } diff --git a/packages/local_auth/local_auth_darwin/darwin/local_auth_darwin/Sources/local_auth_darwin/include/local_auth_darwin/messages.g.h b/packages/local_auth/local_auth_darwin/darwin/local_auth_darwin/Sources/local_auth_darwin/include/local_auth_darwin/messages.g.h index 7f77dc6ea9f5..3e64f6e9e0ac 100644 --- a/packages/local_auth/local_auth_darwin/darwin/local_auth_darwin/Sources/local_auth_darwin/include/local_auth_darwin/messages.g.h +++ b/packages/local_auth/local_auth_darwin/darwin/local_auth_darwin/Sources/local_auth_darwin/include/local_auth_darwin/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.1.2), do not edit directly. +// Autogenerated from Pigeon (v22.4.0), do not edit directly. // See also: https://pub.dev/packages/pigeon #import @@ -48,7 +48,6 @@ typedef NS_ENUM(NSUInteger, FLADAuthBiometric) { @class FLADAuthStrings; @class FLADAuthOptions; @class FLADAuthResultDetails; -@class FLADAuthBiometricWrapper; /// Pigeon version of IOSAuthMessages, plus the authorization reason. /// @@ -95,15 +94,8 @@ typedef NS_ENUM(NSUInteger, FLADAuthBiometric) { @property(nonatomic, copy, nullable) NSString *errorDetails; @end -@interface FLADAuthBiometricWrapper : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithValue:(FLADAuthBiometric)value; -@property(nonatomic, assign) FLADAuthBiometric value; -@end - -/// The codec used by FLADLocalAuthApi. -NSObject *FLADLocalAuthApiGetCodec(void); +/// The codec used by all APIs. +NSObject *FLADGetMessagesCodec(void); @protocol FLADLocalAuthApi /// Returns true if this device supports authentication. @@ -119,7 +111,7 @@ NSObject *FLADLocalAuthApiGetCodec(void); /// without additional setup. /// /// @return `nil` only when `error != nil`. -- (nullable NSArray *)getEnrolledBiometricsWithError: +- (nullable NSArray *)getEnrolledBiometricsWithError: (FlutterError *_Nullable *_Nonnull)error; /// Attempts to authenticate the user with the provided [options], and using /// [strings] for any UI. @@ -132,4 +124,8 @@ NSObject *FLADLocalAuthApiGetCodec(void); extern void SetUpFLADLocalAuthApi(id binaryMessenger, NSObject *_Nullable api); +extern void SetUpFLADLocalAuthApiWithSuffix(id binaryMessenger, + NSObject *_Nullable api, + NSString *messageChannelSuffix); + NS_ASSUME_NONNULL_END diff --git a/packages/local_auth/local_auth_darwin/darwin/local_auth_darwin/Sources/local_auth_darwin/messages.g.m b/packages/local_auth/local_auth_darwin/darwin/local_auth_darwin/Sources/local_auth_darwin/messages.g.m index 7a316a14359f..b43fcf138b71 100644 --- a/packages/local_auth/local_auth_darwin/darwin/local_auth_darwin/Sources/local_auth_darwin/messages.g.m +++ b/packages/local_auth/local_auth_darwin/darwin/local_auth_darwin/Sources/local_auth_darwin/messages.g.m @@ -1,11 +1,9 @@ // 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.1.2), do not edit directly. +// Autogenerated from Pigeon (v22.4.0), do not edit directly. // See also: https://pub.dev/packages/pigeon -// The line below is manually edited. See: -// https://github.com/flutter/flutter/issues/147587 #import "./include/local_auth_darwin/messages.g.h" #if TARGET_OS_OSX @@ -18,7 +16,7 @@ #error File requires ARC to be enabled. #endif -static NSArray *wrapResult(id result, FlutterError *error) { +static NSArray *wrapResult(id result, FlutterError *error) { if (error) { return @[ error.code ?: [NSNull null], error.message ?: [NSNull null], error.details ?: [NSNull null] @@ -27,7 +25,7 @@ return @[ result ?: [NSNull null] ]; } -static id GetNullableObjectAtIndex(NSArray *array, NSInteger key) { +static id GetNullableObjectAtIndex(NSArray *array, NSInteger key) { id result = array[key]; return (result == [NSNull null]) ? nil : result; } @@ -55,27 +53,21 @@ - (instancetype)initWithValue:(FLADAuthBiometric)value { @end @interface FLADAuthStrings () -+ (FLADAuthStrings *)fromList:(NSArray *)list; -+ (nullable FLADAuthStrings *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; ++ (FLADAuthStrings *)fromList:(NSArray *)list; ++ (nullable FLADAuthStrings *)nullableFromList:(NSArray *)list; +- (NSArray *)toList; @end @interface FLADAuthOptions () -+ (FLADAuthOptions *)fromList:(NSArray *)list; -+ (nullable FLADAuthOptions *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; ++ (FLADAuthOptions *)fromList:(NSArray *)list; ++ (nullable FLADAuthOptions *)nullableFromList:(NSArray *)list; +- (NSArray *)toList; @end @interface FLADAuthResultDetails () -+ (FLADAuthResultDetails *)fromList:(NSArray *)list; -+ (nullable FLADAuthResultDetails *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FLADAuthBiometricWrapper () -+ (FLADAuthBiometricWrapper *)fromList:(NSArray *)list; -+ (nullable FLADAuthBiometricWrapper *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; ++ (FLADAuthResultDetails *)fromList:(NSArray *)list; ++ (nullable FLADAuthResultDetails *)nullableFromList:(NSArray *)list; +- (NSArray *)toList; @end @implementation FLADAuthStrings @@ -94,7 +86,7 @@ + (instancetype)makeWithReason:(NSString *)reason pigeonResult.localizedFallbackTitle = localizedFallbackTitle; return pigeonResult; } -+ (FLADAuthStrings *)fromList:(NSArray *)list { ++ (FLADAuthStrings *)fromList:(NSArray *)list { FLADAuthStrings *pigeonResult = [[FLADAuthStrings alloc] init]; pigeonResult.reason = GetNullableObjectAtIndex(list, 0); pigeonResult.lockOut = GetNullableObjectAtIndex(list, 1); @@ -104,10 +96,10 @@ + (FLADAuthStrings *)fromList:(NSArray *)list { pigeonResult.localizedFallbackTitle = GetNullableObjectAtIndex(list, 5); return pigeonResult; } -+ (nullable FLADAuthStrings *)nullableFromList:(NSArray *)list { ++ (nullable FLADAuthStrings *)nullableFromList:(NSArray *)list { return (list) ? [FLADAuthStrings fromList:list] : nil; } -- (NSArray *)toList { +- (NSArray *)toList { return @[ self.reason ?: [NSNull null], self.lockOut ?: [NSNull null], @@ -129,17 +121,17 @@ + (instancetype)makeWithBiometricOnly:(BOOL)biometricOnly pigeonResult.useErrorDialogs = useErrorDialogs; return pigeonResult; } -+ (FLADAuthOptions *)fromList:(NSArray *)list { ++ (FLADAuthOptions *)fromList:(NSArray *)list { FLADAuthOptions *pigeonResult = [[FLADAuthOptions alloc] init]; pigeonResult.biometricOnly = [GetNullableObjectAtIndex(list, 0) boolValue]; pigeonResult.sticky = [GetNullableObjectAtIndex(list, 1) boolValue]; pigeonResult.useErrorDialogs = [GetNullableObjectAtIndex(list, 2) boolValue]; return pigeonResult; } -+ (nullable FLADAuthOptions *)nullableFromList:(NSArray *)list { ++ (nullable FLADAuthOptions *)nullableFromList:(NSArray *)list { return (list) ? [FLADAuthOptions fromList:list] : nil; } -- (NSArray *)toList { +- (NSArray *)toList { return @[ @(self.biometricOnly), @(self.sticky), @@ -158,117 +150,123 @@ + (instancetype)makeWithResult:(FLADAuthResult)result pigeonResult.errorDetails = errorDetails; return pigeonResult; } -+ (FLADAuthResultDetails *)fromList:(NSArray *)list { ++ (FLADAuthResultDetails *)fromList:(NSArray *)list { FLADAuthResultDetails *pigeonResult = [[FLADAuthResultDetails alloc] init]; - pigeonResult.result = [GetNullableObjectAtIndex(list, 0) integerValue]; + FLADAuthResultBox *boxedFLADAuthResult = GetNullableObjectAtIndex(list, 0); + pigeonResult.result = boxedFLADAuthResult.value; pigeonResult.errorMessage = GetNullableObjectAtIndex(list, 1); pigeonResult.errorDetails = GetNullableObjectAtIndex(list, 2); return pigeonResult; } -+ (nullable FLADAuthResultDetails *)nullableFromList:(NSArray *)list { ++ (nullable FLADAuthResultDetails *)nullableFromList:(NSArray *)list { return (list) ? [FLADAuthResultDetails fromList:list] : nil; } -- (NSArray *)toList { +- (NSArray *)toList { return @[ - @(self.result), + [[FLADAuthResultBox alloc] initWithValue:self.result], self.errorMessage ?: [NSNull null], self.errorDetails ?: [NSNull null], ]; } @end -@implementation FLADAuthBiometricWrapper -+ (instancetype)makeWithValue:(FLADAuthBiometric)value { - FLADAuthBiometricWrapper *pigeonResult = [[FLADAuthBiometricWrapper alloc] init]; - pigeonResult.value = value; - return pigeonResult; -} -+ (FLADAuthBiometricWrapper *)fromList:(NSArray *)list { - FLADAuthBiometricWrapper *pigeonResult = [[FLADAuthBiometricWrapper alloc] init]; - pigeonResult.value = [GetNullableObjectAtIndex(list, 0) integerValue]; - return pigeonResult; -} -+ (nullable FLADAuthBiometricWrapper *)nullableFromList:(NSArray *)list { - return (list) ? [FLADAuthBiometricWrapper fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - @(self.value), - ]; -} -@end - -@interface FLADLocalAuthApiCodecReader : FlutterStandardReader +@interface FLADMessagesPigeonCodecReader : FlutterStandardReader @end -@implementation FLADLocalAuthApiCodecReader +@implementation FLADMessagesPigeonCodecReader - (nullable id)readValueOfType:(UInt8)type { switch (type) { - case 128: - return [FLADAuthBiometricWrapper fromList:[self readValue]]; - case 129: - return [FLADAuthOptions fromList:[self readValue]]; - case 130: - return [FLADAuthResultDetails fromList:[self readValue]]; + case 129: { + NSNumber *enumAsNumber = [self readValue]; + return enumAsNumber == nil + ? nil + : [[FLADAuthResultBox alloc] initWithValue:[enumAsNumber integerValue]]; + } + case 130: { + NSNumber *enumAsNumber = [self readValue]; + return enumAsNumber == nil + ? nil + : [[FLADAuthBiometricBox alloc] initWithValue:[enumAsNumber integerValue]]; + } case 131: return [FLADAuthStrings fromList:[self readValue]]; + case 132: + return [FLADAuthOptions fromList:[self readValue]]; + case 133: + return [FLADAuthResultDetails fromList:[self readValue]]; default: return [super readValueOfType:type]; } } @end -@interface FLADLocalAuthApiCodecWriter : FlutterStandardWriter +@interface FLADMessagesPigeonCodecWriter : FlutterStandardWriter @end -@implementation FLADLocalAuthApiCodecWriter +@implementation FLADMessagesPigeonCodecWriter - (void)writeValue:(id)value { - if ([value isKindOfClass:[FLADAuthBiometricWrapper class]]) { - [self writeByte:128]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FLADAuthOptions class]]) { + if ([value isKindOfClass:[FLADAuthResultBox class]]) { + FLADAuthResultBox *box = (FLADAuthResultBox *)value; [self writeByte:129]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FLADAuthResultDetails class]]) { + [self writeValue:(value == nil ? [NSNull null] : [NSNumber numberWithInteger:box.value])]; + } else if ([value isKindOfClass:[FLADAuthBiometricBox class]]) { + FLADAuthBiometricBox *box = (FLADAuthBiometricBox *)value; [self writeByte:130]; - [self writeValue:[value toList]]; + [self writeValue:(value == nil ? [NSNull null] : [NSNumber numberWithInteger:box.value])]; } else if ([value isKindOfClass:[FLADAuthStrings class]]) { [self writeByte:131]; [self writeValue:[value toList]]; + } else if ([value isKindOfClass:[FLADAuthOptions class]]) { + [self writeByte:132]; + [self writeValue:[value toList]]; + } else if ([value isKindOfClass:[FLADAuthResultDetails class]]) { + [self writeByte:133]; + [self writeValue:[value toList]]; } else { [super writeValue:value]; } } @end -@interface FLADLocalAuthApiCodecReaderWriter : FlutterStandardReaderWriter +@interface FLADMessagesPigeonCodecReaderWriter : FlutterStandardReaderWriter @end -@implementation FLADLocalAuthApiCodecReaderWriter +@implementation FLADMessagesPigeonCodecReaderWriter - (FlutterStandardWriter *)writerWithData:(NSMutableData *)data { - return [[FLADLocalAuthApiCodecWriter alloc] initWithData:data]; + return [[FLADMessagesPigeonCodecWriter alloc] initWithData:data]; } - (FlutterStandardReader *)readerWithData:(NSData *)data { - return [[FLADLocalAuthApiCodecReader alloc] initWithData:data]; + return [[FLADMessagesPigeonCodecReader alloc] initWithData:data]; } @end -NSObject *FLADLocalAuthApiGetCodec(void) { +NSObject *FLADGetMessagesCodec(void) { static FlutterStandardMessageCodec *sSharedObject = nil; static dispatch_once_t sPred = 0; dispatch_once(&sPred, ^{ - FLADLocalAuthApiCodecReaderWriter *readerWriter = - [[FLADLocalAuthApiCodecReaderWriter alloc] init]; + FLADMessagesPigeonCodecReaderWriter *readerWriter = + [[FLADMessagesPigeonCodecReaderWriter alloc] init]; sSharedObject = [FlutterStandardMessageCodec codecWithReaderWriter:readerWriter]; }); return sSharedObject; } - void SetUpFLADLocalAuthApi(id binaryMessenger, NSObject *api) { + SetUpFLADLocalAuthApiWithSuffix(binaryMessenger, api, @""); +} + +void SetUpFLADLocalAuthApiWithSuffix(id binaryMessenger, + NSObject *api, + NSString *messageChannelSuffix) { + messageChannelSuffix = messageChannelSuffix.length > 0 + ? [NSString stringWithFormat:@".%@", messageChannelSuffix] + : @""; /// Returns true if this device supports authentication. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.local_auth_darwin.LocalAuthApi.isDeviceSupported" + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.local_auth_darwin." + @"LocalAuthApi.isDeviceSupported", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLADLocalAuthApiGetCodec()]; + codec:FLADGetMessagesCodec()]; if (api) { NSCAssert( [api respondsToSelector:@selector(isDeviceSupportedWithError:)], @@ -287,10 +285,12 @@ void SetUpFLADLocalAuthApi(id binaryMessenger, /// any biometrics are enrolled or not. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - @"dev.flutter.pigeon.local_auth_darwin.LocalAuthApi.deviceCanSupportBiometrics" + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.local_auth_darwin." + @"LocalAuthApi.deviceCanSupportBiometrics", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLADLocalAuthApiGetCodec()]; + codec:FLADGetMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(deviceCanSupportBiometricsWithError:)], @"FLADLocalAuthApi api (%@) doesn't respond to " @@ -309,9 +309,12 @@ void SetUpFLADLocalAuthApi(id binaryMessenger, /// without additional setup. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.local_auth_darwin.LocalAuthApi.getEnrolledBiometrics" + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.local_auth_darwin." + @"LocalAuthApi.getEnrolledBiometrics", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLADLocalAuthApiGetCodec()]; + codec:FLADGetMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(getEnrolledBiometricsWithError:)], @"FLADLocalAuthApi api (%@) doesn't respond to " @@ -319,7 +322,7 @@ void SetUpFLADLocalAuthApi(id binaryMessenger, api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { FlutterError *error; - NSArray *output = [api getEnrolledBiometricsWithError:&error]; + NSArray *output = [api getEnrolledBiometricsWithError:&error]; callback(wrapResult(output, error)); }]; } else { @@ -330,16 +333,20 @@ void SetUpFLADLocalAuthApi(id binaryMessenger, /// [strings] for any UI. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.local_auth_darwin.LocalAuthApi.authenticate" + initWithName:[NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.local_auth_darwin.LocalAuthApi.authenticate", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLADLocalAuthApiGetCodec()]; + codec:FLADGetMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(authenticateWithOptions:strings:completion:)], @"FLADLocalAuthApi api (%@) doesn't respond to " @"@selector(authenticateWithOptions:strings:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; FLADAuthOptions *arg_options = GetNullableObjectAtIndex(args, 0); FLADAuthStrings *arg_strings = GetNullableObjectAtIndex(args, 1); [api authenticateWithOptions:arg_options diff --git a/packages/local_auth/local_auth_darwin/lib/local_auth_darwin.dart b/packages/local_auth/local_auth_darwin/lib/local_auth_darwin.dart index 4552330a2125..935d274efa6c 100644 --- a/packages/local_auth/local_auth_darwin/lib/local_auth_darwin.dart +++ b/packages/local_auth/local_auth_darwin/lib/local_auth_darwin.dart @@ -85,12 +85,9 @@ class LocalAuthDarwin extends LocalAuthPlatform { @override Future> getEnrolledBiometrics() async { - final List result = - await _api.getEnrolledBiometrics(); - return result - .cast() - .map((AuthBiometricWrapper entry) { - switch (entry.value) { + final List result = await _api.getEnrolledBiometrics(); + return result.map((AuthBiometric value) { + switch (value) { case AuthBiometric.face: return BiometricType.face; case AuthBiometric.fingerprint: diff --git a/packages/local_auth/local_auth_darwin/lib/src/messages.g.dart b/packages/local_auth/local_auth_darwin/lib/src/messages.g.dart index 25ccf3d46cb7..51b921c1540b 100644 --- a/packages/local_auth/local_auth_darwin/lib/src/messages.g.dart +++ b/packages/local_auth/local_auth_darwin/lib/src/messages.g.dart @@ -1,9 +1,9 @@ // 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.1.2), do not edit directly. +// Autogenerated from Pigeon (v22.4.0), 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 +// 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, no_leading_underscores_for_local_identifiers import 'dart:async'; import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List; @@ -140,7 +140,7 @@ class AuthResultDetails { Object encode() { return [ - result.index, + result, errorMessage, errorDetails, ]; @@ -149,50 +149,35 @@ class AuthResultDetails { static AuthResultDetails decode(Object result) { result as List; return AuthResultDetails( - result: AuthResult.values[result[0]! as int], + result: result[0]! as AuthResult, errorMessage: result[1] as String?, errorDetails: result[2] as String?, ); } } -class AuthBiometricWrapper { - AuthBiometricWrapper({ - required this.value, - }); - - AuthBiometric value; - - Object encode() { - return [ - value.index, - ]; - } - - static AuthBiometricWrapper decode(Object result) { - result as List; - return AuthBiometricWrapper( - value: AuthBiometric.values[result[0]! as int], - ); - } -} - -class _LocalAuthApiCodec extends StandardMessageCodec { - const _LocalAuthApiCodec(); +class _PigeonCodec extends StandardMessageCodec { + const _PigeonCodec(); @override void writeValue(WriteBuffer buffer, Object? value) { - if (value is AuthBiometricWrapper) { - buffer.putUint8(128); - writeValue(buffer, value.encode()); - } else if (value is AuthOptions) { + if (value is int) { + buffer.putUint8(4); + buffer.putInt64(value); + } else if (value is AuthResult) { buffer.putUint8(129); - writeValue(buffer, value.encode()); - } else if (value is AuthResultDetails) { + writeValue(buffer, value.index); + } else if (value is AuthBiometric) { buffer.putUint8(130); - writeValue(buffer, value.encode()); + writeValue(buffer, value.index); } else if (value is AuthStrings) { buffer.putUint8(131); writeValue(buffer, value.encode()); + } else if (value is AuthOptions) { + buffer.putUint8(132); + writeValue(buffer, value.encode()); + } else if (value is AuthResultDetails) { + buffer.putUint8(133); + writeValue(buffer, value.encode()); } else { super.writeValue(buffer, value); } @@ -201,14 +186,18 @@ class _LocalAuthApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: - return AuthBiometricWrapper.decode(readValue(buffer)!); case 129: - return AuthOptions.decode(readValue(buffer)!); + final int? value = readValue(buffer) as int?; + return value == null ? null : AuthResult.values[value]; case 130: - return AuthResultDetails.decode(readValue(buffer)!); + final int? value = readValue(buffer) as int?; + return value == null ? null : AuthBiometric.values[value]; case 131: return AuthStrings.decode(readValue(buffer)!); + case 132: + return AuthOptions.decode(readValue(buffer)!); + case 133: + return AuthResultDetails.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); } @@ -219,126 +208,138 @@ class LocalAuthApi { /// Constructor for [LocalAuthApi]. The [binaryMessenger] named argument is /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. - LocalAuthApi({BinaryMessenger? binaryMessenger}) - : _binaryMessenger = binaryMessenger; - final BinaryMessenger? _binaryMessenger; + LocalAuthApi( + {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) + : pigeonVar_binaryMessenger = binaryMessenger, + pigeonVar_messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + final BinaryMessenger? pigeonVar_binaryMessenger; + + static const MessageCodec pigeonChannelCodec = _PigeonCodec(); - static const MessageCodec codec = _LocalAuthApiCodec(); + final String pigeonVar_messageChannelSuffix; /// Returns true if this device supports authentication. Future isDeviceSupported() async { - const String channelName = - 'dev.flutter.pigeon.local_auth_darwin.LocalAuthApi.isDeviceSupported'; - final BasicMessageChannel channel = BasicMessageChannel( - channelName, - codec, - binaryMessenger: _binaryMessenger, + final String pigeonVar_channelName = + 'dev.flutter.pigeon.local_auth_darwin.LocalAuthApi.isDeviceSupported$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? replyList = await channel.send(null) as List?; - if (replyList == null) { - throw _createConnectionError(channelName); - } else if (replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (replyList[0] == null) { + } else if (pigeonVar_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 (pigeonVar_replyList[0] as bool?)!; } } /// Returns true if this device can support biometric authentication, whether /// any biometrics are enrolled or not. Future deviceCanSupportBiometrics() async { - const String channelName = - 'dev.flutter.pigeon.local_auth_darwin.LocalAuthApi.deviceCanSupportBiometrics'; - final BasicMessageChannel channel = BasicMessageChannel( - channelName, - codec, - binaryMessenger: _binaryMessenger, + final String pigeonVar_channelName = + 'dev.flutter.pigeon.local_auth_darwin.LocalAuthApi.deviceCanSupportBiometrics$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? replyList = await channel.send(null) as List?; - if (replyList == null) { - throw _createConnectionError(channelName); - } else if (replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (replyList[0] == null) { + } else if (pigeonVar_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 (pigeonVar_replyList[0] as bool?)!; } } /// Returns the biometric types that are enrolled, and can thus be used /// without additional setup. - Future> getEnrolledBiometrics() async { - const String channelName = - 'dev.flutter.pigeon.local_auth_darwin.LocalAuthApi.getEnrolledBiometrics'; - final BasicMessageChannel channel = BasicMessageChannel( - channelName, - codec, - binaryMessenger: _binaryMessenger, + Future> getEnrolledBiometrics() async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.local_auth_darwin.LocalAuthApi.getEnrolledBiometrics$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? replyList = await channel.send(null) as List?; - if (replyList == null) { - throw _createConnectionError(channelName); - } else if (replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (replyList[0] as List?)!.cast(); + return (pigeonVar_replyList[0] as List?)!.cast(); } } /// Attempts to authenticate the user with the provided [options], and using /// [strings] for any UI. Future authenticate( - AuthOptions arg_options, AuthStrings arg_strings) async { - const String channelName = - 'dev.flutter.pigeon.local_auth_darwin.LocalAuthApi.authenticate'; - final BasicMessageChannel channel = BasicMessageChannel( - channelName, - codec, - binaryMessenger: _binaryMessenger, + AuthOptions options, AuthStrings strings) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.local_auth_darwin.LocalAuthApi.authenticate$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? replyList = await channel - .send([arg_options, arg_strings]) as List?; - if (replyList == null) { - throw _createConnectionError(channelName); - } else if (replyList.length > 1) { + final List? pigeonVar_replyList = await pigeonVar_channel + .send([options, strings]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (replyList[0] as AuthResultDetails?)!; + return (pigeonVar_replyList[0] as AuthResultDetails?)!; } } } diff --git a/packages/local_auth/local_auth_darwin/pigeons/messages.dart b/packages/local_auth/local_auth_darwin/pigeons/messages.dart index 7f35a7208997..17aad093a06a 100644 --- a/packages/local_auth/local_auth_darwin/pigeons/messages.dart +++ b/packages/local_auth/local_auth_darwin/pigeons/messages.dart @@ -88,13 +88,6 @@ class AuthResultDetails { /// Pigeon equivalent of the subset of BiometricType used by iOS. enum AuthBiometric { face, fingerprint } -// TODO(stuartmorgan): Enums need be wrapped in a data class because thay can't -// be used as collection arguments. See https://github.com/flutter/flutter/issues/133728 -class AuthBiometricWrapper { - AuthBiometricWrapper({required this.value}); - final AuthBiometric value; -} - @HostApi() abstract class LocalAuthApi { /// Returns true if this device supports authentication. @@ -106,7 +99,7 @@ abstract class LocalAuthApi { /// Returns the biometric types that are enrolled, and can thus be used /// without additional setup. - List getEnrolledBiometrics(); + List getEnrolledBiometrics(); /// Attempts to authenticate the user with the provided [options], and using /// [strings] for any UI. diff --git a/packages/local_auth/local_auth_darwin/pubspec.yaml b/packages/local_auth/local_auth_darwin/pubspec.yaml index 82aa0c0e87fc..1ed3b6563041 100644 --- a/packages/local_auth/local_auth_darwin/pubspec.yaml +++ b/packages/local_auth/local_auth_darwin/pubspec.yaml @@ -2,7 +2,7 @@ name: local_auth_darwin description: iOS implementation of the local_auth plugin. repository: https://github.com/flutter/packages/tree/main/packages/local_auth/local_auth_darwin issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+local_auth%22 -version: 1.4.0 +version: 1.4.1 environment: sdk: ^3.3.0 @@ -31,8 +31,8 @@ dev_dependencies: build_runner: ^2.3.3 flutter_test: sdk: flutter - mockito: 5.4.4 - pigeon: ^13.0.0 + mockito: ^5.4.4 + pigeon: ^22.4.0 topics: - authentication diff --git a/packages/local_auth/local_auth_darwin/test/local_auth_darwin_test.dart b/packages/local_auth/local_auth_darwin/test/local_auth_darwin_test.dart index 4dfc2646e267..756205f1b681 100644 --- a/packages/local_auth/local_auth_darwin/test/local_auth_darwin_test.dart +++ b/packages/local_auth/local_auth_darwin/test/local_auth_darwin_test.dart @@ -60,11 +60,10 @@ void main() { group('getEnrolledBiometrics', () { test('translates values', () async { - when(api.getEnrolledBiometrics()) - .thenAnswer((_) async => [ - AuthBiometricWrapper(value: AuthBiometric.face), - AuthBiometricWrapper(value: AuthBiometric.fingerprint), - ]); + when(api.getEnrolledBiometrics()).thenAnswer((_) async => [ + AuthBiometric.face, + AuthBiometric.fingerprint, + ]); final List result = await plugin.getEnrolledBiometrics(); @@ -76,7 +75,7 @@ void main() { test('handles empty', () async { when(api.getEnrolledBiometrics()) - .thenAnswer((_) async => []); + .thenAnswer((_) async => []); final List result = await plugin.getEnrolledBiometrics(); diff --git a/packages/local_auth/local_auth_darwin/test/local_auth_darwin_test.mocks.dart b/packages/local_auth/local_auth_darwin/test/local_auth_darwin_test.mocks.dart index 30ea55ae2ca2..befeb1bbbfc5 100644 --- a/packages/local_auth/local_auth_darwin/test/local_auth_darwin_test.mocks.dart +++ b/packages/local_auth/local_auth_darwin/test/local_auth_darwin_test.mocks.dart @@ -3,10 +3,11 @@ // Do not manually edit this file. // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:async' as _i3; +import 'dart:async' as _i4; import 'package:local_auth_darwin/src/messages.g.dart' as _i2; import 'package:mockito/mockito.dart' as _i1; +import 'package:mockito/src/dummies.dart' as _i3; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values @@ -41,57 +42,66 @@ class MockLocalAuthApi extends _i1.Mock implements _i2.LocalAuthApi { } @override - _i3.Future isDeviceSupported() => (super.noSuchMethod( + String get pigeonVar_messageChannelSuffix => (super.noSuchMethod( + Invocation.getter(#pigeonVar_messageChannelSuffix), + returnValue: _i3.dummyValue( + this, + Invocation.getter(#pigeonVar_messageChannelSuffix), + ), + ) as String); + + @override + _i4.Future isDeviceSupported() => (super.noSuchMethod( Invocation.method( #isDeviceSupported, [], ), - returnValue: _i3.Future.value(false), - ) as _i3.Future); + returnValue: _i4.Future.value(false), + ) as _i4.Future); @override - _i3.Future deviceCanSupportBiometrics() => (super.noSuchMethod( + _i4.Future deviceCanSupportBiometrics() => (super.noSuchMethod( Invocation.method( #deviceCanSupportBiometrics, [], ), - returnValue: _i3.Future.value(false), - ) as _i3.Future); + returnValue: _i4.Future.value(false), + ) as _i4.Future); @override - _i3.Future> getEnrolledBiometrics() => + _i4.Future> getEnrolledBiometrics() => (super.noSuchMethod( Invocation.method( #getEnrolledBiometrics, [], ), - returnValue: _i3.Future>.value( - <_i2.AuthBiometricWrapper?>[]), - ) as _i3.Future>); + returnValue: + _i4.Future>.value(<_i2.AuthBiometric>[]), + ) as _i4.Future>); @override - _i3.Future<_i2.AuthResultDetails> authenticate( - _i2.AuthOptions? arg_options, - _i2.AuthStrings? arg_strings, + _i4.Future<_i2.AuthResultDetails> authenticate( + _i2.AuthOptions? options, + _i2.AuthStrings? strings, ) => (super.noSuchMethod( Invocation.method( #authenticate, [ - arg_options, - arg_strings, + options, + strings, ], ), returnValue: - _i3.Future<_i2.AuthResultDetails>.value(_FakeAuthResultDetails_0( + _i4.Future<_i2.AuthResultDetails>.value(_FakeAuthResultDetails_0( this, Invocation.method( #authenticate, [ - arg_options, - arg_strings, + options, + strings, ], ), )), - ) as _i3.Future<_i2.AuthResultDetails>); + ) as _i4.Future<_i2.AuthResultDetails>); } diff --git a/packages/local_auth/local_auth_platform_interface/pubspec.yaml b/packages/local_auth/local_auth_platform_interface/pubspec.yaml index bc41f6d6a6d3..471978598642 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.4 + mockito: ^5.4.4 topics: - authentication diff --git a/packages/metrics_center/CHANGELOG.md b/packages/metrics_center/CHANGELOG.md index 7e005f1efc04..904f9775a932 100644 --- a/packages/metrics_center/CHANGELOG.md +++ b/packages/metrics_center/CHANGELOG.md @@ -1,6 +1,7 @@ ## NEXT * Updates minimum supported SDK version to Flutter 3.19/Dart 3.3. +* Update dependency `http: ^1.0.0` ## 1.0.13 diff --git a/packages/metrics_center/pubspec.yaml b/packages/metrics_center/pubspec.yaml index 94180b80f75e..a1ef1bebcf93 100644 --- a/packages/metrics_center/pubspec.yaml +++ b/packages/metrics_center/pubspec.yaml @@ -14,12 +14,12 @@ dependencies: gcloud: ^0.8.2 googleapis: ^12.0.0 googleapis_auth: ^1.1.0 - http: ">=0.13.0 <2.0.0" + http: ^1.0.0 dev_dependencies: build_runner: ^2.1.1 fake_async: ^1.2.0 - mockito: 5.4.4 + mockito: ^5.4.4 test: ^1.17.11 topics: diff --git a/packages/palette_generator/example/android/build.gradle b/packages/palette_generator/example/android/build.gradle index cec92de922cf..0bed8906c094 100644 --- a/packages/palette_generator/example/android/build.gradle +++ b/packages/palette_generator/example/android/build.gradle @@ -5,7 +5,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:7.4.2' + classpath 'com.android.tools.build:gradle:8.5.2' } } 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..c5b3f7f9bfe1 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-8.7-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..d951fac2bf31 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-8.7-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/packages/path_provider/path_provider/example/android/build.gradle b/packages/path_provider/path_provider/example/android/build.gradle index cec92de922cf..0bed8906c094 100644 --- a/packages/path_provider/path_provider/example/android/build.gradle +++ b/packages/path_provider/path_provider/example/android/build.gradle @@ -5,7 +5,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:7.4.2' + classpath 'com.android.tools.build:gradle:8.5.2' } } 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..3c85cfe057a1 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-8.7-all.zip diff --git a/packages/path_provider/path_provider_android/CHANGELOG.md b/packages/path_provider/path_provider_android/CHANGELOG.md index 8d813e49dec8..352bad5b6cb7 100644 --- a/packages/path_provider/path_provider_android/CHANGELOG.md +++ b/packages/path_provider/path_provider_android/CHANGELOG.md @@ -1,3 +1,16 @@ +## 2.2.13 + +* Updates annotations lib to 1.9.0. + +## 2.2.12 + +* Updates Pigeon for non-nullable collection type support. + +## 2.2.11 + +* Updates Java compatibility version to 11. +* Updates minimum supported SDK version to Flutter 3.24/Dart 3.5. + ## 2.2.10 * Updates annotations lib to 1.8.2. diff --git a/packages/path_provider/path_provider_android/android/build.gradle b/packages/path_provider/path_provider_android/android/build.gradle index 46d8e053b48a..69a189f90d45 100644 --- a/packages/path_provider/path_provider_android/android/build.gradle +++ b/packages/path_provider/path_provider_android/android/build.gradle @@ -22,10 +22,7 @@ rootProject.allprojects { apply plugin: 'com.android.library' android { - // Conditional for compatibility with AGP <4.2. - if (project.android.hasProperty("namespace")) { - namespace 'io.flutter.plugins.pathprovider' - } + namespace 'io.flutter.plugins.pathprovider' compileSdk 34 defaultConfig { @@ -38,8 +35,8 @@ android { disable 'AndroidGradlePluginVersion', 'InvalidPackage', 'GradleDependency', 'NewerVersionAvailable' } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_11 + targetCompatibility JavaVersion.VERSION_11 } @@ -57,6 +54,6 @@ android { } dependencies { - implementation 'androidx.annotation:annotation:1.8.2' + implementation 'androidx.annotation:annotation:1.9.0' testImplementation 'junit:junit:4.13.2' } diff --git a/packages/path_provider/path_provider_android/android/src/main/java/io/flutter/plugins/pathprovider/Messages.java b/packages/path_provider/path_provider_android/android/src/main/java/io/flutter/plugins/pathprovider/Messages.java index 1bfa729157db..9bf8785650d2 100644 --- a/packages/path_provider/path_provider_android/android/src/main/java/io/flutter/plugins/pathprovider/Messages.java +++ b/packages/path_provider/path_provider_android/android/src/main/java/io/flutter/plugins/pathprovider/Messages.java @@ -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 (v9.2.5), do not edit directly. +// Autogenerated from Pigeon (v22.4.2), do not edit directly. // See also: https://pub.dev/packages/pigeon package io.flutter.plugins.pathprovider; @@ -13,6 +13,8 @@ import io.flutter.plugin.common.BinaryMessenger; import io.flutter.plugin.common.MessageCodec; import io.flutter.plugin.common.StandardMessageCodec; +import java.io.ByteArrayOutputStream; +import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.List; @@ -38,7 +40,7 @@ public FlutterError(@NonNull String code, @Nullable String message, @Nullable Ob @NonNull protected static ArrayList wrapError(@NonNull Throwable exception) { - ArrayList errorList = new ArrayList(3); + ArrayList errorList = new ArrayList<>(3); if (exception instanceof FlutterError) { FlutterError error = (FlutterError) exception; errorList.add(error.code); @@ -68,10 +70,40 @@ public enum StorageDirectory { final int index; - private StorageDirectory(final int index) { + StorageDirectory(final int index) { this.index = index; } } + + private static class PigeonCodec extends StandardMessageCodec { + public static final PigeonCodec INSTANCE = new PigeonCodec(); + + private PigeonCodec() {} + + @Override + protected Object readValueOfType(byte type, @NonNull ByteBuffer buffer) { + switch (type) { + case (byte) 129: + { + Object value = readValue(buffer); + return value == null ? null : StorageDirectory.values()[((Long) value).intValue()]; + } + default: + return super.readValueOfType(type, buffer); + } + } + + @Override + protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { + if (value instanceof StorageDirectory) { + stream.write(129); + writeValue(stream, value == null ? null : ((StorageDirectory) value).index); + } else { + super.writeValue(stream, value); + } + } + } + /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface PathProviderApi { @@ -98,30 +130,38 @@ public interface PathProviderApi { /** The codec used by PathProviderApi. */ static @NonNull MessageCodec getCodec() { - return new StandardMessageCodec(); + return PigeonCodec.INSTANCE; } /** * Sets up an instance of `PathProviderApi` to handle messages through the `binaryMessenger`. */ - static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PathProviderApi api) { + static void setUp(@NonNull BinaryMessenger binaryMessenger, @Nullable PathProviderApi api) { + setUp(binaryMessenger, "", api); + } + + static void setUp( + @NonNull BinaryMessenger binaryMessenger, + @NonNull String messageChannelSuffix, + @Nullable PathProviderApi api) { + messageChannelSuffix = messageChannelSuffix.isEmpty() ? "" : "." + messageChannelSuffix; { BinaryMessenger.TaskQueue taskQueue = binaryMessenger.makeBackgroundTaskQueue(); BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.PathProviderApi.getTemporaryPath", + "dev.flutter.pigeon.path_provider_android.PathProviderApi.getTemporaryPath" + + messageChannelSuffix, getCodec(), taskQueue); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); try { String output = api.getTemporaryPath(); wrapped.add(0, output); } catch (Throwable exception) { - ArrayList wrappedError = wrapError(exception); - wrapped = wrappedError; + wrapped = wrapError(exception); } reply.reply(wrapped); }); @@ -134,19 +174,19 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PathProvid BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.PathProviderApi.getApplicationSupportPath", + "dev.flutter.pigeon.path_provider_android.PathProviderApi.getApplicationSupportPath" + + messageChannelSuffix, getCodec(), taskQueue); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); try { String output = api.getApplicationSupportPath(); wrapped.add(0, output); } catch (Throwable exception) { - ArrayList wrappedError = wrapError(exception); - wrapped = wrappedError; + wrapped = wrapError(exception); } reply.reply(wrapped); }); @@ -159,19 +199,19 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PathProvid BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.PathProviderApi.getApplicationDocumentsPath", + "dev.flutter.pigeon.path_provider_android.PathProviderApi.getApplicationDocumentsPath" + + messageChannelSuffix, getCodec(), taskQueue); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); try { String output = api.getApplicationDocumentsPath(); wrapped.add(0, output); } catch (Throwable exception) { - ArrayList wrappedError = wrapError(exception); - wrapped = wrappedError; + wrapped = wrapError(exception); } reply.reply(wrapped); }); @@ -184,19 +224,19 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PathProvid BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.PathProviderApi.getApplicationCachePath", + "dev.flutter.pigeon.path_provider_android.PathProviderApi.getApplicationCachePath" + + messageChannelSuffix, getCodec(), taskQueue); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); try { String output = api.getApplicationCachePath(); wrapped.add(0, output); } catch (Throwable exception) { - ArrayList wrappedError = wrapError(exception); - wrapped = wrappedError; + wrapped = wrapError(exception); } reply.reply(wrapped); }); @@ -209,19 +249,19 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PathProvid BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.PathProviderApi.getExternalStoragePath", + "dev.flutter.pigeon.path_provider_android.PathProviderApi.getExternalStoragePath" + + messageChannelSuffix, getCodec(), taskQueue); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); try { String output = api.getExternalStoragePath(); wrapped.add(0, output); } catch (Throwable exception) { - ArrayList wrappedError = wrapError(exception); - wrapped = wrappedError; + wrapped = wrapError(exception); } reply.reply(wrapped); }); @@ -234,19 +274,19 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PathProvid BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.PathProviderApi.getExternalCachePaths", + "dev.flutter.pigeon.path_provider_android.PathProviderApi.getExternalCachePaths" + + messageChannelSuffix, getCodec(), taskQueue); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); try { List output = api.getExternalCachePaths(); wrapped.add(0, output); } catch (Throwable exception) { - ArrayList wrappedError = wrapError(exception); - wrapped = wrappedError; + wrapped = wrapError(exception); } reply.reply(wrapped); }); @@ -259,22 +299,21 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PathProvid BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.PathProviderApi.getExternalStoragePaths", + "dev.flutter.pigeon.path_provider_android.PathProviderApi.getExternalStoragePaths" + + messageChannelSuffix, getCodec(), taskQueue); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - StorageDirectory directoryArg = - args.get(0) == null ? null : StorageDirectory.values()[(int) args.get(0)]; + StorageDirectory directoryArg = (StorageDirectory) args.get(0); try { List output = api.getExternalStoragePaths(directoryArg); wrapped.add(0, output); } catch (Throwable exception) { - ArrayList wrappedError = wrapError(exception); - wrapped = wrappedError; + wrapped = wrapError(exception); } reply.reply(wrapped); }); diff --git a/packages/path_provider/path_provider_android/android/src/main/java/io/flutter/plugins/pathprovider/PathProviderPlugin.java b/packages/path_provider/path_provider_android/android/src/main/java/io/flutter/plugins/pathprovider/PathProviderPlugin.java index ce23e545d618..1140875fd2bc 100644 --- a/packages/path_provider/path_provider_android/android/src/main/java/io/flutter/plugins/pathprovider/PathProviderPlugin.java +++ b/packages/path_provider/path_provider_android/android/src/main/java/io/flutter/plugins/pathprovider/PathProviderPlugin.java @@ -22,9 +22,9 @@ public class PathProviderPlugin implements FlutterPlugin, PathProviderApi { public PathProviderPlugin() {} - private void setup(BinaryMessenger messenger, Context context) { + private void setUp(BinaryMessenger messenger, Context context) { try { - PathProviderApi.setup(messenger, this); + PathProviderApi.setUp(messenger, this); } catch (Exception ex) { Log.e(TAG, "Received exception while setting up PathProviderPlugin", ex); } @@ -34,12 +34,12 @@ private void setup(BinaryMessenger messenger, Context context) { @Override public void onAttachedToEngine(@NonNull FlutterPluginBinding binding) { - setup(binding.getBinaryMessenger(), binding.getApplicationContext()); + setUp(binding.getBinaryMessenger(), binding.getApplicationContext()); } @Override public void onDetachedFromEngine(@NonNull FlutterPluginBinding binding) { - PathProviderApi.setup(binding.getBinaryMessenger(), null); + PathProviderApi.setUp(binding.getBinaryMessenger(), null); } @Override diff --git a/packages/path_provider/path_provider_android/example/android/app/build.gradle b/packages/path_provider/path_provider_android/example/android/app/build.gradle index 3e67e5d7f4ca..c081b5c732ed 100644 --- a/packages/path_provider/path_provider_android/example/android/app/build.gradle +++ b/packages/path_provider/path_provider_android/example/android/app/build.gradle @@ -32,7 +32,7 @@ android { defaultConfig { applicationId "io.flutter.plugins.pathproviderexample" minSdkVersion flutter.minSdkVersion - targetSdkVersion 28 + targetSdkVersion 34 versionCode flutterVersionCode.toInteger() versionName flutterVersionName testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 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..d951fac2bf31 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-8.7-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/packages/path_provider/path_provider_android/example/android/app/src/main/AndroidManifest.xml b/packages/path_provider/path_provider_android/example/android/app/src/main/AndroidManifest.xml index df8cee7bc3be..b298b976f220 100644 --- a/packages/path_provider/path_provider_android/example/android/app/src/main/AndroidManifest.xml +++ b/packages/path_provider/path_provider_android/example/android/app/src/main/AndroidManifest.xml @@ -5,7 +5,8 @@ =3.22.0" + sdk: ^3.5.0 + flutter: ">=3.24.0" dependencies: flutter: diff --git a/packages/path_provider/path_provider_android/lib/messages.g.dart b/packages/path_provider/path_provider_android/lib/messages.g.dart index 20d4368d5d44..20c0e9c23997 100644 --- a/packages/path_provider/path_provider_android/lib/messages.g.dart +++ b/packages/path_provider/path_provider_android/lib/messages.g.dart @@ -1,9 +1,9 @@ // 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 (v9.2.5), do not edit directly. +// Autogenerated from Pigeon (v22.4.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 +// 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, no_leading_underscores_for_local_identifiers import 'dart:async'; import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List; @@ -11,6 +11,24 @@ import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List; import 'package:flutter/foundation.dart' show ReadBuffer, WriteBuffer; import 'package:flutter/services.dart'; +PlatformException _createConnectionError(String channelName) { + return PlatformException( + code: 'channel-error', + message: 'Unable to establish connection on channel: "$channelName".', + ); +} + +List wrapResponse( + {Object? result, PlatformException? error, bool empty = false}) { + if (empty) { + return []; + } + if (error == null) { + return [result]; + } + return [error.code, error.message, error.details]; +} + enum StorageDirectory { root, music, @@ -25,172 +43,224 @@ enum StorageDirectory { documents, } +class _PigeonCodec extends StandardMessageCodec { + const _PigeonCodec(); + @override + void writeValue(WriteBuffer buffer, Object? value) { + if (value is int) { + buffer.putUint8(4); + buffer.putInt64(value); + } else if (value is StorageDirectory) { + buffer.putUint8(129); + writeValue(buffer, value.index); + } else { + super.writeValue(buffer, value); + } + } + + @override + Object? readValueOfType(int type, ReadBuffer buffer) { + switch (type) { + case 129: + final int? value = readValue(buffer) as int?; + return value == null ? null : StorageDirectory.values[value]; + default: + return super.readValueOfType(type, buffer); + } + } +} + class PathProviderApi { /// Constructor for [PathProviderApi]. The [binaryMessenger] named argument is /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. - PathProviderApi({BinaryMessenger? binaryMessenger}) - : _binaryMessenger = binaryMessenger; - final BinaryMessenger? _binaryMessenger; + PathProviderApi( + {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) + : pigeonVar_binaryMessenger = binaryMessenger, + pigeonVar_messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + final BinaryMessenger? pigeonVar_binaryMessenger; + + static const MessageCodec pigeonChannelCodec = _PigeonCodec(); - static const MessageCodec codec = StandardMessageCodec(); + final String pigeonVar_messageChannelSuffix; Future getTemporaryPath() async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.PathProviderApi.getTemporaryPath', codec, - binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send(null) as List?; - if (replyList == null) { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.path_provider_android.PathProviderApi.getTemporaryPath$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { - throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { - return (replyList[0] as String?); + return (pigeonVar_replyList[0] as String?); } } Future getApplicationSupportPath() async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.PathProviderApi.getApplicationSupportPath', codec, - binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send(null) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.path_provider_android.PathProviderApi.getApplicationSupportPath$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { - return (replyList[0] as String?); + return (pigeonVar_replyList[0] as String?); } } Future getApplicationDocumentsPath() async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.PathProviderApi.getApplicationDocumentsPath', codec, - binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send(null) as List?; - if (replyList == null) { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.path_provider_android.PathProviderApi.getApplicationDocumentsPath$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { - throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { - return (replyList[0] as String?); + return (pigeonVar_replyList[0] as String?); } } Future getApplicationCachePath() async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.PathProviderApi.getApplicationCachePath', codec, - binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send(null) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.path_provider_android.PathProviderApi.getApplicationCachePath$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { - return (replyList[0] as String?); + return (pigeonVar_replyList[0] as String?); } } Future getExternalStoragePath() async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.PathProviderApi.getExternalStoragePath', codec, - binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send(null) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.path_provider_android.PathProviderApi.getExternalStoragePath$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { - return (replyList[0] as String?); + return (pigeonVar_replyList[0] as String?); } } - Future> getExternalCachePaths() async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.PathProviderApi.getExternalCachePaths', codec, - binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send(null) as List?; - if (replyList == null) { + Future> getExternalCachePaths() async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.path_provider_android.PathProviderApi.getExternalCachePaths$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (replyList.length > 1) { - throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], - ); - } else if (replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (replyList[0] as List?)!.cast(); + return (pigeonVar_replyList[0] as List?)!.cast(); } } - Future> getExternalStoragePaths( - StorageDirectory arg_directory) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.PathProviderApi.getExternalStoragePaths', codec, - binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_directory.index]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + Future> getExternalStoragePaths( + StorageDirectory directory) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.path_provider_android.PathProviderApi.getExternalStoragePaths$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([directory]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (replyList[0] as List?)!.cast(); + return (pigeonVar_replyList[0] as List?)!.cast(); } } } diff --git a/packages/path_provider/path_provider_android/lib/path_provider_android.dart b/packages/path_provider/path_provider_android/lib/path_provider_android.dart index 20effb2f3c29..2698e10ab638 100644 --- a/packages/path_provider/path_provider_android/lib/path_provider_android.dart +++ b/packages/path_provider/path_provider_android/lib/path_provider_android.dart @@ -74,7 +74,7 @@ class PathProviderAndroid extends PathProviderPlatform { @override Future?> getExternalCachePaths() async { - return (await _api.getExternalCachePaths()).cast(); + return _api.getExternalCachePaths(); } @override @@ -94,7 +94,6 @@ class PathProviderAndroid extends PathProviderPlatform { Future> _getExternalStoragePaths({ StorageDirectory? type, }) async { - return (await _api.getExternalStoragePaths(_convertStorageDirectory(type))) - .cast(); + return _api.getExternalStoragePaths(_convertStorageDirectory(type)); } } diff --git a/packages/path_provider/path_provider_android/pigeons/messages.dart b/packages/path_provider/path_provider_android/pigeons/messages.dart index 6e4eb8f1956e..c8db7ec55e12 100644 --- a/packages/path_provider/path_provider_android/pigeons/messages.dart +++ b/packages/path_provider/path_provider_android/pigeons/messages.dart @@ -40,7 +40,7 @@ abstract class PathProviderApi { @TaskQueue(type: TaskQueueType.serialBackgroundThread) String? getExternalStoragePath(); @TaskQueue(type: TaskQueueType.serialBackgroundThread) - List getExternalCachePaths(); + List getExternalCachePaths(); @TaskQueue(type: TaskQueueType.serialBackgroundThread) - List getExternalStoragePaths(StorageDirectory directory); + List getExternalStoragePaths(StorageDirectory directory); } diff --git a/packages/path_provider/path_provider_android/pubspec.yaml b/packages/path_provider/path_provider_android/pubspec.yaml index 5d3e7e398141..d46959f9cd75 100644 --- a/packages/path_provider/path_provider_android/pubspec.yaml +++ b/packages/path_provider/path_provider_android/pubspec.yaml @@ -2,11 +2,11 @@ name: path_provider_android description: Android implementation of the path_provider plugin. repository: https://github.com/flutter/packages/tree/main/packages/path_provider/path_provider_android issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+path_provider%22 -version: 2.2.10 +version: 2.2.13 environment: - sdk: ^3.4.0 - flutter: ">=3.22.0" + sdk: ^3.5.0 + flutter: ">=3.24.0" flutter: plugin: @@ -27,7 +27,7 @@ dev_dependencies: sdk: flutter integration_test: sdk: flutter - pigeon: ^9.2.4 + pigeon: ^22.4.2 test: ^1.16.0 topics: diff --git a/packages/path_provider/path_provider_android/test/messages_test.g.dart b/packages/path_provider/path_provider_android/test/messages_test.g.dart index e18fc9699969..48b8e023862f 100644 --- a/packages/path_provider/path_provider_android/test/messages_test.g.dart +++ b/packages/path_provider/path_provider_android/test/messages_test.g.dart @@ -1,9 +1,9 @@ // 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 (v9.2.5), do not edit directly. +// Autogenerated from Pigeon (v22.4.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, unnecessary_import +// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, unnecessary_import, no_leading_underscores_for_local_identifiers // ignore_for_file: avoid_relative_lib_imports import 'dart:async'; import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List; @@ -13,10 +13,37 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:path_provider_android/messages.g.dart'; +class _PigeonCodec extends StandardMessageCodec { + const _PigeonCodec(); + @override + void writeValue(WriteBuffer buffer, Object? value) { + if (value is int) { + buffer.putUint8(4); + buffer.putInt64(value); + } else if (value is StorageDirectory) { + buffer.putUint8(129); + writeValue(buffer, value.index); + } else { + super.writeValue(buffer, value); + } + } + + @override + Object? readValueOfType(int type, ReadBuffer buffer) { + switch (type) { + case 129: + final int? value = readValue(buffer) as int?; + return value == null ? null : StorageDirectory.values[value]; + default: + return super.readValueOfType(type, buffer); + } + } +} + abstract class TestPathProviderApi { static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; - static const MessageCodec codec = StandardMessageCodec(); + static const MessageCodec pigeonChannelCodec = _PigeonCodec(); String? getTemporaryPath(); @@ -28,136 +55,204 @@ abstract class TestPathProviderApi { String? getExternalStoragePath(); - List getExternalCachePaths(); + List getExternalCachePaths(); - List getExternalStoragePaths(StorageDirectory directory); + List getExternalStoragePaths(StorageDirectory directory); - static void setup(TestPathProviderApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setUp( + TestPathProviderApi? api, { + BinaryMessenger? binaryMessenger, + String messageChannelSuffix = '', + }) { + messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.PathProviderApi.getTemporaryPath', codec, + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.path_provider_android.PathProviderApi.getTemporaryPath$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - // ignore message - final String? output = api.getTemporaryPath(); - return [output]; + try { + final String? output = api.getTemporaryPath(); + return [output]; + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } }); } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.PathProviderApi.getApplicationSupportPath', codec, + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.path_provider_android.PathProviderApi.getApplicationSupportPath$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - // ignore message - final String? output = api.getApplicationSupportPath(); - return [output]; + try { + final String? output = api.getApplicationSupportPath(); + return [output]; + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } }); } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.PathProviderApi.getApplicationDocumentsPath', - codec, + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.path_provider_android.PathProviderApi.getApplicationDocumentsPath$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - // ignore message - final String? output = api.getApplicationDocumentsPath(); - return [output]; + try { + final String? output = api.getApplicationDocumentsPath(); + return [output]; + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } }); } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.PathProviderApi.getApplicationCachePath', codec, + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.path_provider_android.PathProviderApi.getApplicationCachePath$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - // ignore message - final String? output = api.getApplicationCachePath(); - return [output]; + try { + final String? output = api.getApplicationCachePath(); + return [output]; + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } }); } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.PathProviderApi.getExternalStoragePath', codec, + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.path_provider_android.PathProviderApi.getExternalStoragePath$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - // ignore message - final String? output = api.getExternalStoragePath(); - return [output]; + try { + final String? output = api.getExternalStoragePath(); + return [output]; + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } }); } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.PathProviderApi.getExternalCachePaths', codec, + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.path_provider_android.PathProviderApi.getExternalCachePaths$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - // ignore message - final List output = api.getExternalCachePaths(); - return [output]; + try { + final List output = api.getExternalCachePaths(); + return [output]; + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } }); } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.PathProviderApi.getExternalStoragePaths', codec, + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.path_provider_android.PathProviderApi.getExternalStoragePaths$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.PathProviderApi.getExternalStoragePaths was null.'); + 'Argument for dev.flutter.pigeon.path_provider_android.PathProviderApi.getExternalStoragePaths was null.'); final List args = (message as List?)!; final StorageDirectory? arg_directory = - args[0] == null ? null : StorageDirectory.values[args[0] as int]; + (args[0] as StorageDirectory?); assert(arg_directory != null, - 'Argument for dev.flutter.pigeon.PathProviderApi.getExternalStoragePaths was null, expected non-null StorageDirectory.'); - final List output = - api.getExternalStoragePaths(arg_directory!); - return [output]; + 'Argument for dev.flutter.pigeon.path_provider_android.PathProviderApi.getExternalStoragePaths was null, expected non-null StorageDirectory.'); + try { + final List output = + api.getExternalStoragePaths(arg_directory!); + return [output]; + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } }); } } diff --git a/packages/path_provider/path_provider_android/test/path_provider_android_test.dart b/packages/path_provider/path_provider_android/test/path_provider_android_test.dart index 10c4cd0f2d63..440c5275a717 100644 --- a/packages/path_provider/path_provider_android/test/path_provider_android_test.dart +++ b/packages/path_provider/path_provider_android/test/path_provider_android_test.dart @@ -30,14 +30,14 @@ class _Api implements TestPathProviderApi { String? getApplicationCachePath() => kApplicationCachePath; @override - List getExternalCachePaths() => [kExternalCachePaths]; + List getExternalCachePaths() => [kExternalCachePaths]; @override String? getExternalStoragePath() => kExternalStoragePaths; @override - List getExternalStoragePaths(messages.StorageDirectory directory) { - return [if (returnsExternalStoragePaths) kExternalStoragePaths]; + List getExternalStoragePaths(messages.StorageDirectory directory) { + return [if (returnsExternalStoragePaths) kExternalStoragePaths]; } @override @@ -52,7 +52,7 @@ void main() { setUp(() async { pathProvider = PathProviderAndroid(); - TestPathProviderApi.setup(_Api()); + TestPathProviderApi.setUp(_Api()); }); test('getTemporaryPath', () async { @@ -90,7 +90,7 @@ void main() { expect(result.first, kExternalCachePaths); }); - for (final StorageDirectory? type in [ + for (final StorageDirectory? type in [ ...StorageDirectory.values ]) { test('getExternalStoragePaths (type: $type) android succeeds', () async { @@ -110,7 +110,7 @@ void main() { 'getDownloadsPath returns null, when getExternalStoragePaths returns ' 'an empty list', () async { final PathProviderAndroid pathProvider = PathProviderAndroid(); - TestPathProviderApi.setup(_Api(returnsExternalStoragePaths: false)); + TestPathProviderApi.setUp(_Api(returnsExternalStoragePaths: false)); final String? path = await pathProvider.getDownloadsPath(); expect(path, null); }); diff --git a/packages/path_provider/path_provider_foundation/pubspec.yaml b/packages/path_provider/path_provider_foundation/pubspec.yaml index f439f0e0275f..cfeac45f6cd4 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.4 + mockito: ^5.4.4 path: ^1.8.0 pigeon: ^10.1.3 diff --git a/packages/pigeon/CHANGELOG.md b/packages/pigeon/CHANGELOG.md index c5281a3469a3..85842f046117 100644 --- a/packages/pigeon/CHANGELOG.md +++ b/packages/pigeon/CHANGELOG.md @@ -1,3 +1,41 @@ +## 22.6.0 + +* [swift] Adds `includeErrorClass` to `SwiftOptions`. + +## 22.5.0 + +* [swift] Adds implementation for `@ProxyApi`. + +## 22.4.2 + +* Updates `README.md` to replace the deprecated `flutter pub run pigeon` command with `dart run pigeon`. + +## 22.4.1 + +* [dart] Fixes bug where special handling of ints is ignored if no custom types are used. + +## 22.4.0 + +* Adds support for non-nullable types in collections. + +## 22.3.0 + +* Adds support for enums and classes in collections. + +## 22.2.0 + +* [kotlin] Adds implementation for `@ProxyApi`. + +## 22.1.0 + +* Allows generation of classes that aren't referenced in an API. + +## 22.0.0 + +* [dart] Changes codec to send int64 instead of int32. +* **Breaking Change** [swift] Changes generic `map` to nullable keys of `AnyHashable` to conform to other platforms. +* Adds tests to validate collections of ints. + ## 21.2.0 * Removes restriction on number of custom types. @@ -184,8 +222,6 @@ `YES`. Any data class or Flutter API interactions involving `bool`s should be carefully audited by hand when updating. - - ## 12.0.1 * [swift] Adds protocol for Flutter APIs. diff --git a/packages/pigeon/CONTRIBUTING.md b/packages/pigeon/CONTRIBUTING.md index e19f6958623c..4bf96c208086 100644 --- a/packages/pigeon/CONTRIBUTING.md +++ b/packages/pigeon/CONTRIBUTING.md @@ -62,7 +62,7 @@ This is what the temporary generated code that the _PigeonIsolate_ executes looks like (see [State Diagram](#state-diagram)): ```dart -import 'path/to/supplied/pigeon/file.dart' +import 'path/to/supplied/pigeon/file.dart'; import 'dart:io'; import 'dart:isolate'; import 'package:pigeon/pigeon_lib.dart'; diff --git a/packages/pigeon/README.md b/packages/pigeon/README.md index a3c4f341ade7..cc375f5e2faa 100644 --- a/packages/pigeon/README.md +++ b/packages/pigeon/README.md @@ -86,7 +86,7 @@ to the api to allow for multiple instances to be created and operate in parallel 1) Make a ".dart" file outside of your "lib" directory for defining the communication interface. 1) Run pigeon on your ".dart" file to generate the required Dart and - host-language code: `flutter pub get` then `flutter pub run pigeon` + host-language code: `flutter pub get` then `dart run pigeon` with suitable arguments. [Example](./example/README.md#Invocation). 1) Add the generated Dart code to `./lib` for compilation. 1) Implement the host-language code and add it to your build (see below). diff --git a/packages/pigeon/example/README.md b/packages/pigeon/example/README.md index 448b65a489ef..bd5e4bd116af 100644 --- a/packages/pigeon/example/README.md +++ b/packages/pigeon/example/README.md @@ -40,7 +40,7 @@ needed for your project. Then make a simple call to run pigeon on the Dart file containing your definitions. ```sh -flutter pub run pigeon --input path/to/input.dart +dart run pigeon --input path/to/input.dart ``` ## HostApi Example @@ -62,7 +62,7 @@ class MessageData { String? name; String? description; Code code; - Map data; + Map data; } @HostApi() @@ -103,7 +103,7 @@ Future add(int a, int b) async { Future sendMessage(String messageText) { final MessageData message = MessageData( code: Code.one, - data: {'header': 'this is a header'}, + data: {'header': 'this is a header'}, description: 'uri text', ); try { diff --git a/packages/pigeon/example/app/android/app/build.gradle b/packages/pigeon/example/app/android/app/build.gradle index 0877433025ad..f898ecae685a 100644 --- a/packages/pigeon/example/app/android/app/build.gradle +++ b/packages/pigeon/example/app/android/app/build.gradle @@ -31,12 +31,12 @@ android { ndkVersion flutter.ndkVersion compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_11 + targetCompatibility JavaVersion.VERSION_11 } kotlinOptions { - jvmTarget = '1.8' + jvmTarget = '11' } sourceSets { 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 7e5e839dd737..8d9256c3795e 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 @@ -232,7 +232,7 @@ protected Object readValueOfType(byte type, @NonNull ByteBuffer buffer) { case (byte) 129: { Object value = readValue(buffer); - return value == null ? null : Code.values()[(int) value]; + return value == null ? null : Code.values()[((Long) value).intValue()]; } case (byte) 130: return MessageData.fromList((ArrayList) readValue(buffer)); @@ -339,13 +339,10 @@ static void setUp( (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - Number aArg = (Number) args.get(0); - Number bArg = (Number) args.get(1); + Long aArg = (Long) args.get(0); + Long bArg = (Long) args.get(1); try { - Long output = - api.add( - (aArg == null) ? null : aArg.longValue(), - (bArg == null) ? null : bArg.longValue()); + Long output = api.add(aArg, bArg); wrapped.add(0, output); } catch (Throwable exception) { wrapped = wrapError(exception); diff --git a/packages/pigeon/example/app/android/app/src/main/kotlin/dev/flutter/pigeon_example_app/Messages.g.kt b/packages/pigeon/example/app/android/app/src/main/kotlin/dev/flutter/pigeon_example_app/Messages.g.kt index d96ca417a45b..c6b32713ebf4 100644 --- a/packages/pigeon/example/app/android/app/src/main/kotlin/dev/flutter/pigeon_example_app/Messages.g.kt +++ b/packages/pigeon/example/app/android/app/src/main/kotlin/dev/flutter/pigeon_example_app/Messages.g.kt @@ -62,14 +62,14 @@ data class MessageData( val name: String? = null, val description: String? = null, val code: Code, - val data: Map + val data: Map ) { companion object { fun fromList(pigeonVar_list: List): MessageData { val name = pigeonVar_list[0] as String? val description = pigeonVar_list[1] as String? val code = pigeonVar_list[2] as Code - val data = pigeonVar_list[3] as Map + val data = pigeonVar_list[3] as Map return MessageData(name, description, code, data) } } @@ -84,11 +84,11 @@ data class MessageData( } } -private object MessagesPigeonCodec : StandardMessageCodec() { +private open class MessagesPigeonCodec : StandardMessageCodec() { override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { return when (type) { 129.toByte() -> { - return (readValue(buffer) as Int?)?.let { Code.ofRaw(it) } + return (readValue(buffer) as Long?)?.let { Code.ofRaw(it.toInt()) } } 130.toByte() -> { return (readValue(buffer) as? List)?.let { MessageData.fromList(it) } @@ -122,7 +122,7 @@ interface ExampleHostApi { companion object { /** The codec used by ExampleHostApi. */ - val codec: MessageCodec by lazy { MessagesPigeonCodec } + val codec: MessageCodec by lazy { MessagesPigeonCodec() } /** Sets up an instance of `ExampleHostApi` to handle messages through the `binaryMessenger`. */ @JvmOverloads fun setUp( @@ -161,8 +161,8 @@ interface ExampleHostApi { if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val aArg = args[0].let { num -> if (num is Int) num.toLong() else num as Long } - val bArg = args[1].let { num -> if (num is Int) num.toLong() else num as Long } + val aArg = args[0] as Long + val bArg = args[1] as Long val wrapped: List = try { listOf(api.add(aArg, bArg)) @@ -209,7 +209,7 @@ class MessageFlutterApi( ) { companion object { /** The codec used by MessageFlutterApi. */ - val codec: MessageCodec by lazy { MessagesPigeonCodec } + val codec: MessageCodec by lazy { MessagesPigeonCodec() } } fun flutterMethod(aStringArg: String?, callback: (Result) -> Unit) { diff --git a/packages/pigeon/example/app/android/build.gradle b/packages/pigeon/example/app/android/build.gradle index fdf447f8a7e6..491936f2fbef 100644 --- a/packages/pigeon/example/app/android/build.gradle +++ b/packages/pigeon/example/app/android/build.gradle @@ -6,7 +6,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:7.3.0' + classpath 'com.android.tools.build:gradle:8.5.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } 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..3c85cfe057a1 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-8.7-all.zip diff --git a/packages/pigeon/example/app/ios/Runner/Messages.g.swift b/packages/pigeon/example/app/ios/Runner/Messages.g.swift index 0198cd783b14..b42c8a41a1d5 100644 --- a/packages/pigeon/example/app/ios/Runner/Messages.g.swift +++ b/packages/pigeon/example/app/ios/Runner/Messages.g.swift @@ -83,14 +83,14 @@ struct MessageData { var name: String? = nil var description: String? = nil var code: Code - var data: [String?: String?] + var data: [String: String] // swift-format-ignore: AlwaysUseLowerCamelCase static func fromList(_ pigeonVar_list: [Any?]) -> MessageData? { let name: String? = nilOrValue(pigeonVar_list[0]) let description: String? = nilOrValue(pigeonVar_list[1]) let code = pigeonVar_list[2] as! Code - let data = pigeonVar_list[3] as! [String?: String?] + let data = pigeonVar_list[3] as! [String: String] return MessageData( name: name, @@ -113,7 +113,7 @@ private class MessagesPigeonCodecReader: FlutterStandardReader { override func readValue(ofType type: UInt8) -> Any? { switch type { case 129: - let enumResultAsInt: Int? = nilOrValue(self.readValue() as? Int) + let enumResultAsInt: Int? = nilOrValue(self.readValue() as! Int?) if let enumResultAsInt = enumResultAsInt { return Code(rawValue: enumResultAsInt) } @@ -191,8 +191,8 @@ class ExampleHostApiSetup { if let api = api { addChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let aArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) - let bArg = args[1] is Int64 ? args[1] as! Int64 : Int64(args[1] as! Int32) + let aArg = args[0] as! Int64 + let bArg = args[1] as! Int64 do { let result = try api.add(aArg, to: bArg) reply(wrapResult(result)) diff --git a/packages/pigeon/example/app/lib/main.dart b/packages/pigeon/example/app/lib/main.dart index 48138f9e950a..cc158abe0c1f 100644 --- a/packages/pigeon/example/app/lib/main.dart +++ b/packages/pigeon/example/app/lib/main.dart @@ -73,7 +73,7 @@ class _MyHomePageState extends State { Future sendMessage(String messageText) { final MessageData message = MessageData( code: Code.one, - data: {'header': 'this is a header'}, + data: {'header': 'this is a header'}, description: 'uri text', ); try { diff --git a/packages/pigeon/example/app/lib/src/messages.g.dart b/packages/pigeon/example/app/lib/src/messages.g.dart index 4eaf6bccecd1..330809525762 100644 --- a/packages/pigeon/example/app/lib/src/messages.g.dart +++ b/packages/pigeon/example/app/lib/src/messages.g.dart @@ -48,7 +48,7 @@ class MessageData { Code code; - Map data; + Map data; Object encode() { return [ @@ -65,7 +65,7 @@ class MessageData { name: result[0] as String?, description: result[1] as String?, code: result[2]! as Code, - data: (result[3] as Map?)!.cast(), + data: (result[3] as Map?)!.cast(), ); } } @@ -74,7 +74,10 @@ class _PigeonCodec extends StandardMessageCodec { const _PigeonCodec(); @override void writeValue(WriteBuffer buffer, Object? value) { - if (value is Code) { + if (value is int) { + buffer.putUint8(4); + buffer.putInt64(value); + } else if (value is Code) { buffer.putUint8(129); writeValue(buffer, value.index); } else if (value is MessageData) { diff --git a/packages/pigeon/example/app/pigeons/messages.dart b/packages/pigeon/example/app/pigeons/messages.dart index 8c18cc87e81d..2112fed96371 100644 --- a/packages/pigeon/example/app/pigeons/messages.dart +++ b/packages/pigeon/example/app/pigeons/messages.dart @@ -40,7 +40,7 @@ class MessageData { String? name; String? description; Code code; - Map data; + Map data; } @HostApi() diff --git a/packages/pigeon/lib/ast.dart b/packages/pigeon/lib/ast.dart index 8151ef9f092d..1c93d4630e30 100644 --- a/packages/pigeon/lib/ast.dart +++ b/packages/pigeon/lib/ast.dart @@ -4,8 +4,11 @@ import 'package:collection/collection.dart' show ListEquality; import 'package:meta/meta.dart'; + import 'generator_tools.dart'; +import 'kotlin_generator.dart' show KotlinProxyApiOptions; import 'pigeon_lib.dart'; +import 'swift_generator.dart' show SwiftProxyApiOptions; typedef _ListEquals = bool Function(List, List); @@ -140,6 +143,8 @@ class AstProxyApi extends Api { required this.fields, this.superClass, this.interfaces = const {}, + this.swiftOptions, + this.kotlinOptions, }); /// List of constructors inside the API. @@ -154,6 +159,14 @@ class AstProxyApi extends Api { /// Name of the classes this class considers to be implemented. Set interfaces; + /// Options that control how Swift code will be generated for a specific + /// ProxyApi. + final SwiftProxyApiOptions? swiftOptions; + + /// Options that control how Kotlin code will be generated for a specific + /// ProxyApi. + final KotlinProxyApiOptions? kotlinOptions; + /// Methods implemented in the host platform language. Iterable get hostMethods => methods.where( (Method method) => method.location == ApiLocation.host, @@ -253,7 +266,7 @@ class AstProxyApi extends Api { } } - /// Whether the api has a method that callbacks to Dart to add a new instance + /// Whether the API has a method that callbacks to Dart to add a new instance /// to the InstanceManager. /// /// This is possible as long as no callback methods are required to @@ -265,6 +278,21 @@ class AstProxyApi extends Api { .every((Method method) => !method.isRequired); } + /// Whether the API has any message calls from Dart to host. + bool hasAnyHostMessageCalls() => + constructors.isNotEmpty || + attachedFields.isNotEmpty || + hostMethods.isNotEmpty; + + /// Whether the API has any message calls from host to Dart. + bool hasAnyFlutterMessageCalls() => + hasCallbackConstructor() || flutterMethods.isNotEmpty; + + /// Whether the host proxy API class will have methods that need to be + /// implemented. + bool hasMethodsRequiringImplementation() => + hasAnyHostMessageCalls() || unattachedFields.isNotEmpty; + // Recursively search for all the interfaces apis from a list of names of // interfaces. // @@ -652,6 +680,7 @@ class Class extends Node { Class({ required this.name, required this.fields, + this.isReferenced = true, this.isSwiftClass = false, this.documentationComments = const [], }); @@ -662,6 +691,9 @@ class Class extends Node { /// All the fields contained in the class. List fields; + /// Whether the class is referenced in any API. + bool isReferenced; + /// Determines whether the defined class should be represented as a struct or /// a class in Swift generation. /// diff --git a/packages/pigeon/lib/cpp_generator.dart b/packages/pigeon/lib/cpp_generator.dart index 425c5a297684..96579cc23f9a 100644 --- a/packages/pigeon/lib/cpp_generator.dart +++ b/packages/pigeon/lib/cpp_generator.dart @@ -867,9 +867,7 @@ class CppSourceGenerator extends StructuredGenerator { // Returns the expression to convert the given EncodableValue to a field // value. String getValueExpression(NamedType field, String encodable) { - if (field.type.baseName == 'int') { - return '$encodable.LongValue()'; - } else if (field.type.baseName == 'Object') { + if (field.type.baseName == 'Object') { return encodable; } else { final HostDatatype hostDatatype = @@ -1636,17 +1634,7 @@ ${prefix}reply(EncodableValue(std::move(wrapped)));'''; if (hostType.isNullable) { // Nullable arguments are always pointers, with nullptr corresponding to // null. - if (hostType.datatype == 'int64_t') { - // The EncodableValue will either be an int32_t or an int64_t depending - // on the value, but the generated API requires an int64_t so that it can - // handle any case. Create a local variable for the 64-bit value... - final String valueVarName = '${argName}_value'; - indent.writeln( - 'const int64_t $valueVarName = $encodableArgName.IsNull() ? 0 : $encodableArgName.LongValue();'); - // ... then declare the arg as a reference to that local. - indent.writeln( - 'const auto* $argName = $encodableArgName.IsNull() ? nullptr : &$valueVarName;'); - } else if (hostType.datatype == 'EncodableValue') { + if (hostType.datatype == 'EncodableValue') { // Generic objects just pass the EncodableValue through directly. indent.writeln('const auto* $argName = &$encodableArgName;'); } else if (hostType.isBuiltin) { diff --git a/packages/pigeon/lib/dart/templates.dart b/packages/pigeon/lib/dart/templates.dart index 48c5859dc3d5..c78c4f566d22 100644 --- a/packages/pigeon/lib/dart/templates.dart +++ b/packages/pigeon/lib/dart/templates.dart @@ -4,6 +4,20 @@ import '../generator_tools.dart'; +/// Name for the generated InstanceManager for ProxyApis. +/// +/// This lowers the chances of variable name collisions with user defined +/// parameters. +const String dartInstanceManagerClassName = + '${proxyApiClassNamePrefix}InstanceManager'; + +/// Name for the generated InstanceManager API for ProxyApis. +/// +/// This lowers the chances of variable name collisions with user defined +/// parameters. +const String dartInstanceManagerApiClassName = + '_${classNamePrefix}InstanceManagerApi'; + /// Creates the `InstanceManager` with the passed string values. String instanceManagerTemplate({ required Iterable allProxyApiNames, @@ -30,9 +44,9 @@ String instanceManagerTemplate({ /// is added as a weak reference with the same identifier. This prevents a /// scenario where the weak referenced instance was released and then later /// returned by the host platform. -class $instanceManagerClassName { - /// Constructs a [$instanceManagerClassName]. - $instanceManagerClassName({required void Function(int) onWeakReferenceRemoved}) { +class $dartInstanceManagerClassName { + /// Constructs a [$dartInstanceManagerClassName]. + $dartInstanceManagerClassName({required void Function(int) onWeakReferenceRemoved}) { this.onWeakReferenceRemoved = (int identifier) { _weakInstances.remove(identifier); onWeakReferenceRemoved(identifier); @@ -46,12 +60,12 @@ class $instanceManagerClassName { // 0 <= n < 2^16. static const int _maxDartCreatedIdentifier = 65536; - /// The default [$instanceManagerClassName] used by ProxyApis. + /// The default [$dartInstanceManagerClassName] used by ProxyApis. /// /// On creation, this manager makes a call to clear the native /// InstanceManager. This is to prevent identifier conflicts after a host /// restart. - static final $instanceManagerClassName instance = _initInstance(); + static final $dartInstanceManagerClassName instance = _initInstance(); // Expando is used because it doesn't prevent its keys from becoming // inaccessible. This allows the manager to efficiently retrieve an identifier @@ -72,17 +86,17 @@ class $instanceManagerClassName { /// or becomes inaccessible. late final void Function(int) onWeakReferenceRemoved; - static $instanceManagerClassName _initInstance() { + static $dartInstanceManagerClassName _initInstance() { WidgetsFlutterBinding.ensureInitialized(); - final _${instanceManagerClassName}Api api = _${instanceManagerClassName}Api(); - // Clears the native `$instanceManagerClassName` on the initial use of the Dart one. + final $dartInstanceManagerApiClassName api = $dartInstanceManagerApiClassName(); + // Clears the native `$dartInstanceManagerClassName` on the initial use of the Dart one. api.clear(); - final $instanceManagerClassName instanceManager = $instanceManagerClassName( + final $dartInstanceManagerClassName instanceManager = $dartInstanceManagerClassName( onWeakReferenceRemoved: (int identifier) { api.removeStrongReference(identifier); }, ); - _${instanceManagerClassName}Api.setUpMessageHandlers(instanceManager: instanceManager); + $dartInstanceManagerApiClassName.setUpMessageHandlers(instanceManager: instanceManager); ${apiHandlerSetUps.join('\n\t\t')} return instanceManager; } @@ -229,9 +243,9 @@ abstract class $proxyApiBaseClassName { /// Construct a [$proxyApiBaseClassName]. $proxyApiBaseClassName({ this.$_proxyApiBaseClassMessengerVarName, - $instanceManagerClassName? $_proxyApiBaseClassInstanceManagerVarName, + $dartInstanceManagerClassName? $_proxyApiBaseClassInstanceManagerVarName, }) : $_proxyApiBaseClassInstanceManagerVarName = - $_proxyApiBaseClassInstanceManagerVarName ?? $instanceManagerClassName.instance; + $_proxyApiBaseClassInstanceManagerVarName ?? $dartInstanceManagerClassName.instance; /// Sends and receives binary data across the Flutter platform barrier. /// @@ -242,12 +256,12 @@ abstract class $proxyApiBaseClassName { /// Maintains instances stored to communicate with native language objects. @protected - final $instanceManagerClassName $_proxyApiBaseClassInstanceManagerVarName; + final $dartInstanceManagerClassName $_proxyApiBaseClassInstanceManagerVarName; /// Instantiates and returns a functionally identical object to oneself. /// /// Outside of tests, this method should only ever be called by - /// [$instanceManagerClassName]. + /// [$dartInstanceManagerClassName]. /// /// Subclasses should always override their parent's implementation of this /// method. @@ -264,11 +278,11 @@ abstract class $proxyApiBaseClassName { const String proxyApiBaseCodec = ''' class $_proxyApiCodecName extends _PigeonCodec { const $_proxyApiCodecName(this.instanceManager); - final $instanceManagerClassName instanceManager; + final $dartInstanceManagerClassName instanceManager; @override void writeValue(WriteBuffer buffer, Object? value) { if (value is $proxyApiBaseClassName) { - buffer.putUint8(128); + buffer.putUint8($proxyApiCodecInstanceManagerKey); writeValue(buffer, instanceManager.getIdentifier(value)); } else { super.writeValue(buffer, value); @@ -277,7 +291,7 @@ class $_proxyApiCodecName extends _PigeonCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case $proxyApiCodecInstanceManagerKey: return instanceManager .getInstanceWithWeakReference(readValue(buffer)! as int); default: diff --git a/packages/pigeon/lib/dart_generator.dart b/packages/pigeon/lib/dart_generator.dart index df9f31759293..e8c7550cd708 100644 --- a/packages/pigeon/lib/dart_generator.dart +++ b/packages/pigeon/lib/dart_generator.dart @@ -286,7 +286,7 @@ class DartGenerator extends StructuredGenerator { required String dartPackageName, }) { void writeEncodeLogic(EnumeratedType customType) { - indent.writeScoped('if (value is ${customType.name}) {', '} else ', () { + indent.writeScoped('else if (value is ${customType.name}) {', '}', () { if (customType.enumeration < maximumCodecFieldKey) { indent.writeln('buffer.putUint8(${customType.enumeration});'); if (customType.type == CustomTypes.customClass) { @@ -339,39 +339,42 @@ class DartGenerator extends StructuredGenerator { indent.write('class $_pigeonCodec extends StandardMessageCodec'); indent.addScoped(' {', '}', () { indent.writeln('const $_pigeonCodec();'); - if (enumeratedTypes.isNotEmpty) { - indent.writeln('@override'); - indent.write('void writeValue(WriteBuffer buffer, Object? value) '); - indent.addScoped('{', '}', () { - enumerate(enumeratedTypes, - (int index, final EnumeratedType customType) { - writeEncodeLogic(customType); - }); - indent.addScoped('{', '}', () { - indent.writeln('super.writeValue(buffer, value);'); - }); + indent.writeln('@override'); + indent.write('void writeValue(WriteBuffer buffer, Object? value) '); + indent.addScoped('{', '}', () { + indent.writeScoped('if (value is int) {', '}', () { + indent.writeln('buffer.putUint8(4);'); + indent.writeln('buffer.putInt64(value);'); + }, addTrailingNewline: false); + + enumerate(enumeratedTypes, + (int index, final EnumeratedType customType) { + writeEncodeLogic(customType); }); - indent.newln(); - indent.writeln('@override'); - indent.write('Object? readValueOfType(int type, ReadBuffer buffer) '); + indent.addScoped(' else {', '}', () { + indent.writeln('super.writeValue(buffer, value);'); + }); + }); + indent.newln(); + indent.writeln('@override'); + indent.write('Object? readValueOfType(int type, ReadBuffer buffer) '); + indent.addScoped('{', '}', () { + indent.write('switch (type) '); indent.addScoped('{', '}', () { - indent.write('switch (type) '); - indent.addScoped('{', '}', () { - for (final EnumeratedType customType in enumeratedTypes) { - if (customType.enumeration < maximumCodecFieldKey) { - writeDecodeLogic(customType); - } - } - if (root.requiresOverflowClass) { - writeDecodeLogic(overflowClass); + for (final EnumeratedType customType in enumeratedTypes) { + if (customType.enumeration < maximumCodecFieldKey) { + writeDecodeLogic(customType); } - indent.writeln('default:'); - indent.nest(1, () { - indent.writeln('return super.readValueOfType(type, buffer);'); - }); + } + if (root.requiresOverflowClass) { + writeDecodeLogic(overflowClass); + } + indent.writeln('default:'); + indent.nest(1, () { + indent.writeln('return super.readValueOfType(type, buffer);'); }); }); - } + }); }); } @@ -534,8 +537,6 @@ final BinaryMessenger? ${varNamePrefix}binaryMessenger; Indent indent, { required String dartPackageName, }) { - const String apiName = '${instanceManagerClassName}Api'; - final cb.Parameter binaryMessengerParameter = cb.Parameter( (cb.ParameterBuilder builder) => builder ..name = 'binaryMessenger' @@ -550,23 +551,18 @@ final BinaryMessenger? ${varNamePrefix}binaryMessenger; ..modifier = cb.FieldModifier.final$, ); - final String removeStrongReferenceName = makeChannelNameWithStrings( - apiName: apiName, - methodName: 'removeStrongReference', - dartPackageName: dartPackageName, - ); - final cb.Class instanceManagerApi = cb.Class( (cb.ClassBuilder builder) => builder - ..name = '_$apiName' + ..name = dartInstanceManagerApiClassName ..docs.add( - '/// Generated API for managing the Dart and native `$instanceManagerClassName`s.', + '/// Generated API for managing the Dart and native `$dartInstanceManagerClassName`s.', ) ..constructors.add( cb.Constructor( (cb.ConstructorBuilder builder) { builder - ..docs.add('/// Constructor for [_$apiName].') + ..docs.add( + '/// Constructor for [$dartInstanceManagerApiClassName].') ..optionalParameters.add(binaryMessengerParameter) ..initializers.add( cb.Code( @@ -586,7 +582,7 @@ final BinaryMessenger? ${varNamePrefix}binaryMessenger; ..type = cb.refer('MessageCodec') ..static = true ..modifier = cb.FieldModifier.constant - ..assignment = const cb.Code('StandardMessageCodec()'); + ..assignment = const cb.Code('$_pigeonCodec()'); }, ) ], @@ -611,7 +607,7 @@ final BinaryMessenger? ${varNamePrefix}binaryMessenger; (cb.ParameterBuilder builder) => builder ..name = 'instanceManager' ..named = true - ..type = cb.refer('$instanceManagerClassName?'), + ..type = cb.refer('$dartInstanceManagerClassName?'), ), ]) ..body = cb.Block.of( @@ -631,7 +627,9 @@ final BinaryMessenger? ${varNamePrefix}binaryMessenger; ) ], returnType: const TypeDeclaration.voidDeclaration(), - channelName: removeStrongReferenceName, + channelName: makeRemoveStrongReferenceChannelName( + dartPackageName, + ), isMockHandler: false, isAsynchronous: false, nullHandlerExpression: @@ -641,7 +639,7 @@ final BinaryMessenger? ${varNamePrefix}binaryMessenger; Iterable parameters, Iterable safeArgumentNames, ) { - return '(instanceManager ?? $instanceManagerClassName.instance).remove(${safeArgumentNames.single})'; + return '(instanceManager ?? $dartInstanceManagerClassName.instance).remove(${safeArgumentNames.single})'; }, ); builder.statements.add( @@ -674,7 +672,8 @@ final BinaryMessenger? ${varNamePrefix}binaryMessenger; _writeHostMethodMessageCall( Indent(messageCallSink), addSuffixVariable: false, - channelName: removeStrongReferenceName, + channelName: makeRemoveStrongReferenceChannelName( + dartPackageName), parameters: [ Parameter( name: 'identifier', @@ -700,7 +699,7 @@ final BinaryMessenger? ${varNamePrefix}binaryMessenger; ..returns = cb.refer('Future') ..modifier = cb.MethodModifier.async ..docs.addAll([ - '/// Clear the native `$instanceManagerClassName`.', + '/// Clear the native `$dartInstanceManagerClassName`.', '///', '/// This is typically called after a hot restart.', ]) @@ -710,11 +709,7 @@ final BinaryMessenger? ${varNamePrefix}binaryMessenger; _writeHostMethodMessageCall( Indent(messageCallSink), addSuffixVariable: false, - channelName: makeChannelNameWithStrings( - apiName: apiName, - methodName: 'clear', - dartPackageName: dartPackageName, - ), + channelName: makeClearChannelName(dartPackageName), parameters: [], returnType: const TypeDeclaration.voidDeclaration(), ); @@ -1423,7 +1418,7 @@ if (${varNamePrefix}replyList == null) { '/// Constructs [$apiName] without creating the associated native object.', '///', '/// This should only be used by subclasses created by this library or to', - '/// create copies for an [$instanceManagerClassName].', + '/// create copies for an [$dartInstanceManagerClassName].', ]) ..annotations.add(cb.refer('protected')) ..optionalParameters.addAll([ @@ -1530,7 +1525,7 @@ if (${varNamePrefix}replyList == null) { ');', '```', '', - 'Alternatively, [$instanceManagerClassName.removeWeakReference] can be used to', + 'Alternatively, [$dartInstanceManagerClassName.removeWeakReference] can be used to', 'release the associated Native object manually.', ], ], @@ -1676,7 +1671,7 @@ if (${varNamePrefix}replyList == null) { (cb.ParameterBuilder builder) => builder ..name = _instanceManagerVarName ..named = true - ..type = cb.refer('$instanceManagerClassName?'), + ..type = cb.refer('$dartInstanceManagerClassName?'), ), if (hasCallbackConstructor) cb.Parameter( @@ -1727,7 +1722,7 @@ if (${varNamePrefix}replyList == null) { ..body = cb.Block.of([ if (hasAnyMessageHandlers) ...[ cb.Code( - 'final $codecName $_pigeonChannelCodec = $codecName($_instanceManagerVarName ?? $instanceManagerClassName.instance);', + 'final $codecName $_pigeonChannelCodec = $codecName($_instanceManagerVarName ?? $dartInstanceManagerClassName.instance);', ), const cb.Code( 'final BinaryMessenger? binaryMessenger = ${classMemberNamePrefix}binaryMessenger;', @@ -1775,7 +1770,7 @@ if (${varNamePrefix}replyList == null) { return '${parameter.name}: $safeArgName,\n'; }, ).skip(1).join(); - return '($_instanceManagerVarName ?? $instanceManagerClassName.instance)\n' + return '($_instanceManagerVarName ?? $dartInstanceManagerClassName.instance)\n' ' .addHostCreatedInstance(\n' ' $methodName?.call(${safeArgumentNames.skip(1).join(',')}) ??\n' ' $apiName.${classMemberNamePrefix}detached(' @@ -1911,13 +1906,13 @@ if (${varNamePrefix}replyList == null) { 'final $type $instanceName = $type.${classMemberNamePrefix}detached();', ), cb.Code( - 'final $codecName $_pigeonChannelCodec = $codecName($instanceManagerClassName.instance);', + 'final $codecName $_pigeonChannelCodec = $codecName($dartInstanceManagerClassName.instance);', ), const cb.Code( 'final BinaryMessenger ${varNamePrefix}binaryMessenger = ServicesBinding.instance.defaultBinaryMessenger;', ), const cb.Code( - 'final int $identifierInstanceName = $instanceManagerClassName.instance.addDartCreatedInstance($instanceName);', + 'final int $identifierInstanceName = $dartInstanceManagerClassName.instance.addDartCreatedInstance($instanceName);', ), ], const cb.Code('() async {'), @@ -1978,7 +1973,7 @@ if (${varNamePrefix}replyList == null) { cb.Parameter( (cb.ParameterBuilder builder) => builder ..name = _instanceManagerVarName - ..type = cb.refer('$instanceManagerClassName?'), + ..type = cb.refer('$dartInstanceManagerClassName?'), ), ], ]) @@ -2012,7 +2007,7 @@ if (${varNamePrefix}replyList == null) { ' $codecInstanceName;') else cb.Code( - 'final $codecName $_pigeonChannelCodec = $codecName($_instanceManagerVarName ?? $instanceManagerClassName.instance);', + 'final $codecName $_pigeonChannelCodec = $codecName($_instanceManagerVarName ?? $dartInstanceManagerClassName.instance);', ), const cb.Code( 'final BinaryMessenger? ${varNamePrefix}binaryMessenger = ${classMemberNamePrefix}binaryMessenger;', @@ -2162,8 +2157,8 @@ String _getMethodParameterSignature(Iterable parameters) { String _flattenTypeArguments(List args) { return args .map((TypeDeclaration arg) => arg.typeArguments.isEmpty - ? '${arg.baseName}?' - : '${arg.baseName}<${_flattenTypeArguments(arg.typeArguments)}>?') + ? '${arg.baseName}${arg.isNullable ? '?' : ''}' + : '${arg.baseName}<${_flattenTypeArguments(arg.typeArguments)}>${arg.isNullable ? '?' : ''}') .join(', '); } @@ -2173,11 +2168,11 @@ String _addGenericTypes(TypeDeclaration type) { final List typeArguments = type.typeArguments; switch (type.baseName) { case 'List': - return (typeArguments.isEmpty) + return typeArguments.isEmpty ? 'List' : 'List<${_flattenTypeArguments(typeArguments)}>'; case 'Map': - return (typeArguments.isEmpty) + return typeArguments.isEmpty ? 'Map' : 'Map<${_flattenTypeArguments(typeArguments)}>'; default: diff --git a/packages/pigeon/lib/generator_tools.dart b/packages/pigeon/lib/generator_tools.dart index 0f02dd980d73..cbec3e8da6fc 100644 --- a/packages/pigeon/lib/generator_tools.dart +++ b/packages/pigeon/lib/generator_tools.dart @@ -4,6 +4,7 @@ import 'dart:convert'; import 'dart:io'; +import 'dart:math'; import 'dart:mirrors'; import 'package:yaml/yaml.dart' as yaml; @@ -13,7 +14,7 @@ import 'ast.dart'; /// The current version of pigeon. /// /// This must match the version in pubspec.yaml. -const String pigeonVersion = '21.2.0'; +const String pigeonVersion = '22.6.0'; /// Read all the content from [stdin] to a String. String readStdin() { @@ -70,11 +71,29 @@ class Indent { } /// Replaces the newlines and tabs of input and adds it to the stream. - void format(String input, - {bool leadingSpace = true, bool trailingNewline = true}) { + /// + /// [trimIndentation] flag finds the line with the fewest leading empty + /// spaces and trims the beginning of all lines by this number. + void format( + String input, { + bool leadingSpace = true, + bool trailingNewline = true, + bool trimIndentation = true, + }) { final List lines = input.split('\n'); + + final int indentationToRemove = !trimIndentation + ? 0 + : lines + .where((String line) => line.trim().isNotEmpty) + .map((String line) => line.length - line.trimLeft().length) + .reduce(min); + for (int i = 0; i < lines.length; ++i) { - final String line = lines[i]; + final String line = lines[i].length >= indentationToRemove + ? lines[i].substring(indentationToRemove) + : lines[i]; + if (i == 0 && !leadingSpace) { add(line.replaceAll('\t', tab)); } else if (line.isNotEmpty) { @@ -297,11 +316,17 @@ const String seeAlsoWarning = 'See also: https://pub.dev/packages/pigeon'; /// parameters. const String classNamePrefix = 'PigeonInternal'; -/// Name for the generated InstanceManager for ProxyApis. +/// Prefix for classes generated to use with ProxyApis. /// /// This lowers the chances of variable name collisions with user defined /// parameters. -const String instanceManagerClassName = '${classNamePrefix}InstanceManager'; +const String proxyApiClassNamePrefix = 'Pigeon'; + +/// Prefix for APIs generated for ProxyApi. +/// +/// Since ProxyApis are intended to wrap a class and will often share the name +/// of said class, host APIs should prefix the API with this protected name. +const String hostProxyApiPrefix = '${proxyApiClassNamePrefix}Api'; /// Prefix for class member names not defined by the user. /// @@ -309,7 +334,7 @@ const String instanceManagerClassName = '${classNamePrefix}InstanceManager'; /// parameters. const String classMemberNamePrefix = 'pigeon_'; -/// Prefix for variable names not defined by the user. +/// Prefix for variable names not defined by the user. /// /// This lowers the chances of variable name collisions with user defined /// parameters. @@ -319,6 +344,8 @@ const String varNamePrefix = 'pigeonVar_'; const List disallowedPrefixes = [ classNamePrefix, classMemberNamePrefix, + hostProxyApiPrefix, + proxyApiClassNamePrefix, varNamePrefix, 'pigeonChannelCodec' ]; @@ -422,9 +449,19 @@ const List validTypes = [ 'Object', ]; +/// The dedicated key for accessing an InstanceManager in ProxyApi base codecs. +/// +/// Generated codecs override the `StandardMessageCodec` which reserves the byte +/// keys of 0-127, so this value is chosen because it is the lowest available +/// key. +/// +/// See https://api.flutter.dev/flutter/services/StandardMessageCodec/writeValue.html +/// for more information on keys in MessageCodecs. +const int proxyApiCodecInstanceManagerKey = 128; + /// Custom codecs' custom types are enumerations begin at this number to /// avoid collisions with the StandardMessageCodec. -const int minimumCodecFieldKey = 129; +const int minimumCodecFieldKey = proxyApiCodecInstanceManagerKey + 1; /// The maximum codec enumeration allowed. const int maximumCodecFieldKey = 255; @@ -515,6 +552,48 @@ Map> getReferencedTypes( return references.map; } +/// Find the [TypeDeclaration] that has the highest API requirement and its +/// version, [T]. +/// +/// [T] depends on the language. For example, Android uses an int while iOS uses +/// semantic versioning. +({TypeDeclaration type, T version})? + findHighestApiRequirement( + Iterable types, { + required T? Function(TypeDeclaration) onGetApiRequirement, + required Comparator onCompare, +}) { + Iterable addAllRecursive(TypeDeclaration type) sync* { + yield type; + if (type.typeArguments.isNotEmpty) { + for (final TypeDeclaration typeArg in type.typeArguments) { + yield* addAllRecursive(typeArg); + } + } + } + + final Iterable allReferencedTypes = types + .expand(addAllRecursive) + .where((TypeDeclaration type) => onGetApiRequirement(type) != null); + + if (allReferencedTypes.isEmpty) { + return null; + } + + final TypeDeclaration typeWithHighestRequirement = allReferencedTypes.reduce( + (TypeDeclaration one, TypeDeclaration two) { + return onCompare(onGetApiRequirement(one)!, onGetApiRequirement(two)!) > 0 + ? one + : two; + }, + ); + + return ( + type: typeWithHighestRequirement, + version: onGetApiRequirement(typeWithHighestRequirement)!, + ); +} + /// All custom definable data types. enum CustomTypes { /// A custom Class. @@ -729,3 +808,26 @@ String toScreamingSnakeCase(String string) { RegExp(r'(?<=[a-z])[A-Z]'), (Match m) => '_${m.group(0)}') .toUpperCase(); } + +/// The channel name for the `removeStrongReference` method of the +/// `InstanceManager` API. +/// +/// This ensures the channel name is the same for all languages. +String makeRemoveStrongReferenceChannelName(String dartPackageName) { + return makeChannelNameWithStrings( + apiName: '${classNamePrefix}InstanceManager', + methodName: 'removeStrongReference', + dartPackageName: dartPackageName, + ); +} + +/// The channel name for the `clear` method of the `InstanceManager` API. +/// +/// This ensures the channel name is the same for all languages. +String makeClearChannelName(String dartPackageName) { + return makeChannelNameWithStrings( + apiName: '${classNamePrefix}InstanceManager', + methodName: 'clear', + dartPackageName: dartPackageName, + ); +} diff --git a/packages/pigeon/lib/java_generator.dart b/packages/pigeon/lib/java_generator.dart index 1d4c83d60032..27a1a5915e78 100644 --- a/packages/pigeon/lib/java_generator.dart +++ b/packages/pigeon/lib/java_generator.dart @@ -30,9 +30,6 @@ const String _codecName = 'PigeonCodec'; const String _overflowClassName = '${classNamePrefix}CodecOverflow'; -// Used to create classes with type Int rather than long. -const String _forceInt = '${varNamePrefix}forceInt'; - /// Options that control how Java code will be generated. class JavaOptions { /// Creates a [JavaOptions] object @@ -253,18 +250,11 @@ class JavaGenerator extends StructuredGenerator { } void _writeClassField( - JavaOptions generatorOptions, - Indent indent, - NamedType field, { - bool isPrimitive = false, - }) { + JavaOptions generatorOptions, Indent indent, NamedType field) { final HostDatatype hostDatatype = getFieldHostDatatype( field, (TypeDeclaration x) => _javaTypeForBuiltinDartType(x)); - final String nullability = isPrimitive - ? '' - : field.type.isNullable - ? '@Nullable ' - : '@NonNull '; + final String nullability = + field.type.isNullable ? '@Nullable ' : '@NonNull '; addDocumentationComments( indent, field.documentationComments, _docCommentSpec); @@ -280,7 +270,7 @@ class JavaGenerator extends StructuredGenerator { indent.writeScoped( 'public void ${_makeSetter(field)}($nullability${hostDatatype.datatype} setterArg) {', '}', () { - if (!field.type.isNullable && !isPrimitive) { + if (!field.type.isNullable) { indent.writeScoped('if (setterArg == null) {', '}', () { indent.writeln( 'throw new IllegalStateException("Nonnull field \\"${field.name}\\" is null.");'); @@ -306,7 +296,6 @@ class JavaGenerator extends StructuredGenerator { generatorOptions, indent, field, - isPrimitive: field.type.baseName == _forceInt, ); indent.newln(); } @@ -490,7 +479,7 @@ class JavaGenerator extends StructuredGenerator { indent .writeln('$_overflowClassName wrap = new $_overflowClassName();'); indent.writeln( - 'wrap.setType(${customType.enumeration - maximumCodecFieldKey});'); + 'wrap.setType(${customType.enumeration - maximumCodecFieldKey}L);'); indent.writeln( 'wrap.setWrapped($nullCheck((${customType.name}) value).$encodeString);'); } @@ -580,7 +569,7 @@ class JavaGenerator extends StructuredGenerator { }) { final NamedType overflowInteration = NamedType( name: 'type', - type: const TypeDeclaration(baseName: _forceInt, isNullable: false)); + type: const TypeDeclaration(baseName: 'int', isNullable: false)); final NamedType overflowObject = NamedType( name: 'wrapped', type: const TypeDeclaration(baseName: 'Object', isNullable: true)); @@ -607,7 +596,7 @@ class JavaGenerator extends StructuredGenerator { indent.format(''' static @Nullable Object fromList(@NonNull ArrayList ${varNamePrefix}list) { $_overflowClassName wrapper = new $_overflowClassName(); - wrapper.setType((int) ${varNamePrefix}list.get(0)); + wrapper.setType((Long) ${varNamePrefix}list.get(0)); wrapper.setWrapped(${varNamePrefix}list.get(1)); return wrapper.unwrap(); } @@ -619,7 +608,7 @@ if (wrapped == null) { return null; } '''); - indent.writeScoped('switch (type) {', '}', () { + indent.writeScoped('switch (type.intValue()) {', '}', () { for (int i = totalCustomCodecKeysAllowed; i < types.length; i++) { indent.writeln('case ${i - totalCustomCodecKeysAllowed}:'); indent.nest(1, () { @@ -628,7 +617,7 @@ if (wrapped == null) { 'return ${types[i].name}.fromList((ArrayList) wrapped);'); } else if (types[i].type == CustomTypes.customEnum) { indent.writeln( - 'return ${types[i].name}.values()[(int) wrapped];'); + 'return ${_intToEnum('wrapped', types[i].name, false)};'); } }); } @@ -766,13 +755,8 @@ if (wrapped == null) { const String output = 'output'; final String outputExpression; indent.writeln('@SuppressWarnings("ConstantConditions")'); - if (func.returnType.baseName == 'int') { - outputExpression = - 'listReply.get(0) == null ? null : ((Number) listReply.get(0)).longValue();'; - } else { - outputExpression = - '${_cast('listReply.get(0)', javaType: returnType)};'; - } + outputExpression = + '${_cast('listReply.get(0)', javaType: returnType)};'; indent.writeln('$returnType $output = $outputExpression'); indent.writeln('result.success($output);'); } @@ -951,16 +935,9 @@ if (wrapped == null) { indent.writeln( 'ArrayList args = (ArrayList) message;'); enumerate(method.parameters, (int index, NamedType arg) { - // The StandardMessageCodec can give us [Integer, Long] for - // a Dart 'int'. To keep things simple we just use 64bit - // longs in Pigeon with Java. - final bool isInt = arg.type.baseName == 'int'; - final String argType = - isInt ? 'Number' : _javaTypeForDartType(arg.type); + final String argType = _javaTypeForDartType(arg.type); final String argName = _getSafeArgumentName(index, arg); - final String argExpression = isInt - ? '($argName == null) ? null : $argName.longValue()' - : argName; + final String argExpression = argName; String accessor = 'args.get($index)'; if (argType != 'Object') { accessor = _cast(accessor, javaType: argType); @@ -1176,9 +1153,10 @@ protected static ArrayList wrapError(@NonNull Throwable exception) { /// Converts an expression that evaluates to an nullable int to an expression /// that evaluates to a nullable enum. -String _intToEnum(String expression, String enumName, bool nullable) => nullable - ? '$expression == null ? null : $enumName.values()[(int) $expression]' - : '$enumName.values()[(int) $expression]'; +String _intToEnum(String expression, String enumName, bool nullable) { + final String toEnum = '$enumName.values()[((Long) $expression).intValue()]'; + return nullable ? '$expression == null ? null : $toEnum' : toEnum; +} String _getArgumentName(int count, NamedType argument) => argument.name.isEmpty ? 'arg$count' : argument.name; @@ -1231,8 +1209,6 @@ String? _javaTypeForBuiltinDartType(TypeDeclaration type) { 'Int64List': 'long[]', 'Float64List': 'double[]', 'Object': 'Object', - // This is used to allow the creation of true `int`s for the codec overflow class. - _forceInt: 'int', }; if (javaTypeForDartTypeMap.containsKey(type.baseName)) { return javaTypeForDartTypeMap[type.baseName]; @@ -1271,11 +1247,7 @@ String _cast(String variable, {required String javaType}) { String _castObject(NamedType field, String varName) { final HostDatatype hostDatatype = getFieldHostDatatype( field, (TypeDeclaration x) => _javaTypeForBuiltinDartType(x)); - if (field.type.baseName == 'int') { - return '($varName == null) ? null : (($varName instanceof Integer) ? (Integer) $varName : (${hostDatatype.datatype}) $varName)'; - } else { - return _cast(varName, javaType: hostDatatype.datatype); - } + return _cast(varName, javaType: hostDatatype.datatype); } /// Returns string of Result class type for method based on [TypeDeclaration]. diff --git a/packages/pigeon/lib/kotlin/templates.dart b/packages/pigeon/lib/kotlin/templates.dart new file mode 100644 index 000000000000..5f85078588be --- /dev/null +++ b/packages/pigeon/lib/kotlin/templates.dart @@ -0,0 +1,240 @@ +// 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 '../generator_tools.dart'; +import '../kotlin_generator.dart'; + +/// Name of the Kotlin `InstanceManager`. +String kotlinInstanceManagerClassName(KotlinOptions options) => + '${options.fileSpecificClassNameComponent ?? ''}${proxyApiClassNamePrefix}InstanceManager'; + +/// The name of the registrar containing all the ProxyApi implementations. +String proxyApiRegistrarName(KotlinOptions options) => + '${options.fileSpecificClassNameComponent ?? ''}${proxyApiClassNamePrefix}ProxyApiRegistrar'; + +/// The name of the codec that handles ProxyApis. +String proxyApiCodecName(KotlinOptions options) => + '${options.fileSpecificClassNameComponent ?? ''}${proxyApiClassNamePrefix}ProxyApiBaseCodec'; + +/// The Kotlin `InstanceManager`. +String instanceManagerTemplate(KotlinOptions options) { + return ''' +/** + * Maintains instances used to communicate with the corresponding objects in Dart. + * + * Objects stored in this container are represented by an object in Dart that is also stored in + * an InstanceManager with the same identifier. + * + * When an instance is added with an identifier, either can be used to retrieve the other. + * + * Added instances are added as a weak reference and a strong reference. When the strong + * reference is removed with [remove] and the weak reference is deallocated, the + * `finalizationListener.onFinalize` is called with the instance's identifier. However, if the strong + * reference is removed and then the identifier is retrieved with the intention to pass the identifier + * to Dart (e.g. calling [getIdentifierForStrongReference]), the strong reference to the instance + * is recreated. The strong reference will then need to be removed manually again. + */ +@Suppress("UNCHECKED_CAST", "MemberVisibilityCanBePrivate") +class ${kotlinInstanceManagerClassName(options)}(private val finalizationListener: $_finalizationListenerClassName) { + /** Interface for listening when a weak reference of an instance is removed from the manager. */ + interface $_finalizationListenerClassName { + fun onFinalize(identifier: Long) + } + + private val identifiers = java.util.WeakHashMap() + private val weakInstances = HashMap>() + private val strongInstances = HashMap() + private val referenceQueue = java.lang.ref.ReferenceQueue() + private val weakReferencesToIdentifiers = HashMap, Long>() + private val handler = android.os.Handler(android.os.Looper.getMainLooper()) + private var nextIdentifier: Long = minHostCreatedIdentifier + private var hasFinalizationListenerStopped = false + + /** + * Modifies the time interval used to define how often this instance removes garbage collected + * weak references to native Android objects that this instance was managing. + */ + var clearFinalizedWeakReferencesInterval: Long = 3000 + set(value) { + handler.removeCallbacks { this.releaseAllFinalizedInstances() } + field = value + releaseAllFinalizedInstances() + } + + init { + handler.postDelayed( + { releaseAllFinalizedInstances() }, + clearFinalizedWeakReferencesInterval + ) + } + + companion object { + // Identifiers are locked to a specific range to avoid collisions with objects + // created simultaneously from Dart. + // Host uses identifiers >= 2^16 and Dart is expected to use values n where, + // 0 <= n < 2^16. + private const val minHostCreatedIdentifier: Long = 65536 + private const val tag = "${proxyApiClassNamePrefix}InstanceManager" + + /** + * Instantiate a new manager with a listener for garbage collected weak + * references. + * + * When the manager is no longer needed, [stopFinalizationListener] must be called. + */ + fun create(finalizationListener: $_finalizationListenerClassName): ${kotlinInstanceManagerClassName(options)} { + return ${kotlinInstanceManagerClassName(options)}(finalizationListener) + } + } + + /** + * Removes `identifier` and return its associated strongly referenced instance, if present, + * from the manager. + */ + fun remove(identifier: Long): T? { + logWarningIfFinalizationListenerHasStopped() + return strongInstances.remove(identifier) as T? + } + + /** + * Retrieves the identifier paired with an instance, if present, otherwise `null`. + * + * + * If the manager contains a strong reference to `instance`, it will return the identifier + * associated with `instance`. If the manager contains only a weak reference to `instance`, a new + * strong reference to `instance` will be added and will need to be removed again with [remove]. + * + * + * If this method returns a nonnull identifier, this method also expects the Dart + * `${kotlinInstanceManagerClassName(options)}` to have, or recreate, a weak reference to the Dart instance the + * identifier is associated with. + */ + fun getIdentifierForStrongReference(instance: Any?): Long? { + logWarningIfFinalizationListenerHasStopped() + val identifier = identifiers[instance] + if (identifier != null) { + strongInstances[identifier] = instance!! + } + return identifier + } + + /** + * Adds a new instance that was instantiated from Dart. + * + * The same instance can be added multiple times, but each identifier must be unique. This + * allows two objects that are equivalent (e.g. the `equals` method returns true and their + * hashcodes are equal) to both be added. + * + * [identifier] must be >= 0 and unique. + */ + fun addDartCreatedInstance(instance: Any, identifier: Long) { + logWarningIfFinalizationListenerHasStopped() + addInstance(instance, identifier) + } + + /** + * Adds a new unique instance that was instantiated from the host platform. + * + * [identifier] must be >= 0 and unique. + */ + fun addHostCreatedInstance(instance: Any): Long { + logWarningIfFinalizationListenerHasStopped() + require(!containsInstance(instance)) { "Instance of \${instance.javaClass} has already been added." } + val identifier = nextIdentifier++ + addInstance(instance, identifier) + return identifier + } + + /** Retrieves the instance associated with identifier, if present, otherwise `null`. */ + fun getInstance(identifier: Long): T? { + logWarningIfFinalizationListenerHasStopped() + val instance = weakInstances[identifier] as java.lang.ref.WeakReference? + return instance?.get() + } + + /** Returns whether this manager contains the given `instance`. */ + fun containsInstance(instance: Any?): Boolean { + logWarningIfFinalizationListenerHasStopped() + return identifiers.containsKey(instance) + } + + /** + * Stops the periodic run of the [$_finalizationListenerClassName] for instances that have been garbage + * collected. + * + * The InstanceManager can continue to be used, but the [$_finalizationListenerClassName] will no + * longer be called and methods will log a warning. + */ + fun stopFinalizationListener() { + handler.removeCallbacks { this.releaseAllFinalizedInstances() } + hasFinalizationListenerStopped = true + } + + /** + * Removes all of the instances from this manager. + * + * The manager will be empty after this call returns. + */ + fun clear() { + identifiers.clear() + weakInstances.clear() + strongInstances.clear() + weakReferencesToIdentifiers.clear() + } + + /** + * Whether the [$_finalizationListenerClassName] is still being called for instances that are garbage + * collected. + * + * See [stopFinalizationListener]. + */ + fun hasFinalizationListenerStopped(): Boolean { + return hasFinalizationListenerStopped + } + + private fun releaseAllFinalizedInstances() { + if (hasFinalizationListenerStopped()) { + return + } + var reference: java.lang.ref.WeakReference? + while ((referenceQueue.poll() as java.lang.ref.WeakReference?).also { reference = it } != null) { + val identifier = weakReferencesToIdentifiers.remove(reference) + if (identifier != null) { + weakInstances.remove(identifier) + strongInstances.remove(identifier) + finalizationListener.onFinalize(identifier) + } + } + handler.postDelayed( + { releaseAllFinalizedInstances() }, + clearFinalizedWeakReferencesInterval + ) + } + + private fun addInstance(instance: Any, identifier: Long) { + require(identifier >= 0) { "Identifier must be >= 0: \$identifier" } + require(!weakInstances.containsKey(identifier)) { + "Identifier has already been added: \$identifier" + } + val weakReference = java.lang.ref.WeakReference(instance, referenceQueue) + identifiers[instance] = identifier + weakInstances[identifier] = weakReference + weakReferencesToIdentifiers[weakReference] = identifier + strongInstances[identifier] = instance + } + + private fun logWarningIfFinalizationListenerHasStopped() { + if (hasFinalizationListenerStopped()) { + Log.w( + tag, + "The manager was used after calls to the $_finalizationListenerClassName has been stopped." + ) + } + } +} +'''; +} + +const String _finalizationListenerClassName = + '${proxyApiClassNamePrefix}FinalizationListener'; diff --git a/packages/pigeon/lib/kotlin_generator.dart b/packages/pigeon/lib/kotlin_generator.dart index 4656f2bc16a4..3b5ff62aa822 100644 --- a/packages/pigeon/lib/kotlin_generator.dart +++ b/packages/pigeon/lib/kotlin_generator.dart @@ -2,10 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'package:graphs/graphs.dart'; + import 'ast.dart'; import 'functional.dart'; import 'generator.dart'; import 'generator_tools.dart'; +import 'kotlin/templates.dart'; import 'pigeon_lib.dart' show TaskQueueType; /// Documentation open symbol. @@ -92,6 +95,23 @@ class KotlinOptions { } } +/// Options that control how Kotlin code will be generated for a specific +/// ProxyApi. +class KotlinProxyApiOptions { + /// Construct a [KotlinProxyApiOptions]. + const KotlinProxyApiOptions({this.fullClassName, this.minAndroidApi}); + + /// The name of the full runtime Kotlin class name (including the package). + final String? fullClassName; + + /// The minimum Android api version. + /// + /// This adds the [RequiresApi](https://developer.android.com/reference/androidx/annotation/RequiresApi) + /// annotations on top of any constructor, field, or method that references + /// this element. + final int? minAndroidApi; +} + /// Class that manages all Kotlin code generation. class KotlinGenerator extends StructuredGenerator { /// Instantiates a Kotlin Generator. @@ -344,9 +364,9 @@ class KotlinGenerator extends StructuredGenerator { indent.writeln('${customType.name}.fromList(it)'); }); } else if (customType.type == CustomTypes.customEnum) { - indent.write('return (readValue(buffer) as Int?)?.let '); + indent.write('return (readValue(buffer) as Long?)?.let '); indent.addScoped('{', '}', () { - indent.writeln('${customType.name}.ofRaw(it)'); + indent.writeln('${customType.name}.ofRaw(it.toInt())'); }); } }); @@ -368,7 +388,7 @@ class KotlinGenerator extends StructuredGenerator { } indent.write( - 'private object ${generatorOptions.fileSpecificClassNameComponent}$_codecName : StandardMessageCodec() '); + 'private open class ${generatorOptions.fileSpecificClassNameComponent}$_codecName : StandardMessageCodec() '); indent.addScoped('{', '}', () { indent.write( 'override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? '); @@ -418,7 +438,7 @@ class KotlinGenerator extends StructuredGenerator { }) { final NamedType overflowInt = NamedType( name: 'type', - type: const TypeDeclaration(baseName: 'Int', isNullable: false)); + type: const TypeDeclaration(baseName: 'int', isNullable: false)); final NamedType overflowObject = NamedType( name: 'wrapped', type: const TypeDeclaration(baseName: 'Object', isNullable: true)); @@ -445,7 +465,7 @@ class KotlinGenerator extends StructuredGenerator { companion object { fun fromList(${varNamePrefix}list: List): Any? { val wrapper = ${generatorOptions.fileSpecificClassNameComponent}$_overflowClassName( - type = ${varNamePrefix}list[0] as Int, + type = ${varNamePrefix}list[0] as Long, wrapped = ${varNamePrefix}list[1], ); return wrapper.unwrap() @@ -459,14 +479,15 @@ if (wrapped == null) { return null } '''); - indent.writeScoped('when (type) {', '}', () { + indent.writeScoped('when (type.toInt()) {', '}', () { for (int i = totalCustomCodecKeysAllowed; i < types.length; i++) { indent.writeScoped('${i - totalCustomCodecKeysAllowed} ->', '', () { if (types[i].type == CustomTypes.customClass) { indent.writeln( 'return ${types[i].name}.fromList(wrapped as List)'); } else if (types[i].type == CustomTypes.customEnum) { - indent.writeln('return ${types[i].name}.ofRaw(wrapped as Int)'); + indent.writeln( + 'return ${types[i].name}.ofRaw((wrapped as Long).toInt())'); } }); } @@ -505,7 +526,7 @@ if (wrapped == null) { indent.write('val codec: MessageCodec by lazy '); indent.addScoped('{', '}', () { indent.writeln( - '${generatorOptions.fileSpecificClassNameComponent}$_codecName'); + '${generatorOptions.fileSpecificClassNameComponent}$_codecName()'); }); }); @@ -519,6 +540,24 @@ if (wrapped == null) { channelName: makeChannelName(api, method, dartPackageName), documentationComments: method.documentationComments, dartPackageName: dartPackageName, + onWriteBody: ( + Indent indent, { + required List parameters, + required TypeDeclaration returnType, + required String channelName, + required String errorClassName, + }) { + indent.writeln( + r'val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else ""', + ); + _writeFlutterMethodMessageCall( + indent, + parameters: parameters, + returnType: returnType, + channelName: '$channelName\$separatedMessageChannelSuffix', + errorClassName: errorClassName, + ); + }, ); } }); @@ -569,7 +608,7 @@ if (wrapped == null) { indent.write('val codec: MessageCodec by lazy '); indent.addScoped('{', '}', () { indent.writeln( - '${generatorOptions.fileSpecificClassNameComponent}$_codecName'); + '${generatorOptions.fileSpecificClassNameComponent}$_codecName()'); }); indent.writeln( '/** Sets up an instance of `$apiName` to handle messages through the `binaryMessenger`. */'); @@ -582,9 +621,9 @@ if (wrapped == null) { for (final Method method in api.methods) { _writeHostMethodMessageHandler( indent, - api: api, name: method.name, - channelName: makeChannelName(api, method, dartPackageName), + channelName: + '${makeChannelName(api, method, dartPackageName)}\$separatedMessageChannelSuffix', taskQueueType: method.taskQueueType, parameters: method.parameters, returnType: method.returnType, @@ -596,6 +635,355 @@ if (wrapped == null) { }); } + @override + void writeInstanceManager( + KotlinOptions generatorOptions, + Root root, + Indent indent, { + required String dartPackageName, + }) { + indent.format(instanceManagerTemplate(generatorOptions)); + indent.newln(); + } + + @override + void writeInstanceManagerApi( + KotlinOptions generatorOptions, + Root root, + Indent indent, { + required String dartPackageName, + }) { + final String instanceManagerApiName = + '${kotlinInstanceManagerClassName(generatorOptions)}Api'; + + addDocumentationComments( + indent, + [ + ' Generated API for managing the Dart and native `InstanceManager`s.', + ], + _docCommentSpec, + ); + indent.writeScoped( + 'private class $instanceManagerApiName(val binaryMessenger: BinaryMessenger) {', + '}', + () { + indent.writeScoped('companion object {', '}', () { + addDocumentationComments( + indent, + [' The codec used by $instanceManagerApiName.'], + _docCommentSpec, + ); + indent.writeScoped( + 'val codec: MessageCodec by lazy {', + '}', + () { + indent.writeln( + '${generatorOptions.fileSpecificClassNameComponent}$_codecName()', + ); + }, + ); + indent.newln(); + + addDocumentationComments( + indent, + [ + ' Sets up an instance of `$instanceManagerApiName` to handle messages from the', + ' `binaryMessenger`.', + ], + _docCommentSpec, + ); + indent.writeScoped( + 'fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, instanceManager: ${kotlinInstanceManagerClassName(generatorOptions)}?) {', + '}', + () { + const String setHandlerCondition = 'instanceManager != null'; + _writeHostMethodMessageHandler( + indent, + name: 'removeStrongReference', + channelName: + makeRemoveStrongReferenceChannelName(dartPackageName), + taskQueueType: TaskQueueType.serial, + parameters: [ + Parameter( + name: 'identifier', + type: const TypeDeclaration( + baseName: 'int', + isNullable: false, + ), + ), + ], + returnType: const TypeDeclaration.voidDeclaration(), + setHandlerCondition: setHandlerCondition, + onCreateCall: ( + List safeArgNames, { + required String apiVarName, + }) { + return 'instanceManager.remove(${safeArgNames.single})'; + }, + ); + _writeHostMethodMessageHandler( + indent, + name: 'clear', + channelName: makeClearChannelName(dartPackageName), + taskQueueType: TaskQueueType.serial, + parameters: [], + returnType: const TypeDeclaration.voidDeclaration(), + setHandlerCondition: setHandlerCondition, + onCreateCall: ( + List safeArgNames, { + required String apiVarName, + }) { + return 'instanceManager.clear()'; + }, + ); + }, + ); + }); + indent.newln(); + + _writeFlutterMethod( + indent, + generatorOptions: generatorOptions, + name: 'removeStrongReference', + parameters: [ + Parameter( + name: 'identifier', + type: const TypeDeclaration(baseName: 'int', isNullable: false), + ) + ], + returnType: const TypeDeclaration.voidDeclaration(), + channelName: makeRemoveStrongReferenceChannelName(dartPackageName), + dartPackageName: dartPackageName, + ); + }, + ); + } + + @override + void writeProxyApiBaseCodec( + KotlinOptions generatorOptions, + Root root, + Indent indent, + ) { + final Iterable allProxyApis = + root.apis.whereType(); + + _writeProxyApiRegistrar( + indent, + generatorOptions: generatorOptions, + allProxyApis: allProxyApis, + ); + + // Sort APIs where edges are an API's super class and interfaces. + // + // This sorts the APIs to have child classes be listed before their parent + // classes. This prevents the scenario where a method might return the super + // class of the actual class, so the incorrect Dart class gets created + // because the 'value is ' was checked first in the codec. For + // example: + // + // class Shape {} + // class Circle extends Shape {} + // + // class SomeClass { + // Shape giveMeAShape() => Circle(); + // } + final List sortedApis = topologicalSort( + allProxyApis, + (AstProxyApi api) { + return [ + if (api.superClass?.associatedProxyApi != null) + api.superClass!.associatedProxyApi!, + ...api.interfaces.map( + (TypeDeclaration interface) => interface.associatedProxyApi!, + ), + ]; + }, + ); + + indent.writeScoped( + 'private class ${proxyApiCodecName(generatorOptions)}(val registrar: ${proxyApiRegistrarName(generatorOptions)}) : ' + '${generatorOptions.fileSpecificClassNameComponent}$_codecName() {', + '}', + () { + indent.format( + ''' + override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { + return when (type) { + $proxyApiCodecInstanceManagerKey.toByte() -> { + return registrar.instanceManager.getInstance(readValue(buffer) as Long) + } + else -> super.readValueOfType(type, buffer) + } + }''', + ); + indent.newln(); + + indent.writeScoped( + 'override fun writeValue(stream: ByteArrayOutputStream, value: Any?) {', + '}', + () { + final List nonProxyApiTypes = [ + 'Boolean', + 'ByteArray', + 'Double', + 'DoubleArray', + 'FloatArray', + 'Int', + 'IntArray', + 'List<*>', + 'Long', + 'LongArray', + 'Map<*, *>', + 'String', + ...root.enums.map((Enum anEnum) => anEnum.name), + ]; + final String isSupportedExpression = nonProxyApiTypes + .map((String kotlinType) => 'value is $kotlinType') + .followedBy(['value == null']).join(' || '); + // Non ProxyApi types are checked first to handle the scenario + // where a client wraps the `Object` class which all the + // classes above extend. + indent.writeScoped('if ($isSupportedExpression) {', '}', () { + indent.writeln('super.writeValue(stream, value)'); + indent.writeln('return'); + }); + indent.newln(); + + enumerate( + sortedApis, + (int index, AstProxyApi api) { + final String className = + api.kotlinOptions?.fullClassName ?? api.name; + + final int? minApi = api.kotlinOptions?.minAndroidApi; + final String versionCheck = minApi != null + ? 'android.os.Build.VERSION.SDK_INT >= $minApi && ' + : ''; + + indent.format( + ''' + ${index > 0 ? ' else ' : ''}if (${versionCheck}value is $className) { + registrar.get$hostProxyApiPrefix${api.name}().${classMemberNamePrefix}newInstance(value) { } + }''', + ); + }, + ); + indent.newln(); + + indent.format( + ''' + when { + registrar.instanceManager.containsInstance(value) -> { + stream.write($proxyApiCodecInstanceManagerKey) + writeValue(stream, registrar.instanceManager.getIdentifierForStrongReference(value)) + } + else -> throw IllegalArgumentException("Unsupported value: '\$value' of type '\${value.javaClass.name}'") + }''', + ); + }, + ); + }, + ); + } + + @override + void writeProxyApi( + KotlinOptions generatorOptions, + Root root, + Indent indent, + AstProxyApi api, { + required String dartPackageName, + }) { + final String kotlinApiName = '$hostProxyApiPrefix${api.name}'; + + addDocumentationComments( + indent, + api.documentationComments, + _docCommentSpec, + ); + indent.writeln('@Suppress("UNCHECKED_CAST")'); + // The API only needs to be abstract if there are methods to override. + final String classModifier = + api.hasMethodsRequiringImplementation() ? 'abstract' : 'open'; + indent.writeScoped( + '$classModifier class $kotlinApiName(open val pigeonRegistrar: ${proxyApiRegistrarName(generatorOptions)}) {', + '}', + () { + final String fullKotlinClassName = + api.kotlinOptions?.fullClassName ?? api.name; + + final TypeDeclaration apiAsTypeDeclaration = TypeDeclaration( + baseName: api.name, + isNullable: false, + associatedProxyApi: api, + ); + + _writeProxyApiConstructorAbstractMethods( + indent, + api, + apiAsTypeDeclaration: apiAsTypeDeclaration, + ); + + _writeProxyApiAttachedFieldAbstractMethods( + indent, + api, + apiAsTypeDeclaration: apiAsTypeDeclaration, + ); + + if (api.hasCallbackConstructor()) { + _writeProxyApiUnattachedFieldAbstractMethods( + indent, + api, + apiAsTypeDeclaration: apiAsTypeDeclaration, + ); + } + + _writeProxyApiHostMethodAbstractMethods( + indent, + api, + apiAsTypeDeclaration: apiAsTypeDeclaration, + ); + + if (api.constructors.isNotEmpty || + api.attachedFields.isNotEmpty || + api.hostMethods.isNotEmpty) { + indent.writeScoped('companion object {', '}', () { + _writeProxyApiMessageHandlerMethod( + indent, + api, + apiAsTypeDeclaration: apiAsTypeDeclaration, + kotlinApiName: kotlinApiName, + dartPackageName: dartPackageName, + fullKotlinClassName: fullKotlinClassName, + generatorOptions: generatorOptions, + ); + }); + indent.newln(); + } + + _writeProxyApiNewInstanceMethod( + indent, + api, + generatorOptions: generatorOptions, + apiAsTypeDeclaration: apiAsTypeDeclaration, + newInstanceMethodName: '${classMemberNamePrefix}newInstance', + dartPackageName: dartPackageName, + ); + + _writeProxyApiFlutterMethods( + indent, + api, + generatorOptions: generatorOptions, + apiAsTypeDeclaration: apiAsTypeDeclaration, + dartPackageName: dartPackageName, + ); + + _writeProxyApiInheritedApiMethods(indent, api); + }, + ); + } + void _writeWrapResult(Indent indent) { indent.newln(); indent.write('private fun wrapResult(result: Any?): List '); @@ -672,12 +1060,13 @@ if (wrapped == null) { final bool hasFlutterApi = root.apis .whereType() .any((Api api) => api.methods.isNotEmpty); + final bool hasProxyApi = root.apis.any((Api api) => api is AstProxyApi); - if (hasHostApi) { + if (hasHostApi || hasProxyApi) { _writeWrapResult(indent); _writeWrapError(generatorOptions, indent); } - if (hasFlutterApi) { + if (hasFlutterApi || hasProxyApi) { _writeCreateConnectionError(generatorOptions, indent); } if (generatorOptions.includeErrorClass) { @@ -693,6 +1082,7 @@ if (wrapped == null) { List documentationComments = const [], int? minApiRequirement, bool isAsynchronous = false, + bool isOpen = false, bool isAbstract = false, String Function(int index, NamedType type) getArgumentName = _getArgumentName, @@ -725,28 +1115,33 @@ if (wrapped == null) { ); } + final String openKeyword = isOpen ? 'open ' : ''; final String abstractKeyword = isAbstract ? 'abstract ' : ''; if (isAsynchronous) { argSignature.add('callback: (Result<$resultType>) -> Unit'); - indent.writeln('${abstractKeyword}fun $name(${argSignature.join(', ')})'); + indent.writeln( + '$openKeyword${abstractKeyword}fun $name(${argSignature.join(', ')})', + ); } else if (returnType.isVoid) { - indent.writeln('${abstractKeyword}fun $name(${argSignature.join(', ')})'); + indent.writeln( + '$openKeyword${abstractKeyword}fun $name(${argSignature.join(', ')})', + ); } else { indent.writeln( - '${abstractKeyword}fun $name(${argSignature.join(', ')}): $returnTypeString', + '$openKeyword${abstractKeyword}fun $name(${argSignature.join(', ')}): $returnTypeString', ); } } void _writeHostMethodMessageHandler( Indent indent, { - required Api api, required String name, required String channelName, required TaskQueueType taskQueueType, required List parameters, required TypeDeclaration returnType, + String setHandlerCondition = 'api != null', bool isAsynchronous = false, String Function(List safeArgNames, {required String apiVarName})? onCreateCall, @@ -759,8 +1154,10 @@ if (wrapped == null) { indent.writeln( 'val $taskQueue = binaryMessenger.makeBackgroundTaskQueue()'); } + indent.write( - 'val channel = BasicMessageChannel(binaryMessenger, "$channelName\$separatedMessageChannelSuffix", codec'); + 'val channel = BasicMessageChannel(binaryMessenger, "$channelName", codec', + ); if (taskQueue != null) { indent.addln(', $taskQueue)'); @@ -768,7 +1165,7 @@ if (wrapped == null) { indent.addln(')'); } - indent.write('if (api != null) '); + indent.write('if ($setHandlerCondition) '); indent.addScoped('{', '}', () { final String messageVarName = parameters.isNotEmpty ? 'message' : '_'; @@ -841,6 +1238,13 @@ if (wrapped == null) { required String dartPackageName, List documentationComments = const [], int? minApiRequirement, + void Function( + Indent indent, { + required List parameters, + required TypeDeclaration returnType, + required String channelName, + required String errorClassName, + }) onWriteBody = _writeFlutterMethodMessageCall, }) { _writeMethodDeclaration( indent, @@ -855,7 +1259,7 @@ if (wrapped == null) { final String errorClassName = _getErrorClassName(generatorOptions); indent.addScoped('{', '}', () { - _writeFlutterMethodMessageCall( + onWriteBody( indent, parameters: parameters, returnType: returnType, @@ -885,10 +1289,7 @@ if (wrapped == null) { } const String channel = 'channel'; - indent.writeln( - r'val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else ""'); - indent.writeln( - 'val channelName = "$channelName\$separatedMessageChannelSuffix"'); + indent.writeln('val channelName = "$channelName"'); indent.writeln( 'val $channel = BasicMessageChannel(binaryMessenger, channelName, codec)'); indent.writeScoped('$channel.send($sendArgument) {', '}', () { @@ -920,6 +1321,664 @@ if (wrapped == null) { }); }); } + + void _writeProxyApiRegistrar( + Indent indent, { + required KotlinOptions generatorOptions, + required Iterable allProxyApis, + }) { + final String registrarName = proxyApiRegistrarName(generatorOptions); + final String instanceManagerName = kotlinInstanceManagerClassName( + generatorOptions, + ); + final String instanceManagerApiName = '${instanceManagerName}Api'; + + addDocumentationComments( + indent, + [ + ' Provides implementations for each ProxyApi implementation and provides access to resources', + ' needed by any implementation.', + ], + _docCommentSpec, + ); + indent.writeScoped( + 'abstract class $registrarName(val binaryMessenger: BinaryMessenger) {', + '}', + () { + addDocumentationComments( + indent, + [' Whether APIs should ignore calling to Dart.'], + _docCommentSpec, + ); + indent.writeln('public var ignoreCallsToDart = false'); + indent.format( + ''' + val instanceManager: $instanceManagerName + private var _codec: MessageCodec? = null + val codec: MessageCodec + get() { + if (_codec == null) { + _codec = ${proxyApiCodecName(generatorOptions)}(this) + } + return _codec!! + } + + init { + val api = $instanceManagerApiName(binaryMessenger) + instanceManager = $instanceManagerName.create( + object : $instanceManagerName.PigeonFinalizationListener { + override fun onFinalize(identifier: Long) { + api.removeStrongReference(identifier) { + if (it.isFailure) { + Log.e( + "${proxyApiClassNamePrefix}ProxyApiRegistrar", + "Failed to remove Dart strong reference with identifier: \$identifier" + ) + } + } + } + } + ) + }''', + ); + for (final AstProxyApi api in allProxyApis) { + _writeMethodDeclaration( + indent, + name: 'get$hostProxyApiPrefix${api.name}', + isAbstract: + api.hasAnyHostMessageCalls() || api.unattachedFields.isNotEmpty, + isOpen: + !api.hasAnyHostMessageCalls() && api.unattachedFields.isEmpty, + documentationComments: [ + ' An implementation of [$hostProxyApiPrefix${api.name}] used to add a new Dart instance of', + ' `${api.name}` to the Dart `InstanceManager`.' + ], + returnType: TypeDeclaration( + baseName: '$hostProxyApiPrefix${api.name}', + isNullable: false, + ), + parameters: [], + ); + + // Use the default API implementation if this API does not have any + // methods to implement. + if (!api.hasMethodsRequiringImplementation()) { + indent.writeScoped('{', '}', () { + indent.writeln('return $hostProxyApiPrefix${api.name}(this)'); + }); + } + indent.newln(); + } + + indent.writeScoped('fun setUp() {', '}', () { + indent.writeln( + '$instanceManagerApiName.setUpMessageHandlers(binaryMessenger, instanceManager)', + ); + for (final AstProxyApi api in allProxyApis) { + final bool hasHostMessageCalls = api.constructors.isNotEmpty || + api.attachedFields.isNotEmpty || + api.hostMethods.isNotEmpty; + if (hasHostMessageCalls) { + indent.writeln( + '$hostProxyApiPrefix${api.name}.setUpMessageHandlers(binaryMessenger, get$hostProxyApiPrefix${api.name}())', + ); + } + } + }); + + indent.writeScoped('fun tearDown() {', '}', () { + indent.writeln( + '$instanceManagerApiName.setUpMessageHandlers(binaryMessenger, null)', + ); + for (final AstProxyApi api in allProxyApis) { + if (api.hasAnyHostMessageCalls()) { + indent.writeln( + '$hostProxyApiPrefix${api.name}.setUpMessageHandlers(binaryMessenger, null)', + ); + } + } + }); + }, + ); + } + + // Writes the abstract method that instantiates a new instance of the Kotlin + // class. + void _writeProxyApiConstructorAbstractMethods( + Indent indent, + AstProxyApi api, { + required TypeDeclaration apiAsTypeDeclaration, + }) { + for (final Constructor constructor in api.constructors) { + _writeMethodDeclaration( + indent, + name: constructor.name.isNotEmpty + ? constructor.name + : '${classMemberNamePrefix}defaultConstructor', + returnType: apiAsTypeDeclaration, + documentationComments: constructor.documentationComments, + minApiRequirement: _findAndroidHighestApiRequirement([ + apiAsTypeDeclaration, + ...constructor.parameters.map( + (Parameter parameter) => parameter.type, + ), + ])?.version, + isAbstract: true, + parameters: [ + ...api.unattachedFields.map((ApiField field) { + return Parameter(name: field.name, type: field.type); + }), + ...constructor.parameters + ], + ); + indent.newln(); + } + } + + // Writes the abstract method that handles instantiating an attached field. + void _writeProxyApiAttachedFieldAbstractMethods( + Indent indent, + AstProxyApi api, { + required TypeDeclaration apiAsTypeDeclaration, + }) { + for (final ApiField field in api.attachedFields) { + _writeMethodDeclaration( + indent, + name: field.name, + documentationComments: field.documentationComments, + returnType: field.type, + isAbstract: true, + minApiRequirement: _findAndroidHighestApiRequirement([ + apiAsTypeDeclaration, + field.type, + ])?.version, + parameters: [ + if (!field.isStatic) + Parameter( + name: '${classMemberNamePrefix}instance', + type: apiAsTypeDeclaration, + ), + ], + ); + indent.newln(); + } + } + + // Writes the abstract method that handles accessing an unattached field. + void _writeProxyApiUnattachedFieldAbstractMethods( + Indent indent, + AstProxyApi api, { + required TypeDeclaration apiAsTypeDeclaration, + }) { + for (final ApiField field in api.unattachedFields) { + _writeMethodDeclaration( + indent, + name: field.name, + documentationComments: field.documentationComments, + returnType: field.type, + isAbstract: true, + minApiRequirement: _findAndroidHighestApiRequirement([ + apiAsTypeDeclaration, + field.type, + ])?.version, + parameters: [ + Parameter( + name: '${classMemberNamePrefix}instance', + type: apiAsTypeDeclaration, + ), + ], + ); + indent.newln(); + } + } + + // Writes the abstract method that handles making a call from for a host + // method. + void _writeProxyApiHostMethodAbstractMethods( + Indent indent, + AstProxyApi api, { + required TypeDeclaration apiAsTypeDeclaration, + }) { + for (final Method method in api.hostMethods) { + _writeMethodDeclaration( + indent, + name: method.name, + returnType: method.returnType, + documentationComments: method.documentationComments, + isAsynchronous: method.isAsynchronous, + isAbstract: true, + minApiRequirement: _findAndroidHighestApiRequirement( + [ + if (!method.isStatic) apiAsTypeDeclaration, + method.returnType, + ...method.parameters.map((Parameter p) => p.type), + ], + )?.version, + parameters: [ + if (!method.isStatic) + Parameter( + name: '${classMemberNamePrefix}instance', + type: apiAsTypeDeclaration, + ), + ...method.parameters, + ], + ); + indent.newln(); + } + } + + // Writes the `..setUpMessageHandler` method to ensure incoming messages are + // handled by the correct abstract host methods. + void _writeProxyApiMessageHandlerMethod( + Indent indent, + AstProxyApi api, { + required TypeDeclaration apiAsTypeDeclaration, + required String kotlinApiName, + required String dartPackageName, + required String fullKotlinClassName, + required KotlinOptions generatorOptions, + }) { + indent.writeln('@Suppress("LocalVariableName")'); + indent.writeScoped( + 'fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: $kotlinApiName?) {', + '}', + () { + indent.writeln( + 'val codec = api?.pigeonRegistrar?.codec ?: ${generatorOptions.fileSpecificClassNameComponent}$_codecName()', + ); + void writeWithApiCheckIfNecessary( + List types, { + required String channelName, + required void Function() onWrite, + }) { + final ({TypeDeclaration type, int version})? typeWithRequirement = + _findAndroidHighestApiRequirement(types); + if (typeWithRequirement != null) { + final int apiRequirement = typeWithRequirement.version; + indent.writeScoped( + 'if (android.os.Build.VERSION.SDK_INT >= $apiRequirement) {', + '}', + onWrite, + addTrailingNewline: false, + ); + indent.writeScoped(' else {', '}', () { + final String className = typeWithRequirement + .type.associatedProxyApi!.kotlinOptions?.fullClassName ?? + typeWithRequirement.type.baseName; + indent.format( + ''' + val channel = BasicMessageChannel( + binaryMessenger, + "$channelName", + codec + ) + if (api != null) { + channel.setMessageHandler { _, reply -> + reply.reply(wrapError(UnsupportedOperationException( + "Call references class `$className`, which requires api version $apiRequirement." + ))) + } + } else { + channel.setMessageHandler(null) + }''', + ); + }); + } else { + onWrite(); + } + } + + for (final Constructor constructor in api.constructors) { + final String name = constructor.name.isNotEmpty + ? constructor.name + : '${classMemberNamePrefix}defaultConstructor'; + final String channelName = makeChannelNameWithStrings( + apiName: api.name, + methodName: name, + dartPackageName: dartPackageName, + ); + writeWithApiCheckIfNecessary( + [ + apiAsTypeDeclaration, + ...api.unattachedFields.map((ApiField f) => f.type), + ...constructor.parameters.map((Parameter p) => p.type), + ], + channelName: channelName, + onWrite: () { + _writeHostMethodMessageHandler( + indent, + name: name, + channelName: channelName, + taskQueueType: TaskQueueType.serial, + returnType: const TypeDeclaration.voidDeclaration(), + onCreateCall: ( + List methodParameters, { + required String apiVarName, + }) { + return '$apiVarName.pigeonRegistrar.instanceManager.addDartCreatedInstance(' + '$apiVarName.$name(${methodParameters.skip(1).join(',')}), ${methodParameters.first})'; + }, + parameters: [ + Parameter( + name: '${classMemberNamePrefix}identifier', + type: const TypeDeclaration( + baseName: 'int', + isNullable: false, + ), + ), + ...api.unattachedFields.map((ApiField field) { + return Parameter( + name: field.name, + type: field.type, + ); + }), + ...constructor.parameters, + ], + ); + }, + ); + } + + for (final ApiField field in api.attachedFields) { + final String channelName = makeChannelNameWithStrings( + apiName: api.name, + methodName: field.name, + dartPackageName: dartPackageName, + ); + writeWithApiCheckIfNecessary( + [apiAsTypeDeclaration, field.type], + channelName: channelName, + onWrite: () { + _writeHostMethodMessageHandler( + indent, + name: field.name, + channelName: channelName, + taskQueueType: TaskQueueType.serial, + returnType: const TypeDeclaration.voidDeclaration(), + onCreateCall: ( + List methodParameters, { + required String apiVarName, + }) { + final String param = + methodParameters.length > 1 ? methodParameters.first : ''; + return '$apiVarName.pigeonRegistrar.instanceManager.addDartCreatedInstance(' + '$apiVarName.${field.name}($param), ${methodParameters.last})'; + }, + parameters: [ + if (!field.isStatic) + Parameter( + name: '${classMemberNamePrefix}instance', + type: apiAsTypeDeclaration, + ), + Parameter( + name: '${classMemberNamePrefix}identifier', + type: const TypeDeclaration( + baseName: 'int', + isNullable: false, + ), + ), + ], + ); + }, + ); + } + + for (final Method method in api.hostMethods) { + final String channelName = + makeChannelName(api, method, dartPackageName); + writeWithApiCheckIfNecessary( + [ + if (!method.isStatic) apiAsTypeDeclaration, + method.returnType, + ...method.parameters.map((Parameter p) => p.type), + ], + channelName: channelName, + onWrite: () { + _writeHostMethodMessageHandler( + indent, + name: method.name, + channelName: makeChannelName(api, method, dartPackageName), + taskQueueType: method.taskQueueType, + returnType: method.returnType, + isAsynchronous: method.isAsynchronous, + parameters: [ + if (!method.isStatic) + Parameter( + name: '${classMemberNamePrefix}instance', + type: TypeDeclaration( + baseName: fullKotlinClassName, + isNullable: false, + associatedProxyApi: api, + ), + ), + ...method.parameters, + ], + ); + }, + ); + } + }, + ); + } + + // Writes the method that calls to Dart to instantiate a new Dart instance. + void _writeProxyApiNewInstanceMethod( + Indent indent, + AstProxyApi api, { + required KotlinOptions generatorOptions, + required TypeDeclaration apiAsTypeDeclaration, + required String newInstanceMethodName, + required String dartPackageName, + }) { + indent.writeln('@Suppress("LocalVariableName", "FunctionName")'); + _writeFlutterMethod( + indent, + generatorOptions: generatorOptions, + name: newInstanceMethodName, + returnType: const TypeDeclaration.voidDeclaration(), + documentationComments: [ + ' Creates a Dart instance of ${api.name} and attaches it to [${classMemberNamePrefix}instanceArg].', + ], + channelName: makeChannelNameWithStrings( + apiName: api.name, + methodName: newInstanceMethodName, + dartPackageName: dartPackageName, + ), + minApiRequirement: _findAndroidHighestApiRequirement([ + apiAsTypeDeclaration, + ...api.unattachedFields.map((ApiField field) => field.type), + ])?.version, + dartPackageName: dartPackageName, + parameters: [ + Parameter( + name: '${classMemberNamePrefix}instance', + type: TypeDeclaration( + baseName: api.name, + isNullable: false, + associatedProxyApi: api, + ), + ), + ], + onWriteBody: ( + Indent indent, { + required List parameters, + required TypeDeclaration returnType, + required String channelName, + required String errorClassName, + }) { + indent.writeScoped( + 'if (pigeonRegistrar.ignoreCallsToDart) {', + '}', + () { + indent.format( + ''' + callback( + Result.failure( + $errorClassName("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return''', + ); + }, + ); + indent.writeScoped( + 'if (pigeonRegistrar.instanceManager.containsInstance(${classMemberNamePrefix}instanceArg)) {', + '}', + () { + indent.writeln('Result.success(Unit)'); + indent.writeln('return'); + }, + ); + if (api.hasCallbackConstructor()) { + indent.writeln( + 'val ${classMemberNamePrefix}identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(${classMemberNamePrefix}instanceArg)', + ); + enumerate(api.unattachedFields, (int index, ApiField field) { + final String argName = _getSafeArgumentName(index, field); + indent.writeln( + 'val $argName = ${field.name}(${classMemberNamePrefix}instanceArg)', + ); + }); + + indent + .writeln('val binaryMessenger = pigeonRegistrar.binaryMessenger'); + indent.writeln('val codec = pigeonRegistrar.codec'); + _writeFlutterMethodMessageCall( + indent, + returnType: returnType, + channelName: channelName, + errorClassName: errorClassName, + parameters: [ + Parameter( + name: '${classMemberNamePrefix}identifier', + type: const TypeDeclaration( + baseName: 'int', + isNullable: false, + ), + ), + ...api.unattachedFields.map( + (ApiField field) { + return Parameter(name: field.name, type: field.type); + }, + ), + ], + ); + } else { + indent.writeln( + 'throw IllegalStateException("Attempting to create a new Dart instance of ${api.name}, but the class has a nonnull callback method.")', + ); + } + }, + ); + indent.newln(); + } + + // Writes the Flutter methods that call back to Dart. + void _writeProxyApiFlutterMethods( + Indent indent, + AstProxyApi api, { + required KotlinOptions generatorOptions, + required TypeDeclaration apiAsTypeDeclaration, + required String dartPackageName, + }) { + for (final Method method in api.flutterMethods) { + _writeFlutterMethod( + indent, + generatorOptions: generatorOptions, + name: method.name, + returnType: method.returnType, + channelName: makeChannelName(api, method, dartPackageName), + dartPackageName: dartPackageName, + documentationComments: method.documentationComments, + minApiRequirement: _findAndroidHighestApiRequirement([ + apiAsTypeDeclaration, + method.returnType, + ...method.parameters.map((Parameter parameter) => parameter.type), + ])?.version, + parameters: [ + Parameter( + name: '${classMemberNamePrefix}instance', + type: TypeDeclaration( + baseName: api.name, + isNullable: false, + associatedProxyApi: api, + ), + ), + ...method.parameters, + ], + onWriteBody: ( + Indent indent, { + required List parameters, + required TypeDeclaration returnType, + required String channelName, + required String errorClassName, + }) { + indent.writeScoped( + 'if (pigeonRegistrar.ignoreCallsToDart) {', + '}', + () { + indent.format( + ''' + callback( + Result.failure( + $errorClassName("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return''', + ); + }, + ); + indent + .writeln('val binaryMessenger = pigeonRegistrar.binaryMessenger'); + indent.writeln('val codec = pigeonRegistrar.codec'); + _writeFlutterMethodMessageCall( + indent, + returnType: returnType, + channelName: channelName, + errorClassName: errorClassName, + parameters: parameters, + ); + }, + ); + indent.newln(); + } + } + + // Writes the getters for accessing the implementation of other ProxyApis. + // + // These are used for inherited Flutter methods. + void _writeProxyApiInheritedApiMethods(Indent indent, AstProxyApi api) { + final Set inheritedApiNames = { + if (api.superClass != null) api.superClass!.baseName, + ...api.interfaces.map((TypeDeclaration type) => type.baseName), + }; + for (final String name in inheritedApiNames) { + indent.writeln('@Suppress("FunctionName")'); + final String apiName = '$hostProxyApiPrefix$name'; + _writeMethodDeclaration( + indent, + name: '${classMemberNamePrefix}get$apiName', + documentationComments: [ + ' An implementation of [$apiName] used to access callback methods', + ], + returnType: TypeDeclaration(baseName: apiName, isNullable: false), + parameters: [], + ); + + indent.writeScoped('{', '}', () { + indent.writeln('return pigeonRegistrar.get$apiName()'); + }); + indent.newln(); + } + } +} + +({TypeDeclaration type, int version})? _findAndroidHighestApiRequirement( + Iterable types, +) { + return findHighestApiRequirement( + types, + onGetApiRequirement: (TypeDeclaration type) { + return type.associatedProxyApi?.kotlinOptions?.minAndroidApi; + }, + onCompare: (int first, int second) => first.compareTo(second), + ); } String _getErrorClassName(KotlinOptions generatorOptions) => @@ -993,8 +2052,19 @@ String? _kotlinTypeForBuiltinDartType(TypeDeclaration type) { } } +String? _kotlinTypeForProxyApiType(TypeDeclaration type) { + if (type.isProxyApi) { + return type.associatedProxyApi!.kotlinOptions?.fullClassName ?? + type.associatedProxyApi!.name; + } + + return null; +} + String _kotlinTypeForDartType(TypeDeclaration type) { - return _kotlinTypeForBuiltinDartType(type) ?? type.baseName; + return _kotlinTypeForBuiltinDartType(type) ?? + _kotlinTypeForProxyApiType(type) ?? + type.baseName; } String _nullSafeKotlinTypeForDartType(TypeDeclaration type) { @@ -1009,13 +2079,5 @@ String _cast(Indent indent, String variable, {required TypeDeclaration type}) { if (type.isNullable && typeString == 'Any') { return variable; } - if (typeString == 'Int' || typeString == 'Long') { - return '$variable${_castInt(type.isNullable)}'; - } return '$variable as ${_nullSafeKotlinTypeForDartType(type)}'; } - -String _castInt(bool isNullable) { - final String nullability = isNullable ? '?' : ''; - return '.let { num -> if (num is Int) num.toLong() else num as Long$nullability }'; -} diff --git a/packages/pigeon/lib/objc_generator.dart b/packages/pigeon/lib/objc_generator.dart index 6489b5d4e0ed..d0e0e99ee293 100644 --- a/packages/pigeon/lib/objc_generator.dart +++ b/packages/pigeon/lib/objc_generator.dart @@ -297,7 +297,7 @@ class ObjcHeaderGenerator extends StructuredGenerator { final _ObjcType returnType = _objcTypeForDartType( generatorOptions.prefix, func.returnType, // Nullability is required since the return must be nil if NSError is set. - forceNullability: true, + forceBox: true, ); final String callbackType = _callbackForType(func.returnType, returnType, generatorOptions); @@ -336,7 +336,7 @@ class ObjcHeaderGenerator extends StructuredGenerator { func.returnType, // Nullability is required since the return must be nil if NSError is // set. - forceNullability: true, + forceBox: true, ); String? lastArgName; @@ -1072,7 +1072,7 @@ static FlutterError *createConnectionError(NSString *channelName) { final _ObjcType returnType = _objcTypeForDartType( generatorOptions.prefix, func.returnType, // Nullability is required since the return must be nil if NSError is set. - forceNullability: true, + forceBox: true, ); final Iterable selectorComponents = _getSelectorComponents(func, lastSelectorComponent); @@ -1187,7 +1187,7 @@ void _writeMethod( languageOptions.prefix, func.returnType, // Nullability is required since the return must be nil if NSError is set. - forceNullability: true, + forceBox: true, ); final String callbackType = _callbackForType(func.returnType, returnType, languageOptions); @@ -1440,28 +1440,27 @@ String? _nsnumberExtractionMethod( /// Example: ('FOO', ['Foo', 'Bar']) -> 'FOOFoo *, FOOBar *'). String _flattenTypeArguments(String? classPrefix, List args) { final String result = args.map((TypeDeclaration e) { - // print(e); if (e.isEnum) { return _enumName(e.baseName, prefix: classPrefix, box: true, suffix: ' *'); } - return _objcTypeForDartType(classPrefix, e).toString(); + return _objcTypeForDartType(classPrefix, e, forceBox: true).toString(); }).join(', '); return result; } _ObjcType? _objcTypeForPrimitiveDartType(TypeDeclaration type, - {bool forceNullability = false}) { - return forceNullability || type.isNullable + {bool forceBox = false}) { + return forceBox || type.isNullable ? _objcTypeForNullableDartTypeMap[type.baseName] : _objcTypeForNonNullableDartTypeMap[type.baseName]; } String? _objcTypeStringForPrimitiveDartType( String? classPrefix, TypeDeclaration type, - {required bool beforeString, bool forceNullability = false}) { + {required bool beforeString, bool forceBox = false}) { final _ObjcType? objcType; - if (forceNullability || type.isNullable) { + if (forceBox || type.isNullable) { objcType = _objcTypeForNullableDartTypeMap.containsKey(type.baseName) ? _objcTypeForDartType(classPrefix, type) : null; @@ -1476,14 +1475,14 @@ String? _objcTypeStringForPrimitiveDartType( /// Returns the Objective-C type for a Dart [field], prepending the /// [classPrefix] for generated classes. _ObjcType _objcTypeForDartType(String? classPrefix, TypeDeclaration field, - {bool forceNullability = false}) { + {bool forceBox = false}) { final _ObjcType? primitiveType = - _objcTypeForPrimitiveDartType(field, forceNullability: forceNullability); + _objcTypeForPrimitiveDartType(field, forceBox: forceBox); return primitiveType == null ? _ObjcType( baseName: _className(classPrefix, field.baseName), // Non-nullable enums are non-pointer types. - isPointer: !field.isEnum || (field.isNullable || forceNullability)) + isPointer: !field.isEnum || (field.isNullable || forceBox)) : field.typeArguments.isEmpty ? primitiveType : _ObjcType( @@ -1516,7 +1515,7 @@ String _propertyTypeForDartType(TypeDeclaration type, } String _capitalize(String str) => - (str.isEmpty) ? '' : str[0].toUpperCase() + str.substring(1); + str.isEmpty ? '' : str[0].toUpperCase() + str.substring(1); /// Returns the components of the objc selector that will be generated from /// [func], ie the strings between the semicolons. [lastSelectorComponent] is diff --git a/packages/pigeon/lib/pigeon.dart b/packages/pigeon/lib/pigeon.dart index 53087ae7877a..bfa23ad58017 100644 --- a/packages/pigeon/lib/pigeon.dart +++ b/packages/pigeon/lib/pigeon.dart @@ -8,7 +8,7 @@ export 'cpp_generator.dart' show CppOptions; export 'dart_generator.dart' show DartOptions; export 'gobject_generator.dart' show GObjectOptions; export 'java_generator.dart' show JavaOptions; -export 'kotlin_generator.dart' show KotlinOptions; +export 'kotlin_generator.dart' show KotlinOptions, KotlinProxyApiOptions; export 'objc_generator.dart' show ObjcOptions; export 'pigeon_lib.dart'; -export 'swift_generator.dart' show SwiftOptions; +export 'swift_generator.dart' show SwiftOptions, SwiftProxyApiOptions; diff --git a/packages/pigeon/lib/pigeon_lib.dart b/packages/pigeon/lib/pigeon_lib.dart index d5623a295814..075049d98298 100644 --- a/packages/pigeon/lib/pigeon_lib.dart +++ b/packages/pigeon/lib/pigeon_lib.dart @@ -23,6 +23,7 @@ import 'package:analyzer/error/error.dart' show AnalysisError; import 'package:args/args.dart'; import 'package:collection/collection.dart' as collection; import 'package:path/path.dart' as path; +import 'package:pub_semver/pub_semver.dart'; import 'ast.dart'; import 'ast_generator.dart'; @@ -139,7 +140,7 @@ class FlutterApi { /// methods. class ProxyApi { /// Parametric constructor for [ProxyApi]. - const ProxyApi({this.superClass}); + const ProxyApi({this.superClass, this.kotlinOptions, this.swiftOptions}); /// The proxy api that is a super class to this one. /// @@ -149,6 +150,14 @@ class ProxyApi { /// Note that using this instead of `extends` can cause unexpected conflicts /// with inherited method names. final Type? superClass; + + /// Options that control how Swift code will be generated for a specific + /// ProxyApi. + final SwiftProxyApiOptions? swiftOptions; + + /// Options that control how Kotlin code will be generated for a specific + /// ProxyApi. + final KotlinProxyApiOptions? kotlinOptions; } /// Metadata to annotation methods to control the selector used for objc output. @@ -736,6 +745,7 @@ class SwiftGeneratorAdapter implements GeneratorAdapter { path.posix.join(options.basePath ?? '', options.copyrightHeader)) : null, errorClassName: swiftOptions.errorClassName, + includeErrorClass: swiftOptions.includeErrorClass, )); const SwiftGenerator generator = SwiftGenerator(); generator.generate( @@ -967,22 +977,6 @@ List _validateAst(Root root, String source) { lineNumber: _calculateLineNumberNullable(source, field.offset), )); } - for (final TypeDeclaration typeArgument in field.type.typeArguments) { - if (!typeArgument.isNullable) { - result.add(Error( - message: - 'Generic type parameters must be nullable in field "${field.name}" in class "${classDefinition.name}".', - lineNumber: _calculateLineNumberNullable(source, field.offset), - )); - } - if (customEnums.contains(typeArgument.baseName)) { - result.add(Error( - message: - 'Enum types aren\'t supported in type arguments in "${field.name}" in class "${classDefinition.name}".', - lineNumber: _calculateLineNumberNullable(source, field.offset), - )); - } - } if (!(validTypes.contains(field.type.baseName) || customClasses.contains(field.type.baseName) || customEnums.contains(field.type.baseName))) { @@ -1393,13 +1387,16 @@ class _RootBuilder extends dart_ast_visitor.RecursiveAstVisitor { getReferencedTypes(_apis, _classes); final Set referencedTypeNames = referencedTypes.keys.map((TypeDeclaration e) => e.baseName).toSet(); - final List referencedClasses = List.from(_classes); - referencedClasses - .removeWhere((Class x) => !referencedTypeNames.contains(x.name)); + final List nonReferencedClasses = List.from(_classes); + nonReferencedClasses + .removeWhere((Class x) => referencedTypeNames.contains(x.name)); + for (final Class x in nonReferencedClasses) { + x.isReferenced = false; + } final List referencedEnums = List.from(_enums); final Root completeRoot = - Root(apis: _apis, classes: referencedClasses, enums: referencedEnums); + Root(apis: _apis, classes: _classes, enums: referencedEnums); final List validateErrors = _validateAst(completeRoot, source); final List totalErrors = List.from(_errors); @@ -1407,9 +1404,7 @@ class _RootBuilder extends dart_ast_visitor.RecursiveAstVisitor { for (final MapEntry> element in referencedTypes.entries) { - if (!referencedClasses - .map((Class e) => e.name) - .contains(element.key.baseName) && + if (!_classes.map((Class e) => e.name).contains(element.key.baseName) && !referencedEnums .map((Enum e) => e.name) .contains(element.key.baseName) && @@ -1430,7 +1425,7 @@ class _RootBuilder extends dart_ast_visitor.RecursiveAstVisitor { lineNumber: lineNumber)); } } - for (final Class classDefinition in referencedClasses) { + for (final Class classDefinition in _classes) { classDefinition.fields = _attachAssociatedDefinitions( classDefinition.fields, ); @@ -1685,6 +1680,50 @@ class _RootBuilder extends dart_ast_visitor.RecursiveAstVisitor { } } + SwiftProxyApiOptions? swiftOptions; + final Map? swiftOptionsMap = + annotationMap['swiftOptions'] as Map?; + if (swiftOptionsMap != null) { + swiftOptions = SwiftProxyApiOptions( + name: swiftOptionsMap['name'] as String?, + import: swiftOptionsMap['import'] as String?, + minIosApi: swiftOptionsMap['minIosApi'] as String?, + minMacosApi: swiftOptionsMap['minMacosApi'] as String?, + supportsIos: swiftOptionsMap['supportsIos'] as bool? ?? true, + supportsMacos: swiftOptionsMap['supportsMacos'] as bool? ?? true, + ); + } + + void tryParseApiRequirement(String? version) { + if (version == null) { + return; + } + try { + Version.parse(version); + } on FormatException catch (error) { + _errors.add( + Error( + message: + 'Could not parse version: ${error.message}. Please use semantic versioning format: "1.2.3".', + lineNumber: _calculateLineNumber(source, node.offset), + ), + ); + } + } + + tryParseApiRequirement(swiftOptions?.minIosApi); + tryParseApiRequirement(swiftOptions?.minMacosApi); + + KotlinProxyApiOptions? kotlinOptions; + final Map? kotlinOptionsMap = + annotationMap['kotlinOptions'] as Map?; + if (kotlinOptionsMap != null) { + kotlinOptions = KotlinProxyApiOptions( + fullClassName: kotlinOptionsMap['fullClassName'] as String?, + minAndroidApi: kotlinOptionsMap['minAndroidApi'] as int?, + ); + } + _currentApi = AstProxyApi( name: node.name.lexeme, methods: [], @@ -1692,6 +1731,8 @@ class _RootBuilder extends dart_ast_visitor.RecursiveAstVisitor { fields: [], superClass: superClass, interfaces: interfaces, + swiftOptions: swiftOptions, + kotlinOptions: kotlinOptions, documentationComments: _documentationCommentsParser(node.documentationComment?.tokens), ); diff --git a/packages/pigeon/lib/swift/templates.dart b/packages/pigeon/lib/swift/templates.dart new file mode 100644 index 000000000000..d67e8acf18fa --- /dev/null +++ b/packages/pigeon/lib/swift/templates.dart @@ -0,0 +1,256 @@ +// 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 '../generator_tools.dart'; +import '../pigeon.dart'; + +/// Name of delegate that handles the callback when an object is deallocated +/// in an `InstanceManager`. +String instanceManagerFinalizerDelegateName(SwiftOptions options) => + '${_instanceManagerFinalizerName(options)}Delegate'; + +/// The name of the registrar containing all the ProxyApi implementations. +String proxyApiRegistrarName(SwiftOptions options) => + '${options.fileSpecificClassNameComponent ?? ''}${proxyApiClassNamePrefix}ProxyApiRegistrar'; + +/// The name of the `ReaderWriter` that handles ProxyApis. +String proxyApiReaderWriterName(SwiftOptions options) => + '${options.fileSpecificClassNameComponent ?? ''}${classNamePrefix}ProxyApiCodecReaderWriter'; + +/// Name of the Swift `InstanceManager`. +String swiftInstanceManagerClassName(SwiftOptions options) => + '${options.fileSpecificClassNameComponent ?? ''}${proxyApiClassNamePrefix}InstanceManager'; + +/// Template for delegate with callback when an object is deallocated. +String instanceManagerFinalizerDelegateTemplate(SwiftOptions options) => ''' +/// Handles the callback when an object is deallocated. +protocol ${instanceManagerFinalizerDelegateName(options)}: AnyObject { + /// Invoked when the strong reference of an object is deallocated in an `InstanceManager`. + func onDeinit(identifier: Int64) +} + +'''; + +/// Template for an object that tracks when an object is deallocated. +String instanceManagerFinalizerTemplate(SwiftOptions options) => ''' +// Attaches to an object to receive a callback when the object is deallocated. +internal final class ${_instanceManagerFinalizerName(options)} { + private static let associatedObjectKey = malloc(1)! + + private let identifier: Int64 + // Reference to the delegate is weak because the callback should be ignored if the + // `InstanceManager` is deallocated. + private weak var delegate: ${instanceManagerFinalizerDelegateName(options)}? + + private init(identifier: Int64, delegate: ${instanceManagerFinalizerDelegateName(options)}) { + self.identifier = identifier + self.delegate = delegate + } + + internal static func attach( + to instance: AnyObject, identifier: Int64, delegate: ${instanceManagerFinalizerDelegateName(options)} + ) { + let finalizer = ${_instanceManagerFinalizerName(options)}(identifier: identifier, delegate: delegate) + objc_setAssociatedObject(instance, associatedObjectKey, finalizer, .OBJC_ASSOCIATION_RETAIN) + } + + static func detach(from instance: AnyObject) { + objc_setAssociatedObject(instance, associatedObjectKey, nil, .OBJC_ASSOCIATION_ASSIGN) + } + + deinit { + delegate?.onDeinit(identifier: identifier) + } +} + +'''; + +/// The Swift `InstanceManager`. +String instanceManagerTemplate(SwiftOptions options) { + return ''' +/// Maintains instances used to communicate with the corresponding objects in Dart. +/// +/// Objects stored in this container are represented by an object in Dart that is also stored in +/// an InstanceManager with the same identifier. +/// +/// When an instance is added with an identifier, either can be used to retrieve the other. +/// +/// Added instances are added as a weak reference and a strong reference. When the strong +/// reference is removed and the weak reference is deallocated,`${instanceManagerFinalizerDelegateName(options)}.onDeinit` +/// is called with the instance's identifier. However, if the strong reference is removed and then the identifier is +/// retrieved with the intention to pass the identifier to Dart (e.g. by calling `identifierWithStrongReference`), +/// the strong reference to the instance is re-added. The strong reference will then need to be removed manually +/// again. +/// +/// Accessing and inserting to an InstanceManager is thread safe. +final class ${swiftInstanceManagerClassName(options)} { + // Identifiers are locked to a specific range to avoid collisions with objects + // created simultaneously from Dart. + // Host uses identifiers >= 2^16 and Dart is expected to use values n where, + // 0 <= n < 2^16. + private static let minHostCreatedIdentifier: Int64 = 65536 + + private let lockQueue = DispatchQueue(label: "${swiftInstanceManagerClassName(options)}") + private let identifiers: NSMapTable = NSMapTable( + keyOptions: [.weakMemory, .objectPointerPersonality], valueOptions: .strongMemory) + private let weakInstances: NSMapTable = NSMapTable( + keyOptions: .strongMemory, valueOptions: [.weakMemory, .objectPointerPersonality]) + private let strongInstances: NSMapTable = NSMapTable( + keyOptions: .strongMemory, valueOptions: [.strongMemory, .objectPointerPersonality]) + private let finalizerDelegate: ${instanceManagerFinalizerDelegateName(options)} + private var nextIdentifier: Int64 = minHostCreatedIdentifier + + public init(finalizerDelegate: ${instanceManagerFinalizerDelegateName(options)}) { + self.finalizerDelegate = finalizerDelegate + } + + /// Adds a new instance that was instantiated from Dart. + /// + /// The same instance can be added multiple times, but each identifier must be unique. This allows + /// two objects that are equivalent (e.g. conforms to `Equatable`) to both be added. + /// + /// - Parameters: + /// - instance: the instance to be stored + /// - identifier: the identifier to be paired with instance. This value must be >= 0 and unique + func addDartCreatedInstance(_ instance: AnyObject, withIdentifier identifier: Int64) { + lockQueue.async { + self.addInstance(instance, withIdentifier: identifier) + } + } + + /// Adds a new instance that was instantiated from the host platform. + /// + /// - Parameters: + /// - instance: the instance to be stored. This must be unique to all other added instances. + /// - Returns: the unique identifier (>= 0) stored with instance + func addHostCreatedInstance(_ instance: AnyObject) -> Int64 { + assert(!containsInstance(instance), "Instance of \\(instance) has already been added.") + var identifier: Int64 = -1 + lockQueue.sync { + identifier = nextIdentifier + nextIdentifier += 1 + self.addInstance(instance, withIdentifier: identifier) + } + return identifier + } + + /// Removes `instanceIdentifier` and its associated strongly referenced instance, if present, from the manager. + /// + /// - Parameters: + /// - instanceIdentifier: the identifier paired to an instance. + /// - Returns: removed instance if the manager contains the given identifier, otherwise `nil` if + /// the manager doesn't contain the value + func removeInstance(withIdentifier instanceIdentifier: Int64) throws -> T? { + var instance: AnyObject? = nil + lockQueue.sync { + instance = strongInstances.object(forKey: NSNumber(value: instanceIdentifier)) + strongInstances.removeObject(forKey: NSNumber(value: instanceIdentifier)) + } + return instance as? T + } + + /// Retrieves the instance associated with identifier. + /// + /// - Parameters: + /// - instanceIdentifier: the identifier associated with an instance + /// - Returns: the instance associated with `instanceIdentifier` if the manager contains the value, otherwise + /// `nil` if the manager doesn't contain the value + func instance(forIdentifier instanceIdentifier: Int64) -> T? { + var instance: AnyObject? = nil + lockQueue.sync { + instance = weakInstances.object(forKey: NSNumber(value: instanceIdentifier)) + } + return instance as? T + } + + private func addInstance(_ instance: AnyObject, withIdentifier identifier: Int64) { + assert(identifier >= 0) + assert( + weakInstances.object(forKey: identifier as NSNumber) == nil, + "Identifier has already been added: \\(identifier)") + identifiers.setObject(NSNumber(value: identifier), forKey: instance) + weakInstances.setObject(instance, forKey: NSNumber(value: identifier)) + strongInstances.setObject(instance, forKey: NSNumber(value: identifier)) + ${_instanceManagerFinalizerName(options)}.attach(to: instance, identifier: identifier, delegate: finalizerDelegate) + } + + /// Retrieves the identifier paired with an instance. + /// + /// If the manager contains a strong reference to `instance`, it will return the identifier + /// associated with `instance`. If the manager contains only a weak reference to `instance`, a new + /// strong reference to `instance` will be added and will need to be removed again with `removeInstance`. + /// + /// If this method returns a nonnull identifier, this method also expects the Dart + /// `${swiftInstanceManagerClassName(options)}` to have, or recreate, a weak reference to the Dart instance the + /// identifier is associated with. + /// + /// - Parameters: + /// - instance: an instance that may be stored in the manager + /// - Returns: the identifier associated with `instance` if the manager contains the value, otherwise + /// `nil` if the manager doesn't contain the value + func identifierWithStrongReference(forInstance instance: AnyObject) -> Int64? { + var identifier: Int64? = nil + lockQueue.sync { + if let existingIdentifier = identifiers.object(forKey: instance)?.int64Value { + strongInstances.setObject(instance, forKey: NSNumber(value: existingIdentifier)) + identifier = existingIdentifier + } + } + return identifier + } + + /// Whether this manager contains the given `instance`. + /// + /// - Parameters: + /// - instance: the instance whose presence in this manager is to be tested + /// - Returns: whether this manager contains the given `instance` + func containsInstance(_ instance: AnyObject) -> Bool { + var containsInstance = false + lockQueue.sync { + containsInstance = identifiers.object(forKey: instance) != nil + } + return containsInstance + } + + /// Removes all of the instances from this manager. + /// + /// The manager will be empty after this call returns. + func removeAllObjects() throws { + lockQueue.sync { + identifiers.removeAllObjects() + weakInstances.removeAllObjects() + strongInstances.removeAllObjects() + nextIdentifier = ${swiftInstanceManagerClassName(options)}.minHostCreatedIdentifier + } + } + + /// The number of instances stored as a strong reference. + /// + /// For debugging and testing purposes. + internal var strongInstanceCount: Int { + var count: Int = 0 + lockQueue.sync { + count = strongInstances.count + } + return count + } + + /// The number of instances stored as a weak reference. + /// + /// For debugging and testing purposes. NSMapTables that store keys or objects as weak + /// reference will be reclaimed non-deterministically. + internal var weakInstanceCount: Int { + var count: Int = 0 + lockQueue.sync { + count = weakInstances.count + } + return count + } +} + +'''; +} + +String _instanceManagerFinalizerName(SwiftOptions options) => + '${options.fileSpecificClassNameComponent ?? ''}${classNamePrefix}Finalizer'; diff --git a/packages/pigeon/lib/swift_generator.dart b/packages/pigeon/lib/swift_generator.dart index f1c493534842..289c50dbd887 100644 --- a/packages/pigeon/lib/swift_generator.dart +++ b/packages/pigeon/lib/swift_generator.dart @@ -2,10 +2,15 @@ // 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' as collection; +import 'package:graphs/graphs.dart'; +import 'package:pub_semver/pub_semver.dart'; + import 'ast.dart'; import 'functional.dart'; import 'generator.dart'; import 'generator_tools.dart'; +import 'swift/templates.dart'; /// Documentation comment open symbol. const String _docCommentPrefix = '///'; @@ -23,6 +28,7 @@ class SwiftOptions { this.copyrightHeader, this.fileSpecificClassNameComponent, this.errorClassName, + this.includeErrorClass = true, }); /// A copyright header that will get prepended to generated code. @@ -34,6 +40,12 @@ class SwiftOptions { /// The name of the error class used for passing custom error parameters. final String? errorClassName; + /// Whether to include the error class in generation. + /// + /// This should only ever be set to false if you have another generated + /// Swift file in the same directory. + final bool includeErrorClass; + /// Creates a [SwiftOptions] from a Map representation where: /// `x = SwiftOptions.fromList(x.toMap())`. static SwiftOptions fromList(Map map) { @@ -42,6 +54,7 @@ class SwiftOptions { fileSpecificClassNameComponent: map['fileSpecificClassNameComponent'] as String?, errorClassName: map['errorClassName'] as String?, + includeErrorClass: map['includeErrorClass'] as bool? ?? true, ); } @@ -53,6 +66,7 @@ class SwiftOptions { if (fileSpecificClassNameComponent != null) 'fileSpecificClassNameComponent': fileSpecificClassNameComponent!, if (errorClassName != null) 'errorClassName': errorClassName!, + 'includeErrorClass': includeErrorClass, }; return result; } @@ -64,6 +78,54 @@ class SwiftOptions { } } +/// Options that control how Swift code will be generated for a specific +/// ProxyApi. +class SwiftProxyApiOptions { + /// Constructs a [SwiftProxyApiOptions]. + const SwiftProxyApiOptions({ + this.name, + this.import, + this.minIosApi, + this.minMacosApi, + this.supportsIos = true, + this.supportsMacos = true, + }); + + /// The name of the Swift class. + /// + /// By default, generated code will use the same name as the class in the Dart + /// pigeon file. + final String? name; + + /// The name of the module that needs to be imported to access the class. + final String? import; + + /// The API version requirement for iOS. + /// + /// This adds `@available` annotations on top of any constructor, field, or + /// method that references this element. + final String? minIosApi; + + /// The API version requirement for macOS. + /// + /// This adds `@available` annotations on top of any constructor, field, or + /// method that references this element. + final String? minMacosApi; + + /// Whether this ProxyApi class compiles on iOS. + /// + /// This adds `#` annotations on top of any constructor, field, or + /// method that references this element. + /// + /// Defaults to true. + final bool supportsIos; + + /// Whether this ProxyApi class compiles on macOS. + /// + /// Defaults to true. + final bool supportsMacos; +} + /// Class that manages all Swift code generation. class SwiftGenerator extends StructuredGenerator { /// Instantiates a Swift Generator. @@ -92,7 +154,17 @@ class SwiftGenerator extends StructuredGenerator { required String dartPackageName, }) { indent.writeln('import Foundation'); + + final Iterable proxyApiImports = root.apis + .whereType() + .map((AstProxyApi proxyApi) => proxyApi.swiftOptions?.import) + .whereNotNull() + .toSet(); + for (final String import in proxyApiImports) { + indent.writeln('import $import'); + } indent.newln(); + indent.format(''' #if os(iOS) import Flutter @@ -145,7 +217,7 @@ class SwiftGenerator extends StructuredGenerator { indent.nest(1, () { if (customType.type == CustomTypes.customEnum) { indent.writeln( - 'let enumResultAsInt: Int? = nilOrValue(self.readValue() as? Int)'); + 'let enumResultAsInt: Int? = nilOrValue(self.readValue() as! Int?)'); indent.writeScoped('if let enumResultAsInt = enumResultAsInt {', '}', () { indent.writeln( @@ -419,7 +491,7 @@ if (wrapped == nil) { } void _writeClassField(Indent indent, NamedType field, {bool addNil = true}) { - indent.add('${field.name}: ${_nullsafeSwiftTypeForDartType(field.type)}'); + indent.add('${field.name}: ${_nullSafeSwiftTypeForDartType(field.type)}'); final String defaultNil = field.type.isNullable && addNil ? ' = nil' : ''; indent.add(defaultNil); } @@ -487,7 +559,17 @@ if (wrapped == nil) { getFieldsInSerializationOrder(classDefinition).last == field ? '' : ','; - indent.writeln('${field.name}: ${field.name}$comma'); + // Force-casting nullable enums in maps doesn't work the same as other types. + // It needs soft-casting followed by force unwrapping. + final String forceUnwrapMapWithNullableEnums = + (field.type.baseName == 'Map' && + !field.type.isNullable && + field.type.typeArguments + .any((TypeDeclaration type) => type.isEnum)) + ? '!' + : ''; + indent.writeln( + '${field.name}: ${field.name}$forceUnwrapMapWithNullableEnums$comma'); } }); }); @@ -570,7 +652,8 @@ if (wrapped == nil) { indent, generatorOptions: generatorOptions, name: func.name, - channelName: makeChannelName(api, func, dartPackageName), + channelName: + '${makeChannelName(api, func, dartPackageName)}\\(messageChannelSuffix)', parameters: func.parameters, returnType: func.returnType, swiftFunction: func.swiftFunction, @@ -634,7 +717,8 @@ if (wrapped == nil) { _writeHostMethodMessageHandler( indent, name: method.name, - channelName: makeChannelName(api, method, dartPackageName), + channelName: + '${makeChannelName(api, method, dartPackageName)}\\(channelSuffix)', parameters: method.parameters, returnType: method.returnType, isAsynchronous: method.isAsynchronous, @@ -646,18 +730,483 @@ if (wrapped == nil) { }); } + @override + void writeInstanceManager( + SwiftOptions generatorOptions, + Root root, + Indent indent, { + required String dartPackageName, + }) { + indent.format(instanceManagerFinalizerDelegateTemplate(generatorOptions)); + indent.format(instanceManagerFinalizerTemplate(generatorOptions)); + indent.format(instanceManagerTemplate(generatorOptions)); + } + + @override + void writeInstanceManagerApi( + SwiftOptions generatorOptions, + Root root, + Indent indent, { + required String dartPackageName, + }) { + final String instanceManagerApiName = + '${swiftInstanceManagerClassName(generatorOptions)}Api'; + + final String removeStrongReferenceName = + makeRemoveStrongReferenceChannelName( + dartPackageName, + ); + + indent.writeScoped('private class $instanceManagerApiName {', '}', () { + addDocumentationComments( + indent, + [' The codec used for serializing messages.'], + _docCommentSpec, + ); + indent.writeln( + 'var codec: FlutterStandardMessageCodec { ${_getCodecName(generatorOptions)}.shared }', + ); + indent.newln(); + + addDocumentationComments( + indent, + [' Handles sending and receiving messages with Dart.'], + _docCommentSpec, + ); + indent.writeln('unowned let binaryMessenger: FlutterBinaryMessenger'); + indent.newln(); + + indent.writeScoped( + 'init(binaryMessenger: FlutterBinaryMessenger) {', + '}', + () { + indent.writeln('self.binaryMessenger = binaryMessenger'); + }, + ); + indent.newln(); + + addDocumentationComments( + indent, + [ + ' Sets up an instance of `$instanceManagerApiName` to handle messages through the `binaryMessenger`.', + ], + _docCommentSpec, + ); + indent.writeScoped( + 'static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, instanceManager: ${swiftInstanceManagerClassName(generatorOptions)}?) {', + '}', + () { + indent.writeln( + 'let codec = ${_getCodecName(generatorOptions)}.shared', + ); + const String setHandlerCondition = + 'let instanceManager = instanceManager'; + _writeHostMethodMessageHandler( + indent, + name: 'removeStrongReference', + channelName: removeStrongReferenceName, + parameters: [ + Parameter( + name: 'identifier', + type: const TypeDeclaration( + baseName: 'int', + isNullable: false, + ), + ), + ], + returnType: const TypeDeclaration.voidDeclaration(), + swiftFunction: 'method(withIdentifier:)', + setHandlerCondition: setHandlerCondition, + isAsynchronous: false, + onCreateCall: ( + List safeArgNames, { + required String apiVarName, + }) { + return 'let _: AnyObject? = try instanceManager.removeInstance(${safeArgNames.single})'; + }, + ); + _writeHostMethodMessageHandler( + indent, + name: 'clear', + channelName: makeClearChannelName(dartPackageName), + parameters: [], + returnType: const TypeDeclaration.voidDeclaration(), + setHandlerCondition: setHandlerCondition, + swiftFunction: null, + isAsynchronous: false, + onCreateCall: ( + List safeArgNames, { + required String apiVarName, + }) { + return 'try instanceManager.removeAllObjects()'; + }, + ); + }, + ); + indent.newln(); + + addDocumentationComments( + indent, + [ + ' Sends a message to the Dart `InstanceManager` to remove the strong reference of the instance associated with `identifier`.', + ], + _docCommentSpec, + ); + _writeFlutterMethod( + indent, + generatorOptions: generatorOptions, + name: 'removeStrongReference', + parameters: [ + Parameter( + name: 'identifier', + type: const TypeDeclaration(baseName: 'int', isNullable: false), + ) + ], + returnType: const TypeDeclaration.voidDeclaration(), + channelName: removeStrongReferenceName, + swiftFunction: null, + ); + }); + } + + @override + void writeProxyApiBaseCodec( + SwiftOptions generatorOptions, + Root root, + Indent indent, + ) { + final Iterable allProxyApis = + root.apis.whereType(); + + _writeProxyApiRegistrar( + indent, + generatorOptions: generatorOptions, + allProxyApis: allProxyApis, + ); + + final String filePrefix = + generatorOptions.fileSpecificClassNameComponent ?? ''; + + final String registrarName = proxyApiRegistrarName(generatorOptions); + + indent.writeScoped( + 'private class ${proxyApiReaderWriterName(generatorOptions)}: FlutterStandardReaderWriter {', + '}', + () { + indent.writeln( + 'unowned let pigeonRegistrar: $registrarName', + ); + indent.newln(); + + indent.writeScoped( + 'private class $filePrefix${classNamePrefix}ProxyApiCodecReader: ${_getCodecName(generatorOptions)}Reader {', + '}', + () { + indent.writeln('unowned let pigeonRegistrar: $registrarName'); + indent.newln(); + + indent.writeScoped( + 'init(data: Data, pigeonRegistrar: $registrarName) {', + '}', + () { + indent.writeln('self.pigeonRegistrar = pigeonRegistrar'); + indent.writeln('super.init(data: data)'); + }, + ); + indent.newln(); + + indent.writeScoped( + 'override func readValue(ofType type: UInt8) -> Any? {', + '}', + () { + indent.format( + ''' + switch type { + case $proxyApiCodecInstanceManagerKey: + let identifier = self.readValue() + let instance: AnyObject? = pigeonRegistrar.instanceManager.instance( + forIdentifier: identifier is Int64 ? identifier as! Int64 : Int64(identifier as! Int32)) + return instance + default: + return super.readValue(ofType: type) + }''', + ); + }, + ); + }, + ); + indent.newln(); + + indent.writeScoped( + 'private class $filePrefix${classNamePrefix}ProxyApiCodecWriter: ${_getCodecName(generatorOptions)}Writer {', + '}', + () { + indent.writeln( + 'unowned let pigeonRegistrar: $registrarName', + ); + indent.newln(); + + indent.writeScoped( + 'init(data: NSMutableData, pigeonRegistrar: $registrarName) {', + '}', + () { + indent.writeln('self.pigeonRegistrar = pigeonRegistrar'); + indent.writeln('super.init(data: data)'); + }, + ); + indent.newln(); + + indent.writeScoped( + 'override func writeValue(_ value: Any) {', + '}', + () { + final List nonProxyApiTypes = [ + '[Any]', + 'Bool', + 'Data', + '[AnyHashable: Any]', + 'Double', + 'FlutterStandardTypedData', + 'Int64', + 'String', + ...root.enums.map((Enum anEnum) => anEnum.name), + ]; + final String isBuiltinExpression = nonProxyApiTypes + .map((String swiftType) => 'value is $swiftType') + .join(' || '); + // Non ProxyApi types are checked first to prevent the scenario + // where a client wraps the `NSObject` class which all the + // classes above extend. + indent.writeScoped('if $isBuiltinExpression {', '}', () { + indent.writeln('super.writeValue(value)'); + indent.writeln('return'); + }); + indent.newln(); + + // Sort APIs where edges are an API's super class and interfaces. + // + // This sorts the APIs to have child classes be listed before their parent + // classes. This prevents the scenario where a method might return the super + // class of the actual class, so the incorrect Dart class gets created + // because the 'value is ' was checked first in the codec. For + // example: + // + // class Shape {} + // class Circle extends Shape {} + // + // class SomeClass { + // Shape giveMeAShape() => Circle(); + // } + final List sortedApis = topologicalSort( + allProxyApis, + (AstProxyApi api) { + return [ + if (api.superClass?.associatedProxyApi != null) + api.superClass!.associatedProxyApi!, + ...api.interfaces.map( + (TypeDeclaration interface) => + interface.associatedProxyApi!, + ), + ]; + }, + ); + + enumerate( + sortedApis, + (int index, AstProxyApi api) { + final TypeDeclaration apiAsTypeDecl = TypeDeclaration( + baseName: api.name, + isNullable: false, + associatedProxyApi: api, + ); + final String? availability = _tryGetAvailabilityAnnotation( + [apiAsTypeDecl], + ); + final String? unsupportedPlatforms = + _tryGetUnsupportedPlatformsCondition( + [apiAsTypeDecl], + ); + final String className = api.swiftOptions?.name ?? api.name; + indent.format( + ''' + ${unsupportedPlatforms != null ? '#if $unsupportedPlatforms' : ''} + if ${availability != null ? '#$availability, ' : ''}let instance = value as? $className { + pigeonRegistrar.apiDelegate.pigeonApi${api.name}(pigeonRegistrar).pigeonNewInstance( + pigeonInstance: instance + ) { _ in } + super.writeByte($proxyApiCodecInstanceManagerKey) + super.writeValue( + pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance as AnyObject)!) + return + } + ${unsupportedPlatforms != null ? '#endif' : ''}''', + ); + }, + ); + indent.newln(); + + indent.format( + ''' + if let instance = value as AnyObject?, pigeonRegistrar.instanceManager.containsInstance(instance) + { + super.writeByte($proxyApiCodecInstanceManagerKey) + super.writeValue( + pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance)!) + } else { + print("Unsupported value: \\(value) of \\(type(of: value))") + assert(false, "Unsupported value for $filePrefix${classNamePrefix}ProxyApiCodecWriter") + } + ''', + ); + }, + ); + }, + ); + indent.newln(); + + indent.format( + ''' + init(pigeonRegistrar: $registrarName) { + self.pigeonRegistrar = pigeonRegistrar + }''', + ); + indent.newln(); + + indent.format( + ''' + override func reader(with data: Data) -> FlutterStandardReader { + return $filePrefix${classNamePrefix}ProxyApiCodecReader(data: data, pigeonRegistrar: pigeonRegistrar) + }''', + ); + indent.newln(); + + indent.format( + ''' + override func writer(with data: NSMutableData) -> FlutterStandardWriter { + return $filePrefix${classNamePrefix}ProxyApiCodecWriter(data: data, pigeonRegistrar: pigeonRegistrar) + }''', + ); + }, + ); + } + + @override + void writeProxyApi( + SwiftOptions generatorOptions, + Root root, + Indent indent, + AstProxyApi api, { + required String dartPackageName, + }) { + final TypeDeclaration apiAsTypeDeclaration = TypeDeclaration( + baseName: api.name, + isNullable: false, + associatedProxyApi: api, + ); + + final String swiftApiDelegateName = + '${hostProxyApiPrefix}Delegate${api.name}'; + final String type = + api.hasMethodsRequiringImplementation() ? 'protocol' : 'open class'; + indent.writeScoped('$type $swiftApiDelegateName {', '}', () { + _writeProxyApiConstructorDelegateMethods( + indent, + api, + apiAsTypeDeclaration: apiAsTypeDeclaration, + ); + _writeProxyApiAttachedFieldDelegateMethods( + indent, + api, + apiAsTypeDeclaration: apiAsTypeDeclaration, + ); + if (api.hasCallbackConstructor()) { + _writeProxyApiUnattachedFieldDelegateMethods( + indent, + api, + apiAsTypeDeclaration: apiAsTypeDeclaration, + ); + } + _writeProxyApiHostMethodDelegateMethods( + indent, + api, + apiAsTypeDeclaration: apiAsTypeDeclaration, + ); + }); + indent.newln(); + + final String swiftApiProtocolName = + '${hostProxyApiPrefix}Protocol${api.name}'; + indent.writeScoped('protocol $swiftApiProtocolName {', '}', () { + _writeProxyApiFlutterMethods( + indent, + api, + generatorOptions: generatorOptions, + apiAsTypeDeclaration: apiAsTypeDeclaration, + dartPackageName: dartPackageName, + writeBody: false, + ); + }); + indent.newln(); + + final String swiftApiName = '$hostProxyApiPrefix${api.name}'; + indent.writeScoped( + 'final class $swiftApiName: $swiftApiProtocolName {', '}', () { + indent.writeln( + 'unowned let pigeonRegistrar: ${proxyApiRegistrarName(generatorOptions)}', + ); + indent.writeln('let pigeonDelegate: $swiftApiDelegateName'); + + _writeProxyApiInheritedApiMethods(indent, api); + + indent.writeScoped( + 'init(pigeonRegistrar: ${proxyApiRegistrarName(generatorOptions)}, delegate: $swiftApiDelegateName) {', + '}', + () { + indent.writeln('self.pigeonRegistrar = pigeonRegistrar'); + indent.writeln('self.pigeonDelegate = delegate'); + }, + ); + + if (api.hasAnyHostMessageCalls()) { + _writeProxyApiMessageHandlerMethod( + indent, + api, + generatorOptions: generatorOptions, + apiAsTypeDeclaration: apiAsTypeDeclaration, + swiftApiName: swiftApiName, + dartPackageName: dartPackageName, + ); + indent.newln(); + } + + _writeProxyApiNewInstanceMethod( + indent, + api, + generatorOptions: generatorOptions, + apiAsTypeDeclaration: apiAsTypeDeclaration, + newInstanceMethodName: '${classMemberNamePrefix}newInstance', + dartPackageName: dartPackageName, + ); + + _writeProxyApiFlutterMethods( + indent, + api, + generatorOptions: generatorOptions, + apiAsTypeDeclaration: apiAsTypeDeclaration, + dartPackageName: dartPackageName, + ); + }); + } + String _castForceUnwrap(String value, TypeDeclaration type) { assert(!type.isVoid); if (type.baseName == 'Object') { return value + (type.isNullable ? '' : '!'); - } else if (type.baseName == 'int') { - if (type.isNullable) { - // Nullable ints need to check for NSNull, and Int32 before casting can be done safely. - // This nested ternary is a necessary evil to avoid less efficient conversions. - return 'isNullish($value) ? nil : ($value is Int64? ? $value as! Int64? : Int64($value as! Int32))'; - } else { - return '$value is Int64 ? $value as! Int64 : Int64($value as! Int32)'; - } + // Force-casting nullable enums in maps doesn't work the same as other types. + // It needs soft-casting followed by force unwrapping. + } else if (type.baseName == 'Map' && + type.typeArguments.any((TypeDeclaration type) => type.isEnum)) { + return '$value as? ${_swiftTypeForDartType(type)}'; } else if (type.isNullable) { return 'nilOrValue($value)'; } else { @@ -761,14 +1310,17 @@ private func nilOrValue(_ value: Any?) -> T? { final bool hasFlutterApi = root.apis .whereType() .any((Api api) => api.methods.isNotEmpty); + final bool hasProxyApi = root.apis.any((Api api) => api is AstProxyApi); - _writePigeonError(generatorOptions, indent); + if (generatorOptions.includeErrorClass) { + _writePigeonError(generatorOptions, indent); + } - if (hasHostApi) { + if (hasHostApi || hasProxyApi) { _writeWrapResult(indent); _writeWrapError(generatorOptions, indent); } - if (hasFlutterApi) { + if (hasFlutterApi || hasProxyApi) { _writeCreateConnectionError(generatorOptions, indent); } @@ -795,60 +1347,81 @@ private func nilOrValue(_ value: Any?) -> T? { getParameterName: _getSafeArgumentName, ); + indent.writeScoped('$methodSignature {', '}', () { + _writeFlutterMethodMessageCall( + indent, + generatorOptions: generatorOptions, + parameters: parameters, + returnType: returnType, + channelName: channelName, + ); + }); + } + + void _writeFlutterMethodMessageCall( + Indent indent, { + required SwiftOptions generatorOptions, + required List parameters, + required TypeDeclaration returnType, + required String channelName, + }) { /// Returns an argument name that can be used in a context where it is possible to collide. String getEnumSafeArgumentExpression(int count, NamedType argument) { return '${_getArgumentName(count, argument)}Arg'; } - indent.writeScoped('$methodSignature {', '}', () { - final Iterable enumSafeArgNames = parameters.asMap().entries.map( - (MapEntry e) => - getEnumSafeArgumentExpression(e.key, e.value)); - final String sendArgument = parameters.isEmpty - ? 'nil' - : '[${enumSafeArgNames.join(', ')}] as [Any?]'; - const String channel = 'channel'; - indent.writeln( - 'let channelName: String = "$channelName\\(messageChannelSuffix)"'); - indent.writeln( - 'let $channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec)'); - indent.write('$channel.sendMessage($sendArgument) '); + final Iterable enumSafeArgNames = parameters.asMap().entries.map( + (MapEntry e) => + getEnumSafeArgumentExpression(e.key, e.value)); + final String sendArgument = parameters.isEmpty + ? 'nil' + : '[${enumSafeArgNames.join(', ')}] as [Any?]'; + const String channel = 'channel'; + indent.writeln('let channelName: String = "$channelName"'); + indent.writeln( + 'let $channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec)'); + indent.write('$channel.sendMessage($sendArgument) '); - indent.addScoped('{ response in', '}', () { - indent.writeScoped( - 'guard let listResponse = response as? [Any?] else {', '}', () { - indent.writeln( - 'completion(.failure(createConnectionError(withChannelName: channelName)))'); - indent.writeln('return'); - }); - indent.writeScoped('if listResponse.count > 1 {', '} ', () { - indent.writeln('let code: String = listResponse[0] as! String'); - indent.writeln('let message: String? = nilOrValue(listResponse[1])'); - indent.writeln('let details: String? = nilOrValue(listResponse[2])'); + indent.addScoped('{ response in', '}', () { + indent.writeScoped( + 'guard let listResponse = response as? [Any?] else {', '}', () { + indent.writeln( + 'completion(.failure(createConnectionError(withChannelName: channelName)))'); + indent.writeln('return'); + }); + indent.writeScoped('if listResponse.count > 1 {', '} ', () { + indent.writeln('let code: String = listResponse[0] as! String'); + indent.writeln('let message: String? = nilOrValue(listResponse[1])'); + indent.writeln('let details: String? = nilOrValue(listResponse[2])'); + indent.writeln( + 'completion(.failure(${_getErrorClassName(generatorOptions)}(code: code, message: message, details: details)))'); + }, addTrailingNewline: false); + if (!returnType.isNullable && !returnType.isVoid) { + indent.addScoped('else if listResponse[0] == nil {', '} ', () { indent.writeln( - 'completion(.failure(${_getErrorClassName(generatorOptions)}(code: code, message: message, details: details)))'); + 'completion(.failure(${_getErrorClassName(generatorOptions)}(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: "")))'); }, addTrailingNewline: false); - if (!returnType.isNullable && !returnType.isVoid) { - indent.addScoped('else if listResponse[0] == nil {', '} ', () { - indent.writeln( - 'completion(.failure(${_getErrorClassName(generatorOptions)}(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: "")))'); - }, addTrailingNewline: false); + } + indent.addScoped('else {', '}', () { + if (returnType.isVoid) { + indent.writeln('completion(.success(Void()))'); + } else { + final String fieldType = _swiftTypeForDartType(returnType); + _writeGenericCasting( + indent: indent, + value: 'listResponse[0]', + variableName: 'result', + fieldType: fieldType, + type: returnType, + ); + // There is a swift bug with unwrapping maps of nullable Enums; + final String enumMapForceUnwrap = returnType.baseName == 'Map' && + returnType.typeArguments + .any((TypeDeclaration type) => type.isEnum) + ? '!' + : ''; + indent.writeln('completion(.success(result$enumMapForceUnwrap))'); } - indent.addScoped('else {', '}', () { - if (returnType.isVoid) { - indent.writeln('completion(.success(Void()))'); - } else { - final String fieldType = _swiftTypeForDartType(returnType); - _writeGenericCasting( - indent: indent, - value: 'listResponse[0]', - variableName: 'result', - fieldType: fieldType, - type: returnType, - ); - indent.writeln('completion(.success(result))'); - } - }); }); }); } @@ -861,7 +1434,10 @@ private func nilOrValue(_ value: Any?) -> T? { required TypeDeclaration returnType, required bool isAsynchronous, required String? swiftFunction, + String setHandlerCondition = 'let api = api', List documentationComments = const [], + String Function(List safeArgNames, {required String apiVarName})? + onCreateCall, }) { final _SwiftFunctionComponents components = _SwiftFunctionComponents( name: name, @@ -873,8 +1449,8 @@ private func nilOrValue(_ value: Any?) -> T? { final String varChannelName = '${name}Channel'; addDocumentationComments(indent, documentationComments, _docCommentSpec); indent.writeln( - 'let $varChannelName = FlutterBasicMessageChannel(name: "$channelName\\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec)'); - indent.write('if let api = api '); + 'let $varChannelName = FlutterBasicMessageChannel(name: "$channelName", binaryMessenger: binaryMessenger, codec: codec)'); + indent.write('if $setHandlerCondition '); indent.addScoped('{', '}', () { indent.write('$varChannelName.setMessageHandler '); final String messageVarName = parameters.isNotEmpty ? 'message' : '_'; @@ -887,6 +1463,12 @@ private func nilOrValue(_ value: Any?) -> T? { final String argName = _getSafeArgumentName(index, arg.namedType); final String argIndex = 'args[$index]'; final String fieldType = _swiftTypeForDartType(arg.type); + // There is a swift bug with unwrapping maps of nullable Enums; + final String enumMapForceUnwrap = arg.type.baseName == 'Map' && + arg.type.typeArguments + .any((TypeDeclaration type) => type.isEnum) + ? '!' + : ''; _writeGenericCasting( indent: indent, @@ -896,20 +1478,25 @@ private func nilOrValue(_ value: Any?) -> T? { type: arg.type); if (arg.label == '_') { - methodArgument.add(argName); + methodArgument.add('$argName$enumMapForceUnwrap'); } else { - methodArgument.add('${arg.label ?? arg.name}: $argName'); + methodArgument + .add('${arg.label ?? arg.name}: $argName$enumMapForceUnwrap'); } }); } final String tryStatement = isAsynchronous ? '' : 'try '; - // Empty parens are not required when calling a method whose only - // argument is a trailing closure. - final String argumentString = methodArgument.isEmpty && isAsynchronous - ? '' - : '(${methodArgument.join(', ')})'; - final String call = - '${tryStatement}api.${components.name}$argumentString'; + late final String call; + if (onCreateCall == null) { + // Empty parens are not required when calling a method whose only + // argument is a trailing closure. + final String argumentString = methodArgument.isEmpty && isAsynchronous + ? '' + : '(${methodArgument.join(', ')})'; + call = '${tryStatement}api.${components.name}$argumentString'; + } else { + call = onCreateCall(methodArgument, apiVarName: 'api'); + } if (isAsynchronous) { final String resultName = returnType.isVoid ? 'nil' : 'res'; final String successVariableInit = @@ -951,6 +1538,837 @@ private func nilOrValue(_ value: Any?) -> T? { }); } + void _writeProxyApiRegistrar( + Indent indent, { + required SwiftOptions generatorOptions, + required Iterable allProxyApis, + }) { + final String delegateName = + '${generatorOptions.fileSpecificClassNameComponent ?? ''}${proxyApiClassNamePrefix}ProxyApiDelegate'; + indent.writeScoped('protocol $delegateName {', '}', () { + for (final AstProxyApi api in allProxyApis) { + final String hostApiName = '$hostProxyApiPrefix${api.name}'; + addDocumentationComments( + indent, + [ + ' An implementation of [$hostApiName] used to add a new Dart instance of', + ' `${api.name}` to the Dart `InstanceManager` and make calls to Dart.' + ], + _docCommentSpec, + ); + indent.writeln( + 'func pigeonApi${api.name}(_ registrar: ${proxyApiRegistrarName(generatorOptions)}) -> $hostApiName', + ); + } + }); + indent.newln(); + + // Some APIs don't have any methods to implement, + // so this creates an extension of the PigeonProxyApiDelegate that adds + // default implementations for these APIs. + final Iterable apisThatCanHaveADefaultImpl = allProxyApis + .where((AstProxyApi api) => !api.hasMethodsRequiringImplementation()); + if (apisThatCanHaveADefaultImpl.isNotEmpty) { + indent.writeScoped('extension $delegateName {', '}', () { + for (final AstProxyApi api in apisThatCanHaveADefaultImpl) { + final String hostApiName = '$hostProxyApiPrefix${api.name}'; + final String swiftApiDelegateName = + '${hostProxyApiPrefix}Delegate${api.name}'; + indent.format( + ''' + func pigeonApi${api.name}(_ registrar: ${proxyApiRegistrarName(generatorOptions)}) -> $hostApiName { + return $hostApiName(pigeonRegistrar: registrar, delegate: $swiftApiDelegateName()) + }''', + ); + } + }); + indent.newln(); + } + + final String instanceManagerApiName = + '${swiftInstanceManagerClassName(generatorOptions)}Api'; + + indent.writeScoped( + 'open class ${proxyApiRegistrarName(generatorOptions)} {', '}', () { + indent.writeln('let binaryMessenger: FlutterBinaryMessenger'); + indent.writeln('let apiDelegate: $delegateName'); + indent.writeln( + 'let instanceManager: ${swiftInstanceManagerClassName(generatorOptions)}'); + + addDocumentationComments( + indent, + [' Whether APIs should ignore calling to Dart.'], + _docCommentSpec, + ); + indent.writeln('public var ignoreCallsToDart = false'); + + indent.writeln('private var _codec: FlutterStandardMessageCodec?'); + indent.format( + ''' + var codec: FlutterStandardMessageCodec { + if _codec == nil { + _codec = FlutterStandardMessageCodec( + readerWriter: ${proxyApiReaderWriterName(generatorOptions)}(pigeonRegistrar: self)) + } + return _codec! + }''', + ); + indent.newln(); + + indent.format( + ''' + private class InstanceManagerApiFinalizerDelegate: ${instanceManagerFinalizerDelegateName(generatorOptions)} { + let api: $instanceManagerApiName + + init(_ api: $instanceManagerApiName) { + self.api = api + } + + public func onDeinit(identifier: Int64) { + api.removeStrongReference(identifier: identifier) { + _ in + } + } + }''', + ); + indent.newln(); + + indent.format( + ''' + init(binaryMessenger: FlutterBinaryMessenger, apiDelegate: $delegateName) { + self.binaryMessenger = binaryMessenger + self.apiDelegate = apiDelegate + self.instanceManager = ${swiftInstanceManagerClassName(generatorOptions)}( + finalizerDelegate: InstanceManagerApiFinalizerDelegate( + $instanceManagerApiName(binaryMessenger: binaryMessenger))) + }''', + ); + indent.newln(); + + indent.writeScoped('func setUp() {', '}', () { + indent.writeln( + '$instanceManagerApiName.setUpMessageHandlers(binaryMessenger: binaryMessenger, instanceManager: instanceManager)', + ); + for (final AstProxyApi api in allProxyApis) { + if (api.hasAnyHostMessageCalls()) { + indent.writeln( + '$hostProxyApiPrefix${api.name}.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApi${api.name}(self))', + ); + } + } + }); + + indent.writeScoped('func tearDown() {', '}', () { + indent.writeln( + '$instanceManagerApiName.setUpMessageHandlers(binaryMessenger: binaryMessenger, instanceManager: nil)', + ); + for (final AstProxyApi api in allProxyApis) { + if (api.hasAnyHostMessageCalls()) { + indent.writeln( + '$hostProxyApiPrefix${api.name}.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil)', + ); + } + } + }); + }); + } + + // Writes the delegate method that instantiates a new instance of the Kotlin + // class. + void _writeProxyApiConstructorDelegateMethods( + Indent indent, + AstProxyApi api, { + required TypeDeclaration apiAsTypeDeclaration, + }) { + for (final Constructor constructor in api.constructors) { + final List allReferencedTypes = [ + apiAsTypeDeclaration, + ...api.unattachedFields.map((ApiField field) => field.type), + ...constructor.parameters.map((Parameter parameter) => parameter.type), + ]; + + final String? unsupportedPlatforms = + _tryGetUnsupportedPlatformsCondition(allReferencedTypes); + if (unsupportedPlatforms != null) { + indent.writeln('#if $unsupportedPlatforms'); + } + + addDocumentationComments( + indent, + constructor.documentationComments, + _docCommentSpec, + ); + + final String? availableAnnotation = + _tryGetAvailabilityAnnotation(allReferencedTypes); + if (availableAnnotation != null) { + indent.writeln('@$availableAnnotation'); + } + + final String methodSignature = _getMethodSignature( + name: constructor.name.isNotEmpty + ? constructor.name + : 'pigeonDefaultConstructor', + parameters: [ + Parameter( + name: 'pigeonApi', + type: TypeDeclaration( + baseName: '$hostProxyApiPrefix${api.name}', + isNullable: false, + ), + ), + ...api.unattachedFields.map((ApiField field) { + return Parameter(name: field.name, type: field.type); + }), + ...constructor.parameters + ], + returnType: apiAsTypeDeclaration, + errorTypeName: '', + ); + indent.writeln(methodSignature); + + if (unsupportedPlatforms != null) { + indent.writeln('#endif'); + } + } + } + + // Writes the delegate method that handles instantiating an attached field. + void _writeProxyApiAttachedFieldDelegateMethods( + Indent indent, + AstProxyApi api, { + required TypeDeclaration apiAsTypeDeclaration, + }) { + for (final ApiField field in api.attachedFields) { + final List allReferencedTypes = [ + apiAsTypeDeclaration, + field.type, + ]; + + final String? unsupportedPlatforms = + _tryGetUnsupportedPlatformsCondition(allReferencedTypes); + if (unsupportedPlatforms != null) { + indent.writeln('#if $unsupportedPlatforms'); + } + + addDocumentationComments( + indent, + field.documentationComments, + _docCommentSpec, + ); + + final String? availableAnnotation = + _tryGetAvailabilityAnnotation(allReferencedTypes); + if (availableAnnotation != null) { + indent.writeln('@$availableAnnotation'); + } + + final String methodSignature = _getMethodSignature( + name: field.name, + parameters: [ + Parameter( + name: 'pigeonApi', + type: TypeDeclaration( + baseName: '$hostProxyApiPrefix${api.name}', + isNullable: false, + ), + ), + if (!field.isStatic) + Parameter( + name: 'pigeonInstance', + type: apiAsTypeDeclaration, + ), + ], + returnType: field.type, + errorTypeName: '', + ); + indent.writeln(methodSignature); + + if (unsupportedPlatforms != null) { + indent.writeln('#endif'); + } + } + } + + // Writes the delegate method that handles accessing an unattached field. + void _writeProxyApiUnattachedFieldDelegateMethods( + Indent indent, + AstProxyApi api, { + required TypeDeclaration apiAsTypeDeclaration, + }) { + for (final ApiField field in api.unattachedFields) { + final List allReferencedTypes = [ + apiAsTypeDeclaration, + field.type, + ]; + + final String? unsupportedPlatforms = + _tryGetUnsupportedPlatformsCondition(allReferencedTypes); + if (unsupportedPlatforms != null) { + indent.writeln('#if $unsupportedPlatforms'); + } + + addDocumentationComments( + indent, + field.documentationComments, + _docCommentSpec, + ); + + final String? availableAnnotation = + _tryGetAvailabilityAnnotation(allReferencedTypes); + if (availableAnnotation != null) { + indent.writeln('@$availableAnnotation'); + } + + final String methodSignature = _getMethodSignature( + name: field.name, + parameters: [ + Parameter( + name: 'pigeonApi', + type: TypeDeclaration( + baseName: '$hostProxyApiPrefix${api.name}', + isNullable: false, + ), + ), + Parameter( + name: 'pigeonInstance', + type: apiAsTypeDeclaration, + ), + ], + returnType: field.type, + errorTypeName: '', + ); + indent.writeln(methodSignature); + + if (unsupportedPlatforms != null) { + indent.writeln('#endif'); + } + } + } + + // Writes the delegate method that handles making a call from for a host + // method. + void _writeProxyApiHostMethodDelegateMethods( + Indent indent, + AstProxyApi api, { + required TypeDeclaration apiAsTypeDeclaration, + }) { + for (final Method method in api.hostMethods) { + final List allReferencedTypes = [ + if (!method.isStatic) apiAsTypeDeclaration, + method.returnType, + ...method.parameters.map((Parameter p) => p.type), + ]; + + final String? unsupportedPlatforms = + _tryGetUnsupportedPlatformsCondition(allReferencedTypes); + if (unsupportedPlatforms != null) { + indent.writeln('#if $unsupportedPlatforms'); + } + + addDocumentationComments( + indent, + method.documentationComments, + _docCommentSpec, + ); + + final String? availableAnnotation = + _tryGetAvailabilityAnnotation(allReferencedTypes); + if (availableAnnotation != null) { + indent.writeln('@$availableAnnotation'); + } + + final String methodSignature = _getMethodSignature( + name: method.name, + parameters: [ + Parameter( + name: 'pigeonApi', + type: TypeDeclaration( + baseName: '$hostProxyApiPrefix${api.name}', + isNullable: false, + ), + ), + if (!method.isStatic) + Parameter( + name: 'pigeonInstance', + type: apiAsTypeDeclaration, + ), + ...method.parameters, + ], + returnType: method.returnType, + isAsynchronous: method.isAsynchronous, + errorTypeName: 'Error', + ); + indent.writeln(methodSignature); + + if (unsupportedPlatforms != null) { + indent.writeln('#endif'); + } + } + } + + // Writes the getters for accessing the implementation of other ProxyApis. + // + // These are used for inherited Flutter methods. + void _writeProxyApiInheritedApiMethods(Indent indent, AstProxyApi api) { + final Set inheritedApiNames = { + if (api.superClass != null) api.superClass!.baseName, + ...api.interfaces.map((TypeDeclaration type) => type.baseName), + }; + for (final String name in inheritedApiNames) { + addDocumentationComments( + indent, + [ + 'An implementation of [$name] used to access callback methods', + ], + _docCommentSpec, + ); + indent.writeScoped( + 'var pigeonApi$name: $hostProxyApiPrefix$name {', + '}', + () { + indent.writeln( + 'return pigeonRegistrar.apiDelegate.pigeonApi$name(pigeonRegistrar)', + ); + }, + ); + indent.newln(); + } + } + + // Writes the `..setUpMessageHandler` method to ensure incoming messages are + // handled by the correct delegate host methods. + void _writeProxyApiMessageHandlerMethod( + Indent indent, + AstProxyApi api, { + required SwiftOptions generatorOptions, + required TypeDeclaration apiAsTypeDeclaration, + required String swiftApiName, + required String dartPackageName, + }) { + indent.writeScoped( + 'static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: $swiftApiName?) {', + '}', + () { + indent.format( + ''' + let codec: FlutterStandardMessageCodec = + api != nil + ? FlutterStandardMessageCodec( + readerWriter: ${proxyApiReaderWriterName(generatorOptions)}(pigeonRegistrar: api!.pigeonRegistrar)) + : FlutterStandardMessageCodec.sharedInstance()''', + ); + void writeWithApiCheckIfNecessary( + List types, { + required String methodName, + required String channelName, + required void Function() onWrite, + }) { + final String? unsupportedPlatforms = + _tryGetUnsupportedPlatformsCondition(types); + if (unsupportedPlatforms != null) { + indent.writeln('#if $unsupportedPlatforms'); + } + + final String? availableAnnotation = + _tryGetAvailabilityAnnotation(types); + if (availableAnnotation != null) { + indent.writeScoped( + 'if #$availableAnnotation {', + '}', + onWrite, + addTrailingNewline: false, + ); + indent.writeScoped(' else {', '}', () { + final String varChannelName = '${methodName}Channel'; + indent.format( + ''' + let $varChannelName = FlutterBasicMessageChannel( + name: "$channelName", + binaryMessenger: binaryMessenger, codec: codec) + if api != nil { + $varChannelName.setMessageHandler { message, reply in + reply(wrapError(FlutterError(code: "PigeonUnsupportedOperationError", + message: "Call to $methodName requires @$availableAnnotation.", + details: nil + ))) + } + } else { + $varChannelName.setMessageHandler(nil) + }''', + ); + }); + } else { + onWrite(); + } + + if (unsupportedPlatforms != null) { + indent.writeln('#endif'); + } + } + + for (final Constructor constructor in api.constructors) { + final String name = constructor.name.isNotEmpty + ? constructor.name + : 'pigeonDefaultConstructor'; + final String channelName = makeChannelNameWithStrings( + apiName: api.name, + methodName: '${classMemberNamePrefix}defaultConstructor', + dartPackageName: dartPackageName, + ); + writeWithApiCheckIfNecessary( + [ + apiAsTypeDeclaration, + ...api.unattachedFields.map((ApiField f) => f.type), + ...constructor.parameters.map((Parameter p) => p.type), + ], + methodName: name, + channelName: channelName, + onWrite: () { + _writeHostMethodMessageHandler( + indent, + name: name, + channelName: channelName, + returnType: const TypeDeclaration.voidDeclaration(), + swiftFunction: null, + isAsynchronous: false, + onCreateCall: ( + List methodParameters, { + required String apiVarName, + }) { + final List parameters = [ + 'pigeonApi: $apiVarName', + // Skip the identifier used by the InstanceManager. + ...methodParameters.skip(1), + ]; + return '$apiVarName.pigeonRegistrar.instanceManager.addDartCreatedInstance(\n' + 'try $apiVarName.pigeonDelegate.$name(${parameters.join(', ')}),\n' + 'withIdentifier: pigeonIdentifierArg)'; + }, + parameters: [ + Parameter( + name: 'pigeonIdentifier', + type: const TypeDeclaration( + baseName: 'int', + isNullable: false, + ), + ), + ...api.unattachedFields.map((ApiField field) { + return Parameter( + name: field.name, + type: field.type, + ); + }), + ...constructor.parameters, + ], + ); + }, + ); + } + + for (final ApiField field in api.attachedFields) { + final String channelName = makeChannelNameWithStrings( + apiName: api.name, + methodName: field.name, + dartPackageName: dartPackageName, + ); + writeWithApiCheckIfNecessary( + [apiAsTypeDeclaration, field.type], + methodName: field.name, + channelName: channelName, + onWrite: () { + _writeHostMethodMessageHandler( + indent, + name: field.name, + channelName: channelName, + swiftFunction: null, + isAsynchronous: false, + returnType: const TypeDeclaration.voidDeclaration(), + onCreateCall: ( + List methodParameters, { + required String apiVarName, + }) { + final String instanceArg = field.isStatic + ? '' + : ', pigeonInstance: pigeonInstanceArg'; + return '$apiVarName.pigeonRegistrar.instanceManager.addDartCreatedInstance(' + 'try $apiVarName.pigeonDelegate.${field.name}(pigeonApi: api$instanceArg), ' + 'withIdentifier: pigeonIdentifierArg)'; + }, + parameters: [ + if (!field.isStatic) + Parameter( + name: 'pigeonInstance', + type: apiAsTypeDeclaration, + ), + Parameter( + name: 'pigeonIdentifier', + type: const TypeDeclaration( + baseName: 'int', + isNullable: false, + ), + ), + ], + ); + }, + ); + } + + for (final Method method in api.hostMethods) { + final String channelName = + makeChannelName(api, method, dartPackageName); + writeWithApiCheckIfNecessary( + [ + apiAsTypeDeclaration, + method.returnType, + ...method.parameters.map((Parameter parameter) => parameter.type), + ], + methodName: method.name, + channelName: channelName, + onWrite: () { + _writeHostMethodMessageHandler( + indent, + name: method.name, + channelName: makeChannelName(api, method, dartPackageName), + returnType: method.returnType, + isAsynchronous: method.isAsynchronous, + swiftFunction: null, + onCreateCall: ( + List methodParameters, { + required String apiVarName, + }) { + final String tryStatement = + method.isAsynchronous ? '' : 'try '; + final List parameters = [ + 'pigeonApi: $apiVarName', + // Skip the identifier used by the InstanceManager. + ...methodParameters, + ]; + + return '$tryStatement$apiVarName.pigeonDelegate.${method.name}(${parameters.join(', ')})'; + }, + parameters: [ + if (!method.isStatic) + Parameter( + name: 'pigeonInstance', + type: apiAsTypeDeclaration, + ), + ...method.parameters, + ], + ); + }, + ); + } + }, + ); + } + + // Writes the method that calls to Dart to instantiate a new Dart instance. + void _writeProxyApiNewInstanceMethod( + Indent indent, + AstProxyApi api, { + required SwiftOptions generatorOptions, + required TypeDeclaration apiAsTypeDeclaration, + required String newInstanceMethodName, + required String dartPackageName, + }) { + final List allReferencedTypes = [ + apiAsTypeDeclaration, + ...api.unattachedFields.map((ApiField field) => field.type), + ]; + + final String? unsupportedPlatforms = + _tryGetUnsupportedPlatformsCondition(allReferencedTypes); + if (unsupportedPlatforms != null) { + indent.writeln('#if $unsupportedPlatforms'); + } + + addDocumentationComments( + indent, + [ + 'Creates a Dart instance of ${api.name} and attaches it to [pigeonInstance].' + ], + _docCommentSpec, + ); + + final String? availableAnnotation = _tryGetAvailabilityAnnotation( + allReferencedTypes, + ); + if (availableAnnotation != null) { + indent.writeln('@$availableAnnotation'); + } + + final String methodSignature = _getMethodSignature( + name: 'pigeonNewInstance', + parameters: [ + Parameter(name: 'pigeonInstance', type: apiAsTypeDeclaration), + ], + returnType: const TypeDeclaration.voidDeclaration(), + isAsynchronous: true, + errorTypeName: _getErrorClassName(generatorOptions), + ); + indent.writeScoped('$methodSignature {', '}', () { + indent.writeScoped( + 'if pigeonRegistrar.ignoreCallsToDart {', + '}', + () { + indent.format( + ''' + completion( + .failure( + ${_getErrorClassName(generatorOptions)}( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return''', + ); + }, + ); + + indent.writeScoped( + 'if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) {', + '}', + () { + indent.writeln('completion(.success(Void()))'); + indent.writeln('return'); + }, + ); + if (api.hasCallbackConstructor()) { + indent.writeln( + 'let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeonInstance as AnyObject)', + ); + enumerate(api.unattachedFields, (int index, ApiField field) { + final String argName = _getSafeArgumentName(index, field); + indent.writeln( + 'let $argName = try! pigeonDelegate.${field.name}(pigeonApi: self, pigeonInstance: pigeonInstance)', + ); + }); + indent.writeln( + 'let binaryMessenger = pigeonRegistrar.binaryMessenger', + ); + indent.writeln('let codec = pigeonRegistrar.codec'); + _writeFlutterMethodMessageCall( + indent, + generatorOptions: generatorOptions, + parameters: [ + Parameter( + name: 'pigeonIdentifier', + type: const TypeDeclaration( + baseName: 'int', + isNullable: false, + ), + ), + ...api.unattachedFields.map( + (ApiField field) { + return Parameter(name: field.name, type: field.type); + }, + ), + ], + returnType: const TypeDeclaration.voidDeclaration(), + channelName: makeChannelNameWithStrings( + apiName: api.name, + methodName: newInstanceMethodName, + dartPackageName: dartPackageName, + ), + ); + } else { + indent.writeln( + 'print("Error: Attempting to create a new Dart instance of ${api.name}, but the class has a nonnull callback method.")', + ); + } + }); + + if (unsupportedPlatforms != null) { + indent.writeln('#endif'); + } + } + + // Writes the Flutter methods that call back to Dart. + void _writeProxyApiFlutterMethods( + Indent indent, + AstProxyApi api, { + required SwiftOptions generatorOptions, + required TypeDeclaration apiAsTypeDeclaration, + required String dartPackageName, + bool writeBody = true, + }) { + for (final Method method in api.flutterMethods) { + final List allReferencedTypes = [ + apiAsTypeDeclaration, + ...method.parameters.map((Parameter parameter) => parameter.type), + method.returnType, + ]; + + final String? unsupportedPlatforms = + _tryGetUnsupportedPlatformsCondition(allReferencedTypes); + if (unsupportedPlatforms != null) { + indent.writeln('#if $unsupportedPlatforms'); + } + + addDocumentationComments( + indent, + method.documentationComments, + _docCommentSpec, + ); + + final String? availableAnnotation = + _tryGetAvailabilityAnnotation(allReferencedTypes); + if (availableAnnotation != null) { + indent.writeln('@$availableAnnotation'); + } + + final String methodSignature = _getMethodSignature( + name: method.name, + parameters: [ + Parameter(name: 'pigeonInstance', type: apiAsTypeDeclaration), + ...method.parameters, + ], + returnType: method.returnType, + isAsynchronous: true, + errorTypeName: _getErrorClassName(generatorOptions), + getParameterName: _getSafeArgumentName, + ); + + indent.write(methodSignature); + if (writeBody) { + indent.writeScoped(' {', '}', () { + indent.writeScoped( + 'if pigeonRegistrar.ignoreCallsToDart {', + '}', + () { + indent.format( + ''' + completion( + .failure( + ${_getErrorClassName(generatorOptions)}( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return''', + ); + }, + ); + indent + .writeln('let binaryMessenger = pigeonRegistrar.binaryMessenger'); + indent.writeln('let codec = pigeonRegistrar.codec'); + + _writeFlutterMethodMessageCall( + indent, + generatorOptions: generatorOptions, + parameters: [ + Parameter(name: 'pigeonInstance', type: apiAsTypeDeclaration), + ...method.parameters, + ], + returnType: method.returnType, + channelName: makeChannelName(api, method, dartPackageName), + ); + }); + } + if (unsupportedPlatforms != null) { + indent.writeln('#endif'); + } + indent.newln(); + } + } + void _writePigeonError(SwiftOptions generatorOptions, Indent indent) { indent.newln(); indent.writeln( @@ -979,6 +2397,99 @@ private func nilOrValue(_ value: Any?) -> T? { } } +typedef _VersionRequirement = ({TypeDeclaration type, Version version}); +({_VersionRequirement? ios, _VersionRequirement? macos}) + _findHighestVersionRequirement( + Iterable types, +) { + final _VersionRequirement? iosApiRequirement = + findHighestApiRequirement( + types, + onGetApiRequirement: (TypeDeclaration type) { + final String? apiRequirement = + type.associatedProxyApi?.swiftOptions?.minIosApi; + if (apiRequirement != null) { + return Version.parse(apiRequirement); + } + + return null; + }, + onCompare: (Version one, Version two) => one.compareTo(two), + ); + + final _VersionRequirement? macosApiRequirement = + findHighestApiRequirement( + types, + onGetApiRequirement: (TypeDeclaration type) { + final String? apiRequirement = + type.associatedProxyApi?.swiftOptions?.minMacosApi; + if (apiRequirement != null) { + return Version.parse(apiRequirement); + } + + return null; + }, + onCompare: (Version one, Version two) => one.compareTo(two), + ); + + return (ios: iosApiRequirement, macos: macosApiRequirement); +} + +/// Finds the highest api requirement for each supported platform and creates +/// the `available(platform version , platform version ..., *)` annotation. +/// +/// Returns `null` if there is not api requirement in [types]. +String? _tryGetAvailabilityAnnotation(Iterable types) { + final ({ + _VersionRequirement? ios, + _VersionRequirement? macos + }) versionRequirement = _findHighestVersionRequirement(types); + + final List apis = [ + if (versionRequirement.ios != null) + 'iOS ${versionRequirement.ios!.version}', + if (versionRequirement.macos != null) + 'macOS ${versionRequirement.macos!.version}', + ]; + + return apis.isNotEmpty ? 'available(${apis.join(', ')}, *)' : null; +} + +/// Creates the string used to indicate a platform is unsupported. +/// +/// Recursively iterates through all types to find any that are not supported +/// by a platform. +/// +/// Returns `null` if every type supports all platforms. +String? _tryGetUnsupportedPlatformsCondition(Iterable types) { + Iterable addAllRecursive(TypeDeclaration type) sync* { + yield type; + if (type.typeArguments.isNotEmpty) { + for (final TypeDeclaration typeArg in type.typeArguments) { + yield* addAllRecursive(typeArg); + } + } + } + + final Iterable allReferencedTypes = + types.expand(addAllRecursive); + + final List unsupportedPlatforms = [ + if (!allReferencedTypes.every((TypeDeclaration type) { + return type.associatedProxyApi?.swiftOptions?.supportsIos ?? true; + })) + '!os(iOS)', + if (!allReferencedTypes.every((TypeDeclaration type) { + return type.associatedProxyApi?.swiftOptions?.supportsMacos ?? true; + })) + '!os(macOS)', + ]; + + return unsupportedPlatforms.isNotEmpty + ? unsupportedPlatforms.join(' || ') + : null; +} + /// Calculates the name of the codec that will be generated for [api]. String _getCodecName(SwiftOptions options) { return '${options.fileSpecificClassNameComponent}PigeonCodec'; @@ -1011,27 +2522,29 @@ String _flattenTypeArguments(List args) { } String _swiftTypeForBuiltinGenericDartType(TypeDeclaration type) { - if (type.typeArguments.isEmpty || - (type.typeArguments.first.baseName == 'Object')) { + if (type.typeArguments.isEmpty) { if (type.baseName == 'List') { return '[Any?]'; } else if (type.baseName == 'Map') { - return '[AnyHashable: Any?]'; + return '[AnyHashable?: Any?]'; } else { return 'Any'; } } else { if (type.baseName == 'List') { - return '[${_nullsafeSwiftTypeForDartType(type.typeArguments.first)}]'; + return '[${_nullSafeSwiftTypeForDartType(type.typeArguments.first)}]'; } else if (type.baseName == 'Map') { - return '[${_nullsafeSwiftTypeForDartType(type.typeArguments.first)}: ${_nullsafeSwiftTypeForDartType(type.typeArguments.last)}]'; + return '[${_nullSafeSwiftTypeForDartType(type.typeArguments.first, mapKey: true)}: ${_nullSafeSwiftTypeForDartType(type.typeArguments.last)}]'; } else { return '${type.baseName}<${_flattenTypeArguments(type.typeArguments)}>'; } } } -String? _swiftTypeForBuiltinDartType(TypeDeclaration type) { +String? _swiftTypeForBuiltinDartType( + TypeDeclaration type, { + bool mapKey = false, +}) { const Map swiftTypeForDartTypeMap = { 'void': 'Void', 'bool': 'Bool', @@ -1045,7 +2558,9 @@ String? _swiftTypeForBuiltinDartType(TypeDeclaration type) { 'Float64List': 'FlutterStandardTypedData', 'Object': 'Any', }; - if (swiftTypeForDartTypeMap.containsKey(type.baseName)) { + if (mapKey && type.baseName == 'Object') { + return 'AnyHashable'; + } else if (swiftTypeForDartTypeMap.containsKey(type.baseName)) { return swiftTypeForDartTypeMap[type.baseName]; } else if (type.baseName == 'List' || type.baseName == 'Map') { return _swiftTypeForBuiltinGenericDartType(type); @@ -1054,13 +2569,27 @@ String? _swiftTypeForBuiltinDartType(TypeDeclaration type) { } } -String _swiftTypeForDartType(TypeDeclaration type) { - return _swiftTypeForBuiltinDartType(type) ?? type.baseName; +String? _swiftTypeForProxyApiType(TypeDeclaration type) { + if (type.isProxyApi) { + return type.associatedProxyApi!.swiftOptions?.name ?? + type.associatedProxyApi!.name; + } + + return null; } -String _nullsafeSwiftTypeForDartType(TypeDeclaration type) { +String _swiftTypeForDartType(TypeDeclaration type, {bool mapKey = false}) { + return _swiftTypeForBuiltinDartType(type, mapKey: mapKey) ?? + _swiftTypeForProxyApiType(type) ?? + type.baseName; +} + +String _nullSafeSwiftTypeForDartType( + TypeDeclaration type, { + bool mapKey = false, +}) { final String nullSafe = type.isNullable ? '?' : ''; - return '${_swiftTypeForDartType(type)}$nullSafe'; + return '${_swiftTypeForDartType(type, mapKey: mapKey)}$nullSafe'; } String _getMethodSignature({ @@ -1080,10 +2609,10 @@ String _getMethodSignature({ swiftFunction: swiftFunction, ); final String returnTypeString = - returnType.isVoid ? 'Void' : _nullsafeSwiftTypeForDartType(returnType); + returnType.isVoid ? 'Void' : _nullSafeSwiftTypeForDartType(returnType); final Iterable types = - parameters.map((NamedType e) => _nullsafeSwiftTypeForDartType(e.type)); + parameters.map((NamedType e) => _nullSafeSwiftTypeForDartType(e.type)); final Iterable labels = indexMap(components.arguments, (int index, _SwiftFunctionArgument argument) { return argument.label ?? _getArgumentName(index, argument.namedType); diff --git a/packages/pigeon/pigeons/core_tests.dart b/packages/pigeon/pigeons/core_tests.dart index 626992c0a65b..a644ce5b3e00 100644 --- a/packages/pigeon/pigeons/core_tests.dart +++ b/packages/pigeon/pigeons/core_tests.dart @@ -18,14 +18,11 @@ enum AnotherEnum { justInCase, } -class SimpleClass { - SimpleClass({ - this.aString, - this.aBool = true, - }); +// This exists to show that unused data classes still generate. +class UnusedClass { + UnusedClass({this.aField}); - String? aString; - bool aBool; + Object? aField; } /// A class containing all supported types. @@ -46,15 +43,25 @@ class AllTypes { // Lists // This name is in a different format than the others to ensure that name - // collision with the work 'list' doesn't occur in the generated files. + // collision with the word 'list' doesn't occur in the generated files. required this.list, required this.stringList, required this.intList, required this.doubleList, required this.boolList, + required this.enumList, + required this.objectList, + required this.listList, + required this.mapList, // Maps required this.map, + required this.stringMap, + required this.intMap, + required this.enumMap, + required this.objectMap, + required this.listMap, + required this.mapMap, }); bool aBool; @@ -73,14 +80,24 @@ class AllTypes { // Lists // ignore: strict_raw_type, always_specify_types List list; - List stringList; - List intList; - List doubleList; - List boolList; + List stringList; + List intList; + List doubleList; + List boolList; + List enumList; + List objectList; + List> listList; + List> mapList; // Maps // ignore: strict_raw_type, always_specify_types Map map; + Map stringMap; + Map intMap; + Map enumMap; + Map objectMap; + Map> listMap; + Map> mapMap; } /// A class containing all supported nullable types. @@ -95,9 +112,6 @@ class AllNullableTypes { this.aNullable4ByteArray, this.aNullable8ByteArray, this.aNullableFloatArray, - this.nullableNestedList, - this.nullableMapWithAnnotations, - this.nullableMapWithObject, this.aNullableEnum, this.anotherNullableEnum, this.aNullableString, @@ -105,15 +119,28 @@ class AllNullableTypes { this.allNullableTypes, // Lists + // This name is in a different format than the others to ensure that name + // collision with the word 'list' doesn't occur in the generated files. this.list, this.stringList, this.intList, this.doubleList, this.boolList, - this.nestedClassList, + this.enumList, + this.objectList, + this.listList, + this.mapList, + this.recursiveClassList, - //Maps + // Maps this.map, + this.stringMap, + this.intMap, + this.enumMap, + this.objectMap, + this.listMap, + this.mapMap, + this.recursiveClassMap, ); bool? aNullableBool; @@ -124,9 +151,6 @@ class AllNullableTypes { Int32List? aNullable4ByteArray; Int64List? aNullable8ByteArray; Float64List? aNullableFloatArray; - List?>? nullableNestedList; - Map? nullableMapWithAnnotations; - Map? nullableMapWithObject; AnEnum? aNullableEnum; AnotherEnum? anotherNullableEnum; String? aNullableString; @@ -140,11 +164,22 @@ class AllNullableTypes { List? intList; List? doubleList; List? boolList; - List? nestedClassList; + List? enumList; + List? objectList; + List?>? listList; + List?>? mapList; + List? recursiveClassList; // Maps // ignore: strict_raw_type, always_specify_types Map? map; + Map? stringMap; + Map? intMap; + Map? enumMap; + Map? objectMap; + Map?>? listMap; + Map?>? mapMap; + Map? recursiveClassMap; } /// The primary purpose for this class is to ensure coverage of Swift structs @@ -160,23 +195,32 @@ class AllNullableTypesWithoutRecursion { this.aNullable4ByteArray, this.aNullable8ByteArray, this.aNullableFloatArray, - this.nullableNestedList, - this.nullableMapWithAnnotations, - this.nullableMapWithObject, this.aNullableEnum, this.anotherNullableEnum, this.aNullableString, this.aNullableObject, // Lists + // This name is in a different format than the others to ensure that name + // collision with the word 'list' doesn't occur in the generated files. this.list, this.stringList, this.intList, this.doubleList, this.boolList, + this.enumList, + this.objectList, + this.listList, + this.mapList, - //Maps + // Maps this.map, + this.stringMap, + this.intMap, + this.enumMap, + this.objectMap, + this.listMap, + this.mapMap, ); bool? aNullableBool; @@ -187,9 +231,6 @@ class AllNullableTypesWithoutRecursion { Int32List? aNullable4ByteArray; Int64List? aNullable8ByteArray; Float64List? aNullableFloatArray; - List?>? nullableNestedList; - Map? nullableMapWithAnnotations; - Map? nullableMapWithObject; AnEnum? aNullableEnum; AnotherEnum? anotherNullableEnum; String? aNullableString; @@ -202,10 +243,20 @@ class AllNullableTypesWithoutRecursion { List? intList; List? doubleList; List? boolList; + List? enumList; + List? objectList; + List?>? listList; + List?>? mapList; // Maps // ignore: strict_raw_type, always_specify_types Map? map; + Map? stringMap; + Map? intMap; + Map? enumMap; + Map? objectMap; + Map?>? listMap; + Map?>? mapMap; } /// A class for testing nested class handling. @@ -214,11 +265,22 @@ class AllNullableTypesWithoutRecursion { /// `AllNullableTypes` is non-nullable here as it is easier to instantiate /// than `AllTypes` when testing doesn't require both (ie. testing null classes). class AllClassesWrapper { - AllClassesWrapper(this.allNullableTypes, - this.allNullableTypesWithoutRecursion, this.allTypes); + AllClassesWrapper( + this.allNullableTypes, + this.allNullableTypesWithoutRecursion, + this.allTypes, + this.classList, + this.classMap, + this.nullableClassList, + this.nullableClassMap, + ); AllNullableTypes allNullableTypes; AllNullableTypesWithoutRecursion? allNullableTypesWithoutRecursion; AllTypes? allTypes; + List classList; + List? nullableClassList; + Map classMap; + Map? nullableClassMap; } /// The core interface that each host language plugin must implement in @@ -280,12 +342,74 @@ abstract class HostIntegrationCoreApi { @SwiftFunction('echo(_:)') List echoList(List list); + /// Returns the passed list, to test serialization and deserialization. + @ObjCSelector('echoEnumList:') + @SwiftFunction('echo(enumList:)') + List echoEnumList(List enumList); + + /// Returns the passed list, to test serialization and deserialization. + @ObjCSelector('echoClassList:') + @SwiftFunction('echo(classList:)') + List echoClassList(List classList); + + /// Returns the passed list, to test serialization and deserialization. + @ObjCSelector('echoNonNullEnumList:') + @SwiftFunction('echoNonNull(enumList:)') + List echoNonNullEnumList(List enumList); + + /// Returns the passed list, to test serialization and deserialization. + @ObjCSelector('echoNonNullClassList:') + @SwiftFunction('echoNonNull(classList:)') + List echoNonNullClassList(List classList); + /// Returns the passed map, to test serialization and deserialization. @ObjCSelector('echoMap:') @SwiftFunction('echo(_:)') - Map echoMap(Map aMap); + Map echoMap(Map map); + + /// Returns the passed map, to test serialization and deserialization. + @ObjCSelector('echoStringMap:') + @SwiftFunction('echo(stringMap:)') + Map echoStringMap(Map stringMap); + + /// Returns the passed map, to test serialization and deserialization. + @ObjCSelector('echoIntMap:') + @SwiftFunction('echo(intMap:)') + Map echoIntMap(Map intMap); + + /// Returns the passed map, to test serialization and deserialization. + @ObjCSelector('echoEnumMap:') + @SwiftFunction('echo(enumMap:)') + Map echoEnumMap(Map enumMap); + + /// Returns the passed map, to test serialization and deserialization. + @ObjCSelector('echoClassMap:') + @SwiftFunction('echo(classMap:)') + Map echoClassMap( + Map classMap); - /// Returns the passed map to test nested class serialization and deserialization. + /// Returns the passed map, to test serialization and deserialization. + @ObjCSelector('echoNonNullStringMap:') + @SwiftFunction('echoNonNull(stringMap:)') + Map echoNonNullStringMap(Map stringMap); + + /// Returns the passed map, to test serialization and deserialization. + @ObjCSelector('echoNonNullIntMap:') + @SwiftFunction('echoNonNull(intMap:)') + Map echoNonNullIntMap(Map intMap); + + /// Returns the passed map, to test serialization and deserialization. + @ObjCSelector('echoNonNullEnumMap:') + @SwiftFunction('echoNonNull(enumMap:)') + Map echoNonNullEnumMap(Map enumMap); + + /// Returns the passed map, to test serialization and deserialization. + @ObjCSelector('echoNonNullClassMap:') + @SwiftFunction('echoNonNull(classMap:)') + Map echoNonNullClassMap( + Map classMap); + + /// Returns the passed class to test nested class serialization and deserialization. @ObjCSelector('echoClassWrapper:') @SwiftFunction('echo(_:)') AllClassesWrapper echoClassWrapper(AllClassesWrapper wrapper); @@ -388,10 +512,76 @@ abstract class HostIntegrationCoreApi { @SwiftFunction('echoNullable(_:)') List? echoNullableList(List? aNullableList); + /// Returns the passed list, to test serialization and deserialization. + @ObjCSelector('echoNullableEnumList:') + @SwiftFunction('echoNullable(enumList:)') + List? echoNullableEnumList(List? enumList); + + /// Returns the passed list, to test serialization and deserialization. + @ObjCSelector('echoNullableClassList:') + @SwiftFunction('echoNullable(classList:)') + List? echoNullableClassList( + List? classList); + + /// Returns the passed list, to test serialization and deserialization. + @ObjCSelector('echoNullableNonNullEnumList:') + @SwiftFunction('echoNullableNonNull(enumList:)') + List? echoNullableNonNullEnumList(List? enumList); + + /// Returns the passed list, to test serialization and deserialization. + @ObjCSelector('echoNullableNonNullClassList:') + @SwiftFunction('echoNullableNonNull(classList:)') + List? echoNullableNonNullClassList( + List? classList); + /// Returns the passed map, to test serialization and deserialization. @ObjCSelector('echoNullableMap:') @SwiftFunction('echoNullable(_:)') - Map? echoNullableMap(Map? aNullableMap); + Map? echoNullableMap(Map? map); + + /// Returns the passed map, to test serialization and deserialization. + @ObjCSelector('echoNullableStringMap:') + @SwiftFunction('echoNullable(stringMap:)') + Map? echoNullableStringMap( + Map? stringMap); + + /// Returns the passed map, to test serialization and deserialization. + @ObjCSelector('echoNullableIntMap:') + @SwiftFunction('echoNullable(intMap:)') + Map? echoNullableIntMap(Map? intMap); + + /// Returns the passed map, to test serialization and deserialization. + @ObjCSelector('echoNullableEnumMap:') + @SwiftFunction('echoNullable(enumMap:)') + Map? echoNullableEnumMap(Map? enumMap); + + /// Returns the passed map, to test serialization and deserialization. + @ObjCSelector('echoNullableClassMap:') + @SwiftFunction('echoNullable(classMap:)') + Map? echoNullableClassMap( + Map? classMap); + + /// Returns the passed map, to test serialization and deserialization. + @ObjCSelector('echoNullableNonNullStringMap:') + @SwiftFunction('echoNullableNonNull(stringMap:)') + Map? echoNullableNonNullStringMap( + Map? stringMap); + + /// Returns the passed map, to test serialization and deserialization. + @ObjCSelector('echoNullableNonNullIntMap:') + @SwiftFunction('echoNullableNonNull(intMap:)') + Map? echoNullableNonNullIntMap(Map? intMap); + + /// Returns the passed map, to test serialization and deserialization. + @ObjCSelector('echoNullableNonNullEnumMap:') + @SwiftFunction('echoNullableNonNull(enumMap:)') + Map? echoNullableNonNullEnumMap(Map? enumMap); + + /// Returns the passed map, to test serialization and deserialization. + @ObjCSelector('echoNullableNonNullClassMap:') + @SwiftFunction('echoNullableNonNull(classMap:)') + Map? echoNullableNonNullClassMap( + Map? classMap); @ObjCSelector('echoNullableEnum:') @SwiftFunction('echoNullable(_:)') @@ -460,11 +650,48 @@ abstract class HostIntegrationCoreApi { @SwiftFunction('echoAsync(_:)') List echoAsyncList(List list); + /// Returns the passed list, to test asynchronous serialization and deserialization. + @async + @ObjCSelector('echoAsyncEnumList:') + @SwiftFunction('echoAsync(enumList:)') + List echoAsyncEnumList(List enumList); + + /// Returns the passed list, to test asynchronous serialization and deserialization. + @async + @ObjCSelector('echoAsyncClassList:') + @SwiftFunction('echoAsync(classList:)') + List echoAsyncClassList(List classList); + /// Returns the passed map, to test asynchronous serialization and deserialization. @async @ObjCSelector('echoAsyncMap:') @SwiftFunction('echoAsync(_:)') - Map echoAsyncMap(Map aMap); + Map echoAsyncMap(Map map); + + /// Returns the passed map, to test asynchronous serialization and deserialization. + @async + @ObjCSelector('echoAsyncStringMap:') + @SwiftFunction('echoAsync(stringMap:)') + Map echoAsyncStringMap(Map stringMap); + + /// Returns the passed map, to test asynchronous serialization and deserialization. + @async + @ObjCSelector('echoAsyncIntMap:') + @SwiftFunction('echoAsync(intMap:)') + Map echoAsyncIntMap(Map intMap); + + /// Returns the passed map, to test asynchronous serialization and deserialization. + @async + @ObjCSelector('echoAsyncEnumMap:') + @SwiftFunction('echoAsync(enumMap:)') + Map echoAsyncEnumMap(Map enumMap); + + /// Returns the passed map, to test asynchronous serialization and deserialization. + @async + @ObjCSelector('echoAsyncClassMap:') + @SwiftFunction('echoAsync(classMap:)') + Map echoAsyncClassMap( + Map classMap); /// Returns the passed enum, to test asynchronous serialization and deserialization. @async @@ -553,11 +780,51 @@ abstract class HostIntegrationCoreApi { @SwiftFunction('echoAsyncNullable(_:)') List? echoAsyncNullableList(List? list); + /// Returns the passed list, to test asynchronous serialization and deserialization. + @async + @ObjCSelector('echoAsyncNullableEnumList:') + @SwiftFunction('echoAsyncNullable(enumList:)') + List? echoAsyncNullableEnumList(List? enumList); + + /// Returns the passed list, to test asynchronous serialization and deserialization. + @async + @ObjCSelector('echoAsyncNullableClassList:') + @SwiftFunction('echoAsyncNullable(classList:)') + List? echoAsyncNullableClassList( + List? classList); + /// Returns the passed map, to test asynchronous serialization and deserialization. @async @ObjCSelector('echoAsyncNullableMap:') @SwiftFunction('echoAsyncNullable(_:)') - Map? echoAsyncNullableMap(Map? aMap); + Map? echoAsyncNullableMap(Map? map); + + /// Returns the passed map, to test asynchronous serialization and deserialization. + @async + @ObjCSelector('echoAsyncNullableStringMap:') + @SwiftFunction('echoAsyncNullable(stringMap:)') + Map? echoAsyncNullableStringMap( + Map? stringMap); + + /// Returns the passed map, to test asynchronous serialization and deserialization. + @async + @ObjCSelector('echoAsyncNullableIntMap:') + @SwiftFunction('echoAsyncNullable(intMap:)') + Map? echoAsyncNullableIntMap(Map? intMap); + + /// Returns the passed map, to test asynchronous serialization and deserialization. + @async + @ObjCSelector('echoAsyncNullableEnumMap:') + @SwiftFunction('echoAsyncNullable(enumMap:)') + Map? echoAsyncNullableEnumMap( + Map? enumMap); + + /// Returns the passed map, to test asynchronous serialization and deserialization. + @async + @ObjCSelector('echoAsyncNullableClassMap:') + @SwiftFunction('echoAsyncNullable(classMap:)') + Map? echoAsyncNullableClassMap( + Map? classMap); /// Returns the passed enum, to test asynchronous serialization and deserialization. @async @@ -645,10 +912,77 @@ abstract class HostIntegrationCoreApi { @SwiftFunction('callFlutterEcho(_:)') List callFlutterEchoList(List list); + @async + @ObjCSelector('callFlutterEchoEnumList:') + @SwiftFunction('callFlutterEcho(enumList:)') + List callFlutterEchoEnumList(List enumList); + + @async + @ObjCSelector('callFlutterEchoClassList:') + @SwiftFunction('callFlutterEcho(classList:)') + List callFlutterEchoClassList( + List classList); + + @async + @ObjCSelector('callFlutterEchoNonNullEnumList:') + @SwiftFunction('callFlutterEchoNonNull(enumList:)') + List callFlutterEchoNonNullEnumList(List enumList); + + @async + @ObjCSelector('callFlutterEchoNonNullClassList:') + @SwiftFunction('callFlutterEchoNonNull(classList:)') + List callFlutterEchoNonNullClassList( + List classList); + @async @ObjCSelector('callFlutterEchoMap:') @SwiftFunction('callFlutterEcho(_:)') - Map callFlutterEchoMap(Map aMap); + Map callFlutterEchoMap(Map map); + + @async + @ObjCSelector('callFlutterEchoStringMap:') + @SwiftFunction('callFlutterEcho(stringMap:)') + Map callFlutterEchoStringMap( + Map stringMap); + + @async + @ObjCSelector('callFlutterEchoIntMap:') + @SwiftFunction('callFlutterEcho(intMap:)') + Map callFlutterEchoIntMap(Map intMap); + + @async + @ObjCSelector('callFlutterEchoEnumMap:') + @SwiftFunction('callFlutterEcho(enumMap:)') + Map callFlutterEchoEnumMap(Map enumMap); + + @async + @ObjCSelector('callFlutterEchoClassMap:') + @SwiftFunction('callFlutterEcho(classMap:)') + Map callFlutterEchoClassMap( + Map classMap); + + @async + @ObjCSelector('callFlutterEchoNonNullStringMap:') + @SwiftFunction('callFlutterEchoNonNull(stringMap:)') + Map callFlutterEchoNonNullStringMap( + Map stringMap); + + @async + @ObjCSelector('callFlutterEchoNonNullIntMap:') + @SwiftFunction('callFlutterEchoNonNull(intMap:)') + Map callFlutterEchoNonNullIntMap(Map intMap); + + @async + @ObjCSelector('callFlutterEchoNonNullEnumMap:') + @SwiftFunction('callFlutterEchoNonNull(enumMap:)') + Map callFlutterEchoNonNullEnumMap( + Map enumMap); + + @async + @ObjCSelector('callFlutterEchoNonNullClassMap:') + @SwiftFunction('callFlutterEchoNonNull(classMap:)') + Map callFlutterEchoNonNullClassMap( + Map classMap); @async @ObjCSelector('callFlutterEchoEnum:') @@ -690,11 +1024,78 @@ abstract class HostIntegrationCoreApi { @SwiftFunction('callFlutterEchoNullable(_:)') List? callFlutterEchoNullableList(List? list); + @async + @ObjCSelector('callFlutterEchoNullableEnumList:') + @SwiftFunction('callFlutterEchoNullable(enumList:)') + List? callFlutterEchoNullableEnumList(List? enumList); + + @async + @ObjCSelector('callFlutterEchoNullableClassList:') + @SwiftFunction('callFlutterEchoNullable(classList:)') + List? callFlutterEchoNullableClassList( + List? classList); + + @async + @ObjCSelector('callFlutterEchoNullableNonNullEnumList:') + @SwiftFunction('callFlutterEchoNullableNonNull(enumList:)') + List? callFlutterEchoNullableNonNullEnumList(List? enumList); + + @async + @ObjCSelector('callFlutterEchoNullableNonNullClassList:') + @SwiftFunction('callFlutterEchoNullableNonNull(classList:)') + List? callFlutterEchoNullableNonNullClassList( + List? classList); + @async @ObjCSelector('callFlutterEchoNullableMap:') @SwiftFunction('callFlutterEchoNullable(_:)') - Map? callFlutterEchoNullableMap( - Map? aMap); + Map? callFlutterEchoNullableMap(Map? map); + + @async + @ObjCSelector('callFlutterEchoNullableStringMap:') + @SwiftFunction('callFlutterEchoNullable(stringMap:)') + Map? callFlutterEchoNullableStringMap( + Map? stringMap); + + @async + @ObjCSelector('callFlutterEchoNullableIntMap:') + @SwiftFunction('callFlutterEchoNullable(intMap:)') + Map? callFlutterEchoNullableIntMap(Map? intMap); + + @async + @ObjCSelector('callFlutterEchoNullableEnumMap:') + @SwiftFunction('callFlutterEchoNullable(enumMap:)') + Map? callFlutterEchoNullableEnumMap( + Map? enumMap); + + @async + @ObjCSelector('callFlutterEchoNullableClassMap:') + @SwiftFunction('callFlutterEchoNullable(classMap:)') + Map? callFlutterEchoNullableClassMap( + Map? classMap); + + @async + @ObjCSelector('callFlutterEchoNullableNonNullStringMap:') + @SwiftFunction('callFlutterEchoNullableNonNull(stringMap:)') + Map? callFlutterEchoNullableNonNullStringMap( + Map? stringMap); + + @async + @ObjCSelector('callFlutterEchoNullableNonNullIntMap:') + @SwiftFunction('callFlutterEchoNullableNonNull(intMap:)') + Map? callFlutterEchoNullableNonNullIntMap(Map? intMap); + + @async + @ObjCSelector('callFlutterEchoNullableNonNullEnumMap:') + @SwiftFunction('callFlutterEchoNullableNonNull(enumMap:)') + Map? callFlutterEchoNullableNonNullEnumMap( + Map? enumMap); + + @async + @ObjCSelector('callFlutterEchoNullableNonNullClassMap:') + @SwiftFunction('callFlutterEchoNullableNonNull(classMap:)') + Map? callFlutterEchoNullableNonNullClassMap( + Map? classMap); @async @ObjCSelector('callFlutterEchoNullableEnum:') @@ -791,10 +1192,72 @@ abstract class FlutterIntegrationCoreApi { @SwiftFunction('echo(_:)') List echoList(List list); + /// Returns the passed list, to test serialization and deserialization. + @ObjCSelector('echoEnumList:') + @SwiftFunction('echo(enumList:)') + List echoEnumList(List enumList); + + /// Returns the passed list, to test serialization and deserialization. + @ObjCSelector('echoClassList:') + @SwiftFunction('echo(classList:)') + List echoClassList(List classList); + + /// Returns the passed list, to test serialization and deserialization. + @ObjCSelector('echoNonNullEnumList:') + @SwiftFunction('echoNonNull(enumList:)') + List echoNonNullEnumList(List enumList); + + /// Returns the passed list, to test serialization and deserialization. + @ObjCSelector('echoNonNullClassList:') + @SwiftFunction('echoNonNull(classList:)') + List echoNonNullClassList(List classList); + /// Returns the passed map, to test serialization and deserialization. @ObjCSelector('echoMap:') @SwiftFunction('echo(_:)') - Map echoMap(Map aMap); + Map echoMap(Map map); + + /// Returns the passed map, to test serialization and deserialization. + @ObjCSelector('echoStringMap:') + @SwiftFunction('echo(stringMap:)') + Map echoStringMap(Map stringMap); + + /// Returns the passed map, to test serialization and deserialization. + @ObjCSelector('echoIntMap:') + @SwiftFunction('echo(intMap:)') + Map echoIntMap(Map intMap); + + /// Returns the passed map, to test serialization and deserialization. + @ObjCSelector('echoEnumMap:') + @SwiftFunction('echo(enumMap:)') + Map echoEnumMap(Map enumMap); + + /// Returns the passed map, to test serialization and deserialization. + @ObjCSelector('echoClassMap:') + @SwiftFunction('echo(classMap:)') + Map echoClassMap( + Map classMap); + + /// Returns the passed map, to test serialization and deserialization. + @ObjCSelector('echoNonNullStringMap:') + @SwiftFunction('echoNonNull(stringMap:)') + Map echoNonNullStringMap(Map stringMap); + + /// Returns the passed map, to test serialization and deserialization. + @ObjCSelector('echoNonNullIntMap:') + @SwiftFunction('echoNonNull(intMap:)') + Map echoNonNullIntMap(Map intMap); + + /// Returns the passed map, to test serialization and deserialization. + @ObjCSelector('echoNonNullEnumMap:') + @SwiftFunction('echoNonNull(enumMap:)') + Map echoNonNullEnumMap(Map enumMap); + + /// Returns the passed map, to test serialization and deserialization. + @ObjCSelector('echoNonNullClassMap:') + @SwiftFunction('echoNonNull(classMap:)') + Map echoNonNullClassMap( + Map classMap); /// Returns the passed enum to test serialization and deserialization. @ObjCSelector('echoEnum:') @@ -838,10 +1301,76 @@ abstract class FlutterIntegrationCoreApi { @SwiftFunction('echoNullable(_:)') List? echoNullableList(List? list); + /// Returns the passed list, to test serialization and deserialization. + @ObjCSelector('echoNullableEnumList:') + @SwiftFunction('echoNullable(enumList:)') + List? echoNullableEnumList(List? enumList); + + /// Returns the passed list, to test serialization and deserialization. + @ObjCSelector('echoNullableClassList:') + @SwiftFunction('echoNullable(classList:)') + List? echoNullableClassList( + List? classList); + + /// Returns the passed list, to test serialization and deserialization. + @ObjCSelector('echoNullableNonNullEnumList:') + @SwiftFunction('echoNullableNonNull(enumList:)') + List? echoNullableNonNullEnumList(List? enumList); + + /// Returns the passed list, to test serialization and deserialization. + @ObjCSelector('echoNullableNonNullClassList:') + @SwiftFunction('echoNullableNonNull(classList:)') + List? echoNullableNonNullClassList( + List? classList); + /// Returns the passed map, to test serialization and deserialization. @ObjCSelector('echoNullableMap:') @SwiftFunction('echoNullable(_:)') - Map? echoNullableMap(Map? aMap); + Map? echoNullableMap(Map? map); + + /// Returns the passed map, to test serialization and deserialization. + @ObjCSelector('echoNullableStringMap:') + @SwiftFunction('echoNullable(stringMap:)') + Map? echoNullableStringMap( + Map? stringMap); + + /// Returns the passed map, to test serialization and deserialization. + @ObjCSelector('echoNullableIntMap:') + @SwiftFunction('echoNullable(intMap:)') + Map? echoNullableIntMap(Map? intMap); + + /// Returns the passed map, to test serialization and deserialization. + @ObjCSelector('echoNullableEnumMap:') + @SwiftFunction('echoNullable(enumMap:)') + Map? echoNullableEnumMap(Map? enumMap); + + /// Returns the passed map, to test serialization and deserialization. + @ObjCSelector('echoNullableClassMap:') + @SwiftFunction('echoNullable(classMap:)') + Map? echoNullableClassMap( + Map? classMap); + + /// Returns the passed map, to test serialization and deserialization. + @ObjCSelector('echoNullableNonNullStringMap:') + @SwiftFunction('echoNullableNonNull(stringMap:)') + Map? echoNullableNonNullStringMap( + Map? stringMap); + + /// Returns the passed map, to test serialization and deserialization. + @ObjCSelector('echoNullableNonNullIntMap:') + @SwiftFunction('echoNullableNonNull(intMap:)') + Map? echoNullableNonNullIntMap(Map? intMap); + + /// Returns the passed map, to test serialization and deserialization. + @ObjCSelector('echoNullableNonNullEnumMap:') + @SwiftFunction('echoNullableNonNull(enumMap:)') + Map? echoNullableNonNullEnumMap(Map? enumMap); + + /// Returns the passed map, to test serialization and deserialization. + @ObjCSelector('echoNullableNonNullClassMap:') + @SwiftFunction('echoNullableNonNull(classMap:)') + Map? echoNullableNonNullClassMap( + Map? classMap); /// Returns the passed enum to test serialization and deserialization. @ObjCSelector('echoNullableEnum:') diff --git a/packages/pigeon/pigeons/proxy_api_tests.dart b/packages/pigeon/pigeons/proxy_api_tests.dart index 699e5dfaed86..0e7bfed75ff6 100644 --- a/packages/pigeon/pigeons/proxy_api_tests.dart +++ b/packages/pigeon/pigeons/proxy_api_tests.dart @@ -455,7 +455,12 @@ abstract class ProxyApiTestClass extends ProxyApiSuperClass } /// ProxyApi to serve as a super class to the core ProxyApi class. -@ProxyApi() +@ProxyApi( + kotlinOptions: KotlinProxyApiOptions( + fullClassName: 'com.example.test_plugin.ProxyApiSuperClass', + ), + swiftOptions: SwiftProxyApiOptions(name: 'ProxyApiSuperClass'), +) abstract class ProxyApiSuperClass { ProxyApiSuperClass(); @@ -467,3 +472,16 @@ abstract class ProxyApiSuperClass { abstract class ProxyApiInterface { late void Function()? anInterfaceMethod; } + +@ProxyApi( + kotlinOptions: KotlinProxyApiOptions(minAndroidApi: 25), + swiftOptions: SwiftProxyApiOptions( + minIosApi: '15.0.0', + minMacosApi: '10.0.0', + ), +) +abstract class ClassWithApiRequirement { + ClassWithApiRequirement(); + + void aMethod(); +} diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/android/build.gradle b/packages/pigeon/platform_tests/alternate_language_test_plugin/android/build.gradle index 3c2e835e5ac5..099568e3c98e 100644 --- a/packages/pigeon/platform_tests/alternate_language_test_plugin/android/build.gradle +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/android/build.gradle @@ -22,15 +22,12 @@ rootProject.allprojects { apply plugin: 'com.android.library' android { - // Conditional for compatibility with AGP <4.2. - if (project.android.hasProperty("namespace")) { - namespace 'com.example.alternate_language_test_plugin' - } + namespace 'com.example.alternate_language_test_plugin' compileSdk 34 compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_11 + targetCompatibility JavaVersion.VERSION_11 } defaultConfig { diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/main/java/com/example/alternate_language_test_plugin/AlternateLanguageTestPlugin.java b/packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/main/java/com/example/alternate_language_test_plugin/AlternateLanguageTestPlugin.java index 9f5b079fa334..8580645a27d7 100644 --- a/packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/main/java/com/example/alternate_language_test_plugin/AlternateLanguageTestPlugin.java +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/main/java/com/example/alternate_language_test_plugin/AlternateLanguageTestPlugin.java @@ -19,6 +19,8 @@ import com.example.alternate_language_test_plugin.CoreTests.Result; import com.example.alternate_language_test_plugin.CoreTests.VoidResult; import io.flutter.embedding.engine.plugins.FlutterPlugin; +import java.util.ArrayList; +import java.util.HashMap; import java.util.List; import java.util.Map; @@ -115,8 +117,76 @@ public void throwErrorFromVoid() { } @Override - public @NonNull Map echoMap(@NonNull Map aMap) { - return aMap; + public @NonNull List echoEnumList(@NonNull List enumList) { + return enumList; + } + + @Override + public @NonNull List echoClassList(@NonNull List classList) { + return classList; + } + + @NonNull + @Override + public List echoNonNullEnumList(@NonNull List enumList) { + return enumList; + } + + @NonNull + @Override + public List echoNonNullClassList(@NonNull List classList) { + return classList; + } + + @Override + public @NonNull Map echoMap(@NonNull Map map) { + return map; + } + + @Override + public @NonNull Map echoStringMap(@NonNull Map stringMap) { + return stringMap; + } + + @Override + public @NonNull Map echoIntMap(@NonNull Map intMap) { + return intMap; + } + + @Override + public @NonNull Map echoEnumMap(@NonNull Map enumMap) { + return enumMap; + } + + @Override + public @NonNull Map echoClassMap( + @NonNull Map classMap) { + return classMap; + } + + @NonNull + @Override + public Map echoNonNullStringMap(@NonNull Map stringMap) { + return stringMap; + } + + @NonNull + @Override + public Map echoNonNullIntMap(@NonNull Map intMap) { + return intMap; + } + + @NonNull + @Override + public Map echoNonNullEnumMap(@NonNull Map enumMap) { + return enumMap; + } + + @NonNull + @Override + public Map echoNonNullClassMap( + @NonNull Map classMap) { + return classMap; } @Override @@ -158,7 +228,11 @@ public void throwErrorFromVoid() { public @NonNull AllClassesWrapper createNestedNullableString(@Nullable String nullableString) { AllNullableTypes innerObject = new AllNullableTypes.Builder().setANullableString(nullableString).build(); - return new AllClassesWrapper.Builder().setAllNullableTypes(innerObject).build(); + return new AllClassesWrapper.Builder() + .setAllNullableTypes(innerObject) + .setClassList(new ArrayList()) + .setClassMap(new HashMap()) + .build(); } @Override @@ -221,8 +295,79 @@ public void throwErrorFromVoid() { } @Override - public @Nullable Map echoNullableMap(@Nullable Map aNullableMap) { - return aNullableMap; + public @Nullable List echoNullableEnumList(@Nullable List enumList) { + return enumList; + } + + @Override + public @Nullable List echoNullableClassList( + @Nullable List classList) { + return classList; + } + + @Nullable + @Override + public List echoNullableNonNullEnumList(@Nullable List enumList) { + return enumList; + } + + @Nullable + @Override + public List echoNullableNonNullClassList( + @Nullable List classList) { + return classList; + } + + @Override + public @Nullable Map echoNullableMap(@Nullable Map map) { + return map; + } + + @Override + public @Nullable Map echoNullableStringMap( + @Nullable Map stringMap) { + return stringMap; + } + + @Override + public @Nullable Map echoNullableIntMap(@Nullable Map intMap) { + return intMap; + } + + @Override + public @Nullable Map echoNullableEnumMap(@Nullable Map enumMap) { + return enumMap; + } + + @Override + public @Nullable Map echoNullableClassMap( + @Nullable Map classMap) { + return classMap; + } + + @Nullable + @Override + public Map echoNullableNonNullStringMap(@Nullable Map stringMap) { + return stringMap; + } + + @Nullable + @Override + public Map echoNullableNonNullIntMap(@Nullable Map intMap) { + return intMap; + } + + @Nullable + @Override + public Map echoNullableNonNullEnumMap(@Nullable Map enumMap) { + return enumMap; + } + + @Nullable + @Override + public Map echoNullableNonNullClassMap( + @Nullable Map classMap) { + return classMap; } @Override @@ -318,10 +463,47 @@ public void echoAsyncList(@NonNull List list, @NonNull Result enumList, @NonNull Result> result) { + result.success(enumList); + } + + @Override + public void echoAsyncClassList( + @NonNull List classList, @NonNull Result> result) { + result.success(classList); + } + @Override public void echoAsyncMap( - @NonNull Map aMap, @NonNull Result> result) { - result.success(aMap); + @NonNull Map map, @NonNull Result> result) { + result.success(map); + } + + @Override + public void echoAsyncStringMap( + @NonNull Map stringMap, @NonNull Result> result) { + result.success(stringMap); + } + + @Override + public void echoAsyncIntMap( + @NonNull Map intMap, @NonNull Result> result) { + result.success(intMap); + } + + @Override + public void echoAsyncEnumMap( + @NonNull Map enumMap, @NonNull Result> result) { + result.success(enumMap); + } + + @Override + public void echoAsyncClassMap( + @NonNull Map classMap, + @NonNull Result> result) { + result.success(classMap); } @Override @@ -376,10 +558,49 @@ public void echoAsyncNullableList( result.success(list); } + @Override + public void echoAsyncNullableEnumList( + @Nullable List enumList, @NonNull NullableResult> result) { + result.success(enumList); + } + + @Override + public void echoAsyncNullableClassList( + @Nullable List classList, + @NonNull NullableResult> result) { + result.success(classList); + } + @Override public void echoAsyncNullableMap( - @Nullable Map aMap, @NonNull NullableResult> result) { - result.success(aMap); + @Nullable Map map, @NonNull NullableResult> result) { + result.success(map); + } + + @Override + public void echoAsyncNullableStringMap( + @Nullable Map stringMap, + @NonNull NullableResult> result) { + result.success(stringMap); + } + + @Override + public void echoAsyncNullableIntMap( + @Nullable Map intMap, @NonNull NullableResult> result) { + result.success(intMap); + } + + @Override + public void echoAsyncNullableEnumMap( + @Nullable Map enumMap, @NonNull NullableResult> result) { + result.success(enumMap); + } + + @Override + public void echoAsyncNullableClassMap( + @Nullable Map classMap, + @NonNull NullableResult> result) { + result.success(classMap); } @Override @@ -492,11 +713,98 @@ public void callFlutterEchoList( flutterApi.echoList(list, result); } + @Override + public void callFlutterEchoEnumList( + @NonNull List enumList, @NonNull Result> result) { + assert flutterApi != null; + flutterApi.echoEnumList(enumList, result); + } + + @Override + public void callFlutterEchoClassList( + @NonNull List classNullableTypes, + @NonNull Result> result) { + assert flutterApi != null; + flutterApi.echoClassList(classNullableTypes, result); + } + + @Override + public void callFlutterEchoNonNullEnumList( + @NonNull List enumList, @NonNull Result> result) { + assert flutterApi != null; + flutterApi.echoNonNullEnumList(enumList, result); + } + + @Override + public void callFlutterEchoNonNullClassList( + @NonNull List classList, @NonNull Result> result) { + assert flutterApi != null; + flutterApi.echoNonNullClassList(classList, result); + } + @Override public void callFlutterEchoMap( - @NonNull Map aMap, @NonNull Result> result) { + @NonNull Map map, @NonNull Result> result) { + assert flutterApi != null; + flutterApi.echoMap(map, result); + } + + @Override + public void callFlutterEchoStringMap( + @NonNull Map stringMap, @NonNull Result> result) { + assert flutterApi != null; + flutterApi.echoStringMap(stringMap, result); + } + + @Override + public void callFlutterEchoIntMap( + @NonNull Map intMap, @NonNull Result> result) { + assert flutterApi != null; + flutterApi.echoIntMap(intMap, result); + } + + @Override + public void callFlutterEchoEnumMap( + @NonNull Map enumMap, @NonNull Result> result) { + assert flutterApi != null; + flutterApi.echoEnumMap(enumMap, result); + } + + @Override + public void callFlutterEchoClassMap( + @NonNull Map classMap, + @NonNull Result> result) { + assert flutterApi != null; + flutterApi.echoClassMap(classMap, result); + } + + @Override + public void callFlutterEchoNonNullStringMap( + @NonNull Map stringMap, @NonNull Result> result) { + assert flutterApi != null; + flutterApi.echoNonNullStringMap(stringMap, result); + } + + @Override + public void callFlutterEchoNonNullIntMap( + @NonNull Map intMap, @NonNull Result> result) { + assert flutterApi != null; + flutterApi.echoNonNullIntMap(intMap, result); + } + + @Override + public void callFlutterEchoNonNullEnumMap( + @NonNull Map enumMap, @NonNull Result> result) { + assert flutterApi != null; + flutterApi.echoNonNullEnumMap(enumMap, result); + } + + @Override + public void callFlutterEchoNonNullClassMap( + @NonNull Map classMap, + @NonNull Result> result) { assert flutterApi != null; - flutterApi.echoMap(aMap, result); + flutterApi.echoNonNullClassMap(classMap, result); } @Override @@ -554,11 +862,102 @@ public void callFlutterEchoNullableList( flutterApi.echoNullableList(list, result); } + @Override + public void callFlutterEchoNullableEnumList( + @Nullable List enumList, @NonNull NullableResult> result) { + assert flutterApi != null; + flutterApi.echoNullableEnumList(enumList, result); + } + + @Override + public void callFlutterEchoNullableClassList( + @Nullable List classList, + @NonNull NullableResult> result) { + assert flutterApi != null; + flutterApi.echoNullableClassList(classList, result); + } + + @Override + public void callFlutterEchoNullableNonNullEnumList( + @Nullable List enumList, @NonNull NullableResult> result) { + assert flutterApi != null; + flutterApi.echoNullableNonNullEnumList(enumList, result); + } + + @Override + public void callFlutterEchoNullableNonNullClassList( + @Nullable List classList, + @NonNull NullableResult> result) { + assert flutterApi != null; + flutterApi.echoNullableNonNullClassList(classList, result); + } + @Override public void callFlutterEchoNullableMap( - @Nullable Map aMap, @NonNull NullableResult> result) { + @Nullable Map map, @NonNull NullableResult> result) { + assert flutterApi != null; + flutterApi.echoNullableMap(map, result); + } + + @Override + public void callFlutterEchoNullableStringMap( + @Nullable Map stringMap, + @NonNull NullableResult> result) { + assert flutterApi != null; + flutterApi.echoNullableStringMap(stringMap, result); + } + + @Override + public void callFlutterEchoNullableIntMap( + @Nullable Map intMap, @NonNull NullableResult> result) { + assert flutterApi != null; + flutterApi.echoNullableIntMap(intMap, result); + } + + @Override + public void callFlutterEchoNullableEnumMap( + @Nullable Map enumMap, @NonNull NullableResult> result) { + assert flutterApi != null; + flutterApi.echoNullableEnumMap(enumMap, result); + } + + @Override + public void callFlutterEchoNullableClassMap( + @Nullable Map classMap, + @NonNull NullableResult> result) { + assert flutterApi != null; + flutterApi.echoNullableClassMap(classMap, result); + } + + @Override + public void callFlutterEchoNullableNonNullStringMap( + @Nullable Map stringMap, + @NonNull NullableResult> result) { + + assert flutterApi != null; + flutterApi.echoNullableNonNullStringMap(stringMap, result); + } + + @Override + public void callFlutterEchoNullableNonNullIntMap( + @Nullable Map intMap, @NonNull NullableResult> result) { + assert flutterApi != null; + flutterApi.echoNullableNonNullIntMap(intMap, result); + } + + @Override + public void callFlutterEchoNullableNonNullEnumMap( + @Nullable Map enumMap, @NonNull NullableResult> result) { assert flutterApi != null; - flutterApi.echoNullableMap(aMap, result); + flutterApi.echoNullableNonNullEnumMap(enumMap, result); + } + + @Override + public void callFlutterEchoNullableNonNullClassMap( + @Nullable Map classMap, + @NonNull NullableResult> result) { + assert flutterApi != null; + flutterApi.echoNullableNonNullClassMap(classMap, result); } @Override @@ -613,6 +1012,10 @@ public void error(Throwable error) { }; flutterSmallApiOne.echoString(aString, resultCallbackOne); } + + public @NonNull CoreTests.UnusedClass testIfUnusedClassIsGenerated() { + return new CoreTests.UnusedClass(); + } } class TestPluginWithSuffix implements CoreTests.HostSmallApi { 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 3f2ae2af2c65..4707969aab13 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 @@ -99,6 +99,67 @@ public enum AnotherEnum { } } + /** Generated class from Pigeon that represents data sent in messages. */ + public static final class UnusedClass { + private @Nullable Object aField; + + public @Nullable Object getAField() { + return aField; + } + + public void setAField(@Nullable Object setterArg) { + this.aField = setterArg; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UnusedClass that = (UnusedClass) o; + return Objects.equals(aField, that.aField); + } + + @Override + public int hashCode() { + return Objects.hash(aField); + } + + public static final class Builder { + + private @Nullable Object aField; + + @CanIgnoreReturnValue + public @NonNull Builder setAField(@Nullable Object setterArg) { + this.aField = setterArg; + return this; + } + + public @NonNull UnusedClass build() { + UnusedClass pigeonReturn = new UnusedClass(); + pigeonReturn.setAField(aField); + return pigeonReturn; + } + } + + @NonNull + ArrayList toList() { + ArrayList toListResult = new ArrayList<>(1); + toListResult.add(aField); + return toListResult; + } + + static @NonNull UnusedClass fromList(@NonNull ArrayList pigeonVar_list) { + UnusedClass pigeonResult = new UnusedClass(); + Object aField = pigeonVar_list.get(0); + pigeonResult.setAField(aField); + return pigeonResult; + } + } + /** * A class containing all supported types. * @@ -326,6 +387,58 @@ public void setBoolList(@NonNull List setterArg) { this.boolList = setterArg; } + private @NonNull List enumList; + + public @NonNull List getEnumList() { + return enumList; + } + + public void setEnumList(@NonNull List setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"enumList\" is null."); + } + this.enumList = setterArg; + } + + private @NonNull List objectList; + + public @NonNull List getObjectList() { + return objectList; + } + + public void setObjectList(@NonNull List setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"objectList\" is null."); + } + this.objectList = setterArg; + } + + private @NonNull List> listList; + + public @NonNull List> getListList() { + return listList; + } + + public void setListList(@NonNull List> setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"listList\" is null."); + } + this.listList = setterArg; + } + + private @NonNull List> mapList; + + public @NonNull List> getMapList() { + return mapList; + } + + public void setMapList(@NonNull List> setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"mapList\" is null."); + } + this.mapList = setterArg; + } + private @NonNull Map map; public @NonNull Map getMap() { @@ -339,6 +452,84 @@ public void setMap(@NonNull Map setterArg) { this.map = setterArg; } + private @NonNull Map stringMap; + + public @NonNull Map getStringMap() { + return stringMap; + } + + public void setStringMap(@NonNull Map setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"stringMap\" is null."); + } + this.stringMap = setterArg; + } + + private @NonNull Map intMap; + + public @NonNull Map getIntMap() { + return intMap; + } + + public void setIntMap(@NonNull Map setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"intMap\" is null."); + } + this.intMap = setterArg; + } + + private @NonNull Map enumMap; + + public @NonNull Map getEnumMap() { + return enumMap; + } + + public void setEnumMap(@NonNull Map setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"enumMap\" is null."); + } + this.enumMap = setterArg; + } + + private @NonNull Map objectMap; + + public @NonNull Map getObjectMap() { + return objectMap; + } + + public void setObjectMap(@NonNull Map setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"objectMap\" is null."); + } + this.objectMap = setterArg; + } + + private @NonNull Map> listMap; + + public @NonNull Map> getListMap() { + return listMap; + } + + public void setListMap(@NonNull Map> setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"listMap\" is null."); + } + this.listMap = setterArg; + } + + private @NonNull Map> mapMap; + + public @NonNull Map> getMapMap() { + return mapMap; + } + + public void setMapMap(@NonNull Map> setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"mapMap\" is null."); + } + this.mapMap = setterArg; + } + /** Constructor is non-public to enforce null safety; use Builder. */ AllTypes() {} @@ -368,7 +559,17 @@ public boolean equals(Object o) { && intList.equals(that.intList) && doubleList.equals(that.doubleList) && boolList.equals(that.boolList) - && map.equals(that.map); + && enumList.equals(that.enumList) + && objectList.equals(that.objectList) + && listList.equals(that.listList) + && mapList.equals(that.mapList) + && map.equals(that.map) + && stringMap.equals(that.stringMap) + && intMap.equals(that.intMap) + && enumMap.equals(that.enumMap) + && objectMap.equals(that.objectMap) + && listMap.equals(that.listMap) + && mapMap.equals(that.mapMap); } @Override @@ -388,7 +589,17 @@ public int hashCode() { intList, doubleList, boolList, - map); + enumList, + objectList, + listList, + mapList, + map, + stringMap, + intMap, + enumMap, + objectMap, + listMap, + mapMap); pigeonVar_result = 31 * pigeonVar_result + Arrays.hashCode(aByteArray); pigeonVar_result = 31 * pigeonVar_result + Arrays.hashCode(a4ByteArray); pigeonVar_result = 31 * pigeonVar_result + Arrays.hashCode(a8ByteArray); @@ -534,6 +745,38 @@ public static final class Builder { return this; } + private @Nullable List enumList; + + @CanIgnoreReturnValue + public @NonNull Builder setEnumList(@NonNull List setterArg) { + this.enumList = setterArg; + return this; + } + + private @Nullable List objectList; + + @CanIgnoreReturnValue + public @NonNull Builder setObjectList(@NonNull List setterArg) { + this.objectList = setterArg; + return this; + } + + private @Nullable List> listList; + + @CanIgnoreReturnValue + public @NonNull Builder setListList(@NonNull List> setterArg) { + this.listList = setterArg; + return this; + } + + private @Nullable List> mapList; + + @CanIgnoreReturnValue + public @NonNull Builder setMapList(@NonNull List> setterArg) { + this.mapList = setterArg; + return this; + } + private @Nullable Map map; @CanIgnoreReturnValue @@ -542,6 +785,54 @@ public static final class Builder { return this; } + private @Nullable Map stringMap; + + @CanIgnoreReturnValue + public @NonNull Builder setStringMap(@NonNull Map setterArg) { + this.stringMap = setterArg; + return this; + } + + private @Nullable Map intMap; + + @CanIgnoreReturnValue + public @NonNull Builder setIntMap(@NonNull Map setterArg) { + this.intMap = setterArg; + return this; + } + + private @Nullable Map enumMap; + + @CanIgnoreReturnValue + public @NonNull Builder setEnumMap(@NonNull Map setterArg) { + this.enumMap = setterArg; + return this; + } + + private @Nullable Map objectMap; + + @CanIgnoreReturnValue + public @NonNull Builder setObjectMap(@NonNull Map setterArg) { + this.objectMap = setterArg; + return this; + } + + private @Nullable Map> listMap; + + @CanIgnoreReturnValue + public @NonNull Builder setListMap(@NonNull Map> setterArg) { + this.listMap = setterArg; + return this; + } + + private @Nullable Map> mapMap; + + @CanIgnoreReturnValue + public @NonNull Builder setMapMap(@NonNull Map> setterArg) { + this.mapMap = setterArg; + return this; + } + public @NonNull AllTypes build() { AllTypes pigeonReturn = new AllTypes(); pigeonReturn.setABool(aBool); @@ -561,14 +852,24 @@ public static final class Builder { pigeonReturn.setIntList(intList); pigeonReturn.setDoubleList(doubleList); pigeonReturn.setBoolList(boolList); + pigeonReturn.setEnumList(enumList); + pigeonReturn.setObjectList(objectList); + pigeonReturn.setListList(listList); + pigeonReturn.setMapList(mapList); pigeonReturn.setMap(map); + pigeonReturn.setStringMap(stringMap); + pigeonReturn.setIntMap(intMap); + pigeonReturn.setEnumMap(enumMap); + pigeonReturn.setObjectMap(objectMap); + pigeonReturn.setListMap(listMap); + pigeonReturn.setMapMap(mapMap); return pigeonReturn; } } @NonNull ArrayList toList() { - ArrayList toListResult = new ArrayList<>(18); + ArrayList toListResult = new ArrayList<>(28); toListResult.add(aBool); toListResult.add(anInt); toListResult.add(anInt64); @@ -586,7 +887,17 @@ ArrayList toList() { toListResult.add(intList); toListResult.add(doubleList); toListResult.add(boolList); + toListResult.add(enumList); + toListResult.add(objectList); + toListResult.add(listList); + toListResult.add(mapList); toListResult.add(map); + toListResult.add(stringMap); + toListResult.add(intMap); + toListResult.add(enumMap); + toListResult.add(objectMap); + toListResult.add(listMap); + toListResult.add(mapMap); return toListResult; } @@ -595,13 +906,9 @@ ArrayList toList() { Object aBool = pigeonVar_list.get(0); pigeonResult.setABool((Boolean) aBool); Object anInt = pigeonVar_list.get(1); - pigeonResult.setAnInt( - (anInt == null) ? null : ((anInt instanceof Integer) ? (Integer) anInt : (Long) anInt)); + pigeonResult.setAnInt((Long) anInt); Object anInt64 = pigeonVar_list.get(2); - pigeonResult.setAnInt64( - (anInt64 == null) - ? null - : ((anInt64 instanceof Integer) ? (Integer) anInt64 : (Long) anInt64)); + pigeonResult.setAnInt64((Long) anInt64); Object aDouble = pigeonVar_list.get(3); pigeonResult.setADouble((Double) aDouble); Object aByteArray = pigeonVar_list.get(4); @@ -630,8 +937,28 @@ ArrayList toList() { pigeonResult.setDoubleList((List) doubleList); Object boolList = pigeonVar_list.get(16); pigeonResult.setBoolList((List) boolList); - Object map = pigeonVar_list.get(17); + Object enumList = pigeonVar_list.get(17); + pigeonResult.setEnumList((List) enumList); + Object objectList = pigeonVar_list.get(18); + pigeonResult.setObjectList((List) objectList); + Object listList = pigeonVar_list.get(19); + pigeonResult.setListList((List>) listList); + Object mapList = pigeonVar_list.get(20); + pigeonResult.setMapList((List>) mapList); + Object map = pigeonVar_list.get(21); pigeonResult.setMap((Map) map); + Object stringMap = pigeonVar_list.get(22); + pigeonResult.setStringMap((Map) stringMap); + Object intMap = pigeonVar_list.get(23); + pigeonResult.setIntMap((Map) intMap); + Object enumMap = pigeonVar_list.get(24); + pigeonResult.setEnumMap((Map) enumMap); + Object objectMap = pigeonVar_list.get(25); + pigeonResult.setObjectMap((Map) objectMap); + Object listMap = pigeonVar_list.get(26); + pigeonResult.setListMap((Map>) listMap); + Object mapMap = pigeonVar_list.get(27); + pigeonResult.setMapMap((Map>) mapMap); return pigeonResult; } } @@ -722,36 +1049,6 @@ public void setANullableFloatArray(@Nullable double[] setterArg) { this.aNullableFloatArray = setterArg; } - private @Nullable List> nullableNestedList; - - public @Nullable List> getNullableNestedList() { - return nullableNestedList; - } - - public void setNullableNestedList(@Nullable List> setterArg) { - this.nullableNestedList = setterArg; - } - - private @Nullable Map nullableMapWithAnnotations; - - public @Nullable Map getNullableMapWithAnnotations() { - return nullableMapWithAnnotations; - } - - public void setNullableMapWithAnnotations(@Nullable Map setterArg) { - this.nullableMapWithAnnotations = setterArg; - } - - private @Nullable Map nullableMapWithObject; - - public @Nullable Map getNullableMapWithObject() { - return nullableMapWithObject; - } - - public void setNullableMapWithObject(@Nullable Map setterArg) { - this.nullableMapWithObject = setterArg; - } - private @Nullable AnEnum aNullableEnum; public @Nullable AnEnum getANullableEnum() { @@ -852,14 +1149,54 @@ public void setBoolList(@Nullable List setterArg) { this.boolList = setterArg; } - private @Nullable List nestedClassList; + private @Nullable List enumList; + + public @Nullable List getEnumList() { + return enumList; + } + + public void setEnumList(@Nullable List setterArg) { + this.enumList = setterArg; + } + + private @Nullable List objectList; + + public @Nullable List getObjectList() { + return objectList; + } + + public void setObjectList(@Nullable List setterArg) { + this.objectList = setterArg; + } + + private @Nullable List> listList; + + public @Nullable List> getListList() { + return listList; + } + + public void setListList(@Nullable List> setterArg) { + this.listList = setterArg; + } + + private @Nullable List> mapList; + + public @Nullable List> getMapList() { + return mapList; + } + + public void setMapList(@Nullable List> setterArg) { + this.mapList = setterArg; + } + + private @Nullable List recursiveClassList; - public @Nullable List getNestedClassList() { - return nestedClassList; + public @Nullable List getRecursiveClassList() { + return recursiveClassList; } - public void setNestedClassList(@Nullable List setterArg) { - this.nestedClassList = setterArg; + public void setRecursiveClassList(@Nullable List setterArg) { + this.recursiveClassList = setterArg; } private @Nullable Map map; @@ -872,6 +1209,76 @@ public void setMap(@Nullable Map setterArg) { this.map = setterArg; } + private @Nullable Map stringMap; + + public @Nullable Map getStringMap() { + return stringMap; + } + + public void setStringMap(@Nullable Map setterArg) { + this.stringMap = setterArg; + } + + private @Nullable Map intMap; + + public @Nullable Map getIntMap() { + return intMap; + } + + public void setIntMap(@Nullable Map setterArg) { + this.intMap = setterArg; + } + + private @Nullable Map enumMap; + + public @Nullable Map getEnumMap() { + return enumMap; + } + + public void setEnumMap(@Nullable Map setterArg) { + this.enumMap = setterArg; + } + + private @Nullable Map objectMap; + + public @Nullable Map getObjectMap() { + return objectMap; + } + + public void setObjectMap(@Nullable Map setterArg) { + this.objectMap = setterArg; + } + + private @Nullable Map> listMap; + + public @Nullable Map> getListMap() { + return listMap; + } + + public void setListMap(@Nullable Map> setterArg) { + this.listMap = setterArg; + } + + private @Nullable Map> mapMap; + + public @Nullable Map> getMapMap() { + return mapMap; + } + + public void setMapMap(@Nullable Map> setterArg) { + this.mapMap = setterArg; + } + + private @Nullable Map recursiveClassMap; + + public @Nullable Map getRecursiveClassMap() { + return recursiveClassMap; + } + + public void setRecursiveClassMap(@Nullable Map setterArg) { + this.recursiveClassMap = setterArg; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -889,9 +1296,6 @@ public boolean equals(Object o) { && Arrays.equals(aNullable4ByteArray, that.aNullable4ByteArray) && Arrays.equals(aNullable8ByteArray, that.aNullable8ByteArray) && Arrays.equals(aNullableFloatArray, that.aNullableFloatArray) - && Objects.equals(nullableNestedList, that.nullableNestedList) - && Objects.equals(nullableMapWithAnnotations, that.nullableMapWithAnnotations) - && Objects.equals(nullableMapWithObject, that.nullableMapWithObject) && Objects.equals(aNullableEnum, that.aNullableEnum) && Objects.equals(anotherNullableEnum, that.anotherNullableEnum) && Objects.equals(aNullableString, that.aNullableString) @@ -902,8 +1306,19 @@ public boolean equals(Object o) { && Objects.equals(intList, that.intList) && Objects.equals(doubleList, that.doubleList) && Objects.equals(boolList, that.boolList) - && Objects.equals(nestedClassList, that.nestedClassList) - && Objects.equals(map, that.map); + && Objects.equals(enumList, that.enumList) + && Objects.equals(objectList, that.objectList) + && Objects.equals(listList, that.listList) + && Objects.equals(mapList, that.mapList) + && Objects.equals(recursiveClassList, that.recursiveClassList) + && Objects.equals(map, that.map) + && Objects.equals(stringMap, that.stringMap) + && Objects.equals(intMap, that.intMap) + && Objects.equals(enumMap, that.enumMap) + && Objects.equals(objectMap, that.objectMap) + && Objects.equals(listMap, that.listMap) + && Objects.equals(mapMap, that.mapMap) + && Objects.equals(recursiveClassMap, that.recursiveClassMap); } @Override @@ -914,9 +1329,6 @@ public int hashCode() { aNullableInt, aNullableInt64, aNullableDouble, - nullableNestedList, - nullableMapWithAnnotations, - nullableMapWithObject, aNullableEnum, anotherNullableEnum, aNullableString, @@ -927,8 +1339,19 @@ public int hashCode() { intList, doubleList, boolList, - nestedClassList, - map); + enumList, + objectList, + listList, + mapList, + recursiveClassList, + map, + stringMap, + intMap, + enumMap, + objectMap, + listMap, + mapMap, + recursiveClassMap); pigeonVar_result = 31 * pigeonVar_result + Arrays.hashCode(aNullableByteArray); pigeonVar_result = 31 * pigeonVar_result + Arrays.hashCode(aNullable4ByteArray); pigeonVar_result = 31 * pigeonVar_result + Arrays.hashCode(aNullable8ByteArray); @@ -1002,31 +1425,6 @@ public static final class Builder { return this; } - private @Nullable List> nullableNestedList; - - @CanIgnoreReturnValue - public @NonNull Builder setNullableNestedList(@Nullable List> setterArg) { - this.nullableNestedList = setterArg; - return this; - } - - private @Nullable Map nullableMapWithAnnotations; - - @CanIgnoreReturnValue - public @NonNull Builder setNullableMapWithAnnotations( - @Nullable Map setterArg) { - this.nullableMapWithAnnotations = setterArg; - return this; - } - - private @Nullable Map nullableMapWithObject; - - @CanIgnoreReturnValue - public @NonNull Builder setNullableMapWithObject(@Nullable Map setterArg) { - this.nullableMapWithObject = setterArg; - return this; - } - private @Nullable AnEnum aNullableEnum; @CanIgnoreReturnValue @@ -1107,35 +1505,121 @@ public static final class Builder { return this; } - private @Nullable List nestedClassList; + private @Nullable List enumList; @CanIgnoreReturnValue - public @NonNull Builder setNestedClassList(@Nullable List setterArg) { - this.nestedClassList = setterArg; + public @NonNull Builder setEnumList(@Nullable List setterArg) { + this.enumList = setterArg; return this; } - private @Nullable Map map; + private @Nullable List objectList; @CanIgnoreReturnValue - public @NonNull Builder setMap(@Nullable Map setterArg) { - this.map = setterArg; + public @NonNull Builder setObjectList(@Nullable List setterArg) { + this.objectList = setterArg; return this; } - public @NonNull AllNullableTypes build() { - AllNullableTypes pigeonReturn = new AllNullableTypes(); - pigeonReturn.setANullableBool(aNullableBool); - pigeonReturn.setANullableInt(aNullableInt); - pigeonReturn.setANullableInt64(aNullableInt64); - pigeonReturn.setANullableDouble(aNullableDouble); - pigeonReturn.setANullableByteArray(aNullableByteArray); - pigeonReturn.setANullable4ByteArray(aNullable4ByteArray); + private @Nullable List> listList; + + @CanIgnoreReturnValue + public @NonNull Builder setListList(@Nullable List> setterArg) { + this.listList = setterArg; + return this; + } + + private @Nullable List> mapList; + + @CanIgnoreReturnValue + public @NonNull Builder setMapList(@Nullable List> setterArg) { + this.mapList = setterArg; + return this; + } + + private @Nullable List recursiveClassList; + + @CanIgnoreReturnValue + public @NonNull Builder setRecursiveClassList(@Nullable List setterArg) { + this.recursiveClassList = setterArg; + return this; + } + + private @Nullable Map map; + + @CanIgnoreReturnValue + public @NonNull Builder setMap(@Nullable Map setterArg) { + this.map = setterArg; + return this; + } + + private @Nullable Map stringMap; + + @CanIgnoreReturnValue + public @NonNull Builder setStringMap(@Nullable Map setterArg) { + this.stringMap = setterArg; + return this; + } + + private @Nullable Map intMap; + + @CanIgnoreReturnValue + public @NonNull Builder setIntMap(@Nullable Map setterArg) { + this.intMap = setterArg; + return this; + } + + private @Nullable Map enumMap; + + @CanIgnoreReturnValue + public @NonNull Builder setEnumMap(@Nullable Map setterArg) { + this.enumMap = setterArg; + return this; + } + + private @Nullable Map objectMap; + + @CanIgnoreReturnValue + public @NonNull Builder setObjectMap(@Nullable Map setterArg) { + this.objectMap = setterArg; + return this; + } + + private @Nullable Map> listMap; + + @CanIgnoreReturnValue + public @NonNull Builder setListMap(@Nullable Map> setterArg) { + this.listMap = setterArg; + return this; + } + + private @Nullable Map> mapMap; + + @CanIgnoreReturnValue + public @NonNull Builder setMapMap(@Nullable Map> setterArg) { + this.mapMap = setterArg; + return this; + } + + private @Nullable Map recursiveClassMap; + + @CanIgnoreReturnValue + public @NonNull Builder setRecursiveClassMap( + @Nullable Map setterArg) { + this.recursiveClassMap = setterArg; + return this; + } + + public @NonNull AllNullableTypes build() { + AllNullableTypes pigeonReturn = new AllNullableTypes(); + pigeonReturn.setANullableBool(aNullableBool); + pigeonReturn.setANullableInt(aNullableInt); + pigeonReturn.setANullableInt64(aNullableInt64); + pigeonReturn.setANullableDouble(aNullableDouble); + pigeonReturn.setANullableByteArray(aNullableByteArray); + pigeonReturn.setANullable4ByteArray(aNullable4ByteArray); pigeonReturn.setANullable8ByteArray(aNullable8ByteArray); pigeonReturn.setANullableFloatArray(aNullableFloatArray); - pigeonReturn.setNullableNestedList(nullableNestedList); - pigeonReturn.setNullableMapWithAnnotations(nullableMapWithAnnotations); - pigeonReturn.setNullableMapWithObject(nullableMapWithObject); pigeonReturn.setANullableEnum(aNullableEnum); pigeonReturn.setAnotherNullableEnum(anotherNullableEnum); pigeonReturn.setANullableString(aNullableString); @@ -1146,15 +1630,26 @@ public static final class Builder { pigeonReturn.setIntList(intList); pigeonReturn.setDoubleList(doubleList); pigeonReturn.setBoolList(boolList); - pigeonReturn.setNestedClassList(nestedClassList); + pigeonReturn.setEnumList(enumList); + pigeonReturn.setObjectList(objectList); + pigeonReturn.setListList(listList); + pigeonReturn.setMapList(mapList); + pigeonReturn.setRecursiveClassList(recursiveClassList); pigeonReturn.setMap(map); + pigeonReturn.setStringMap(stringMap); + pigeonReturn.setIntMap(intMap); + pigeonReturn.setEnumMap(enumMap); + pigeonReturn.setObjectMap(objectMap); + pigeonReturn.setListMap(listMap); + pigeonReturn.setMapMap(mapMap); + pigeonReturn.setRecursiveClassMap(recursiveClassMap); return pigeonReturn; } } @NonNull ArrayList toList() { - ArrayList toListResult = new ArrayList<>(23); + ArrayList toListResult = new ArrayList<>(31); toListResult.add(aNullableBool); toListResult.add(aNullableInt); toListResult.add(aNullableInt64); @@ -1163,9 +1658,6 @@ ArrayList toList() { toListResult.add(aNullable4ByteArray); toListResult.add(aNullable8ByteArray); toListResult.add(aNullableFloatArray); - toListResult.add(nullableNestedList); - toListResult.add(nullableMapWithAnnotations); - toListResult.add(nullableMapWithObject); toListResult.add(aNullableEnum); toListResult.add(anotherNullableEnum); toListResult.add(aNullableString); @@ -1176,8 +1668,19 @@ ArrayList toList() { toListResult.add(intList); toListResult.add(doubleList); toListResult.add(boolList); - toListResult.add(nestedClassList); + toListResult.add(enumList); + toListResult.add(objectList); + toListResult.add(listList); + toListResult.add(mapList); + toListResult.add(recursiveClassList); toListResult.add(map); + toListResult.add(stringMap); + toListResult.add(intMap); + toListResult.add(enumMap); + toListResult.add(objectMap); + toListResult.add(listMap); + toListResult.add(mapMap); + toListResult.add(recursiveClassMap); return toListResult; } @@ -1186,17 +1689,9 @@ ArrayList toList() { Object aNullableBool = pigeonVar_list.get(0); pigeonResult.setANullableBool((Boolean) aNullableBool); Object aNullableInt = pigeonVar_list.get(1); - pigeonResult.setANullableInt( - (aNullableInt == null) - ? null - : ((aNullableInt instanceof Integer) ? (Integer) aNullableInt : (Long) aNullableInt)); + pigeonResult.setANullableInt((Long) aNullableInt); Object aNullableInt64 = pigeonVar_list.get(2); - pigeonResult.setANullableInt64( - (aNullableInt64 == null) - ? null - : ((aNullableInt64 instanceof Integer) - ? (Integer) aNullableInt64 - : (Long) aNullableInt64)); + pigeonResult.setANullableInt64((Long) aNullableInt64); Object aNullableDouble = pigeonVar_list.get(3); pigeonResult.setANullableDouble((Double) aNullableDouble); Object aNullableByteArray = pigeonVar_list.get(4); @@ -1207,36 +1702,52 @@ ArrayList toList() { pigeonResult.setANullable8ByteArray((long[]) aNullable8ByteArray); Object aNullableFloatArray = pigeonVar_list.get(7); pigeonResult.setANullableFloatArray((double[]) aNullableFloatArray); - Object nullableNestedList = pigeonVar_list.get(8); - pigeonResult.setNullableNestedList((List>) nullableNestedList); - Object nullableMapWithAnnotations = pigeonVar_list.get(9); - pigeonResult.setNullableMapWithAnnotations((Map) nullableMapWithAnnotations); - Object nullableMapWithObject = pigeonVar_list.get(10); - pigeonResult.setNullableMapWithObject((Map) nullableMapWithObject); - Object aNullableEnum = pigeonVar_list.get(11); + Object aNullableEnum = pigeonVar_list.get(8); pigeonResult.setANullableEnum((AnEnum) aNullableEnum); - Object anotherNullableEnum = pigeonVar_list.get(12); + Object anotherNullableEnum = pigeonVar_list.get(9); pigeonResult.setAnotherNullableEnum((AnotherEnum) anotherNullableEnum); - Object aNullableString = pigeonVar_list.get(13); + Object aNullableString = pigeonVar_list.get(10); pigeonResult.setANullableString((String) aNullableString); - Object aNullableObject = pigeonVar_list.get(14); + Object aNullableObject = pigeonVar_list.get(11); pigeonResult.setANullableObject(aNullableObject); - Object allNullableTypes = pigeonVar_list.get(15); + Object allNullableTypes = pigeonVar_list.get(12); pigeonResult.setAllNullableTypes((AllNullableTypes) allNullableTypes); - Object list = pigeonVar_list.get(16); + Object list = pigeonVar_list.get(13); pigeonResult.setList((List) list); - Object stringList = pigeonVar_list.get(17); + Object stringList = pigeonVar_list.get(14); pigeonResult.setStringList((List) stringList); - Object intList = pigeonVar_list.get(18); + Object intList = pigeonVar_list.get(15); pigeonResult.setIntList((List) intList); - Object doubleList = pigeonVar_list.get(19); + Object doubleList = pigeonVar_list.get(16); pigeonResult.setDoubleList((List) doubleList); - Object boolList = pigeonVar_list.get(20); + Object boolList = pigeonVar_list.get(17); pigeonResult.setBoolList((List) boolList); - Object nestedClassList = pigeonVar_list.get(21); - pigeonResult.setNestedClassList((List) nestedClassList); - Object map = pigeonVar_list.get(22); + Object enumList = pigeonVar_list.get(18); + pigeonResult.setEnumList((List) enumList); + Object objectList = pigeonVar_list.get(19); + pigeonResult.setObjectList((List) objectList); + Object listList = pigeonVar_list.get(20); + pigeonResult.setListList((List>) listList); + Object mapList = pigeonVar_list.get(21); + pigeonResult.setMapList((List>) mapList); + Object recursiveClassList = pigeonVar_list.get(22); + pigeonResult.setRecursiveClassList((List) recursiveClassList); + Object map = pigeonVar_list.get(23); pigeonResult.setMap((Map) map); + Object stringMap = pigeonVar_list.get(24); + pigeonResult.setStringMap((Map) stringMap); + Object intMap = pigeonVar_list.get(25); + pigeonResult.setIntMap((Map) intMap); + Object enumMap = pigeonVar_list.get(26); + pigeonResult.setEnumMap((Map) enumMap); + Object objectMap = pigeonVar_list.get(27); + pigeonResult.setObjectMap((Map) objectMap); + Object listMap = pigeonVar_list.get(28); + pigeonResult.setListMap((Map>) listMap); + Object mapMap = pigeonVar_list.get(29); + pigeonResult.setMapMap((Map>) mapMap); + Object recursiveClassMap = pigeonVar_list.get(30); + pigeonResult.setRecursiveClassMap((Map) recursiveClassMap); return pigeonResult; } } @@ -1328,36 +1839,6 @@ public void setANullableFloatArray(@Nullable double[] setterArg) { this.aNullableFloatArray = setterArg; } - private @Nullable List> nullableNestedList; - - public @Nullable List> getNullableNestedList() { - return nullableNestedList; - } - - public void setNullableNestedList(@Nullable List> setterArg) { - this.nullableNestedList = setterArg; - } - - private @Nullable Map nullableMapWithAnnotations; - - public @Nullable Map getNullableMapWithAnnotations() { - return nullableMapWithAnnotations; - } - - public void setNullableMapWithAnnotations(@Nullable Map setterArg) { - this.nullableMapWithAnnotations = setterArg; - } - - private @Nullable Map nullableMapWithObject; - - public @Nullable Map getNullableMapWithObject() { - return nullableMapWithObject; - } - - public void setNullableMapWithObject(@Nullable Map setterArg) { - this.nullableMapWithObject = setterArg; - } - private @Nullable AnEnum aNullableEnum; public @Nullable AnEnum getANullableEnum() { @@ -1448,6 +1929,46 @@ public void setBoolList(@Nullable List setterArg) { this.boolList = setterArg; } + private @Nullable List enumList; + + public @Nullable List getEnumList() { + return enumList; + } + + public void setEnumList(@Nullable List setterArg) { + this.enumList = setterArg; + } + + private @Nullable List objectList; + + public @Nullable List getObjectList() { + return objectList; + } + + public void setObjectList(@Nullable List setterArg) { + this.objectList = setterArg; + } + + private @Nullable List> listList; + + public @Nullable List> getListList() { + return listList; + } + + public void setListList(@Nullable List> setterArg) { + this.listList = setterArg; + } + + private @Nullable List> mapList; + + public @Nullable List> getMapList() { + return mapList; + } + + public void setMapList(@Nullable List> setterArg) { + this.mapList = setterArg; + } + private @Nullable Map map; public @Nullable Map getMap() { @@ -1458,6 +1979,66 @@ public void setMap(@Nullable Map setterArg) { this.map = setterArg; } + private @Nullable Map stringMap; + + public @Nullable Map getStringMap() { + return stringMap; + } + + public void setStringMap(@Nullable Map setterArg) { + this.stringMap = setterArg; + } + + private @Nullable Map intMap; + + public @Nullable Map getIntMap() { + return intMap; + } + + public void setIntMap(@Nullable Map setterArg) { + this.intMap = setterArg; + } + + private @Nullable Map enumMap; + + public @Nullable Map getEnumMap() { + return enumMap; + } + + public void setEnumMap(@Nullable Map setterArg) { + this.enumMap = setterArg; + } + + private @Nullable Map objectMap; + + public @Nullable Map getObjectMap() { + return objectMap; + } + + public void setObjectMap(@Nullable Map setterArg) { + this.objectMap = setterArg; + } + + private @Nullable Map> listMap; + + public @Nullable Map> getListMap() { + return listMap; + } + + public void setListMap(@Nullable Map> setterArg) { + this.listMap = setterArg; + } + + private @Nullable Map> mapMap; + + public @Nullable Map> getMapMap() { + return mapMap; + } + + public void setMapMap(@Nullable Map> setterArg) { + this.mapMap = setterArg; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -1475,9 +2056,6 @@ public boolean equals(Object o) { && Arrays.equals(aNullable4ByteArray, that.aNullable4ByteArray) && Arrays.equals(aNullable8ByteArray, that.aNullable8ByteArray) && Arrays.equals(aNullableFloatArray, that.aNullableFloatArray) - && Objects.equals(nullableNestedList, that.nullableNestedList) - && Objects.equals(nullableMapWithAnnotations, that.nullableMapWithAnnotations) - && Objects.equals(nullableMapWithObject, that.nullableMapWithObject) && Objects.equals(aNullableEnum, that.aNullableEnum) && Objects.equals(anotherNullableEnum, that.anotherNullableEnum) && Objects.equals(aNullableString, that.aNullableString) @@ -1487,7 +2065,17 @@ public boolean equals(Object o) { && Objects.equals(intList, that.intList) && Objects.equals(doubleList, that.doubleList) && Objects.equals(boolList, that.boolList) - && Objects.equals(map, that.map); + && Objects.equals(enumList, that.enumList) + && Objects.equals(objectList, that.objectList) + && Objects.equals(listList, that.listList) + && Objects.equals(mapList, that.mapList) + && Objects.equals(map, that.map) + && Objects.equals(stringMap, that.stringMap) + && Objects.equals(intMap, that.intMap) + && Objects.equals(enumMap, that.enumMap) + && Objects.equals(objectMap, that.objectMap) + && Objects.equals(listMap, that.listMap) + && Objects.equals(mapMap, that.mapMap); } @Override @@ -1498,9 +2086,6 @@ public int hashCode() { aNullableInt, aNullableInt64, aNullableDouble, - nullableNestedList, - nullableMapWithAnnotations, - nullableMapWithObject, aNullableEnum, anotherNullableEnum, aNullableString, @@ -1510,7 +2095,17 @@ public int hashCode() { intList, doubleList, boolList, - map); + enumList, + objectList, + listList, + mapList, + map, + stringMap, + intMap, + enumMap, + objectMap, + listMap, + mapMap); pigeonVar_result = 31 * pigeonVar_result + Arrays.hashCode(aNullableByteArray); pigeonVar_result = 31 * pigeonVar_result + Arrays.hashCode(aNullable4ByteArray); pigeonVar_result = 31 * pigeonVar_result + Arrays.hashCode(aNullable8ByteArray); @@ -1584,31 +2179,6 @@ public static final class Builder { return this; } - private @Nullable List> nullableNestedList; - - @CanIgnoreReturnValue - public @NonNull Builder setNullableNestedList(@Nullable List> setterArg) { - this.nullableNestedList = setterArg; - return this; - } - - private @Nullable Map nullableMapWithAnnotations; - - @CanIgnoreReturnValue - public @NonNull Builder setNullableMapWithAnnotations( - @Nullable Map setterArg) { - this.nullableMapWithAnnotations = setterArg; - return this; - } - - private @Nullable Map nullableMapWithObject; - - @CanIgnoreReturnValue - public @NonNull Builder setNullableMapWithObject(@Nullable Map setterArg) { - this.nullableMapWithObject = setterArg; - return this; - } - private @Nullable AnEnum aNullableEnum; @CanIgnoreReturnValue @@ -1681,6 +2251,38 @@ public static final class Builder { return this; } + private @Nullable List enumList; + + @CanIgnoreReturnValue + public @NonNull Builder setEnumList(@Nullable List setterArg) { + this.enumList = setterArg; + return this; + } + + private @Nullable List objectList; + + @CanIgnoreReturnValue + public @NonNull Builder setObjectList(@Nullable List setterArg) { + this.objectList = setterArg; + return this; + } + + private @Nullable List> listList; + + @CanIgnoreReturnValue + public @NonNull Builder setListList(@Nullable List> setterArg) { + this.listList = setterArg; + return this; + } + + private @Nullable List> mapList; + + @CanIgnoreReturnValue + public @NonNull Builder setMapList(@Nullable List> setterArg) { + this.mapList = setterArg; + return this; + } + private @Nullable Map map; @CanIgnoreReturnValue @@ -1689,6 +2291,54 @@ public static final class Builder { return this; } + private @Nullable Map stringMap; + + @CanIgnoreReturnValue + public @NonNull Builder setStringMap(@Nullable Map setterArg) { + this.stringMap = setterArg; + return this; + } + + private @Nullable Map intMap; + + @CanIgnoreReturnValue + public @NonNull Builder setIntMap(@Nullable Map setterArg) { + this.intMap = setterArg; + return this; + } + + private @Nullable Map enumMap; + + @CanIgnoreReturnValue + public @NonNull Builder setEnumMap(@Nullable Map setterArg) { + this.enumMap = setterArg; + return this; + } + + private @Nullable Map objectMap; + + @CanIgnoreReturnValue + public @NonNull Builder setObjectMap(@Nullable Map setterArg) { + this.objectMap = setterArg; + return this; + } + + private @Nullable Map> listMap; + + @CanIgnoreReturnValue + public @NonNull Builder setListMap(@Nullable Map> setterArg) { + this.listMap = setterArg; + return this; + } + + private @Nullable Map> mapMap; + + @CanIgnoreReturnValue + public @NonNull Builder setMapMap(@Nullable Map> setterArg) { + this.mapMap = setterArg; + return this; + } + public @NonNull AllNullableTypesWithoutRecursion build() { AllNullableTypesWithoutRecursion pigeonReturn = new AllNullableTypesWithoutRecursion(); pigeonReturn.setANullableBool(aNullableBool); @@ -1699,9 +2349,6 @@ public static final class Builder { pigeonReturn.setANullable4ByteArray(aNullable4ByteArray); pigeonReturn.setANullable8ByteArray(aNullable8ByteArray); pigeonReturn.setANullableFloatArray(aNullableFloatArray); - pigeonReturn.setNullableNestedList(nullableNestedList); - pigeonReturn.setNullableMapWithAnnotations(nullableMapWithAnnotations); - pigeonReturn.setNullableMapWithObject(nullableMapWithObject); pigeonReturn.setANullableEnum(aNullableEnum); pigeonReturn.setAnotherNullableEnum(anotherNullableEnum); pigeonReturn.setANullableString(aNullableString); @@ -1711,14 +2358,24 @@ public static final class Builder { pigeonReturn.setIntList(intList); pigeonReturn.setDoubleList(doubleList); pigeonReturn.setBoolList(boolList); + pigeonReturn.setEnumList(enumList); + pigeonReturn.setObjectList(objectList); + pigeonReturn.setListList(listList); + pigeonReturn.setMapList(mapList); pigeonReturn.setMap(map); + pigeonReturn.setStringMap(stringMap); + pigeonReturn.setIntMap(intMap); + pigeonReturn.setEnumMap(enumMap); + pigeonReturn.setObjectMap(objectMap); + pigeonReturn.setListMap(listMap); + pigeonReturn.setMapMap(mapMap); return pigeonReturn; } } @NonNull ArrayList toList() { - ArrayList toListResult = new ArrayList<>(21); + ArrayList toListResult = new ArrayList<>(28); toListResult.add(aNullableBool); toListResult.add(aNullableInt); toListResult.add(aNullableInt64); @@ -1727,9 +2384,6 @@ ArrayList toList() { toListResult.add(aNullable4ByteArray); toListResult.add(aNullable8ByteArray); toListResult.add(aNullableFloatArray); - toListResult.add(nullableNestedList); - toListResult.add(nullableMapWithAnnotations); - toListResult.add(nullableMapWithObject); toListResult.add(aNullableEnum); toListResult.add(anotherNullableEnum); toListResult.add(aNullableString); @@ -1739,7 +2393,17 @@ ArrayList toList() { toListResult.add(intList); toListResult.add(doubleList); toListResult.add(boolList); + toListResult.add(enumList); + toListResult.add(objectList); + toListResult.add(listList); + toListResult.add(mapList); toListResult.add(map); + toListResult.add(stringMap); + toListResult.add(intMap); + toListResult.add(enumMap); + toListResult.add(objectMap); + toListResult.add(listMap); + toListResult.add(mapMap); return toListResult; } @@ -1749,17 +2413,9 @@ ArrayList toList() { Object aNullableBool = pigeonVar_list.get(0); pigeonResult.setANullableBool((Boolean) aNullableBool); Object aNullableInt = pigeonVar_list.get(1); - pigeonResult.setANullableInt( - (aNullableInt == null) - ? null - : ((aNullableInt instanceof Integer) ? (Integer) aNullableInt : (Long) aNullableInt)); + pigeonResult.setANullableInt((Long) aNullableInt); Object aNullableInt64 = pigeonVar_list.get(2); - pigeonResult.setANullableInt64( - (aNullableInt64 == null) - ? null - : ((aNullableInt64 instanceof Integer) - ? (Integer) aNullableInt64 - : (Long) aNullableInt64)); + pigeonResult.setANullableInt64((Long) aNullableInt64); Object aNullableDouble = pigeonVar_list.get(3); pigeonResult.setANullableDouble((Double) aNullableDouble); Object aNullableByteArray = pigeonVar_list.get(4); @@ -1770,32 +2426,46 @@ ArrayList toList() { pigeonResult.setANullable8ByteArray((long[]) aNullable8ByteArray); Object aNullableFloatArray = pigeonVar_list.get(7); pigeonResult.setANullableFloatArray((double[]) aNullableFloatArray); - Object nullableNestedList = pigeonVar_list.get(8); - pigeonResult.setNullableNestedList((List>) nullableNestedList); - Object nullableMapWithAnnotations = pigeonVar_list.get(9); - pigeonResult.setNullableMapWithAnnotations((Map) nullableMapWithAnnotations); - Object nullableMapWithObject = pigeonVar_list.get(10); - pigeonResult.setNullableMapWithObject((Map) nullableMapWithObject); - Object aNullableEnum = pigeonVar_list.get(11); + Object aNullableEnum = pigeonVar_list.get(8); pigeonResult.setANullableEnum((AnEnum) aNullableEnum); - Object anotherNullableEnum = pigeonVar_list.get(12); + Object anotherNullableEnum = pigeonVar_list.get(9); pigeonResult.setAnotherNullableEnum((AnotherEnum) anotherNullableEnum); - Object aNullableString = pigeonVar_list.get(13); + Object aNullableString = pigeonVar_list.get(10); pigeonResult.setANullableString((String) aNullableString); - Object aNullableObject = pigeonVar_list.get(14); + Object aNullableObject = pigeonVar_list.get(11); pigeonResult.setANullableObject(aNullableObject); - Object list = pigeonVar_list.get(15); + Object list = pigeonVar_list.get(12); pigeonResult.setList((List) list); - Object stringList = pigeonVar_list.get(16); + Object stringList = pigeonVar_list.get(13); pigeonResult.setStringList((List) stringList); - Object intList = pigeonVar_list.get(17); + Object intList = pigeonVar_list.get(14); pigeonResult.setIntList((List) intList); - Object doubleList = pigeonVar_list.get(18); + Object doubleList = pigeonVar_list.get(15); pigeonResult.setDoubleList((List) doubleList); - Object boolList = pigeonVar_list.get(19); + Object boolList = pigeonVar_list.get(16); pigeonResult.setBoolList((List) boolList); - Object map = pigeonVar_list.get(20); + Object enumList = pigeonVar_list.get(17); + pigeonResult.setEnumList((List) enumList); + Object objectList = pigeonVar_list.get(18); + pigeonResult.setObjectList((List) objectList); + Object listList = pigeonVar_list.get(19); + pigeonResult.setListList((List>) listList); + Object mapList = pigeonVar_list.get(20); + pigeonResult.setMapList((List>) mapList); + Object map = pigeonVar_list.get(21); pigeonResult.setMap((Map) map); + Object stringMap = pigeonVar_list.get(22); + pigeonResult.setStringMap((Map) stringMap); + Object intMap = pigeonVar_list.get(23); + pigeonResult.setIntMap((Map) intMap); + Object enumMap = pigeonVar_list.get(24); + pigeonResult.setEnumMap((Map) enumMap); + Object objectMap = pigeonVar_list.get(25); + pigeonResult.setObjectMap((Map) objectMap); + Object listMap = pigeonVar_list.get(26); + pigeonResult.setListMap((Map>) listMap); + Object mapMap = pigeonVar_list.get(27); + pigeonResult.setMapMap((Map>) mapMap); return pigeonResult; } } @@ -1844,6 +2514,53 @@ public void setAllTypes(@Nullable AllTypes setterArg) { this.allTypes = setterArg; } + private @NonNull List classList; + + public @NonNull List getClassList() { + return classList; + } + + public void setClassList(@NonNull List setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"classList\" is null."); + } + this.classList = setterArg; + } + + private @Nullable List nullableClassList; + + public @Nullable List getNullableClassList() { + return nullableClassList; + } + + public void setNullableClassList(@Nullable List setterArg) { + this.nullableClassList = setterArg; + } + + private @NonNull Map classMap; + + public @NonNull Map getClassMap() { + return classMap; + } + + public void setClassMap(@NonNull Map setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"classMap\" is null."); + } + this.classMap = setterArg; + } + + private @Nullable Map nullableClassMap; + + public @Nullable Map getNullableClassMap() { + return nullableClassMap; + } + + public void setNullableClassMap( + @Nullable Map setterArg) { + this.nullableClassMap = setterArg; + } + /** Constructor is non-public to enforce null safety; use Builder. */ AllClassesWrapper() {} @@ -1858,12 +2575,23 @@ public boolean equals(Object o) { AllClassesWrapper that = (AllClassesWrapper) o; return allNullableTypes.equals(that.allNullableTypes) && Objects.equals(allNullableTypesWithoutRecursion, that.allNullableTypesWithoutRecursion) - && Objects.equals(allTypes, that.allTypes); + && Objects.equals(allTypes, that.allTypes) + && classList.equals(that.classList) + && Objects.equals(nullableClassList, that.nullableClassList) + && classMap.equals(that.classMap) + && Objects.equals(nullableClassMap, that.nullableClassMap); } @Override public int hashCode() { - return Objects.hash(allNullableTypes, allNullableTypesWithoutRecursion, allTypes); + return Objects.hash( + allNullableTypes, + allNullableTypesWithoutRecursion, + allTypes, + classList, + nullableClassList, + classMap, + nullableClassMap); } public static final class Builder { @@ -1893,21 +2621,63 @@ public static final class Builder { return this; } + private @Nullable List classList; + + @CanIgnoreReturnValue + public @NonNull Builder setClassList(@NonNull List setterArg) { + this.classList = setterArg; + return this; + } + + private @Nullable List nullableClassList; + + @CanIgnoreReturnValue + public @NonNull Builder setNullableClassList( + @Nullable List setterArg) { + this.nullableClassList = setterArg; + return this; + } + + private @Nullable Map classMap; + + @CanIgnoreReturnValue + public @NonNull Builder setClassMap(@NonNull Map setterArg) { + this.classMap = setterArg; + return this; + } + + private @Nullable Map nullableClassMap; + + @CanIgnoreReturnValue + public @NonNull Builder setNullableClassMap( + @Nullable Map setterArg) { + this.nullableClassMap = setterArg; + return this; + } + public @NonNull AllClassesWrapper build() { AllClassesWrapper pigeonReturn = new AllClassesWrapper(); pigeonReturn.setAllNullableTypes(allNullableTypes); pigeonReturn.setAllNullableTypesWithoutRecursion(allNullableTypesWithoutRecursion); pigeonReturn.setAllTypes(allTypes); + pigeonReturn.setClassList(classList); + pigeonReturn.setNullableClassList(nullableClassList); + pigeonReturn.setClassMap(classMap); + pigeonReturn.setNullableClassMap(nullableClassMap); return pigeonReturn; } } @NonNull ArrayList toList() { - ArrayList toListResult = new ArrayList<>(3); + ArrayList toListResult = new ArrayList<>(7); toListResult.add(allNullableTypes); toListResult.add(allNullableTypesWithoutRecursion); toListResult.add(allTypes); + toListResult.add(classList); + toListResult.add(nullableClassList); + toListResult.add(classMap); + toListResult.add(nullableClassMap); return toListResult; } @@ -1920,6 +2690,15 @@ ArrayList toList() { (AllNullableTypesWithoutRecursion) allNullableTypesWithoutRecursion); Object allTypes = pigeonVar_list.get(2); pigeonResult.setAllTypes((AllTypes) allTypes); + Object classList = pigeonVar_list.get(3); + pigeonResult.setClassList((List) classList); + Object nullableClassList = pigeonVar_list.get(4); + pigeonResult.setNullableClassList((List) nullableClassList); + Object classMap = pigeonVar_list.get(5); + pigeonResult.setClassMap((Map) classMap); + Object nullableClassMap = pigeonVar_list.get(6); + pigeonResult.setNullableClassMap( + (Map) nullableClassMap); return pigeonResult; } } @@ -2000,22 +2779,24 @@ protected Object readValueOfType(byte type, @NonNull ByteBuffer buffer) { case (byte) 129: { Object value = readValue(buffer); - return value == null ? null : AnEnum.values()[(int) value]; + return value == null ? null : AnEnum.values()[((Long) value).intValue()]; } case (byte) 130: { Object value = readValue(buffer); - return value == null ? null : AnotherEnum.values()[(int) value]; + return value == null ? null : AnotherEnum.values()[((Long) value).intValue()]; } case (byte) 131: - return AllTypes.fromList((ArrayList) readValue(buffer)); + return UnusedClass.fromList((ArrayList) readValue(buffer)); case (byte) 132: - return AllNullableTypes.fromList((ArrayList) readValue(buffer)); + return AllTypes.fromList((ArrayList) readValue(buffer)); case (byte) 133: - return AllNullableTypesWithoutRecursion.fromList((ArrayList) readValue(buffer)); + return AllNullableTypes.fromList((ArrayList) readValue(buffer)); case (byte) 134: - return AllClassesWrapper.fromList((ArrayList) readValue(buffer)); + return AllNullableTypesWithoutRecursion.fromList((ArrayList) readValue(buffer)); case (byte) 135: + return AllClassesWrapper.fromList((ArrayList) readValue(buffer)); + case (byte) 136: return TestMessage.fromList((ArrayList) readValue(buffer)); default: return super.readValueOfType(type, buffer); @@ -2030,20 +2811,23 @@ protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { } else if (value instanceof AnotherEnum) { stream.write(130); writeValue(stream, value == null ? null : ((AnotherEnum) value).index); - } else if (value instanceof AllTypes) { + } else if (value instanceof UnusedClass) { stream.write(131); + writeValue(stream, ((UnusedClass) value).toList()); + } else if (value instanceof AllTypes) { + stream.write(132); writeValue(stream, ((AllTypes) value).toList()); } else if (value instanceof AllNullableTypes) { - stream.write(132); + stream.write(133); writeValue(stream, ((AllNullableTypes) value).toList()); } else if (value instanceof AllNullableTypesWithoutRecursion) { - stream.write(133); + stream.write(134); writeValue(stream, ((AllNullableTypesWithoutRecursion) value).toList()); } else if (value instanceof AllClassesWrapper) { - stream.write(134); + stream.write(135); writeValue(stream, ((AllClassesWrapper) value).toList()); } else if (value instanceof TestMessage) { - stream.write(135); + stream.write(136); writeValue(stream, ((TestMessage) value).toList()); } else { super.writeValue(stream, value); @@ -2118,10 +2902,46 @@ public interface HostIntegrationCoreApi { /** Returns the passed list, to test serialization and deserialization. */ @NonNull List echoList(@NonNull List list); + /** Returns the passed list, to test serialization and deserialization. */ + @NonNull + List echoEnumList(@NonNull List enumList); + /** Returns the passed list, to test serialization and deserialization. */ + @NonNull + List echoClassList(@NonNull List classList); + /** Returns the passed list, to test serialization and deserialization. */ + @NonNull + List echoNonNullEnumList(@NonNull List enumList); + /** Returns the passed list, to test serialization and deserialization. */ + @NonNull + List echoNonNullClassList(@NonNull List classList); + /** Returns the passed map, to test serialization and deserialization. */ + @NonNull + Map echoMap(@NonNull Map map); + /** Returns the passed map, to test serialization and deserialization. */ + @NonNull + Map echoStringMap(@NonNull Map stringMap); + /** Returns the passed map, to test serialization and deserialization. */ + @NonNull + Map echoIntMap(@NonNull Map intMap); + /** Returns the passed map, to test serialization and deserialization. */ + @NonNull + Map echoEnumMap(@NonNull Map enumMap); + /** Returns the passed map, to test serialization and deserialization. */ + @NonNull + Map echoClassMap(@NonNull Map classMap); + /** Returns the passed map, to test serialization and deserialization. */ + @NonNull + Map echoNonNullStringMap(@NonNull Map stringMap); + /** Returns the passed map, to test serialization and deserialization. */ + @NonNull + Map echoNonNullIntMap(@NonNull Map intMap); + /** Returns the passed map, to test serialization and deserialization. */ + @NonNull + Map echoNonNullEnumMap(@NonNull Map enumMap); /** Returns the passed map, to test serialization and deserialization. */ @NonNull - Map echoMap(@NonNull Map aMap); - /** Returns the passed map to test nested class serialization and deserialization. */ + Map echoNonNullClassMap(@NonNull Map classMap); + /** Returns the passed class to test nested class serialization and deserialization. */ @NonNull AllClassesWrapper echoClassWrapper(@NonNull AllClassesWrapper wrapper); /** Returns the passed enum to test serialization and deserialization. */ @@ -2189,9 +3009,47 @@ AllNullableTypesWithoutRecursion sendMultipleNullableTypesWithoutRecursion( /** Returns the passed list, to test serialization and deserialization. */ @Nullable List echoNullableList(@Nullable List aNullableList); + /** Returns the passed list, to test serialization and deserialization. */ + @Nullable + List echoNullableEnumList(@Nullable List enumList); + /** Returns the passed list, to test serialization and deserialization. */ + @Nullable + List echoNullableClassList(@Nullable List classList); + /** Returns the passed list, to test serialization and deserialization. */ + @Nullable + List echoNullableNonNullEnumList(@Nullable List enumList); + /** Returns the passed list, to test serialization and deserialization. */ + @Nullable + List echoNullableNonNullClassList(@Nullable List classList); + /** Returns the passed map, to test serialization and deserialization. */ + @Nullable + Map echoNullableMap(@Nullable Map map); + /** Returns the passed map, to test serialization and deserialization. */ + @Nullable + Map echoNullableStringMap(@Nullable Map stringMap); + /** Returns the passed map, to test serialization and deserialization. */ + @Nullable + Map echoNullableIntMap(@Nullable Map intMap); + /** Returns the passed map, to test serialization and deserialization. */ + @Nullable + Map echoNullableEnumMap(@Nullable Map enumMap); + /** Returns the passed map, to test serialization and deserialization. */ + @Nullable + Map echoNullableClassMap( + @Nullable Map classMap); + /** Returns the passed map, to test serialization and deserialization. */ + @Nullable + Map echoNullableNonNullStringMap(@Nullable Map stringMap); + /** Returns the passed map, to test serialization and deserialization. */ + @Nullable + Map echoNullableNonNullIntMap(@Nullable Map intMap); + /** Returns the passed map, to test serialization and deserialization. */ + @Nullable + Map echoNullableNonNullEnumMap(@Nullable Map enumMap); /** Returns the passed map, to test serialization and deserialization. */ @Nullable - Map echoNullableMap(@Nullable Map aNullableMap); + Map echoNullableNonNullClassMap( + @Nullable Map classMap); @Nullable AnEnum echoNullableEnum(@Nullable AnEnum anEnum); @@ -2223,9 +3081,26 @@ AllNullableTypesWithoutRecursion sendMultipleNullableTypesWithoutRecursion( void echoAsyncObject(@NonNull Object anObject, @NonNull Result result); /** Returns the passed list, to test asynchronous serialization and deserialization. */ void echoAsyncList(@NonNull List list, @NonNull Result> result); + /** Returns the passed list, to test asynchronous serialization and deserialization. */ + void echoAsyncEnumList(@NonNull List enumList, @NonNull Result> result); + /** Returns the passed list, to test asynchronous serialization and deserialization. */ + void echoAsyncClassList( + @NonNull List classList, @NonNull Result> result); /** Returns the passed map, to test asynchronous serialization and deserialization. */ void echoAsyncMap( - @NonNull Map aMap, @NonNull Result> result); + @NonNull Map map, @NonNull Result> result); + /** Returns the passed map, to test asynchronous serialization and deserialization. */ + void echoAsyncStringMap( + @NonNull Map stringMap, @NonNull Result> result); + /** Returns the passed map, to test asynchronous serialization and deserialization. */ + void echoAsyncIntMap(@NonNull Map intMap, @NonNull Result> result); + /** Returns the passed map, to test asynchronous serialization and deserialization. */ + void echoAsyncEnumMap( + @NonNull Map enumMap, @NonNull Result> result); + /** Returns the passed map, to test asynchronous serialization and deserialization. */ + void echoAsyncClassMap( + @NonNull Map classMap, + @NonNull Result> result); /** Returns the passed enum, to test asynchronous serialization and deserialization. */ void echoAsyncEnum(@NonNull AnEnum anEnum, @NonNull Result result); /** Returns the passed enum, to test asynchronous serialization and deserialization. */ @@ -2262,9 +3137,30 @@ void echoAsyncNullableUint8List( /** Returns the passed list, to test asynchronous serialization and deserialization. */ void echoAsyncNullableList( @Nullable List list, @NonNull NullableResult> result); + /** Returns the passed list, to test asynchronous serialization and deserialization. */ + void echoAsyncNullableEnumList( + @Nullable List enumList, @NonNull NullableResult> result); + /** Returns the passed list, to test asynchronous serialization and deserialization. */ + void echoAsyncNullableClassList( + @Nullable List classList, + @NonNull NullableResult> result); /** Returns the passed map, to test asynchronous serialization and deserialization. */ void echoAsyncNullableMap( - @Nullable Map aMap, @NonNull NullableResult> result); + @Nullable Map map, @NonNull NullableResult> result); + /** Returns the passed map, to test asynchronous serialization and deserialization. */ + void echoAsyncNullableStringMap( + @Nullable Map stringMap, + @NonNull NullableResult> result); + /** Returns the passed map, to test asynchronous serialization and deserialization. */ + void echoAsyncNullableIntMap( + @Nullable Map intMap, @NonNull NullableResult> result); + /** Returns the passed map, to test asynchronous serialization and deserialization. */ + void echoAsyncNullableEnumMap( + @Nullable Map enumMap, @NonNull NullableResult> result); + /** Returns the passed map, to test asynchronous serialization and deserialization. */ + void echoAsyncNullableClassMap( + @Nullable Map classMap, + @NonNull NullableResult> result); /** Returns the passed enum, to test asynchronous serialization and deserialization. */ void echoAsyncNullableEnum(@Nullable AnEnum anEnum, @NonNull NullableResult result); /** Returns the passed enum, to test asynchronous serialization and deserialization. */ @@ -2310,8 +3206,46 @@ void callFlutterSendMultipleNullableTypesWithoutRecursion( void callFlutterEchoList(@NonNull List list, @NonNull Result> result); + void callFlutterEchoEnumList( + @NonNull List enumList, @NonNull Result> result); + + void callFlutterEchoClassList( + @NonNull List classList, @NonNull Result> result); + + void callFlutterEchoNonNullEnumList( + @NonNull List enumList, @NonNull Result> result); + + void callFlutterEchoNonNullClassList( + @NonNull List classList, @NonNull Result> result); + void callFlutterEchoMap( - @NonNull Map aMap, @NonNull Result> result); + @NonNull Map map, @NonNull Result> result); + + void callFlutterEchoStringMap( + @NonNull Map stringMap, @NonNull Result> result); + + void callFlutterEchoIntMap( + @NonNull Map intMap, @NonNull Result> result); + + void callFlutterEchoEnumMap( + @NonNull Map enumMap, @NonNull Result> result); + + void callFlutterEchoClassMap( + @NonNull Map classMap, + @NonNull Result> result); + + void callFlutterEchoNonNullStringMap( + @NonNull Map stringMap, @NonNull Result> result); + + void callFlutterEchoNonNullIntMap( + @NonNull Map intMap, @NonNull Result> result); + + void callFlutterEchoNonNullEnumMap( + @NonNull Map enumMap, @NonNull Result> result); + + void callFlutterEchoNonNullClassMap( + @NonNull Map classMap, + @NonNull Result> result); void callFlutterEchoEnum(@NonNull AnEnum anEnum, @NonNull Result result); @@ -2335,8 +3269,50 @@ void callFlutterEchoNullableUint8List( void callFlutterEchoNullableList( @Nullable List list, @NonNull NullableResult> result); + void callFlutterEchoNullableEnumList( + @Nullable List enumList, @NonNull NullableResult> result); + + void callFlutterEchoNullableClassList( + @Nullable List classList, + @NonNull NullableResult> result); + + void callFlutterEchoNullableNonNullEnumList( + @Nullable List enumList, @NonNull NullableResult> result); + + void callFlutterEchoNullableNonNullClassList( + @Nullable List classList, + @NonNull NullableResult> result); + void callFlutterEchoNullableMap( - @Nullable Map aMap, @NonNull NullableResult> result); + @Nullable Map map, @NonNull NullableResult> result); + + void callFlutterEchoNullableStringMap( + @Nullable Map stringMap, + @NonNull NullableResult> result); + + void callFlutterEchoNullableIntMap( + @Nullable Map intMap, @NonNull NullableResult> result); + + void callFlutterEchoNullableEnumMap( + @Nullable Map enumMap, @NonNull NullableResult> result); + + void callFlutterEchoNullableClassMap( + @Nullable Map classMap, + @NonNull NullableResult> result); + + void callFlutterEchoNullableNonNullStringMap( + @Nullable Map stringMap, + @NonNull NullableResult> result); + + void callFlutterEchoNullableNonNullIntMap( + @Nullable Map intMap, @NonNull NullableResult> result); + + void callFlutterEchoNullableNonNullEnumMap( + @Nullable Map enumMap, @NonNull NullableResult> result); + + void callFlutterEchoNullableNonNullClassMap( + @Nullable Map classMap, + @NonNull NullableResult> result); void callFlutterEchoNullableEnum( @Nullable AnEnum anEnum, @NonNull NullableResult result); @@ -2493,9 +3469,9 @@ static void setUp( (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - Number anIntArg = (Number) args.get(0); + Long anIntArg = (Long) args.get(0); try { - Long output = api.echoInt((anIntArg == null) ? null : anIntArg.longValue()); + Long output = api.echoInt(anIntArg); wrapped.add(0, output); } catch (Throwable exception) { wrapped = wrapError(exception); @@ -2660,7 +3636,7 @@ static void setUp( BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoMap" + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoEnumList" + messageChannelSuffix, getCodec()); if (api != null) { @@ -2668,9 +3644,9 @@ static void setUp( (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - Map aMapArg = (Map) args.get(0); + List enumListArg = (List) args.get(0); try { - Map output = api.echoMap(aMapArg); + List output = api.echoEnumList(enumListArg); wrapped.add(0, output); } catch (Throwable exception) { wrapped = wrapError(exception); @@ -2685,7 +3661,7 @@ static void setUp( BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoClassWrapper" + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoClassList" + messageChannelSuffix, getCodec()); if (api != null) { @@ -2693,9 +3669,9 @@ static void setUp( (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - AllClassesWrapper wrapperArg = (AllClassesWrapper) args.get(0); + List classListArg = (List) args.get(0); try { - AllClassesWrapper output = api.echoClassWrapper(wrapperArg); + List output = api.echoClassList(classListArg); wrapped.add(0, output); } catch (Throwable exception) { wrapped = wrapError(exception); @@ -2710,7 +3686,7 @@ static void setUp( BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoEnum" + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNonNullEnumList" + messageChannelSuffix, getCodec()); if (api != null) { @@ -2718,9 +3694,9 @@ static void setUp( (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - AnEnum anEnumArg = (AnEnum) args.get(0); + List enumListArg = (List) args.get(0); try { - AnEnum output = api.echoEnum(anEnumArg); + List output = api.echoNonNullEnumList(enumListArg); wrapped.add(0, output); } catch (Throwable exception) { wrapped = wrapError(exception); @@ -2735,7 +3711,7 @@ static void setUp( BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAnotherEnum" + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNonNullClassList" + messageChannelSuffix, getCodec()); if (api != null) { @@ -2743,9 +3719,9 @@ static void setUp( (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - AnotherEnum anotherEnumArg = (AnotherEnum) args.get(0); + List classListArg = (List) args.get(0); try { - AnotherEnum output = api.echoAnotherEnum(anotherEnumArg); + List output = api.echoNonNullClassList(classListArg); wrapped.add(0, output); } catch (Throwable exception) { wrapped = wrapError(exception); @@ -2760,7 +3736,7 @@ static void setUp( BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNamedDefaultString" + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoMap" + messageChannelSuffix, getCodec()); if (api != null) { @@ -2768,9 +3744,9 @@ static void setUp( (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - String aStringArg = (String) args.get(0); + Map mapArg = (Map) args.get(0); try { - String output = api.echoNamedDefaultString(aStringArg); + Map output = api.echoMap(mapArg); wrapped.add(0, output); } catch (Throwable exception) { wrapped = wrapError(exception); @@ -2785,7 +3761,7 @@ static void setUp( BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoOptionalDefaultDouble" + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoStringMap" + messageChannelSuffix, getCodec()); if (api != null) { @@ -2793,9 +3769,9 @@ static void setUp( (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - Double aDoubleArg = (Double) args.get(0); + Map stringMapArg = (Map) args.get(0); try { - Double output = api.echoOptionalDefaultDouble(aDoubleArg); + Map output = api.echoStringMap(stringMapArg); wrapped.add(0, output); } catch (Throwable exception) { wrapped = wrapError(exception); @@ -2810,7 +3786,7 @@ static void setUp( BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoRequiredInt" + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoIntMap" + messageChannelSuffix, getCodec()); if (api != null) { @@ -2818,10 +3794,9 @@ static void setUp( (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - Number anIntArg = (Number) args.get(0); + Map intMapArg = (Map) args.get(0); try { - Long output = - api.echoRequiredInt((anIntArg == null) ? null : anIntArg.longValue()); + Map output = api.echoIntMap(intMapArg); wrapped.add(0, output); } catch (Throwable exception) { wrapped = wrapError(exception); @@ -2836,7 +3811,7 @@ static void setUp( BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllNullableTypes" + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoEnumMap" + messageChannelSuffix, getCodec()); if (api != null) { @@ -2844,9 +3819,9 @@ static void setUp( (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - AllNullableTypes everythingArg = (AllNullableTypes) args.get(0); + Map enumMapArg = (Map) args.get(0); try { - AllNullableTypes output = api.echoAllNullableTypes(everythingArg); + Map output = api.echoEnumMap(enumMapArg); wrapped.add(0, output); } catch (Throwable exception) { wrapped = wrapError(exception); @@ -2861,7 +3836,7 @@ static void setUp( BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllNullableTypesWithoutRecursion" + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoClassMap" + messageChannelSuffix, getCodec()); if (api != null) { @@ -2869,11 +3844,9 @@ static void setUp( (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - AllNullableTypesWithoutRecursion everythingArg = - (AllNullableTypesWithoutRecursion) args.get(0); + Map classMapArg = (Map) args.get(0); try { - AllNullableTypesWithoutRecursion output = - api.echoAllNullableTypesWithoutRecursion(everythingArg); + Map output = api.echoClassMap(classMapArg); wrapped.add(0, output); } catch (Throwable exception) { wrapped = wrapError(exception); @@ -2888,7 +3861,7 @@ static void setUp( BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.extractNestedNullableString" + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNonNullStringMap" + messageChannelSuffix, getCodec()); if (api != null) { @@ -2896,9 +3869,9 @@ static void setUp( (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - AllClassesWrapper wrapperArg = (AllClassesWrapper) args.get(0); + Map stringMapArg = (Map) args.get(0); try { - String output = api.extractNestedNullableString(wrapperArg); + Map output = api.echoNonNullStringMap(stringMapArg); wrapped.add(0, output); } catch (Throwable exception) { wrapped = wrapError(exception); @@ -2913,7 +3886,7 @@ static void setUp( BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.createNestedNullableString" + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNonNullIntMap" + messageChannelSuffix, getCodec()); if (api != null) { @@ -2921,9 +3894,9 @@ static void setUp( (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - String nullableStringArg = (String) args.get(0); + Map intMapArg = (Map) args.get(0); try { - AllClassesWrapper output = api.createNestedNullableString(nullableStringArg); + Map output = api.echoNonNullIntMap(intMapArg); wrapped.add(0, output); } catch (Throwable exception) { wrapped = wrapError(exception); @@ -2938,7 +3911,7 @@ static void setUp( BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.sendMultipleNullableTypes" + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNonNullEnumMap" + messageChannelSuffix, getCodec()); if (api != null) { @@ -2946,15 +3919,9 @@ static void setUp( (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - Boolean aNullableBoolArg = (Boolean) args.get(0); - Number aNullableIntArg = (Number) args.get(1); - String aNullableStringArg = (String) args.get(2); + Map enumMapArg = (Map) args.get(0); try { - AllNullableTypes output = - api.sendMultipleNullableTypes( - aNullableBoolArg, - (aNullableIntArg == null) ? null : aNullableIntArg.longValue(), - aNullableStringArg); + Map output = api.echoNonNullEnumMap(enumMapArg); wrapped.add(0, output); } catch (Throwable exception) { wrapped = wrapError(exception); @@ -2969,7 +3936,7 @@ static void setUp( BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion" + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNonNullClassMap" + messageChannelSuffix, getCodec()); if (api != null) { @@ -2977,15 +3944,9 @@ static void setUp( (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - Boolean aNullableBoolArg = (Boolean) args.get(0); - Number aNullableIntArg = (Number) args.get(1); - String aNullableStringArg = (String) args.get(2); + Map classMapArg = (Map) args.get(0); try { - AllNullableTypesWithoutRecursion output = - api.sendMultipleNullableTypesWithoutRecursion( - aNullableBoolArg, - (aNullableIntArg == null) ? null : aNullableIntArg.longValue(), - aNullableStringArg); + Map output = api.echoNonNullClassMap(classMapArg); wrapped.add(0, output); } catch (Throwable exception) { wrapped = wrapError(exception); @@ -3000,7 +3961,7 @@ static void setUp( BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableInt" + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoClassWrapper" + messageChannelSuffix, getCodec()); if (api != null) { @@ -3008,11 +3969,9 @@ static void setUp( (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - Number aNullableIntArg = (Number) args.get(0); + AllClassesWrapper wrapperArg = (AllClassesWrapper) args.get(0); try { - Long output = - api.echoNullableInt( - (aNullableIntArg == null) ? null : aNullableIntArg.longValue()); + AllClassesWrapper output = api.echoClassWrapper(wrapperArg); wrapped.add(0, output); } catch (Throwable exception) { wrapped = wrapError(exception); @@ -3027,7 +3986,7 @@ static void setUp( BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableDouble" + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoEnum" + messageChannelSuffix, getCodec()); if (api != null) { @@ -3035,9 +3994,9 @@ static void setUp( (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - Double aNullableDoubleArg = (Double) args.get(0); + AnEnum anEnumArg = (AnEnum) args.get(0); try { - Double output = api.echoNullableDouble(aNullableDoubleArg); + AnEnum output = api.echoEnum(anEnumArg); wrapped.add(0, output); } catch (Throwable exception) { wrapped = wrapError(exception); @@ -3052,7 +4011,7 @@ static void setUp( BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableBool" + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAnotherEnum" + messageChannelSuffix, getCodec()); if (api != null) { @@ -3060,9 +4019,9 @@ static void setUp( (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - Boolean aNullableBoolArg = (Boolean) args.get(0); + AnotherEnum anotherEnumArg = (AnotherEnum) args.get(0); try { - Boolean output = api.echoNullableBool(aNullableBoolArg); + AnotherEnum output = api.echoAnotherEnum(anotherEnumArg); wrapped.add(0, output); } catch (Throwable exception) { wrapped = wrapError(exception); @@ -3077,7 +4036,7 @@ static void setUp( BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableString" + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNamedDefaultString" + messageChannelSuffix, getCodec()); if (api != null) { @@ -3085,9 +4044,9 @@ static void setUp( (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - String aNullableStringArg = (String) args.get(0); + String aStringArg = (String) args.get(0); try { - String output = api.echoNullableString(aNullableStringArg); + String output = api.echoNamedDefaultString(aStringArg); wrapped.add(0, output); } catch (Throwable exception) { wrapped = wrapError(exception); @@ -3102,7 +4061,7 @@ static void setUp( BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableUint8List" + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoOptionalDefaultDouble" + messageChannelSuffix, getCodec()); if (api != null) { @@ -3110,9 +4069,9 @@ static void setUp( (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - byte[] aNullableUint8ListArg = (byte[]) args.get(0); + Double aDoubleArg = (Double) args.get(0); try { - byte[] output = api.echoNullableUint8List(aNullableUint8ListArg); + Double output = api.echoOptionalDefaultDouble(aDoubleArg); wrapped.add(0, output); } catch (Throwable exception) { wrapped = wrapError(exception); @@ -3127,7 +4086,7 @@ static void setUp( BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableObject" + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoRequiredInt" + messageChannelSuffix, getCodec()); if (api != null) { @@ -3135,9 +4094,9 @@ static void setUp( (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - Object aNullableObjectArg = args.get(0); + Long anIntArg = (Long) args.get(0); try { - Object output = api.echoNullableObject(aNullableObjectArg); + Long output = api.echoRequiredInt(anIntArg); wrapped.add(0, output); } catch (Throwable exception) { wrapped = wrapError(exception); @@ -3152,7 +4111,7 @@ static void setUp( BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableList" + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllNullableTypes" + messageChannelSuffix, getCodec()); if (api != null) { @@ -3160,9 +4119,9 @@ static void setUp( (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - List aNullableListArg = (List) args.get(0); + AllNullableTypes everythingArg = (AllNullableTypes) args.get(0); try { - List output = api.echoNullableList(aNullableListArg); + AllNullableTypes output = api.echoAllNullableTypes(everythingArg); wrapped.add(0, output); } catch (Throwable exception) { wrapped = wrapError(exception); @@ -3177,7 +4136,7 @@ static void setUp( BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableMap" + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllNullableTypesWithoutRecursion" + messageChannelSuffix, getCodec()); if (api != null) { @@ -3185,9 +4144,11 @@ static void setUp( (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - Map aNullableMapArg = (Map) args.get(0); + AllNullableTypesWithoutRecursion everythingArg = + (AllNullableTypesWithoutRecursion) args.get(0); try { - Map output = api.echoNullableMap(aNullableMapArg); + AllNullableTypesWithoutRecursion output = + api.echoAllNullableTypesWithoutRecursion(everythingArg); wrapped.add(0, output); } catch (Throwable exception) { wrapped = wrapError(exception); @@ -3202,7 +4163,7 @@ static void setUp( BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableEnum" + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.extractNestedNullableString" + messageChannelSuffix, getCodec()); if (api != null) { @@ -3210,9 +4171,9 @@ static void setUp( (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - AnEnum anEnumArg = (AnEnum) args.get(0); + AllClassesWrapper wrapperArg = (AllClassesWrapper) args.get(0); try { - AnEnum output = api.echoNullableEnum(anEnumArg); + String output = api.extractNestedNullableString(wrapperArg); wrapped.add(0, output); } catch (Throwable exception) { wrapped = wrapError(exception); @@ -3227,7 +4188,7 @@ static void setUp( BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAnotherNullableEnum" + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.createNestedNullableString" + messageChannelSuffix, getCodec()); if (api != null) { @@ -3235,9 +4196,9 @@ static void setUp( (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - AnotherEnum anotherEnumArg = (AnotherEnum) args.get(0); + String nullableStringArg = (String) args.get(0); try { - AnotherEnum output = api.echoAnotherNullableEnum(anotherEnumArg); + AllClassesWrapper output = api.createNestedNullableString(nullableStringArg); wrapped.add(0, output); } catch (Throwable exception) { wrapped = wrapError(exception); @@ -3252,7 +4213,7 @@ static void setUp( BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoOptionalNullableInt" + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.sendMultipleNullableTypes" + messageChannelSuffix, getCodec()); if (api != null) { @@ -3260,11 +4221,13 @@ static void setUp( (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - Number aNullableIntArg = (Number) args.get(0); + Boolean aNullableBoolArg = (Boolean) args.get(0); + Long aNullableIntArg = (Long) args.get(1); + String aNullableStringArg = (String) args.get(2); try { - Long output = - api.echoOptionalNullableInt( - (aNullableIntArg == null) ? null : aNullableIntArg.longValue()); + AllNullableTypes output = + api.sendMultipleNullableTypes( + aNullableBoolArg, aNullableIntArg, aNullableStringArg); wrapped.add(0, output); } catch (Throwable exception) { wrapped = wrapError(exception); @@ -3279,7 +4242,7 @@ static void setUp( BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNamedNullableString" + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion" + messageChannelSuffix, getCodec()); if (api != null) { @@ -3287,9 +4250,13 @@ static void setUp( (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - String aNullableStringArg = (String) args.get(0); + Boolean aNullableBoolArg = (Boolean) args.get(0); + Long aNullableIntArg = (Long) args.get(1); + String aNullableStringArg = (String) args.get(2); try { - String output = api.echoNamedNullableString(aNullableStringArg); + AllNullableTypesWithoutRecursion output = + api.sendMultipleNullableTypesWithoutRecursion( + aNullableBoolArg, aNullableIntArg, aNullableStringArg); wrapped.add(0, output); } catch (Throwable exception) { wrapped = wrapError(exception); @@ -3304,27 +4271,22 @@ static void setUp( BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.noopAsync" + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableInt" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { ArrayList wrapped = new ArrayList<>(); - VoidResult resultCallback = - new VoidResult() { - public void success() { - wrapped.add(0, null); - reply.reply(wrapped); - } - - public void error(Throwable error) { - ArrayList wrappedError = wrapError(error); - reply.reply(wrappedError); - } - }; - - api.noopAsync(resultCallback); + ArrayList args = (ArrayList) message; + Long aNullableIntArg = (Long) args.get(0); + try { + Long output = api.echoNullableInt(aNullableIntArg); + wrapped.add(0, output); + } catch (Throwable exception) { + wrapped = wrapError(exception); + } + reply.reply(wrapped); }); } else { channel.setMessageHandler(null); @@ -3334,7 +4296,7 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncInt" + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableDouble" + messageChannelSuffix, getCodec()); if (api != null) { @@ -3342,21 +4304,14 @@ public void error(Throwable error) { (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - Number anIntArg = (Number) args.get(0); - Result resultCallback = - new Result() { - public void success(Long result) { - wrapped.add(0, result); - reply.reply(wrapped); - } - - public void error(Throwable error) { - ArrayList wrappedError = wrapError(error); - reply.reply(wrappedError); - } - }; - - api.echoAsyncInt((anIntArg == null) ? null : anIntArg.longValue(), resultCallback); + Double aNullableDoubleArg = (Double) args.get(0); + try { + Double output = api.echoNullableDouble(aNullableDoubleArg); + wrapped.add(0, output); + } catch (Throwable exception) { + wrapped = wrapError(exception); + } + reply.reply(wrapped); }); } else { channel.setMessageHandler(null); @@ -3366,7 +4321,7 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncDouble" + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableBool" + messageChannelSuffix, getCodec()); if (api != null) { @@ -3374,21 +4329,14 @@ public void error(Throwable error) { (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - Double aDoubleArg = (Double) args.get(0); - Result resultCallback = - new Result() { - public void success(Double result) { - wrapped.add(0, result); - reply.reply(wrapped); - } - - public void error(Throwable error) { - ArrayList wrappedError = wrapError(error); - reply.reply(wrappedError); - } - }; - - api.echoAsyncDouble(aDoubleArg, resultCallback); + Boolean aNullableBoolArg = (Boolean) args.get(0); + try { + Boolean output = api.echoNullableBool(aNullableBoolArg); + wrapped.add(0, output); + } catch (Throwable exception) { + wrapped = wrapError(exception); + } + reply.reply(wrapped); }); } else { channel.setMessageHandler(null); @@ -3398,7 +4346,7 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncBool" + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableString" + messageChannelSuffix, getCodec()); if (api != null) { @@ -3406,21 +4354,14 @@ public void error(Throwable error) { (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - Boolean aBoolArg = (Boolean) args.get(0); - Result resultCallback = - new Result() { - public void success(Boolean result) { - wrapped.add(0, result); - reply.reply(wrapped); - } - - public void error(Throwable error) { - ArrayList wrappedError = wrapError(error); - reply.reply(wrappedError); - } - }; - - api.echoAsyncBool(aBoolArg, resultCallback); + String aNullableStringArg = (String) args.get(0); + try { + String output = api.echoNullableString(aNullableStringArg); + wrapped.add(0, output); + } catch (Throwable exception) { + wrapped = wrapError(exception); + } + reply.reply(wrapped); }); } else { channel.setMessageHandler(null); @@ -3430,7 +4371,7 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncString" + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableUint8List" + messageChannelSuffix, getCodec()); if (api != null) { @@ -3438,21 +4379,14 @@ public void error(Throwable error) { (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - String aStringArg = (String) args.get(0); - Result resultCallback = - new Result() { - public void success(String result) { - wrapped.add(0, result); - reply.reply(wrapped); - } - - public void error(Throwable error) { - ArrayList wrappedError = wrapError(error); - reply.reply(wrappedError); - } - }; - - api.echoAsyncString(aStringArg, resultCallback); + byte[] aNullableUint8ListArg = (byte[]) args.get(0); + try { + byte[] output = api.echoNullableUint8List(aNullableUint8ListArg); + wrapped.add(0, output); + } catch (Throwable exception) { + wrapped = wrapError(exception); + } + reply.reply(wrapped); }); } else { channel.setMessageHandler(null); @@ -3462,7 +4396,7 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncUint8List" + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableObject" + messageChannelSuffix, getCodec()); if (api != null) { @@ -3470,21 +4404,14 @@ public void error(Throwable error) { (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - byte[] aUint8ListArg = (byte[]) args.get(0); - Result resultCallback = - new Result() { - public void success(byte[] result) { - wrapped.add(0, result); - reply.reply(wrapped); - } - - public void error(Throwable error) { - ArrayList wrappedError = wrapError(error); - reply.reply(wrappedError); - } - }; - - api.echoAsyncUint8List(aUint8ListArg, resultCallback); + Object aNullableObjectArg = args.get(0); + try { + Object output = api.echoNullableObject(aNullableObjectArg); + wrapped.add(0, output); + } catch (Throwable exception) { + wrapped = wrapError(exception); + } + reply.reply(wrapped); }); } else { channel.setMessageHandler(null); @@ -3494,7 +4421,7 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncObject" + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableList" + messageChannelSuffix, getCodec()); if (api != null) { @@ -3502,21 +4429,14 @@ public void error(Throwable error) { (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - Object anObjectArg = args.get(0); - Result resultCallback = - new Result() { - public void success(Object result) { - wrapped.add(0, result); - reply.reply(wrapped); - } - - public void error(Throwable error) { - ArrayList wrappedError = wrapError(error); - reply.reply(wrappedError); - } - }; - - api.echoAsyncObject(anObjectArg, resultCallback); + List aNullableListArg = (List) args.get(0); + try { + List output = api.echoNullableList(aNullableListArg); + wrapped.add(0, output); + } catch (Throwable exception) { + wrapped = wrapError(exception); + } + reply.reply(wrapped); }); } else { channel.setMessageHandler(null); @@ -3526,7 +4446,7 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncList" + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableEnumList" + messageChannelSuffix, getCodec()); if (api != null) { @@ -3534,21 +4454,14 @@ public void error(Throwable error) { (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - List listArg = (List) args.get(0); - Result> resultCallback = - new Result>() { - public void success(List result) { - wrapped.add(0, result); - reply.reply(wrapped); - } - - public void error(Throwable error) { - ArrayList wrappedError = wrapError(error); - reply.reply(wrappedError); - } - }; - - api.echoAsyncList(listArg, resultCallback); + List enumListArg = (List) args.get(0); + try { + List output = api.echoNullableEnumList(enumListArg); + wrapped.add(0, output); + } catch (Throwable exception) { + wrapped = wrapError(exception); + } + reply.reply(wrapped); }); } else { channel.setMessageHandler(null); @@ -3558,7 +4471,7 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncMap" + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableClassList" + messageChannelSuffix, getCodec()); if (api != null) { @@ -3566,21 +4479,14 @@ public void error(Throwable error) { (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - Map aMapArg = (Map) args.get(0); - Result> resultCallback = - new Result>() { - public void success(Map result) { - wrapped.add(0, result); - reply.reply(wrapped); - } - - public void error(Throwable error) { - ArrayList wrappedError = wrapError(error); - reply.reply(wrappedError); - } - }; - - api.echoAsyncMap(aMapArg, resultCallback); + List classListArg = (List) args.get(0); + try { + List output = api.echoNullableClassList(classListArg); + wrapped.add(0, output); + } catch (Throwable exception) { + wrapped = wrapError(exception); + } + reply.reply(wrapped); }); } else { channel.setMessageHandler(null); @@ -3590,7 +4496,7 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncEnum" + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableNonNullEnumList" + messageChannelSuffix, getCodec()); if (api != null) { @@ -3598,21 +4504,14 @@ public void error(Throwable error) { (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - AnEnum anEnumArg = (AnEnum) args.get(0); - Result resultCallback = - new Result() { - public void success(AnEnum result) { - wrapped.add(0, result); - reply.reply(wrapped); - } - - public void error(Throwable error) { - ArrayList wrappedError = wrapError(error); - reply.reply(wrappedError); - } - }; - - api.echoAsyncEnum(anEnumArg, resultCallback); + List enumListArg = (List) args.get(0); + try { + List output = api.echoNullableNonNullEnumList(enumListArg); + wrapped.add(0, output); + } catch (Throwable exception) { + wrapped = wrapError(exception); + } + reply.reply(wrapped); }); } else { channel.setMessageHandler(null); @@ -3622,7 +4521,7 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAnotherAsyncEnum" + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableNonNullClassList" + messageChannelSuffix, getCodec()); if (api != null) { @@ -3630,21 +4529,14 @@ public void error(Throwable error) { (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - AnotherEnum anotherEnumArg = (AnotherEnum) args.get(0); - Result resultCallback = - new Result() { - public void success(AnotherEnum result) { - wrapped.add(0, result); - reply.reply(wrapped); - } - - public void error(Throwable error) { - ArrayList wrappedError = wrapError(error); - reply.reply(wrappedError); - } - }; - - api.echoAnotherAsyncEnum(anotherEnumArg, resultCallback); + List classListArg = (List) args.get(0); + try { + List output = api.echoNullableNonNullClassList(classListArg); + wrapped.add(0, output); + } catch (Throwable exception) { + wrapped = wrapError(exception); + } + reply.reply(wrapped); }); } else { channel.setMessageHandler(null); @@ -3654,27 +4546,22 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncError" + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableMap" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { ArrayList wrapped = new ArrayList<>(); - NullableResult resultCallback = - new NullableResult() { - public void success(Object result) { - wrapped.add(0, result); - reply.reply(wrapped); - } - - public void error(Throwable error) { - ArrayList wrappedError = wrapError(error); - reply.reply(wrappedError); - } - }; - - api.throwAsyncError(resultCallback); + ArrayList args = (ArrayList) message; + Map mapArg = (Map) args.get(0); + try { + Map output = api.echoNullableMap(mapArg); + wrapped.add(0, output); + } catch (Throwable exception) { + wrapped = wrapError(exception); + } + reply.reply(wrapped); }); } else { channel.setMessageHandler(null); @@ -3684,27 +4571,22 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncErrorFromVoid" + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableStringMap" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { ArrayList wrapped = new ArrayList<>(); - VoidResult resultCallback = - new VoidResult() { - public void success() { - wrapped.add(0, null); - reply.reply(wrapped); - } - - public void error(Throwable error) { - ArrayList wrappedError = wrapError(error); - reply.reply(wrappedError); - } - }; - - api.throwAsyncErrorFromVoid(resultCallback); + ArrayList args = (ArrayList) message; + Map stringMapArg = (Map) args.get(0); + try { + Map output = api.echoNullableStringMap(stringMapArg); + wrapped.add(0, output); + } catch (Throwable exception) { + wrapped = wrapError(exception); + } + reply.reply(wrapped); }); } else { channel.setMessageHandler(null); @@ -3714,27 +4596,22 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncFlutterError" + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableIntMap" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { ArrayList wrapped = new ArrayList<>(); - NullableResult resultCallback = - new NullableResult() { - public void success(Object result) { - wrapped.add(0, result); - reply.reply(wrapped); - } - - public void error(Throwable error) { - ArrayList wrappedError = wrapError(error); - reply.reply(wrappedError); - } - }; - - api.throwAsyncFlutterError(resultCallback); + ArrayList args = (ArrayList) message; + Map intMapArg = (Map) args.get(0); + try { + Map output = api.echoNullableIntMap(intMapArg); + wrapped.add(0, output); + } catch (Throwable exception) { + wrapped = wrapError(exception); + } + reply.reply(wrapped); }); } else { channel.setMessageHandler(null); @@ -3744,7 +4621,7 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncAllTypes" + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableEnumMap" + messageChannelSuffix, getCodec()); if (api != null) { @@ -3752,21 +4629,14 @@ public void error(Throwable error) { (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - AllTypes everythingArg = (AllTypes) args.get(0); - Result resultCallback = - new Result() { - public void success(AllTypes result) { - wrapped.add(0, result); - reply.reply(wrapped); - } - - public void error(Throwable error) { - ArrayList wrappedError = wrapError(error); - reply.reply(wrappedError); - } - }; - - api.echoAsyncAllTypes(everythingArg, resultCallback); + Map enumMapArg = (Map) args.get(0); + try { + Map output = api.echoNullableEnumMap(enumMapArg); + wrapped.add(0, output); + } catch (Throwable exception) { + wrapped = wrapError(exception); + } + reply.reply(wrapped); }); } else { channel.setMessageHandler(null); @@ -3776,7 +4646,7 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypes" + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableClassMap" + messageChannelSuffix, getCodec()); if (api != null) { @@ -3784,21 +4654,14 @@ public void error(Throwable error) { (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - AllNullableTypes everythingArg = (AllNullableTypes) args.get(0); - NullableResult resultCallback = - new NullableResult() { - public void success(AllNullableTypes result) { - wrapped.add(0, result); - reply.reply(wrapped); - } - - public void error(Throwable error) { - ArrayList wrappedError = wrapError(error); - reply.reply(wrappedError); - } - }; - - api.echoAsyncNullableAllNullableTypes(everythingArg, resultCallback); + Map classMapArg = (Map) args.get(0); + try { + Map output = api.echoNullableClassMap(classMapArg); + wrapped.add(0, output); + } catch (Throwable exception) { + wrapped = wrapError(exception); + } + reply.reply(wrapped); }); } else { channel.setMessageHandler(null); @@ -3808,7 +4671,7 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypesWithoutRecursion" + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableNonNullStringMap" + messageChannelSuffix, getCodec()); if (api != null) { @@ -3816,23 +4679,14 @@ public void error(Throwable error) { (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - AllNullableTypesWithoutRecursion everythingArg = - (AllNullableTypesWithoutRecursion) args.get(0); - NullableResult resultCallback = - new NullableResult() { - public void success(AllNullableTypesWithoutRecursion result) { - wrapped.add(0, result); - reply.reply(wrapped); - } - - public void error(Throwable error) { - ArrayList wrappedError = wrapError(error); - reply.reply(wrappedError); - } - }; - - api.echoAsyncNullableAllNullableTypesWithoutRecursion( - everythingArg, resultCallback); + Map stringMapArg = (Map) args.get(0); + try { + Map output = api.echoNullableNonNullStringMap(stringMapArg); + wrapped.add(0, output); + } catch (Throwable exception) { + wrapped = wrapError(exception); + } + reply.reply(wrapped); }); } else { channel.setMessageHandler(null); @@ -3842,7 +4696,7 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableInt" + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableNonNullIntMap" + messageChannelSuffix, getCodec()); if (api != null) { @@ -3850,22 +4704,14 @@ public void error(Throwable error) { (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - Number anIntArg = (Number) args.get(0); - NullableResult resultCallback = - new NullableResult() { - public void success(Long result) { - wrapped.add(0, result); - reply.reply(wrapped); - } - - public void error(Throwable error) { - ArrayList wrappedError = wrapError(error); - reply.reply(wrappedError); - } - }; - - api.echoAsyncNullableInt( - (anIntArg == null) ? null : anIntArg.longValue(), resultCallback); + Map intMapArg = (Map) args.get(0); + try { + Map output = api.echoNullableNonNullIntMap(intMapArg); + wrapped.add(0, output); + } catch (Throwable exception) { + wrapped = wrapError(exception); + } + reply.reply(wrapped); }); } else { channel.setMessageHandler(null); @@ -3875,7 +4721,7 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableDouble" + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableNonNullEnumMap" + messageChannelSuffix, getCodec()); if (api != null) { @@ -3883,21 +4729,14 @@ public void error(Throwable error) { (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - Double aDoubleArg = (Double) args.get(0); - NullableResult resultCallback = - new NullableResult() { - public void success(Double result) { - wrapped.add(0, result); - reply.reply(wrapped); - } - - public void error(Throwable error) { - ArrayList wrappedError = wrapError(error); - reply.reply(wrappedError); - } - }; - - api.echoAsyncNullableDouble(aDoubleArg, resultCallback); + Map enumMapArg = (Map) args.get(0); + try { + Map output = api.echoNullableNonNullEnumMap(enumMapArg); + wrapped.add(0, output); + } catch (Throwable exception) { + wrapped = wrapError(exception); + } + reply.reply(wrapped); }); } else { channel.setMessageHandler(null); @@ -3907,7 +4746,7 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableBool" + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableNonNullClassMap" + messageChannelSuffix, getCodec()); if (api != null) { @@ -3915,21 +4754,14 @@ public void error(Throwable error) { (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - Boolean aBoolArg = (Boolean) args.get(0); - NullableResult resultCallback = - new NullableResult() { - public void success(Boolean result) { - wrapped.add(0, result); - reply.reply(wrapped); - } - - public void error(Throwable error) { - ArrayList wrappedError = wrapError(error); - reply.reply(wrappedError); - } - }; - - api.echoAsyncNullableBool(aBoolArg, resultCallback); + Map classMapArg = (Map) args.get(0); + try { + Map output = api.echoNullableNonNullClassMap(classMapArg); + wrapped.add(0, output); + } catch (Throwable exception) { + wrapped = wrapError(exception); + } + reply.reply(wrapped); }); } else { channel.setMessageHandler(null); @@ -3939,7 +4771,7 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableString" + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableEnum" + messageChannelSuffix, getCodec()); if (api != null) { @@ -3947,21 +4779,14 @@ public void error(Throwable error) { (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - String aStringArg = (String) args.get(0); - NullableResult resultCallback = - new NullableResult() { - public void success(String result) { - wrapped.add(0, result); - reply.reply(wrapped); - } - - public void error(Throwable error) { - ArrayList wrappedError = wrapError(error); - reply.reply(wrappedError); - } - }; - - api.echoAsyncNullableString(aStringArg, resultCallback); + AnEnum anEnumArg = (AnEnum) args.get(0); + try { + AnEnum output = api.echoNullableEnum(anEnumArg); + wrapped.add(0, output); + } catch (Throwable exception) { + wrapped = wrapError(exception); + } + reply.reply(wrapped); }); } else { channel.setMessageHandler(null); @@ -3971,7 +4796,7 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableUint8List" + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAnotherNullableEnum" + messageChannelSuffix, getCodec()); if (api != null) { @@ -3979,21 +4804,14 @@ public void error(Throwable error) { (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - byte[] aUint8ListArg = (byte[]) args.get(0); - NullableResult resultCallback = - new NullableResult() { - public void success(byte[] result) { - wrapped.add(0, result); - reply.reply(wrapped); - } - - public void error(Throwable error) { - ArrayList wrappedError = wrapError(error); - reply.reply(wrappedError); - } - }; - - api.echoAsyncNullableUint8List(aUint8ListArg, resultCallback); + AnotherEnum anotherEnumArg = (AnotherEnum) args.get(0); + try { + AnotherEnum output = api.echoAnotherNullableEnum(anotherEnumArg); + wrapped.add(0, output); + } catch (Throwable exception) { + wrapped = wrapError(exception); + } + reply.reply(wrapped); }); } else { channel.setMessageHandler(null); @@ -4003,7 +4821,7 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableObject" + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoOptionalNullableInt" + messageChannelSuffix, getCodec()); if (api != null) { @@ -4011,21 +4829,14 @@ public void error(Throwable error) { (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - Object anObjectArg = args.get(0); - NullableResult resultCallback = - new NullableResult() { - public void success(Object result) { - wrapped.add(0, result); - reply.reply(wrapped); - } - - public void error(Throwable error) { - ArrayList wrappedError = wrapError(error); - reply.reply(wrappedError); - } - }; - - api.echoAsyncNullableObject(anObjectArg, resultCallback); + Long aNullableIntArg = (Long) args.get(0); + try { + Long output = api.echoOptionalNullableInt(aNullableIntArg); + wrapped.add(0, output); + } catch (Throwable exception) { + wrapped = wrapError(exception); + } + reply.reply(wrapped); }); } else { channel.setMessageHandler(null); @@ -4035,7 +4846,7 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableList" + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNamedNullableString" + messageChannelSuffix, getCodec()); if (api != null) { @@ -4043,21 +4854,14 @@ public void error(Throwable error) { (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - List listArg = (List) args.get(0); - NullableResult> resultCallback = - new NullableResult>() { - public void success(List result) { - wrapped.add(0, result); - reply.reply(wrapped); - } - - public void error(Throwable error) { - ArrayList wrappedError = wrapError(error); - reply.reply(wrappedError); - } - }; - - api.echoAsyncNullableList(listArg, resultCallback); + String aNullableStringArg = (String) args.get(0); + try { + String output = api.echoNamedNullableString(aNullableStringArg); + wrapped.add(0, output); + } catch (Throwable exception) { + wrapped = wrapError(exception); + } + reply.reply(wrapped); }); } else { channel.setMessageHandler(null); @@ -4067,19 +4871,17 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableMap" + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.noopAsync" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { ArrayList wrapped = new ArrayList<>(); - ArrayList args = (ArrayList) message; - Map aMapArg = (Map) args.get(0); - NullableResult> resultCallback = - new NullableResult>() { - public void success(Map result) { - wrapped.add(0, result); + VoidResult resultCallback = + new VoidResult() { + public void success() { + wrapped.add(0, null); reply.reply(wrapped); } @@ -4089,7 +4891,7 @@ public void error(Throwable error) { } }; - api.echoAsyncNullableMap(aMapArg, resultCallback); + api.noopAsync(resultCallback); }); } else { channel.setMessageHandler(null); @@ -4099,7 +4901,7 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableEnum" + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncInt" + messageChannelSuffix, getCodec()); if (api != null) { @@ -4107,10 +4909,10 @@ public void error(Throwable error) { (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - AnEnum anEnumArg = (AnEnum) args.get(0); - NullableResult resultCallback = - new NullableResult() { - public void success(AnEnum result) { + Long anIntArg = (Long) args.get(0); + Result resultCallback = + new Result() { + public void success(Long result) { wrapped.add(0, result); reply.reply(wrapped); } @@ -4121,7 +4923,7 @@ public void error(Throwable error) { } }; - api.echoAsyncNullableEnum(anEnumArg, resultCallback); + api.echoAsyncInt(anIntArg, resultCallback); }); } else { channel.setMessageHandler(null); @@ -4131,7 +4933,7 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAnotherAsyncNullableEnum" + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncDouble" + messageChannelSuffix, getCodec()); if (api != null) { @@ -4139,10 +4941,10 @@ public void error(Throwable error) { (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - AnotherEnum anotherEnumArg = (AnotherEnum) args.get(0); - NullableResult resultCallback = - new NullableResult() { - public void success(AnotherEnum result) { + Double aDoubleArg = (Double) args.get(0); + Result resultCallback = + new Result() { + public void success(Double result) { wrapped.add(0, result); reply.reply(wrapped); } @@ -4153,7 +4955,7 @@ public void error(Throwable error) { } }; - api.echoAnotherAsyncNullableEnum(anotherEnumArg, resultCallback); + api.echoAsyncDouble(aDoubleArg, resultCallback); }); } else { channel.setMessageHandler(null); @@ -4163,17 +4965,19 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterNoop" + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncBool" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { ArrayList wrapped = new ArrayList<>(); - VoidResult resultCallback = - new VoidResult() { - public void success() { - wrapped.add(0, null); + ArrayList args = (ArrayList) message; + Boolean aBoolArg = (Boolean) args.get(0); + Result resultCallback = + new Result() { + public void success(Boolean result) { + wrapped.add(0, result); reply.reply(wrapped); } @@ -4183,7 +4987,7 @@ public void error(Throwable error) { } }; - api.callFlutterNoop(resultCallback); + api.echoAsyncBool(aBoolArg, resultCallback); }); } else { channel.setMessageHandler(null); @@ -4193,16 +4997,18 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterThrowError" + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncString" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { ArrayList wrapped = new ArrayList<>(); - NullableResult resultCallback = - new NullableResult() { - public void success(Object result) { + ArrayList args = (ArrayList) message; + String aStringArg = (String) args.get(0); + Result resultCallback = + new Result() { + public void success(String result) { wrapped.add(0, result); reply.reply(wrapped); } @@ -4213,7 +5019,7 @@ public void error(Throwable error) { } }; - api.callFlutterThrowError(resultCallback); + api.echoAsyncString(aStringArg, resultCallback); }); } else { channel.setMessageHandler(null); @@ -4223,17 +5029,19 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterThrowErrorFromVoid" + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncUint8List" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { ArrayList wrapped = new ArrayList<>(); - VoidResult resultCallback = - new VoidResult() { - public void success() { - wrapped.add(0, null); + ArrayList args = (ArrayList) message; + byte[] aUint8ListArg = (byte[]) args.get(0); + Result resultCallback = + new Result() { + public void success(byte[] result) { + wrapped.add(0, result); reply.reply(wrapped); } @@ -4243,7 +5051,7 @@ public void error(Throwable error) { } }; - api.callFlutterThrowErrorFromVoid(resultCallback); + api.echoAsyncUint8List(aUint8ListArg, resultCallback); }); } else { channel.setMessageHandler(null); @@ -4253,7 +5061,7 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllTypes" + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncObject" + messageChannelSuffix, getCodec()); if (api != null) { @@ -4261,10 +5069,10 @@ public void error(Throwable error) { (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - AllTypes everythingArg = (AllTypes) args.get(0); - Result resultCallback = - new Result() { - public void success(AllTypes result) { + Object anObjectArg = args.get(0); + Result resultCallback = + new Result() { + public void success(Object result) { wrapped.add(0, result); reply.reply(wrapped); } @@ -4275,7 +5083,7 @@ public void error(Throwable error) { } }; - api.callFlutterEchoAllTypes(everythingArg, resultCallback); + api.echoAsyncObject(anObjectArg, resultCallback); }); } else { channel.setMessageHandler(null); @@ -4285,7 +5093,7 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllNullableTypes" + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncList" + messageChannelSuffix, getCodec()); if (api != null) { @@ -4293,10 +5101,10 @@ public void error(Throwable error) { (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - AllNullableTypes everythingArg = (AllNullableTypes) args.get(0); - NullableResult resultCallback = - new NullableResult() { - public void success(AllNullableTypes result) { + List listArg = (List) args.get(0); + Result> resultCallback = + new Result>() { + public void success(List result) { wrapped.add(0, result); reply.reply(wrapped); } @@ -4307,7 +5115,7 @@ public void error(Throwable error) { } }; - api.callFlutterEchoAllNullableTypes(everythingArg, resultCallback); + api.echoAsyncList(listArg, resultCallback); }); } else { channel.setMessageHandler(null); @@ -4317,7 +5125,7 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypes" + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncEnumList" + messageChannelSuffix, getCodec()); if (api != null) { @@ -4325,12 +5133,10 @@ public void error(Throwable error) { (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - Boolean aNullableBoolArg = (Boolean) args.get(0); - Number aNullableIntArg = (Number) args.get(1); - String aNullableStringArg = (String) args.get(2); - Result resultCallback = - new Result() { - public void success(AllNullableTypes result) { + List enumListArg = (List) args.get(0); + Result> resultCallback = + new Result>() { + public void success(List result) { wrapped.add(0, result); reply.reply(wrapped); } @@ -4341,11 +5147,7 @@ public void error(Throwable error) { } }; - api.callFlutterSendMultipleNullableTypes( - aNullableBoolArg, - (aNullableIntArg == null) ? null : aNullableIntArg.longValue(), - aNullableStringArg, - resultCallback); + api.echoAsyncEnumList(enumListArg, resultCallback); }); } else { channel.setMessageHandler(null); @@ -4355,7 +5157,7 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllNullableTypesWithoutRecursion" + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncClassList" + messageChannelSuffix, getCodec()); if (api != null) { @@ -4363,11 +5165,10 @@ public void error(Throwable error) { (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - AllNullableTypesWithoutRecursion everythingArg = - (AllNullableTypesWithoutRecursion) args.get(0); - NullableResult resultCallback = - new NullableResult() { - public void success(AllNullableTypesWithoutRecursion result) { + List classListArg = (List) args.get(0); + Result> resultCallback = + new Result>() { + public void success(List result) { wrapped.add(0, result); reply.reply(wrapped); } @@ -4378,7 +5179,7 @@ public void error(Throwable error) { } }; - api.callFlutterEchoAllNullableTypesWithoutRecursion(everythingArg, resultCallback); + api.echoAsyncClassList(classListArg, resultCallback); }); } else { channel.setMessageHandler(null); @@ -4388,7 +5189,7 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypesWithoutRecursion" + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncMap" + messageChannelSuffix, getCodec()); if (api != null) { @@ -4396,12 +5197,10 @@ public void error(Throwable error) { (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - Boolean aNullableBoolArg = (Boolean) args.get(0); - Number aNullableIntArg = (Number) args.get(1); - String aNullableStringArg = (String) args.get(2); - Result resultCallback = - new Result() { - public void success(AllNullableTypesWithoutRecursion result) { + Map mapArg = (Map) args.get(0); + Result> resultCallback = + new Result>() { + public void success(Map result) { wrapped.add(0, result); reply.reply(wrapped); } @@ -4412,11 +5211,7 @@ public void error(Throwable error) { } }; - api.callFlutterSendMultipleNullableTypesWithoutRecursion( - aNullableBoolArg, - (aNullableIntArg == null) ? null : aNullableIntArg.longValue(), - aNullableStringArg, - resultCallback); + api.echoAsyncMap(mapArg, resultCallback); }); } else { channel.setMessageHandler(null); @@ -4426,7 +5221,7 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoBool" + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncStringMap" + messageChannelSuffix, getCodec()); if (api != null) { @@ -4434,10 +5229,10 @@ public void error(Throwable error) { (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - Boolean aBoolArg = (Boolean) args.get(0); - Result resultCallback = - new Result() { - public void success(Boolean result) { + Map stringMapArg = (Map) args.get(0); + Result> resultCallback = + new Result>() { + public void success(Map result) { wrapped.add(0, result); reply.reply(wrapped); } @@ -4448,7 +5243,7 @@ public void error(Throwable error) { } }; - api.callFlutterEchoBool(aBoolArg, resultCallback); + api.echoAsyncStringMap(stringMapArg, resultCallback); }); } else { channel.setMessageHandler(null); @@ -4458,7 +5253,7 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoInt" + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncIntMap" + messageChannelSuffix, getCodec()); if (api != null) { @@ -4466,10 +5261,10 @@ public void error(Throwable error) { (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - Number anIntArg = (Number) args.get(0); - Result resultCallback = - new Result() { - public void success(Long result) { + Map intMapArg = (Map) args.get(0); + Result> resultCallback = + new Result>() { + public void success(Map result) { wrapped.add(0, result); reply.reply(wrapped); } @@ -4480,8 +5275,7 @@ public void error(Throwable error) { } }; - api.callFlutterEchoInt( - (anIntArg == null) ? null : anIntArg.longValue(), resultCallback); + api.echoAsyncIntMap(intMapArg, resultCallback); }); } else { channel.setMessageHandler(null); @@ -4491,7 +5285,7 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoDouble" + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncEnumMap" + messageChannelSuffix, getCodec()); if (api != null) { @@ -4499,10 +5293,10 @@ public void error(Throwable error) { (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - Double aDoubleArg = (Double) args.get(0); - Result resultCallback = - new Result() { - public void success(Double result) { + Map enumMapArg = (Map) args.get(0); + Result> resultCallback = + new Result>() { + public void success(Map result) { wrapped.add(0, result); reply.reply(wrapped); } @@ -4513,7 +5307,7 @@ public void error(Throwable error) { } }; - api.callFlutterEchoDouble(aDoubleArg, resultCallback); + api.echoAsyncEnumMap(enumMapArg, resultCallback); }); } else { channel.setMessageHandler(null); @@ -4523,7 +5317,7 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoString" + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncClassMap" + messageChannelSuffix, getCodec()); if (api != null) { @@ -4531,10 +5325,10 @@ public void error(Throwable error) { (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - String aStringArg = (String) args.get(0); - Result resultCallback = - new Result() { - public void success(String result) { + Map classMapArg = (Map) args.get(0); + Result> resultCallback = + new Result>() { + public void success(Map result) { wrapped.add(0, result); reply.reply(wrapped); } @@ -4545,7 +5339,7 @@ public void error(Throwable error) { } }; - api.callFlutterEchoString(aStringArg, resultCallback); + api.echoAsyncClassMap(classMapArg, resultCallback); }); } else { channel.setMessageHandler(null); @@ -4555,7 +5349,7 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoUint8List" + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncEnum" + messageChannelSuffix, getCodec()); if (api != null) { @@ -4563,10 +5357,10 @@ public void error(Throwable error) { (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - byte[] listArg = (byte[]) args.get(0); - Result resultCallback = - new Result() { - public void success(byte[] result) { + AnEnum anEnumArg = (AnEnum) args.get(0); + Result resultCallback = + new Result() { + public void success(AnEnum result) { wrapped.add(0, result); reply.reply(wrapped); } @@ -4577,7 +5371,7 @@ public void error(Throwable error) { } }; - api.callFlutterEchoUint8List(listArg, resultCallback); + api.echoAsyncEnum(anEnumArg, resultCallback); }); } else { channel.setMessageHandler(null); @@ -4587,7 +5381,7 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoList" + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAnotherAsyncEnum" + messageChannelSuffix, getCodec()); if (api != null) { @@ -4595,10 +5389,10 @@ public void error(Throwable error) { (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - List listArg = (List) args.get(0); - Result> resultCallback = - new Result>() { - public void success(List result) { + AnotherEnum anotherEnumArg = (AnotherEnum) args.get(0); + Result resultCallback = + new Result() { + public void success(AnotherEnum result) { wrapped.add(0, result); reply.reply(wrapped); } @@ -4609,7 +5403,7 @@ public void error(Throwable error) { } }; - api.callFlutterEchoList(listArg, resultCallback); + api.echoAnotherAsyncEnum(anotherEnumArg, resultCallback); }); } else { channel.setMessageHandler(null); @@ -4619,18 +5413,16 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoMap" + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncError" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { ArrayList wrapped = new ArrayList<>(); - ArrayList args = (ArrayList) message; - Map aMapArg = (Map) args.get(0); - Result> resultCallback = - new Result>() { - public void success(Map result) { + NullableResult resultCallback = + new NullableResult() { + public void success(Object result) { wrapped.add(0, result); reply.reply(wrapped); } @@ -4641,7 +5433,7 @@ public void error(Throwable error) { } }; - api.callFlutterEchoMap(aMapArg, resultCallback); + api.throwAsyncError(resultCallback); }); } else { channel.setMessageHandler(null); @@ -4651,19 +5443,17 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoEnum" + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncErrorFromVoid" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { ArrayList wrapped = new ArrayList<>(); - ArrayList args = (ArrayList) message; - AnEnum anEnumArg = (AnEnum) args.get(0); - Result resultCallback = - new Result() { - public void success(AnEnum result) { - wrapped.add(0, result); + VoidResult resultCallback = + new VoidResult() { + public void success() { + wrapped.add(0, null); reply.reply(wrapped); } @@ -4673,7 +5463,7 @@ public void error(Throwable error) { } }; - api.callFlutterEchoEnum(anEnumArg, resultCallback); + api.throwAsyncErrorFromVoid(resultCallback); }); } else { channel.setMessageHandler(null); @@ -4683,18 +5473,16 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAnotherEnum" + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncFlutterError" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { ArrayList wrapped = new ArrayList<>(); - ArrayList args = (ArrayList) message; - AnotherEnum anotherEnumArg = (AnotherEnum) args.get(0); - Result resultCallback = - new Result() { - public void success(AnotherEnum result) { + NullableResult resultCallback = + new NullableResult() { + public void success(Object result) { wrapped.add(0, result); reply.reply(wrapped); } @@ -4705,7 +5493,7 @@ public void error(Throwable error) { } }; - api.callFlutterEchoAnotherEnum(anotherEnumArg, resultCallback); + api.throwAsyncFlutterError(resultCallback); }); } else { channel.setMessageHandler(null); @@ -4715,7 +5503,7 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableBool" + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncAllTypes" + messageChannelSuffix, getCodec()); if (api != null) { @@ -4723,10 +5511,10 @@ public void error(Throwable error) { (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - Boolean aBoolArg = (Boolean) args.get(0); - NullableResult resultCallback = - new NullableResult() { - public void success(Boolean result) { + AllTypes everythingArg = (AllTypes) args.get(0); + Result resultCallback = + new Result() { + public void success(AllTypes result) { wrapped.add(0, result); reply.reply(wrapped); } @@ -4737,7 +5525,7 @@ public void error(Throwable error) { } }; - api.callFlutterEchoNullableBool(aBoolArg, resultCallback); + api.echoAsyncAllTypes(everythingArg, resultCallback); }); } else { channel.setMessageHandler(null); @@ -4747,7 +5535,7 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableInt" + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypes" + messageChannelSuffix, getCodec()); if (api != null) { @@ -4755,10 +5543,10 @@ public void error(Throwable error) { (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - Number anIntArg = (Number) args.get(0); - NullableResult resultCallback = - new NullableResult() { - public void success(Long result) { + AllNullableTypes everythingArg = (AllNullableTypes) args.get(0); + NullableResult resultCallback = + new NullableResult() { + public void success(AllNullableTypes result) { wrapped.add(0, result); reply.reply(wrapped); } @@ -4769,8 +5557,7 @@ public void error(Throwable error) { } }; - api.callFlutterEchoNullableInt( - (anIntArg == null) ? null : anIntArg.longValue(), resultCallback); + api.echoAsyncNullableAllNullableTypes(everythingArg, resultCallback); }); } else { channel.setMessageHandler(null); @@ -4780,7 +5567,7 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableDouble" + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypesWithoutRecursion" + messageChannelSuffix, getCodec()); if (api != null) { @@ -4788,10 +5575,11 @@ public void error(Throwable error) { (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - Double aDoubleArg = (Double) args.get(0); - NullableResult resultCallback = - new NullableResult() { - public void success(Double result) { + AllNullableTypesWithoutRecursion everythingArg = + (AllNullableTypesWithoutRecursion) args.get(0); + NullableResult resultCallback = + new NullableResult() { + public void success(AllNullableTypesWithoutRecursion result) { wrapped.add(0, result); reply.reply(wrapped); } @@ -4802,7 +5590,8 @@ public void error(Throwable error) { } }; - api.callFlutterEchoNullableDouble(aDoubleArg, resultCallback); + api.echoAsyncNullableAllNullableTypesWithoutRecursion( + everythingArg, resultCallback); }); } else { channel.setMessageHandler(null); @@ -4812,7 +5601,7 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableString" + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableInt" + messageChannelSuffix, getCodec()); if (api != null) { @@ -4820,10 +5609,10 @@ public void error(Throwable error) { (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - String aStringArg = (String) args.get(0); - NullableResult resultCallback = - new NullableResult() { - public void success(String result) { + Long anIntArg = (Long) args.get(0); + NullableResult resultCallback = + new NullableResult() { + public void success(Long result) { wrapped.add(0, result); reply.reply(wrapped); } @@ -4834,7 +5623,7 @@ public void error(Throwable error) { } }; - api.callFlutterEchoNullableString(aStringArg, resultCallback); + api.echoAsyncNullableInt(anIntArg, resultCallback); }); } else { channel.setMessageHandler(null); @@ -4844,7 +5633,7 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableUint8List" + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableDouble" + messageChannelSuffix, getCodec()); if (api != null) { @@ -4852,10 +5641,10 @@ public void error(Throwable error) { (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - byte[] listArg = (byte[]) args.get(0); - NullableResult resultCallback = - new NullableResult() { - public void success(byte[] result) { + Double aDoubleArg = (Double) args.get(0); + NullableResult resultCallback = + new NullableResult() { + public void success(Double result) { wrapped.add(0, result); reply.reply(wrapped); } @@ -4866,7 +5655,7 @@ public void error(Throwable error) { } }; - api.callFlutterEchoNullableUint8List(listArg, resultCallback); + api.echoAsyncNullableDouble(aDoubleArg, resultCallback); }); } else { channel.setMessageHandler(null); @@ -4876,7 +5665,7 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableList" + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableBool" + messageChannelSuffix, getCodec()); if (api != null) { @@ -4884,10 +5673,10 @@ public void error(Throwable error) { (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - List listArg = (List) args.get(0); - NullableResult> resultCallback = - new NullableResult>() { - public void success(List result) { + Boolean aBoolArg = (Boolean) args.get(0); + NullableResult resultCallback = + new NullableResult() { + public void success(Boolean result) { wrapped.add(0, result); reply.reply(wrapped); } @@ -4898,7 +5687,7 @@ public void error(Throwable error) { } }; - api.callFlutterEchoNullableList(listArg, resultCallback); + api.echoAsyncNullableBool(aBoolArg, resultCallback); }); } else { channel.setMessageHandler(null); @@ -4908,7 +5697,7 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableMap" + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableString" + messageChannelSuffix, getCodec()); if (api != null) { @@ -4916,12 +5705,12 @@ public void error(Throwable error) { (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - Map aMapArg = (Map) args.get(0); - NullableResult> resultCallback = - new NullableResult>() { - public void success(Map result) { - wrapped.add(0, result); - reply.reply(wrapped); + String aStringArg = (String) args.get(0); + NullableResult resultCallback = + new NullableResult() { + public void success(String result) { + wrapped.add(0, result); + reply.reply(wrapped); } public void error(Throwable error) { @@ -4930,7 +5719,7 @@ public void error(Throwable error) { } }; - api.callFlutterEchoNullableMap(aMapArg, resultCallback); + api.echoAsyncNullableString(aStringArg, resultCallback); }); } else { channel.setMessageHandler(null); @@ -4940,7 +5729,7 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableEnum" + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableUint8List" + messageChannelSuffix, getCodec()); if (api != null) { @@ -4948,10 +5737,10 @@ public void error(Throwable error) { (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - AnEnum anEnumArg = (AnEnum) args.get(0); - NullableResult resultCallback = - new NullableResult() { - public void success(AnEnum result) { + byte[] aUint8ListArg = (byte[]) args.get(0); + NullableResult resultCallback = + new NullableResult() { + public void success(byte[] result) { wrapped.add(0, result); reply.reply(wrapped); } @@ -4962,7 +5751,7 @@ public void error(Throwable error) { } }; - api.callFlutterEchoNullableEnum(anEnumArg, resultCallback); + api.echoAsyncNullableUint8List(aUint8ListArg, resultCallback); }); } else { channel.setMessageHandler(null); @@ -4972,7 +5761,7 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAnotherNullableEnum" + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableObject" + messageChannelSuffix, getCodec()); if (api != null) { @@ -4980,10 +5769,10 @@ public void error(Throwable error) { (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - AnotherEnum anotherEnumArg = (AnotherEnum) args.get(0); - NullableResult resultCallback = - new NullableResult() { - public void success(AnotherEnum result) { + Object anObjectArg = args.get(0); + NullableResult resultCallback = + new NullableResult() { + public void success(Object result) { wrapped.add(0, result); reply.reply(wrapped); } @@ -4994,7 +5783,7 @@ public void error(Throwable error) { } }; - api.callFlutterEchoAnotherNullableEnum(anotherEnumArg, resultCallback); + api.echoAsyncNullableObject(anObjectArg, resultCallback); }); } else { channel.setMessageHandler(null); @@ -5004,7 +5793,7 @@ public void error(Throwable error) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSmallApiEchoString" + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableList" + messageChannelSuffix, getCodec()); if (api != null) { @@ -5012,10 +5801,10 @@ public void error(Throwable error) { (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - String aStringArg = (String) args.get(0); - Result resultCallback = - new Result() { - public void success(String result) { + List listArg = (List) args.get(0); + NullableResult> resultCallback = + new NullableResult>() { + public void success(List result) { wrapped.add(0, result); reply.reply(wrapped); } @@ -5026,123 +5815,2839 @@ public void error(Throwable error) { } }; - api.callFlutterSmallApiEchoString(aStringArg, resultCallback); + api.echoAsyncNullableList(listArg, resultCallback); }); } else { channel.setMessageHandler(null); } } - } - } - /** - * The core interface that the Dart platform_test code implements for host integration tests to - * call into. - * - *

Generated class from Pigeon that represents Flutter messages that can be called from Java. - */ - public static class FlutterIntegrationCoreApi { - private final @NonNull BinaryMessenger binaryMessenger; - private final String messageChannelSuffix; + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableEnumList" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + List enumListArg = (List) args.get(0); + NullableResult> resultCallback = + new NullableResult>() { + public void success(List result) { + wrapped.add(0, result); + reply.reply(wrapped); + } - public FlutterIntegrationCoreApi(@NonNull BinaryMessenger argBinaryMessenger) { - this(argBinaryMessenger, ""); - } + public void error(Throwable error) { + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); + } + }; - public FlutterIntegrationCoreApi( - @NonNull BinaryMessenger argBinaryMessenger, @NonNull String messageChannelSuffix) { - this.binaryMessenger = argBinaryMessenger; - this.messageChannelSuffix = messageChannelSuffix.isEmpty() ? "" : "." + messageChannelSuffix; - } + api.echoAsyncNullableEnumList(enumListArg, resultCallback); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableClassList" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + List classListArg = (List) args.get(0); + NullableResult> resultCallback = + new NullableResult>() { + public void success(List result) { + wrapped.add(0, result); + reply.reply(wrapped); + } - /** Public interface for sending reply. The codec used by FlutterIntegrationCoreApi. */ - static @NonNull MessageCodec getCodec() { - return PigeonCodec.INSTANCE; - } - /** - * A no-op function taking no arguments and returning no value, to sanity test basic calling. - */ - public void noop(@NonNull VoidResult result) { - final String channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noop" - + messageChannelSuffix; - BasicMessageChannel channel = - new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); - channel.send( - null, - channelReply -> { - if (channelReply instanceof List) { - List listReply = (List) channelReply; - if (listReply.size() > 1) { - result.error( - new FlutterError( - (String) listReply.get(0), (String) listReply.get(1), listReply.get(2))); - } else { - result.success(); - } - } else { - result.error(createConnectionError(channelName)); - } - }); - } - /** Responds with an error from an async function returning a value. */ - public void throwError(@NonNull NullableResult result) { - final String channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwError" - + messageChannelSuffix; - BasicMessageChannel channel = - new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); - channel.send( - null, - channelReply -> { - if (channelReply instanceof List) { - List listReply = (List) channelReply; - if (listReply.size() > 1) { - result.error( - new FlutterError( - (String) listReply.get(0), (String) listReply.get(1), listReply.get(2))); - } else { - @SuppressWarnings("ConstantConditions") - Object output = listReply.get(0); - result.success(output); - } - } else { - result.error(createConnectionError(channelName)); - } - }); - } - /** Responds with an error from an async void function. */ - public void throwErrorFromVoid(@NonNull VoidResult result) { - final String channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwErrorFromVoid" - + messageChannelSuffix; - BasicMessageChannel channel = - new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); - channel.send( - null, - channelReply -> { - if (channelReply instanceof List) { - List listReply = (List) channelReply; - if (listReply.size() > 1) { - result.error( - new FlutterError( - (String) listReply.get(0), (String) listReply.get(1), listReply.get(2))); - } else { - result.success(); + public void error(Throwable error) { + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); + } + }; + + api.echoAsyncNullableClassList(classListArg, resultCallback); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableMap" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + Map mapArg = (Map) args.get(0); + NullableResult> resultCallback = + new NullableResult>() { + public void success(Map result) { + wrapped.add(0, result); + reply.reply(wrapped); + } + + public void error(Throwable error) { + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); + } + }; + + api.echoAsyncNullableMap(mapArg, resultCallback); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableStringMap" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + Map stringMapArg = (Map) args.get(0); + NullableResult> resultCallback = + new NullableResult>() { + public void success(Map result) { + wrapped.add(0, result); + reply.reply(wrapped); + } + + public void error(Throwable error) { + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); + } + }; + + api.echoAsyncNullableStringMap(stringMapArg, resultCallback); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableIntMap" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + Map intMapArg = (Map) args.get(0); + NullableResult> resultCallback = + new NullableResult>() { + public void success(Map result) { + wrapped.add(0, result); + reply.reply(wrapped); + } + + public void error(Throwable error) { + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); + } + }; + + api.echoAsyncNullableIntMap(intMapArg, resultCallback); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableEnumMap" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + Map enumMapArg = (Map) args.get(0); + NullableResult> resultCallback = + new NullableResult>() { + public void success(Map result) { + wrapped.add(0, result); + reply.reply(wrapped); + } + + public void error(Throwable error) { + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); + } + }; + + api.echoAsyncNullableEnumMap(enumMapArg, resultCallback); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableClassMap" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + Map classMapArg = (Map) args.get(0); + NullableResult> resultCallback = + new NullableResult>() { + public void success(Map result) { + wrapped.add(0, result); + reply.reply(wrapped); + } + + public void error(Throwable error) { + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); + } + }; + + api.echoAsyncNullableClassMap(classMapArg, resultCallback); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableEnum" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + AnEnum anEnumArg = (AnEnum) args.get(0); + NullableResult resultCallback = + new NullableResult() { + public void success(AnEnum result) { + wrapped.add(0, result); + reply.reply(wrapped); + } + + public void error(Throwable error) { + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); + } + }; + + api.echoAsyncNullableEnum(anEnumArg, resultCallback); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAnotherAsyncNullableEnum" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + AnotherEnum anotherEnumArg = (AnotherEnum) args.get(0); + NullableResult resultCallback = + new NullableResult() { + public void success(AnotherEnum result) { + wrapped.add(0, result); + reply.reply(wrapped); + } + + public void error(Throwable error) { + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); + } + }; + + api.echoAnotherAsyncNullableEnum(anotherEnumArg, resultCallback); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterNoop" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + VoidResult resultCallback = + new VoidResult() { + public void success() { + wrapped.add(0, null); + reply.reply(wrapped); + } + + public void error(Throwable error) { + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); + } + }; + + api.callFlutterNoop(resultCallback); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterThrowError" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + NullableResult resultCallback = + new NullableResult() { + public void success(Object result) { + wrapped.add(0, result); + reply.reply(wrapped); + } + + public void error(Throwable error) { + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); + } + }; + + api.callFlutterThrowError(resultCallback); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterThrowErrorFromVoid" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + VoidResult resultCallback = + new VoidResult() { + public void success() { + wrapped.add(0, null); + reply.reply(wrapped); + } + + public void error(Throwable error) { + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); + } + }; + + api.callFlutterThrowErrorFromVoid(resultCallback); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllTypes" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + AllTypes everythingArg = (AllTypes) args.get(0); + Result resultCallback = + new Result() { + public void success(AllTypes result) { + wrapped.add(0, result); + reply.reply(wrapped); + } + + public void error(Throwable error) { + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); + } + }; + + api.callFlutterEchoAllTypes(everythingArg, resultCallback); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllNullableTypes" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + AllNullableTypes everythingArg = (AllNullableTypes) args.get(0); + NullableResult resultCallback = + new NullableResult() { + public void success(AllNullableTypes result) { + wrapped.add(0, result); + reply.reply(wrapped); + } + + public void error(Throwable error) { + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); + } + }; + + api.callFlutterEchoAllNullableTypes(everythingArg, resultCallback); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypes" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + Boolean aNullableBoolArg = (Boolean) args.get(0); + Long aNullableIntArg = (Long) args.get(1); + String aNullableStringArg = (String) args.get(2); + Result resultCallback = + new Result() { + public void success(AllNullableTypes result) { + wrapped.add(0, result); + reply.reply(wrapped); + } + + public void error(Throwable error) { + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); + } + }; + + api.callFlutterSendMultipleNullableTypes( + aNullableBoolArg, aNullableIntArg, aNullableStringArg, resultCallback); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllNullableTypesWithoutRecursion" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + AllNullableTypesWithoutRecursion everythingArg = + (AllNullableTypesWithoutRecursion) args.get(0); + NullableResult resultCallback = + new NullableResult() { + public void success(AllNullableTypesWithoutRecursion result) { + wrapped.add(0, result); + reply.reply(wrapped); + } + + public void error(Throwable error) { + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); + } + }; + + api.callFlutterEchoAllNullableTypesWithoutRecursion(everythingArg, resultCallback); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypesWithoutRecursion" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + Boolean aNullableBoolArg = (Boolean) args.get(0); + Long aNullableIntArg = (Long) args.get(1); + String aNullableStringArg = (String) args.get(2); + Result resultCallback = + new Result() { + public void success(AllNullableTypesWithoutRecursion result) { + wrapped.add(0, result); + reply.reply(wrapped); + } + + public void error(Throwable error) { + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); + } + }; + + api.callFlutterSendMultipleNullableTypesWithoutRecursion( + aNullableBoolArg, aNullableIntArg, aNullableStringArg, resultCallback); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoBool" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + Boolean aBoolArg = (Boolean) args.get(0); + Result resultCallback = + new Result() { + public void success(Boolean result) { + wrapped.add(0, result); + reply.reply(wrapped); + } + + public void error(Throwable error) { + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); + } + }; + + api.callFlutterEchoBool(aBoolArg, resultCallback); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoInt" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + Long anIntArg = (Long) args.get(0); + Result resultCallback = + new Result() { + public void success(Long result) { + wrapped.add(0, result); + reply.reply(wrapped); + } + + public void error(Throwable error) { + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); + } + }; + + api.callFlutterEchoInt(anIntArg, resultCallback); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoDouble" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + Double aDoubleArg = (Double) args.get(0); + Result resultCallback = + new Result() { + public void success(Double result) { + wrapped.add(0, result); + reply.reply(wrapped); + } + + public void error(Throwable error) { + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); + } + }; + + api.callFlutterEchoDouble(aDoubleArg, resultCallback); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoString" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + String aStringArg = (String) args.get(0); + Result resultCallback = + new Result() { + public void success(String result) { + wrapped.add(0, result); + reply.reply(wrapped); + } + + public void error(Throwable error) { + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); + } + }; + + api.callFlutterEchoString(aStringArg, resultCallback); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoUint8List" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + byte[] listArg = (byte[]) args.get(0); + Result resultCallback = + new Result() { + public void success(byte[] result) { + wrapped.add(0, result); + reply.reply(wrapped); + } + + public void error(Throwable error) { + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); + } + }; + + api.callFlutterEchoUint8List(listArg, resultCallback); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoList" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + List listArg = (List) args.get(0); + Result> resultCallback = + new Result>() { + public void success(List result) { + wrapped.add(0, result); + reply.reply(wrapped); + } + + public void error(Throwable error) { + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); + } + }; + + api.callFlutterEchoList(listArg, resultCallback); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoEnumList" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + List enumListArg = (List) args.get(0); + Result> resultCallback = + new Result>() { + public void success(List result) { + wrapped.add(0, result); + reply.reply(wrapped); + } + + public void error(Throwable error) { + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); + } + }; + + api.callFlutterEchoEnumList(enumListArg, resultCallback); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoClassList" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + List classListArg = (List) args.get(0); + Result> resultCallback = + new Result>() { + public void success(List result) { + wrapped.add(0, result); + reply.reply(wrapped); + } + + public void error(Throwable error) { + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); + } + }; + + api.callFlutterEchoClassList(classListArg, resultCallback); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNonNullEnumList" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + List enumListArg = (List) args.get(0); + Result> resultCallback = + new Result>() { + public void success(List result) { + wrapped.add(0, result); + reply.reply(wrapped); + } + + public void error(Throwable error) { + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); + } + }; + + api.callFlutterEchoNonNullEnumList(enumListArg, resultCallback); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNonNullClassList" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + List classListArg = (List) args.get(0); + Result> resultCallback = + new Result>() { + public void success(List result) { + wrapped.add(0, result); + reply.reply(wrapped); + } + + public void error(Throwable error) { + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); + } + }; + + api.callFlutterEchoNonNullClassList(classListArg, resultCallback); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoMap" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + Map mapArg = (Map) args.get(0); + Result> resultCallback = + new Result>() { + public void success(Map result) { + wrapped.add(0, result); + reply.reply(wrapped); + } + + public void error(Throwable error) { + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); + } + }; + + api.callFlutterEchoMap(mapArg, resultCallback); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoStringMap" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + Map stringMapArg = (Map) args.get(0); + Result> resultCallback = + new Result>() { + public void success(Map result) { + wrapped.add(0, result); + reply.reply(wrapped); + } + + public void error(Throwable error) { + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); + } + }; + + api.callFlutterEchoStringMap(stringMapArg, resultCallback); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoIntMap" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + Map intMapArg = (Map) args.get(0); + Result> resultCallback = + new Result>() { + public void success(Map result) { + wrapped.add(0, result); + reply.reply(wrapped); + } + + public void error(Throwable error) { + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); + } + }; + + api.callFlutterEchoIntMap(intMapArg, resultCallback); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoEnumMap" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + Map enumMapArg = (Map) args.get(0); + Result> resultCallback = + new Result>() { + public void success(Map result) { + wrapped.add(0, result); + reply.reply(wrapped); + } + + public void error(Throwable error) { + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); + } + }; + + api.callFlutterEchoEnumMap(enumMapArg, resultCallback); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoClassMap" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + Map classMapArg = (Map) args.get(0); + Result> resultCallback = + new Result>() { + public void success(Map result) { + wrapped.add(0, result); + reply.reply(wrapped); + } + + public void error(Throwable error) { + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); + } + }; + + api.callFlutterEchoClassMap(classMapArg, resultCallback); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNonNullStringMap" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + Map stringMapArg = (Map) args.get(0); + Result> resultCallback = + new Result>() { + public void success(Map result) { + wrapped.add(0, result); + reply.reply(wrapped); + } + + public void error(Throwable error) { + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); + } + }; + + api.callFlutterEchoNonNullStringMap(stringMapArg, resultCallback); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNonNullIntMap" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + Map intMapArg = (Map) args.get(0); + Result> resultCallback = + new Result>() { + public void success(Map result) { + wrapped.add(0, result); + reply.reply(wrapped); + } + + public void error(Throwable error) { + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); + } + }; + + api.callFlutterEchoNonNullIntMap(intMapArg, resultCallback); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNonNullEnumMap" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + Map enumMapArg = (Map) args.get(0); + Result> resultCallback = + new Result>() { + public void success(Map result) { + wrapped.add(0, result); + reply.reply(wrapped); + } + + public void error(Throwable error) { + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); + } + }; + + api.callFlutterEchoNonNullEnumMap(enumMapArg, resultCallback); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNonNullClassMap" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + Map classMapArg = (Map) args.get(0); + Result> resultCallback = + new Result>() { + public void success(Map result) { + wrapped.add(0, result); + reply.reply(wrapped); + } + + public void error(Throwable error) { + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); + } + }; + + api.callFlutterEchoNonNullClassMap(classMapArg, resultCallback); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoEnum" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + AnEnum anEnumArg = (AnEnum) args.get(0); + Result resultCallback = + new Result() { + public void success(AnEnum result) { + wrapped.add(0, result); + reply.reply(wrapped); + } + + public void error(Throwable error) { + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); + } + }; + + api.callFlutterEchoEnum(anEnumArg, resultCallback); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAnotherEnum" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + AnotherEnum anotherEnumArg = (AnotherEnum) args.get(0); + Result resultCallback = + new Result() { + public void success(AnotherEnum result) { + wrapped.add(0, result); + reply.reply(wrapped); + } + + public void error(Throwable error) { + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); + } + }; + + api.callFlutterEchoAnotherEnum(anotherEnumArg, resultCallback); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableBool" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + Boolean aBoolArg = (Boolean) args.get(0); + NullableResult resultCallback = + new NullableResult() { + public void success(Boolean result) { + wrapped.add(0, result); + reply.reply(wrapped); + } + + public void error(Throwable error) { + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); + } + }; + + api.callFlutterEchoNullableBool(aBoolArg, resultCallback); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableInt" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + Long anIntArg = (Long) args.get(0); + NullableResult resultCallback = + new NullableResult() { + public void success(Long result) { + wrapped.add(0, result); + reply.reply(wrapped); + } + + public void error(Throwable error) { + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); + } + }; + + api.callFlutterEchoNullableInt(anIntArg, resultCallback); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableDouble" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + Double aDoubleArg = (Double) args.get(0); + NullableResult resultCallback = + new NullableResult() { + public void success(Double result) { + wrapped.add(0, result); + reply.reply(wrapped); + } + + public void error(Throwable error) { + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); + } + }; + + api.callFlutterEchoNullableDouble(aDoubleArg, resultCallback); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableString" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + String aStringArg = (String) args.get(0); + NullableResult resultCallback = + new NullableResult() { + public void success(String result) { + wrapped.add(0, result); + reply.reply(wrapped); + } + + public void error(Throwable error) { + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); + } + }; + + api.callFlutterEchoNullableString(aStringArg, resultCallback); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableUint8List" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + byte[] listArg = (byte[]) args.get(0); + NullableResult resultCallback = + new NullableResult() { + public void success(byte[] result) { + wrapped.add(0, result); + reply.reply(wrapped); + } + + public void error(Throwable error) { + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); + } + }; + + api.callFlutterEchoNullableUint8List(listArg, resultCallback); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableList" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + List listArg = (List) args.get(0); + NullableResult> resultCallback = + new NullableResult>() { + public void success(List result) { + wrapped.add(0, result); + reply.reply(wrapped); + } + + public void error(Throwable error) { + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); + } + }; + + api.callFlutterEchoNullableList(listArg, resultCallback); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableEnumList" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + List enumListArg = (List) args.get(0); + NullableResult> resultCallback = + new NullableResult>() { + public void success(List result) { + wrapped.add(0, result); + reply.reply(wrapped); + } + + public void error(Throwable error) { + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); + } + }; + + api.callFlutterEchoNullableEnumList(enumListArg, resultCallback); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableClassList" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + List classListArg = (List) args.get(0); + NullableResult> resultCallback = + new NullableResult>() { + public void success(List result) { + wrapped.add(0, result); + reply.reply(wrapped); + } + + public void error(Throwable error) { + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); + } + }; + + api.callFlutterEchoNullableClassList(classListArg, resultCallback); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableNonNullEnumList" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + List enumListArg = (List) args.get(0); + NullableResult> resultCallback = + new NullableResult>() { + public void success(List result) { + wrapped.add(0, result); + reply.reply(wrapped); + } + + public void error(Throwable error) { + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); + } + }; + + api.callFlutterEchoNullableNonNullEnumList(enumListArg, resultCallback); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableNonNullClassList" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + List classListArg = (List) args.get(0); + NullableResult> resultCallback = + new NullableResult>() { + public void success(List result) { + wrapped.add(0, result); + reply.reply(wrapped); + } + + public void error(Throwable error) { + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); + } + }; + + api.callFlutterEchoNullableNonNullClassList(classListArg, resultCallback); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableMap" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + Map mapArg = (Map) args.get(0); + NullableResult> resultCallback = + new NullableResult>() { + public void success(Map result) { + wrapped.add(0, result); + reply.reply(wrapped); + } + + public void error(Throwable error) { + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); + } + }; + + api.callFlutterEchoNullableMap(mapArg, resultCallback); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableStringMap" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + Map stringMapArg = (Map) args.get(0); + NullableResult> resultCallback = + new NullableResult>() { + public void success(Map result) { + wrapped.add(0, result); + reply.reply(wrapped); + } + + public void error(Throwable error) { + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); + } + }; + + api.callFlutterEchoNullableStringMap(stringMapArg, resultCallback); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableIntMap" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + Map intMapArg = (Map) args.get(0); + NullableResult> resultCallback = + new NullableResult>() { + public void success(Map result) { + wrapped.add(0, result); + reply.reply(wrapped); + } + + public void error(Throwable error) { + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); + } + }; + + api.callFlutterEchoNullableIntMap(intMapArg, resultCallback); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableEnumMap" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + Map enumMapArg = (Map) args.get(0); + NullableResult> resultCallback = + new NullableResult>() { + public void success(Map result) { + wrapped.add(0, result); + reply.reply(wrapped); + } + + public void error(Throwable error) { + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); + } + }; + + api.callFlutterEchoNullableEnumMap(enumMapArg, resultCallback); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableClassMap" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + Map classMapArg = (Map) args.get(0); + NullableResult> resultCallback = + new NullableResult>() { + public void success(Map result) { + wrapped.add(0, result); + reply.reply(wrapped); + } + + public void error(Throwable error) { + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); + } + }; + + api.callFlutterEchoNullableClassMap(classMapArg, resultCallback); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableNonNullStringMap" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + Map stringMapArg = (Map) args.get(0); + NullableResult> resultCallback = + new NullableResult>() { + public void success(Map result) { + wrapped.add(0, result); + reply.reply(wrapped); + } + + public void error(Throwable error) { + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); + } + }; + + api.callFlutterEchoNullableNonNullStringMap(stringMapArg, resultCallback); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableNonNullIntMap" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + Map intMapArg = (Map) args.get(0); + NullableResult> resultCallback = + new NullableResult>() { + public void success(Map result) { + wrapped.add(0, result); + reply.reply(wrapped); + } + + public void error(Throwable error) { + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); + } + }; + + api.callFlutterEchoNullableNonNullIntMap(intMapArg, resultCallback); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableNonNullEnumMap" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + Map enumMapArg = (Map) args.get(0); + NullableResult> resultCallback = + new NullableResult>() { + public void success(Map result) { + wrapped.add(0, result); + reply.reply(wrapped); + } + + public void error(Throwable error) { + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); + } + }; + + api.callFlutterEchoNullableNonNullEnumMap(enumMapArg, resultCallback); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableNonNullClassMap" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + Map classMapArg = (Map) args.get(0); + NullableResult> resultCallback = + new NullableResult>() { + public void success(Map result) { + wrapped.add(0, result); + reply.reply(wrapped); + } + + public void error(Throwable error) { + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); + } + }; + + api.callFlutterEchoNullableNonNullClassMap(classMapArg, resultCallback); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableEnum" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + AnEnum anEnumArg = (AnEnum) args.get(0); + NullableResult resultCallback = + new NullableResult() { + public void success(AnEnum result) { + wrapped.add(0, result); + reply.reply(wrapped); + } + + public void error(Throwable error) { + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); + } + }; + + api.callFlutterEchoNullableEnum(anEnumArg, resultCallback); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAnotherNullableEnum" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + AnotherEnum anotherEnumArg = (AnotherEnum) args.get(0); + NullableResult resultCallback = + new NullableResult() { + public void success(AnotherEnum result) { + wrapped.add(0, result); + reply.reply(wrapped); + } + + public void error(Throwable error) { + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); + } + }; + + api.callFlutterEchoAnotherNullableEnum(anotherEnumArg, resultCallback); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSmallApiEchoString" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + String aStringArg = (String) args.get(0); + Result resultCallback = + new Result() { + public void success(String result) { + wrapped.add(0, result); + reply.reply(wrapped); + } + + public void error(Throwable error) { + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); + } + }; + + api.callFlutterSmallApiEchoString(aStringArg, resultCallback); + }); + } else { + channel.setMessageHandler(null); + } + } + } + } + /** + * The core interface that the Dart platform_test code implements for host integration tests to + * call into. + * + *

Generated class from Pigeon that represents Flutter messages that can be called from Java. + */ + public static class FlutterIntegrationCoreApi { + private final @NonNull BinaryMessenger binaryMessenger; + private final String messageChannelSuffix; + + public FlutterIntegrationCoreApi(@NonNull BinaryMessenger argBinaryMessenger) { + this(argBinaryMessenger, ""); + } + + public FlutterIntegrationCoreApi( + @NonNull BinaryMessenger argBinaryMessenger, @NonNull String messageChannelSuffix) { + this.binaryMessenger = argBinaryMessenger; + this.messageChannelSuffix = messageChannelSuffix.isEmpty() ? "" : "." + messageChannelSuffix; + } + + /** Public interface for sending reply. The codec used by FlutterIntegrationCoreApi. */ + static @NonNull MessageCodec getCodec() { + return PigeonCodec.INSTANCE; + } + /** + * A no-op function taking no arguments and returning no value, to sanity test basic calling. + */ + public void noop(@NonNull VoidResult result) { + final String channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noop" + + messageChannelSuffix; + BasicMessageChannel channel = + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + channel.send( + null, + channelReply -> { + if (channelReply instanceof List) { + List listReply = (List) channelReply; + if (listReply.size() > 1) { + result.error( + new FlutterError( + (String) listReply.get(0), (String) listReply.get(1), listReply.get(2))); + } else { + result.success(); + } + } else { + result.error(createConnectionError(channelName)); + } + }); + } + /** Responds with an error from an async function returning a value. */ + public void throwError(@NonNull NullableResult result) { + final String channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwError" + + messageChannelSuffix; + BasicMessageChannel channel = + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + channel.send( + null, + channelReply -> { + if (channelReply instanceof List) { + List listReply = (List) channelReply; + if (listReply.size() > 1) { + result.error( + new FlutterError( + (String) listReply.get(0), (String) listReply.get(1), listReply.get(2))); + } else { + @SuppressWarnings("ConstantConditions") + Object output = listReply.get(0); + result.success(output); + } + } else { + result.error(createConnectionError(channelName)); + } + }); + } + /** Responds with an error from an async void function. */ + public void throwErrorFromVoid(@NonNull VoidResult result) { + final String channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwErrorFromVoid" + + messageChannelSuffix; + BasicMessageChannel channel = + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + channel.send( + null, + channelReply -> { + if (channelReply instanceof List) { + List listReply = (List) channelReply; + if (listReply.size() > 1) { + result.error( + new FlutterError( + (String) listReply.get(0), (String) listReply.get(1), listReply.get(2))); + } else { + result.success(); + } + } else { + result.error(createConnectionError(channelName)); + } + }); + } + /** Returns the passed object, to test serialization and deserialization. */ + public void echoAllTypes(@NonNull AllTypes everythingArg, @NonNull Result result) { + final String channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllTypes" + + messageChannelSuffix; + BasicMessageChannel channel = + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + channel.send( + new ArrayList<>(Collections.singletonList(everythingArg)), + channelReply -> { + if (channelReply instanceof List) { + List listReply = (List) channelReply; + if (listReply.size() > 1) { + result.error( + new FlutterError( + (String) listReply.get(0), (String) listReply.get(1), listReply.get(2))); + } else if (listReply.get(0) == null) { + result.error( + new FlutterError( + "null-error", + "Flutter api returned null value for non-null return value.", + "")); + } else { + @SuppressWarnings("ConstantConditions") + AllTypes output = (AllTypes) listReply.get(0); + result.success(output); + } + } else { + result.error(createConnectionError(channelName)); + } + }); + } + /** Returns the passed object, to test serialization and deserialization. */ + public void echoAllNullableTypes( + @Nullable AllNullableTypes everythingArg, + @NonNull NullableResult result) { + final String channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypes" + + messageChannelSuffix; + BasicMessageChannel channel = + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + channel.send( + new ArrayList<>(Collections.singletonList(everythingArg)), + channelReply -> { + if (channelReply instanceof List) { + List listReply = (List) channelReply; + if (listReply.size() > 1) { + result.error( + new FlutterError( + (String) listReply.get(0), (String) listReply.get(1), listReply.get(2))); + } else { + @SuppressWarnings("ConstantConditions") + AllNullableTypes output = (AllNullableTypes) listReply.get(0); + result.success(output); + } + } else { + result.error(createConnectionError(channelName)); + } + }); + } + /** + * Returns passed in arguments of multiple types. + * + *

Tests multiple-arity FlutterApi handling. + */ + public void sendMultipleNullableTypes( + @Nullable Boolean aNullableBoolArg, + @Nullable Long aNullableIntArg, + @Nullable String aNullableStringArg, + @NonNull Result result) { + final String channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypes" + + messageChannelSuffix; + BasicMessageChannel channel = + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + channel.send( + new ArrayList<>(Arrays.asList(aNullableBoolArg, aNullableIntArg, aNullableStringArg)), + channelReply -> { + if (channelReply instanceof List) { + List listReply = (List) channelReply; + if (listReply.size() > 1) { + result.error( + new FlutterError( + (String) listReply.get(0), (String) listReply.get(1), listReply.get(2))); + } else if (listReply.get(0) == null) { + result.error( + new FlutterError( + "null-error", + "Flutter api returned null value for non-null return value.", + "")); + } else { + @SuppressWarnings("ConstantConditions") + AllNullableTypes output = (AllNullableTypes) listReply.get(0); + result.success(output); + } + } else { + result.error(createConnectionError(channelName)); + } + }); + } + /** Returns the passed object, to test serialization and deserialization. */ + public void echoAllNullableTypesWithoutRecursion( + @Nullable AllNullableTypesWithoutRecursion everythingArg, + @NonNull NullableResult result) { + final String channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypesWithoutRecursion" + + messageChannelSuffix; + BasicMessageChannel channel = + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + channel.send( + new ArrayList<>(Collections.singletonList(everythingArg)), + channelReply -> { + if (channelReply instanceof List) { + List listReply = (List) channelReply; + if (listReply.size() > 1) { + result.error( + new FlutterError( + (String) listReply.get(0), (String) listReply.get(1), listReply.get(2))); + } else { + @SuppressWarnings("ConstantConditions") + AllNullableTypesWithoutRecursion output = + (AllNullableTypesWithoutRecursion) listReply.get(0); + result.success(output); + } + } else { + result.error(createConnectionError(channelName)); + } + }); + } + /** + * Returns passed in arguments of multiple types. + * + *

Tests multiple-arity FlutterApi handling. + */ + public void sendMultipleNullableTypesWithoutRecursion( + @Nullable Boolean aNullableBoolArg, + @Nullable Long aNullableIntArg, + @Nullable String aNullableStringArg, + @NonNull Result result) { + final String channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion" + + messageChannelSuffix; + BasicMessageChannel channel = + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + channel.send( + new ArrayList<>(Arrays.asList(aNullableBoolArg, aNullableIntArg, aNullableStringArg)), + channelReply -> { + if (channelReply instanceof List) { + List listReply = (List) channelReply; + if (listReply.size() > 1) { + result.error( + new FlutterError( + (String) listReply.get(0), (String) listReply.get(1), listReply.get(2))); + } else if (listReply.get(0) == null) { + result.error( + new FlutterError( + "null-error", + "Flutter api returned null value for non-null return value.", + "")); + } else { + @SuppressWarnings("ConstantConditions") + AllNullableTypesWithoutRecursion output = + (AllNullableTypesWithoutRecursion) listReply.get(0); + result.success(output); + } + } else { + result.error(createConnectionError(channelName)); + } + }); + } + /** Returns the passed boolean, to test serialization and deserialization. */ + public void echoBool(@NonNull Boolean aBoolArg, @NonNull Result result) { + final String channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoBool" + + messageChannelSuffix; + BasicMessageChannel channel = + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + channel.send( + new ArrayList<>(Collections.singletonList(aBoolArg)), + channelReply -> { + if (channelReply instanceof List) { + List listReply = (List) channelReply; + if (listReply.size() > 1) { + result.error( + new FlutterError( + (String) listReply.get(0), (String) listReply.get(1), listReply.get(2))); + } else if (listReply.get(0) == null) { + result.error( + new FlutterError( + "null-error", + "Flutter api returned null value for non-null return value.", + "")); + } else { + @SuppressWarnings("ConstantConditions") + Boolean output = (Boolean) listReply.get(0); + result.success(output); + } + } else { + result.error(createConnectionError(channelName)); + } + }); + } + /** Returns the passed int, to test serialization and deserialization. */ + public void echoInt(@NonNull Long anIntArg, @NonNull Result result) { + final String channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoInt" + + messageChannelSuffix; + BasicMessageChannel channel = + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + channel.send( + new ArrayList<>(Collections.singletonList(anIntArg)), + channelReply -> { + if (channelReply instanceof List) { + List listReply = (List) channelReply; + if (listReply.size() > 1) { + result.error( + new FlutterError( + (String) listReply.get(0), (String) listReply.get(1), listReply.get(2))); + } else if (listReply.get(0) == null) { + result.error( + new FlutterError( + "null-error", + "Flutter api returned null value for non-null return value.", + "")); + } else { + @SuppressWarnings("ConstantConditions") + Long output = (Long) listReply.get(0); + result.success(output); + } + } else { + result.error(createConnectionError(channelName)); + } + }); + } + /** Returns the passed double, to test serialization and deserialization. */ + public void echoDouble(@NonNull Double aDoubleArg, @NonNull Result result) { + final String channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoDouble" + + messageChannelSuffix; + BasicMessageChannel channel = + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + channel.send( + new ArrayList<>(Collections.singletonList(aDoubleArg)), + channelReply -> { + if (channelReply instanceof List) { + List listReply = (List) channelReply; + if (listReply.size() > 1) { + result.error( + new FlutterError( + (String) listReply.get(0), (String) listReply.get(1), listReply.get(2))); + } else if (listReply.get(0) == null) { + result.error( + new FlutterError( + "null-error", + "Flutter api returned null value for non-null return value.", + "")); + } else { + @SuppressWarnings("ConstantConditions") + Double output = (Double) listReply.get(0); + result.success(output); + } + } else { + result.error(createConnectionError(channelName)); + } + }); + } + /** Returns the passed string, to test serialization and deserialization. */ + public void echoString(@NonNull String aStringArg, @NonNull Result result) { + final String channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoString" + + messageChannelSuffix; + BasicMessageChannel channel = + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + channel.send( + new ArrayList<>(Collections.singletonList(aStringArg)), + channelReply -> { + if (channelReply instanceof List) { + List listReply = (List) channelReply; + if (listReply.size() > 1) { + result.error( + new FlutterError( + (String) listReply.get(0), (String) listReply.get(1), listReply.get(2))); + } else if (listReply.get(0) == null) { + result.error( + new FlutterError( + "null-error", + "Flutter api returned null value for non-null return value.", + "")); + } else { + @SuppressWarnings("ConstantConditions") + String output = (String) listReply.get(0); + result.success(output); + } + } else { + result.error(createConnectionError(channelName)); + } + }); + } + /** Returns the passed byte list, to test serialization and deserialization. */ + public void echoUint8List(@NonNull byte[] listArg, @NonNull Result result) { + final String channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoUint8List" + + messageChannelSuffix; + BasicMessageChannel channel = + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + channel.send( + new ArrayList<>(Collections.singletonList(listArg)), + channelReply -> { + if (channelReply instanceof List) { + List listReply = (List) channelReply; + if (listReply.size() > 1) { + result.error( + new FlutterError( + (String) listReply.get(0), (String) listReply.get(1), listReply.get(2))); + } else if (listReply.get(0) == null) { + result.error( + new FlutterError( + "null-error", + "Flutter api returned null value for non-null return value.", + "")); + } else { + @SuppressWarnings("ConstantConditions") + byte[] output = (byte[]) listReply.get(0); + result.success(output); + } + } else { + result.error(createConnectionError(channelName)); + } + }); + } + /** Returns the passed list, to test serialization and deserialization. */ + public void echoList(@NonNull List listArg, @NonNull Result> result) { + final String channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoList" + + messageChannelSuffix; + BasicMessageChannel channel = + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + channel.send( + new ArrayList<>(Collections.singletonList(listArg)), + channelReply -> { + if (channelReply instanceof List) { + List listReply = (List) channelReply; + if (listReply.size() > 1) { + result.error( + new FlutterError( + (String) listReply.get(0), (String) listReply.get(1), listReply.get(2))); + } else if (listReply.get(0) == null) { + result.error( + new FlutterError( + "null-error", + "Flutter api returned null value for non-null return value.", + "")); + } else { + @SuppressWarnings("ConstantConditions") + List output = (List) listReply.get(0); + result.success(output); + } + } else { + result.error(createConnectionError(channelName)); + } + }); + } + /** Returns the passed list, to test serialization and deserialization. */ + public void echoEnumList( + @NonNull List enumListArg, @NonNull Result> result) { + final String channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnumList" + + messageChannelSuffix; + BasicMessageChannel channel = + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + channel.send( + new ArrayList<>(Collections.singletonList(enumListArg)), + channelReply -> { + if (channelReply instanceof List) { + List listReply = (List) channelReply; + if (listReply.size() > 1) { + result.error( + new FlutterError( + (String) listReply.get(0), (String) listReply.get(1), listReply.get(2))); + } else if (listReply.get(0) == null) { + result.error( + new FlutterError( + "null-error", + "Flutter api returned null value for non-null return value.", + "")); + } else { + @SuppressWarnings("ConstantConditions") + List output = (List) listReply.get(0); + result.success(output); + } + } else { + result.error(createConnectionError(channelName)); + } + }); + } + /** Returns the passed list, to test serialization and deserialization. */ + public void echoClassList( + @NonNull List classListArg, + @NonNull Result> result) { + final String channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoClassList" + + messageChannelSuffix; + BasicMessageChannel channel = + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + channel.send( + new ArrayList<>(Collections.singletonList(classListArg)), + channelReply -> { + if (channelReply instanceof List) { + List listReply = (List) channelReply; + if (listReply.size() > 1) { + result.error( + new FlutterError( + (String) listReply.get(0), (String) listReply.get(1), listReply.get(2))); + } else if (listReply.get(0) == null) { + result.error( + new FlutterError( + "null-error", + "Flutter api returned null value for non-null return value.", + "")); + } else { + @SuppressWarnings("ConstantConditions") + List output = (List) listReply.get(0); + result.success(output); + } + } else { + result.error(createConnectionError(channelName)); + } + }); + } + /** Returns the passed list, to test serialization and deserialization. */ + public void echoNonNullEnumList( + @NonNull List enumListArg, @NonNull Result> result) { + final String channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNonNullEnumList" + + messageChannelSuffix; + BasicMessageChannel channel = + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + channel.send( + new ArrayList<>(Collections.singletonList(enumListArg)), + channelReply -> { + if (channelReply instanceof List) { + List listReply = (List) channelReply; + if (listReply.size() > 1) { + result.error( + new FlutterError( + (String) listReply.get(0), (String) listReply.get(1), listReply.get(2))); + } else if (listReply.get(0) == null) { + result.error( + new FlutterError( + "null-error", + "Flutter api returned null value for non-null return value.", + "")); + } else { + @SuppressWarnings("ConstantConditions") + List output = (List) listReply.get(0); + result.success(output); + } + } else { + result.error(createConnectionError(channelName)); + } + }); + } + /** Returns the passed list, to test serialization and deserialization. */ + public void echoNonNullClassList( + @NonNull List classListArg, + @NonNull Result> result) { + final String channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNonNullClassList" + + messageChannelSuffix; + BasicMessageChannel channel = + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + channel.send( + new ArrayList<>(Collections.singletonList(classListArg)), + channelReply -> { + if (channelReply instanceof List) { + List listReply = (List) channelReply; + if (listReply.size() > 1) { + result.error( + new FlutterError( + (String) listReply.get(0), (String) listReply.get(1), listReply.get(2))); + } else if (listReply.get(0) == null) { + result.error( + new FlutterError( + "null-error", + "Flutter api returned null value for non-null return value.", + "")); + } else { + @SuppressWarnings("ConstantConditions") + List output = (List) listReply.get(0); + result.success(output); + } + } else { + result.error(createConnectionError(channelName)); + } + }); + } + /** Returns the passed map, to test serialization and deserialization. */ + public void echoMap( + @NonNull Map mapArg, @NonNull Result> result) { + final String channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoMap" + + messageChannelSuffix; + BasicMessageChannel channel = + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + channel.send( + new ArrayList<>(Collections.singletonList(mapArg)), + channelReply -> { + if (channelReply instanceof List) { + List listReply = (List) channelReply; + if (listReply.size() > 1) { + result.error( + new FlutterError( + (String) listReply.get(0), (String) listReply.get(1), listReply.get(2))); + } else if (listReply.get(0) == null) { + result.error( + new FlutterError( + "null-error", + "Flutter api returned null value for non-null return value.", + "")); + } else { + @SuppressWarnings("ConstantConditions") + Map output = (Map) listReply.get(0); + result.success(output); + } + } else { + result.error(createConnectionError(channelName)); + } + }); + } + /** Returns the passed map, to test serialization and deserialization. */ + public void echoStringMap( + @NonNull Map stringMapArg, @NonNull Result> result) { + final String channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoStringMap" + + messageChannelSuffix; + BasicMessageChannel channel = + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + channel.send( + new ArrayList<>(Collections.singletonList(stringMapArg)), + channelReply -> { + if (channelReply instanceof List) { + List listReply = (List) channelReply; + if (listReply.size() > 1) { + result.error( + new FlutterError( + (String) listReply.get(0), (String) listReply.get(1), listReply.get(2))); + } else if (listReply.get(0) == null) { + result.error( + new FlutterError( + "null-error", + "Flutter api returned null value for non-null return value.", + "")); + } else { + @SuppressWarnings("ConstantConditions") + Map output = (Map) listReply.get(0); + result.success(output); + } + } else { + result.error(createConnectionError(channelName)); + } + }); + } + /** Returns the passed map, to test serialization and deserialization. */ + public void echoIntMap( + @NonNull Map intMapArg, @NonNull Result> result) { + final String channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoIntMap" + + messageChannelSuffix; + BasicMessageChannel channel = + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + channel.send( + new ArrayList<>(Collections.singletonList(intMapArg)), + channelReply -> { + if (channelReply instanceof List) { + List listReply = (List) channelReply; + if (listReply.size() > 1) { + result.error( + new FlutterError( + (String) listReply.get(0), (String) listReply.get(1), listReply.get(2))); + } else if (listReply.get(0) == null) { + result.error( + new FlutterError( + "null-error", + "Flutter api returned null value for non-null return value.", + "")); + } else { + @SuppressWarnings("ConstantConditions") + Map output = (Map) listReply.get(0); + result.success(output); + } + } else { + result.error(createConnectionError(channelName)); + } + }); + } + /** Returns the passed map, to test serialization and deserialization. */ + public void echoEnumMap( + @NonNull Map enumMapArg, @NonNull Result> result) { + final String channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnumMap" + + messageChannelSuffix; + BasicMessageChannel channel = + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + channel.send( + new ArrayList<>(Collections.singletonList(enumMapArg)), + channelReply -> { + if (channelReply instanceof List) { + List listReply = (List) channelReply; + if (listReply.size() > 1) { + result.error( + new FlutterError( + (String) listReply.get(0), (String) listReply.get(1), listReply.get(2))); + } else if (listReply.get(0) == null) { + result.error( + new FlutterError( + "null-error", + "Flutter api returned null value for non-null return value.", + "")); + } else { + @SuppressWarnings("ConstantConditions") + Map output = (Map) listReply.get(0); + result.success(output); + } + } else { + result.error(createConnectionError(channelName)); + } + }); + } + /** Returns the passed map, to test serialization and deserialization. */ + public void echoClassMap( + @NonNull Map classMapArg, + @NonNull Result> result) { + final String channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoClassMap" + + messageChannelSuffix; + BasicMessageChannel channel = + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + channel.send( + new ArrayList<>(Collections.singletonList(classMapArg)), + channelReply -> { + if (channelReply instanceof List) { + List listReply = (List) channelReply; + if (listReply.size() > 1) { + result.error( + new FlutterError( + (String) listReply.get(0), (String) listReply.get(1), listReply.get(2))); + } else if (listReply.get(0) == null) { + result.error( + new FlutterError( + "null-error", + "Flutter api returned null value for non-null return value.", + "")); + } else { + @SuppressWarnings("ConstantConditions") + Map output = (Map) listReply.get(0); + result.success(output); + } + } else { + result.error(createConnectionError(channelName)); + } + }); + } + /** Returns the passed map, to test serialization and deserialization. */ + public void echoNonNullStringMap( + @NonNull Map stringMapArg, @NonNull Result> result) { + final String channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNonNullStringMap" + + messageChannelSuffix; + BasicMessageChannel channel = + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + channel.send( + new ArrayList<>(Collections.singletonList(stringMapArg)), + channelReply -> { + if (channelReply instanceof List) { + List listReply = (List) channelReply; + if (listReply.size() > 1) { + result.error( + new FlutterError( + (String) listReply.get(0), (String) listReply.get(1), listReply.get(2))); + } else if (listReply.get(0) == null) { + result.error( + new FlutterError( + "null-error", + "Flutter api returned null value for non-null return value.", + "")); + } else { + @SuppressWarnings("ConstantConditions") + Map output = (Map) listReply.get(0); + result.success(output); + } + } else { + result.error(createConnectionError(channelName)); + } + }); + } + /** Returns the passed map, to test serialization and deserialization. */ + public void echoNonNullIntMap( + @NonNull Map intMapArg, @NonNull Result> result) { + final String channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNonNullIntMap" + + messageChannelSuffix; + BasicMessageChannel channel = + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + channel.send( + new ArrayList<>(Collections.singletonList(intMapArg)), + channelReply -> { + if (channelReply instanceof List) { + List listReply = (List) channelReply; + if (listReply.size() > 1) { + result.error( + new FlutterError( + (String) listReply.get(0), (String) listReply.get(1), listReply.get(2))); + } else if (listReply.get(0) == null) { + result.error( + new FlutterError( + "null-error", + "Flutter api returned null value for non-null return value.", + "")); + } else { + @SuppressWarnings("ConstantConditions") + Map output = (Map) listReply.get(0); + result.success(output); + } + } else { + result.error(createConnectionError(channelName)); + } + }); + } + /** Returns the passed map, to test serialization and deserialization. */ + public void echoNonNullEnumMap( + @NonNull Map enumMapArg, @NonNull Result> result) { + final String channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNonNullEnumMap" + + messageChannelSuffix; + BasicMessageChannel channel = + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + channel.send( + new ArrayList<>(Collections.singletonList(enumMapArg)), + channelReply -> { + if (channelReply instanceof List) { + List listReply = (List) channelReply; + if (listReply.size() > 1) { + result.error( + new FlutterError( + (String) listReply.get(0), (String) listReply.get(1), listReply.get(2))); + } else if (listReply.get(0) == null) { + result.error( + new FlutterError( + "null-error", + "Flutter api returned null value for non-null return value.", + "")); + } else { + @SuppressWarnings("ConstantConditions") + Map output = (Map) listReply.get(0); + result.success(output); + } + } else { + result.error(createConnectionError(channelName)); + } + }); + } + /** Returns the passed map, to test serialization and deserialization. */ + public void echoNonNullClassMap( + @NonNull Map classMapArg, + @NonNull Result> result) { + final String channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNonNullClassMap" + + messageChannelSuffix; + BasicMessageChannel channel = + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + channel.send( + new ArrayList<>(Collections.singletonList(classMapArg)), + channelReply -> { + if (channelReply instanceof List) { + List listReply = (List) channelReply; + if (listReply.size() > 1) { + result.error( + new FlutterError( + (String) listReply.get(0), (String) listReply.get(1), listReply.get(2))); + } else if (listReply.get(0) == null) { + result.error( + new FlutterError( + "null-error", + "Flutter api returned null value for non-null return value.", + "")); + } else { + @SuppressWarnings("ConstantConditions") + Map output = (Map) listReply.get(0); + result.success(output); } } else { result.error(createConnectionError(channelName)); } }); } - /** Returns the passed object, to test serialization and deserialization. */ - public void echoAllTypes(@NonNull AllTypes everythingArg, @NonNull Result result) { + /** Returns the passed enum to test serialization and deserialization. */ + public void echoEnum(@NonNull AnEnum anEnumArg, @NonNull Result result) { final String channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllTypes" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnum" + messageChannelSuffix; BasicMessageChannel channel = new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( - new ArrayList<>(Collections.singletonList(everythingArg)), + new ArrayList<>(Collections.singletonList(anEnumArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; @@ -5158,7 +8663,7 @@ public void echoAllTypes(@NonNull AllTypes everythingArg, @NonNull Result result) { + /** Returns the passed enum to test serialization and deserialization. */ + public void echoAnotherEnum( + @NonNull AnotherEnum anotherEnumArg, @NonNull Result result) { final String channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypes" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAnotherEnum" + messageChannelSuffix; BasicMessageChannel channel = new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( - new ArrayList<>(Collections.singletonList(everythingArg)), + new ArrayList<>(Collections.singletonList(anotherEnumArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; @@ -5184,9 +8688,15 @@ public void echoAllNullableTypes( result.error( new FlutterError( (String) listReply.get(0), (String) listReply.get(1), listReply.get(2))); + } else if (listReply.get(0) == null) { + result.error( + new FlutterError( + "null-error", + "Flutter api returned null value for non-null return value.", + "")); } else { @SuppressWarnings("ConstantConditions") - AllNullableTypes output = (AllNullableTypes) listReply.get(0); + AnotherEnum output = (AnotherEnum) listReply.get(0); result.success(output); } } else { @@ -5194,23 +8704,16 @@ public void echoAllNullableTypes( } }); } - /** - * Returns passed in arguments of multiple types. - * - *

Tests multiple-arity FlutterApi handling. - */ - public void sendMultipleNullableTypes( - @Nullable Boolean aNullableBoolArg, - @Nullable Long aNullableIntArg, - @Nullable String aNullableStringArg, - @NonNull Result result) { + /** Returns the passed boolean, to test serialization and deserialization. */ + public void echoNullableBool( + @Nullable Boolean aBoolArg, @NonNull NullableResult result) { final String channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypes" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableBool" + messageChannelSuffix; BasicMessageChannel channel = new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( - new ArrayList<>(Arrays.asList(aNullableBoolArg, aNullableIntArg, aNullableStringArg)), + new ArrayList<>(Collections.singletonList(aBoolArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; @@ -5218,15 +8721,9 @@ public void sendMultipleNullableTypes( result.error( new FlutterError( (String) listReply.get(0), (String) listReply.get(1), listReply.get(2))); - } else if (listReply.get(0) == null) { - result.error( - new FlutterError( - "null-error", - "Flutter api returned null value for non-null return value.", - "")); } else { @SuppressWarnings("ConstantConditions") - AllNullableTypes output = (AllNullableTypes) listReply.get(0); + Boolean output = (Boolean) listReply.get(0); result.success(output); } } else { @@ -5234,17 +8731,15 @@ public void sendMultipleNullableTypes( } }); } - /** Returns the passed object, to test serialization and deserialization. */ - public void echoAllNullableTypesWithoutRecursion( - @Nullable AllNullableTypesWithoutRecursion everythingArg, - @NonNull NullableResult result) { + /** Returns the passed int, to test serialization and deserialization. */ + public void echoNullableInt(@Nullable Long anIntArg, @NonNull NullableResult result) { final String channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypesWithoutRecursion" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableInt" + messageChannelSuffix; BasicMessageChannel channel = new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( - new ArrayList<>(Collections.singletonList(everythingArg)), + new ArrayList<>(Collections.singletonList(anIntArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; @@ -5254,8 +8749,7 @@ public void echoAllNullableTypesWithoutRecursion( (String) listReply.get(0), (String) listReply.get(1), listReply.get(2))); } else { @SuppressWarnings("ConstantConditions") - AllNullableTypesWithoutRecursion output = - (AllNullableTypesWithoutRecursion) listReply.get(0); + Long output = (Long) listReply.get(0); result.success(output); } } else { @@ -5263,23 +8757,16 @@ public void echoAllNullableTypesWithoutRecursion( } }); } - /** - * Returns passed in arguments of multiple types. - * - *

Tests multiple-arity FlutterApi handling. - */ - public void sendMultipleNullableTypesWithoutRecursion( - @Nullable Boolean aNullableBoolArg, - @Nullable Long aNullableIntArg, - @Nullable String aNullableStringArg, - @NonNull Result result) { + /** Returns the passed double, to test serialization and deserialization. */ + public void echoNullableDouble( + @Nullable Double aDoubleArg, @NonNull NullableResult result) { final String channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableDouble" + messageChannelSuffix; BasicMessageChannel channel = new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( - new ArrayList<>(Arrays.asList(aNullableBoolArg, aNullableIntArg, aNullableStringArg)), + new ArrayList<>(Collections.singletonList(aDoubleArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; @@ -5287,16 +8774,9 @@ public void sendMultipleNullableTypesWithoutRecursion( result.error( new FlutterError( (String) listReply.get(0), (String) listReply.get(1), listReply.get(2))); - } else if (listReply.get(0) == null) { - result.error( - new FlutterError( - "null-error", - "Flutter api returned null value for non-null return value.", - "")); } else { @SuppressWarnings("ConstantConditions") - AllNullableTypesWithoutRecursion output = - (AllNullableTypesWithoutRecursion) listReply.get(0); + Double output = (Double) listReply.get(0); result.success(output); } } else { @@ -5304,15 +8784,16 @@ public void sendMultipleNullableTypesWithoutRecursion( } }); } - /** Returns the passed boolean, to test serialization and deserialization. */ - public void echoBool(@NonNull Boolean aBoolArg, @NonNull Result result) { + /** Returns the passed string, to test serialization and deserialization. */ + public void echoNullableString( + @Nullable String aStringArg, @NonNull NullableResult result) { final String channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoBool" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableString" + messageChannelSuffix; BasicMessageChannel channel = new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( - new ArrayList<>(Collections.singletonList(aBoolArg)), + new ArrayList<>(Collections.singletonList(aStringArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; @@ -5320,15 +8801,9 @@ public void echoBool(@NonNull Boolean aBoolArg, @NonNull Result result) result.error( new FlutterError( (String) listReply.get(0), (String) listReply.get(1), listReply.get(2))); - } else if (listReply.get(0) == null) { - result.error( - new FlutterError( - "null-error", - "Flutter api returned null value for non-null return value.", - "")); } else { @SuppressWarnings("ConstantConditions") - Boolean output = (Boolean) listReply.get(0); + String output = (String) listReply.get(0); result.success(output); } } else { @@ -5336,15 +8811,16 @@ public void echoBool(@NonNull Boolean aBoolArg, @NonNull Result result) } }); } - /** Returns the passed int, to test serialization and deserialization. */ - public void echoInt(@NonNull Long anIntArg, @NonNull Result result) { + /** Returns the passed byte list, to test serialization and deserialization. */ + public void echoNullableUint8List( + @Nullable byte[] listArg, @NonNull NullableResult result) { final String channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoInt" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableUint8List" + messageChannelSuffix; BasicMessageChannel channel = new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( - new ArrayList<>(Collections.singletonList(anIntArg)), + new ArrayList<>(Collections.singletonList(listArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; @@ -5352,16 +8828,9 @@ public void echoInt(@NonNull Long anIntArg, @NonNull Result result) { result.error( new FlutterError( (String) listReply.get(0), (String) listReply.get(1), listReply.get(2))); - } else if (listReply.get(0) == null) { - result.error( - new FlutterError( - "null-error", - "Flutter api returned null value for non-null return value.", - "")); } else { @SuppressWarnings("ConstantConditions") - Long output = - listReply.get(0) == null ? null : ((Number) listReply.get(0)).longValue(); + byte[] output = (byte[]) listReply.get(0); result.success(output); } } else { @@ -5369,15 +8838,16 @@ public void echoInt(@NonNull Long anIntArg, @NonNull Result result) { } }); } - /** Returns the passed double, to test serialization and deserialization. */ - public void echoDouble(@NonNull Double aDoubleArg, @NonNull Result result) { + /** Returns the passed list, to test serialization and deserialization. */ + public void echoNullableList( + @Nullable List listArg, @NonNull NullableResult> result) { final String channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoDouble" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableList" + messageChannelSuffix; BasicMessageChannel channel = new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( - new ArrayList<>(Collections.singletonList(aDoubleArg)), + new ArrayList<>(Collections.singletonList(listArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; @@ -5385,15 +8855,9 @@ public void echoDouble(@NonNull Double aDoubleArg, @NonNull Result resul result.error( new FlutterError( (String) listReply.get(0), (String) listReply.get(1), listReply.get(2))); - } else if (listReply.get(0) == null) { - result.error( - new FlutterError( - "null-error", - "Flutter api returned null value for non-null return value.", - "")); } else { @SuppressWarnings("ConstantConditions") - Double output = (Double) listReply.get(0); + List output = (List) listReply.get(0); result.success(output); } } else { @@ -5401,15 +8865,16 @@ public void echoDouble(@NonNull Double aDoubleArg, @NonNull Result resul } }); } - /** Returns the passed string, to test serialization and deserialization. */ - public void echoString(@NonNull String aStringArg, @NonNull Result result) { + /** Returns the passed list, to test serialization and deserialization. */ + public void echoNullableEnumList( + @Nullable List enumListArg, @NonNull NullableResult> result) { final String channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoString" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableEnumList" + messageChannelSuffix; BasicMessageChannel channel = new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( - new ArrayList<>(Collections.singletonList(aStringArg)), + new ArrayList<>(Collections.singletonList(enumListArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; @@ -5417,15 +8882,9 @@ public void echoString(@NonNull String aStringArg, @NonNull Result resul result.error( new FlutterError( (String) listReply.get(0), (String) listReply.get(1), listReply.get(2))); - } else if (listReply.get(0) == null) { - result.error( - new FlutterError( - "null-error", - "Flutter api returned null value for non-null return value.", - "")); } else { @SuppressWarnings("ConstantConditions") - String output = (String) listReply.get(0); + List output = (List) listReply.get(0); result.success(output); } } else { @@ -5433,15 +8892,17 @@ public void echoString(@NonNull String aStringArg, @NonNull Result resul } }); } - /** Returns the passed byte list, to test serialization and deserialization. */ - public void echoUint8List(@NonNull byte[] listArg, @NonNull Result result) { + /** Returns the passed list, to test serialization and deserialization. */ + public void echoNullableClassList( + @Nullable List classListArg, + @NonNull NullableResult> result) { final String channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoUint8List" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableClassList" + messageChannelSuffix; BasicMessageChannel channel = new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( - new ArrayList<>(Collections.singletonList(listArg)), + new ArrayList<>(Collections.singletonList(classListArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; @@ -5449,15 +8910,9 @@ public void echoUint8List(@NonNull byte[] listArg, @NonNull Result resul result.error( new FlutterError( (String) listReply.get(0), (String) listReply.get(1), listReply.get(2))); - } else if (listReply.get(0) == null) { - result.error( - new FlutterError( - "null-error", - "Flutter api returned null value for non-null return value.", - "")); } else { @SuppressWarnings("ConstantConditions") - byte[] output = (byte[]) listReply.get(0); + List output = (List) listReply.get(0); result.success(output); } } else { @@ -5466,14 +8921,15 @@ public void echoUint8List(@NonNull byte[] listArg, @NonNull Result resul }); } /** Returns the passed list, to test serialization and deserialization. */ - public void echoList(@NonNull List listArg, @NonNull Result> result) { + public void echoNullableNonNullEnumList( + @Nullable List enumListArg, @NonNull NullableResult> result) { final String channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoList" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableNonNullEnumList" + messageChannelSuffix; BasicMessageChannel channel = new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( - new ArrayList<>(Collections.singletonList(listArg)), + new ArrayList<>(Collections.singletonList(enumListArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; @@ -5481,15 +8937,9 @@ public void echoList(@NonNull List listArg, @NonNull Result result.error( new FlutterError( (String) listReply.get(0), (String) listReply.get(1), listReply.get(2))); - } else if (listReply.get(0) == null) { - result.error( - new FlutterError( - "null-error", - "Flutter api returned null value for non-null return value.", - "")); } else { @SuppressWarnings("ConstantConditions") - List output = (List) listReply.get(0); + List output = (List) listReply.get(0); result.success(output); } } else { @@ -5497,16 +8947,17 @@ public void echoList(@NonNull List listArg, @NonNull Result } }); } - /** Returns the passed map, to test serialization and deserialization. */ - public void echoMap( - @NonNull Map aMapArg, @NonNull Result> result) { + /** Returns the passed list, to test serialization and deserialization. */ + public void echoNullableNonNullClassList( + @Nullable List classListArg, + @NonNull NullableResult> result) { final String channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoMap" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableNonNullClassList" + messageChannelSuffix; BasicMessageChannel channel = new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( - new ArrayList<>(Collections.singletonList(aMapArg)), + new ArrayList<>(Collections.singletonList(classListArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; @@ -5514,15 +8965,9 @@ public void echoMap( result.error( new FlutterError( (String) listReply.get(0), (String) listReply.get(1), listReply.get(2))); - } else if (listReply.get(0) == null) { - result.error( - new FlutterError( - "null-error", - "Flutter api returned null value for non-null return value.", - "")); } else { @SuppressWarnings("ConstantConditions") - Map output = (Map) listReply.get(0); + List output = (List) listReply.get(0); result.success(output); } } else { @@ -5530,15 +8975,16 @@ public void echoMap( } }); } - /** Returns the passed enum to test serialization and deserialization. */ - public void echoEnum(@NonNull AnEnum anEnumArg, @NonNull Result result) { + /** Returns the passed map, to test serialization and deserialization. */ + public void echoNullableMap( + @Nullable Map mapArg, @NonNull NullableResult> result) { final String channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnum" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableMap" + messageChannelSuffix; BasicMessageChannel channel = new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( - new ArrayList<>(Collections.singletonList(anEnumArg)), + new ArrayList<>(Collections.singletonList(mapArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; @@ -5546,15 +8992,9 @@ public void echoEnum(@NonNull AnEnum anEnumArg, @NonNull Result result) result.error( new FlutterError( (String) listReply.get(0), (String) listReply.get(1), listReply.get(2))); - } else if (listReply.get(0) == null) { - result.error( - new FlutterError( - "null-error", - "Flutter api returned null value for non-null return value.", - "")); } else { @SuppressWarnings("ConstantConditions") - AnEnum output = (AnEnum) listReply.get(0); + Map output = (Map) listReply.get(0); result.success(output); } } else { @@ -5562,16 +9002,17 @@ public void echoEnum(@NonNull AnEnum anEnumArg, @NonNull Result result) } }); } - /** Returns the passed enum to test serialization and deserialization. */ - public void echoAnotherEnum( - @NonNull AnotherEnum anotherEnumArg, @NonNull Result result) { + /** Returns the passed map, to test serialization and deserialization. */ + public void echoNullableStringMap( + @Nullable Map stringMapArg, + @NonNull NullableResult> result) { final String channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAnotherEnum" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableStringMap" + messageChannelSuffix; BasicMessageChannel channel = new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( - new ArrayList<>(Collections.singletonList(anotherEnumArg)), + new ArrayList<>(Collections.singletonList(stringMapArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; @@ -5579,15 +9020,9 @@ public void echoAnotherEnum( result.error( new FlutterError( (String) listReply.get(0), (String) listReply.get(1), listReply.get(2))); - } else if (listReply.get(0) == null) { - result.error( - new FlutterError( - "null-error", - "Flutter api returned null value for non-null return value.", - "")); } else { @SuppressWarnings("ConstantConditions") - AnotherEnum output = (AnotherEnum) listReply.get(0); + Map output = (Map) listReply.get(0); result.success(output); } } else { @@ -5595,16 +9030,16 @@ public void echoAnotherEnum( } }); } - /** Returns the passed boolean, to test serialization and deserialization. */ - public void echoNullableBool( - @Nullable Boolean aBoolArg, @NonNull NullableResult result) { + /** Returns the passed map, to test serialization and deserialization. */ + public void echoNullableIntMap( + @Nullable Map intMapArg, @NonNull NullableResult> result) { final String channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableBool" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableIntMap" + messageChannelSuffix; BasicMessageChannel channel = new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( - new ArrayList<>(Collections.singletonList(aBoolArg)), + new ArrayList<>(Collections.singletonList(intMapArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; @@ -5614,7 +9049,7 @@ public void echoNullableBool( (String) listReply.get(0), (String) listReply.get(1), listReply.get(2))); } else { @SuppressWarnings("ConstantConditions") - Boolean output = (Boolean) listReply.get(0); + Map output = (Map) listReply.get(0); result.success(output); } } else { @@ -5622,15 +9057,17 @@ public void echoNullableBool( } }); } - /** Returns the passed int, to test serialization and deserialization. */ - public void echoNullableInt(@Nullable Long anIntArg, @NonNull NullableResult result) { + /** Returns the passed map, to test serialization and deserialization. */ + public void echoNullableEnumMap( + @Nullable Map enumMapArg, + @NonNull NullableResult> result) { final String channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableInt" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableEnumMap" + messageChannelSuffix; BasicMessageChannel channel = new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( - new ArrayList<>(Collections.singletonList(anIntArg)), + new ArrayList<>(Collections.singletonList(enumMapArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; @@ -5640,8 +9077,7 @@ public void echoNullableInt(@Nullable Long anIntArg, @NonNull NullableResult output = (Map) listReply.get(0); result.success(output); } } else { @@ -5649,16 +9085,17 @@ public void echoNullableInt(@Nullable Long anIntArg, @NonNull NullableResult result) { + /** Returns the passed map, to test serialization and deserialization. */ + public void echoNullableClassMap( + @Nullable Map classMapArg, + @NonNull NullableResult> result) { final String channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableDouble" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableClassMap" + messageChannelSuffix; BasicMessageChannel channel = new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( - new ArrayList<>(Collections.singletonList(aDoubleArg)), + new ArrayList<>(Collections.singletonList(classMapArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; @@ -5668,7 +9105,7 @@ public void echoNullableDouble( (String) listReply.get(0), (String) listReply.get(1), listReply.get(2))); } else { @SuppressWarnings("ConstantConditions") - Double output = (Double) listReply.get(0); + Map output = (Map) listReply.get(0); result.success(output); } } else { @@ -5676,16 +9113,17 @@ public void echoNullableDouble( } }); } - /** Returns the passed string, to test serialization and deserialization. */ - public void echoNullableString( - @Nullable String aStringArg, @NonNull NullableResult result) { + /** Returns the passed map, to test serialization and deserialization. */ + public void echoNullableNonNullStringMap( + @Nullable Map stringMapArg, + @NonNull NullableResult> result) { final String channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableString" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableNonNullStringMap" + messageChannelSuffix; BasicMessageChannel channel = new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( - new ArrayList<>(Collections.singletonList(aStringArg)), + new ArrayList<>(Collections.singletonList(stringMapArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; @@ -5695,7 +9133,7 @@ public void echoNullableString( (String) listReply.get(0), (String) listReply.get(1), listReply.get(2))); } else { @SuppressWarnings("ConstantConditions") - String output = (String) listReply.get(0); + Map output = (Map) listReply.get(0); result.success(output); } } else { @@ -5703,16 +9141,16 @@ public void echoNullableString( } }); } - /** Returns the passed byte list, to test serialization and deserialization. */ - public void echoNullableUint8List( - @Nullable byte[] listArg, @NonNull NullableResult result) { + /** Returns the passed map, to test serialization and deserialization. */ + public void echoNullableNonNullIntMap( + @Nullable Map intMapArg, @NonNull NullableResult> result) { final String channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableUint8List" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableNonNullIntMap" + messageChannelSuffix; BasicMessageChannel channel = new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( - new ArrayList<>(Collections.singletonList(listArg)), + new ArrayList<>(Collections.singletonList(intMapArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; @@ -5722,7 +9160,7 @@ public void echoNullableUint8List( (String) listReply.get(0), (String) listReply.get(1), listReply.get(2))); } else { @SuppressWarnings("ConstantConditions") - byte[] output = (byte[]) listReply.get(0); + Map output = (Map) listReply.get(0); result.success(output); } } else { @@ -5730,16 +9168,17 @@ public void echoNullableUint8List( } }); } - /** Returns the passed list, to test serialization and deserialization. */ - public void echoNullableList( - @Nullable List listArg, @NonNull NullableResult> result) { + /** Returns the passed map, to test serialization and deserialization. */ + public void echoNullableNonNullEnumMap( + @Nullable Map enumMapArg, + @NonNull NullableResult> result) { final String channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableList" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableNonNullEnumMap" + messageChannelSuffix; BasicMessageChannel channel = new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( - new ArrayList<>(Collections.singletonList(listArg)), + new ArrayList<>(Collections.singletonList(enumMapArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; @@ -5749,7 +9188,7 @@ public void echoNullableList( (String) listReply.get(0), (String) listReply.get(1), listReply.get(2))); } else { @SuppressWarnings("ConstantConditions") - List output = (List) listReply.get(0); + Map output = (Map) listReply.get(0); result.success(output); } } else { @@ -5758,16 +9197,16 @@ public void echoNullableList( }); } /** Returns the passed map, to test serialization and deserialization. */ - public void echoNullableMap( - @Nullable Map aMapArg, - @NonNull NullableResult> result) { + public void echoNullableNonNullClassMap( + @Nullable Map classMapArg, + @NonNull NullableResult> result) { final String channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableMap" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableNonNullClassMap" + messageChannelSuffix; BasicMessageChannel channel = new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( - new ArrayList<>(Collections.singletonList(aMapArg)), + new ArrayList<>(Collections.singletonList(classMapArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; @@ -5777,7 +9216,7 @@ public void echoNullableMap( (String) listReply.get(0), (String) listReply.get(1), listReply.get(2))); } else { @SuppressWarnings("ConstantConditions") - Map output = (Map) listReply.get(0); + Map output = (Map) listReply.get(0); result.success(output); } } else { diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/test/java/com/example/alternate_language_test_plugin/AllDatatypesTest.java b/packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/test/java/com/example/alternate_language_test_plugin/AllDatatypesTest.java index 99bbb49c7ecc..d873a0ffe428 100644 --- a/packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/test/java/com/example/alternate_language_test_plugin/AllDatatypesTest.java +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/test/java/com/example/alternate_language_test_plugin/AllDatatypesTest.java @@ -15,6 +15,8 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; +import java.util.List; +import java.util.Map; import org.junit.Test; public class AllDatatypesTest { @@ -67,19 +69,27 @@ void compareAllNullableTypes(AllNullableTypes firstTypes, AllNullableTypes secon assertTrue( floatArraysEqual( firstTypes.getANullableFloatArray(), secondTypes.getANullableFloatArray())); - assertArrayEquals( - firstTypes.getNullableMapWithObject().values().toArray(), - secondTypes.getNullableMapWithObject().values().toArray()); assertEquals(firstTypes.getANullableObject(), secondTypes.getANullableObject()); assertArrayEquals(firstTypes.getList().toArray(), secondTypes.getList().toArray()); assertArrayEquals(firstTypes.getStringList().toArray(), secondTypes.getStringList().toArray()); assertArrayEquals(firstTypes.getBoolList().toArray(), secondTypes.getBoolList().toArray()); assertArrayEquals(firstTypes.getDoubleList().toArray(), secondTypes.getDoubleList().toArray()); assertArrayEquals(firstTypes.getIntList().toArray(), secondTypes.getIntList().toArray()); + assertArrayEquals(firstTypes.getListList().toArray(), secondTypes.getListList().toArray()); assertArrayEquals( firstTypes.getMap().keySet().toArray(), secondTypes.getMap().keySet().toArray()); assertArrayEquals( firstTypes.getMap().values().toArray(), secondTypes.getMap().values().toArray()); + assertArrayEquals( + firstTypes.getStringMap().keySet().toArray(), + secondTypes.getStringMap().keySet().toArray()); + assertArrayEquals( + firstTypes.getStringMap().values().toArray(), + secondTypes.getStringMap().values().toArray()); + assertArrayEquals( + firstTypes.getIntMap().keySet().toArray(), secondTypes.getIntMap().keySet().toArray()); + assertArrayEquals( + firstTypes.getIntMap().values().toArray(), secondTypes.getIntMap().values().toArray()); // Also check that the implementation of equality works. assertEquals(firstTypes, secondTypes); @@ -120,13 +130,15 @@ public void success(AllNullableTypes result) { assertNull(everything.getANullable4ByteArray()); assertNull(everything.getANullable8ByteArray()); assertNull(everything.getANullableFloatArray()); - assertNull(everything.getNullableMapWithObject()); assertNull(everything.getList()); assertNull(everything.getDoubleList()); assertNull(everything.getIntList()); assertNull(everything.getStringList()); assertNull(everything.getBoolList()); + assertNull(everything.getListList()); assertNull(everything.getMap()); + assertNull(everything.getStringMap()); + assertNull(everything.getIntMap()); } public void error(Throwable error) { @@ -136,14 +148,8 @@ public void error(Throwable error) { assertTrue(didCall[0]); } - private static HashMap makeMap(String key, Integer value) { - HashMap result = new HashMap(); - result.put(key, value); - return result; - } - - private static HashMap makeStringMap(String key, Integer value) { - HashMap result = new HashMap(); + private static HashMap makeMap(K key, J value) { + HashMap result = new HashMap(); result.put(key, value); return result; } @@ -163,7 +169,15 @@ private static boolean floatArraysEqual(double[] x, double[] y) { @Test public void hasValues() { // Not inline due to warnings about an ambiguous varargs call when inline. - final Object[] genericList = new Boolean[] {true, false}; + final List genericList = Arrays.asList(new Object[] {"hello", 1, true, false, null}); + final List> listList = new ArrayList<>(Arrays.asList()); + final List> mapList = new ArrayList<>(Arrays.asList()); + final Map> listMap = new HashMap>(); + final Map> mapMap = new HashMap>(); + listList.add(genericList); + mapList.add(makeMap("hello", 1234)); + listMap.put(1L, genericList); + mapMap.put(1L, makeMap("hello", 1234)); AllTypes allEverything = new AllTypes.Builder() .setABool(false) @@ -178,12 +192,24 @@ public void hasValues() { .setAnEnum(CoreTests.AnEnum.ONE) .setAnotherEnum(CoreTests.AnotherEnum.JUST_IN_CASE) .setAnObject(0) + .setList(genericList) .setBoolList(Arrays.asList(new Boolean[] {true, false})) .setDoubleList(Arrays.asList(new Double[] {0.5, 0.25, 1.5, 1.25})) .setIntList(Arrays.asList(new Long[] {1l, 2l, 3l, 4l})) - .setList(Arrays.asList(genericList)) .setStringList(Arrays.asList(new String[] {"string", "another one"})) + .setObjectList(genericList) + .setEnumList( + Arrays.asList( + new CoreTests.AnEnum[] {CoreTests.AnEnum.ONE, CoreTests.AnEnum.FORTY_TWO})) + .setListList(listList) + .setMapList(mapList) .setMap(makeMap("hello", 1234)) + .setIntMap(makeMap(1L, 0L)) + .setStringMap(makeMap("hello", "you")) + .setObjectMap(makeMap("E", 4321)) + .setEnumMap(makeMap(CoreTests.AnEnum.ONE, CoreTests.AnEnum.FOUR_HUNDRED_TWENTY_TWO)) + .setListMap(listMap) + .setMapMap(mapMap) .build(); AllNullableTypes everything = @@ -196,14 +222,16 @@ public void hasValues() { .setANullable4ByteArray(new int[] {1, 2, 3, 4}) .setANullable8ByteArray(new long[] {1, 2, 3, 4}) .setANullableFloatArray(new double[] {0.5, 0.25, 1.5, 1.25}) - .setNullableMapWithObject(makeStringMap("hello", 1234)) .setANullableObject(0) + .setList(Arrays.asList(genericList)) .setBoolList(Arrays.asList(new Boolean[] {true, false})) .setDoubleList(Arrays.asList(new Double[] {0.5, 0.25, 1.5, 1.25})) .setIntList(Arrays.asList(new Long[] {1l, 2l, 3l, 4l})) - .setList(Arrays.asList(genericList)) .setStringList(Arrays.asList(new String[] {"string", "another one"})) + .setListList(listList) .setMap(makeMap("hello", 1234)) + .setStringMap(makeMap("hello", "you")) + .setIntMap(makeMap(2L, -2L)) .build(); BinaryMessenger binaryMessenger = mock(BinaryMessenger.class); @@ -238,17 +266,4 @@ public void error(Throwable error) { }); assertTrue(didCall[0]); } - - @Test - public void integerToLong() { - AllNullableTypes everything = new AllNullableTypes(); - everything.setANullableInt(123L); - ArrayList list = everything.toList(); - assertNotNull(list); - assertNull(list.get(0)); - assertNotNull(list.get(1)); - list.set(1, 123); - AllNullableTypes readEverything = AllNullableTypes.fromList(list); - assertEquals(readEverything.getANullableInt(), everything.getANullableInt()); - } } diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/test/java/com/example/alternate_language_test_plugin/PrimitiveTest.java b/packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/test/java/com/example/alternate_language_test_plugin/PrimitiveTest.java index fc96adc2cb4b..8624bced5b1f 100644 --- a/packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/test/java/com/example/alternate_language_test_plugin/PrimitiveTest.java +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/test/java/com/example/alternate_language_test_plugin/PrimitiveTest.java @@ -32,14 +32,6 @@ private static BinaryMessenger makeMockBinaryMessenger() { ArrayList args = (ArrayList) PrimitiveFlutterApi.getCodec().decodeMessage(message); Object arg = args.get(0); - if (arg instanceof Long) { - Long longArg = (Long) arg; - if (longArg.intValue() == longArg.longValue()) { - // Value fits in the Integer so gets sent as such - // https://docs.flutter.dev/development/platform-integration/platform-channels?tab=type-mappings-java-tab#codec - arg = Integer.valueOf(longArg.intValue()); - } - } ArrayList wrapped = new ArrayList(); wrapped.add(0, arg); ByteBuffer replyData = PrimitiveFlutterApi.getCodec().encodeMessage(wrapped); @@ -106,7 +98,7 @@ public void primitiveIntHostApi() { handler.capture()); MessageCodec codec = PrimitiveHostApi.getCodec(); @SuppressWarnings("unchecked") - ByteBuffer message = codec.encodeMessage(new ArrayList(Arrays.asList((Integer) 1))); + ByteBuffer message = codec.encodeMessage(new ArrayList(Arrays.asList(1L))); message.rewind(); handler .getValue() diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/example/android/app/build.gradle b/packages/pigeon/platform_tests/alternate_language_test_plugin/example/android/app/build.gradle index aecfb56abf70..21beeb8a7042 100644 --- a/packages/pigeon/platform_tests/alternate_language_test_plugin/example/android/app/build.gradle +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/example/android/app/build.gradle @@ -31,8 +31,8 @@ android { ndkVersion flutter.ndkVersion compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_11 + targetCompatibility JavaVersion.VERSION_11 } defaultConfig { diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/example/android/build.gradle b/packages/pigeon/platform_tests/alternate_language_test_plugin/example/android/build.gradle index 18a1d3ccb472..0b4ac7621f18 100644 --- a/packages/pigeon/platform_tests/alternate_language_test_plugin/example/android/build.gradle +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/example/android/build.gradle @@ -6,7 +6,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:7.4.2' + classpath 'com.android.tools.build:gradle:8.5.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } 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..3c85cfe057a1 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-8.7-all.zip diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/example/ios/RunnerTests/AllDatatypesTest.m b/packages/pigeon/platform_tests/alternate_language_test_plugin/example/ios/RunnerTests/AllDatatypesTest.m index a605276d1592..b4ebec5f9c70 100644 --- a/packages/pigeon/platform_tests/alternate_language_test_plugin/example/ios/RunnerTests/AllDatatypesTest.m +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/example/ios/RunnerTests/AllDatatypesTest.m @@ -38,7 +38,9 @@ - (void)testAllNull { XCTAssertNil(result.intList); XCTAssertNil(result.doubleList); XCTAssertNil(result.stringList); + XCTAssertNil(result.objectList); XCTAssertNil(result.map); + XCTAssertNil(result.objectMap); [expectation fulfill]; }]; [self waitForExpectations:@[ expectation ] timeout:1.0]; @@ -58,13 +60,22 @@ - (void)testAllEquals { typedDataWithInt64:[@"12345678" dataUsingEncoding:NSUTF8StringEncoding]]; everything.aNullableFloatArray = [FlutterStandardTypedData typedDataWithFloat64:[@"12345678" dataUsingEncoding:NSUTF8StringEncoding]]; - everything.nullableMapWithObject = @{@"hello" : @(1234), @"goodbye" : @"world"}; + everything.list = @[ @"string", @1 ]; everything.boolList = @[ @YES, @NO ]; everything.intList = @[ @1, @2 ]; everything.doubleList = @[ @1.1, @2.2 ]; everything.stringList = @[ @"string", @"another one" ]; - everything.list = @[ @"string", @1 ]; + everything.objectList = @[ @"string", @1 ]; + everything.listList = @[ @[ @"string" ], @[ @"another one" ] ]; + everything.mapList = @[ + @{@"hello" : @(1234), @"goodbye" : @"world"}, @{@"hello" : @(1234), @"goodbye" : @"world"} + ]; everything.map = @{@"hello" : @(1234), @"goodbye" : @"world"}; + everything.stringMap = @{@"hello" : @"you", @"goodbye" : @"world"}; + everything.intMap = @{@(1) : @(0), @(2) : @(-2)}; + everything.objectMap = @{@"hello" : @(1234), @"goodbye" : @"world"}; + everything.listMap = @{@(1234) : @[ @"string", @"another one" ]}; + everything.mapMap = @{@(1234) : @{@"goodbye" : @"world"}}; EchoBinaryMessenger *binaryMessenger = [[EchoBinaryMessenger alloc] initWithCodec:FLTGetCoreTestsCodec()]; FLTFlutterIntegrationCoreApi *api = @@ -84,17 +95,27 @@ - (void)testAllEquals { everything.aNullable8ByteArray.data); XCTAssertEqualObjects(result.aNullableFloatArray.data, everything.aNullableFloatArray.data); - XCTAssertEqualObjects(result.nullableMapWithObject, - everything.nullableMapWithObject); XCTAssertEqualObjects(result.list, everything.list); XCTAssertEqualObjects(result.boolList, everything.boolList); XCTAssertEqualObjects(result.intList, everything.intList); XCTAssertEqualObjects(result.doubleList, everything.doubleList); XCTAssertEqualObjects(result.stringList, everything.stringList); + XCTAssertEqualObjects(result.objectList, everything.objectList); + XCTAssertEqualObjects(result.listList, everything.listList); + XCTAssertEqualObjects(result.mapList, everything.mapList); XCTAssertEqualObjects(result.map, everything.map); + XCTAssertEqualObjects(result.stringMap, everything.stringMap); + XCTAssertEqualObjects(result.intMap, everything.intMap); + XCTAssertEqualObjects(result.objectMap, everything.objectMap); + XCTAssertEqualObjects(result.listMap, everything.listMap); + XCTAssertEqualObjects(result.mapMap, everything.mapMap); [expectation fulfill]; }]; [self waitForExpectations:@[ expectation ] timeout:1.0]; } +- (void)unusedClassesExist { + XCTAssert([[FLTUnusedClass alloc] init] != nil); +} + @end diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/ios/Classes/AlternateLanguageTestPlugin.m b/packages/pigeon/platform_tests/alternate_language_test_plugin/ios/Classes/AlternateLanguageTestPlugin.m index ef45caaf12e5..d684acfd55e6 100644 --- a/packages/pigeon/platform_tests/alternate_language_test_plugin/ios/Classes/AlternateLanguageTestPlugin.m +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/ios/Classes/AlternateLanguageTestPlugin.m @@ -95,9 +95,80 @@ - (nullable id)echoObject:(id)anObject error:(FlutterError *_Nullable *_Nonnull) return list; } -- (nullable NSDictionary *)echoMap:(NSDictionary *)aMap +- (nullable NSArray *)echoEnumList:(NSArray *)enumList error:(FlutterError *_Nullable *_Nonnull)error { - return aMap; + return enumList; +} + +- (nullable NSArray *) + echoClassList:(NSArray *)classList + error:(FlutterError *_Nullable *_Nonnull)error { + return classList; +} + +- (nullable NSArray *) + echoNonNullEnumList:(nonnull NSArray *)enumList + error:(FlutterError *_Nullable __autoreleasing *_Nonnull)error { + return enumList; +} + +- (nullable NSArray *) + echoNonNullClassList:(nonnull NSArray *)classList + error:(FlutterError *_Nullable __autoreleasing *_Nonnull)error { + return classList; +} + +- (nullable NSDictionary *)echoMap:(NSDictionary *)map + error:(FlutterError *_Nullable *_Nonnull)error { + return map; +} + +- (nullable NSDictionary *) + echoStringMap:(NSDictionary *)stringMap + error:(FlutterError *_Nullable *_Nonnull)error { + return stringMap; +} + +- (nullable NSDictionary *) + echoIntMap:(NSDictionary *)intMap + error:(FlutterError *_Nullable *_Nonnull)error { + return intMap; +} + +- (nullable NSDictionary *) + echoEnumMap:(NSDictionary *)enumMap + error:(FlutterError *_Nullable *_Nonnull)error { + return enumMap; +} + +- (nullable NSDictionary *) + echoClassMap:(NSDictionary *)classMap + error:(FlutterError *_Nullable *_Nonnull)error { + return classMap; +} + +- (nullable NSDictionary *) + echoNonNullStringMap:(nonnull NSDictionary *)stringMap + error:(FlutterError *_Nullable __autoreleasing *_Nonnull)error { + return stringMap; +} + +- (nullable NSDictionary *) + echoNonNullIntMap:(nonnull NSDictionary *)intMap + error:(FlutterError *_Nullable __autoreleasing *_Nonnull)error { + return intMap; +} + +- (nullable NSDictionary *) + echoNonNullEnumMap:(nonnull NSDictionary *)enumMap + error:(FlutterError *_Nullable __autoreleasing *_Nonnull)error { + return enumMap; +} + +- (nullable NSDictionary *) + echoNonNullClassMap:(nonnull NSDictionary *)classMap + error:(FlutterError *_Nullable __autoreleasing *_Nonnull)error { + return classMap; } - (nullable FLTAllClassesWrapper *)echoClassWrapper:(FLTAllClassesWrapper *)wrapper @@ -142,7 +213,11 @@ - (nullable NSString *)extractNestedNullableStringFrom:(FLTAllClassesWrapper *)w innerObject.aNullableString = nullableString; return [FLTAllClassesWrapper makeWithAllNullableTypes:innerObject allNullableTypesWithoutRecursion:nil - allTypes:nil]; + allTypes:nil + classList:@[] + nullableClassList:nil + classMap:@{} + nullableClassMap:nil]; } - (nullable FLTAllNullableTypes *) @@ -208,10 +283,81 @@ - (nullable id)echoNullableObject:(nullable id)aNullableObject return aNullableList; } -- (nullable NSDictionary *) - echoNullableMap:(nullable NSDictionary *)aNullableMap - error:(FlutterError *_Nullable *_Nonnull)error { - return aNullableMap; +- (nullable NSArray *) + echoNullableEnumList:(nullable NSArray *)enumList + error:(FlutterError *_Nullable *_Nonnull)error { + return enumList; +} + +- (nullable NSArray *) + echoNullableClassList:(nullable NSArray *)classList + error:(FlutterError *_Nullable *_Nonnull)error { + return classList; +} + +- (nullable NSArray *) + echoNullableNonNullEnumList:(nullable NSArray *)enumList + error:(FlutterError *_Nullable __autoreleasing *_Nonnull)error { + return enumList; +} + +- (nullable NSArray *) + echoNullableNonNullClassList:(nullable NSArray *)classList + error:(FlutterError *_Nullable __autoreleasing *_Nonnull)error { + return classList; +} + +- (nullable NSDictionary *)echoNullableMap:(nullable NSDictionary *)map + error:(FlutterError *_Nullable *_Nonnull)error { + return map; +} + +- (nullable NSDictionary *) + echoNullableStringMap:(nullable NSDictionary *)stringMap + error:(FlutterError *_Nullable *_Nonnull)error { + return stringMap; +} + +- (nullable NSDictionary *) + echoNullableIntMap:(nullable NSDictionary *)intMap + error:(FlutterError *_Nullable *_Nonnull)error { + return intMap; +} + +- (nullable NSDictionary *) + echoNullableEnumMap:(nullable NSDictionary *)enumMap + error:(FlutterError *_Nullable *_Nonnull)error { + return enumMap; +} + +- (nullable NSDictionary *) + echoNullableClassMap:(nullable NSDictionary *)classMap + error:(FlutterError *_Nullable *_Nonnull)error { + return classMap; +} + +- (nullable NSDictionary *) + echoNullableNonNullStringMap:(nullable NSDictionary *)stringMap + error:(FlutterError *_Nullable __autoreleasing *_Nonnull)error { + return stringMap; +} + +- (nullable NSDictionary *) + echoNullableNonNullIntMap:(nullable NSDictionary *)intMap + error:(FlutterError *_Nullable __autoreleasing *_Nonnull)error { + return intMap; +} + +- (nullable NSDictionary *) + echoNullableNonNullEnumMap:(nullable NSDictionary *)enumMap + error:(FlutterError *_Nullable __autoreleasing *_Nonnull)error { + return enumMap; +} + +- (nullable NSDictionary *) + echoNullableNonNullClassMap:(nullable NSDictionary *)classMap + error:(FlutterError *_Nullable __autoreleasing *_Nonnull)error { + return classMap; } - (FLTAnEnumBox *_Nullable)echoNullableEnum:(nullable FLTAnEnumBox *)AnEnumBoxed @@ -309,10 +455,46 @@ - (void)echoAsyncList:(NSArray *)list completion(list, nil); } -- (void)echoAsyncMap:(NSDictionary *)aMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion { - completion(aMap, nil); +- (void)echoAsyncEnumList:(NSArray *)enumList + completion:(void (^)(NSArray *_Nullable, + FlutterError *_Nullable))completion { + completion(enumList, nil); +} + +- (void)echoAsyncClassList:(NSArray *)classList + completion:(void (^)(NSArray *_Nullable, + FlutterError *_Nullable))completion { + completion(classList, nil); +} + +- (void)echoAsyncMap:(NSDictionary *)map + completion: + (void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion { + completion(map, nil); +} + +- (void)echoAsyncStringMap:(NSDictionary *)stringMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + completion(stringMap, nil); +} + +- (void)echoAsyncIntMap:(NSDictionary *)intMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + completion(intMap, nil); +} + +- (void)echoAsyncEnumMap:(NSDictionary *)enumMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + completion(enumMap, nil); +} + +- (void)echoAsyncClassMap:(NSDictionary *)classMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + completion(classMap, nil); } - (void)echoAsyncEnum:(FLTAnEnum)anEnum @@ -363,10 +545,47 @@ - (void)echoAsyncNullableList:(nullable NSArray *)list completion(list, nil); } -- (void)echoAsyncNullableMap:(nullable NSDictionary *)aMap - completion:(void (^)(NSDictionary *_Nullable, +- (void)echoAsyncNullableEnumList:(nullable NSArray *)enumList + completion:(void (^)(NSArray *_Nullable, + FlutterError *_Nullable))completion { + completion(enumList, nil); +} + +- (void)echoAsyncNullableClassList:(nullable NSArray *)classList + completion:(void (^)(NSArray *_Nullable, + FlutterError *_Nullable))completion { + completion(classList, nil); +} + +- (void)echoAsyncNullableMap:(nullable NSDictionary *)map + completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion { - completion(aMap, nil); + completion(map, nil); +} + +- (void)echoAsyncNullableStringMap:(nullable NSDictionary *)stringMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + completion(stringMap, nil); +} + +- (void)echoAsyncNullableIntMap:(nullable NSDictionary *)intMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + completion(intMap, nil); +} + +- (void)echoAsyncNullableEnumMap:(nullable NSDictionary *)enumMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + completion(enumMap, nil); +} + +- (void) + echoAsyncNullableClassMap:(nullable NSDictionary *)classMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + completion(classMap, nil); } - (void)echoAsyncNullableEnum:(nullable FLTAnEnumBox *)AnEnumBoxed @@ -491,15 +710,139 @@ - (void)callFlutterEchoList:(NSArray *)list }]; } -- (void)callFlutterEchoMap:(NSDictionary *)aMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion { - [self.flutterAPI echoMap:aMap - completion:^(NSDictionary *value, FlutterError *error) { +- (void)callFlutterEchoEnumList:(NSArray *)enumList + completion:(void (^)(NSArray *_Nullable, + FlutterError *_Nullable))completion { + [self.flutterAPI echoEnumList:enumList + completion:^(NSArray *value, FlutterError *error) { + completion(value, error); + }]; +} + +- (void)callFlutterEchoClassList:(NSArray *)classList + completion:(void (^)(NSArray *_Nullable, + FlutterError *_Nullable))completion { + [self.flutterAPI echoClassList:classList + completion:^(NSArray *value, FlutterError *error) { + completion(value, error); + }]; +} + +- (void)callFlutterEchoNonNullEnumList:(nonnull NSArray *)enumList + completion:(nonnull void (^)(NSArray *_Nullable, + FlutterError *_Nullable))completion { + [self.flutterAPI echoNonNullEnumList:enumList + completion:^(NSArray *value, FlutterError *error) { + completion(value, error); + }]; +} + +- (void)callFlutterEchoNonNullClassList:(nonnull NSArray *)classList + completion:(nonnull void (^)(NSArray *_Nullable, + FlutterError *_Nullable))completion { + [self.flutterAPI + echoNonNullClassList:classList + completion:^(NSArray *value, FlutterError *error) { + completion(value, error); + }]; +} + +- (void)callFlutterEchoMap:(NSDictionary *)map + completion: + (void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion { + [self.flutterAPI echoMap:map + completion:^(NSDictionary *value, FlutterError *error) { + completion(value, error); + }]; +} + +- (void)callFlutterEchoStringMap:(NSDictionary *)stringMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + [self.flutterAPI + echoStringMap:stringMap + completion:^(NSDictionary *value, FlutterError *error) { + completion(value, error); + }]; +} + +- (void)callFlutterEchoIntMap:(NSDictionary *)intMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + [self.flutterAPI echoIntMap:intMap + completion:^(NSDictionary *value, FlutterError *error) { + completion(value, error); + }]; +} + +- (void)callFlutterEchoEnumMap:(NSDictionary *)enumMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + [self.flutterAPI + echoEnumMap:enumMap + completion:^(NSDictionary *value, FlutterError *error) { + completion(value, error); + }]; +} + +- (void)callFlutterEchoClassMap:(NSDictionary *)classMap + completion: + (void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + [self.flutterAPI + echoClassMap:classMap + completion:^(NSDictionary *value, FlutterError *error) { + completion(value, error); + }]; +} + +- (void)callFlutterEchoNonNullStringMap:(nonnull NSDictionary *)stringMap + completion: + (nonnull void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + [self.flutterAPI + echoNonNullStringMap:stringMap + completion:^(NSDictionary *value, FlutterError *error) { completion(value, error); }]; } +- (void)callFlutterEchoNonNullIntMap:(nonnull NSDictionary *)intMap + completion: + (nonnull void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + [self.flutterAPI + echoNonNullIntMap:intMap + completion:^(NSDictionary *value, FlutterError *error) { + completion(value, error); + }]; +} + +- (void)callFlutterEchoNonNullEnumMap: + (nonnull NSDictionary *)enumMap + completion:(nonnull void (^)( + NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + [self.flutterAPI echoNonNullEnumMap:enumMap + completion:^(NSDictionary *value, + FlutterError *error) { + completion(value, error); + }]; +} + +- (void)callFlutterEchoNonNullClassMap: + (nonnull NSDictionary *)classMap + completion: + (nonnull void (^)( + NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + [self.flutterAPI echoNonNullClassMap:classMap + completion:^(NSDictionary *value, + FlutterError *error) { + completion(value, error); + }]; +} + - (void)callFlutterEchoEnum:(FLTAnEnum)anEnum completion:(void (^)(FLTAnEnumBox *_Nullable, FlutterError *_Nullable))completion { [self.flutterAPI echoEnum:anEnum @@ -594,15 +937,152 @@ - (void)callFlutterEchoNullableList:(nullable NSArray *)list }]; } -- (void)callFlutterEchoNullableMap:(nullable NSDictionary *)aMap - completion:(void (^)(NSDictionary *_Nullable, +- (void)callFlutterEchoNullableEnumList:(nullable NSArray *)enumList + completion:(void (^)(NSArray *_Nullable, + FlutterError *_Nullable))completion { + [self.flutterAPI echoNullableEnumList:enumList + completion:^(NSArray *value, FlutterError *error) { + completion(value, error); + }]; +} + +- (void)callFlutterEchoNullableClassList:(nullable NSArray *)classList + completion:(void (^)(NSArray *_Nullable, + FlutterError *_Nullable))completion { + [self.flutterAPI + echoNullableClassList:classList + completion:^(NSArray *value, FlutterError *error) { + completion(value, error); + }]; +} + +- (void)callFlutterEchoNullableNonNullEnumList:(nullable NSArray *)enumList + completion: + (nonnull void (^)(NSArray *_Nullable, + FlutterError *_Nullable))completion { + [self.flutterAPI + echoNullableNonNullEnumList:enumList + completion:^(NSArray *value, FlutterError *error) { + completion(value, error); + }]; +} + +- (void)callFlutterEchoNullableNonNullClassList:(nullable NSArray *)classList + completion:(nonnull void (^)( + NSArray *_Nullable, + FlutterError *_Nullable))completion { + [self.flutterAPI + echoNullableNonNullClassList:classList + completion:^(NSArray *value, FlutterError *error) { + completion(value, error); + }]; +} + +- (void)callFlutterEchoNullableMap:(nullable NSDictionary *)map + completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion { - [self.flutterAPI echoNullableMap:aMap - completion:^(NSDictionary *value, FlutterError *error) { + [self.flutterAPI echoNullableMap:map + completion:^(NSDictionary *value, FlutterError *error) { completion(value, error); }]; } +- (void)callFlutterEchoNullableStringMap:(nullable NSDictionary *)stringMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + [self.flutterAPI + echoNullableStringMap:stringMap + completion:^(NSDictionary *value, FlutterError *error) { + completion(value, error); + }]; +} + +- (void)callFlutterEchoNullableIntMap:(nullable NSDictionary *)intMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + [self.flutterAPI + echoNullableIntMap:intMap + completion:^(NSDictionary *value, FlutterError *error) { + completion(value, error); + }]; +} + +- (void)callFlutterEchoNullableEnumMap: + (nullable NSDictionary *)enumMap + completion: + (void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + [self.flutterAPI echoNullableEnumMap:enumMap + completion:^(NSDictionary *value, + FlutterError *error) { + completion(value, error); + }]; +} + +- (void) + callFlutterEchoNullableClassMap: + (nullable NSDictionary *)classMap + completion: + (void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + [self.flutterAPI echoNullableClassMap:classMap + completion:^(NSDictionary *value, + FlutterError *error) { + completion(value, error); + }]; +} + +- (void)callFlutterEchoNullableNonNullStringMap: + (nullable NSDictionary *)stringMap + completion:(nonnull void (^)( + NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + [self.flutterAPI echoNullableNonNullStringMap:stringMap + completion:^(NSDictionary *value, + FlutterError *error) { + completion(value, error); + }]; +} + +- (void)callFlutterEchoNullableNonNullIntMap:(nullable NSDictionary *)intMap + completion:(nonnull void (^)( + NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + [self.flutterAPI echoNullableNonNullIntMap:intMap + completion:^(NSDictionary *value, + FlutterError *error) { + completion(value, error); + }]; +} + +- (void)callFlutterEchoNullableNonNullEnumMap: + (nullable NSDictionary *)enumMap + completion: + (nonnull void (^)( + NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + [self.flutterAPI echoNullableNonNullEnumMap:enumMap + completion:^(NSDictionary *value, + FlutterError *error) { + completion(value, error); + }]; +} + +- (void) + callFlutterEchoNullableNonNullClassMap: + (nullable NSDictionary *)classMap + completion: + (nonnull void (^)( + NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + [self.flutterAPI + echoNullableNonNullClassMap:classMap + completion:^(NSDictionary *value, + FlutterError *error) { + completion(value, error); + }]; +} + - (void)callFlutterEchoNullableEnum:(nullable FLTAnEnumBox *)AnEnumBoxed completion:(void (^)(FLTAnEnumBox *_Nullable, FlutterError *_Nullable))completion { @@ -647,6 +1127,10 @@ - (void)callFlutterSmallApiEchoString:(nonnull NSString *)aString }]; } +- (FLTUnusedClass *)checkIfUnusedClassGenerated { + return [[FLTUnusedClass alloc] init]; +} + @end @interface AlternateLanguageTestAPIWithSuffix () diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/ios/Classes/CoreTests.gen.h b/packages/pigeon/platform_tests/alternate_language_test_plugin/ios/Classes/CoreTests.gen.h index f3fa20aa6a49..bd913ca95a9e 100644 --- a/packages/pigeon/platform_tests/alternate_language_test_plugin/ios/Classes/CoreTests.gen.h +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/ios/Classes/CoreTests.gen.h @@ -38,12 +38,18 @@ typedef NS_ENUM(NSUInteger, FLTAnotherEnum) { - (instancetype)initWithValue:(FLTAnotherEnum)value; @end +@class FLTUnusedClass; @class FLTAllTypes; @class FLTAllNullableTypes; @class FLTAllNullableTypesWithoutRecursion; @class FLTAllClassesWrapper; @class FLTTestMessage; +@interface FLTUnusedClass : NSObject ++ (instancetype)makeWithAField:(nullable id)aField; +@property(nonatomic, strong, nullable) id aField; +@end + /// A class containing all supported types. @interface FLTAllTypes : NSObject /// `init` unavailable to enforce nonnull fields, see the `make` class method. @@ -65,7 +71,17 @@ typedef NS_ENUM(NSUInteger, FLTAnotherEnum) { intList:(NSArray *)intList doubleList:(NSArray *)doubleList boolList:(NSArray *)boolList - map:(NSDictionary *)map; + enumList:(NSArray *)enumList + objectList:(NSArray *)objectList + listList:(NSArray *> *)listList + mapList:(NSArray *> *)mapList + map:(NSDictionary *)map + stringMap:(NSDictionary *)stringMap + intMap:(NSDictionary *)intMap + enumMap:(NSDictionary *)enumMap + objectMap:(NSDictionary *)objectMap + listMap:(NSDictionary *> *)listMap + mapMap:(NSDictionary *> *)mapMap; @property(nonatomic, assign) BOOL aBool; @property(nonatomic, assign) NSInteger anInt; @property(nonatomic, assign) NSInteger anInt64; @@ -83,35 +99,54 @@ typedef NS_ENUM(NSUInteger, FLTAnotherEnum) { @property(nonatomic, copy) NSArray *intList; @property(nonatomic, copy) NSArray *doubleList; @property(nonatomic, copy) NSArray *boolList; +@property(nonatomic, copy) NSArray *enumList; +@property(nonatomic, copy) NSArray *objectList; +@property(nonatomic, copy) NSArray *> *listList; +@property(nonatomic, copy) NSArray *> *mapList; @property(nonatomic, copy) NSDictionary *map; +@property(nonatomic, copy) NSDictionary *stringMap; +@property(nonatomic, copy) NSDictionary *intMap; +@property(nonatomic, copy) NSDictionary *enumMap; +@property(nonatomic, copy) NSDictionary *objectMap; +@property(nonatomic, copy) NSDictionary *> *listMap; +@property(nonatomic, copy) NSDictionary *> *mapMap; @end /// A class containing all supported nullable types. @interface FLTAllNullableTypes : NSObject -+ (instancetype)makeWithANullableBool:(nullable NSNumber *)aNullableBool - aNullableInt:(nullable NSNumber *)aNullableInt - aNullableInt64:(nullable NSNumber *)aNullableInt64 - aNullableDouble:(nullable NSNumber *)aNullableDouble - aNullableByteArray:(nullable FlutterStandardTypedData *)aNullableByteArray - aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray - aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray - aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray - nullableNestedList:(nullable NSArray *> *)nullableNestedList - nullableMapWithAnnotations: - (nullable NSDictionary *)nullableMapWithAnnotations - nullableMapWithObject:(nullable NSDictionary *)nullableMapWithObject - aNullableEnum:(nullable FLTAnEnumBox *)aNullableEnum - anotherNullableEnum:(nullable FLTAnotherEnumBox *)anotherNullableEnum - aNullableString:(nullable NSString *)aNullableString - aNullableObject:(nullable id)aNullableObject - allNullableTypes:(nullable FLTAllNullableTypes *)allNullableTypes - list:(nullable NSArray *)list - stringList:(nullable NSArray *)stringList - intList:(nullable NSArray *)intList - doubleList:(nullable NSArray *)doubleList - boolList:(nullable NSArray *)boolList - nestedClassList:(nullable NSArray *)nestedClassList - map:(nullable NSDictionary *)map; ++ (instancetype) + makeWithANullableBool:(nullable NSNumber *)aNullableBool + aNullableInt:(nullable NSNumber *)aNullableInt + aNullableInt64:(nullable NSNumber *)aNullableInt64 + aNullableDouble:(nullable NSNumber *)aNullableDouble + aNullableByteArray:(nullable FlutterStandardTypedData *)aNullableByteArray + aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray + aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray + aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray + aNullableEnum:(nullable FLTAnEnumBox *)aNullableEnum + anotherNullableEnum:(nullable FLTAnotherEnumBox *)anotherNullableEnum + aNullableString:(nullable NSString *)aNullableString + aNullableObject:(nullable id)aNullableObject + allNullableTypes:(nullable FLTAllNullableTypes *)allNullableTypes + list:(nullable NSArray *)list + stringList:(nullable NSArray *)stringList + intList:(nullable NSArray *)intList + doubleList:(nullable NSArray *)doubleList + boolList:(nullable NSArray *)boolList + enumList:(nullable NSArray *)enumList + objectList:(nullable NSArray *)objectList + listList:(nullable NSArray *> *)listList + mapList:(nullable NSArray *> *)mapList + recursiveClassList:(nullable NSArray *)recursiveClassList + map:(nullable NSDictionary *)map + stringMap:(nullable NSDictionary *)stringMap + intMap:(nullable NSDictionary *)intMap + enumMap:(nullable NSDictionary *)enumMap + objectMap:(nullable NSDictionary *)objectMap + listMap:(nullable NSDictionary *> *)listMap + mapMap:(nullable NSDictionary *> *)mapMap + recursiveClassMap: + (nullable NSDictionary *)recursiveClassMap; @property(nonatomic, strong, nullable) NSNumber *aNullableBool; @property(nonatomic, strong, nullable) NSNumber *aNullableInt; @property(nonatomic, strong, nullable) NSNumber *aNullableInt64; @@ -120,10 +155,6 @@ typedef NS_ENUM(NSUInteger, FLTAnotherEnum) { @property(nonatomic, strong, nullable) FlutterStandardTypedData *aNullable4ByteArray; @property(nonatomic, strong, nullable) FlutterStandardTypedData *aNullable8ByteArray; @property(nonatomic, strong, nullable) FlutterStandardTypedData *aNullableFloatArray; -@property(nonatomic, copy, nullable) NSArray *> *nullableNestedList; -@property(nonatomic, copy, nullable) - NSDictionary *nullableMapWithAnnotations; -@property(nonatomic, copy, nullable) NSDictionary *nullableMapWithObject; @property(nonatomic, strong, nullable) FLTAnEnumBox *aNullableEnum; @property(nonatomic, strong, nullable) FLTAnotherEnumBox *anotherNullableEnum; @property(nonatomic, copy, nullable) NSString *aNullableString; @@ -134,36 +165,55 @@ typedef NS_ENUM(NSUInteger, FLTAnotherEnum) { @property(nonatomic, copy, nullable) NSArray *intList; @property(nonatomic, copy, nullable) NSArray *doubleList; @property(nonatomic, copy, nullable) NSArray *boolList; -@property(nonatomic, copy, nullable) NSArray *nestedClassList; +@property(nonatomic, copy, nullable) NSArray *enumList; +@property(nonatomic, copy, nullable) NSArray *objectList; +@property(nonatomic, copy, nullable) NSArray *> *listList; +@property(nonatomic, copy, nullable) NSArray *> *mapList; +@property(nonatomic, copy, nullable) NSArray *recursiveClassList; @property(nonatomic, copy, nullable) NSDictionary *map; +@property(nonatomic, copy, nullable) NSDictionary *stringMap; +@property(nonatomic, copy, nullable) NSDictionary *intMap; +@property(nonatomic, copy, nullable) NSDictionary *enumMap; +@property(nonatomic, copy, nullable) NSDictionary *objectMap; +@property(nonatomic, copy, nullable) NSDictionary *> *listMap; +@property(nonatomic, copy, nullable) NSDictionary *> *mapMap; +@property(nonatomic, copy, nullable) + NSDictionary *recursiveClassMap; @end /// The primary purpose for this class is to ensure coverage of Swift structs /// with nullable items, as the primary [AllNullableTypes] class is being used to /// test Swift classes. @interface FLTAllNullableTypesWithoutRecursion : NSObject -+ (instancetype)makeWithANullableBool:(nullable NSNumber *)aNullableBool - aNullableInt:(nullable NSNumber *)aNullableInt - aNullableInt64:(nullable NSNumber *)aNullableInt64 - aNullableDouble:(nullable NSNumber *)aNullableDouble - aNullableByteArray:(nullable FlutterStandardTypedData *)aNullableByteArray - aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray - aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray - aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray - nullableNestedList:(nullable NSArray *> *)nullableNestedList - nullableMapWithAnnotations: - (nullable NSDictionary *)nullableMapWithAnnotations - nullableMapWithObject:(nullable NSDictionary *)nullableMapWithObject - aNullableEnum:(nullable FLTAnEnumBox *)aNullableEnum - anotherNullableEnum:(nullable FLTAnotherEnumBox *)anotherNullableEnum - aNullableString:(nullable NSString *)aNullableString - aNullableObject:(nullable id)aNullableObject - list:(nullable NSArray *)list - stringList:(nullable NSArray *)stringList - intList:(nullable NSArray *)intList - doubleList:(nullable NSArray *)doubleList - boolList:(nullable NSArray *)boolList - map:(nullable NSDictionary *)map; ++ (instancetype) + makeWithANullableBool:(nullable NSNumber *)aNullableBool + aNullableInt:(nullable NSNumber *)aNullableInt + aNullableInt64:(nullable NSNumber *)aNullableInt64 + aNullableDouble:(nullable NSNumber *)aNullableDouble + aNullableByteArray:(nullable FlutterStandardTypedData *)aNullableByteArray + aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray + aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray + aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray + aNullableEnum:(nullable FLTAnEnumBox *)aNullableEnum + anotherNullableEnum:(nullable FLTAnotherEnumBox *)anotherNullableEnum + aNullableString:(nullable NSString *)aNullableString + aNullableObject:(nullable id)aNullableObject + list:(nullable NSArray *)list + stringList:(nullable NSArray *)stringList + intList:(nullable NSArray *)intList + doubleList:(nullable NSArray *)doubleList + boolList:(nullable NSArray *)boolList + enumList:(nullable NSArray *)enumList + objectList:(nullable NSArray *)objectList + listList:(nullable NSArray *> *)listList + mapList:(nullable NSArray *> *)mapList + map:(nullable NSDictionary *)map + stringMap:(nullable NSDictionary *)stringMap + intMap:(nullable NSDictionary *)intMap + enumMap:(nullable NSDictionary *)enumMap + objectMap:(nullable NSDictionary *)objectMap + listMap:(nullable NSDictionary *> *)listMap + mapMap:(nullable NSDictionary *> *)mapMap; @property(nonatomic, strong, nullable) NSNumber *aNullableBool; @property(nonatomic, strong, nullable) NSNumber *aNullableInt; @property(nonatomic, strong, nullable) NSNumber *aNullableInt64; @@ -172,10 +222,6 @@ typedef NS_ENUM(NSUInteger, FLTAnotherEnum) { @property(nonatomic, strong, nullable) FlutterStandardTypedData *aNullable4ByteArray; @property(nonatomic, strong, nullable) FlutterStandardTypedData *aNullable8ByteArray; @property(nonatomic, strong, nullable) FlutterStandardTypedData *aNullableFloatArray; -@property(nonatomic, copy, nullable) NSArray *> *nullableNestedList; -@property(nonatomic, copy, nullable) - NSDictionary *nullableMapWithAnnotations; -@property(nonatomic, copy, nullable) NSDictionary *nullableMapWithObject; @property(nonatomic, strong, nullable) FLTAnEnumBox *aNullableEnum; @property(nonatomic, strong, nullable) FLTAnotherEnumBox *anotherNullableEnum; @property(nonatomic, copy, nullable) NSString *aNullableString; @@ -185,7 +231,17 @@ typedef NS_ENUM(NSUInteger, FLTAnotherEnum) { @property(nonatomic, copy, nullable) NSArray *intList; @property(nonatomic, copy, nullable) NSArray *doubleList; @property(nonatomic, copy, nullable) NSArray *boolList; +@property(nonatomic, copy, nullable) NSArray *enumList; +@property(nonatomic, copy, nullable) NSArray *objectList; +@property(nonatomic, copy, nullable) NSArray *> *listList; +@property(nonatomic, copy, nullable) NSArray *> *mapList; @property(nonatomic, copy, nullable) NSDictionary *map; +@property(nonatomic, copy, nullable) NSDictionary *stringMap; +@property(nonatomic, copy, nullable) NSDictionary *intMap; +@property(nonatomic, copy, nullable) NSDictionary *enumMap; +@property(nonatomic, copy, nullable) NSDictionary *objectMap; +@property(nonatomic, copy, nullable) NSDictionary *> *listMap; +@property(nonatomic, copy, nullable) NSDictionary *> *mapMap; @end /// A class for testing nested class handling. @@ -196,14 +252,28 @@ typedef NS_ENUM(NSUInteger, FLTAnotherEnum) { @interface FLTAllClassesWrapper : NSObject /// `init` unavailable to enforce nonnull fields, see the `make` class method. - (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithAllNullableTypes:(FLTAllNullableTypes *)allNullableTypes - allNullableTypesWithoutRecursion: - (nullable FLTAllNullableTypesWithoutRecursion *)allNullableTypesWithoutRecursion - allTypes:(nullable FLTAllTypes *)allTypes; ++ (instancetype) + makeWithAllNullableTypes:(FLTAllNullableTypes *)allNullableTypes + allNullableTypesWithoutRecursion: + (nullable FLTAllNullableTypesWithoutRecursion *)allNullableTypesWithoutRecursion + allTypes:(nullable FLTAllTypes *)allTypes + classList:(NSArray *)classList + nullableClassList: + (nullable NSArray *)nullableClassList + classMap:(NSDictionary *)classMap + nullableClassMap: + (nullable NSDictionary *) + nullableClassMap; @property(nonatomic, strong) FLTAllNullableTypes *allNullableTypes; @property(nonatomic, strong, nullable) FLTAllNullableTypesWithoutRecursion *allNullableTypesWithoutRecursion; @property(nonatomic, strong, nullable) FLTAllTypes *allTypes; +@property(nonatomic, copy) NSArray *classList; +@property(nonatomic, copy, nullable) + NSArray *nullableClassList; +@property(nonatomic, copy) NSDictionary *classMap; +@property(nonatomic, copy, nullable) + NSDictionary *nullableClassMap; @end /// A data class containing a List, used in unit tests. @@ -263,12 +333,82 @@ NSObject *FLTGetCoreTestsCodec(void); /// @return `nil` only when `error != nil`. - (nullable NSArray *)echoList:(NSArray *)list error:(FlutterError *_Nullable *_Nonnull)error; -/// Returns the passed map, to test serialization and deserialization. +/// Returns the passed list, to test serialization and deserialization. /// /// @return `nil` only when `error != nil`. -- (nullable NSDictionary *)echoMap:(NSDictionary *)aMap +- (nullable NSArray *)echoEnumList:(NSArray *)enumList error:(FlutterError *_Nullable *_Nonnull)error; -/// Returns the passed map to test nested class serialization and deserialization. +/// Returns the passed list, to test serialization and deserialization. +/// +/// @return `nil` only when `error != nil`. +- (nullable NSArray *)echoClassList: + (NSArray *)classList + error:(FlutterError *_Nullable *_Nonnull)error; +/// Returns the passed list, to test serialization and deserialization. +/// +/// @return `nil` only when `error != nil`. +- (nullable NSArray *)echoNonNullEnumList:(NSArray *)enumList + error:(FlutterError *_Nullable *_Nonnull)error; +/// Returns the passed list, to test serialization and deserialization. +/// +/// @return `nil` only when `error != nil`. +- (nullable NSArray *) + echoNonNullClassList:(NSArray *)classList + error:(FlutterError *_Nullable *_Nonnull)error; +/// Returns the passed map, to test serialization and deserialization. +/// +/// @return `nil` only when `error != nil`. +- (nullable NSDictionary *)echoMap:(NSDictionary *)map + error:(FlutterError *_Nullable *_Nonnull)error; +/// Returns the passed map, to test serialization and deserialization. +/// +/// @return `nil` only when `error != nil`. +- (nullable NSDictionary *) + echoStringMap:(NSDictionary *)stringMap + error:(FlutterError *_Nullable *_Nonnull)error; +/// Returns the passed map, to test serialization and deserialization. +/// +/// @return `nil` only when `error != nil`. +- (nullable NSDictionary *) + echoIntMap:(NSDictionary *)intMap + error:(FlutterError *_Nullable *_Nonnull)error; +/// Returns the passed map, to test serialization and deserialization. +/// +/// @return `nil` only when `error != nil`. +- (nullable NSDictionary *) + echoEnumMap:(NSDictionary *)enumMap + error:(FlutterError *_Nullable *_Nonnull)error; +/// Returns the passed map, to test serialization and deserialization. +/// +/// @return `nil` only when `error != nil`. +- (nullable NSDictionary *) + echoClassMap:(NSDictionary *)classMap + error:(FlutterError *_Nullable *_Nonnull)error; +/// Returns the passed map, to test serialization and deserialization. +/// +/// @return `nil` only when `error != nil`. +- (nullable NSDictionary *) + echoNonNullStringMap:(NSDictionary *)stringMap + error:(FlutterError *_Nullable *_Nonnull)error; +/// Returns the passed map, to test serialization and deserialization. +/// +/// @return `nil` only when `error != nil`. +- (nullable NSDictionary *) + echoNonNullIntMap:(NSDictionary *)intMap + error:(FlutterError *_Nullable *_Nonnull)error; +/// Returns the passed map, to test serialization and deserialization. +/// +/// @return `nil` only when `error != nil`. +- (nullable NSDictionary *) + echoNonNullEnumMap:(NSDictionary *)enumMap + error:(FlutterError *_Nullable *_Nonnull)error; +/// Returns the passed map, to test serialization and deserialization. +/// +/// @return `nil` only when `error != nil`. +- (nullable NSDictionary *) + echoNonNullClassMap:(NSDictionary *)classMap + error:(FlutterError *_Nullable *_Nonnull)error; +/// Returns the passed class to test nested class serialization and deserialization. /// /// @return `nil` only when `error != nil`. - (nullable FLTAllClassesWrapper *)echoClassWrapper:(FLTAllClassesWrapper *)wrapper @@ -354,10 +494,57 @@ NSObject *FLTGetCoreTestsCodec(void); /// Returns the passed list, to test serialization and deserialization. - (nullable NSArray *)echoNullableList:(nullable NSArray *)aNullableList error:(FlutterError *_Nullable *_Nonnull)error; -/// Returns the passed map, to test serialization and deserialization. -- (nullable NSDictionary *)echoNullableMap: - (nullable NSDictionary *)aNullableMap +/// Returns the passed list, to test serialization and deserialization. +- (nullable NSArray *)echoNullableEnumList: + (nullable NSArray *)enumList error:(FlutterError *_Nullable *_Nonnull)error; +/// Returns the passed list, to test serialization and deserialization. +- (nullable NSArray *) + echoNullableClassList:(nullable NSArray *)classList + error:(FlutterError *_Nullable *_Nonnull)error; +/// Returns the passed list, to test serialization and deserialization. +- (nullable NSArray *) + echoNullableNonNullEnumList:(nullable NSArray *)enumList + error:(FlutterError *_Nullable *_Nonnull)error; +/// Returns the passed list, to test serialization and deserialization. +- (nullable NSArray *) + echoNullableNonNullClassList:(nullable NSArray *)classList + error:(FlutterError *_Nullable *_Nonnull)error; +/// Returns the passed map, to test serialization and deserialization. +- (nullable NSDictionary *)echoNullableMap:(nullable NSDictionary *)map + error:(FlutterError *_Nullable *_Nonnull)error; +/// Returns the passed map, to test serialization and deserialization. +- (nullable NSDictionary *) + echoNullableStringMap:(nullable NSDictionary *)stringMap + error:(FlutterError *_Nullable *_Nonnull)error; +/// Returns the passed map, to test serialization and deserialization. +- (nullable NSDictionary *) + echoNullableIntMap:(nullable NSDictionary *)intMap + error:(FlutterError *_Nullable *_Nonnull)error; +/// Returns the passed map, to test serialization and deserialization. +- (nullable NSDictionary *) + echoNullableEnumMap:(nullable NSDictionary *)enumMap + error:(FlutterError *_Nullable *_Nonnull)error; +/// Returns the passed map, to test serialization and deserialization. +- (nullable NSDictionary *) + echoNullableClassMap:(nullable NSDictionary *)classMap + error:(FlutterError *_Nullable *_Nonnull)error; +/// Returns the passed map, to test serialization and deserialization. +- (nullable NSDictionary *) + echoNullableNonNullStringMap:(nullable NSDictionary *)stringMap + error:(FlutterError *_Nullable *_Nonnull)error; +/// Returns the passed map, to test serialization and deserialization. +- (nullable NSDictionary *) + echoNullableNonNullIntMap:(nullable NSDictionary *)intMap + error:(FlutterError *_Nullable *_Nonnull)error; +/// Returns the passed map, to test serialization and deserialization. +- (nullable NSDictionary *) + echoNullableNonNullEnumMap:(nullable NSDictionary *)enumMap + error:(FlutterError *_Nullable *_Nonnull)error; +/// Returns the passed map, to test serialization and deserialization. +- (nullable NSDictionary *) + echoNullableNonNullClassMap:(nullable NSDictionary *)classMap + error:(FlutterError *_Nullable *_Nonnull)error; - (FLTAnEnumBox *_Nullable)echoNullableEnum:(nullable FLTAnEnumBox *)anEnumBoxed error:(FlutterError *_Nullable *_Nonnull)error; - (FLTAnotherEnumBox *_Nullable)echoAnotherNullableEnum: @@ -394,10 +581,33 @@ NSObject *FLTGetCoreTestsCodec(void); /// Returns the passed list, to test asynchronous serialization and deserialization. - (void)echoAsyncList:(NSArray *)list completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; +/// Returns the passed list, to test asynchronous serialization and deserialization. +- (void)echoAsyncEnumList:(NSArray *)enumList + completion:(void (^)(NSArray *_Nullable, + FlutterError *_Nullable))completion; +/// Returns the passed list, to test asynchronous serialization and deserialization. +- (void)echoAsyncClassList:(NSArray *)classList + completion:(void (^)(NSArray *_Nullable, + FlutterError *_Nullable))completion; /// Returns the passed map, to test asynchronous serialization and deserialization. -- (void)echoAsyncMap:(NSDictionary *)aMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion; +- (void)echoAsyncMap:(NSDictionary *)map + completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion; +/// Returns the passed map, to test asynchronous serialization and deserialization. +- (void)echoAsyncStringMap:(NSDictionary *)stringMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +/// Returns the passed map, to test asynchronous serialization and deserialization. +- (void)echoAsyncIntMap:(NSDictionary *)intMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +/// Returns the passed map, to test asynchronous serialization and deserialization. +- (void)echoAsyncEnumMap:(NSDictionary *)enumMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +/// Returns the passed map, to test asynchronous serialization and deserialization. +- (void)echoAsyncClassMap:(NSDictionary *)classMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; /// Returns the passed enum, to test asynchronous serialization and deserialization. - (void)echoAsyncEnum:(FLTAnEnum)anEnum completion:(void (^)(FLTAnEnumBox *_Nullable, FlutterError *_Nullable))completion; @@ -448,10 +658,35 @@ NSObject *FLTGetCoreTestsCodec(void); /// Returns the passed list, to test asynchronous serialization and deserialization. - (void)echoAsyncNullableList:(nullable NSArray *)list completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; +/// Returns the passed list, to test asynchronous serialization and deserialization. +- (void)echoAsyncNullableEnumList:(nullable NSArray *)enumList + completion:(void (^)(NSArray *_Nullable, + FlutterError *_Nullable))completion; +/// Returns the passed list, to test asynchronous serialization and deserialization. +- (void)echoAsyncNullableClassList:(nullable NSArray *)classList + completion:(void (^)(NSArray *_Nullable, + FlutterError *_Nullable))completion; /// Returns the passed map, to test asynchronous serialization and deserialization. -- (void)echoAsyncNullableMap:(nullable NSDictionary *)aMap - completion:(void (^)(NSDictionary *_Nullable, +- (void)echoAsyncNullableMap:(nullable NSDictionary *)map + completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion; +/// Returns the passed map, to test asynchronous serialization and deserialization. +- (void)echoAsyncNullableStringMap:(nullable NSDictionary *)stringMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +/// Returns the passed map, to test asynchronous serialization and deserialization. +- (void)echoAsyncNullableIntMap:(nullable NSDictionary *)intMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +/// Returns the passed map, to test asynchronous serialization and deserialization. +- (void)echoAsyncNullableEnumMap:(nullable NSDictionary *)enumMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +/// Returns the passed map, to test asynchronous serialization and deserialization. +- (void) + echoAsyncNullableClassMap:(nullable NSDictionary *)classMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; /// Returns the passed enum, to test asynchronous serialization and deserialization. - (void)echoAsyncNullableEnum:(nullable FLTAnEnumBox *)anEnumBoxed completion: @@ -503,9 +738,49 @@ NSObject *FLTGetCoreTestsCodec(void); FlutterError *_Nullable))completion; - (void)callFlutterEchoList:(NSArray *)list completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoMap:(NSDictionary *)aMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion; +- (void)callFlutterEchoEnumList:(NSArray *)enumList + completion:(void (^)(NSArray *_Nullable, + FlutterError *_Nullable))completion; +- (void)callFlutterEchoClassList:(NSArray *)classList + completion:(void (^)(NSArray *_Nullable, + FlutterError *_Nullable))completion; +- (void)callFlutterEchoNonNullEnumList:(NSArray *)enumList + completion:(void (^)(NSArray *_Nullable, + FlutterError *_Nullable))completion; +- (void)callFlutterEchoNonNullClassList:(NSArray *)classList + completion:(void (^)(NSArray *_Nullable, + FlutterError *_Nullable))completion; +- (void)callFlutterEchoMap:(NSDictionary *)map + completion: + (void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoStringMap:(NSDictionary *)stringMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +- (void)callFlutterEchoIntMap:(NSDictionary *)intMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +- (void)callFlutterEchoEnumMap:(NSDictionary *)enumMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +- (void)callFlutterEchoClassMap:(NSDictionary *)classMap + completion: + (void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +- (void)callFlutterEchoNonNullStringMap:(NSDictionary *)stringMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +- (void)callFlutterEchoNonNullIntMap:(NSDictionary *)intMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +- (void)callFlutterEchoNonNullEnumMap:(NSDictionary *)enumMap + completion: + (void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +- (void) + callFlutterEchoNonNullClassMap:(NSDictionary *)classMap + completion: + (void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; - (void)callFlutterEchoEnum:(FLTAnEnum)anEnum completion:(void (^)(FLTAnEnumBox *_Nullable, FlutterError *_Nullable))completion; - (void)callFlutterEchoAnotherEnum:(FLTAnotherEnum)anotherEnum @@ -529,9 +804,59 @@ NSObject *FLTGetCoreTestsCodec(void); - (void)callFlutterEchoNullableList:(nullable NSArray *)list completion: (void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoNullableMap:(nullable NSDictionary *)aMap - completion:(void (^)(NSDictionary *_Nullable, +- (void)callFlutterEchoNullableEnumList:(nullable NSArray *)enumList + completion:(void (^)(NSArray *_Nullable, + FlutterError *_Nullable))completion; +- (void)callFlutterEchoNullableClassList:(nullable NSArray *)classList + completion:(void (^)(NSArray *_Nullable, + FlutterError *_Nullable))completion; +- (void)callFlutterEchoNullableNonNullEnumList:(nullable NSArray *)enumList + completion:(void (^)(NSArray *_Nullable, + FlutterError *_Nullable))completion; +- (void)callFlutterEchoNullableNonNullClassList:(nullable NSArray *)classList + completion:(void (^)(NSArray *_Nullable, + FlutterError *_Nullable))completion; +- (void)callFlutterEchoNullableMap:(nullable NSDictionary *)map + completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoNullableStringMap:(nullable NSDictionary *)stringMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +- (void)callFlutterEchoNullableIntMap:(nullable NSDictionary *)intMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +- (void)callFlutterEchoNullableEnumMap: + (nullable NSDictionary *)enumMap + completion: + (void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +- (void) + callFlutterEchoNullableClassMap: + (nullable NSDictionary *)classMap + completion: + (void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +- (void)callFlutterEchoNullableNonNullStringMap: + (nullable NSDictionary *)stringMap + completion: + (void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +- (void)callFlutterEchoNullableNonNullIntMap:(nullable NSDictionary *)intMap + completion: + (void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +- (void)callFlutterEchoNullableNonNullEnumMap: + (nullable NSDictionary *)enumMap + completion: + (void (^)( + NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +- (void)callFlutterEchoNullableNonNullClassMap: + (nullable NSDictionary *)classMap + completion: + (void (^)(NSDictionary + *_Nullable, + FlutterError *_Nullable))completion; - (void)callFlutterEchoNullableEnum:(nullable FLTAnEnumBox *)anEnumBoxed completion: (void (^)(FLTAnEnumBox *_Nullable, FlutterError *_Nullable))completion; @@ -612,10 +937,57 @@ extern void SetUpFLTHostIntegrationCoreApiWithSuffix( /// Returns the passed list, to test serialization and deserialization. - (void)echoList:(NSArray *)list completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; +/// Returns the passed list, to test serialization and deserialization. +- (void)echoEnumList:(NSArray *)enumList + completion: + (void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; +/// Returns the passed list, to test serialization and deserialization. +- (void)echoClassList:(NSArray *)classList + completion:(void (^)(NSArray *_Nullable, + FlutterError *_Nullable))completion; +/// Returns the passed list, to test serialization and deserialization. +- (void)echoNonNullEnumList:(NSArray *)enumList + completion:(void (^)(NSArray *_Nullable, + FlutterError *_Nullable))completion; +/// Returns the passed list, to test serialization and deserialization. +- (void)echoNonNullClassList:(NSArray *)classList + completion:(void (^)(NSArray *_Nullable, + FlutterError *_Nullable))completion; +/// Returns the passed map, to test serialization and deserialization. +- (void)echoMap:(NSDictionary *)map + completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion; +/// Returns the passed map, to test serialization and deserialization. +- (void)echoStringMap:(NSDictionary *)stringMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; /// Returns the passed map, to test serialization and deserialization. -- (void)echoMap:(NSDictionary *)aMap - completion: - (void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion; +- (void)echoIntMap:(NSDictionary *)intMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +/// Returns the passed map, to test serialization and deserialization. +- (void)echoEnumMap:(NSDictionary *)enumMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +/// Returns the passed map, to test serialization and deserialization. +- (void)echoClassMap:(NSDictionary *)classMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +/// Returns the passed map, to test serialization and deserialization. +- (void)echoNonNullStringMap:(NSDictionary *)stringMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +/// Returns the passed map, to test serialization and deserialization. +- (void)echoNonNullIntMap:(NSDictionary *)intMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +/// Returns the passed map, to test serialization and deserialization. +- (void)echoNonNullEnumMap:(NSDictionary *)enumMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +/// Returns the passed map, to test serialization and deserialization. +- (void)echoNonNullClassMap:(NSDictionary *)classMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; /// Returns the passed enum to test serialization and deserialization. - (void)echoEnum:(FLTAnEnum)anEnum completion:(void (^)(FLTAnEnumBox *_Nullable, FlutterError *_Nullable))completion; @@ -641,10 +1013,61 @@ extern void SetUpFLTHostIntegrationCoreApiWithSuffix( /// Returns the passed list, to test serialization and deserialization. - (void)echoNullableList:(nullable NSArray *)list completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; +/// Returns the passed list, to test serialization and deserialization. +- (void)echoNullableEnumList:(nullable NSArray *)enumList + completion:(void (^)(NSArray *_Nullable, + FlutterError *_Nullable))completion; +/// Returns the passed list, to test serialization and deserialization. +- (void)echoNullableClassList:(nullable NSArray *)classList + completion:(void (^)(NSArray *_Nullable, + FlutterError *_Nullable))completion; +/// Returns the passed list, to test serialization and deserialization. +- (void)echoNullableNonNullEnumList:(nullable NSArray *)enumList + completion:(void (^)(NSArray *_Nullable, + FlutterError *_Nullable))completion; +/// Returns the passed list, to test serialization and deserialization. +- (void)echoNullableNonNullClassList:(nullable NSArray *)classList + completion:(void (^)(NSArray *_Nullable, + FlutterError *_Nullable))completion; /// Returns the passed map, to test serialization and deserialization. -- (void)echoNullableMap:(nullable NSDictionary *)aMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion; +- (void)echoNullableMap:(nullable NSDictionary *)map + completion: + (void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion; +/// Returns the passed map, to test serialization and deserialization. +- (void)echoNullableStringMap:(nullable NSDictionary *)stringMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +/// Returns the passed map, to test serialization and deserialization. +- (void)echoNullableIntMap:(nullable NSDictionary *)intMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +/// Returns the passed map, to test serialization and deserialization. +- (void)echoNullableEnumMap:(nullable NSDictionary *)enumMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +/// Returns the passed map, to test serialization and deserialization. +- (void)echoNullableClassMap:(nullable NSDictionary *)classMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +/// Returns the passed map, to test serialization and deserialization. +- (void)echoNullableNonNullStringMap:(nullable NSDictionary *)stringMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +/// Returns the passed map, to test serialization and deserialization. +- (void)echoNullableNonNullIntMap:(nullable NSDictionary *)intMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +/// Returns the passed map, to test serialization and deserialization. +- (void)echoNullableNonNullEnumMap:(nullable NSDictionary *)enumMap + completion: + (void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +/// Returns the passed map, to test serialization and deserialization. +- (void)echoNullableNonNullClassMap: + (nullable NSDictionary *)classMap + completion: + (void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; /// Returns the passed enum to test serialization and deserialization. - (void)echoNullableEnum:(nullable FLTAnEnumBox *)anEnumBoxed completion:(void (^)(FLTAnEnumBox *_Nullable, FlutterError *_Nullable))completion; diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/ios/Classes/CoreTests.gen.m b/packages/pigeon/platform_tests/alternate_language_test_plugin/ios/Classes/CoreTests.gen.m index 3d4d841ef151..2cc3da7877d8 100644 --- a/packages/pigeon/platform_tests/alternate_language_test_plugin/ios/Classes/CoreTests.gen.m +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/ios/Classes/CoreTests.gen.m @@ -60,6 +60,12 @@ - (instancetype)initWithValue:(FLTAnotherEnum)value { } @end +@interface FLTUnusedClass () ++ (FLTUnusedClass *)fromList:(NSArray *)list; ++ (nullable FLTUnusedClass *)nullableFromList:(NSArray *)list; +- (NSArray *)toList; +@end + @interface FLTAllTypes () + (FLTAllTypes *)fromList:(NSArray *)list; + (nullable FLTAllTypes *)nullableFromList:(NSArray *)list; @@ -90,6 +96,27 @@ + (nullable FLTTestMessage *)nullableFromList:(NSArray *)list; - (NSArray *)toList; @end +@implementation FLTUnusedClass ++ (instancetype)makeWithAField:(nullable id)aField { + FLTUnusedClass *pigeonResult = [[FLTUnusedClass alloc] init]; + pigeonResult.aField = aField; + return pigeonResult; +} ++ (FLTUnusedClass *)fromList:(NSArray *)list { + FLTUnusedClass *pigeonResult = [[FLTUnusedClass alloc] init]; + pigeonResult.aField = GetNullableObjectAtIndex(list, 0); + return pigeonResult; +} ++ (nullable FLTUnusedClass *)nullableFromList:(NSArray *)list { + return (list) ? [FLTUnusedClass fromList:list] : nil; +} +- (NSArray *)toList { + return @[ + self.aField ?: [NSNull null], + ]; +} +@end + @implementation FLTAllTypes + (instancetype)makeWithABool:(BOOL)aBool anInt:(NSInteger)anInt @@ -108,7 +135,17 @@ + (instancetype)makeWithABool:(BOOL)aBool intList:(NSArray *)intList doubleList:(NSArray *)doubleList boolList:(NSArray *)boolList - map:(NSDictionary *)map { + enumList:(NSArray *)enumList + objectList:(NSArray *)objectList + listList:(NSArray *> *)listList + mapList:(NSArray *> *)mapList + map:(NSDictionary *)map + stringMap:(NSDictionary *)stringMap + intMap:(NSDictionary *)intMap + enumMap:(NSDictionary *)enumMap + objectMap:(NSDictionary *)objectMap + listMap:(NSDictionary *> *)listMap + mapMap:(NSDictionary *> *)mapMap { FLTAllTypes *pigeonResult = [[FLTAllTypes alloc] init]; pigeonResult.aBool = aBool; pigeonResult.anInt = anInt; @@ -127,7 +164,17 @@ + (instancetype)makeWithABool:(BOOL)aBool pigeonResult.intList = intList; pigeonResult.doubleList = doubleList; pigeonResult.boolList = boolList; + pigeonResult.enumList = enumList; + pigeonResult.objectList = objectList; + pigeonResult.listList = listList; + pigeonResult.mapList = mapList; pigeonResult.map = map; + pigeonResult.stringMap = stringMap; + pigeonResult.intMap = intMap; + pigeonResult.enumMap = enumMap; + pigeonResult.objectMap = objectMap; + pigeonResult.listMap = listMap; + pigeonResult.mapMap = mapMap; return pigeonResult; } + (FLTAllTypes *)fromList:(NSArray *)list { @@ -151,7 +198,17 @@ + (FLTAllTypes *)fromList:(NSArray *)list { pigeonResult.intList = GetNullableObjectAtIndex(list, 14); pigeonResult.doubleList = GetNullableObjectAtIndex(list, 15); pigeonResult.boolList = GetNullableObjectAtIndex(list, 16); - pigeonResult.map = GetNullableObjectAtIndex(list, 17); + pigeonResult.enumList = GetNullableObjectAtIndex(list, 17); + pigeonResult.objectList = GetNullableObjectAtIndex(list, 18); + pigeonResult.listList = GetNullableObjectAtIndex(list, 19); + pigeonResult.mapList = GetNullableObjectAtIndex(list, 20); + pigeonResult.map = GetNullableObjectAtIndex(list, 21); + pigeonResult.stringMap = GetNullableObjectAtIndex(list, 22); + pigeonResult.intMap = GetNullableObjectAtIndex(list, 23); + pigeonResult.enumMap = GetNullableObjectAtIndex(list, 24); + pigeonResult.objectMap = GetNullableObjectAtIndex(list, 25); + pigeonResult.listMap = GetNullableObjectAtIndex(list, 26); + pigeonResult.mapMap = GetNullableObjectAtIndex(list, 27); return pigeonResult; } + (nullable FLTAllTypes *)nullableFromList:(NSArray *)list { @@ -176,36 +233,55 @@ + (nullable FLTAllTypes *)nullableFromList:(NSArray *)list { self.intList ?: [NSNull null], self.doubleList ?: [NSNull null], self.boolList ?: [NSNull null], + self.enumList ?: [NSNull null], + self.objectList ?: [NSNull null], + self.listList ?: [NSNull null], + self.mapList ?: [NSNull null], self.map ?: [NSNull null], + self.stringMap ?: [NSNull null], + self.intMap ?: [NSNull null], + self.enumMap ?: [NSNull null], + self.objectMap ?: [NSNull null], + self.listMap ?: [NSNull null], + self.mapMap ?: [NSNull null], ]; } @end @implementation FLTAllNullableTypes -+ (instancetype)makeWithANullableBool:(nullable NSNumber *)aNullableBool - aNullableInt:(nullable NSNumber *)aNullableInt - aNullableInt64:(nullable NSNumber *)aNullableInt64 - aNullableDouble:(nullable NSNumber *)aNullableDouble - aNullableByteArray:(nullable FlutterStandardTypedData *)aNullableByteArray - aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray - aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray - aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray - nullableNestedList:(nullable NSArray *> *)nullableNestedList - nullableMapWithAnnotations: - (nullable NSDictionary *)nullableMapWithAnnotations - nullableMapWithObject:(nullable NSDictionary *)nullableMapWithObject - aNullableEnum:(nullable FLTAnEnumBox *)aNullableEnum - anotherNullableEnum:(nullable FLTAnotherEnumBox *)anotherNullableEnum - aNullableString:(nullable NSString *)aNullableString - aNullableObject:(nullable id)aNullableObject - allNullableTypes:(nullable FLTAllNullableTypes *)allNullableTypes - list:(nullable NSArray *)list - stringList:(nullable NSArray *)stringList - intList:(nullable NSArray *)intList - doubleList:(nullable NSArray *)doubleList - boolList:(nullable NSArray *)boolList - nestedClassList:(nullable NSArray *)nestedClassList - map:(nullable NSDictionary *)map { ++ (instancetype) + makeWithANullableBool:(nullable NSNumber *)aNullableBool + aNullableInt:(nullable NSNumber *)aNullableInt + aNullableInt64:(nullable NSNumber *)aNullableInt64 + aNullableDouble:(nullable NSNumber *)aNullableDouble + aNullableByteArray:(nullable FlutterStandardTypedData *)aNullableByteArray + aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray + aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray + aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray + aNullableEnum:(nullable FLTAnEnumBox *)aNullableEnum + anotherNullableEnum:(nullable FLTAnotherEnumBox *)anotherNullableEnum + aNullableString:(nullable NSString *)aNullableString + aNullableObject:(nullable id)aNullableObject + allNullableTypes:(nullable FLTAllNullableTypes *)allNullableTypes + list:(nullable NSArray *)list + stringList:(nullable NSArray *)stringList + intList:(nullable NSArray *)intList + doubleList:(nullable NSArray *)doubleList + boolList:(nullable NSArray *)boolList + enumList:(nullable NSArray *)enumList + objectList:(nullable NSArray *)objectList + listList:(nullable NSArray *> *)listList + mapList:(nullable NSArray *> *)mapList + recursiveClassList:(nullable NSArray *)recursiveClassList + map:(nullable NSDictionary *)map + stringMap:(nullable NSDictionary *)stringMap + intMap:(nullable NSDictionary *)intMap + enumMap:(nullable NSDictionary *)enumMap + objectMap:(nullable NSDictionary *)objectMap + listMap:(nullable NSDictionary *> *)listMap + mapMap:(nullable NSDictionary *> *)mapMap + recursiveClassMap: + (nullable NSDictionary *)recursiveClassMap { FLTAllNullableTypes *pigeonResult = [[FLTAllNullableTypes alloc] init]; pigeonResult.aNullableBool = aNullableBool; pigeonResult.aNullableInt = aNullableInt; @@ -215,9 +291,6 @@ + (instancetype)makeWithANullableBool:(nullable NSNumber *)aNullableBool pigeonResult.aNullable4ByteArray = aNullable4ByteArray; pigeonResult.aNullable8ByteArray = aNullable8ByteArray; pigeonResult.aNullableFloatArray = aNullableFloatArray; - pigeonResult.nullableNestedList = nullableNestedList; - pigeonResult.nullableMapWithAnnotations = nullableMapWithAnnotations; - pigeonResult.nullableMapWithObject = nullableMapWithObject; pigeonResult.aNullableEnum = aNullableEnum; pigeonResult.anotherNullableEnum = anotherNullableEnum; pigeonResult.aNullableString = aNullableString; @@ -228,8 +301,19 @@ + (instancetype)makeWithANullableBool:(nullable NSNumber *)aNullableBool pigeonResult.intList = intList; pigeonResult.doubleList = doubleList; pigeonResult.boolList = boolList; - pigeonResult.nestedClassList = nestedClassList; + pigeonResult.enumList = enumList; + pigeonResult.objectList = objectList; + pigeonResult.listList = listList; + pigeonResult.mapList = mapList; + pigeonResult.recursiveClassList = recursiveClassList; pigeonResult.map = map; + pigeonResult.stringMap = stringMap; + pigeonResult.intMap = intMap; + pigeonResult.enumMap = enumMap; + pigeonResult.objectMap = objectMap; + pigeonResult.listMap = listMap; + pigeonResult.mapMap = mapMap; + pigeonResult.recursiveClassMap = recursiveClassMap; return pigeonResult; } + (FLTAllNullableTypes *)fromList:(NSArray *)list { @@ -242,21 +326,29 @@ + (FLTAllNullableTypes *)fromList:(NSArray *)list { pigeonResult.aNullable4ByteArray = GetNullableObjectAtIndex(list, 5); pigeonResult.aNullable8ByteArray = GetNullableObjectAtIndex(list, 6); pigeonResult.aNullableFloatArray = GetNullableObjectAtIndex(list, 7); - pigeonResult.nullableNestedList = GetNullableObjectAtIndex(list, 8); - pigeonResult.nullableMapWithAnnotations = GetNullableObjectAtIndex(list, 9); - pigeonResult.nullableMapWithObject = GetNullableObjectAtIndex(list, 10); - pigeonResult.aNullableEnum = GetNullableObjectAtIndex(list, 11); - pigeonResult.anotherNullableEnum = GetNullableObjectAtIndex(list, 12); - pigeonResult.aNullableString = GetNullableObjectAtIndex(list, 13); - pigeonResult.aNullableObject = GetNullableObjectAtIndex(list, 14); - pigeonResult.allNullableTypes = GetNullableObjectAtIndex(list, 15); - pigeonResult.list = GetNullableObjectAtIndex(list, 16); - pigeonResult.stringList = GetNullableObjectAtIndex(list, 17); - pigeonResult.intList = GetNullableObjectAtIndex(list, 18); - pigeonResult.doubleList = GetNullableObjectAtIndex(list, 19); - pigeonResult.boolList = GetNullableObjectAtIndex(list, 20); - pigeonResult.nestedClassList = GetNullableObjectAtIndex(list, 21); - pigeonResult.map = GetNullableObjectAtIndex(list, 22); + pigeonResult.aNullableEnum = GetNullableObjectAtIndex(list, 8); + pigeonResult.anotherNullableEnum = GetNullableObjectAtIndex(list, 9); + pigeonResult.aNullableString = GetNullableObjectAtIndex(list, 10); + pigeonResult.aNullableObject = GetNullableObjectAtIndex(list, 11); + pigeonResult.allNullableTypes = GetNullableObjectAtIndex(list, 12); + pigeonResult.list = GetNullableObjectAtIndex(list, 13); + pigeonResult.stringList = GetNullableObjectAtIndex(list, 14); + pigeonResult.intList = GetNullableObjectAtIndex(list, 15); + pigeonResult.doubleList = GetNullableObjectAtIndex(list, 16); + pigeonResult.boolList = GetNullableObjectAtIndex(list, 17); + pigeonResult.enumList = GetNullableObjectAtIndex(list, 18); + pigeonResult.objectList = GetNullableObjectAtIndex(list, 19); + pigeonResult.listList = GetNullableObjectAtIndex(list, 20); + pigeonResult.mapList = GetNullableObjectAtIndex(list, 21); + pigeonResult.recursiveClassList = GetNullableObjectAtIndex(list, 22); + pigeonResult.map = GetNullableObjectAtIndex(list, 23); + pigeonResult.stringMap = GetNullableObjectAtIndex(list, 24); + pigeonResult.intMap = GetNullableObjectAtIndex(list, 25); + pigeonResult.enumMap = GetNullableObjectAtIndex(list, 26); + pigeonResult.objectMap = GetNullableObjectAtIndex(list, 27); + pigeonResult.listMap = GetNullableObjectAtIndex(list, 28); + pigeonResult.mapMap = GetNullableObjectAtIndex(list, 29); + pigeonResult.recursiveClassMap = GetNullableObjectAtIndex(list, 30); return pigeonResult; } + (nullable FLTAllNullableTypes *)nullableFromList:(NSArray *)list { @@ -272,9 +364,6 @@ + (nullable FLTAllNullableTypes *)nullableFromList:(NSArray *)list { self.aNullable4ByteArray ?: [NSNull null], self.aNullable8ByteArray ?: [NSNull null], self.aNullableFloatArray ?: [NSNull null], - self.nullableNestedList ?: [NSNull null], - self.nullableMapWithAnnotations ?: [NSNull null], - self.nullableMapWithObject ?: [NSNull null], self.aNullableEnum ?: [NSNull null], self.anotherNullableEnum ?: [NSNull null], self.aNullableString ?: [NSNull null], @@ -285,35 +374,53 @@ + (nullable FLTAllNullableTypes *)nullableFromList:(NSArray *)list { self.intList ?: [NSNull null], self.doubleList ?: [NSNull null], self.boolList ?: [NSNull null], - self.nestedClassList ?: [NSNull null], + self.enumList ?: [NSNull null], + self.objectList ?: [NSNull null], + self.listList ?: [NSNull null], + self.mapList ?: [NSNull null], + self.recursiveClassList ?: [NSNull null], self.map ?: [NSNull null], + self.stringMap ?: [NSNull null], + self.intMap ?: [NSNull null], + self.enumMap ?: [NSNull null], + self.objectMap ?: [NSNull null], + self.listMap ?: [NSNull null], + self.mapMap ?: [NSNull null], + self.recursiveClassMap ?: [NSNull null], ]; } @end @implementation FLTAllNullableTypesWithoutRecursion -+ (instancetype)makeWithANullableBool:(nullable NSNumber *)aNullableBool - aNullableInt:(nullable NSNumber *)aNullableInt - aNullableInt64:(nullable NSNumber *)aNullableInt64 - aNullableDouble:(nullable NSNumber *)aNullableDouble - aNullableByteArray:(nullable FlutterStandardTypedData *)aNullableByteArray - aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray - aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray - aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray - nullableNestedList:(nullable NSArray *> *)nullableNestedList - nullableMapWithAnnotations: - (nullable NSDictionary *)nullableMapWithAnnotations - nullableMapWithObject:(nullable NSDictionary *)nullableMapWithObject - aNullableEnum:(nullable FLTAnEnumBox *)aNullableEnum - anotherNullableEnum:(nullable FLTAnotherEnumBox *)anotherNullableEnum - aNullableString:(nullable NSString *)aNullableString - aNullableObject:(nullable id)aNullableObject - list:(nullable NSArray *)list - stringList:(nullable NSArray *)stringList - intList:(nullable NSArray *)intList - doubleList:(nullable NSArray *)doubleList - boolList:(nullable NSArray *)boolList - map:(nullable NSDictionary *)map { ++ (instancetype) + makeWithANullableBool:(nullable NSNumber *)aNullableBool + aNullableInt:(nullable NSNumber *)aNullableInt + aNullableInt64:(nullable NSNumber *)aNullableInt64 + aNullableDouble:(nullable NSNumber *)aNullableDouble + aNullableByteArray:(nullable FlutterStandardTypedData *)aNullableByteArray + aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray + aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray + aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray + aNullableEnum:(nullable FLTAnEnumBox *)aNullableEnum + anotherNullableEnum:(nullable FLTAnotherEnumBox *)anotherNullableEnum + aNullableString:(nullable NSString *)aNullableString + aNullableObject:(nullable id)aNullableObject + list:(nullable NSArray *)list + stringList:(nullable NSArray *)stringList + intList:(nullable NSArray *)intList + doubleList:(nullable NSArray *)doubleList + boolList:(nullable NSArray *)boolList + enumList:(nullable NSArray *)enumList + objectList:(nullable NSArray *)objectList + listList:(nullable NSArray *> *)listList + mapList:(nullable NSArray *> *)mapList + map:(nullable NSDictionary *)map + stringMap:(nullable NSDictionary *)stringMap + intMap:(nullable NSDictionary *)intMap + enumMap:(nullable NSDictionary *)enumMap + objectMap:(nullable NSDictionary *)objectMap + listMap:(nullable NSDictionary *> *)listMap + mapMap:(nullable NSDictionary *> *)mapMap { FLTAllNullableTypesWithoutRecursion *pigeonResult = [[FLTAllNullableTypesWithoutRecursion alloc] init]; pigeonResult.aNullableBool = aNullableBool; @@ -324,9 +431,6 @@ + (instancetype)makeWithANullableBool:(nullable NSNumber *)aNullableBool pigeonResult.aNullable4ByteArray = aNullable4ByteArray; pigeonResult.aNullable8ByteArray = aNullable8ByteArray; pigeonResult.aNullableFloatArray = aNullableFloatArray; - pigeonResult.nullableNestedList = nullableNestedList; - pigeonResult.nullableMapWithAnnotations = nullableMapWithAnnotations; - pigeonResult.nullableMapWithObject = nullableMapWithObject; pigeonResult.aNullableEnum = aNullableEnum; pigeonResult.anotherNullableEnum = anotherNullableEnum; pigeonResult.aNullableString = aNullableString; @@ -336,7 +440,17 @@ + (instancetype)makeWithANullableBool:(nullable NSNumber *)aNullableBool pigeonResult.intList = intList; pigeonResult.doubleList = doubleList; pigeonResult.boolList = boolList; + pigeonResult.enumList = enumList; + pigeonResult.objectList = objectList; + pigeonResult.listList = listList; + pigeonResult.mapList = mapList; pigeonResult.map = map; + pigeonResult.stringMap = stringMap; + pigeonResult.intMap = intMap; + pigeonResult.enumMap = enumMap; + pigeonResult.objectMap = objectMap; + pigeonResult.listMap = listMap; + pigeonResult.mapMap = mapMap; return pigeonResult; } + (FLTAllNullableTypesWithoutRecursion *)fromList:(NSArray *)list { @@ -350,19 +464,26 @@ + (FLTAllNullableTypesWithoutRecursion *)fromList:(NSArray *)list { pigeonResult.aNullable4ByteArray = GetNullableObjectAtIndex(list, 5); pigeonResult.aNullable8ByteArray = GetNullableObjectAtIndex(list, 6); pigeonResult.aNullableFloatArray = GetNullableObjectAtIndex(list, 7); - pigeonResult.nullableNestedList = GetNullableObjectAtIndex(list, 8); - pigeonResult.nullableMapWithAnnotations = GetNullableObjectAtIndex(list, 9); - pigeonResult.nullableMapWithObject = GetNullableObjectAtIndex(list, 10); - pigeonResult.aNullableEnum = GetNullableObjectAtIndex(list, 11); - pigeonResult.anotherNullableEnum = GetNullableObjectAtIndex(list, 12); - pigeonResult.aNullableString = GetNullableObjectAtIndex(list, 13); - pigeonResult.aNullableObject = GetNullableObjectAtIndex(list, 14); - pigeonResult.list = GetNullableObjectAtIndex(list, 15); - pigeonResult.stringList = GetNullableObjectAtIndex(list, 16); - pigeonResult.intList = GetNullableObjectAtIndex(list, 17); - pigeonResult.doubleList = GetNullableObjectAtIndex(list, 18); - pigeonResult.boolList = GetNullableObjectAtIndex(list, 19); - pigeonResult.map = GetNullableObjectAtIndex(list, 20); + pigeonResult.aNullableEnum = GetNullableObjectAtIndex(list, 8); + pigeonResult.anotherNullableEnum = GetNullableObjectAtIndex(list, 9); + pigeonResult.aNullableString = GetNullableObjectAtIndex(list, 10); + pigeonResult.aNullableObject = GetNullableObjectAtIndex(list, 11); + pigeonResult.list = GetNullableObjectAtIndex(list, 12); + pigeonResult.stringList = GetNullableObjectAtIndex(list, 13); + pigeonResult.intList = GetNullableObjectAtIndex(list, 14); + pigeonResult.doubleList = GetNullableObjectAtIndex(list, 15); + pigeonResult.boolList = GetNullableObjectAtIndex(list, 16); + pigeonResult.enumList = GetNullableObjectAtIndex(list, 17); + pigeonResult.objectList = GetNullableObjectAtIndex(list, 18); + pigeonResult.listList = GetNullableObjectAtIndex(list, 19); + pigeonResult.mapList = GetNullableObjectAtIndex(list, 20); + pigeonResult.map = GetNullableObjectAtIndex(list, 21); + pigeonResult.stringMap = GetNullableObjectAtIndex(list, 22); + pigeonResult.intMap = GetNullableObjectAtIndex(list, 23); + pigeonResult.enumMap = GetNullableObjectAtIndex(list, 24); + pigeonResult.objectMap = GetNullableObjectAtIndex(list, 25); + pigeonResult.listMap = GetNullableObjectAtIndex(list, 26); + pigeonResult.mapMap = GetNullableObjectAtIndex(list, 27); return pigeonResult; } + (nullable FLTAllNullableTypesWithoutRecursion *)nullableFromList:(NSArray *)list { @@ -378,9 +499,6 @@ + (nullable FLTAllNullableTypesWithoutRecursion *)nullableFromList:(NSArray self.aNullable4ByteArray ?: [NSNull null], self.aNullable8ByteArray ?: [NSNull null], self.aNullableFloatArray ?: [NSNull null], - self.nullableNestedList ?: [NSNull null], - self.nullableMapWithAnnotations ?: [NSNull null], - self.nullableMapWithObject ?: [NSNull null], self.aNullableEnum ?: [NSNull null], self.anotherNullableEnum ?: [NSNull null], self.aNullableString ?: [NSNull null], @@ -390,20 +508,42 @@ + (nullable FLTAllNullableTypesWithoutRecursion *)nullableFromList:(NSArray self.intList ?: [NSNull null], self.doubleList ?: [NSNull null], self.boolList ?: [NSNull null], + self.enumList ?: [NSNull null], + self.objectList ?: [NSNull null], + self.listList ?: [NSNull null], + self.mapList ?: [NSNull null], self.map ?: [NSNull null], + self.stringMap ?: [NSNull null], + self.intMap ?: [NSNull null], + self.enumMap ?: [NSNull null], + self.objectMap ?: [NSNull null], + self.listMap ?: [NSNull null], + self.mapMap ?: [NSNull null], ]; } @end @implementation FLTAllClassesWrapper -+ (instancetype)makeWithAllNullableTypes:(FLTAllNullableTypes *)allNullableTypes - allNullableTypesWithoutRecursion: - (nullable FLTAllNullableTypesWithoutRecursion *)allNullableTypesWithoutRecursion - allTypes:(nullable FLTAllTypes *)allTypes { ++ (instancetype) + makeWithAllNullableTypes:(FLTAllNullableTypes *)allNullableTypes + allNullableTypesWithoutRecursion: + (nullable FLTAllNullableTypesWithoutRecursion *)allNullableTypesWithoutRecursion + allTypes:(nullable FLTAllTypes *)allTypes + classList:(NSArray *)classList + nullableClassList: + (nullable NSArray *)nullableClassList + classMap:(NSDictionary *)classMap + nullableClassMap: + (nullable NSDictionary *) + nullableClassMap { FLTAllClassesWrapper *pigeonResult = [[FLTAllClassesWrapper alloc] init]; pigeonResult.allNullableTypes = allNullableTypes; pigeonResult.allNullableTypesWithoutRecursion = allNullableTypesWithoutRecursion; pigeonResult.allTypes = allTypes; + pigeonResult.classList = classList; + pigeonResult.nullableClassList = nullableClassList; + pigeonResult.classMap = classMap; + pigeonResult.nullableClassMap = nullableClassMap; return pigeonResult; } + (FLTAllClassesWrapper *)fromList:(NSArray *)list { @@ -411,6 +551,10 @@ + (FLTAllClassesWrapper *)fromList:(NSArray *)list { pigeonResult.allNullableTypes = GetNullableObjectAtIndex(list, 0); pigeonResult.allNullableTypesWithoutRecursion = GetNullableObjectAtIndex(list, 1); pigeonResult.allTypes = GetNullableObjectAtIndex(list, 2); + pigeonResult.classList = GetNullableObjectAtIndex(list, 3); + pigeonResult.nullableClassList = GetNullableObjectAtIndex(list, 4); + pigeonResult.classMap = GetNullableObjectAtIndex(list, 5); + pigeonResult.nullableClassMap = GetNullableObjectAtIndex(list, 6); return pigeonResult; } + (nullable FLTAllClassesWrapper *)nullableFromList:(NSArray *)list { @@ -421,6 +565,10 @@ + (nullable FLTAllClassesWrapper *)nullableFromList:(NSArray *)list { self.allNullableTypes ?: [NSNull null], self.allNullableTypesWithoutRecursion ?: [NSNull null], self.allTypes ?: [NSNull null], + self.classList ?: [NSNull null], + self.nullableClassList ?: [NSNull null], + self.classMap ?: [NSNull null], + self.nullableClassMap ?: [NSNull null], ]; } @end @@ -463,14 +611,16 @@ - (nullable id)readValueOfType:(UInt8)type { : [[FLTAnotherEnumBox alloc] initWithValue:[enumAsNumber integerValue]]; } case 131: - return [FLTAllTypes fromList:[self readValue]]; + return [FLTUnusedClass fromList:[self readValue]]; case 132: - return [FLTAllNullableTypes fromList:[self readValue]]; + return [FLTAllTypes fromList:[self readValue]]; case 133: - return [FLTAllNullableTypesWithoutRecursion fromList:[self readValue]]; + return [FLTAllNullableTypes fromList:[self readValue]]; case 134: - return [FLTAllClassesWrapper fromList:[self readValue]]; + return [FLTAllNullableTypesWithoutRecursion fromList:[self readValue]]; case 135: + return [FLTAllClassesWrapper fromList:[self readValue]]; + case 136: return [FLTTestMessage fromList:[self readValue]]; default: return [super readValueOfType:type]; @@ -490,21 +640,24 @@ - (void)writeValue:(id)value { FLTAnotherEnumBox *box = (FLTAnotherEnumBox *)value; [self writeByte:130]; [self writeValue:(value == nil ? [NSNull null] : [NSNumber numberWithInteger:box.value])]; - } else if ([value isKindOfClass:[FLTAllTypes class]]) { + } else if ([value isKindOfClass:[FLTUnusedClass class]]) { [self writeByte:131]; [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FLTAllNullableTypes class]]) { + } else if ([value isKindOfClass:[FLTAllTypes class]]) { [self writeByte:132]; [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FLTAllNullableTypesWithoutRecursion class]]) { + } else if ([value isKindOfClass:[FLTAllNullableTypes class]]) { [self writeByte:133]; [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FLTAllClassesWrapper class]]) { + } else if ([value isKindOfClass:[FLTAllNullableTypesWithoutRecursion class]]) { [self writeByte:134]; [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FLTTestMessage class]]) { + } else if ([value isKindOfClass:[FLTAllClassesWrapper class]]) { [self writeByte:135]; [self writeValue:[value toList]]; + } else if ([value isKindOfClass:[FLTTestMessage class]]) { + [self writeByte:136]; + [self writeValue:[value toList]]; } else { [super writeValue:value]; } @@ -832,2008 +985,2025 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM [channel setMessageHandler:nil]; } } - /// Returns the passed map, to test serialization and deserialization. + /// Returns the passed list, to test serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoMap", + @"HostIntegrationCoreApi.echoEnumList", messageChannelSuffix] binaryMessenger:binaryMessenger codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoMap:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoMap:error:)", - api); + NSCAssert( + [api respondsToSelector:@selector(echoEnumList:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoEnumList:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSDictionary *arg_aMap = GetNullableObjectAtIndex(args, 0); + NSArray *arg_enumList = GetNullableObjectAtIndex(args, 0); FlutterError *error; - NSDictionary *output = [api echoMap:arg_aMap error:&error]; + NSArray *output = [api echoEnumList:arg_enumList error:&error]; callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns the passed map to test nested class serialization and deserialization. + /// Returns the passed list, to test serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoClassWrapper", + @"HostIntegrationCoreApi.echoClassList", messageChannelSuffix] binaryMessenger:binaryMessenger codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoClassWrapper:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoClassWrapper:error:)", - api); + NSCAssert( + [api respondsToSelector:@selector(echoClassList:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoClassList:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - FLTAllClassesWrapper *arg_wrapper = GetNullableObjectAtIndex(args, 0); + NSArray *arg_classList = GetNullableObjectAtIndex(args, 0); FlutterError *error; - FLTAllClassesWrapper *output = [api echoClassWrapper:arg_wrapper error:&error]; + NSArray *output = [api echoClassList:arg_classList error:&error]; callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns the passed enum to test serialization and deserialization. + /// Returns the passed list, to test serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoEnum", + @"HostIntegrationCoreApi.echoNonNullEnumList", messageChannelSuffix] binaryMessenger:binaryMessenger codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoEnum:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoEnum:error:)", + NSCAssert([api respondsToSelector:@selector(echoNonNullEnumList:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoNonNullEnumList:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - FLTAnEnumBox *boxedFLTAnEnum = GetNullableObjectAtIndex(args, 0); - FLTAnEnum arg_anEnum = boxedFLTAnEnum.value; + NSArray *arg_enumList = GetNullableObjectAtIndex(args, 0); FlutterError *error; - FLTAnEnumBox *output = [api echoEnum:arg_anEnum error:&error]; + NSArray *output = [api echoNonNullEnumList:arg_enumList error:&error]; callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns the passed enum to test serialization and deserialization. + /// Returns the passed list, to test serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAnotherEnum", + @"HostIntegrationCoreApi.echoNonNullClassList", messageChannelSuffix] binaryMessenger:binaryMessenger codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAnotherEnum:error:)], + NSCAssert([api respondsToSelector:@selector(echoNonNullClassList:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAnotherEnum:error:)", + @"@selector(echoNonNullClassList:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - FLTAnotherEnumBox *boxedFLTAnotherEnum = GetNullableObjectAtIndex(args, 0); - FLTAnotherEnum arg_anotherEnum = boxedFLTAnotherEnum.value; + NSArray *arg_classList = GetNullableObjectAtIndex(args, 0); FlutterError *error; - FLTAnotherEnumBox *output = [api echoAnotherEnum:arg_anotherEnum error:&error]; + NSArray *output = [api echoNonNullClassList:arg_classList + error:&error]; callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns the default string. + /// Returns the passed map, to test serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoNamedDefaultString", + @"HostIntegrationCoreApi.echoMap", messageChannelSuffix] binaryMessenger:binaryMessenger codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoNamedDefaultString:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoNamedDefaultString:error:)", + NSCAssert([api respondsToSelector:@selector(echoMap:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoMap:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSString *arg_aString = GetNullableObjectAtIndex(args, 0); + NSDictionary *arg_map = GetNullableObjectAtIndex(args, 0); FlutterError *error; - NSString *output = [api echoNamedDefaultString:arg_aString error:&error]; + NSDictionary *output = [api echoMap:arg_map error:&error]; callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns passed in double. + /// Returns the passed map, to test serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoOptionalDefaultDouble", - messageChannelSuffix] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoStringMap", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoOptionalDefaultDouble:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoOptionalDefaultDouble:error:)", - api); + NSCAssert( + [api respondsToSelector:@selector(echoStringMap:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoStringMap:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - double arg_aDouble = [GetNullableObjectAtIndex(args, 0) doubleValue]; + NSDictionary *arg_stringMap = GetNullableObjectAtIndex(args, 0); FlutterError *error; - NSNumber *output = [api echoOptionalDefaultDouble:arg_aDouble error:&error]; + NSDictionary *output = [api echoStringMap:arg_stringMap + error:&error]; callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns passed in int. + /// Returns the passed map, to test serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoRequiredInt", + @"HostIntegrationCoreApi.echoIntMap", messageChannelSuffix] binaryMessenger:binaryMessenger codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoRequiredInt:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoRequiredInt:error:)", - api); + NSCAssert( + [api respondsToSelector:@selector(echoIntMap:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoIntMap:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSInteger arg_anInt = [GetNullableObjectAtIndex(args, 0) integerValue]; + NSDictionary *arg_intMap = GetNullableObjectAtIndex(args, 0); FlutterError *error; - NSNumber *output = [api echoRequiredInt:arg_anInt error:&error]; + NSDictionary *output = [api echoIntMap:arg_intMap error:&error]; callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns the passed object, to test serialization and deserialization. + /// Returns the passed map, to test serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAllNullableTypes", + @"HostIntegrationCoreApi.echoEnumMap", messageChannelSuffix] binaryMessenger:binaryMessenger codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAllNullableTypes:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAllNullableTypes:error:)", - api); + NSCAssert( + [api respondsToSelector:@selector(echoEnumMap:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoEnumMap:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - FLTAllNullableTypes *arg_everything = GetNullableObjectAtIndex(args, 0); + NSDictionary *arg_enumMap = + GetNullableObjectAtIndex(args, 0); FlutterError *error; - FLTAllNullableTypes *output = [api echoAllNullableTypes:arg_everything error:&error]; + NSDictionary *output = [api echoEnumMap:arg_enumMap + error:&error]; callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns the passed object, to test serialization and deserialization. + /// Returns the passed map, to test serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - [NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAllNullableTypesWithoutRecursion", - messageChannelSuffix] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoClassMap", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAllNullableTypesWithoutRecursion:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAllNullableTypesWithoutRecursion:error:)", - api); + NSCAssert( + [api respondsToSelector:@selector(echoClassMap:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoClassMap:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - FLTAllNullableTypesWithoutRecursion *arg_everything = GetNullableObjectAtIndex(args, 0); + NSDictionary *arg_classMap = + GetNullableObjectAtIndex(args, 0); FlutterError *error; - FLTAllNullableTypesWithoutRecursion *output = - [api echoAllNullableTypesWithoutRecursion:arg_everything error:&error]; + NSDictionary *output = [api echoClassMap:arg_classMap + error:&error]; callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns the inner `aString` value from the wrapped object, to test - /// sending of nested objects. + /// Returns the passed map, to test serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.extractNestedNullableString", - messageChannelSuffix] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoNonNullStringMap", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(extractNestedNullableStringFrom:error:)], + NSCAssert([api respondsToSelector:@selector(echoNonNullStringMap:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(extractNestedNullableStringFrom:error:)", + @"@selector(echoNonNullStringMap:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - FLTAllClassesWrapper *arg_wrapper = GetNullableObjectAtIndex(args, 0); + NSDictionary *arg_stringMap = GetNullableObjectAtIndex(args, 0); FlutterError *error; - NSString *output = [api extractNestedNullableStringFrom:arg_wrapper error:&error]; + NSDictionary *output = [api echoNonNullStringMap:arg_stringMap + error:&error]; callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns the inner `aString` value from the wrapped object, to test - /// sending of nested objects. + /// Returns the passed map, to test serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.createNestedNullableString", - messageChannelSuffix] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoNonNullIntMap", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(createNestedObjectWithNullableString:error:)], + NSCAssert([api respondsToSelector:@selector(echoNonNullIntMap:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(createNestedObjectWithNullableString:error:)", + @"@selector(echoNonNullIntMap:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSString *arg_nullableString = GetNullableObjectAtIndex(args, 0); + NSDictionary *arg_intMap = GetNullableObjectAtIndex(args, 0); FlutterError *error; - FLTAllClassesWrapper *output = [api createNestedObjectWithNullableString:arg_nullableString - error:&error]; + NSDictionary *output = [api echoNonNullIntMap:arg_intMap + error:&error]; callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns passed in arguments of multiple types. + /// Returns the passed map, to test serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.sendMultipleNullableTypes", - messageChannelSuffix] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoNonNullEnumMap", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(sendMultipleNullableTypesABool: - anInt:aString:error:)], + NSCAssert([api respondsToSelector:@selector(echoNonNullEnumMap:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(sendMultipleNullableTypesABool:anInt:aString:error:)", + @"@selector(echoNonNullEnumMap:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSNumber *arg_aNullableBool = GetNullableObjectAtIndex(args, 0); - NSNumber *arg_aNullableInt = GetNullableObjectAtIndex(args, 1); - NSString *arg_aNullableString = GetNullableObjectAtIndex(args, 2); + NSDictionary *arg_enumMap = + GetNullableObjectAtIndex(args, 0); FlutterError *error; - FLTAllNullableTypes *output = [api sendMultipleNullableTypesABool:arg_aNullableBool - anInt:arg_aNullableInt - aString:arg_aNullableString - error:&error]; + NSDictionary *output = [api echoNonNullEnumMap:arg_enumMap + error:&error]; callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns passed in arguments of multiple types. + /// Returns the passed map, to test serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion", - messageChannelSuffix] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoNonNullClassMap", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector - (sendMultipleNullableTypesWithoutRecursionABool:anInt:aString:error:)], + NSCAssert([api respondsToSelector:@selector(echoNonNullClassMap:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(sendMultipleNullableTypesWithoutRecursionABool:anInt:aString:error:)", + @"@selector(echoNonNullClassMap:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSNumber *arg_aNullableBool = GetNullableObjectAtIndex(args, 0); - NSNumber *arg_aNullableInt = GetNullableObjectAtIndex(args, 1); - NSString *arg_aNullableString = GetNullableObjectAtIndex(args, 2); + NSDictionary *arg_classMap = + GetNullableObjectAtIndex(args, 0); FlutterError *error; - FLTAllNullableTypesWithoutRecursion *output = - [api sendMultipleNullableTypesWithoutRecursionABool:arg_aNullableBool - anInt:arg_aNullableInt - aString:arg_aNullableString - error:&error]; + NSDictionary *output = + [api echoNonNullClassMap:arg_classMap error:&error]; callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns passed in int. + /// Returns the passed class to test nested class serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoNullableInt", + @"HostIntegrationCoreApi.echoClassWrapper", messageChannelSuffix] binaryMessenger:binaryMessenger codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoNullableInt:error:)], + NSCAssert([api respondsToSelector:@selector(echoClassWrapper:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoNullableInt:error:)", + @"@selector(echoClassWrapper:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSNumber *arg_aNullableInt = GetNullableObjectAtIndex(args, 0); + FLTAllClassesWrapper *arg_wrapper = GetNullableObjectAtIndex(args, 0); FlutterError *error; - NSNumber *output = [api echoNullableInt:arg_aNullableInt error:&error]; + FLTAllClassesWrapper *output = [api echoClassWrapper:arg_wrapper error:&error]; callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns passed in double. + /// Returns the passed enum to test serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoNullableDouble", + @"HostIntegrationCoreApi.echoEnum", messageChannelSuffix] binaryMessenger:binaryMessenger codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoNullableDouble:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoNullableDouble:error:)", + NSCAssert([api respondsToSelector:@selector(echoEnum:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoEnum:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSNumber *arg_aNullableDouble = GetNullableObjectAtIndex(args, 0); + FLTAnEnumBox *boxedFLTAnEnum = GetNullableObjectAtIndex(args, 0); + FLTAnEnum arg_anEnum = boxedFLTAnEnum.value; FlutterError *error; - NSNumber *output = [api echoNullableDouble:arg_aNullableDouble error:&error]; + FLTAnEnumBox *output = [api echoEnum:arg_anEnum error:&error]; callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns the passed in boolean. + /// Returns the passed enum to test serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoNullableBool", + @"HostIntegrationCoreApi.echoAnotherEnum", messageChannelSuffix] binaryMessenger:binaryMessenger codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoNullableBool:error:)], + NSCAssert([api respondsToSelector:@selector(echoAnotherEnum:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoNullableBool:error:)", + @"@selector(echoAnotherEnum:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSNumber *arg_aNullableBool = GetNullableObjectAtIndex(args, 0); + FLTAnotherEnumBox *boxedFLTAnotherEnum = GetNullableObjectAtIndex(args, 0); + FLTAnotherEnum arg_anotherEnum = boxedFLTAnotherEnum.value; FlutterError *error; - NSNumber *output = [api echoNullableBool:arg_aNullableBool error:&error]; + FLTAnotherEnumBox *output = [api echoAnotherEnum:arg_anotherEnum error:&error]; callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns the passed in string. + /// Returns the default string. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoNullableString", + @"HostIntegrationCoreApi.echoNamedDefaultString", messageChannelSuffix] binaryMessenger:binaryMessenger codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoNullableString:error:)], + NSCAssert([api respondsToSelector:@selector(echoNamedDefaultString:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoNullableString:error:)", + @"@selector(echoNamedDefaultString:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSString *arg_aNullableString = GetNullableObjectAtIndex(args, 0); + NSString *arg_aString = GetNullableObjectAtIndex(args, 0); FlutterError *error; - NSString *output = [api echoNullableString:arg_aNullableString error:&error]; + NSString *output = [api echoNamedDefaultString:arg_aString error:&error]; callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns the passed in Uint8List. + /// Returns passed in double. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoNullableUint8List", - messageChannelSuffix] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoOptionalDefaultDouble", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoNullableUint8List:error:)], + NSCAssert([api respondsToSelector:@selector(echoOptionalDefaultDouble:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoNullableUint8List:error:)", + @"@selector(echoOptionalDefaultDouble:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - FlutterStandardTypedData *arg_aNullableUint8List = GetNullableObjectAtIndex(args, 0); + double arg_aDouble = [GetNullableObjectAtIndex(args, 0) doubleValue]; FlutterError *error; - FlutterStandardTypedData *output = [api echoNullableUint8List:arg_aNullableUint8List - error:&error]; + NSNumber *output = [api echoOptionalDefaultDouble:arg_aDouble error:&error]; callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns the passed in generic Object. + /// Returns passed in int. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoNullableObject", + @"HostIntegrationCoreApi.echoRequiredInt", messageChannelSuffix] binaryMessenger:binaryMessenger codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoNullableObject:error:)], + NSCAssert([api respondsToSelector:@selector(echoRequiredInt:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoNullableObject:error:)", + @"@selector(echoRequiredInt:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - id arg_aNullableObject = GetNullableObjectAtIndex(args, 0); + NSInteger arg_anInt = [GetNullableObjectAtIndex(args, 0) integerValue]; FlutterError *error; - id output = [api echoNullableObject:arg_aNullableObject error:&error]; + NSNumber *output = [api echoRequiredInt:arg_anInt error:&error]; callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns the passed list, to test serialization and deserialization. + /// Returns the passed object, to test serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoNullableList", + @"HostIntegrationCoreApi.echoAllNullableTypes", messageChannelSuffix] binaryMessenger:binaryMessenger codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoNullableList:error:)], + NSCAssert([api respondsToSelector:@selector(echoAllNullableTypes:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoNullableList:error:)", + @"@selector(echoAllNullableTypes:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSArray *arg_aNullableList = GetNullableObjectAtIndex(args, 0); + FLTAllNullableTypes *arg_everything = GetNullableObjectAtIndex(args, 0); FlutterError *error; - NSArray *output = [api echoNullableList:arg_aNullableList error:&error]; + FLTAllNullableTypes *output = [api echoAllNullableTypes:arg_everything error:&error]; callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns the passed map, to test serialization and deserialization. + /// Returns the passed object, to test serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoNullableMap", - messageChannelSuffix] + initWithName: + [NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAllNullableTypesWithoutRecursion", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoNullableMap:error:)], + NSCAssert([api respondsToSelector:@selector(echoAllNullableTypesWithoutRecursion:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoNullableMap:error:)", + @"@selector(echoAllNullableTypesWithoutRecursion:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSDictionary *arg_aNullableMap = GetNullableObjectAtIndex(args, 0); + FLTAllNullableTypesWithoutRecursion *arg_everything = GetNullableObjectAtIndex(args, 0); FlutterError *error; - NSDictionary *output = [api echoNullableMap:arg_aNullableMap error:&error]; + FLTAllNullableTypesWithoutRecursion *output = + [api echoAllNullableTypesWithoutRecursion:arg_everything error:&error]; callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } + /// Returns the inner `aString` value from the wrapped object, to test + /// sending of nested objects. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoNullableEnum", - messageChannelSuffix] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.extractNestedNullableString", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoNullableEnum:error:)], + NSCAssert([api respondsToSelector:@selector(extractNestedNullableStringFrom:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoNullableEnum:error:)", + @"@selector(extractNestedNullableStringFrom:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - FLTAnEnumBox *arg_anEnum = GetNullableObjectAtIndex(args, 0); + FLTAllClassesWrapper *arg_wrapper = GetNullableObjectAtIndex(args, 0); FlutterError *error; - FLTAnEnumBox *output = [api echoNullableEnum:arg_anEnum error:&error]; + NSString *output = [api extractNestedNullableStringFrom:arg_wrapper error:&error]; callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } + /// Returns the inner `aString` value from the wrapped object, to test + /// sending of nested objects. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAnotherNullableEnum", + @"HostIntegrationCoreApi.createNestedNullableString", messageChannelSuffix] binaryMessenger:binaryMessenger codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAnotherNullableEnum:error:)], + NSCAssert([api respondsToSelector:@selector(createNestedObjectWithNullableString:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAnotherNullableEnum:error:)", + @"@selector(createNestedObjectWithNullableString:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - FLTAnotherEnumBox *arg_anotherEnum = GetNullableObjectAtIndex(args, 0); + NSString *arg_nullableString = GetNullableObjectAtIndex(args, 0); FlutterError *error; - FLTAnotherEnumBox *output = [api echoAnotherNullableEnum:arg_anotherEnum error:&error]; + FLTAllClassesWrapper *output = [api createNestedObjectWithNullableString:arg_nullableString + error:&error]; callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns passed in int. + /// Returns passed in arguments of multiple types. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoOptionalNullableInt", + @"HostIntegrationCoreApi.sendMultipleNullableTypes", messageChannelSuffix] binaryMessenger:binaryMessenger codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoOptionalNullableInt:error:)], + NSCAssert([api respondsToSelector:@selector(sendMultipleNullableTypesABool: + anInt:aString:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoOptionalNullableInt:error:)", + @"@selector(sendMultipleNullableTypesABool:anInt:aString:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSNumber *arg_aNullableInt = GetNullableObjectAtIndex(args, 0); + NSNumber *arg_aNullableBool = GetNullableObjectAtIndex(args, 0); + NSNumber *arg_aNullableInt = GetNullableObjectAtIndex(args, 1); + NSString *arg_aNullableString = GetNullableObjectAtIndex(args, 2); FlutterError *error; - NSNumber *output = [api echoOptionalNullableInt:arg_aNullableInt error:&error]; + FLTAllNullableTypes *output = [api sendMultipleNullableTypesABool:arg_aNullableBool + anInt:arg_aNullableInt + aString:arg_aNullableString + error:&error]; callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns the passed in string. + /// Returns passed in arguments of multiple types. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoNamedNullableString", - messageChannelSuffix] + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoNamedNullableString:error:)], + NSCAssert([api respondsToSelector:@selector + (sendMultipleNullableTypesWithoutRecursionABool:anInt:aString:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoNamedNullableString:error:)", + @"@selector(sendMultipleNullableTypesWithoutRecursionABool:anInt:aString:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSString *arg_aNullableString = GetNullableObjectAtIndex(args, 0); + NSNumber *arg_aNullableBool = GetNullableObjectAtIndex(args, 0); + NSNumber *arg_aNullableInt = GetNullableObjectAtIndex(args, 1); + NSString *arg_aNullableString = GetNullableObjectAtIndex(args, 2); FlutterError *error; - NSString *output = [api echoNamedNullableString:arg_aNullableString error:&error]; + FLTAllNullableTypesWithoutRecursion *output = + [api sendMultipleNullableTypesWithoutRecursionABool:arg_aNullableBool + anInt:arg_aNullableInt + aString:arg_aNullableString + error:&error]; callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// A no-op function taking no arguments and returning no value, to sanity - /// test basic asynchronous calling. + /// Returns passed in int. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.noopAsync", + @"HostIntegrationCoreApi.echoNullableInt", messageChannelSuffix] binaryMessenger:binaryMessenger codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(noopAsyncWithCompletion:)], + NSCAssert([api respondsToSelector:@selector(echoNullableInt:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(noopAsyncWithCompletion:)", + @"@selector(echoNullableInt:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - [api noopAsyncWithCompletion:^(FlutterError *_Nullable error) { - callback(wrapResult(nil, error)); - }]; + NSArray *args = message; + NSNumber *arg_aNullableInt = GetNullableObjectAtIndex(args, 0); + FlutterError *error; + NSNumber *output = [api echoNullableInt:arg_aNullableInt error:&error]; + callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns passed in int asynchronously. + /// Returns passed in double. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncInt", + @"HostIntegrationCoreApi.echoNullableDouble", messageChannelSuffix] binaryMessenger:binaryMessenger codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncInt:completion:)], + NSCAssert([api respondsToSelector:@selector(echoNullableDouble:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncInt:completion:)", + @"@selector(echoNullableDouble:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSInteger arg_anInt = [GetNullableObjectAtIndex(args, 0) integerValue]; - [api echoAsyncInt:arg_anInt - completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + NSNumber *arg_aNullableDouble = GetNullableObjectAtIndex(args, 0); + FlutterError *error; + NSNumber *output = [api echoNullableDouble:arg_aNullableDouble error:&error]; + callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns passed in double asynchronously. + /// Returns the passed in boolean. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncDouble", + @"HostIntegrationCoreApi.echoNullableBool", messageChannelSuffix] binaryMessenger:binaryMessenger codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncDouble:completion:)], + NSCAssert([api respondsToSelector:@selector(echoNullableBool:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncDouble:completion:)", + @"@selector(echoNullableBool:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - double arg_aDouble = [GetNullableObjectAtIndex(args, 0) doubleValue]; - [api echoAsyncDouble:arg_aDouble - completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + NSNumber *arg_aNullableBool = GetNullableObjectAtIndex(args, 0); + FlutterError *error; + NSNumber *output = [api echoNullableBool:arg_aNullableBool error:&error]; + callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns the passed in boolean asynchronously. + /// Returns the passed in string. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncBool", + @"HostIntegrationCoreApi.echoNullableString", messageChannelSuffix] binaryMessenger:binaryMessenger codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncBool:completion:)], + NSCAssert([api respondsToSelector:@selector(echoNullableString:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncBool:completion:)", + @"@selector(echoNullableString:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - BOOL arg_aBool = [GetNullableObjectAtIndex(args, 0) boolValue]; - [api echoAsyncBool:arg_aBool - completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + NSString *arg_aNullableString = GetNullableObjectAtIndex(args, 0); + FlutterError *error; + NSString *output = [api echoNullableString:arg_aNullableString error:&error]; + callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns the passed string asynchronously. + /// Returns the passed in Uint8List. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncString", + @"HostIntegrationCoreApi.echoNullableUint8List", messageChannelSuffix] binaryMessenger:binaryMessenger codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncString:completion:)], + NSCAssert([api respondsToSelector:@selector(echoNullableUint8List:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncString:completion:)", + @"@selector(echoNullableUint8List:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSString *arg_aString = GetNullableObjectAtIndex(args, 0); - [api echoAsyncString:arg_aString - completion:^(NSString *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + FlutterStandardTypedData *arg_aNullableUint8List = GetNullableObjectAtIndex(args, 0); + FlutterError *error; + FlutterStandardTypedData *output = [api echoNullableUint8List:arg_aNullableUint8List + error:&error]; + callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns the passed in Uint8List asynchronously. + /// Returns the passed in generic Object. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncUint8List", + @"HostIntegrationCoreApi.echoNullableObject", messageChannelSuffix] binaryMessenger:binaryMessenger codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncUint8List:completion:)], + NSCAssert([api respondsToSelector:@selector(echoNullableObject:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncUint8List:completion:)", + @"@selector(echoNullableObject:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - FlutterStandardTypedData *arg_aUint8List = GetNullableObjectAtIndex(args, 0); - [api echoAsyncUint8List:arg_aUint8List - completion:^(FlutterStandardTypedData *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + id arg_aNullableObject = GetNullableObjectAtIndex(args, 0); + FlutterError *error; + id output = [api echoNullableObject:arg_aNullableObject error:&error]; + callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns the passed in generic Object asynchronously. + /// Returns the passed list, to test serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncObject", + @"HostIntegrationCoreApi.echoNullableList", messageChannelSuffix] binaryMessenger:binaryMessenger codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncObject:completion:)], + NSCAssert([api respondsToSelector:@selector(echoNullableList:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncObject:completion:)", + @"@selector(echoNullableList:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - id arg_anObject = GetNullableObjectAtIndex(args, 0); - [api echoAsyncObject:arg_anObject - completion:^(id _Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + NSArray *arg_aNullableList = GetNullableObjectAtIndex(args, 0); + FlutterError *error; + NSArray *output = [api echoNullableList:arg_aNullableList error:&error]; + callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns the passed list, to test asynchronous serialization and deserialization. + /// Returns the passed list, to test serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncList", + @"HostIntegrationCoreApi.echoNullableEnumList", messageChannelSuffix] binaryMessenger:binaryMessenger codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncList:completion:)], + NSCAssert([api respondsToSelector:@selector(echoNullableEnumList:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncList:completion:)", + @"@selector(echoNullableEnumList:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSArray *arg_list = GetNullableObjectAtIndex(args, 0); - [api echoAsyncList:arg_list - completion:^(NSArray *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + NSArray *arg_enumList = GetNullableObjectAtIndex(args, 0); + FlutterError *error; + NSArray *output = [api echoNullableEnumList:arg_enumList error:&error]; + callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns the passed map, to test asynchronous serialization and deserialization. + /// Returns the passed list, to test serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncMap", + @"HostIntegrationCoreApi.echoNullableClassList", messageChannelSuffix] binaryMessenger:binaryMessenger codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncMap:completion:)], + NSCAssert([api respondsToSelector:@selector(echoNullableClassList:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncMap:completion:)", + @"@selector(echoNullableClassList:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSDictionary *arg_aMap = GetNullableObjectAtIndex(args, 0); - [api echoAsyncMap:arg_aMap - completion:^(NSDictionary *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + NSArray *arg_classList = GetNullableObjectAtIndex(args, 0); + FlutterError *error; + NSArray *output = [api echoNullableClassList:arg_classList + error:&error]; + callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns the passed enum, to test asynchronous serialization and deserialization. + /// Returns the passed list, to test serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncEnum", - messageChannelSuffix] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoNullableNonNullEnumList", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncEnum:completion:)], + NSCAssert([api respondsToSelector:@selector(echoNullableNonNullEnumList:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncEnum:completion:)", + @"@selector(echoNullableNonNullEnumList:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - FLTAnEnumBox *boxedFLTAnEnum = GetNullableObjectAtIndex(args, 0); - FLTAnEnum arg_anEnum = boxedFLTAnEnum.value; - [api echoAsyncEnum:arg_anEnum - completion:^(FLTAnEnumBox *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + NSArray *arg_enumList = GetNullableObjectAtIndex(args, 0); + FlutterError *error; + NSArray *output = [api echoNullableNonNullEnumList:arg_enumList + error:&error]; + callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns the passed enum, to test asynchronous serialization and deserialization. + /// Returns the passed list, to test serialization and deserialization. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoNullableNonNullClassList", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(echoNullableNonNullClassList:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoNullableNonNullClassList:error:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSArray *arg_classList = GetNullableObjectAtIndex(args, 0); + FlutterError *error; + NSArray *output = [api echoNullableNonNullClassList:arg_classList + error:&error]; + callback(wrapResult(output, error)); + }]; + } else { + [channel setMessageHandler:nil]; + } + } + /// Returns the passed map, to test serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAnotherAsyncEnum", + @"HostIntegrationCoreApi.echoNullableMap", messageChannelSuffix] binaryMessenger:binaryMessenger codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAnotherAsyncEnum:completion:)], + NSCAssert([api respondsToSelector:@selector(echoNullableMap:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAnotherAsyncEnum:completion:)", + @"@selector(echoNullableMap:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - FLTAnotherEnumBox *boxedFLTAnotherEnum = GetNullableObjectAtIndex(args, 0); - FLTAnotherEnum arg_anotherEnum = boxedFLTAnotherEnum.value; - [api echoAnotherAsyncEnum:arg_anotherEnum - completion:^(FLTAnotherEnumBox *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + NSDictionary *arg_map = GetNullableObjectAtIndex(args, 0); + FlutterError *error; + NSDictionary *output = [api echoNullableMap:arg_map error:&error]; + callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Responds with an error from an async function returning a value. + /// Returns the passed map, to test serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.throwAsyncError", + @"HostIntegrationCoreApi.echoNullableStringMap", messageChannelSuffix] binaryMessenger:binaryMessenger codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(throwAsyncErrorWithCompletion:)], + NSCAssert([api respondsToSelector:@selector(echoNullableStringMap:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(throwAsyncErrorWithCompletion:)", + @"@selector(echoNullableStringMap:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - [api throwAsyncErrorWithCompletion:^(id _Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + NSArray *args = message; + NSDictionary *arg_stringMap = GetNullableObjectAtIndex(args, 0); + FlutterError *error; + NSDictionary *output = [api echoNullableStringMap:arg_stringMap + error:&error]; + callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Responds with an error from an async void function. + /// Returns the passed map, to test serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.throwAsyncErrorFromVoid", - messageChannelSuffix] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoNullableIntMap", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(throwAsyncErrorFromVoidWithCompletion:)], + NSCAssert([api respondsToSelector:@selector(echoNullableIntMap:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(throwAsyncErrorFromVoidWithCompletion:)", + @"@selector(echoNullableIntMap:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - [api throwAsyncErrorFromVoidWithCompletion:^(FlutterError *_Nullable error) { - callback(wrapResult(nil, error)); - }]; + NSArray *args = message; + NSDictionary *arg_intMap = GetNullableObjectAtIndex(args, 0); + FlutterError *error; + NSDictionary *output = [api echoNullableIntMap:arg_intMap + error:&error]; + callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Responds with a Flutter error from an async function returning a value. + /// Returns the passed map, to test serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.throwAsyncFlutterError", + @"HostIntegrationCoreApi.echoNullableEnumMap", messageChannelSuffix] binaryMessenger:binaryMessenger codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(throwAsyncFlutterErrorWithCompletion:)], + NSCAssert([api respondsToSelector:@selector(echoNullableEnumMap:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(throwAsyncFlutterErrorWithCompletion:)", + @"@selector(echoNullableEnumMap:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - [api throwAsyncFlutterErrorWithCompletion:^(id _Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + NSArray *args = message; + NSDictionary *arg_enumMap = + GetNullableObjectAtIndex(args, 0); + FlutterError *error; + NSDictionary *output = [api echoNullableEnumMap:arg_enumMap + error:&error]; + callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns the passed object, to test async serialization and deserialization. + /// Returns the passed map, to test serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncAllTypes", + @"HostIntegrationCoreApi.echoNullableClassMap", messageChannelSuffix] binaryMessenger:binaryMessenger codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncAllTypes:completion:)], + NSCAssert([api respondsToSelector:@selector(echoNullableClassMap:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncAllTypes:completion:)", + @"@selector(echoNullableClassMap:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - FLTAllTypes *arg_everything = GetNullableObjectAtIndex(args, 0); - [api echoAsyncAllTypes:arg_everything - completion:^(FLTAllTypes *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + NSDictionary *arg_classMap = + GetNullableObjectAtIndex(args, 0); + FlutterError *error; + NSDictionary *output = + [api echoNullableClassMap:arg_classMap error:&error]; + callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns the passed object, to test serialization and deserialization. + /// Returns the passed map, to test serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncNullableAllNullableTypes", - messageChannelSuffix] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoNullableNonNullStringMap", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableAllNullableTypes:completion:)], + NSCAssert([api respondsToSelector:@selector(echoNullableNonNullStringMap:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncNullableAllNullableTypes:completion:)", + @"@selector(echoNullableNonNullStringMap:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - FLTAllNullableTypes *arg_everything = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableAllNullableTypes:arg_everything - completion:^(FLTAllNullableTypes *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + NSDictionary *arg_stringMap = GetNullableObjectAtIndex(args, 0); + FlutterError *error; + NSDictionary *output = + [api echoNullableNonNullStringMap:arg_stringMap error:&error]; + callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns the passed object, to test serialization and deserialization. + /// Returns the passed map, to test serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi." - @"echoAsyncNullableAllNullableTypesWithoutRecursion", + @"HostIntegrationCoreApi.echoNullableNonNullIntMap", messageChannelSuffix] binaryMessenger:binaryMessenger codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector - (echoAsyncNullableAllNullableTypesWithoutRecursion:completion:)], + NSCAssert([api respondsToSelector:@selector(echoNullableNonNullIntMap:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncNullableAllNullableTypesWithoutRecursion:completion:)", + @"@selector(echoNullableNonNullIntMap:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - FLTAllNullableTypesWithoutRecursion *arg_everything = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableAllNullableTypesWithoutRecursion:arg_everything - completion:^(FLTAllNullableTypesWithoutRecursion - *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + NSDictionary *arg_intMap = GetNullableObjectAtIndex(args, 0); + FlutterError *error; + NSDictionary *output = [api echoNullableNonNullIntMap:arg_intMap + error:&error]; + callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns passed in int asynchronously. + /// Returns the passed map, to test serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncNullableInt", - messageChannelSuffix] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoNullableNonNullEnumMap", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableInt:completion:)], + NSCAssert([api respondsToSelector:@selector(echoNullableNonNullEnumMap:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncNullableInt:completion:)", + @"@selector(echoNullableNonNullEnumMap:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSNumber *arg_anInt = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableInt:arg_anInt - completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + NSDictionary *arg_enumMap = + GetNullableObjectAtIndex(args, 0); + FlutterError *error; + NSDictionary *output = + [api echoNullableNonNullEnumMap:arg_enumMap error:&error]; + callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns passed in double asynchronously. + /// Returns the passed map, to test serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncNullableDouble", + @"HostIntegrationCoreApi.echoNullableNonNullClassMap", messageChannelSuffix] binaryMessenger:binaryMessenger codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableDouble:completion:)], + NSCAssert([api respondsToSelector:@selector(echoNullableNonNullClassMap:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncNullableDouble:completion:)", + @"@selector(echoNullableNonNullClassMap:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSNumber *arg_aDouble = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableDouble:arg_aDouble - completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + NSDictionary *arg_classMap = + GetNullableObjectAtIndex(args, 0); + FlutterError *error; + NSDictionary *output = + [api echoNullableNonNullClassMap:arg_classMap error:&error]; + callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns the passed in boolean asynchronously. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncNullableBool", + @"HostIntegrationCoreApi.echoNullableEnum", messageChannelSuffix] binaryMessenger:binaryMessenger codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableBool:completion:)], + NSCAssert([api respondsToSelector:@selector(echoNullableEnum:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncNullableBool:completion:)", + @"@selector(echoNullableEnum:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSNumber *arg_aBool = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableBool:arg_aBool - completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + FLTAnEnumBox *arg_anEnum = GetNullableObjectAtIndex(args, 0); + FlutterError *error; + FLTAnEnumBox *output = [api echoNullableEnum:arg_anEnum error:&error]; + callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns the passed string asynchronously. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncNullableString", + @"HostIntegrationCoreApi.echoAnotherNullableEnum", messageChannelSuffix] binaryMessenger:binaryMessenger codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableString:completion:)], + NSCAssert([api respondsToSelector:@selector(echoAnotherNullableEnum:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncNullableString:completion:)", + @"@selector(echoAnotherNullableEnum:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSString *arg_aString = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableString:arg_aString - completion:^(NSString *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + FLTAnotherEnumBox *arg_anotherEnum = GetNullableObjectAtIndex(args, 0); + FlutterError *error; + FLTAnotherEnumBox *output = [api echoAnotherNullableEnum:arg_anotherEnum error:&error]; + callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns the passed in Uint8List asynchronously. + /// Returns passed in int. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncNullableUint8List", + @"HostIntegrationCoreApi.echoOptionalNullableInt", messageChannelSuffix] binaryMessenger:binaryMessenger codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableUint8List:completion:)], + NSCAssert([api respondsToSelector:@selector(echoOptionalNullableInt:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncNullableUint8List:completion:)", + @"@selector(echoOptionalNullableInt:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - FlutterStandardTypedData *arg_aUint8List = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableUint8List:arg_aUint8List - completion:^(FlutterStandardTypedData *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + NSNumber *arg_aNullableInt = GetNullableObjectAtIndex(args, 0); + FlutterError *error; + NSNumber *output = [api echoOptionalNullableInt:arg_aNullableInt error:&error]; + callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns the passed in generic Object asynchronously. + /// Returns the passed in string. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncNullableObject", + @"HostIntegrationCoreApi.echoNamedNullableString", messageChannelSuffix] binaryMessenger:binaryMessenger codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableObject:completion:)], + NSCAssert([api respondsToSelector:@selector(echoNamedNullableString:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncNullableObject:completion:)", + @"@selector(echoNamedNullableString:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - id arg_anObject = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableObject:arg_anObject - completion:^(id _Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + NSString *arg_aNullableString = GetNullableObjectAtIndex(args, 0); + FlutterError *error; + NSString *output = [api echoNamedNullableString:arg_aNullableString error:&error]; + callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns the passed list, to test asynchronous serialization and deserialization. + /// A no-op function taking no arguments and returning no value, to sanity + /// test basic asynchronous calling. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncNullableList", + @"HostIntegrationCoreApi.noopAsync", messageChannelSuffix] binaryMessenger:binaryMessenger codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableList:completion:)], + NSCAssert([api respondsToSelector:@selector(noopAsyncWithCompletion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncNullableList:completion:)", + @"@selector(noopAsyncWithCompletion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSArray *arg_list = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableList:arg_list - completion:^(NSArray *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api noopAsyncWithCompletion:^(FlutterError *_Nullable error) { + callback(wrapResult(nil, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } - /// Returns the passed map, to test asynchronous serialization and deserialization. + /// Returns passed in int asynchronously. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncNullableMap", + @"HostIntegrationCoreApi.echoAsyncInt", messageChannelSuffix] binaryMessenger:binaryMessenger codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableMap:completion:)], + NSCAssert([api respondsToSelector:@selector(echoAsyncInt:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncNullableMap:completion:)", + @"@selector(echoAsyncInt:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSDictionary *arg_aMap = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableMap:arg_aMap - completion:^(NSDictionary *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + NSInteger arg_anInt = [GetNullableObjectAtIndex(args, 0) integerValue]; + [api echoAsyncInt:arg_anInt + completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } - /// Returns the passed enum, to test asynchronous serialization and deserialization. + /// Returns passed in double asynchronously. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncNullableEnum", + @"HostIntegrationCoreApi.echoAsyncDouble", messageChannelSuffix] binaryMessenger:binaryMessenger codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableEnum:completion:)], + NSCAssert([api respondsToSelector:@selector(echoAsyncDouble:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncNullableEnum:completion:)", + @"@selector(echoAsyncDouble:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - FLTAnEnumBox *arg_anEnum = GetNullableObjectAtIndex(args, 0); - [api - echoAsyncNullableEnum:arg_anEnum - completion:^(FLTAnEnumBox *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + double arg_aDouble = [GetNullableObjectAtIndex(args, 0) doubleValue]; + [api echoAsyncDouble:arg_aDouble + completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } - /// Returns the passed enum, to test asynchronous serialization and deserialization. + /// Returns the passed in boolean asynchronously. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAnotherAsyncNullableEnum", - messageChannelSuffix] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncBool", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAnotherAsyncNullableEnum:completion:)], + NSCAssert([api respondsToSelector:@selector(echoAsyncBool:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAnotherAsyncNullableEnum:completion:)", + @"@selector(echoAsyncBool:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - FLTAnotherEnumBox *arg_anotherEnum = GetNullableObjectAtIndex(args, 0); - [api echoAnotherAsyncNullableEnum:arg_anotherEnum - completion:^(FLTAnotherEnumBox *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + BOOL arg_aBool = [GetNullableObjectAtIndex(args, 0) boolValue]; + [api echoAsyncBool:arg_aBool + completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } + /// Returns the passed string asynchronously. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterNoop", + @"HostIntegrationCoreApi.echoAsyncString", messageChannelSuffix] binaryMessenger:binaryMessenger codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterNoopWithCompletion:)], + NSCAssert([api respondsToSelector:@selector(echoAsyncString:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterNoopWithCompletion:)", + @"@selector(echoAsyncString:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - [api callFlutterNoopWithCompletion:^(FlutterError *_Nullable error) { - callback(wrapResult(nil, error)); - }]; + NSArray *args = message; + NSString *arg_aString = GetNullableObjectAtIndex(args, 0); + [api echoAsyncString:arg_aString + completion:^(NSString *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } + /// Returns the passed in Uint8List asynchronously. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterThrowError", + @"HostIntegrationCoreApi.echoAsyncUint8List", messageChannelSuffix] binaryMessenger:binaryMessenger codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterThrowErrorWithCompletion:)], + NSCAssert([api respondsToSelector:@selector(echoAsyncUint8List:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterThrowErrorWithCompletion:)", + @"@selector(echoAsyncUint8List:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - [api callFlutterThrowErrorWithCompletion:^(id _Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + NSArray *args = message; + FlutterStandardTypedData *arg_aUint8List = GetNullableObjectAtIndex(args, 0); + [api echoAsyncUint8List:arg_aUint8List + completion:^(FlutterStandardTypedData *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } + /// Returns the passed in generic Object asynchronously. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterThrowErrorFromVoid", - messageChannelSuffix] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncObject", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterThrowErrorFromVoidWithCompletion:)], + NSCAssert([api respondsToSelector:@selector(echoAsyncObject:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterThrowErrorFromVoidWithCompletion:)", + @"@selector(echoAsyncObject:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - [api callFlutterThrowErrorFromVoidWithCompletion:^(FlutterError *_Nullable error) { - callback(wrapResult(nil, error)); - }]; + NSArray *args = message; + id arg_anObject = GetNullableObjectAtIndex(args, 0); + [api echoAsyncObject:arg_anObject + completion:^(id _Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } + /// Returns the passed list, to test asynchronous serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoAllTypes", - messageChannelSuffix] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncList", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoAllTypes:completion:)], + NSCAssert([api respondsToSelector:@selector(echoAsyncList:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoAllTypes:completion:)", + @"@selector(echoAsyncList:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - FLTAllTypes *arg_everything = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoAllTypes:arg_everything - completion:^(FLTAllTypes *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + NSArray *arg_list = GetNullableObjectAtIndex(args, 0); + [api echoAsyncList:arg_list + completion:^(NSArray *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } + /// Returns the passed list, to test asynchronous serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoAllNullableTypes", - messageChannelSuffix] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncEnumList", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoAllNullableTypes:completion:)], + NSCAssert([api respondsToSelector:@selector(echoAsyncEnumList:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoAllNullableTypes:completion:)", + @"@selector(echoAsyncEnumList:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - FLTAllNullableTypes *arg_everything = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoAllNullableTypes:arg_everything - completion:^(FLTAllNullableTypes *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + NSArray *arg_enumList = GetNullableObjectAtIndex(args, 0); + [api echoAsyncEnumList:arg_enumList + completion:^(NSArray *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } + /// Returns the passed list, to test asynchronous serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - [NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterSendMultipleNullableTypes", - messageChannelSuffix] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncClassList", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector - (callFlutterSendMultipleNullableTypesABool:anInt:aString:completion:)], + NSCAssert([api respondsToSelector:@selector(echoAsyncClassList:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterSendMultipleNullableTypesABool:anInt:aString:completion:)", + @"@selector(echoAsyncClassList:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSNumber *arg_aNullableBool = GetNullableObjectAtIndex(args, 0); - NSNumber *arg_aNullableInt = GetNullableObjectAtIndex(args, 1); - NSString *arg_aNullableString = GetNullableObjectAtIndex(args, 2); - [api callFlutterSendMultipleNullableTypesABool:arg_aNullableBool - anInt:arg_aNullableInt - aString:arg_aNullableString - completion:^(FLTAllNullableTypes *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + NSArray *arg_classList = GetNullableObjectAtIndex(args, 0); + [api echoAsyncClassList:arg_classList + completion:^(NSArray *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } + /// Returns the passed map, to test asynchronous serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi." - @"callFlutterEchoAllNullableTypesWithoutRecursion", - messageChannelSuffix] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncMap", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector - (callFlutterEchoAllNullableTypesWithoutRecursion:completion:)], + NSCAssert([api respondsToSelector:@selector(echoAsyncMap:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoAllNullableTypesWithoutRecursion:completion:)", + @"@selector(echoAsyncMap:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - FLTAllNullableTypesWithoutRecursion *arg_everything = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoAllNullableTypesWithoutRecursion:arg_everything - completion:^(FLTAllNullableTypesWithoutRecursion - *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + NSDictionary *arg_map = GetNullableObjectAtIndex(args, 0); + [api echoAsyncMap:arg_map + completion:^(NSDictionary *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } + /// Returns the passed map, to test asynchronous serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - [NSString stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"callFlutterSendMultipleNullableTypesWithoutRecursion", - messageChannelSuffix] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncStringMap", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert( - [api respondsToSelector:@selector - (callFlutterSendMultipleNullableTypesWithoutRecursionABool: - anInt:aString:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterSendMultipleNullableTypesWithoutRecursionABool:anInt:aString:" - @"completion:)", - api); + NSCAssert([api respondsToSelector:@selector(echoAsyncStringMap:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncStringMap:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSNumber *arg_aNullableBool = GetNullableObjectAtIndex(args, 0); - NSNumber *arg_aNullableInt = GetNullableObjectAtIndex(args, 1); - NSString *arg_aNullableString = GetNullableObjectAtIndex(args, 2); - [api callFlutterSendMultipleNullableTypesWithoutRecursionABool:arg_aNullableBool - anInt:arg_aNullableInt - aString:arg_aNullableString - completion:^( - FLTAllNullableTypesWithoutRecursion - *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + NSDictionary *arg_stringMap = GetNullableObjectAtIndex(args, 0); + [api echoAsyncStringMap:arg_stringMap + completion:^(NSDictionary *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } + /// Returns the passed map, to test asynchronous serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoBool", + @"HostIntegrationCoreApi.echoAsyncIntMap", messageChannelSuffix] binaryMessenger:binaryMessenger codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoBool:completion:)], + NSCAssert([api respondsToSelector:@selector(echoAsyncIntMap:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoBool:completion:)", + @"@selector(echoAsyncIntMap:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - BOOL arg_aBool = [GetNullableObjectAtIndex(args, 0) boolValue]; - [api callFlutterEchoBool:arg_aBool - completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + NSDictionary *arg_intMap = GetNullableObjectAtIndex(args, 0); + [api echoAsyncIntMap:arg_intMap + completion:^(NSDictionary *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } + /// Returns the passed map, to test asynchronous serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoInt", + @"HostIntegrationCoreApi.echoAsyncEnumMap", messageChannelSuffix] binaryMessenger:binaryMessenger codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoInt:completion:)], + NSCAssert([api respondsToSelector:@selector(echoAsyncEnumMap:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoInt:completion:)", + @"@selector(echoAsyncEnumMap:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSInteger arg_anInt = [GetNullableObjectAtIndex(args, 0) integerValue]; - [api callFlutterEchoInt:arg_anInt - completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + NSDictionary *arg_enumMap = + GetNullableObjectAtIndex(args, 0); + [api echoAsyncEnumMap:arg_enumMap + completion:^(NSDictionary *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } + /// Returns the passed map, to test asynchronous serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoDouble", + @"HostIntegrationCoreApi.echoAsyncClassMap", messageChannelSuffix] binaryMessenger:binaryMessenger codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoDouble:completion:)], + NSCAssert([api respondsToSelector:@selector(echoAsyncClassMap:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoDouble:completion:)", + @"@selector(echoAsyncClassMap:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - double arg_aDouble = [GetNullableObjectAtIndex(args, 0) doubleValue]; - [api callFlutterEchoDouble:arg_aDouble - completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + NSDictionary *arg_classMap = + GetNullableObjectAtIndex(args, 0); + [api echoAsyncClassMap:arg_classMap + completion:^(NSDictionary *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } + /// Returns the passed enum, to test asynchronous serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoString", + @"HostIntegrationCoreApi.echoAsyncEnum", messageChannelSuffix] binaryMessenger:binaryMessenger codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoString:completion:)], + NSCAssert([api respondsToSelector:@selector(echoAsyncEnum:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoString:completion:)", + @"@selector(echoAsyncEnum:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSString *arg_aString = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoString:arg_aString - completion:^(NSString *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + FLTAnEnumBox *boxedFLTAnEnum = GetNullableObjectAtIndex(args, 0); + FLTAnEnum arg_anEnum = boxedFLTAnEnum.value; + [api echoAsyncEnum:arg_anEnum + completion:^(FLTAnEnumBox *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } + /// Returns the passed enum, to test asynchronous serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoUint8List", - messageChannelSuffix] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAnotherAsyncEnum", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoUint8List:completion:)], + NSCAssert([api respondsToSelector:@selector(echoAnotherAsyncEnum:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoUint8List:completion:)", + @"@selector(echoAnotherAsyncEnum:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - FlutterStandardTypedData *arg_list = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoUint8List:arg_list - completion:^(FlutterStandardTypedData *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + FLTAnotherEnumBox *boxedFLTAnotherEnum = GetNullableObjectAtIndex(args, 0); + FLTAnotherEnum arg_anotherEnum = boxedFLTAnotherEnum.value; + [api echoAnotherAsyncEnum:arg_anotherEnum + completion:^(FLTAnotherEnumBox *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } + /// Responds with an error from an async function returning a value. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoList", + @"HostIntegrationCoreApi.throwAsyncError", messageChannelSuffix] binaryMessenger:binaryMessenger codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoList:completion:)], + NSCAssert([api respondsToSelector:@selector(throwAsyncErrorWithCompletion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoList:completion:)", + @"@selector(throwAsyncErrorWithCompletion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSArray *arg_list = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoList:arg_list - completion:^(NSArray *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api throwAsyncErrorWithCompletion:^(id _Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } + /// Responds with an error from an async void function. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoMap", - messageChannelSuffix] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.throwAsyncErrorFromVoid", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoMap:completion:)], + NSCAssert([api respondsToSelector:@selector(throwAsyncErrorFromVoidWithCompletion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoMap:completion:)", + @"@selector(throwAsyncErrorFromVoidWithCompletion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSDictionary *arg_aMap = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoMap:arg_aMap - completion:^(NSDictionary *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api throwAsyncErrorFromVoidWithCompletion:^(FlutterError *_Nullable error) { + callback(wrapResult(nil, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } + /// Responds with a Flutter error from an async function returning a value. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoEnum", + @"HostIntegrationCoreApi.throwAsyncFlutterError", messageChannelSuffix] binaryMessenger:binaryMessenger codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoEnum:completion:)], + NSCAssert([api respondsToSelector:@selector(throwAsyncFlutterErrorWithCompletion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoEnum:completion:)", + @"@selector(throwAsyncFlutterErrorWithCompletion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - FLTAnEnumBox *boxedFLTAnEnum = GetNullableObjectAtIndex(args, 0); - FLTAnEnum arg_anEnum = boxedFLTAnEnum.value; - [api callFlutterEchoEnum:arg_anEnum - completion:^(FLTAnEnumBox *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api throwAsyncFlutterErrorWithCompletion:^(id _Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } + /// Returns the passed object, to test async serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoAnotherEnum", - messageChannelSuffix] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncAllTypes", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoAnotherEnum:completion:)], + NSCAssert([api respondsToSelector:@selector(echoAsyncAllTypes:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoAnotherEnum:completion:)", + @"@selector(echoAsyncAllTypes:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - FLTAnotherEnumBox *boxedFLTAnotherEnum = GetNullableObjectAtIndex(args, 0); - FLTAnotherEnum arg_anotherEnum = boxedFLTAnotherEnum.value; - [api callFlutterEchoAnotherEnum:arg_anotherEnum - completion:^(FLTAnotherEnumBox *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + FLTAllTypes *arg_everything = GetNullableObjectAtIndex(args, 0); + [api echoAsyncAllTypes:arg_everything + completion:^(FLTAllTypes *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } + /// Returns the passed object, to test serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoNullableBool", - messageChannelSuffix] + initWithName:[NSString stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncNullableAllNullableTypes", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableBool:completion:)], + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableAllNullableTypes:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoNullableBool:completion:)", + @"@selector(echoAsyncNullableAllNullableTypes:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSNumber *arg_aBool = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoNullableBool:arg_aBool - completion:^(NSNumber *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + FLTAllNullableTypes *arg_everything = GetNullableObjectAtIndex(args, 0); + [api echoAsyncNullableAllNullableTypes:arg_everything + completion:^(FLTAllNullableTypes *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } + /// Returns the passed object, to test serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoNullableInt", + @"HostIntegrationCoreApi." + @"echoAsyncNullableAllNullableTypesWithoutRecursion", messageChannelSuffix] binaryMessenger:binaryMessenger codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableInt:completion:)], + NSCAssert([api respondsToSelector:@selector + (echoAsyncNullableAllNullableTypesWithoutRecursion:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoNullableInt:completion:)", + @"@selector(echoAsyncNullableAllNullableTypesWithoutRecursion:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSNumber *arg_anInt = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoNullableInt:arg_anInt - completion:^(NSNumber *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + FLTAllNullableTypesWithoutRecursion *arg_everything = GetNullableObjectAtIndex(args, 0); + [api echoAsyncNullableAllNullableTypesWithoutRecursion:arg_everything + completion:^(FLTAllNullableTypesWithoutRecursion + *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } + /// Returns passed in int asynchronously. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoNullableDouble", - messageChannelSuffix] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncNullableInt", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableDouble:completion:)], + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableInt:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoNullableDouble:completion:)", + @"@selector(echoAsyncNullableInt:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSNumber *arg_aDouble = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoNullableDouble:arg_aDouble - completion:^(NSNumber *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + NSNumber *arg_anInt = GetNullableObjectAtIndex(args, 0); + [api echoAsyncNullableInt:arg_anInt + completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } + /// Returns passed in double asynchronously. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoNullableString", - messageChannelSuffix] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncNullableDouble", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableString:completion:)], + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableDouble:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoNullableString:completion:)", + @"@selector(echoAsyncNullableDouble:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSString *arg_aString = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoNullableString:arg_aString - completion:^(NSString *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + NSNumber *arg_aDouble = GetNullableObjectAtIndex(args, 0); + [api echoAsyncNullableDouble:arg_aDouble + completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } + /// Returns the passed in boolean asynchronously. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoNullableUint8List", - messageChannelSuffix] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncNullableBool", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableUint8List:completion:)], + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableBool:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoNullableUint8List:completion:)", + @"@selector(echoAsyncNullableBool:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - FlutterStandardTypedData *arg_list = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoNullableUint8List:arg_list - completion:^(FlutterStandardTypedData *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + NSNumber *arg_aBool = GetNullableObjectAtIndex(args, 0); + [api echoAsyncNullableBool:arg_aBool + completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } + /// Returns the passed string asynchronously. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoNullableList", + @"HostIntegrationCoreApi.echoAsyncNullableString", messageChannelSuffix] binaryMessenger:binaryMessenger codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableList:completion:)], + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableString:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoNullableList:completion:)", + @"@selector(echoAsyncNullableString:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSArray *arg_list = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoNullableList:arg_list - completion:^(NSArray *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + NSString *arg_aString = GetNullableObjectAtIndex(args, 0); + [api echoAsyncNullableString:arg_aString + completion:^(NSString *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } + /// Returns the passed in Uint8List asynchronously. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoNullableMap", + @"HostIntegrationCoreApi.echoAsyncNullableUint8List", messageChannelSuffix] binaryMessenger:binaryMessenger codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableMap:completion:)], + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableUint8List:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoNullableMap:completion:)", + @"@selector(echoAsyncNullableUint8List:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSDictionary *arg_aMap = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoNullableMap:arg_aMap - completion:^(NSDictionary *_Nullable output, + FlutterStandardTypedData *arg_aUint8List = GetNullableObjectAtIndex(args, 0); + [api echoAsyncNullableUint8List:arg_aUint8List + completion:^(FlutterStandardTypedData *_Nullable output, FlutterError *_Nullable error) { callback(wrapResult(output, error)); }]; @@ -2842,196 +3012,2287 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM [channel setMessageHandler:nil]; } } + /// Returns the passed in generic Object asynchronously. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoNullableEnum", + @"HostIntegrationCoreApi.echoAsyncNullableObject", messageChannelSuffix] binaryMessenger:binaryMessenger codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableEnum:completion:)], + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableObject:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoNullableEnum:completion:)", + @"@selector(echoAsyncNullableObject:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - FLTAnEnumBox *arg_anEnum = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoNullableEnum:arg_anEnum - completion:^(FLTAnEnumBox *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + id arg_anObject = GetNullableObjectAtIndex(args, 0); + [api echoAsyncNullableObject:arg_anObject + completion:^(id _Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } + /// Returns the passed list, to test asynchronous serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoAnotherNullableEnum", - messageChannelSuffix] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncNullableList", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoAnotherNullableEnum:completion:)], + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableList:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoAnotherNullableEnum:completion:)", + @"@selector(echoAsyncNullableList:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - FLTAnotherEnumBox *arg_anotherEnum = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoAnotherNullableEnum:arg_anotherEnum - completion:^(FLTAnotherEnumBox *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + NSArray *arg_list = GetNullableObjectAtIndex(args, 0); + [api echoAsyncNullableList:arg_list + completion:^(NSArray *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } + /// Returns the passed list, to test asynchronous serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterSmallApiEchoString", - messageChannelSuffix] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncNullableEnumList", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterSmallApiEchoString:completion:)], + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableEnumList:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterSmallApiEchoString:completion:)", + @"@selector(echoAsyncNullableEnumList:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSString *arg_aString = GetNullableObjectAtIndex(args, 0); - [api callFlutterSmallApiEchoString:arg_aString - completion:^(NSString *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + NSArray *arg_enumList = GetNullableObjectAtIndex(args, 0); + [api echoAsyncNullableEnumList:arg_enumList + completion:^(NSArray *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } -} -@interface FLTFlutterIntegrationCoreApi () -@property(nonatomic, strong) NSObject *binaryMessenger; -@property(nonatomic, strong) NSString *messageChannelSuffix; -@end - -@implementation FLTFlutterIntegrationCoreApi - -- (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger { - return [self initWithBinaryMessenger:binaryMessenger messageChannelSuffix:@""]; -} -- (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger - messageChannelSuffix:(nullable NSString *)messageChannelSuffix { - self = [self init]; - if (self) { - _binaryMessenger = binaryMessenger; - _messageChannelSuffix = [messageChannelSuffix length] == 0 - ? @"" - : [NSString stringWithFormat:@".%@", messageChannelSuffix]; + /// Returns the passed list, to test asynchronous serialization and deserialization. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncNullableClassList", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableClassList:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncNullableClassList:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSArray *arg_classList = GetNullableObjectAtIndex(args, 0); + [api echoAsyncNullableClassList:arg_classList + completion:^(NSArray *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } } - return self; -} -- (void)noopWithCompletion:(void (^)(FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noop", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:nil - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; -} -- (void)throwErrorWithCompletion:(void (^)(id _Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwError", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:nil - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - id output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)throwErrorFromVoidWithCompletion:(void (^)(FlutterError *_Nullable))completion { - NSString *channelName = - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"FlutterIntegrationCoreApi.throwErrorFromVoid", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:nil + /// Returns the passed map, to test asynchronous serialization and deserialization. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncNullableMap", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableMap:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncNullableMap:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSDictionary *arg_map = GetNullableObjectAtIndex(args, 0); + [api echoAsyncNullableMap:arg_map + completion:^(NSDictionary *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + /// Returns the passed map, to test asynchronous serialization and deserialization. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncNullableStringMap", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableStringMap:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncNullableStringMap:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSDictionary *arg_stringMap = GetNullableObjectAtIndex(args, 0); + [api echoAsyncNullableStringMap:arg_stringMap + completion:^(NSDictionary *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + /// Returns the passed map, to test asynchronous serialization and deserialization. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncNullableIntMap", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableIntMap:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncNullableIntMap:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSDictionary *arg_intMap = GetNullableObjectAtIndex(args, 0); + [api echoAsyncNullableIntMap:arg_intMap + completion:^(NSDictionary *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + /// Returns the passed map, to test asynchronous serialization and deserialization. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncNullableEnumMap", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableEnumMap:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncNullableEnumMap:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSDictionary *arg_enumMap = + GetNullableObjectAtIndex(args, 0); + [api echoAsyncNullableEnumMap:arg_enumMap + completion:^( + NSDictionary *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + /// Returns the passed map, to test asynchronous serialization and deserialization. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncNullableClassMap", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableClassMap:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncNullableClassMap:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSDictionary *arg_classMap = + GetNullableObjectAtIndex(args, 0); + [api echoAsyncNullableClassMap:arg_classMap + completion:^( + NSDictionary *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + /// Returns the passed enum, to test asynchronous serialization and deserialization. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncNullableEnum", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableEnum:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncNullableEnum:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + FLTAnEnumBox *arg_anEnum = GetNullableObjectAtIndex(args, 0); + [api + echoAsyncNullableEnum:arg_anEnum + completion:^(FLTAnEnumBox *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + /// Returns the passed enum, to test asynchronous serialization and deserialization. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAnotherAsyncNullableEnum", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(echoAnotherAsyncNullableEnum:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAnotherAsyncNullableEnum:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + FLTAnotherEnumBox *arg_anotherEnum = GetNullableObjectAtIndex(args, 0); + [api echoAnotherAsyncNullableEnum:arg_anotherEnum + completion:^(FLTAnotherEnumBox *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterNoop", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterNoopWithCompletion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterNoopWithCompletion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + [api callFlutterNoopWithCompletion:^(FlutterError *_Nullable error) { + callback(wrapResult(nil, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterThrowError", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterThrowErrorWithCompletion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterThrowErrorWithCompletion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + [api callFlutterThrowErrorWithCompletion:^(id _Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName: + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterThrowErrorFromVoid", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterThrowErrorFromVoidWithCompletion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterThrowErrorFromVoidWithCompletion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + [api callFlutterThrowErrorFromVoidWithCompletion:^(FlutterError *_Nullable error) { + callback(wrapResult(nil, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoAllTypes", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoAllTypes:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoAllTypes:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + FLTAllTypes *arg_everything = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoAllTypes:arg_everything + completion:^(FLTAllTypes *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName: + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoAllNullableTypes", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoAllNullableTypes:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoAllNullableTypes:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + FLTAllNullableTypes *arg_everything = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoAllNullableTypes:arg_everything + completion:^(FLTAllNullableTypes *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName: + [NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterSendMultipleNullableTypes", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector + (callFlutterSendMultipleNullableTypesABool:anInt:aString:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterSendMultipleNullableTypesABool:anInt:aString:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSNumber *arg_aNullableBool = GetNullableObjectAtIndex(args, 0); + NSNumber *arg_aNullableInt = GetNullableObjectAtIndex(args, 1); + NSString *arg_aNullableString = GetNullableObjectAtIndex(args, 2); + [api callFlutterSendMultipleNullableTypesABool:arg_aNullableBool + anInt:arg_aNullableInt + aString:arg_aNullableString + completion:^(FLTAllNullableTypes *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi." + @"callFlutterEchoAllNullableTypesWithoutRecursion", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector + (callFlutterEchoAllNullableTypesWithoutRecursion:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoAllNullableTypesWithoutRecursion:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + FLTAllNullableTypesWithoutRecursion *arg_everything = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoAllNullableTypesWithoutRecursion:arg_everything + completion:^(FLTAllNullableTypesWithoutRecursion + *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName: + [NSString stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + @"callFlutterSendMultipleNullableTypesWithoutRecursion", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert( + [api respondsToSelector:@selector + (callFlutterSendMultipleNullableTypesWithoutRecursionABool: + anInt:aString:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterSendMultipleNullableTypesWithoutRecursionABool:anInt:aString:" + @"completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSNumber *arg_aNullableBool = GetNullableObjectAtIndex(args, 0); + NSNumber *arg_aNullableInt = GetNullableObjectAtIndex(args, 1); + NSString *arg_aNullableString = GetNullableObjectAtIndex(args, 2); + [api callFlutterSendMultipleNullableTypesWithoutRecursionABool:arg_aNullableBool + anInt:arg_aNullableInt + aString:arg_aNullableString + completion:^( + FLTAllNullableTypesWithoutRecursion + *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoBool", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoBool:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoBool:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + BOOL arg_aBool = [GetNullableObjectAtIndex(args, 0) boolValue]; + [api callFlutterEchoBool:arg_aBool + completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoInt", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoInt:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoInt:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSInteger arg_anInt = [GetNullableObjectAtIndex(args, 0) integerValue]; + [api callFlutterEchoInt:arg_anInt + completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoDouble", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoDouble:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoDouble:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + double arg_aDouble = [GetNullableObjectAtIndex(args, 0) doubleValue]; + [api callFlutterEchoDouble:arg_aDouble + completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoString", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoString:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoString:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSString *arg_aString = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoString:arg_aString + completion:^(NSString *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoUint8List", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoUint8List:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoUint8List:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + FlutterStandardTypedData *arg_list = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoUint8List:arg_list + completion:^(FlutterStandardTypedData *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoList", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoList:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoList:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSArray *arg_list = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoList:arg_list + completion:^(NSArray *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoEnumList", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoEnumList:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoEnumList:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSArray *arg_enumList = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoEnumList:arg_enumList + completion:^(NSArray *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoClassList", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoClassList:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoClassList:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSArray *arg_classList = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoClassList:arg_classList + completion:^(NSArray *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName: + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoNonNullEnumList", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNonNullEnumList:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoNonNullEnumList:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSArray *arg_enumList = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoNonNullEnumList:arg_enumList + completion:^(NSArray *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName: + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoNonNullClassList", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNonNullClassList:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoNonNullClassList:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSArray *arg_classList = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoNonNullClassList:arg_classList + completion:^(NSArray *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoMap", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoMap:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoMap:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSDictionary *arg_map = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoMap:arg_map + completion:^(NSDictionary *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoStringMap", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoStringMap:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoStringMap:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSDictionary *arg_stringMap = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoStringMap:arg_stringMap + completion:^(NSDictionary *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoIntMap", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoIntMap:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoIntMap:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSDictionary *arg_intMap = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoIntMap:arg_intMap + completion:^(NSDictionary *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoEnumMap", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoEnumMap:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoEnumMap:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSDictionary *arg_enumMap = + GetNullableObjectAtIndex(args, 0); + [api + callFlutterEchoEnumMap:arg_enumMap + completion:^(NSDictionary *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoClassMap", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoClassMap:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoClassMap:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSDictionary *arg_classMap = + GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoClassMap:arg_classMap + completion:^( + NSDictionary *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName: + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoNonNullStringMap", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNonNullStringMap:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoNonNullStringMap:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSDictionary *arg_stringMap = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoNonNullStringMap:arg_stringMap + completion:^( + NSDictionary *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoNonNullIntMap", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNonNullIntMap:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoNonNullIntMap:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSDictionary *arg_intMap = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoNonNullIntMap:arg_intMap + completion:^(NSDictionary *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName: + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoNonNullEnumMap", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNonNullEnumMap:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoNonNullEnumMap:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSDictionary *arg_enumMap = + GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoNonNullEnumMap:arg_enumMap + completion:^( + NSDictionary *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName: + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoNonNullClassMap", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNonNullClassMap:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoNonNullClassMap:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSDictionary *arg_classMap = + GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoNonNullClassMap:arg_classMap + completion:^(NSDictionary + *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoEnum", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoEnum:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoEnum:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + FLTAnEnumBox *boxedFLTAnEnum = GetNullableObjectAtIndex(args, 0); + FLTAnEnum arg_anEnum = boxedFLTAnEnum.value; + [api callFlutterEchoEnum:arg_anEnum + completion:^(FLTAnEnumBox *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoAnotherEnum", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoAnotherEnum:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoAnotherEnum:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + FLTAnotherEnumBox *boxedFLTAnotherEnum = GetNullableObjectAtIndex(args, 0); + FLTAnotherEnum arg_anotherEnum = boxedFLTAnotherEnum.value; + [api callFlutterEchoAnotherEnum:arg_anotherEnum + completion:^(FLTAnotherEnumBox *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoNullableBool", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableBool:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoNullableBool:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSNumber *arg_aBool = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoNullableBool:arg_aBool + completion:^(NSNumber *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoNullableInt", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableInt:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoNullableInt:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSNumber *arg_anInt = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoNullableInt:arg_anInt + completion:^(NSNumber *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName: + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoNullableDouble", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableDouble:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoNullableDouble:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSNumber *arg_aDouble = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoNullableDouble:arg_aDouble + completion:^(NSNumber *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName: + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoNullableString", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableString:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoNullableString:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSString *arg_aString = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoNullableString:arg_aString + completion:^(NSString *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoNullableUint8List", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableUint8List:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoNullableUint8List:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + FlutterStandardTypedData *arg_list = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoNullableUint8List:arg_list + completion:^(FlutterStandardTypedData *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoNullableList", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableList:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoNullableList:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSArray *arg_list = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoNullableList:arg_list + completion:^(NSArray *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName: + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoNullableEnumList", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableEnumList:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoNullableEnumList:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSArray *arg_enumList = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoNullableEnumList:arg_enumList + completion:^(NSArray *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoNullableClassList", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableClassList:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoNullableClassList:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSArray *arg_classList = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoNullableClassList:arg_classList + completion:^(NSArray *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoNullableNonNullEnumList", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableNonNullEnumList: + completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoNullableNonNullEnumList:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSArray *arg_enumList = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoNullableNonNullEnumList:arg_enumList + completion:^(NSArray *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoNullableNonNullClassList", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableNonNullClassList: + completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoNullableNonNullClassList:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSArray *arg_classList = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoNullableNonNullClassList:arg_classList + completion:^( + NSArray *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoNullableMap", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableMap:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoNullableMap:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSDictionary *arg_map = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoNullableMap:arg_map + completion:^(NSDictionary *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoNullableStringMap", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableStringMap:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoNullableStringMap:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSDictionary *arg_stringMap = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoNullableStringMap:arg_stringMap + completion:^( + NSDictionary *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName: + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoNullableIntMap", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableIntMap:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoNullableIntMap:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSDictionary *arg_intMap = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoNullableIntMap:arg_intMap + completion:^(NSDictionary *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName: + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoNullableEnumMap", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableEnumMap:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoNullableEnumMap:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSDictionary *arg_enumMap = + GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoNullableEnumMap:arg_enumMap + completion:^( + NSDictionary *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName: + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoNullableClassMap", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableClassMap:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoNullableClassMap:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSDictionary *arg_classMap = + GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoNullableClassMap:arg_classMap + completion:^(NSDictionary + *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoNullableNonNullStringMap", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableNonNullStringMap: + completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoNullableNonNullStringMap:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSDictionary *arg_stringMap = GetNullableObjectAtIndex(args, 0); + [api + callFlutterEchoNullableNonNullStringMap:arg_stringMap + completion:^( + NSDictionary *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName: + [NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoNullableNonNullIntMap", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableNonNullIntMap: + completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoNullableNonNullIntMap:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSDictionary *arg_intMap = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoNullableNonNullIntMap:arg_intMap + completion:^( + NSDictionary *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName: + [NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoNullableNonNullEnumMap", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableNonNullEnumMap: + completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoNullableNonNullEnumMap:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSDictionary *arg_enumMap = + GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoNullableNonNullEnumMap:arg_enumMap + completion:^(NSDictionary + *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoNullableNonNullClassMap", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableNonNullClassMap: + completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoNullableNonNullClassMap:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSDictionary *arg_classMap = + GetNullableObjectAtIndex(args, 0); + [api + callFlutterEchoNullableNonNullClassMap:arg_classMap + completion:^(NSDictionary + *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoNullableEnum", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableEnum:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoNullableEnum:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + FLTAnEnumBox *arg_anEnum = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoNullableEnum:arg_anEnum + completion:^(FLTAnEnumBox *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoAnotherNullableEnum", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoAnotherNullableEnum:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoAnotherNullableEnum:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + FLTAnotherEnumBox *arg_anotherEnum = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoAnotherNullableEnum:arg_anotherEnum + completion:^(FLTAnotherEnumBox *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName: + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterSmallApiEchoString", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterSmallApiEchoString:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterSmallApiEchoString:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSString *arg_aString = GetNullableObjectAtIndex(args, 0); + [api callFlutterSmallApiEchoString:arg_aString + completion:^(NSString *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } +} +@interface FLTFlutterIntegrationCoreApi () +@property(nonatomic, strong) NSObject *binaryMessenger; +@property(nonatomic, strong) NSString *messageChannelSuffix; +@end + +@implementation FLTFlutterIntegrationCoreApi + +- (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger { + return [self initWithBinaryMessenger:binaryMessenger messageChannelSuffix:@""]; +} +- (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger + messageChannelSuffix:(nullable NSString *)messageChannelSuffix { + self = [self init]; + if (self) { + _binaryMessenger = binaryMessenger; + _messageChannelSuffix = [messageChannelSuffix length] == 0 + ? @"" + : [NSString stringWithFormat:@".%@", messageChannelSuffix]; + } + return self; +} +- (void)noopWithCompletion:(void (^)(FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noop", + _messageChannelSuffix]; + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:nil + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion([FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + completion(nil); + } + } else { + completion(createConnectionError(channelName)); + } + }]; +} +- (void)throwErrorWithCompletion:(void (^)(id _Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwError", + _messageChannelSuffix]; + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:nil + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + id output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)throwErrorFromVoidWithCompletion:(void (^)(FlutterError *_Nullable))completion { + NSString *channelName = + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"FlutterIntegrationCoreApi.throwErrorFromVoid", + _messageChannelSuffix]; + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:nil + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion([FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + completion(nil); + } + } else { + completion(createConnectionError(channelName)); + } + }]; +} +- (void)echoAllTypes:(FLTAllTypes *)arg_everything + completion:(void (^)(FLTAllTypes *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllTypes", + _messageChannelSuffix]; + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ arg_everything ?: [NSNull null] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + FLTAllTypes *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoAllNullableTypes:(nullable FLTAllNullableTypes *)arg_everything + completion:(void (^)(FLTAllNullableTypes *_Nullable, + FlutterError *_Nullable))completion { + NSString *channelName = + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"FlutterIntegrationCoreApi.echoAllNullableTypes", + _messageChannelSuffix]; + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ arg_everything ?: [NSNull null] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + FLTAllNullableTypes *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)sendMultipleNullableTypesABool:(nullable NSNumber *)arg_aNullableBool + anInt:(nullable NSNumber *)arg_aNullableInt + aString:(nullable NSString *)arg_aNullableString + completion:(void (^)(FLTAllNullableTypes *_Nullable, + FlutterError *_Nullable))completion { + NSString *channelName = + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"FlutterIntegrationCoreApi.sendMultipleNullableTypes", + _messageChannelSuffix]; + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ + arg_aNullableBool ?: [NSNull null], arg_aNullableInt ?: [NSNull null], + arg_aNullableString ?: [NSNull null] + ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + FLTAllNullableTypes *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoAllNullableTypesWithoutRecursion: + (nullable FLTAllNullableTypesWithoutRecursion *)arg_everything + completion: + (void (^)(FLTAllNullableTypesWithoutRecursion *_Nullable, + FlutterError *_Nullable))completion { + NSString *channelName = + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"FlutterIntegrationCoreApi.echoAllNullableTypesWithoutRecursion", + _messageChannelSuffix]; + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ arg_everything ?: [NSNull null] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + FLTAllNullableTypesWithoutRecursion *output = + reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)sendMultipleNullableTypesWithoutRecursionABool:(nullable NSNumber *)arg_aNullableBool + anInt:(nullable NSNumber *)arg_aNullableInt + aString:(nullable NSString *)arg_aNullableString + completion: + (void (^)( + FLTAllNullableTypesWithoutRecursion *_Nullable, + FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + @"sendMultipleNullableTypesWithoutRecursion", + _messageChannelSuffix]; + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ + arg_aNullableBool ?: [NSNull null], arg_aNullableInt ?: [NSNull null], + arg_aNullableString ?: [NSNull null] + ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + FLTAllNullableTypesWithoutRecursion *output = + reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoBool:(BOOL)arg_aBool + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoBool", + _messageChannelSuffix]; + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ @(arg_aBool) ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoInt:(NSInteger)arg_anInt + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoInt", + _messageChannelSuffix]; + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ @(arg_anInt) ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoDouble:(double)arg_aDouble + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoDouble", + _messageChannelSuffix]; + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ @(arg_aDouble) ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoString:(NSString *)arg_aString + completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoString", + _messageChannelSuffix]; + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ arg_aString ?: [NSNull null] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + NSString *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoUint8List:(FlutterStandardTypedData *)arg_list + completion: + (void (^)(FlutterStandardTypedData *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoUint8List", + _messageChannelSuffix]; + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ arg_list ?: [NSNull null] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + FlutterStandardTypedData *output = + reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoList:(NSArray *)arg_list + completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoList", + _messageChannelSuffix]; + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ arg_list ?: [NSNull null] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + NSArray *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoEnumList:(NSArray *)arg_enumList + completion: + (void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnumList", + _messageChannelSuffix]; + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ arg_enumList ?: [NSNull null] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + NSArray *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoClassList:(NSArray *)arg_classList + completion:(void (^)(NSArray *_Nullable, + FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoClassList", + _messageChannelSuffix]; + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ arg_classList ?: [NSNull null] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + NSArray *output = + reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoNonNullEnumList:(NSArray *)arg_enumList + completion:(void (^)(NSArray *_Nullable, + FlutterError *_Nullable))completion { + NSString *channelName = + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"FlutterIntegrationCoreApi.echoNonNullEnumList", + _messageChannelSuffix]; + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ arg_enumList ?: [NSNull null] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + NSArray *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoNonNullClassList:(NSArray *)arg_classList + completion:(void (^)(NSArray *_Nullable, + FlutterError *_Nullable))completion { + NSString *channelName = + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"FlutterIntegrationCoreApi.echoNonNullClassList", + _messageChannelSuffix]; + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ arg_classList ?: [NSNull null] ] reply:^(NSArray *reply) { if (reply != nil) { if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); } else { - completion(nil); + NSArray *output = + reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); } } else { - completion(createConnectionError(channelName)); + completion(nil, createConnectionError(channelName)); } }]; } -- (void)echoAllTypes:(FLTAllTypes *)arg_everything - completion:(void (^)(FLTAllTypes *_Nullable, FlutterError *_Nullable))completion { +- (void)echoMap:(NSDictionary *)arg_map + completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoMap", + _messageChannelSuffix]; + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ arg_map ?: [NSNull null] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + NSDictionary *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoStringMap:(NSDictionary *)arg_stringMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { NSString *channelName = [NSString stringWithFormat: @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllTypes", + @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoStringMap", _messageChannelSuffix]; FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel messageChannelWithName:channelName binaryMessenger:self.binaryMessenger codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ arg_everything ?: [NSNull null] ] + [channel sendMessage:@[ arg_stringMap ?: [NSNull null] ] reply:^(NSArray *reply) { if (reply != nil) { if (reply.count > 1) { @@ -3039,7 +5300,8 @@ - (void)echoAllTypes:(FLTAllTypes *)arg_everything message:reply[1] details:reply[2]]); } else { - FLTAllTypes *output = reply[0] == [NSNull null] ? nil : reply[0]; + NSDictionary *output = + reply[0] == [NSNull null] ? nil : reply[0]; completion(output, nil); } } else { @@ -3047,19 +5309,106 @@ - (void)echoAllTypes:(FLTAllTypes *)arg_everything } }]; } -- (void)echoAllNullableTypes:(nullable FLTAllNullableTypes *)arg_everything - completion:(void (^)(FLTAllNullableTypes *_Nullable, +- (void)echoIntMap:(NSDictionary *)arg_intMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoIntMap", + _messageChannelSuffix]; + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ arg_intMap ?: [NSNull null] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + NSDictionary *output = + reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoEnumMap:(NSDictionary *)arg_enumMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnumMap", + _messageChannelSuffix]; + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ arg_enumMap ?: [NSNull null] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + NSDictionary *output = + reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoClassMap:(NSDictionary *)arg_classMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoClassMap", + _messageChannelSuffix]; + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ arg_classMap ?: [NSNull null] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + NSDictionary *output = + reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoNonNullStringMap:(NSDictionary *)arg_stringMap + completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion { NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"FlutterIntegrationCoreApi.echoAllNullableTypes", + @"FlutterIntegrationCoreApi.echoNonNullStringMap", _messageChannelSuffix]; FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel messageChannelWithName:channelName binaryMessenger:self.binaryMessenger codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ arg_everything ?: [NSNull null] ] + [channel sendMessage:@[ arg_stringMap ?: [NSNull null] ] reply:^(NSArray *reply) { if (reply != nil) { if (reply.count > 1) { @@ -3067,7 +5416,8 @@ - (void)echoAllNullableTypes:(nullable FLTAllNullableTypes *)arg_everything message:reply[1] details:reply[2]]); } else { - FLTAllNullableTypes *output = reply[0] == [NSNull null] ? nil : reply[0]; + NSDictionary *output = + reply[0] == [NSNull null] ? nil : reply[0]; completion(output, nil); } } else { @@ -3075,24 +5425,159 @@ - (void)echoAllNullableTypes:(nullable FLTAllNullableTypes *)arg_everything } }]; } -- (void)sendMultipleNullableTypesABool:(nullable NSNumber *)arg_aNullableBool - anInt:(nullable NSNumber *)arg_aNullableInt - aString:(nullable NSString *)arg_aNullableString - completion:(void (^)(FLTAllNullableTypes *_Nullable, - FlutterError *_Nullable))completion { +- (void)echoNonNullIntMap:(NSDictionary *)arg_intMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + NSString *channelName = [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"FlutterIntegrationCoreApi.echoNonNullIntMap", + _messageChannelSuffix]; + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ arg_intMap ?: [NSNull null] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + NSDictionary *output = + reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoNonNullEnumMap:(NSDictionary *)arg_enumMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"FlutterIntegrationCoreApi.sendMultipleNullableTypes", + @"FlutterIntegrationCoreApi.echoNonNullEnumMap", + _messageChannelSuffix]; + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ arg_enumMap ?: [NSNull null] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + NSDictionary *output = + reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoNonNullClassMap:(NSDictionary *)arg_classMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + NSString *channelName = + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"FlutterIntegrationCoreApi.echoNonNullClassMap", _messageChannelSuffix]; FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel messageChannelWithName:channelName binaryMessenger:self.binaryMessenger codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ - arg_aNullableBool ?: [NSNull null], arg_aNullableInt ?: [NSNull null], - arg_aNullableString ?: [NSNull null] - ] + [channel sendMessage:@[ arg_classMap ?: [NSNull null] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + NSDictionary *output = + reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoEnum:(FLTAnEnum)arg_anEnum + completion:(void (^)(FLTAnEnumBox *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnum", + _messageChannelSuffix]; + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ [[FLTAnEnumBox alloc] initWithValue:arg_anEnum] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + FLTAnEnumBox *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoAnotherEnum:(FLTAnotherEnum)arg_anotherEnum + completion: + (void (^)(FLTAnotherEnumBox *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAnotherEnum", + _messageChannelSuffix]; + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ [[FLTAnotherEnumBox alloc] initWithValue:arg_anotherEnum] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + FLTAnotherEnumBox *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoNullableBool:(nullable NSNumber *)arg_aBool + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableBool", + _messageChannelSuffix]; + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ arg_aBool ?: [NSNull null] ] reply:^(NSArray *reply) { if (reply != nil) { if (reply.count > 1) { @@ -3100,7 +5585,7 @@ - (void)sendMultipleNullableTypesABool:(nullable NSNumber *)arg_aNullableBool message:reply[1] details:reply[2]]); } else { - FLTAllNullableTypes *output = reply[0] == [NSNull null] ? nil : reply[0]; + NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; completion(output, nil); } } else { @@ -3108,21 +5593,18 @@ - (void)sendMultipleNullableTypesABool:(nullable NSNumber *)arg_aNullableBool } }]; } -- (void)echoAllNullableTypesWithoutRecursion: - (nullable FLTAllNullableTypesWithoutRecursion *)arg_everything - completion: - (void (^)(FLTAllNullableTypesWithoutRecursion *_Nullable, - FlutterError *_Nullable))completion { - NSString *channelName = - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"FlutterIntegrationCoreApi.echoAllNullableTypesWithoutRecursion", - _messageChannelSuffix]; +- (void)echoNullableInt:(nullable NSNumber *)arg_anInt + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableInt", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel messageChannelWithName:channelName binaryMessenger:self.binaryMessenger codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ arg_everything ?: [NSNull null] ] + [channel sendMessage:@[ arg_anInt ?: [NSNull null] ] reply:^(NSArray *reply) { if (reply != nil) { if (reply.count > 1) { @@ -3130,8 +5612,7 @@ - (void)echoAllNullableTypesWithoutRecursion: message:reply[1] details:reply[2]]); } else { - FLTAllNullableTypesWithoutRecursion *output = - reply[0] == [NSNull null] ? nil : reply[0]; + NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; completion(output, nil); } } else { @@ -3139,26 +5620,18 @@ - (void)echoAllNullableTypesWithoutRecursion: } }]; } -- (void)sendMultipleNullableTypesWithoutRecursionABool:(nullable NSNumber *)arg_aNullableBool - anInt:(nullable NSNumber *)arg_aNullableInt - aString:(nullable NSString *)arg_aNullableString - completion: - (void (^)( - FLTAllNullableTypesWithoutRecursion *_Nullable, - FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - @"sendMultipleNullableTypesWithoutRecursion", - _messageChannelSuffix]; +- (void)echoNullableDouble:(nullable NSNumber *)arg_aDouble + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"FlutterIntegrationCoreApi.echoNullableDouble", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel messageChannelWithName:channelName binaryMessenger:self.binaryMessenger codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ - arg_aNullableBool ?: [NSNull null], arg_aNullableInt ?: [NSNull null], - arg_aNullableString ?: [NSNull null] - ] + [channel sendMessage:@[ arg_aDouble ?: [NSNull null] ] reply:^(NSArray *reply) { if (reply != nil) { if (reply.count > 1) { @@ -3166,8 +5639,7 @@ - (void)sendMultipleNullableTypesWithoutRecursionABool:(nullable NSNumber *)arg_ message:reply[1] details:reply[2]]); } else { - FLTAllNullableTypesWithoutRecursion *output = - reply[0] == [NSNull null] ? nil : reply[0]; + NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; completion(output, nil); } } else { @@ -3175,18 +5647,18 @@ - (void)sendMultipleNullableTypesWithoutRecursionABool:(nullable NSNumber *)arg_ } }]; } -- (void)echoBool:(BOOL)arg_aBool - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoBool", - _messageChannelSuffix]; +- (void)echoNullableString:(nullable NSString *)arg_aString + completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"FlutterIntegrationCoreApi.echoNullableString", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel messageChannelWithName:channelName binaryMessenger:self.binaryMessenger codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ @(arg_aBool) ] + [channel sendMessage:@[ arg_aString ?: [NSNull null] ] reply:^(NSArray *reply) { if (reply != nil) { if (reply.count > 1) { @@ -3194,7 +5666,7 @@ - (void)echoBool:(BOOL)arg_aBool message:reply[1] details:reply[2]]); } else { - NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; + NSString *output = reply[0] == [NSNull null] ? nil : reply[0]; completion(output, nil); } } else { @@ -3202,17 +5674,19 @@ - (void)echoBool:(BOOL)arg_aBool } }]; } -- (void)echoInt:(NSInteger)arg_anInt - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoInt", - _messageChannelSuffix]; +- (void)echoNullableUint8List:(nullable FlutterStandardTypedData *)arg_list + completion:(void (^)(FlutterStandardTypedData *_Nullable, + FlutterError *_Nullable))completion { + NSString *channelName = + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"FlutterIntegrationCoreApi.echoNullableUint8List", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel messageChannelWithName:channelName binaryMessenger:self.binaryMessenger codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ @(arg_anInt) ] + [channel sendMessage:@[ arg_list ?: [NSNull null] ] reply:^(NSArray *reply) { if (reply != nil) { if (reply.count > 1) { @@ -3220,7 +5694,8 @@ - (void)echoInt:(NSInteger)arg_anInt message:reply[1] details:reply[2]]); } else { - NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; + FlutterStandardTypedData *output = + reply[0] == [NSNull null] ? nil : reply[0]; completion(output, nil); } } else { @@ -3228,18 +5703,18 @@ - (void)echoInt:(NSInteger)arg_anInt } }]; } -- (void)echoDouble:(double)arg_aDouble - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { +- (void)echoNullableList:(nullable NSArray *)arg_list + completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion { NSString *channelName = [NSString stringWithFormat: @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoDouble", + @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableList", _messageChannelSuffix]; FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel messageChannelWithName:channelName binaryMessenger:self.binaryMessenger codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ @(arg_aDouble) ] + [channel sendMessage:@[ arg_list ?: [NSNull null] ] reply:^(NSArray *reply) { if (reply != nil) { if (reply.count > 1) { @@ -3247,7 +5722,7 @@ - (void)echoDouble:(double)arg_aDouble message:reply[1] details:reply[2]]); } else { - NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; + NSArray *output = reply[0] == [NSNull null] ? nil : reply[0]; completion(output, nil); } } else { @@ -3255,18 +5730,19 @@ - (void)echoDouble:(double)arg_aDouble } }]; } -- (void)echoString:(NSString *)arg_aString - completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoString", - _messageChannelSuffix]; +- (void)echoNullableEnumList:(nullable NSArray *)arg_enumList + completion:(void (^)(NSArray *_Nullable, + FlutterError *_Nullable))completion { + NSString *channelName = + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"FlutterIntegrationCoreApi.echoNullableEnumList", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel messageChannelWithName:channelName binaryMessenger:self.binaryMessenger codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ arg_aString ?: [NSNull null] ] + [channel sendMessage:@[ arg_enumList ?: [NSNull null] ] reply:^(NSArray *reply) { if (reply != nil) { if (reply.count > 1) { @@ -3274,7 +5750,7 @@ - (void)echoString:(NSString *)arg_aString message:reply[1] details:reply[2]]); } else { - NSString *output = reply[0] == [NSNull null] ? nil : reply[0]; + NSArray *output = reply[0] == [NSNull null] ? nil : reply[0]; completion(output, nil); } } else { @@ -3282,19 +5758,19 @@ - (void)echoString:(NSString *)arg_aString } }]; } -- (void)echoUint8List:(FlutterStandardTypedData *)arg_list - completion: - (void (^)(FlutterStandardTypedData *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoUint8List", - _messageChannelSuffix]; +- (void)echoNullableClassList:(nullable NSArray *)arg_classList + completion:(void (^)(NSArray *_Nullable, + FlutterError *_Nullable))completion { + NSString *channelName = + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"FlutterIntegrationCoreApi.echoNullableClassList", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel messageChannelWithName:channelName binaryMessenger:self.binaryMessenger codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ arg_list ?: [NSNull null] ] + [channel sendMessage:@[ arg_classList ?: [NSNull null] ] reply:^(NSArray *reply) { if (reply != nil) { if (reply.count > 1) { @@ -3302,7 +5778,7 @@ - (void)echoUint8List:(FlutterStandardTypedData *)arg_list message:reply[1] details:reply[2]]); } else { - FlutterStandardTypedData *output = + NSArray *output = reply[0] == [NSNull null] ? nil : reply[0]; completion(output, nil); } @@ -3311,18 +5787,19 @@ - (void)echoUint8List:(FlutterStandardTypedData *)arg_list } }]; } -- (void)echoList:(NSArray *)arg_list - completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoList", - _messageChannelSuffix]; +- (void)echoNullableNonNullEnumList:(nullable NSArray *)arg_enumList + completion:(void (^)(NSArray *_Nullable, + FlutterError *_Nullable))completion { + NSString *channelName = + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"FlutterIntegrationCoreApi.echoNullableNonNullEnumList", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel messageChannelWithName:channelName binaryMessenger:self.binaryMessenger codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ arg_list ?: [NSNull null] ] + [channel sendMessage:@[ arg_enumList ?: [NSNull null] ] reply:^(NSArray *reply) { if (reply != nil) { if (reply.count > 1) { @@ -3330,7 +5807,7 @@ - (void)echoList:(NSArray *)arg_list message:reply[1] details:reply[2]]); } else { - NSArray *output = reply[0] == [NSNull null] ? nil : reply[0]; + NSArray *output = reply[0] == [NSNull null] ? nil : reply[0]; completion(output, nil); } } else { @@ -3338,18 +5815,19 @@ - (void)echoList:(NSArray *)arg_list } }]; } -- (void)echoMap:(NSDictionary *)arg_aMap - completion: - (void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoMap", - _messageChannelSuffix]; +- (void)echoNullableNonNullClassList:(nullable NSArray *)arg_classList + completion:(void (^)(NSArray *_Nullable, + FlutterError *_Nullable))completion { + NSString *channelName = + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"FlutterIntegrationCoreApi.echoNullableNonNullClassList", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel messageChannelWithName:channelName binaryMessenger:self.binaryMessenger codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ arg_aMap ?: [NSNull null] ] + [channel sendMessage:@[ arg_classList ?: [NSNull null] ] reply:^(NSArray *reply) { if (reply != nil) { if (reply.count > 1) { @@ -3357,7 +5835,7 @@ - (void)echoMap:(NSDictionary *)arg_aMap message:reply[1] details:reply[2]]); } else { - NSDictionary *output = + NSArray *output = reply[0] == [NSNull null] ? nil : reply[0]; completion(output, nil); } @@ -3366,18 +5844,19 @@ - (void)echoMap:(NSDictionary *)arg_aMap } }]; } -- (void)echoEnum:(FLTAnEnum)arg_anEnum - completion:(void (^)(FLTAnEnumBox *_Nullable, FlutterError *_Nullable))completion { +- (void)echoNullableMap:(nullable NSDictionary *)arg_map + completion: + (void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion { NSString *channelName = [NSString stringWithFormat: @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnum", + @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableMap", _messageChannelSuffix]; FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel messageChannelWithName:channelName binaryMessenger:self.binaryMessenger codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ [[FLTAnEnumBox alloc] initWithValue:arg_anEnum] ] + [channel sendMessage:@[ arg_map ?: [NSNull null] ] reply:^(NSArray *reply) { if (reply != nil) { if (reply.count > 1) { @@ -3385,7 +5864,7 @@ - (void)echoEnum:(FLTAnEnum)arg_anEnum message:reply[1] details:reply[2]]); } else { - FLTAnEnumBox *output = reply[0] == [NSNull null] ? nil : reply[0]; + NSDictionary *output = reply[0] == [NSNull null] ? nil : reply[0]; completion(output, nil); } } else { @@ -3393,19 +5872,19 @@ - (void)echoEnum:(FLTAnEnum)arg_anEnum } }]; } -- (void)echoAnotherEnum:(FLTAnotherEnum)arg_anotherEnum - completion: - (void (^)(FLTAnotherEnumBox *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAnotherEnum", - _messageChannelSuffix]; +- (void)echoNullableStringMap:(nullable NSDictionary *)arg_stringMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + NSString *channelName = + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"FlutterIntegrationCoreApi.echoNullableStringMap", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel messageChannelWithName:channelName binaryMessenger:self.binaryMessenger codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ [[FLTAnotherEnumBox alloc] initWithValue:arg_anotherEnum] ] + [channel sendMessage:@[ arg_stringMap ?: [NSNull null] ] reply:^(NSArray *reply) { if (reply != nil) { if (reply.count > 1) { @@ -3413,7 +5892,8 @@ - (void)echoAnotherEnum:(FLTAnotherEnum)arg_anotherEnum message:reply[1] details:reply[2]]); } else { - FLTAnotherEnumBox *output = reply[0] == [NSNull null] ? nil : reply[0]; + NSDictionary *output = + reply[0] == [NSNull null] ? nil : reply[0]; completion(output, nil); } } else { @@ -3421,18 +5901,19 @@ - (void)echoAnotherEnum:(FLTAnotherEnum)arg_anotherEnum } }]; } -- (void)echoNullableBool:(nullable NSNumber *)arg_aBool - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableBool", - _messageChannelSuffix]; +- (void)echoNullableIntMap:(nullable NSDictionary *)arg_intMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + NSString *channelName = + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"FlutterIntegrationCoreApi.echoNullableIntMap", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel messageChannelWithName:channelName binaryMessenger:self.binaryMessenger codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ arg_aBool ?: [NSNull null] ] + [channel sendMessage:@[ arg_intMap ?: [NSNull null] ] reply:^(NSArray *reply) { if (reply != nil) { if (reply.count > 1) { @@ -3440,7 +5921,8 @@ - (void)echoNullableBool:(nullable NSNumber *)arg_aBool message:reply[1] details:reply[2]]); } else { - NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; + NSDictionary *output = + reply[0] == [NSNull null] ? nil : reply[0]; completion(output, nil); } } else { @@ -3448,18 +5930,19 @@ - (void)echoNullableBool:(nullable NSNumber *)arg_aBool } }]; } -- (void)echoNullableInt:(nullable NSNumber *)arg_anInt - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableInt", - _messageChannelSuffix]; +- (void)echoNullableEnumMap:(nullable NSDictionary *)arg_enumMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + NSString *channelName = + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"FlutterIntegrationCoreApi.echoNullableEnumMap", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel messageChannelWithName:channelName binaryMessenger:self.binaryMessenger codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ arg_anInt ?: [NSNull null] ] + [channel sendMessage:@[ arg_enumMap ?: [NSNull null] ] reply:^(NSArray *reply) { if (reply != nil) { if (reply.count > 1) { @@ -3467,7 +5950,8 @@ - (void)echoNullableInt:(nullable NSNumber *)arg_anInt message:reply[1] details:reply[2]]); } else { - NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; + NSDictionary *output = + reply[0] == [NSNull null] ? nil : reply[0]; completion(output, nil); } } else { @@ -3475,18 +5959,20 @@ - (void)echoNullableInt:(nullable NSNumber *)arg_anInt } }]; } -- (void)echoNullableDouble:(nullable NSNumber *)arg_aDouble - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { +- (void)echoNullableClassMap: + (nullable NSDictionary *)arg_classMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"FlutterIntegrationCoreApi.echoNullableDouble", + @"FlutterIntegrationCoreApi.echoNullableClassMap", _messageChannelSuffix]; FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel messageChannelWithName:channelName binaryMessenger:self.binaryMessenger codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ arg_aDouble ?: [NSNull null] ] + [channel sendMessage:@[ arg_classMap ?: [NSNull null] ] reply:^(NSArray *reply) { if (reply != nil) { if (reply.count > 1) { @@ -3494,7 +5980,8 @@ - (void)echoNullableDouble:(nullable NSNumber *)arg_aDouble message:reply[1] details:reply[2]]); } else { - NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; + NSDictionary *output = + reply[0] == [NSNull null] ? nil : reply[0]; completion(output, nil); } } else { @@ -3502,18 +5989,19 @@ - (void)echoNullableDouble:(nullable NSNumber *)arg_aDouble } }]; } -- (void)echoNullableString:(nullable NSString *)arg_aString - completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { +- (void)echoNullableNonNullStringMap:(nullable NSDictionary *)arg_stringMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"FlutterIntegrationCoreApi.echoNullableString", + @"FlutterIntegrationCoreApi.echoNullableNonNullStringMap", _messageChannelSuffix]; FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel messageChannelWithName:channelName binaryMessenger:self.binaryMessenger codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ arg_aString ?: [NSNull null] ] + [channel sendMessage:@[ arg_stringMap ?: [NSNull null] ] reply:^(NSArray *reply) { if (reply != nil) { if (reply.count > 1) { @@ -3521,7 +6009,8 @@ - (void)echoNullableString:(nullable NSString *)arg_aString message:reply[1] details:reply[2]]); } else { - NSString *output = reply[0] == [NSNull null] ? nil : reply[0]; + NSDictionary *output = + reply[0] == [NSNull null] ? nil : reply[0]; completion(output, nil); } } else { @@ -3529,19 +6018,19 @@ - (void)echoNullableString:(nullable NSString *)arg_aString } }]; } -- (void)echoNullableUint8List:(nullable FlutterStandardTypedData *)arg_list - completion:(void (^)(FlutterStandardTypedData *_Nullable, - FlutterError *_Nullable))completion { +- (void)echoNullableNonNullIntMap:(nullable NSDictionary *)arg_intMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"FlutterIntegrationCoreApi.echoNullableUint8List", + @"FlutterIntegrationCoreApi.echoNullableNonNullIntMap", _messageChannelSuffix]; FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel messageChannelWithName:channelName binaryMessenger:self.binaryMessenger codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ arg_list ?: [NSNull null] ] + [channel sendMessage:@[ arg_intMap ?: [NSNull null] ] reply:^(NSArray *reply) { if (reply != nil) { if (reply.count > 1) { @@ -3549,7 +6038,7 @@ - (void)echoNullableUint8List:(nullable FlutterStandardTypedData *)arg_list message:reply[1] details:reply[2]]); } else { - FlutterStandardTypedData *output = + NSDictionary *output = reply[0] == [NSNull null] ? nil : reply[0]; completion(output, nil); } @@ -3558,18 +6047,20 @@ - (void)echoNullableUint8List:(nullable FlutterStandardTypedData *)arg_list } }]; } -- (void)echoNullableList:(nullable NSArray *)arg_list - completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableList", - _messageChannelSuffix]; +- (void) + echoNullableNonNullEnumMap:(nullable NSDictionary *)arg_enumMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + NSString *channelName = + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"FlutterIntegrationCoreApi.echoNullableNonNullEnumMap", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel messageChannelWithName:channelName binaryMessenger:self.binaryMessenger codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ arg_list ?: [NSNull null] ] + [channel sendMessage:@[ arg_enumMap ?: [NSNull null] ] reply:^(NSArray *reply) { if (reply != nil) { if (reply.count > 1) { @@ -3577,7 +6068,8 @@ - (void)echoNullableList:(nullable NSArray *)arg_list message:reply[1] details:reply[2]]); } else { - NSArray *output = reply[0] == [NSNull null] ? nil : reply[0]; + NSDictionary *output = + reply[0] == [NSNull null] ? nil : reply[0]; completion(output, nil); } } else { @@ -3585,19 +6077,21 @@ - (void)echoNullableList:(nullable NSArray *)arg_list } }]; } -- (void)echoNullableMap:(nullable NSDictionary *)arg_aMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableMap", - _messageChannelSuffix]; +- (void)echoNullableNonNullClassMap: + (nullable NSDictionary *)arg_classMap + completion: + (void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + NSString *channelName = + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"FlutterIntegrationCoreApi.echoNullableNonNullClassMap", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel messageChannelWithName:channelName binaryMessenger:self.binaryMessenger codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ arg_aMap ?: [NSNull null] ] + [channel sendMessage:@[ arg_classMap ?: [NSNull null] ] reply:^(NSArray *reply) { if (reply != nil) { if (reply.count > 1) { @@ -3605,7 +6099,7 @@ - (void)echoNullableMap:(nullable NSDictionary *)arg_aMap message:reply[1] details:reply[2]]); } else { - NSDictionary *output = + NSDictionary *output = reply[0] == [NSNull null] ? nil : reply[0]; completion(output, nil); } diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/Classes/AlternateLanguageTestPlugin.h b/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/Classes/AlternateLanguageTestPlugin.h index 6f0ca22d057c..104ee200c11f 100644 --- a/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/Classes/AlternateLanguageTestPlugin.h +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/Classes/AlternateLanguageTestPlugin.h @@ -6,10 +6,10 @@ #import "CoreTests.gen.h" -@interface AlternateLanguageTestPlugin : NSObject +@interface AlternateLanguageTestPlugin : NSObject @end -@interface AlternateLanguageTestAPIWithSuffix : NSObject +@interface AlternateLanguageTestAPIWithSuffix : NSObject + (void)registerWithRegistrar:(NSObject *)registrar suffix:(NSString *)suffix; @end diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/Classes/AlternateLanguageTestPlugin.m b/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/Classes/AlternateLanguageTestPlugin.m index 25324dab809a..d684acfd55e6 100644 --- a/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/Classes/AlternateLanguageTestPlugin.m +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/Classes/AlternateLanguageTestPlugin.m @@ -7,24 +7,26 @@ #import "CoreTests.gen.h" @interface AlternateLanguageTestPlugin () -@property(nonatomic) FlutterSmallApi *flutterSmallApiOne; -@property(nonatomic) FlutterSmallApi *flutterSmallApiTwo; -@property(nonatomic) FlutterIntegrationCoreApi *flutterAPI; +@property(nonatomic) FLTFlutterSmallApi *flutterSmallApiOne; +@property(nonatomic) FLTFlutterSmallApi *flutterSmallApiTwo; +@property(nonatomic) FLTFlutterIntegrationCoreApi *flutterAPI; @end /// This plugin handles the native side of the integration tests in example/integration_test/. @implementation AlternateLanguageTestPlugin + (void)registerWithRegistrar:(NSObject *)registrar { AlternateLanguageTestPlugin *plugin = [[AlternateLanguageTestPlugin alloc] init]; - SetUpHostIntegrationCoreApi(registrar.messenger, plugin); + SetUpFLTHostIntegrationCoreApi([registrar messenger], plugin); [AlternateLanguageTestAPIWithSuffix registerWithRegistrar:registrar suffix:@"suffixOne"]; [AlternateLanguageTestAPIWithSuffix registerWithRegistrar:registrar suffix:@"suffixTwo"]; plugin.flutterAPI = - [[FlutterIntegrationCoreApi alloc] initWithBinaryMessenger:registrar.messenger]; - plugin.flutterSmallApiOne = [[FlutterSmallApi alloc] initWithBinaryMessenger:registrar.messenger - messageChannelSuffix:@"suffixOne"]; - plugin.flutterSmallApiTwo = [[FlutterSmallApi alloc] initWithBinaryMessenger:registrar.messenger - messageChannelSuffix:@"suffixTwo"]; + [[FLTFlutterIntegrationCoreApi alloc] initWithBinaryMessenger:[registrar messenger]]; + plugin.flutterSmallApiOne = + [[FLTFlutterSmallApi alloc] initWithBinaryMessenger:[registrar messenger] + messageChannelSuffix:@"suffixOne"]; + plugin.flutterSmallApiTwo = + [[FLTFlutterSmallApi alloc] initWithBinaryMessenger:[registrar messenger] + messageChannelSuffix:@"suffixTwo"]; } #pragma mark HostIntegrationCoreApi implementation @@ -32,18 +34,18 @@ + (void)registerWithRegistrar:(NSObject *)registrar { - (void)noopWithError:(FlutterError *_Nullable *_Nonnull)error { } -- (nullable AllTypes *)echoAllTypes:(AllTypes *)everything - error:(FlutterError *_Nullable *_Nonnull)error { +- (nullable FLTAllTypes *)echoAllTypes:(FLTAllTypes *)everything + error:(FlutterError *_Nullable *_Nonnull)error { return everything; } -- (nullable AllNullableTypes *)echoAllNullableTypes:(nullable AllNullableTypes *)everything - error:(FlutterError *_Nullable *_Nonnull)error { +- (nullable FLTAllNullableTypes *)echoAllNullableTypes:(nullable FLTAllNullableTypes *)everything + error:(FlutterError *_Nullable *_Nonnull)error { return everything; } -- (nullable AllNullableTypesWithoutRecursion *) - echoAllNullableTypesWithoutRecursion:(nullable AllNullableTypesWithoutRecursion *)everything +- (nullable FLTAllNullableTypesWithoutRecursion *) + echoAllNullableTypesWithoutRecursion:(nullable FLTAllNullableTypesWithoutRecursion *)everything error:(FlutterError *_Nullable __autoreleasing *_Nonnull)error { return everything; } @@ -93,23 +95,95 @@ - (nullable id)echoObject:(id)anObject error:(FlutterError *_Nullable *_Nonnull) return list; } -- (nullable NSDictionary *)echoMap:(NSDictionary *)aMap +- (nullable NSArray *)echoEnumList:(NSArray *)enumList error:(FlutterError *_Nullable *_Nonnull)error { - return aMap; + return enumList; } -- (nullable AllClassesWrapper *)echoClassWrapper:(AllClassesWrapper *)wrapper - error:(FlutterError *_Nullable *_Nonnull)error { +- (nullable NSArray *) + echoClassList:(NSArray *)classList + error:(FlutterError *_Nullable *_Nonnull)error { + return classList; +} + +- (nullable NSArray *) + echoNonNullEnumList:(nonnull NSArray *)enumList + error:(FlutterError *_Nullable __autoreleasing *_Nonnull)error { + return enumList; +} + +- (nullable NSArray *) + echoNonNullClassList:(nonnull NSArray *)classList + error:(FlutterError *_Nullable __autoreleasing *_Nonnull)error { + return classList; +} + +- (nullable NSDictionary *)echoMap:(NSDictionary *)map + error:(FlutterError *_Nullable *_Nonnull)error { + return map; +} + +- (nullable NSDictionary *) + echoStringMap:(NSDictionary *)stringMap + error:(FlutterError *_Nullable *_Nonnull)error { + return stringMap; +} + +- (nullable NSDictionary *) + echoIntMap:(NSDictionary *)intMap + error:(FlutterError *_Nullable *_Nonnull)error { + return intMap; +} + +- (nullable NSDictionary *) + echoEnumMap:(NSDictionary *)enumMap + error:(FlutterError *_Nullable *_Nonnull)error { + return enumMap; +} + +- (nullable NSDictionary *) + echoClassMap:(NSDictionary *)classMap + error:(FlutterError *_Nullable *_Nonnull)error { + return classMap; +} + +- (nullable NSDictionary *) + echoNonNullStringMap:(nonnull NSDictionary *)stringMap + error:(FlutterError *_Nullable __autoreleasing *_Nonnull)error { + return stringMap; +} + +- (nullable NSDictionary *) + echoNonNullIntMap:(nonnull NSDictionary *)intMap + error:(FlutterError *_Nullable __autoreleasing *_Nonnull)error { + return intMap; +} + +- (nullable NSDictionary *) + echoNonNullEnumMap:(nonnull NSDictionary *)enumMap + error:(FlutterError *_Nullable __autoreleasing *_Nonnull)error { + return enumMap; +} + +- (nullable NSDictionary *) + echoNonNullClassMap:(nonnull NSDictionary *)classMap + error:(FlutterError *_Nullable __autoreleasing *_Nonnull)error { + return classMap; +} + +- (nullable FLTAllClassesWrapper *)echoClassWrapper:(FLTAllClassesWrapper *)wrapper + error:(FlutterError *_Nullable *_Nonnull)error { return wrapper; } -- (AnEnumBox *_Nullable)echoEnum:(AnEnum)anEnum error:(FlutterError *_Nullable *_Nonnull)error { - return [[AnEnumBox alloc] initWithValue:anEnum]; +- (FLTAnEnumBox *_Nullable)echoEnum:(FLTAnEnum)anEnum + error:(FlutterError *_Nullable *_Nonnull)error { + return [[FLTAnEnumBox alloc] initWithValue:anEnum]; } -- (AnotherEnumBox *_Nullable)echoAnotherEnum:(AnotherEnum)anotherEnum - error:(FlutterError *_Nullable *_Nonnull)error { - return [[AnotherEnumBox alloc] initWithValue:anotherEnum]; +- (FLTAnotherEnumBox *_Nullable)echoAnotherEnum:(FLTAnotherEnum)anotherEnum + error:(FlutterError *_Nullable *_Nonnull)error { + return [[FLTAnotherEnumBox alloc] initWithValue:anotherEnum]; } - (nullable NSString *)echoNamedDefaultString:(NSString *)aString @@ -127,41 +201,46 @@ - (nullable NSNumber *)echoRequiredInt:(NSInteger)anInt return @(anInt); } -- (nullable NSString *)extractNestedNullableStringFrom:(AllClassesWrapper *)wrapper +- (nullable NSString *)extractNestedNullableStringFrom:(FLTAllClassesWrapper *)wrapper error:(FlutterError *_Nullable *_Nonnull)error { return wrapper.allNullableTypes.aNullableString; } -- (nullable AllClassesWrapper *) +- (nullable FLTAllClassesWrapper *) createNestedObjectWithNullableString:(nullable NSString *)nullableString error:(FlutterError *_Nullable *_Nonnull)error { - AllNullableTypes *innerObject = [[AllNullableTypes alloc] init]; + FLTAllNullableTypes *innerObject = [[FLTAllNullableTypes alloc] init]; innerObject.aNullableString = nullableString; - return [AllClassesWrapper makeWithAllNullableTypes:innerObject - allNullableTypesWithoutRecursion:nil - allTypes:nil]; -} - -- (nullable AllNullableTypes *)sendMultipleNullableTypesABool:(nullable NSNumber *)aNullableBool - anInt:(nullable NSNumber *)aNullableInt - aString:(nullable NSString *)aNullableString - error:(FlutterError *_Nullable *_Nonnull) - error { - AllNullableTypes *someTypes = [[AllNullableTypes alloc] init]; + return [FLTAllClassesWrapper makeWithAllNullableTypes:innerObject + allNullableTypesWithoutRecursion:nil + allTypes:nil + classList:@[] + nullableClassList:nil + classMap:@{} + nullableClassMap:nil]; +} + +- (nullable FLTAllNullableTypes *) + sendMultipleNullableTypesABool:(nullable NSNumber *)aNullableBool + anInt:(nullable NSNumber *)aNullableInt + aString:(nullable NSString *)aNullableString + error:(FlutterError *_Nullable *_Nonnull)error { + FLTAllNullableTypes *someTypes = [[FLTAllNullableTypes alloc] init]; someTypes.aNullableBool = aNullableBool; someTypes.aNullableInt = aNullableInt; someTypes.aNullableString = aNullableString; return someTypes; } -- (nullable AllNullableTypesWithoutRecursion *) +- (nullable FLTAllNullableTypesWithoutRecursion *) sendMultipleNullableTypesWithoutRecursionABool:(nullable NSNumber *)aNullableBool anInt:(nullable NSNumber *)aNullableInt aString:(nullable NSString *)aNullableString error: (FlutterError *_Nullable __autoreleasing *_Nonnull) error { - AllNullableTypesWithoutRecursion *someTypes = [[AllNullableTypesWithoutRecursion alloc] init]; + FLTAllNullableTypesWithoutRecursion *someTypes = + [[FLTAllNullableTypesWithoutRecursion alloc] init]; someTypes.aNullableBool = aNullableBool; someTypes.aNullableInt = aNullableInt; someTypes.aNullableString = aNullableString; @@ -204,19 +283,91 @@ - (nullable id)echoNullableObject:(nullable id)aNullableObject return aNullableList; } -- (nullable NSDictionary *) - echoNullableMap:(nullable NSDictionary *)aNullableMap - error:(FlutterError *_Nullable *_Nonnull)error { - return aNullableMap; +- (nullable NSArray *) + echoNullableEnumList:(nullable NSArray *)enumList + error:(FlutterError *_Nullable *_Nonnull)error { + return enumList; } -- (AnEnumBox *_Nullable)echoNullableEnum:(nullable AnEnumBox *)AnEnumBoxed - error:(FlutterError *_Nullable *_Nonnull)error { +- (nullable NSArray *) + echoNullableClassList:(nullable NSArray *)classList + error:(FlutterError *_Nullable *_Nonnull)error { + return classList; +} + +- (nullable NSArray *) + echoNullableNonNullEnumList:(nullable NSArray *)enumList + error:(FlutterError *_Nullable __autoreleasing *_Nonnull)error { + return enumList; +} + +- (nullable NSArray *) + echoNullableNonNullClassList:(nullable NSArray *)classList + error:(FlutterError *_Nullable __autoreleasing *_Nonnull)error { + return classList; +} + +- (nullable NSDictionary *)echoNullableMap:(nullable NSDictionary *)map + error:(FlutterError *_Nullable *_Nonnull)error { + return map; +} + +- (nullable NSDictionary *) + echoNullableStringMap:(nullable NSDictionary *)stringMap + error:(FlutterError *_Nullable *_Nonnull)error { + return stringMap; +} + +- (nullable NSDictionary *) + echoNullableIntMap:(nullable NSDictionary *)intMap + error:(FlutterError *_Nullable *_Nonnull)error { + return intMap; +} + +- (nullable NSDictionary *) + echoNullableEnumMap:(nullable NSDictionary *)enumMap + error:(FlutterError *_Nullable *_Nonnull)error { + return enumMap; +} + +- (nullable NSDictionary *) + echoNullableClassMap:(nullable NSDictionary *)classMap + error:(FlutterError *_Nullable *_Nonnull)error { + return classMap; +} + +- (nullable NSDictionary *) + echoNullableNonNullStringMap:(nullable NSDictionary *)stringMap + error:(FlutterError *_Nullable __autoreleasing *_Nonnull)error { + return stringMap; +} + +- (nullable NSDictionary *) + echoNullableNonNullIntMap:(nullable NSDictionary *)intMap + error:(FlutterError *_Nullable __autoreleasing *_Nonnull)error { + return intMap; +} + +- (nullable NSDictionary *) + echoNullableNonNullEnumMap:(nullable NSDictionary *)enumMap + error:(FlutterError *_Nullable __autoreleasing *_Nonnull)error { + return enumMap; +} + +- (nullable NSDictionary *) + echoNullableNonNullClassMap:(nullable NSDictionary *)classMap + error:(FlutterError *_Nullable __autoreleasing *_Nonnull)error { + return classMap; +} + +- (FLTAnEnumBox *_Nullable)echoNullableEnum:(nullable FLTAnEnumBox *)AnEnumBoxed + error:(FlutterError *_Nullable *_Nonnull)error { return AnEnumBoxed; } -- (AnotherEnumBox *_Nullable)echoAnotherNullableEnum:(nullable AnotherEnumBox *)AnotherEnumBoxed - error:(FlutterError *_Nullable *_Nonnull)error { +- (FLTAnotherEnumBox *_Nullable)echoAnotherNullableEnum: + (nullable FLTAnotherEnumBox *)AnotherEnumBoxed + error:(FlutterError *_Nullable *_Nonnull)error { return AnotherEnumBoxed; } @@ -247,23 +398,24 @@ - (void)throwAsyncFlutterErrorWithCompletion:(void (^)(id _Nullable, completion(nil, [FlutterError errorWithCode:@"code" message:@"message" details:@"details"]); } -- (void)echoAsyncAllTypes:(AllTypes *)everything - completion:(void (^)(AllTypes *_Nullable, FlutterError *_Nullable))completion { +- (void)echoAsyncAllTypes:(FLTAllTypes *)everything + completion:(void (^)(FLTAllTypes *_Nullable, FlutterError *_Nullable))completion { completion(everything, nil); } -- (void)echoAsyncNullableAllNullableTypes:(nullable AllNullableTypes *)everything - completion:(void (^)(AllNullableTypes *_Nullable, +- (void)echoAsyncNullableAllNullableTypes:(nullable FLTAllNullableTypes *)everything + completion:(void (^)(FLTAllNullableTypes *_Nullable, FlutterError *_Nullable))completion { completion(everything, nil); } -- (void)echoAsyncNullableAllNullableTypesWithoutRecursion: - (nullable AllNullableTypesWithoutRecursion *)everything - completion: - (nonnull void (^)( - AllNullableTypesWithoutRecursion *_Nullable, - FlutterError *_Nullable))completion { +- (void) + echoAsyncNullableAllNullableTypesWithoutRecursion: + (nullable FLTAllNullableTypesWithoutRecursion *)everything + completion: + (nonnull void (^)( + FLTAllNullableTypesWithoutRecursion *_Nullable, + FlutterError *_Nullable))completion { completion(everything, nil); } @@ -303,21 +455,57 @@ - (void)echoAsyncList:(NSArray *)list completion(list, nil); } -- (void)echoAsyncMap:(NSDictionary *)aMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion { - completion(aMap, nil); +- (void)echoAsyncEnumList:(NSArray *)enumList + completion:(void (^)(NSArray *_Nullable, + FlutterError *_Nullable))completion { + completion(enumList, nil); +} + +- (void)echoAsyncClassList:(NSArray *)classList + completion:(void (^)(NSArray *_Nullable, + FlutterError *_Nullable))completion { + completion(classList, nil); +} + +- (void)echoAsyncMap:(NSDictionary *)map + completion: + (void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion { + completion(map, nil); +} + +- (void)echoAsyncStringMap:(NSDictionary *)stringMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + completion(stringMap, nil); +} + +- (void)echoAsyncIntMap:(NSDictionary *)intMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + completion(intMap, nil); +} + +- (void)echoAsyncEnumMap:(NSDictionary *)enumMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + completion(enumMap, nil); } -- (void)echoAsyncEnum:(AnEnum)anEnum - completion:(void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion { - completion([[AnEnumBox alloc] initWithValue:anEnum], nil); +- (void)echoAsyncClassMap:(NSDictionary *)classMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + completion(classMap, nil); } -- (void)echoAnotherAsyncEnum:(AnotherEnum)anotherEnum +- (void)echoAsyncEnum:(FLTAnEnum)anEnum + completion:(void (^)(FLTAnEnumBox *_Nullable, FlutterError *_Nullable))completion { + completion([[FLTAnEnumBox alloc] initWithValue:anEnum], nil); +} + +- (void)echoAnotherAsyncEnum:(FLTAnotherEnum)anotherEnum completion: - (void (^)(AnotherEnumBox *_Nullable, FlutterError *_Nullable))completion { - completion([[AnotherEnumBox alloc] initWithValue:anotherEnum], nil); + (void (^)(FLTAnotherEnumBox *_Nullable, FlutterError *_Nullable))completion { + completion([[FLTAnotherEnumBox alloc] initWithValue:anotherEnum], nil); } - (void)echoAsyncNullableInt:(nullable NSNumber *)anInt @@ -357,19 +545,57 @@ - (void)echoAsyncNullableList:(nullable NSArray *)list completion(list, nil); } -- (void)echoAsyncNullableMap:(nullable NSDictionary *)aMap - completion:(void (^)(NSDictionary *_Nullable, +- (void)echoAsyncNullableEnumList:(nullable NSArray *)enumList + completion:(void (^)(NSArray *_Nullable, + FlutterError *_Nullable))completion { + completion(enumList, nil); +} + +- (void)echoAsyncNullableClassList:(nullable NSArray *)classList + completion:(void (^)(NSArray *_Nullable, + FlutterError *_Nullable))completion { + completion(classList, nil); +} + +- (void)echoAsyncNullableMap:(nullable NSDictionary *)map + completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion { - completion(aMap, nil); + completion(map, nil); } -- (void)echoAsyncNullableEnum:(nullable AnEnumBox *)AnEnumBoxed - completion:(void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion { +- (void)echoAsyncNullableStringMap:(nullable NSDictionary *)stringMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + completion(stringMap, nil); +} + +- (void)echoAsyncNullableIntMap:(nullable NSDictionary *)intMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + completion(intMap, nil); +} + +- (void)echoAsyncNullableEnumMap:(nullable NSDictionary *)enumMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + completion(enumMap, nil); +} + +- (void) + echoAsyncNullableClassMap:(nullable NSDictionary *)classMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + completion(classMap, nil); +} + +- (void)echoAsyncNullableEnum:(nullable FLTAnEnumBox *)AnEnumBoxed + completion: + (void (^)(FLTAnEnumBox *_Nullable, FlutterError *_Nullable))completion { completion(AnEnumBoxed, nil); } -- (void)echoAnotherAsyncNullableEnum:(nullable AnotherEnumBox *)AnotherEnumBoxed - completion:(void (^)(AnotherEnumBox *_Nullable, +- (void)echoAnotherAsyncNullableEnum:(nullable FLTAnotherEnumBox *)AnotherEnumBoxed + completion:(void (^)(FLTAnotherEnumBox *_Nullable, FlutterError *_Nullable))completion { completion(AnotherEnumBoxed, nil); } @@ -393,10 +619,11 @@ - (void)callFlutterThrowErrorFromVoidWithCompletion:(void (^)(FlutterError *_Nul }]; } -- (void)callFlutterEchoAllTypes:(AllTypes *)everything - completion:(void (^)(AllTypes *_Nullable, FlutterError *_Nullable))completion { +- (void)callFlutterEchoAllTypes:(FLTAllTypes *)everything + completion: + (void (^)(FLTAllTypes *_Nullable, FlutterError *_Nullable))completion { [self.flutterAPI echoAllTypes:everything - completion:^(AllTypes *value, FlutterError *error) { + completion:^(FLTAllTypes *value, FlutterError *error) { completion(value, error); }]; } @@ -404,14 +631,15 @@ - (void)callFlutterEchoAllTypes:(AllTypes *)everything - (void)callFlutterSendMultipleNullableTypesABool:(nullable NSNumber *)aNullableBool anInt:(nullable NSNumber *)aNullableInt aString:(nullable NSString *)aNullableString - completion:(void (^)(AllNullableTypes *_Nullable, + completion:(void (^)(FLTAllNullableTypes *_Nullable, FlutterError *_Nullable))completion { - [self.flutterAPI sendMultipleNullableTypesABool:aNullableBool - anInt:aNullableInt - aString:aNullableString - completion:^(AllNullableTypes *value, FlutterError *error) { - completion(value, error); - }]; + [self.flutterAPI + sendMultipleNullableTypesABool:aNullableBool + anInt:aNullableInt + aString:aNullableString + completion:^(FLTAllNullableTypes *value, FlutterError *error) { + completion(value, error); + }]; } - (void)callFlutterSendMultipleNullableTypesWithoutRecursionABool:(nullable NSNumber *)aNullableBool @@ -420,14 +648,14 @@ - (void)callFlutterSendMultipleNullableTypesWithoutRecursionABool:(nullable NSNu (nullable NSString *)aNullableString completion: (nonnull void (^)( - AllNullableTypesWithoutRecursion + FLTAllNullableTypesWithoutRecursion *_Nullable, FlutterError *_Nullable))completion { [self.flutterAPI sendMultipleNullableTypesWithoutRecursionABool:aNullableBool anInt:aNullableInt aString:aNullableString - completion:^(AllNullableTypesWithoutRecursion *value, + completion:^(FLTAllNullableTypesWithoutRecursion *value, FlutterError *error) { completion(value, error); }]; @@ -482,52 +710,177 @@ - (void)callFlutterEchoList:(NSArray *)list }]; } -- (void)callFlutterEchoMap:(NSDictionary *)aMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion { - [self.flutterAPI echoMap:aMap - completion:^(NSDictionary *value, FlutterError *error) { +- (void)callFlutterEchoEnumList:(NSArray *)enumList + completion:(void (^)(NSArray *_Nullable, + FlutterError *_Nullable))completion { + [self.flutterAPI echoEnumList:enumList + completion:^(NSArray *value, FlutterError *error) { + completion(value, error); + }]; +} + +- (void)callFlutterEchoClassList:(NSArray *)classList + completion:(void (^)(NSArray *_Nullable, + FlutterError *_Nullable))completion { + [self.flutterAPI echoClassList:classList + completion:^(NSArray *value, FlutterError *error) { + completion(value, error); + }]; +} + +- (void)callFlutterEchoNonNullEnumList:(nonnull NSArray *)enumList + completion:(nonnull void (^)(NSArray *_Nullable, + FlutterError *_Nullable))completion { + [self.flutterAPI echoNonNullEnumList:enumList + completion:^(NSArray *value, FlutterError *error) { + completion(value, error); + }]; +} + +- (void)callFlutterEchoNonNullClassList:(nonnull NSArray *)classList + completion:(nonnull void (^)(NSArray *_Nullable, + FlutterError *_Nullable))completion { + [self.flutterAPI + echoNonNullClassList:classList + completion:^(NSArray *value, FlutterError *error) { + completion(value, error); + }]; +} + +- (void)callFlutterEchoMap:(NSDictionary *)map + completion: + (void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion { + [self.flutterAPI echoMap:map + completion:^(NSDictionary *value, FlutterError *error) { + completion(value, error); + }]; +} + +- (void)callFlutterEchoStringMap:(NSDictionary *)stringMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + [self.flutterAPI + echoStringMap:stringMap + completion:^(NSDictionary *value, FlutterError *error) { + completion(value, error); + }]; +} + +- (void)callFlutterEchoIntMap:(NSDictionary *)intMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + [self.flutterAPI echoIntMap:intMap + completion:^(NSDictionary *value, FlutterError *error) { + completion(value, error); + }]; +} + +- (void)callFlutterEchoEnumMap:(NSDictionary *)enumMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + [self.flutterAPI + echoEnumMap:enumMap + completion:^(NSDictionary *value, FlutterError *error) { + completion(value, error); + }]; +} + +- (void)callFlutterEchoClassMap:(NSDictionary *)classMap + completion: + (void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + [self.flutterAPI + echoClassMap:classMap + completion:^(NSDictionary *value, FlutterError *error) { + completion(value, error); + }]; +} + +- (void)callFlutterEchoNonNullStringMap:(nonnull NSDictionary *)stringMap + completion: + (nonnull void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + [self.flutterAPI + echoNonNullStringMap:stringMap + completion:^(NSDictionary *value, FlutterError *error) { completion(value, error); }]; } -- (void)callFlutterEchoEnum:(AnEnum)anEnum - completion:(void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion { +- (void)callFlutterEchoNonNullIntMap:(nonnull NSDictionary *)intMap + completion: + (nonnull void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + [self.flutterAPI + echoNonNullIntMap:intMap + completion:^(NSDictionary *value, FlutterError *error) { + completion(value, error); + }]; +} + +- (void)callFlutterEchoNonNullEnumMap: + (nonnull NSDictionary *)enumMap + completion:(nonnull void (^)( + NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + [self.flutterAPI echoNonNullEnumMap:enumMap + completion:^(NSDictionary *value, + FlutterError *error) { + completion(value, error); + }]; +} + +- (void)callFlutterEchoNonNullClassMap: + (nonnull NSDictionary *)classMap + completion: + (nonnull void (^)( + NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + [self.flutterAPI echoNonNullClassMap:classMap + completion:^(NSDictionary *value, + FlutterError *error) { + completion(value, error); + }]; +} + +- (void)callFlutterEchoEnum:(FLTAnEnum)anEnum + completion:(void (^)(FLTAnEnumBox *_Nullable, FlutterError *_Nullable))completion { [self.flutterAPI echoEnum:anEnum - completion:^(AnEnumBox *value, FlutterError *error) { + completion:^(FLTAnEnumBox *value, FlutterError *error) { completion(value, error); }]; } -- (void)callFlutterEchoAnotherEnum:(AnotherEnum)anotherEnum - completion:(void (^)(AnotherEnumBox *_Nullable, +- (void)callFlutterEchoAnotherEnum:(FLTAnotherEnum)anotherEnum + completion:(void (^)(FLTAnotherEnumBox *_Nullable, FlutterError *_Nullable))completion { [self.flutterAPI echoAnotherEnum:anotherEnum - completion:^(AnotherEnumBox *value, FlutterError *error) { + completion:^(FLTAnotherEnumBox *value, FlutterError *error) { completion(value, error); }]; } -- (void)callFlutterEchoAllNullableTypes:(nullable AllNullableTypes *)everything - completion:(void (^)(AllNullableTypes *_Nullable, +- (void)callFlutterEchoAllNullableTypes:(nullable FLTAllNullableTypes *)everything + completion:(void (^)(FLTAllNullableTypes *_Nullable, FlutterError *_Nullable))completion { [self.flutterAPI echoAllNullableTypes:everything - completion:^(AllNullableTypes *value, FlutterError *error) { + completion:^(FLTAllNullableTypes *value, FlutterError *error) { completion(value, error); }]; } - (void)callFlutterEchoAllNullableTypesWithoutRecursion: - (nullable AllNullableTypesWithoutRecursion *)everything + (nullable FLTAllNullableTypesWithoutRecursion *)everything completion: (nonnull void (^)( - AllNullableTypesWithoutRecursion *_Nullable, + FLTAllNullableTypesWithoutRecursion *_Nullable, FlutterError *_Nullable))completion { - [self.flutterAPI echoAllNullableTypesWithoutRecursion:everything - completion:^(AllNullableTypesWithoutRecursion *value, - FlutterError *error) { - completion(value, error); - }]; + [self.flutterAPI + echoAllNullableTypesWithoutRecursion:everything + completion:^(FLTAllNullableTypesWithoutRecursion *value, + FlutterError *error) { + completion(value, error); + }]; } - (void)callFlutterEchoNullableBool:(nullable NSNumber *)aBool @@ -584,29 +937,166 @@ - (void)callFlutterEchoNullableList:(nullable NSArray *)list }]; } -- (void)callFlutterEchoNullableMap:(nullable NSDictionary *)aMap - completion:(void (^)(NSDictionary *_Nullable, +- (void)callFlutterEchoNullableEnumList:(nullable NSArray *)enumList + completion:(void (^)(NSArray *_Nullable, + FlutterError *_Nullable))completion { + [self.flutterAPI echoNullableEnumList:enumList + completion:^(NSArray *value, FlutterError *error) { + completion(value, error); + }]; +} + +- (void)callFlutterEchoNullableClassList:(nullable NSArray *)classList + completion:(void (^)(NSArray *_Nullable, + FlutterError *_Nullable))completion { + [self.flutterAPI + echoNullableClassList:classList + completion:^(NSArray *value, FlutterError *error) { + completion(value, error); + }]; +} + +- (void)callFlutterEchoNullableNonNullEnumList:(nullable NSArray *)enumList + completion: + (nonnull void (^)(NSArray *_Nullable, + FlutterError *_Nullable))completion { + [self.flutterAPI + echoNullableNonNullEnumList:enumList + completion:^(NSArray *value, FlutterError *error) { + completion(value, error); + }]; +} + +- (void)callFlutterEchoNullableNonNullClassList:(nullable NSArray *)classList + completion:(nonnull void (^)( + NSArray *_Nullable, + FlutterError *_Nullable))completion { + [self.flutterAPI + echoNullableNonNullClassList:classList + completion:^(NSArray *value, FlutterError *error) { + completion(value, error); + }]; +} + +- (void)callFlutterEchoNullableMap:(nullable NSDictionary *)map + completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion { - [self.flutterAPI echoNullableMap:aMap - completion:^(NSDictionary *value, FlutterError *error) { + [self.flutterAPI echoNullableMap:map + completion:^(NSDictionary *value, FlutterError *error) { completion(value, error); }]; } -- (void)callFlutterEchoNullableEnum:(nullable AnEnumBox *)AnEnumBoxed +- (void)callFlutterEchoNullableStringMap:(nullable NSDictionary *)stringMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + [self.flutterAPI + echoNullableStringMap:stringMap + completion:^(NSDictionary *value, FlutterError *error) { + completion(value, error); + }]; +} + +- (void)callFlutterEchoNullableIntMap:(nullable NSDictionary *)intMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + [self.flutterAPI + echoNullableIntMap:intMap + completion:^(NSDictionary *value, FlutterError *error) { + completion(value, error); + }]; +} + +- (void)callFlutterEchoNullableEnumMap: + (nullable NSDictionary *)enumMap + completion: + (void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + [self.flutterAPI echoNullableEnumMap:enumMap + completion:^(NSDictionary *value, + FlutterError *error) { + completion(value, error); + }]; +} + +- (void) + callFlutterEchoNullableClassMap: + (nullable NSDictionary *)classMap completion: - (void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion { + (void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + [self.flutterAPI echoNullableClassMap:classMap + completion:^(NSDictionary *value, + FlutterError *error) { + completion(value, error); + }]; +} + +- (void)callFlutterEchoNullableNonNullStringMap: + (nullable NSDictionary *)stringMap + completion:(nonnull void (^)( + NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + [self.flutterAPI echoNullableNonNullStringMap:stringMap + completion:^(NSDictionary *value, + FlutterError *error) { + completion(value, error); + }]; +} + +- (void)callFlutterEchoNullableNonNullIntMap:(nullable NSDictionary *)intMap + completion:(nonnull void (^)( + NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + [self.flutterAPI echoNullableNonNullIntMap:intMap + completion:^(NSDictionary *value, + FlutterError *error) { + completion(value, error); + }]; +} + +- (void)callFlutterEchoNullableNonNullEnumMap: + (nullable NSDictionary *)enumMap + completion: + (nonnull void (^)( + NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + [self.flutterAPI echoNullableNonNullEnumMap:enumMap + completion:^(NSDictionary *value, + FlutterError *error) { + completion(value, error); + }]; +} + +- (void) + callFlutterEchoNullableNonNullClassMap: + (nullable NSDictionary *)classMap + completion: + (nonnull void (^)( + NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + [self.flutterAPI + echoNullableNonNullClassMap:classMap + completion:^(NSDictionary *value, + FlutterError *error) { + completion(value, error); + }]; +} + +- (void)callFlutterEchoNullableEnum:(nullable FLTAnEnumBox *)AnEnumBoxed + completion:(void (^)(FLTAnEnumBox *_Nullable, + FlutterError *_Nullable))completion { [self.flutterAPI echoNullableEnum:AnEnumBoxed - completion:^(AnEnumBox *value, FlutterError *error) { + completion:^(FLTAnEnumBox *value, FlutterError *error) { completion(value, error); }]; } -- (void)callFlutterEchoAnotherNullableEnum:(nullable AnotherEnumBox *)AnotherEnumBoxed - completion:(void (^)(AnotherEnumBox *_Nullable, +- (void)callFlutterEchoAnotherNullableEnum:(nullable FLTAnotherEnumBox *)AnotherEnumBoxed + completion:(void (^)(FLTAnotherEnumBox *_Nullable, FlutterError *_Nullable))completion { [self.flutterAPI echoAnotherNullableEnum:AnotherEnumBoxed - completion:^(AnotherEnumBox *value, FlutterError *error) { + completion:^(FLTAnotherEnumBox *value, FlutterError *error) { completion(value, error); }]; } @@ -637,6 +1127,10 @@ - (void)callFlutterSmallApiEchoString:(nonnull NSString *)aString }]; } +- (FLTUnusedClass *)checkIfUnusedClassGenerated { + return [[FLTUnusedClass alloc] init]; +} + @end @interface AlternateLanguageTestAPIWithSuffix () @@ -646,7 +1140,7 @@ @implementation AlternateLanguageTestAPIWithSuffix + (void)registerWithRegistrar:(NSObject *)registrar suffix:(NSString *)suffix { AlternateLanguageTestAPIWithSuffix *api = [[AlternateLanguageTestAPIWithSuffix alloc] init]; - SetUpHostSmallApiWithSuffix(registrar.messenger, api, suffix); + SetUpFLTHostSmallApiWithSuffix([registrar messenger], api, suffix); } #pragma mark HostSmallAPI implementation diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/Classes/CoreTests.gen.h b/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/Classes/CoreTests.gen.h index 4a2239f96562..bd913ca95a9e 100644 --- a/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/Classes/CoreTests.gen.h +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/Classes/CoreTests.gen.h @@ -14,38 +14,44 @@ NS_ASSUME_NONNULL_BEGIN -typedef NS_ENUM(NSUInteger, AnEnum) { - AnEnumOne = 0, - AnEnumTwo = 1, - AnEnumThree = 2, - AnEnumFortyTwo = 3, - AnEnumFourHundredTwentyTwo = 4, +typedef NS_ENUM(NSUInteger, FLTAnEnum) { + FLTAnEnumOne = 0, + FLTAnEnumTwo = 1, + FLTAnEnumThree = 2, + FLTAnEnumFortyTwo = 3, + FLTAnEnumFourHundredTwentyTwo = 4, }; -/// Wrapper for AnEnum to allow for nullability. -@interface AnEnumBox : NSObject -@property(nonatomic, assign) AnEnum value; -- (instancetype)initWithValue:(AnEnum)value; +/// Wrapper for FLTAnEnum to allow for nullability. +@interface FLTAnEnumBox : NSObject +@property(nonatomic, assign) FLTAnEnum value; +- (instancetype)initWithValue:(FLTAnEnum)value; @end -typedef NS_ENUM(NSUInteger, AnotherEnum) { - AnotherEnumJustInCase = 0, +typedef NS_ENUM(NSUInteger, FLTAnotherEnum) { + FLTAnotherEnumJustInCase = 0, }; -/// Wrapper for AnotherEnum to allow for nullability. -@interface AnotherEnumBox : NSObject -@property(nonatomic, assign) AnotherEnum value; -- (instancetype)initWithValue:(AnotherEnum)value; +/// Wrapper for FLTAnotherEnum to allow for nullability. +@interface FLTAnotherEnumBox : NSObject +@property(nonatomic, assign) FLTAnotherEnum value; +- (instancetype)initWithValue:(FLTAnotherEnum)value; @end -@class AllTypes; -@class AllNullableTypes; -@class AllNullableTypesWithoutRecursion; -@class AllClassesWrapper; -@class TestMessage; +@class FLTUnusedClass; +@class FLTAllTypes; +@class FLTAllNullableTypes; +@class FLTAllNullableTypesWithoutRecursion; +@class FLTAllClassesWrapper; +@class FLTTestMessage; + +@interface FLTUnusedClass : NSObject ++ (instancetype)makeWithAField:(nullable id)aField; +@property(nonatomic, strong, nullable) id aField; +@end /// A class containing all supported types. -@interface AllTypes : NSObject +@interface FLTAllTypes : NSObject /// `init` unavailable to enforce nonnull fields, see the `make` class method. - (instancetype)init NS_UNAVAILABLE; + (instancetype)makeWithABool:(BOOL)aBool @@ -56,8 +62,8 @@ typedef NS_ENUM(NSUInteger, AnotherEnum) { a4ByteArray:(FlutterStandardTypedData *)a4ByteArray a8ByteArray:(FlutterStandardTypedData *)a8ByteArray aFloatArray:(FlutterStandardTypedData *)aFloatArray - anEnum:(AnEnum)anEnum - anotherEnum:(AnotherEnum)anotherEnum + anEnum:(FLTAnEnum)anEnum + anotherEnum:(FLTAnotherEnum)anotherEnum aString:(NSString *)aString anObject:(id)anObject list:(NSArray *)list @@ -65,7 +71,17 @@ typedef NS_ENUM(NSUInteger, AnotherEnum) { intList:(NSArray *)intList doubleList:(NSArray *)doubleList boolList:(NSArray *)boolList - map:(NSDictionary *)map; + enumList:(NSArray *)enumList + objectList:(NSArray *)objectList + listList:(NSArray *> *)listList + mapList:(NSArray *> *)mapList + map:(NSDictionary *)map + stringMap:(NSDictionary *)stringMap + intMap:(NSDictionary *)intMap + enumMap:(NSDictionary *)enumMap + objectMap:(NSDictionary *)objectMap + listMap:(NSDictionary *> *)listMap + mapMap:(NSDictionary *> *)mapMap; @property(nonatomic, assign) BOOL aBool; @property(nonatomic, assign) NSInteger anInt; @property(nonatomic, assign) NSInteger anInt64; @@ -74,8 +90,8 @@ typedef NS_ENUM(NSUInteger, AnotherEnum) { @property(nonatomic, strong) FlutterStandardTypedData *a4ByteArray; @property(nonatomic, strong) FlutterStandardTypedData *a8ByteArray; @property(nonatomic, strong) FlutterStandardTypedData *aFloatArray; -@property(nonatomic, assign) AnEnum anEnum; -@property(nonatomic, assign) AnotherEnum anotherEnum; +@property(nonatomic, assign) FLTAnEnum anEnum; +@property(nonatomic, assign) FLTAnotherEnum anotherEnum; @property(nonatomic, copy) NSString *aString; @property(nonatomic, strong) id anObject; @property(nonatomic, copy) NSArray *list; @@ -83,35 +99,54 @@ typedef NS_ENUM(NSUInteger, AnotherEnum) { @property(nonatomic, copy) NSArray *intList; @property(nonatomic, copy) NSArray *doubleList; @property(nonatomic, copy) NSArray *boolList; +@property(nonatomic, copy) NSArray *enumList; +@property(nonatomic, copy) NSArray *objectList; +@property(nonatomic, copy) NSArray *> *listList; +@property(nonatomic, copy) NSArray *> *mapList; @property(nonatomic, copy) NSDictionary *map; +@property(nonatomic, copy) NSDictionary *stringMap; +@property(nonatomic, copy) NSDictionary *intMap; +@property(nonatomic, copy) NSDictionary *enumMap; +@property(nonatomic, copy) NSDictionary *objectMap; +@property(nonatomic, copy) NSDictionary *> *listMap; +@property(nonatomic, copy) NSDictionary *> *mapMap; @end /// A class containing all supported nullable types. -@interface AllNullableTypes : NSObject -+ (instancetype)makeWithANullableBool:(nullable NSNumber *)aNullableBool - aNullableInt:(nullable NSNumber *)aNullableInt - aNullableInt64:(nullable NSNumber *)aNullableInt64 - aNullableDouble:(nullable NSNumber *)aNullableDouble - aNullableByteArray:(nullable FlutterStandardTypedData *)aNullableByteArray - aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray - aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray - aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray - nullableNestedList:(nullable NSArray *> *)nullableNestedList - nullableMapWithAnnotations: - (nullable NSDictionary *)nullableMapWithAnnotations - nullableMapWithObject:(nullable NSDictionary *)nullableMapWithObject - aNullableEnum:(nullable AnEnumBox *)aNullableEnum - anotherNullableEnum:(nullable AnotherEnumBox *)anotherNullableEnum - aNullableString:(nullable NSString *)aNullableString - aNullableObject:(nullable id)aNullableObject - allNullableTypes:(nullable AllNullableTypes *)allNullableTypes - list:(nullable NSArray *)list - stringList:(nullable NSArray *)stringList - intList:(nullable NSArray *)intList - doubleList:(nullable NSArray *)doubleList - boolList:(nullable NSArray *)boolList - nestedClassList:(nullable NSArray *)nestedClassList - map:(nullable NSDictionary *)map; +@interface FLTAllNullableTypes : NSObject ++ (instancetype) + makeWithANullableBool:(nullable NSNumber *)aNullableBool + aNullableInt:(nullable NSNumber *)aNullableInt + aNullableInt64:(nullable NSNumber *)aNullableInt64 + aNullableDouble:(nullable NSNumber *)aNullableDouble + aNullableByteArray:(nullable FlutterStandardTypedData *)aNullableByteArray + aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray + aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray + aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray + aNullableEnum:(nullable FLTAnEnumBox *)aNullableEnum + anotherNullableEnum:(nullable FLTAnotherEnumBox *)anotherNullableEnum + aNullableString:(nullable NSString *)aNullableString + aNullableObject:(nullable id)aNullableObject + allNullableTypes:(nullable FLTAllNullableTypes *)allNullableTypes + list:(nullable NSArray *)list + stringList:(nullable NSArray *)stringList + intList:(nullable NSArray *)intList + doubleList:(nullable NSArray *)doubleList + boolList:(nullable NSArray *)boolList + enumList:(nullable NSArray *)enumList + objectList:(nullable NSArray *)objectList + listList:(nullable NSArray *> *)listList + mapList:(nullable NSArray *> *)mapList + recursiveClassList:(nullable NSArray *)recursiveClassList + map:(nullable NSDictionary *)map + stringMap:(nullable NSDictionary *)stringMap + intMap:(nullable NSDictionary *)intMap + enumMap:(nullable NSDictionary *)enumMap + objectMap:(nullable NSDictionary *)objectMap + listMap:(nullable NSDictionary *> *)listMap + mapMap:(nullable NSDictionary *> *)mapMap + recursiveClassMap: + (nullable NSDictionary *)recursiveClassMap; @property(nonatomic, strong, nullable) NSNumber *aNullableBool; @property(nonatomic, strong, nullable) NSNumber *aNullableInt; @property(nonatomic, strong, nullable) NSNumber *aNullableInt64; @@ -120,50 +155,65 @@ typedef NS_ENUM(NSUInteger, AnotherEnum) { @property(nonatomic, strong, nullable) FlutterStandardTypedData *aNullable4ByteArray; @property(nonatomic, strong, nullable) FlutterStandardTypedData *aNullable8ByteArray; @property(nonatomic, strong, nullable) FlutterStandardTypedData *aNullableFloatArray; -@property(nonatomic, copy, nullable) NSArray *> *nullableNestedList; -@property(nonatomic, copy, nullable) - NSDictionary *nullableMapWithAnnotations; -@property(nonatomic, copy, nullable) NSDictionary *nullableMapWithObject; -@property(nonatomic, strong, nullable) AnEnumBox *aNullableEnum; -@property(nonatomic, strong, nullable) AnotherEnumBox *anotherNullableEnum; +@property(nonatomic, strong, nullable) FLTAnEnumBox *aNullableEnum; +@property(nonatomic, strong, nullable) FLTAnotherEnumBox *anotherNullableEnum; @property(nonatomic, copy, nullable) NSString *aNullableString; @property(nonatomic, strong, nullable) id aNullableObject; -@property(nonatomic, strong, nullable) AllNullableTypes *allNullableTypes; +@property(nonatomic, strong, nullable) FLTAllNullableTypes *allNullableTypes; @property(nonatomic, copy, nullable) NSArray *list; @property(nonatomic, copy, nullable) NSArray *stringList; @property(nonatomic, copy, nullable) NSArray *intList; @property(nonatomic, copy, nullable) NSArray *doubleList; @property(nonatomic, copy, nullable) NSArray *boolList; -@property(nonatomic, copy, nullable) NSArray *nestedClassList; +@property(nonatomic, copy, nullable) NSArray *enumList; +@property(nonatomic, copy, nullable) NSArray *objectList; +@property(nonatomic, copy, nullable) NSArray *> *listList; +@property(nonatomic, copy, nullable) NSArray *> *mapList; +@property(nonatomic, copy, nullable) NSArray *recursiveClassList; @property(nonatomic, copy, nullable) NSDictionary *map; +@property(nonatomic, copy, nullable) NSDictionary *stringMap; +@property(nonatomic, copy, nullable) NSDictionary *intMap; +@property(nonatomic, copy, nullable) NSDictionary *enumMap; +@property(nonatomic, copy, nullable) NSDictionary *objectMap; +@property(nonatomic, copy, nullable) NSDictionary *> *listMap; +@property(nonatomic, copy, nullable) NSDictionary *> *mapMap; +@property(nonatomic, copy, nullable) + NSDictionary *recursiveClassMap; @end /// The primary purpose for this class is to ensure coverage of Swift structs /// with nullable items, as the primary [AllNullableTypes] class is being used to /// test Swift classes. -@interface AllNullableTypesWithoutRecursion : NSObject -+ (instancetype)makeWithANullableBool:(nullable NSNumber *)aNullableBool - aNullableInt:(nullable NSNumber *)aNullableInt - aNullableInt64:(nullable NSNumber *)aNullableInt64 - aNullableDouble:(nullable NSNumber *)aNullableDouble - aNullableByteArray:(nullable FlutterStandardTypedData *)aNullableByteArray - aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray - aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray - aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray - nullableNestedList:(nullable NSArray *> *)nullableNestedList - nullableMapWithAnnotations: - (nullable NSDictionary *)nullableMapWithAnnotations - nullableMapWithObject:(nullable NSDictionary *)nullableMapWithObject - aNullableEnum:(nullable AnEnumBox *)aNullableEnum - anotherNullableEnum:(nullable AnotherEnumBox *)anotherNullableEnum - aNullableString:(nullable NSString *)aNullableString - aNullableObject:(nullable id)aNullableObject - list:(nullable NSArray *)list - stringList:(nullable NSArray *)stringList - intList:(nullable NSArray *)intList - doubleList:(nullable NSArray *)doubleList - boolList:(nullable NSArray *)boolList - map:(nullable NSDictionary *)map; +@interface FLTAllNullableTypesWithoutRecursion : NSObject ++ (instancetype) + makeWithANullableBool:(nullable NSNumber *)aNullableBool + aNullableInt:(nullable NSNumber *)aNullableInt + aNullableInt64:(nullable NSNumber *)aNullableInt64 + aNullableDouble:(nullable NSNumber *)aNullableDouble + aNullableByteArray:(nullable FlutterStandardTypedData *)aNullableByteArray + aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray + aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray + aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray + aNullableEnum:(nullable FLTAnEnumBox *)aNullableEnum + anotherNullableEnum:(nullable FLTAnotherEnumBox *)anotherNullableEnum + aNullableString:(nullable NSString *)aNullableString + aNullableObject:(nullable id)aNullableObject + list:(nullable NSArray *)list + stringList:(nullable NSArray *)stringList + intList:(nullable NSArray *)intList + doubleList:(nullable NSArray *)doubleList + boolList:(nullable NSArray *)boolList + enumList:(nullable NSArray *)enumList + objectList:(nullable NSArray *)objectList + listList:(nullable NSArray *> *)listList + mapList:(nullable NSArray *> *)mapList + map:(nullable NSDictionary *)map + stringMap:(nullable NSDictionary *)stringMap + intMap:(nullable NSDictionary *)intMap + enumMap:(nullable NSDictionary *)enumMap + objectMap:(nullable NSDictionary *)objectMap + listMap:(nullable NSDictionary *> *)listMap + mapMap:(nullable NSDictionary *> *)mapMap; @property(nonatomic, strong, nullable) NSNumber *aNullableBool; @property(nonatomic, strong, nullable) NSNumber *aNullableInt; @property(nonatomic, strong, nullable) NSNumber *aNullableInt64; @@ -172,12 +222,8 @@ typedef NS_ENUM(NSUInteger, AnotherEnum) { @property(nonatomic, strong, nullable) FlutterStandardTypedData *aNullable4ByteArray; @property(nonatomic, strong, nullable) FlutterStandardTypedData *aNullable8ByteArray; @property(nonatomic, strong, nullable) FlutterStandardTypedData *aNullableFloatArray; -@property(nonatomic, copy, nullable) NSArray *> *nullableNestedList; -@property(nonatomic, copy, nullable) - NSDictionary *nullableMapWithAnnotations; -@property(nonatomic, copy, nullable) NSDictionary *nullableMapWithObject; -@property(nonatomic, strong, nullable) AnEnumBox *aNullableEnum; -@property(nonatomic, strong, nullable) AnotherEnumBox *anotherNullableEnum; +@property(nonatomic, strong, nullable) FLTAnEnumBox *aNullableEnum; +@property(nonatomic, strong, nullable) FLTAnotherEnumBox *anotherNullableEnum; @property(nonatomic, copy, nullable) NSString *aNullableString; @property(nonatomic, strong, nullable) id aNullableObject; @property(nonatomic, copy, nullable) NSArray *list; @@ -185,7 +231,17 @@ typedef NS_ENUM(NSUInteger, AnotherEnum) { @property(nonatomic, copy, nullable) NSArray *intList; @property(nonatomic, copy, nullable) NSArray *doubleList; @property(nonatomic, copy, nullable) NSArray *boolList; +@property(nonatomic, copy, nullable) NSArray *enumList; +@property(nonatomic, copy, nullable) NSArray *objectList; +@property(nonatomic, copy, nullable) NSArray *> *listList; +@property(nonatomic, copy, nullable) NSArray *> *mapList; @property(nonatomic, copy, nullable) NSDictionary *map; +@property(nonatomic, copy, nullable) NSDictionary *stringMap; +@property(nonatomic, copy, nullable) NSDictionary *intMap; +@property(nonatomic, copy, nullable) NSDictionary *enumMap; +@property(nonatomic, copy, nullable) NSDictionary *objectMap; +@property(nonatomic, copy, nullable) NSDictionary *> *listMap; +@property(nonatomic, copy, nullable) NSDictionary *> *mapMap; @end /// A class for testing nested class handling. @@ -193,39 +249,53 @@ typedef NS_ENUM(NSUInteger, AnotherEnum) { /// This is needed to test nested nullable and non-nullable classes, /// `AllNullableTypes` is non-nullable here as it is easier to instantiate /// than `AllTypes` when testing doesn't require both (ie. testing null classes). -@interface AllClassesWrapper : NSObject +@interface FLTAllClassesWrapper : NSObject /// `init` unavailable to enforce nonnull fields, see the `make` class method. - (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithAllNullableTypes:(AllNullableTypes *)allNullableTypes - allNullableTypesWithoutRecursion: - (nullable AllNullableTypesWithoutRecursion *)allNullableTypesWithoutRecursion - allTypes:(nullable AllTypes *)allTypes; -@property(nonatomic, strong) AllNullableTypes *allNullableTypes; ++ (instancetype) + makeWithAllNullableTypes:(FLTAllNullableTypes *)allNullableTypes + allNullableTypesWithoutRecursion: + (nullable FLTAllNullableTypesWithoutRecursion *)allNullableTypesWithoutRecursion + allTypes:(nullable FLTAllTypes *)allTypes + classList:(NSArray *)classList + nullableClassList: + (nullable NSArray *)nullableClassList + classMap:(NSDictionary *)classMap + nullableClassMap: + (nullable NSDictionary *) + nullableClassMap; +@property(nonatomic, strong) FLTAllNullableTypes *allNullableTypes; @property(nonatomic, strong, nullable) - AllNullableTypesWithoutRecursion *allNullableTypesWithoutRecursion; -@property(nonatomic, strong, nullable) AllTypes *allTypes; + FLTAllNullableTypesWithoutRecursion *allNullableTypesWithoutRecursion; +@property(nonatomic, strong, nullable) FLTAllTypes *allTypes; +@property(nonatomic, copy) NSArray *classList; +@property(nonatomic, copy, nullable) + NSArray *nullableClassList; +@property(nonatomic, copy) NSDictionary *classMap; +@property(nonatomic, copy, nullable) + NSDictionary *nullableClassMap; @end /// A data class containing a List, used in unit tests. -@interface TestMessage : NSObject +@interface FLTTestMessage : NSObject + (instancetype)makeWithTestList:(nullable NSArray *)testList; @property(nonatomic, copy, nullable) NSArray *testList; @end /// The codec used by all APIs. -NSObject *GetCoreTestsCodec(void); +NSObject *FLTGetCoreTestsCodec(void); /// The core interface that each host language plugin must implement in /// platform_test integration tests. -@protocol HostIntegrationCoreApi +@protocol FLTHostIntegrationCoreApi /// A no-op function taking no arguments and returning no value, to sanity /// test basic calling. - (void)noopWithError:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed object, to test serialization and deserialization. /// /// @return `nil` only when `error != nil`. -- (nullable AllTypes *)echoAllTypes:(AllTypes *)everything - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable FLTAllTypes *)echoAllTypes:(FLTAllTypes *)everything + error:(FlutterError *_Nullable *_Nonnull)error; /// Returns an error, to test error handling. - (nullable id)throwErrorWithError:(FlutterError *_Nullable *_Nonnull)error; /// Returns an error from a void function, to test error handling. @@ -263,25 +333,96 @@ NSObject *GetCoreTestsCodec(void); /// @return `nil` only when `error != nil`. - (nullable NSArray *)echoList:(NSArray *)list error:(FlutterError *_Nullable *_Nonnull)error; -/// Returns the passed map, to test serialization and deserialization. +/// Returns the passed list, to test serialization and deserialization. /// /// @return `nil` only when `error != nil`. -- (nullable NSDictionary *)echoMap:(NSDictionary *)aMap +- (nullable NSArray *)echoEnumList:(NSArray *)enumList error:(FlutterError *_Nullable *_Nonnull)error; -/// Returns the passed map to test nested class serialization and deserialization. +/// Returns the passed list, to test serialization and deserialization. /// /// @return `nil` only when `error != nil`. -- (nullable AllClassesWrapper *)echoClassWrapper:(AllClassesWrapper *)wrapper - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSArray *)echoClassList: + (NSArray *)classList + error:(FlutterError *_Nullable *_Nonnull)error; +/// Returns the passed list, to test serialization and deserialization. +/// +/// @return `nil` only when `error != nil`. +- (nullable NSArray *)echoNonNullEnumList:(NSArray *)enumList + error:(FlutterError *_Nullable *_Nonnull)error; +/// Returns the passed list, to test serialization and deserialization. +/// +/// @return `nil` only when `error != nil`. +- (nullable NSArray *) + echoNonNullClassList:(NSArray *)classList + error:(FlutterError *_Nullable *_Nonnull)error; +/// Returns the passed map, to test serialization and deserialization. +/// +/// @return `nil` only when `error != nil`. +- (nullable NSDictionary *)echoMap:(NSDictionary *)map + error:(FlutterError *_Nullable *_Nonnull)error; +/// Returns the passed map, to test serialization and deserialization. +/// +/// @return `nil` only when `error != nil`. +- (nullable NSDictionary *) + echoStringMap:(NSDictionary *)stringMap + error:(FlutterError *_Nullable *_Nonnull)error; +/// Returns the passed map, to test serialization and deserialization. +/// +/// @return `nil` only when `error != nil`. +- (nullable NSDictionary *) + echoIntMap:(NSDictionary *)intMap + error:(FlutterError *_Nullable *_Nonnull)error; +/// Returns the passed map, to test serialization and deserialization. +/// +/// @return `nil` only when `error != nil`. +- (nullable NSDictionary *) + echoEnumMap:(NSDictionary *)enumMap + error:(FlutterError *_Nullable *_Nonnull)error; +/// Returns the passed map, to test serialization and deserialization. +/// +/// @return `nil` only when `error != nil`. +- (nullable NSDictionary *) + echoClassMap:(NSDictionary *)classMap + error:(FlutterError *_Nullable *_Nonnull)error; +/// Returns the passed map, to test serialization and deserialization. +/// +/// @return `nil` only when `error != nil`. +- (nullable NSDictionary *) + echoNonNullStringMap:(NSDictionary *)stringMap + error:(FlutterError *_Nullable *_Nonnull)error; +/// Returns the passed map, to test serialization and deserialization. +/// +/// @return `nil` only when `error != nil`. +- (nullable NSDictionary *) + echoNonNullIntMap:(NSDictionary *)intMap + error:(FlutterError *_Nullable *_Nonnull)error; +/// Returns the passed map, to test serialization and deserialization. +/// +/// @return `nil` only when `error != nil`. +- (nullable NSDictionary *) + echoNonNullEnumMap:(NSDictionary *)enumMap + error:(FlutterError *_Nullable *_Nonnull)error; +/// Returns the passed map, to test serialization and deserialization. +/// +/// @return `nil` only when `error != nil`. +- (nullable NSDictionary *) + echoNonNullClassMap:(NSDictionary *)classMap + error:(FlutterError *_Nullable *_Nonnull)error; +/// Returns the passed class to test nested class serialization and deserialization. +/// +/// @return `nil` only when `error != nil`. +- (nullable FLTAllClassesWrapper *)echoClassWrapper:(FLTAllClassesWrapper *)wrapper + error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed enum to test serialization and deserialization. /// /// @return `nil` only when `error != nil`. -- (AnEnumBox *_Nullable)echoEnum:(AnEnum)anEnum error:(FlutterError *_Nullable *_Nonnull)error; +- (FLTAnEnumBox *_Nullable)echoEnum:(FLTAnEnum)anEnum + error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed enum to test serialization and deserialization. /// /// @return `nil` only when `error != nil`. -- (AnotherEnumBox *_Nullable)echoAnotherEnum:(AnotherEnum)anotherEnum - error:(FlutterError *_Nullable *_Nonnull)error; +- (FLTAnotherEnumBox *_Nullable)echoAnotherEnum:(FLTAnotherEnum)anotherEnum + error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the default string. /// /// @return `nil` only when `error != nil`. @@ -298,35 +439,35 @@ NSObject *GetCoreTestsCodec(void); - (nullable NSNumber *)echoRequiredInt:(NSInteger)anInt error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed object, to test serialization and deserialization. -- (nullable AllNullableTypes *)echoAllNullableTypes:(nullable AllNullableTypes *)everything - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable FLTAllNullableTypes *)echoAllNullableTypes:(nullable FLTAllNullableTypes *)everything + error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed object, to test serialization and deserialization. -- (nullable AllNullableTypesWithoutRecursion *) - echoAllNullableTypesWithoutRecursion:(nullable AllNullableTypesWithoutRecursion *)everything +- (nullable FLTAllNullableTypesWithoutRecursion *) + echoAllNullableTypesWithoutRecursion:(nullable FLTAllNullableTypesWithoutRecursion *)everything error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the inner `aString` value from the wrapped object, to test /// sending of nested objects. -- (nullable NSString *)extractNestedNullableStringFrom:(AllClassesWrapper *)wrapper +- (nullable NSString *)extractNestedNullableStringFrom:(FLTAllClassesWrapper *)wrapper error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the inner `aString` value from the wrapped object, to test /// sending of nested objects. /// /// @return `nil` only when `error != nil`. -- (nullable AllClassesWrapper *) +- (nullable FLTAllClassesWrapper *) createNestedObjectWithNullableString:(nullable NSString *)nullableString error:(FlutterError *_Nullable *_Nonnull)error; /// Returns passed in arguments of multiple types. /// /// @return `nil` only when `error != nil`. -- (nullable AllNullableTypes *)sendMultipleNullableTypesABool:(nullable NSNumber *)aNullableBool - anInt:(nullable NSNumber *)aNullableInt - aString:(nullable NSString *)aNullableString - error:(FlutterError *_Nullable *_Nonnull) - error; +- (nullable FLTAllNullableTypes *) + sendMultipleNullableTypesABool:(nullable NSNumber *)aNullableBool + anInt:(nullable NSNumber *)aNullableInt + aString:(nullable NSString *)aNullableString + error:(FlutterError *_Nullable *_Nonnull)error; /// Returns passed in arguments of multiple types. /// /// @return `nil` only when `error != nil`. -- (nullable AllNullableTypesWithoutRecursion *) +- (nullable FLTAllNullableTypesWithoutRecursion *) sendMultipleNullableTypesWithoutRecursionABool:(nullable NSNumber *)aNullableBool anInt:(nullable NSNumber *)aNullableInt aString:(nullable NSString *)aNullableString @@ -353,14 +494,62 @@ NSObject *GetCoreTestsCodec(void); /// Returns the passed list, to test serialization and deserialization. - (nullable NSArray *)echoNullableList:(nullable NSArray *)aNullableList error:(FlutterError *_Nullable *_Nonnull)error; -/// Returns the passed map, to test serialization and deserialization. -- (nullable NSDictionary *)echoNullableMap: - (nullable NSDictionary *)aNullableMap +/// Returns the passed list, to test serialization and deserialization. +- (nullable NSArray *)echoNullableEnumList: + (nullable NSArray *)enumList error:(FlutterError *_Nullable *_Nonnull)error; -- (AnEnumBox *_Nullable)echoNullableEnum:(nullable AnEnumBox *)anEnumBoxed - error:(FlutterError *_Nullable *_Nonnull)error; -- (AnotherEnumBox *_Nullable)echoAnotherNullableEnum:(nullable AnotherEnumBox *)anotherEnumBoxed - error:(FlutterError *_Nullable *_Nonnull)error; +/// Returns the passed list, to test serialization and deserialization. +- (nullable NSArray *) + echoNullableClassList:(nullable NSArray *)classList + error:(FlutterError *_Nullable *_Nonnull)error; +/// Returns the passed list, to test serialization and deserialization. +- (nullable NSArray *) + echoNullableNonNullEnumList:(nullable NSArray *)enumList + error:(FlutterError *_Nullable *_Nonnull)error; +/// Returns the passed list, to test serialization and deserialization. +- (nullable NSArray *) + echoNullableNonNullClassList:(nullable NSArray *)classList + error:(FlutterError *_Nullable *_Nonnull)error; +/// Returns the passed map, to test serialization and deserialization. +- (nullable NSDictionary *)echoNullableMap:(nullable NSDictionary *)map + error:(FlutterError *_Nullable *_Nonnull)error; +/// Returns the passed map, to test serialization and deserialization. +- (nullable NSDictionary *) + echoNullableStringMap:(nullable NSDictionary *)stringMap + error:(FlutterError *_Nullable *_Nonnull)error; +/// Returns the passed map, to test serialization and deserialization. +- (nullable NSDictionary *) + echoNullableIntMap:(nullable NSDictionary *)intMap + error:(FlutterError *_Nullable *_Nonnull)error; +/// Returns the passed map, to test serialization and deserialization. +- (nullable NSDictionary *) + echoNullableEnumMap:(nullable NSDictionary *)enumMap + error:(FlutterError *_Nullable *_Nonnull)error; +/// Returns the passed map, to test serialization and deserialization. +- (nullable NSDictionary *) + echoNullableClassMap:(nullable NSDictionary *)classMap + error:(FlutterError *_Nullable *_Nonnull)error; +/// Returns the passed map, to test serialization and deserialization. +- (nullable NSDictionary *) + echoNullableNonNullStringMap:(nullable NSDictionary *)stringMap + error:(FlutterError *_Nullable *_Nonnull)error; +/// Returns the passed map, to test serialization and deserialization. +- (nullable NSDictionary *) + echoNullableNonNullIntMap:(nullable NSDictionary *)intMap + error:(FlutterError *_Nullable *_Nonnull)error; +/// Returns the passed map, to test serialization and deserialization. +- (nullable NSDictionary *) + echoNullableNonNullEnumMap:(nullable NSDictionary *)enumMap + error:(FlutterError *_Nullable *_Nonnull)error; +/// Returns the passed map, to test serialization and deserialization. +- (nullable NSDictionary *) + echoNullableNonNullClassMap:(nullable NSDictionary *)classMap + error:(FlutterError *_Nullable *_Nonnull)error; +- (FLTAnEnumBox *_Nullable)echoNullableEnum:(nullable FLTAnEnumBox *)anEnumBoxed + error:(FlutterError *_Nullable *_Nonnull)error; +- (FLTAnotherEnumBox *_Nullable)echoAnotherNullableEnum: + (nullable FLTAnotherEnumBox *)anotherEnumBoxed + error:(FlutterError *_Nullable *_Nonnull)error; /// Returns passed in int. - (nullable NSNumber *)echoOptionalNullableInt:(nullable NSNumber *)aNullableInt error:(FlutterError *_Nullable *_Nonnull)error; @@ -392,17 +581,40 @@ NSObject *GetCoreTestsCodec(void); /// Returns the passed list, to test asynchronous serialization and deserialization. - (void)echoAsyncList:(NSArray *)list completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; +/// Returns the passed list, to test asynchronous serialization and deserialization. +- (void)echoAsyncEnumList:(NSArray *)enumList + completion:(void (^)(NSArray *_Nullable, + FlutterError *_Nullable))completion; +/// Returns the passed list, to test asynchronous serialization and deserialization. +- (void)echoAsyncClassList:(NSArray *)classList + completion:(void (^)(NSArray *_Nullable, + FlutterError *_Nullable))completion; /// Returns the passed map, to test asynchronous serialization and deserialization. -- (void)echoAsyncMap:(NSDictionary *)aMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion; +- (void)echoAsyncMap:(NSDictionary *)map + completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion; +/// Returns the passed map, to test asynchronous serialization and deserialization. +- (void)echoAsyncStringMap:(NSDictionary *)stringMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +/// Returns the passed map, to test asynchronous serialization and deserialization. +- (void)echoAsyncIntMap:(NSDictionary *)intMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +/// Returns the passed map, to test asynchronous serialization and deserialization. +- (void)echoAsyncEnumMap:(NSDictionary *)enumMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +/// Returns the passed map, to test asynchronous serialization and deserialization. +- (void)echoAsyncClassMap:(NSDictionary *)classMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; /// Returns the passed enum, to test asynchronous serialization and deserialization. -- (void)echoAsyncEnum:(AnEnum)anEnum - completion:(void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncEnum:(FLTAnEnum)anEnum + completion:(void (^)(FLTAnEnumBox *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed enum, to test asynchronous serialization and deserialization. -- (void)echoAnotherAsyncEnum:(AnotherEnum)anotherEnum +- (void)echoAnotherAsyncEnum:(FLTAnotherEnum)anotherEnum completion: - (void (^)(AnotherEnumBox *_Nullable, FlutterError *_Nullable))completion; + (void (^)(FLTAnotherEnumBox *_Nullable, FlutterError *_Nullable))completion; /// Responds with an error from an async function returning a value. - (void)throwAsyncErrorWithCompletion:(void (^)(id _Nullable, FlutterError *_Nullable))completion; /// Responds with an error from an async void function. @@ -411,19 +623,19 @@ NSObject *GetCoreTestsCodec(void); - (void)throwAsyncFlutterErrorWithCompletion:(void (^)(id _Nullable, FlutterError *_Nullable))completion; /// Returns the passed object, to test async serialization and deserialization. -- (void)echoAsyncAllTypes:(AllTypes *)everything - completion:(void (^)(AllTypes *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncAllTypes:(FLTAllTypes *)everything + completion:(void (^)(FLTAllTypes *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed object, to test serialization and deserialization. -- (void)echoAsyncNullableAllNullableTypes:(nullable AllNullableTypes *)everything - completion:(void (^)(AllNullableTypes *_Nullable, +- (void)echoAsyncNullableAllNullableTypes:(nullable FLTAllNullableTypes *)everything + completion:(void (^)(FLTAllNullableTypes *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed object, to test serialization and deserialization. - (void)echoAsyncNullableAllNullableTypesWithoutRecursion: - (nullable AllNullableTypesWithoutRecursion *)everything + (nullable FLTAllNullableTypesWithoutRecursion *)everything completion: - (void (^)( - AllNullableTypesWithoutRecursion *_Nullable, - FlutterError *_Nullable))completion; + (void (^)(FLTAllNullableTypesWithoutRecursion + *_Nullable, + FlutterError *_Nullable))completion; /// Returns passed in int asynchronously. - (void)echoAsyncNullableInt:(nullable NSNumber *)anInt completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; @@ -446,43 +658,70 @@ NSObject *GetCoreTestsCodec(void); /// Returns the passed list, to test asynchronous serialization and deserialization. - (void)echoAsyncNullableList:(nullable NSArray *)list completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; +/// Returns the passed list, to test asynchronous serialization and deserialization. +- (void)echoAsyncNullableEnumList:(nullable NSArray *)enumList + completion:(void (^)(NSArray *_Nullable, + FlutterError *_Nullable))completion; +/// Returns the passed list, to test asynchronous serialization and deserialization. +- (void)echoAsyncNullableClassList:(nullable NSArray *)classList + completion:(void (^)(NSArray *_Nullable, + FlutterError *_Nullable))completion; /// Returns the passed map, to test asynchronous serialization and deserialization. -- (void)echoAsyncNullableMap:(nullable NSDictionary *)aMap - completion:(void (^)(NSDictionary *_Nullable, +- (void)echoAsyncNullableMap:(nullable NSDictionary *)map + completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion; +/// Returns the passed map, to test asynchronous serialization and deserialization. +- (void)echoAsyncNullableStringMap:(nullable NSDictionary *)stringMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +/// Returns the passed map, to test asynchronous serialization and deserialization. +- (void)echoAsyncNullableIntMap:(nullable NSDictionary *)intMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +/// Returns the passed map, to test asynchronous serialization and deserialization. +- (void)echoAsyncNullableEnumMap:(nullable NSDictionary *)enumMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +/// Returns the passed map, to test asynchronous serialization and deserialization. +- (void) + echoAsyncNullableClassMap:(nullable NSDictionary *)classMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; /// Returns the passed enum, to test asynchronous serialization and deserialization. -- (void)echoAsyncNullableEnum:(nullable AnEnumBox *)anEnumBoxed - completion:(void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncNullableEnum:(nullable FLTAnEnumBox *)anEnumBoxed + completion: + (void (^)(FLTAnEnumBox *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed enum, to test asynchronous serialization and deserialization. -- (void)echoAnotherAsyncNullableEnum:(nullable AnotherEnumBox *)anotherEnumBoxed - completion:(void (^)(AnotherEnumBox *_Nullable, +- (void)echoAnotherAsyncNullableEnum:(nullable FLTAnotherEnumBox *)anotherEnumBoxed + completion:(void (^)(FLTAnotherEnumBox *_Nullable, FlutterError *_Nullable))completion; - (void)callFlutterNoopWithCompletion:(void (^)(FlutterError *_Nullable))completion; - (void)callFlutterThrowErrorWithCompletion:(void (^)(id _Nullable, FlutterError *_Nullable))completion; - (void)callFlutterThrowErrorFromVoidWithCompletion:(void (^)(FlutterError *_Nullable))completion; -- (void)callFlutterEchoAllTypes:(AllTypes *)everything - completion:(void (^)(AllTypes *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoAllNullableTypes:(nullable AllNullableTypes *)everything - completion:(void (^)(AllNullableTypes *_Nullable, +- (void)callFlutterEchoAllTypes:(FLTAllTypes *)everything + completion: + (void (^)(FLTAllTypes *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoAllNullableTypes:(nullable FLTAllNullableTypes *)everything + completion:(void (^)(FLTAllNullableTypes *_Nullable, FlutterError *_Nullable))completion; - (void)callFlutterSendMultipleNullableTypesABool:(nullable NSNumber *)aNullableBool anInt:(nullable NSNumber *)aNullableInt aString:(nullable NSString *)aNullableString - completion:(void (^)(AllNullableTypes *_Nullable, + completion:(void (^)(FLTAllNullableTypes *_Nullable, FlutterError *_Nullable))completion; -- (void) - callFlutterEchoAllNullableTypesWithoutRecursion: - (nullable AllNullableTypesWithoutRecursion *)everything - completion: - (void (^)(AllNullableTypesWithoutRecursion *_Nullable, - FlutterError *_Nullable))completion; +- (void)callFlutterEchoAllNullableTypesWithoutRecursion: + (nullable FLTAllNullableTypesWithoutRecursion *)everything + completion: + (void (^)( + FLTAllNullableTypesWithoutRecursion *_Nullable, + FlutterError *_Nullable))completion; - (void) callFlutterSendMultipleNullableTypesWithoutRecursionABool:(nullable NSNumber *)aNullableBool anInt:(nullable NSNumber *)aNullableInt aString:(nullable NSString *)aNullableString completion: - (void (^)(AllNullableTypesWithoutRecursion + (void (^)(FLTAllNullableTypesWithoutRecursion *_Nullable, FlutterError *_Nullable)) completion; @@ -499,13 +738,53 @@ NSObject *GetCoreTestsCodec(void); FlutterError *_Nullable))completion; - (void)callFlutterEchoList:(NSArray *)list completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoMap:(NSDictionary *)aMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion; -- (void)callFlutterEchoEnum:(AnEnum)anEnum - completion:(void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoAnotherEnum:(AnotherEnum)anotherEnum - completion:(void (^)(AnotherEnumBox *_Nullable, +- (void)callFlutterEchoEnumList:(NSArray *)enumList + completion:(void (^)(NSArray *_Nullable, + FlutterError *_Nullable))completion; +- (void)callFlutterEchoClassList:(NSArray *)classList + completion:(void (^)(NSArray *_Nullable, + FlutterError *_Nullable))completion; +- (void)callFlutterEchoNonNullEnumList:(NSArray *)enumList + completion:(void (^)(NSArray *_Nullable, + FlutterError *_Nullable))completion; +- (void)callFlutterEchoNonNullClassList:(NSArray *)classList + completion:(void (^)(NSArray *_Nullable, + FlutterError *_Nullable))completion; +- (void)callFlutterEchoMap:(NSDictionary *)map + completion: + (void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoStringMap:(NSDictionary *)stringMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +- (void)callFlutterEchoIntMap:(NSDictionary *)intMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +- (void)callFlutterEchoEnumMap:(NSDictionary *)enumMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +- (void)callFlutterEchoClassMap:(NSDictionary *)classMap + completion: + (void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +- (void)callFlutterEchoNonNullStringMap:(NSDictionary *)stringMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +- (void)callFlutterEchoNonNullIntMap:(NSDictionary *)intMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +- (void)callFlutterEchoNonNullEnumMap:(NSDictionary *)enumMap + completion: + (void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +- (void) + callFlutterEchoNonNullClassMap:(NSDictionary *)classMap + completion: + (void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +- (void)callFlutterEchoEnum:(FLTAnEnum)anEnum + completion:(void (^)(FLTAnEnumBox *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoAnotherEnum:(FLTAnotherEnum)anotherEnum + completion:(void (^)(FLTAnotherEnumBox *_Nullable, FlutterError *_Nullable))completion; - (void)callFlutterEchoNullableBool:(nullable NSNumber *)aBool completion: @@ -525,30 +804,80 @@ NSObject *GetCoreTestsCodec(void); - (void)callFlutterEchoNullableList:(nullable NSArray *)list completion: (void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoNullableMap:(nullable NSDictionary *)aMap - completion:(void (^)(NSDictionary *_Nullable, +- (void)callFlutterEchoNullableEnumList:(nullable NSArray *)enumList + completion:(void (^)(NSArray *_Nullable, + FlutterError *_Nullable))completion; +- (void)callFlutterEchoNullableClassList:(nullable NSArray *)classList + completion:(void (^)(NSArray *_Nullable, + FlutterError *_Nullable))completion; +- (void)callFlutterEchoNullableNonNullEnumList:(nullable NSArray *)enumList + completion:(void (^)(NSArray *_Nullable, + FlutterError *_Nullable))completion; +- (void)callFlutterEchoNullableNonNullClassList:(nullable NSArray *)classList + completion:(void (^)(NSArray *_Nullable, + FlutterError *_Nullable))completion; +- (void)callFlutterEchoNullableMap:(nullable NSDictionary *)map + completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoNullableEnum:(nullable AnEnumBox *)anEnumBoxed +- (void)callFlutterEchoNullableStringMap:(nullable NSDictionary *)stringMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +- (void)callFlutterEchoNullableIntMap:(nullable NSDictionary *)intMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +- (void)callFlutterEchoNullableEnumMap: + (nullable NSDictionary *)enumMap + completion: + (void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +- (void) + callFlutterEchoNullableClassMap: + (nullable NSDictionary *)classMap completion: - (void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoAnotherNullableEnum:(nullable AnotherEnumBox *)anotherEnumBoxed - completion:(void (^)(AnotherEnumBox *_Nullable, + (void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +- (void)callFlutterEchoNullableNonNullStringMap: + (nullable NSDictionary *)stringMap + completion: + (void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +- (void)callFlutterEchoNullableNonNullIntMap:(nullable NSDictionary *)intMap + completion: + (void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +- (void)callFlutterEchoNullableNonNullEnumMap: + (nullable NSDictionary *)enumMap + completion: + (void (^)( + NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +- (void)callFlutterEchoNullableNonNullClassMap: + (nullable NSDictionary *)classMap + completion: + (void (^)(NSDictionary + *_Nullable, + FlutterError *_Nullable))completion; +- (void)callFlutterEchoNullableEnum:(nullable FLTAnEnumBox *)anEnumBoxed + completion: + (void (^)(FLTAnEnumBox *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoAnotherNullableEnum:(nullable FLTAnotherEnumBox *)anotherEnumBoxed + completion:(void (^)(FLTAnotherEnumBox *_Nullable, FlutterError *_Nullable))completion; - (void)callFlutterSmallApiEchoString:(NSString *)aString completion: (void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; @end -extern void SetUpHostIntegrationCoreApi(id binaryMessenger, - NSObject *_Nullable api); +extern void SetUpFLTHostIntegrationCoreApi(id binaryMessenger, + NSObject *_Nullable api); -extern void SetUpHostIntegrationCoreApiWithSuffix(id binaryMessenger, - NSObject *_Nullable api, - NSString *messageChannelSuffix); +extern void SetUpFLTHostIntegrationCoreApiWithSuffix( + id binaryMessenger, NSObject *_Nullable api, + NSString *messageChannelSuffix); /// The core interface that the Dart platform_test code implements for host /// integration tests to call into. -@interface FlutterIntegrationCoreApi : NSObject +@interface FLTFlutterIntegrationCoreApi : NSObject - (instancetype)initWithBinaryMessenger:(id)binaryMessenger; - (instancetype)initWithBinaryMessenger:(id)binaryMessenger messageChannelSuffix:(nullable NSString *)messageChannelSuffix; @@ -560,34 +889,35 @@ extern void SetUpHostIntegrationCoreApiWithSuffix(id bin /// Responds with an error from an async void function. - (void)throwErrorFromVoidWithCompletion:(void (^)(FlutterError *_Nullable))completion; /// Returns the passed object, to test serialization and deserialization. -- (void)echoAllTypes:(AllTypes *)everything - completion:(void (^)(AllTypes *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAllTypes:(FLTAllTypes *)everything + completion:(void (^)(FLTAllTypes *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed object, to test serialization and deserialization. -- (void)echoAllNullableTypes:(nullable AllNullableTypes *)everything +- (void)echoAllNullableTypes:(nullable FLTAllNullableTypes *)everything completion: - (void (^)(AllNullableTypes *_Nullable, FlutterError *_Nullable))completion; + (void (^)(FLTAllNullableTypes *_Nullable, FlutterError *_Nullable))completion; /// Returns passed in arguments of multiple types. /// /// Tests multiple-arity FlutterApi handling. - (void)sendMultipleNullableTypesABool:(nullable NSNumber *)aNullableBool anInt:(nullable NSNumber *)aNullableInt aString:(nullable NSString *)aNullableString - completion:(void (^)(AllNullableTypes *_Nullable, + completion:(void (^)(FLTAllNullableTypes *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed object, to test serialization and deserialization. -- (void)echoAllNullableTypesWithoutRecursion:(nullable AllNullableTypesWithoutRecursion *)everything - completion:(void (^)(AllNullableTypesWithoutRecursion *_Nullable, - FlutterError *_Nullable))completion; +- (void) + echoAllNullableTypesWithoutRecursion:(nullable FLTAllNullableTypesWithoutRecursion *)everything + completion:(void (^)(FLTAllNullableTypesWithoutRecursion *_Nullable, + FlutterError *_Nullable))completion; /// Returns passed in arguments of multiple types. /// /// Tests multiple-arity FlutterApi handling. -- (void) - sendMultipleNullableTypesWithoutRecursionABool:(nullable NSNumber *)aNullableBool - anInt:(nullable NSNumber *)aNullableInt - aString:(nullable NSString *)aNullableString - completion: - (void (^)(AllNullableTypesWithoutRecursion *_Nullable, - FlutterError *_Nullable))completion; +- (void)sendMultipleNullableTypesWithoutRecursionABool:(nullable NSNumber *)aNullableBool + anInt:(nullable NSNumber *)aNullableInt + aString:(nullable NSString *)aNullableString + completion: + (void (^)( + FLTAllNullableTypesWithoutRecursion *_Nullable, + FlutterError *_Nullable))completion; /// Returns the passed boolean, to test serialization and deserialization. - (void)echoBool:(BOOL)aBool completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; @@ -607,16 +937,63 @@ extern void SetUpHostIntegrationCoreApiWithSuffix(id bin /// Returns the passed list, to test serialization and deserialization. - (void)echoList:(NSArray *)list completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; +/// Returns the passed list, to test serialization and deserialization. +- (void)echoEnumList:(NSArray *)enumList + completion: + (void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; +/// Returns the passed list, to test serialization and deserialization. +- (void)echoClassList:(NSArray *)classList + completion:(void (^)(NSArray *_Nullable, + FlutterError *_Nullable))completion; +/// Returns the passed list, to test serialization and deserialization. +- (void)echoNonNullEnumList:(NSArray *)enumList + completion:(void (^)(NSArray *_Nullable, + FlutterError *_Nullable))completion; +/// Returns the passed list, to test serialization and deserialization. +- (void)echoNonNullClassList:(NSArray *)classList + completion:(void (^)(NSArray *_Nullable, + FlutterError *_Nullable))completion; +/// Returns the passed map, to test serialization and deserialization. +- (void)echoMap:(NSDictionary *)map + completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion; +/// Returns the passed map, to test serialization and deserialization. +- (void)echoStringMap:(NSDictionary *)stringMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +/// Returns the passed map, to test serialization and deserialization. +- (void)echoIntMap:(NSDictionary *)intMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; /// Returns the passed map, to test serialization and deserialization. -- (void)echoMap:(NSDictionary *)aMap - completion: - (void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion; +- (void)echoEnumMap:(NSDictionary *)enumMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +/// Returns the passed map, to test serialization and deserialization. +- (void)echoClassMap:(NSDictionary *)classMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +/// Returns the passed map, to test serialization and deserialization. +- (void)echoNonNullStringMap:(NSDictionary *)stringMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +/// Returns the passed map, to test serialization and deserialization. +- (void)echoNonNullIntMap:(NSDictionary *)intMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +/// Returns the passed map, to test serialization and deserialization. +- (void)echoNonNullEnumMap:(NSDictionary *)enumMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +/// Returns the passed map, to test serialization and deserialization. +- (void)echoNonNullClassMap:(NSDictionary *)classMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; /// Returns the passed enum to test serialization and deserialization. -- (void)echoEnum:(AnEnum)anEnum - completion:(void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion; +- (void)echoEnum:(FLTAnEnum)anEnum + completion:(void (^)(FLTAnEnumBox *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed enum to test serialization and deserialization. -- (void)echoAnotherEnum:(AnotherEnum)anotherEnum - completion:(void (^)(AnotherEnumBox *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAnotherEnum:(FLTAnotherEnum)anotherEnum + completion:(void (^)(FLTAnotherEnumBox *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed boolean, to test serialization and deserialization. - (void)echoNullableBool:(nullable NSNumber *)aBool completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; @@ -636,17 +1013,68 @@ extern void SetUpHostIntegrationCoreApiWithSuffix(id bin /// Returns the passed list, to test serialization and deserialization. - (void)echoNullableList:(nullable NSArray *)list completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; +/// Returns the passed list, to test serialization and deserialization. +- (void)echoNullableEnumList:(nullable NSArray *)enumList + completion:(void (^)(NSArray *_Nullable, + FlutterError *_Nullable))completion; +/// Returns the passed list, to test serialization and deserialization. +- (void)echoNullableClassList:(nullable NSArray *)classList + completion:(void (^)(NSArray *_Nullable, + FlutterError *_Nullable))completion; +/// Returns the passed list, to test serialization and deserialization. +- (void)echoNullableNonNullEnumList:(nullable NSArray *)enumList + completion:(void (^)(NSArray *_Nullable, + FlutterError *_Nullable))completion; +/// Returns the passed list, to test serialization and deserialization. +- (void)echoNullableNonNullClassList:(nullable NSArray *)classList + completion:(void (^)(NSArray *_Nullable, + FlutterError *_Nullable))completion; /// Returns the passed map, to test serialization and deserialization. -- (void)echoNullableMap:(nullable NSDictionary *)aMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion; +- (void)echoNullableMap:(nullable NSDictionary *)map + completion: + (void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion; +/// Returns the passed map, to test serialization and deserialization. +- (void)echoNullableStringMap:(nullable NSDictionary *)stringMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +/// Returns the passed map, to test serialization and deserialization. +- (void)echoNullableIntMap:(nullable NSDictionary *)intMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +/// Returns the passed map, to test serialization and deserialization. +- (void)echoNullableEnumMap:(nullable NSDictionary *)enumMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +/// Returns the passed map, to test serialization and deserialization. +- (void)echoNullableClassMap:(nullable NSDictionary *)classMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +/// Returns the passed map, to test serialization and deserialization. +- (void)echoNullableNonNullStringMap:(nullable NSDictionary *)stringMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +/// Returns the passed map, to test serialization and deserialization. +- (void)echoNullableNonNullIntMap:(nullable NSDictionary *)intMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +/// Returns the passed map, to test serialization and deserialization. +- (void)echoNullableNonNullEnumMap:(nullable NSDictionary *)enumMap + completion: + (void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +/// Returns the passed map, to test serialization and deserialization. +- (void)echoNullableNonNullClassMap: + (nullable NSDictionary *)classMap + completion: + (void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; /// Returns the passed enum to test serialization and deserialization. -- (void)echoNullableEnum:(nullable AnEnumBox *)anEnumBoxed - completion:(void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion; +- (void)echoNullableEnum:(nullable FLTAnEnumBox *)anEnumBoxed + completion:(void (^)(FLTAnEnumBox *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed enum to test serialization and deserialization. -- (void)echoAnotherNullableEnum:(nullable AnotherEnumBox *)anotherEnumBoxed - completion: - (void (^)(AnotherEnumBox *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAnotherNullableEnum:(nullable FLTAnotherEnumBox *)anotherEnumBoxed + completion:(void (^)(FLTAnotherEnumBox *_Nullable, + FlutterError *_Nullable))completion; /// A no-op function taking no arguments and returning no value, to sanity /// test basic asynchronous calling. - (void)noopAsyncWithCompletion:(void (^)(FlutterError *_Nullable))completion; @@ -656,38 +1084,38 @@ extern void SetUpHostIntegrationCoreApiWithSuffix(id bin @end /// An API that can be implemented for minimal, compile-only tests. -@protocol HostTrivialApi +@protocol FLTHostTrivialApi - (void)noopWithError:(FlutterError *_Nullable *_Nonnull)error; @end -extern void SetUpHostTrivialApi(id binaryMessenger, - NSObject *_Nullable api); +extern void SetUpFLTHostTrivialApi(id binaryMessenger, + NSObject *_Nullable api); -extern void SetUpHostTrivialApiWithSuffix(id binaryMessenger, - NSObject *_Nullable api, - NSString *messageChannelSuffix); +extern void SetUpFLTHostTrivialApiWithSuffix(id binaryMessenger, + NSObject *_Nullable api, + NSString *messageChannelSuffix); /// A simple API implemented in some unit tests. -@protocol HostSmallApi +@protocol FLTHostSmallApi - (void)echoString:(NSString *)aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; - (void)voidVoidWithCompletion:(void (^)(FlutterError *_Nullable))completion; @end -extern void SetUpHostSmallApi(id binaryMessenger, - NSObject *_Nullable api); +extern void SetUpFLTHostSmallApi(id binaryMessenger, + NSObject *_Nullable api); -extern void SetUpHostSmallApiWithSuffix(id binaryMessenger, - NSObject *_Nullable api, - NSString *messageChannelSuffix); +extern void SetUpFLTHostSmallApiWithSuffix(id binaryMessenger, + NSObject *_Nullable api, + NSString *messageChannelSuffix); /// A simple API called in some unit tests. -@interface FlutterSmallApi : NSObject +@interface FLTFlutterSmallApi : NSObject - (instancetype)initWithBinaryMessenger:(id)binaryMessenger; - (instancetype)initWithBinaryMessenger:(id)binaryMessenger messageChannelSuffix:(nullable NSString *)messageChannelSuffix; -- (void)echoWrappedList:(TestMessage *)msg - completion:(void (^)(TestMessage *_Nullable, FlutterError *_Nullable))completion; +- (void)echoWrappedList:(FLTTestMessage *)msg + completion:(void (^)(FLTTestMessage *_Nullable, FlutterError *_Nullable))completion; - (void)echoString:(NSString *)aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; @end diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/Classes/CoreTests.gen.m b/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/Classes/CoreTests.gen.m index 78b333c21a9f..2cc3da7877d8 100644 --- a/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/Classes/CoreTests.gen.m +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/Classes/CoreTests.gen.m @@ -40,8 +40,8 @@ static id GetNullableObjectAtIndex(NSArray *array, NSInteger key) { return (result == [NSNull null]) ? nil : result; } -@implementation AnEnumBox -- (instancetype)initWithValue:(AnEnum)value { +@implementation FLTAnEnumBox +- (instancetype)initWithValue:(FLTAnEnum)value { self = [super init]; if (self) { _value = value; @@ -50,8 +50,8 @@ - (instancetype)initWithValue:(AnEnum)value { } @end -@implementation AnotherEnumBox -- (instancetype)initWithValue:(AnotherEnum)value { +@implementation FLTAnotherEnumBox +- (instancetype)initWithValue:(FLTAnotherEnum)value { self = [super init]; if (self) { _value = value; @@ -60,37 +60,64 @@ - (instancetype)initWithValue:(AnotherEnum)value { } @end -@interface AllTypes () -+ (AllTypes *)fromList:(NSArray *)list; -+ (nullable AllTypes *)nullableFromList:(NSArray *)list; +@interface FLTUnusedClass () ++ (FLTUnusedClass *)fromList:(NSArray *)list; ++ (nullable FLTUnusedClass *)nullableFromList:(NSArray *)list; - (NSArray *)toList; @end -@interface AllNullableTypes () -+ (AllNullableTypes *)fromList:(NSArray *)list; -+ (nullable AllNullableTypes *)nullableFromList:(NSArray *)list; +@interface FLTAllTypes () ++ (FLTAllTypes *)fromList:(NSArray *)list; ++ (nullable FLTAllTypes *)nullableFromList:(NSArray *)list; - (NSArray *)toList; @end -@interface AllNullableTypesWithoutRecursion () -+ (AllNullableTypesWithoutRecursion *)fromList:(NSArray *)list; -+ (nullable AllNullableTypesWithoutRecursion *)nullableFromList:(NSArray *)list; +@interface FLTAllNullableTypes () ++ (FLTAllNullableTypes *)fromList:(NSArray *)list; ++ (nullable FLTAllNullableTypes *)nullableFromList:(NSArray *)list; - (NSArray *)toList; @end -@interface AllClassesWrapper () -+ (AllClassesWrapper *)fromList:(NSArray *)list; -+ (nullable AllClassesWrapper *)nullableFromList:(NSArray *)list; +@interface FLTAllNullableTypesWithoutRecursion () ++ (FLTAllNullableTypesWithoutRecursion *)fromList:(NSArray *)list; ++ (nullable FLTAllNullableTypesWithoutRecursion *)nullableFromList:(NSArray *)list; - (NSArray *)toList; @end -@interface TestMessage () -+ (TestMessage *)fromList:(NSArray *)list; -+ (nullable TestMessage *)nullableFromList:(NSArray *)list; +@interface FLTAllClassesWrapper () ++ (FLTAllClassesWrapper *)fromList:(NSArray *)list; ++ (nullable FLTAllClassesWrapper *)nullableFromList:(NSArray *)list; - (NSArray *)toList; @end -@implementation AllTypes +@interface FLTTestMessage () ++ (FLTTestMessage *)fromList:(NSArray *)list; ++ (nullable FLTTestMessage *)nullableFromList:(NSArray *)list; +- (NSArray *)toList; +@end + +@implementation FLTUnusedClass ++ (instancetype)makeWithAField:(nullable id)aField { + FLTUnusedClass *pigeonResult = [[FLTUnusedClass alloc] init]; + pigeonResult.aField = aField; + return pigeonResult; +} ++ (FLTUnusedClass *)fromList:(NSArray *)list { + FLTUnusedClass *pigeonResult = [[FLTUnusedClass alloc] init]; + pigeonResult.aField = GetNullableObjectAtIndex(list, 0); + return pigeonResult; +} ++ (nullable FLTUnusedClass *)nullableFromList:(NSArray *)list { + return (list) ? [FLTUnusedClass fromList:list] : nil; +} +- (NSArray *)toList { + return @[ + self.aField ?: [NSNull null], + ]; +} +@end + +@implementation FLTAllTypes + (instancetype)makeWithABool:(BOOL)aBool anInt:(NSInteger)anInt anInt64:(NSInteger)anInt64 @@ -99,8 +126,8 @@ + (instancetype)makeWithABool:(BOOL)aBool a4ByteArray:(FlutterStandardTypedData *)a4ByteArray a8ByteArray:(FlutterStandardTypedData *)a8ByteArray aFloatArray:(FlutterStandardTypedData *)aFloatArray - anEnum:(AnEnum)anEnum - anotherEnum:(AnotherEnum)anotherEnum + anEnum:(FLTAnEnum)anEnum + anotherEnum:(FLTAnotherEnum)anotherEnum aString:(NSString *)aString anObject:(id)anObject list:(NSArray *)list @@ -108,8 +135,18 @@ + (instancetype)makeWithABool:(BOOL)aBool intList:(NSArray *)intList doubleList:(NSArray *)doubleList boolList:(NSArray *)boolList - map:(NSDictionary *)map { - AllTypes *pigeonResult = [[AllTypes alloc] init]; + enumList:(NSArray *)enumList + objectList:(NSArray *)objectList + listList:(NSArray *> *)listList + mapList:(NSArray *> *)mapList + map:(NSDictionary *)map + stringMap:(NSDictionary *)stringMap + intMap:(NSDictionary *)intMap + enumMap:(NSDictionary *)enumMap + objectMap:(NSDictionary *)objectMap + listMap:(NSDictionary *> *)listMap + mapMap:(NSDictionary *> *)mapMap { + FLTAllTypes *pigeonResult = [[FLTAllTypes alloc] init]; pigeonResult.aBool = aBool; pigeonResult.anInt = anInt; pigeonResult.anInt64 = anInt64; @@ -127,11 +164,21 @@ + (instancetype)makeWithABool:(BOOL)aBool pigeonResult.intList = intList; pigeonResult.doubleList = doubleList; pigeonResult.boolList = boolList; + pigeonResult.enumList = enumList; + pigeonResult.objectList = objectList; + pigeonResult.listList = listList; + pigeonResult.mapList = mapList; pigeonResult.map = map; + pigeonResult.stringMap = stringMap; + pigeonResult.intMap = intMap; + pigeonResult.enumMap = enumMap; + pigeonResult.objectMap = objectMap; + pigeonResult.listMap = listMap; + pigeonResult.mapMap = mapMap; return pigeonResult; } -+ (AllTypes *)fromList:(NSArray *)list { - AllTypes *pigeonResult = [[AllTypes alloc] init]; ++ (FLTAllTypes *)fromList:(NSArray *)list { + FLTAllTypes *pigeonResult = [[FLTAllTypes alloc] init]; pigeonResult.aBool = [GetNullableObjectAtIndex(list, 0) boolValue]; pigeonResult.anInt = [GetNullableObjectAtIndex(list, 1) integerValue]; pigeonResult.anInt64 = [GetNullableObjectAtIndex(list, 2) integerValue]; @@ -140,10 +187,10 @@ + (AllTypes *)fromList:(NSArray *)list { pigeonResult.a4ByteArray = GetNullableObjectAtIndex(list, 5); pigeonResult.a8ByteArray = GetNullableObjectAtIndex(list, 6); pigeonResult.aFloatArray = GetNullableObjectAtIndex(list, 7); - AnEnumBox *boxedAnEnum = GetNullableObjectAtIndex(list, 8); - pigeonResult.anEnum = boxedAnEnum.value; - AnotherEnumBox *boxedAnotherEnum = GetNullableObjectAtIndex(list, 9); - pigeonResult.anotherEnum = boxedAnotherEnum.value; + FLTAnEnumBox *boxedFLTAnEnum = GetNullableObjectAtIndex(list, 8); + pigeonResult.anEnum = boxedFLTAnEnum.value; + FLTAnotherEnumBox *boxedFLTAnotherEnum = GetNullableObjectAtIndex(list, 9); + pigeonResult.anotherEnum = boxedFLTAnotherEnum.value; pigeonResult.aString = GetNullableObjectAtIndex(list, 10); pigeonResult.anObject = GetNullableObjectAtIndex(list, 11); pigeonResult.list = GetNullableObjectAtIndex(list, 12); @@ -151,11 +198,21 @@ + (AllTypes *)fromList:(NSArray *)list { pigeonResult.intList = GetNullableObjectAtIndex(list, 14); pigeonResult.doubleList = GetNullableObjectAtIndex(list, 15); pigeonResult.boolList = GetNullableObjectAtIndex(list, 16); - pigeonResult.map = GetNullableObjectAtIndex(list, 17); + pigeonResult.enumList = GetNullableObjectAtIndex(list, 17); + pigeonResult.objectList = GetNullableObjectAtIndex(list, 18); + pigeonResult.listList = GetNullableObjectAtIndex(list, 19); + pigeonResult.mapList = GetNullableObjectAtIndex(list, 20); + pigeonResult.map = GetNullableObjectAtIndex(list, 21); + pigeonResult.stringMap = GetNullableObjectAtIndex(list, 22); + pigeonResult.intMap = GetNullableObjectAtIndex(list, 23); + pigeonResult.enumMap = GetNullableObjectAtIndex(list, 24); + pigeonResult.objectMap = GetNullableObjectAtIndex(list, 25); + pigeonResult.listMap = GetNullableObjectAtIndex(list, 26); + pigeonResult.mapMap = GetNullableObjectAtIndex(list, 27); return pigeonResult; } -+ (nullable AllTypes *)nullableFromList:(NSArray *)list { - return (list) ? [AllTypes fromList:list] : nil; ++ (nullable FLTAllTypes *)nullableFromList:(NSArray *)list { + return (list) ? [FLTAllTypes fromList:list] : nil; } - (NSArray *)toList { return @[ @@ -167,8 +224,8 @@ + (nullable AllTypes *)nullableFromList:(NSArray *)list { self.a4ByteArray ?: [NSNull null], self.a8ByteArray ?: [NSNull null], self.aFloatArray ?: [NSNull null], - [[AnEnumBox alloc] initWithValue:self.anEnum], - [[AnotherEnumBox alloc] initWithValue:self.anotherEnum], + [[FLTAnEnumBox alloc] initWithValue:self.anEnum], + [[FLTAnotherEnumBox alloc] initWithValue:self.anotherEnum], self.aString ?: [NSNull null], self.anObject ?: [NSNull null], self.list ?: [NSNull null], @@ -176,37 +233,56 @@ + (nullable AllTypes *)nullableFromList:(NSArray *)list { self.intList ?: [NSNull null], self.doubleList ?: [NSNull null], self.boolList ?: [NSNull null], + self.enumList ?: [NSNull null], + self.objectList ?: [NSNull null], + self.listList ?: [NSNull null], + self.mapList ?: [NSNull null], self.map ?: [NSNull null], + self.stringMap ?: [NSNull null], + self.intMap ?: [NSNull null], + self.enumMap ?: [NSNull null], + self.objectMap ?: [NSNull null], + self.listMap ?: [NSNull null], + self.mapMap ?: [NSNull null], ]; } @end -@implementation AllNullableTypes -+ (instancetype)makeWithANullableBool:(nullable NSNumber *)aNullableBool - aNullableInt:(nullable NSNumber *)aNullableInt - aNullableInt64:(nullable NSNumber *)aNullableInt64 - aNullableDouble:(nullable NSNumber *)aNullableDouble - aNullableByteArray:(nullable FlutterStandardTypedData *)aNullableByteArray - aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray - aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray - aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray - nullableNestedList:(nullable NSArray *> *)nullableNestedList - nullableMapWithAnnotations: - (nullable NSDictionary *)nullableMapWithAnnotations - nullableMapWithObject:(nullable NSDictionary *)nullableMapWithObject - aNullableEnum:(nullable AnEnumBox *)aNullableEnum - anotherNullableEnum:(nullable AnotherEnumBox *)anotherNullableEnum - aNullableString:(nullable NSString *)aNullableString - aNullableObject:(nullable id)aNullableObject - allNullableTypes:(nullable AllNullableTypes *)allNullableTypes - list:(nullable NSArray *)list - stringList:(nullable NSArray *)stringList - intList:(nullable NSArray *)intList - doubleList:(nullable NSArray *)doubleList - boolList:(nullable NSArray *)boolList - nestedClassList:(nullable NSArray *)nestedClassList - map:(nullable NSDictionary *)map { - AllNullableTypes *pigeonResult = [[AllNullableTypes alloc] init]; +@implementation FLTAllNullableTypes ++ (instancetype) + makeWithANullableBool:(nullable NSNumber *)aNullableBool + aNullableInt:(nullable NSNumber *)aNullableInt + aNullableInt64:(nullable NSNumber *)aNullableInt64 + aNullableDouble:(nullable NSNumber *)aNullableDouble + aNullableByteArray:(nullable FlutterStandardTypedData *)aNullableByteArray + aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray + aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray + aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray + aNullableEnum:(nullable FLTAnEnumBox *)aNullableEnum + anotherNullableEnum:(nullable FLTAnotherEnumBox *)anotherNullableEnum + aNullableString:(nullable NSString *)aNullableString + aNullableObject:(nullable id)aNullableObject + allNullableTypes:(nullable FLTAllNullableTypes *)allNullableTypes + list:(nullable NSArray *)list + stringList:(nullable NSArray *)stringList + intList:(nullable NSArray *)intList + doubleList:(nullable NSArray *)doubleList + boolList:(nullable NSArray *)boolList + enumList:(nullable NSArray *)enumList + objectList:(nullable NSArray *)objectList + listList:(nullable NSArray *> *)listList + mapList:(nullable NSArray *> *)mapList + recursiveClassList:(nullable NSArray *)recursiveClassList + map:(nullable NSDictionary *)map + stringMap:(nullable NSDictionary *)stringMap + intMap:(nullable NSDictionary *)intMap + enumMap:(nullable NSDictionary *)enumMap + objectMap:(nullable NSDictionary *)objectMap + listMap:(nullable NSDictionary *> *)listMap + mapMap:(nullable NSDictionary *> *)mapMap + recursiveClassMap: + (nullable NSDictionary *)recursiveClassMap { + FLTAllNullableTypes *pigeonResult = [[FLTAllNullableTypes alloc] init]; pigeonResult.aNullableBool = aNullableBool; pigeonResult.aNullableInt = aNullableInt; pigeonResult.aNullableInt64 = aNullableInt64; @@ -215,9 +291,6 @@ + (instancetype)makeWithANullableBool:(nullable NSNumber *)aNullableBool pigeonResult.aNullable4ByteArray = aNullable4ByteArray; pigeonResult.aNullable8ByteArray = aNullable8ByteArray; pigeonResult.aNullableFloatArray = aNullableFloatArray; - pigeonResult.nullableNestedList = nullableNestedList; - pigeonResult.nullableMapWithAnnotations = nullableMapWithAnnotations; - pigeonResult.nullableMapWithObject = nullableMapWithObject; pigeonResult.aNullableEnum = aNullableEnum; pigeonResult.anotherNullableEnum = anotherNullableEnum; pigeonResult.aNullableString = aNullableString; @@ -228,12 +301,23 @@ + (instancetype)makeWithANullableBool:(nullable NSNumber *)aNullableBool pigeonResult.intList = intList; pigeonResult.doubleList = doubleList; pigeonResult.boolList = boolList; - pigeonResult.nestedClassList = nestedClassList; + pigeonResult.enumList = enumList; + pigeonResult.objectList = objectList; + pigeonResult.listList = listList; + pigeonResult.mapList = mapList; + pigeonResult.recursiveClassList = recursiveClassList; pigeonResult.map = map; + pigeonResult.stringMap = stringMap; + pigeonResult.intMap = intMap; + pigeonResult.enumMap = enumMap; + pigeonResult.objectMap = objectMap; + pigeonResult.listMap = listMap; + pigeonResult.mapMap = mapMap; + pigeonResult.recursiveClassMap = recursiveClassMap; return pigeonResult; } -+ (AllNullableTypes *)fromList:(NSArray *)list { - AllNullableTypes *pigeonResult = [[AllNullableTypes alloc] init]; ++ (FLTAllNullableTypes *)fromList:(NSArray *)list { + FLTAllNullableTypes *pigeonResult = [[FLTAllNullableTypes alloc] init]; pigeonResult.aNullableBool = GetNullableObjectAtIndex(list, 0); pigeonResult.aNullableInt = GetNullableObjectAtIndex(list, 1); pigeonResult.aNullableInt64 = GetNullableObjectAtIndex(list, 2); @@ -242,25 +326,33 @@ + (AllNullableTypes *)fromList:(NSArray *)list { pigeonResult.aNullable4ByteArray = GetNullableObjectAtIndex(list, 5); pigeonResult.aNullable8ByteArray = GetNullableObjectAtIndex(list, 6); pigeonResult.aNullableFloatArray = GetNullableObjectAtIndex(list, 7); - pigeonResult.nullableNestedList = GetNullableObjectAtIndex(list, 8); - pigeonResult.nullableMapWithAnnotations = GetNullableObjectAtIndex(list, 9); - pigeonResult.nullableMapWithObject = GetNullableObjectAtIndex(list, 10); - pigeonResult.aNullableEnum = GetNullableObjectAtIndex(list, 11); - pigeonResult.anotherNullableEnum = GetNullableObjectAtIndex(list, 12); - pigeonResult.aNullableString = GetNullableObjectAtIndex(list, 13); - pigeonResult.aNullableObject = GetNullableObjectAtIndex(list, 14); - pigeonResult.allNullableTypes = GetNullableObjectAtIndex(list, 15); - pigeonResult.list = GetNullableObjectAtIndex(list, 16); - pigeonResult.stringList = GetNullableObjectAtIndex(list, 17); - pigeonResult.intList = GetNullableObjectAtIndex(list, 18); - pigeonResult.doubleList = GetNullableObjectAtIndex(list, 19); - pigeonResult.boolList = GetNullableObjectAtIndex(list, 20); - pigeonResult.nestedClassList = GetNullableObjectAtIndex(list, 21); - pigeonResult.map = GetNullableObjectAtIndex(list, 22); + pigeonResult.aNullableEnum = GetNullableObjectAtIndex(list, 8); + pigeonResult.anotherNullableEnum = GetNullableObjectAtIndex(list, 9); + pigeonResult.aNullableString = GetNullableObjectAtIndex(list, 10); + pigeonResult.aNullableObject = GetNullableObjectAtIndex(list, 11); + pigeonResult.allNullableTypes = GetNullableObjectAtIndex(list, 12); + pigeonResult.list = GetNullableObjectAtIndex(list, 13); + pigeonResult.stringList = GetNullableObjectAtIndex(list, 14); + pigeonResult.intList = GetNullableObjectAtIndex(list, 15); + pigeonResult.doubleList = GetNullableObjectAtIndex(list, 16); + pigeonResult.boolList = GetNullableObjectAtIndex(list, 17); + pigeonResult.enumList = GetNullableObjectAtIndex(list, 18); + pigeonResult.objectList = GetNullableObjectAtIndex(list, 19); + pigeonResult.listList = GetNullableObjectAtIndex(list, 20); + pigeonResult.mapList = GetNullableObjectAtIndex(list, 21); + pigeonResult.recursiveClassList = GetNullableObjectAtIndex(list, 22); + pigeonResult.map = GetNullableObjectAtIndex(list, 23); + pigeonResult.stringMap = GetNullableObjectAtIndex(list, 24); + pigeonResult.intMap = GetNullableObjectAtIndex(list, 25); + pigeonResult.enumMap = GetNullableObjectAtIndex(list, 26); + pigeonResult.objectMap = GetNullableObjectAtIndex(list, 27); + pigeonResult.listMap = GetNullableObjectAtIndex(list, 28); + pigeonResult.mapMap = GetNullableObjectAtIndex(list, 29); + pigeonResult.recursiveClassMap = GetNullableObjectAtIndex(list, 30); return pigeonResult; } -+ (nullable AllNullableTypes *)nullableFromList:(NSArray *)list { - return (list) ? [AllNullableTypes fromList:list] : nil; ++ (nullable FLTAllNullableTypes *)nullableFromList:(NSArray *)list { + return (list) ? [FLTAllNullableTypes fromList:list] : nil; } - (NSArray *)toList { return @[ @@ -272,9 +364,6 @@ + (nullable AllNullableTypes *)nullableFromList:(NSArray *)list { self.aNullable4ByteArray ?: [NSNull null], self.aNullable8ByteArray ?: [NSNull null], self.aNullableFloatArray ?: [NSNull null], - self.nullableNestedList ?: [NSNull null], - self.nullableMapWithAnnotations ?: [NSNull null], - self.nullableMapWithObject ?: [NSNull null], self.aNullableEnum ?: [NSNull null], self.anotherNullableEnum ?: [NSNull null], self.aNullableString ?: [NSNull null], @@ -285,36 +374,55 @@ + (nullable AllNullableTypes *)nullableFromList:(NSArray *)list { self.intList ?: [NSNull null], self.doubleList ?: [NSNull null], self.boolList ?: [NSNull null], - self.nestedClassList ?: [NSNull null], + self.enumList ?: [NSNull null], + self.objectList ?: [NSNull null], + self.listList ?: [NSNull null], + self.mapList ?: [NSNull null], + self.recursiveClassList ?: [NSNull null], self.map ?: [NSNull null], + self.stringMap ?: [NSNull null], + self.intMap ?: [NSNull null], + self.enumMap ?: [NSNull null], + self.objectMap ?: [NSNull null], + self.listMap ?: [NSNull null], + self.mapMap ?: [NSNull null], + self.recursiveClassMap ?: [NSNull null], ]; } @end -@implementation AllNullableTypesWithoutRecursion -+ (instancetype)makeWithANullableBool:(nullable NSNumber *)aNullableBool - aNullableInt:(nullable NSNumber *)aNullableInt - aNullableInt64:(nullable NSNumber *)aNullableInt64 - aNullableDouble:(nullable NSNumber *)aNullableDouble - aNullableByteArray:(nullable FlutterStandardTypedData *)aNullableByteArray - aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray - aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray - aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray - nullableNestedList:(nullable NSArray *> *)nullableNestedList - nullableMapWithAnnotations: - (nullable NSDictionary *)nullableMapWithAnnotations - nullableMapWithObject:(nullable NSDictionary *)nullableMapWithObject - aNullableEnum:(nullable AnEnumBox *)aNullableEnum - anotherNullableEnum:(nullable AnotherEnumBox *)anotherNullableEnum - aNullableString:(nullable NSString *)aNullableString - aNullableObject:(nullable id)aNullableObject - list:(nullable NSArray *)list - stringList:(nullable NSArray *)stringList - intList:(nullable NSArray *)intList - doubleList:(nullable NSArray *)doubleList - boolList:(nullable NSArray *)boolList - map:(nullable NSDictionary *)map { - AllNullableTypesWithoutRecursion *pigeonResult = [[AllNullableTypesWithoutRecursion alloc] init]; +@implementation FLTAllNullableTypesWithoutRecursion ++ (instancetype) + makeWithANullableBool:(nullable NSNumber *)aNullableBool + aNullableInt:(nullable NSNumber *)aNullableInt + aNullableInt64:(nullable NSNumber *)aNullableInt64 + aNullableDouble:(nullable NSNumber *)aNullableDouble + aNullableByteArray:(nullable FlutterStandardTypedData *)aNullableByteArray + aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray + aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray + aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray + aNullableEnum:(nullable FLTAnEnumBox *)aNullableEnum + anotherNullableEnum:(nullable FLTAnotherEnumBox *)anotherNullableEnum + aNullableString:(nullable NSString *)aNullableString + aNullableObject:(nullable id)aNullableObject + list:(nullable NSArray *)list + stringList:(nullable NSArray *)stringList + intList:(nullable NSArray *)intList + doubleList:(nullable NSArray *)doubleList + boolList:(nullable NSArray *)boolList + enumList:(nullable NSArray *)enumList + objectList:(nullable NSArray *)objectList + listList:(nullable NSArray *> *)listList + mapList:(nullable NSArray *> *)mapList + map:(nullable NSDictionary *)map + stringMap:(nullable NSDictionary *)stringMap + intMap:(nullable NSDictionary *)intMap + enumMap:(nullable NSDictionary *)enumMap + objectMap:(nullable NSDictionary *)objectMap + listMap:(nullable NSDictionary *> *)listMap + mapMap:(nullable NSDictionary *> *)mapMap { + FLTAllNullableTypesWithoutRecursion *pigeonResult = + [[FLTAllNullableTypesWithoutRecursion alloc] init]; pigeonResult.aNullableBool = aNullableBool; pigeonResult.aNullableInt = aNullableInt; pigeonResult.aNullableInt64 = aNullableInt64; @@ -323,9 +431,6 @@ + (instancetype)makeWithANullableBool:(nullable NSNumber *)aNullableBool pigeonResult.aNullable4ByteArray = aNullable4ByteArray; pigeonResult.aNullable8ByteArray = aNullable8ByteArray; pigeonResult.aNullableFloatArray = aNullableFloatArray; - pigeonResult.nullableNestedList = nullableNestedList; - pigeonResult.nullableMapWithAnnotations = nullableMapWithAnnotations; - pigeonResult.nullableMapWithObject = nullableMapWithObject; pigeonResult.aNullableEnum = aNullableEnum; pigeonResult.anotherNullableEnum = anotherNullableEnum; pigeonResult.aNullableString = aNullableString; @@ -335,11 +440,22 @@ + (instancetype)makeWithANullableBool:(nullable NSNumber *)aNullableBool pigeonResult.intList = intList; pigeonResult.doubleList = doubleList; pigeonResult.boolList = boolList; + pigeonResult.enumList = enumList; + pigeonResult.objectList = objectList; + pigeonResult.listList = listList; + pigeonResult.mapList = mapList; pigeonResult.map = map; + pigeonResult.stringMap = stringMap; + pigeonResult.intMap = intMap; + pigeonResult.enumMap = enumMap; + pigeonResult.objectMap = objectMap; + pigeonResult.listMap = listMap; + pigeonResult.mapMap = mapMap; return pigeonResult; } -+ (AllNullableTypesWithoutRecursion *)fromList:(NSArray *)list { - AllNullableTypesWithoutRecursion *pigeonResult = [[AllNullableTypesWithoutRecursion alloc] init]; ++ (FLTAllNullableTypesWithoutRecursion *)fromList:(NSArray *)list { + FLTAllNullableTypesWithoutRecursion *pigeonResult = + [[FLTAllNullableTypesWithoutRecursion alloc] init]; pigeonResult.aNullableBool = GetNullableObjectAtIndex(list, 0); pigeonResult.aNullableInt = GetNullableObjectAtIndex(list, 1); pigeonResult.aNullableInt64 = GetNullableObjectAtIndex(list, 2); @@ -348,23 +464,30 @@ + (AllNullableTypesWithoutRecursion *)fromList:(NSArray *)list { pigeonResult.aNullable4ByteArray = GetNullableObjectAtIndex(list, 5); pigeonResult.aNullable8ByteArray = GetNullableObjectAtIndex(list, 6); pigeonResult.aNullableFloatArray = GetNullableObjectAtIndex(list, 7); - pigeonResult.nullableNestedList = GetNullableObjectAtIndex(list, 8); - pigeonResult.nullableMapWithAnnotations = GetNullableObjectAtIndex(list, 9); - pigeonResult.nullableMapWithObject = GetNullableObjectAtIndex(list, 10); - pigeonResult.aNullableEnum = GetNullableObjectAtIndex(list, 11); - pigeonResult.anotherNullableEnum = GetNullableObjectAtIndex(list, 12); - pigeonResult.aNullableString = GetNullableObjectAtIndex(list, 13); - pigeonResult.aNullableObject = GetNullableObjectAtIndex(list, 14); - pigeonResult.list = GetNullableObjectAtIndex(list, 15); - pigeonResult.stringList = GetNullableObjectAtIndex(list, 16); - pigeonResult.intList = GetNullableObjectAtIndex(list, 17); - pigeonResult.doubleList = GetNullableObjectAtIndex(list, 18); - pigeonResult.boolList = GetNullableObjectAtIndex(list, 19); - pigeonResult.map = GetNullableObjectAtIndex(list, 20); + pigeonResult.aNullableEnum = GetNullableObjectAtIndex(list, 8); + pigeonResult.anotherNullableEnum = GetNullableObjectAtIndex(list, 9); + pigeonResult.aNullableString = GetNullableObjectAtIndex(list, 10); + pigeonResult.aNullableObject = GetNullableObjectAtIndex(list, 11); + pigeonResult.list = GetNullableObjectAtIndex(list, 12); + pigeonResult.stringList = GetNullableObjectAtIndex(list, 13); + pigeonResult.intList = GetNullableObjectAtIndex(list, 14); + pigeonResult.doubleList = GetNullableObjectAtIndex(list, 15); + pigeonResult.boolList = GetNullableObjectAtIndex(list, 16); + pigeonResult.enumList = GetNullableObjectAtIndex(list, 17); + pigeonResult.objectList = GetNullableObjectAtIndex(list, 18); + pigeonResult.listList = GetNullableObjectAtIndex(list, 19); + pigeonResult.mapList = GetNullableObjectAtIndex(list, 20); + pigeonResult.map = GetNullableObjectAtIndex(list, 21); + pigeonResult.stringMap = GetNullableObjectAtIndex(list, 22); + pigeonResult.intMap = GetNullableObjectAtIndex(list, 23); + pigeonResult.enumMap = GetNullableObjectAtIndex(list, 24); + pigeonResult.objectMap = GetNullableObjectAtIndex(list, 25); + pigeonResult.listMap = GetNullableObjectAtIndex(list, 26); + pigeonResult.mapMap = GetNullableObjectAtIndex(list, 27); return pigeonResult; } -+ (nullable AllNullableTypesWithoutRecursion *)nullableFromList:(NSArray *)list { - return (list) ? [AllNullableTypesWithoutRecursion fromList:list] : nil; ++ (nullable FLTAllNullableTypesWithoutRecursion *)nullableFromList:(NSArray *)list { + return (list) ? [FLTAllNullableTypesWithoutRecursion fromList:list] : nil; } - (NSArray *)toList { return @[ @@ -376,9 +499,6 @@ + (nullable AllNullableTypesWithoutRecursion *)nullableFromList:(NSArray *)l self.aNullable4ByteArray ?: [NSNull null], self.aNullable8ByteArray ?: [NSNull null], self.aNullableFloatArray ?: [NSNull null], - self.nullableNestedList ?: [NSNull null], - self.nullableMapWithAnnotations ?: [NSNull null], - self.nullableMapWithObject ?: [NSNull null], self.aNullableEnum ?: [NSNull null], self.anotherNullableEnum ?: [NSNull null], self.aNullableString ?: [NSNull null], @@ -388,54 +508,84 @@ + (nullable AllNullableTypesWithoutRecursion *)nullableFromList:(NSArray *)l self.intList ?: [NSNull null], self.doubleList ?: [NSNull null], self.boolList ?: [NSNull null], + self.enumList ?: [NSNull null], + self.objectList ?: [NSNull null], + self.listList ?: [NSNull null], + self.mapList ?: [NSNull null], self.map ?: [NSNull null], + self.stringMap ?: [NSNull null], + self.intMap ?: [NSNull null], + self.enumMap ?: [NSNull null], + self.objectMap ?: [NSNull null], + self.listMap ?: [NSNull null], + self.mapMap ?: [NSNull null], ]; } @end -@implementation AllClassesWrapper -+ (instancetype)makeWithAllNullableTypes:(AllNullableTypes *)allNullableTypes - allNullableTypesWithoutRecursion: - (nullable AllNullableTypesWithoutRecursion *)allNullableTypesWithoutRecursion - allTypes:(nullable AllTypes *)allTypes { - AllClassesWrapper *pigeonResult = [[AllClassesWrapper alloc] init]; +@implementation FLTAllClassesWrapper ++ (instancetype) + makeWithAllNullableTypes:(FLTAllNullableTypes *)allNullableTypes + allNullableTypesWithoutRecursion: + (nullable FLTAllNullableTypesWithoutRecursion *)allNullableTypesWithoutRecursion + allTypes:(nullable FLTAllTypes *)allTypes + classList:(NSArray *)classList + nullableClassList: + (nullable NSArray *)nullableClassList + classMap:(NSDictionary *)classMap + nullableClassMap: + (nullable NSDictionary *) + nullableClassMap { + FLTAllClassesWrapper *pigeonResult = [[FLTAllClassesWrapper alloc] init]; pigeonResult.allNullableTypes = allNullableTypes; pigeonResult.allNullableTypesWithoutRecursion = allNullableTypesWithoutRecursion; pigeonResult.allTypes = allTypes; + pigeonResult.classList = classList; + pigeonResult.nullableClassList = nullableClassList; + pigeonResult.classMap = classMap; + pigeonResult.nullableClassMap = nullableClassMap; return pigeonResult; } -+ (AllClassesWrapper *)fromList:(NSArray *)list { - AllClassesWrapper *pigeonResult = [[AllClassesWrapper alloc] init]; ++ (FLTAllClassesWrapper *)fromList:(NSArray *)list { + FLTAllClassesWrapper *pigeonResult = [[FLTAllClassesWrapper alloc] init]; pigeonResult.allNullableTypes = GetNullableObjectAtIndex(list, 0); pigeonResult.allNullableTypesWithoutRecursion = GetNullableObjectAtIndex(list, 1); pigeonResult.allTypes = GetNullableObjectAtIndex(list, 2); + pigeonResult.classList = GetNullableObjectAtIndex(list, 3); + pigeonResult.nullableClassList = GetNullableObjectAtIndex(list, 4); + pigeonResult.classMap = GetNullableObjectAtIndex(list, 5); + pigeonResult.nullableClassMap = GetNullableObjectAtIndex(list, 6); return pigeonResult; } -+ (nullable AllClassesWrapper *)nullableFromList:(NSArray *)list { - return (list) ? [AllClassesWrapper fromList:list] : nil; ++ (nullable FLTAllClassesWrapper *)nullableFromList:(NSArray *)list { + return (list) ? [FLTAllClassesWrapper fromList:list] : nil; } - (NSArray *)toList { return @[ self.allNullableTypes ?: [NSNull null], self.allNullableTypesWithoutRecursion ?: [NSNull null], self.allTypes ?: [NSNull null], + self.classList ?: [NSNull null], + self.nullableClassList ?: [NSNull null], + self.classMap ?: [NSNull null], + self.nullableClassMap ?: [NSNull null], ]; } @end -@implementation TestMessage +@implementation FLTTestMessage + (instancetype)makeWithTestList:(nullable NSArray *)testList { - TestMessage *pigeonResult = [[TestMessage alloc] init]; + FLTTestMessage *pigeonResult = [[FLTTestMessage alloc] init]; pigeonResult.testList = testList; return pigeonResult; } -+ (TestMessage *)fromList:(NSArray *)list { - TestMessage *pigeonResult = [[TestMessage alloc] init]; ++ (FLTTestMessage *)fromList:(NSArray *)list { + FLTTestMessage *pigeonResult = [[FLTTestMessage alloc] init]; pigeonResult.testList = GetNullableObjectAtIndex(list, 0); return pigeonResult; } -+ (nullable TestMessage *)nullableFromList:(NSArray *)list { - return (list) ? [TestMessage fromList:list] : nil; ++ (nullable FLTTestMessage *)nullableFromList:(NSArray *)list { + return (list) ? [FLTTestMessage fromList:list] : nil; } - (NSArray *)toList { return @[ @@ -444,100 +594,105 @@ + (nullable TestMessage *)nullableFromList:(NSArray *)list { } @end -@interface CoreTestsPigeonCodecReader : FlutterStandardReader +@interface FLTCoreTestsPigeonCodecReader : FlutterStandardReader @end -@implementation CoreTestsPigeonCodecReader +@implementation FLTCoreTestsPigeonCodecReader - (nullable id)readValueOfType:(UInt8)type { switch (type) { case 129: { NSNumber *enumAsNumber = [self readValue]; return enumAsNumber == nil ? nil - : [[AnEnumBox alloc] initWithValue:[enumAsNumber integerValue]]; + : [[FLTAnEnumBox alloc] initWithValue:[enumAsNumber integerValue]]; } case 130: { NSNumber *enumAsNumber = [self readValue]; return enumAsNumber == nil ? nil - : [[AnotherEnumBox alloc] initWithValue:[enumAsNumber integerValue]]; + : [[FLTAnotherEnumBox alloc] initWithValue:[enumAsNumber integerValue]]; } case 131: - return [AllTypes fromList:[self readValue]]; + return [FLTUnusedClass fromList:[self readValue]]; case 132: - return [AllNullableTypes fromList:[self readValue]]; + return [FLTAllTypes fromList:[self readValue]]; case 133: - return [AllNullableTypesWithoutRecursion fromList:[self readValue]]; + return [FLTAllNullableTypes fromList:[self readValue]]; case 134: - return [AllClassesWrapper fromList:[self readValue]]; + return [FLTAllNullableTypesWithoutRecursion fromList:[self readValue]]; case 135: - return [TestMessage fromList:[self readValue]]; + return [FLTAllClassesWrapper fromList:[self readValue]]; + case 136: + return [FLTTestMessage fromList:[self readValue]]; default: return [super readValueOfType:type]; } } @end -@interface CoreTestsPigeonCodecWriter : FlutterStandardWriter +@interface FLTCoreTestsPigeonCodecWriter : FlutterStandardWriter @end -@implementation CoreTestsPigeonCodecWriter +@implementation FLTCoreTestsPigeonCodecWriter - (void)writeValue:(id)value { - if ([value isKindOfClass:[AnEnumBox class]]) { - AnEnumBox *box = (AnEnumBox *)value; + if ([value isKindOfClass:[FLTAnEnumBox class]]) { + FLTAnEnumBox *box = (FLTAnEnumBox *)value; [self writeByte:129]; [self writeValue:(value == nil ? [NSNull null] : [NSNumber numberWithInteger:box.value])]; - } else if ([value isKindOfClass:[AnotherEnumBox class]]) { - AnotherEnumBox *box = (AnotherEnumBox *)value; + } else if ([value isKindOfClass:[FLTAnotherEnumBox class]]) { + FLTAnotherEnumBox *box = (FLTAnotherEnumBox *)value; [self writeByte:130]; [self writeValue:(value == nil ? [NSNull null] : [NSNumber numberWithInteger:box.value])]; - } else if ([value isKindOfClass:[AllTypes class]]) { + } else if ([value isKindOfClass:[FLTUnusedClass class]]) { [self writeByte:131]; [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[AllNullableTypes class]]) { + } else if ([value isKindOfClass:[FLTAllTypes class]]) { [self writeByte:132]; [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[AllNullableTypesWithoutRecursion class]]) { + } else if ([value isKindOfClass:[FLTAllNullableTypes class]]) { [self writeByte:133]; [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[AllClassesWrapper class]]) { + } else if ([value isKindOfClass:[FLTAllNullableTypesWithoutRecursion class]]) { [self writeByte:134]; [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[TestMessage class]]) { + } else if ([value isKindOfClass:[FLTAllClassesWrapper class]]) { [self writeByte:135]; [self writeValue:[value toList]]; + } else if ([value isKindOfClass:[FLTTestMessage class]]) { + [self writeByte:136]; + [self writeValue:[value toList]]; } else { [super writeValue:value]; } } @end -@interface CoreTestsPigeonCodecReaderWriter : FlutterStandardReaderWriter +@interface FLTCoreTestsPigeonCodecReaderWriter : FlutterStandardReaderWriter @end -@implementation CoreTestsPigeonCodecReaderWriter +@implementation FLTCoreTestsPigeonCodecReaderWriter - (FlutterStandardWriter *)writerWithData:(NSMutableData *)data { - return [[CoreTestsPigeonCodecWriter alloc] initWithData:data]; + return [[FLTCoreTestsPigeonCodecWriter alloc] initWithData:data]; } - (FlutterStandardReader *)readerWithData:(NSData *)data { - return [[CoreTestsPigeonCodecReader alloc] initWithData:data]; + return [[FLTCoreTestsPigeonCodecReader alloc] initWithData:data]; } @end -NSObject *GetCoreTestsCodec(void) { +NSObject *FLTGetCoreTestsCodec(void) { static FlutterStandardMessageCodec *sSharedObject = nil; static dispatch_once_t sPred = 0; dispatch_once(&sPred, ^{ - CoreTestsPigeonCodecReaderWriter *readerWriter = - [[CoreTestsPigeonCodecReaderWriter alloc] init]; + FLTCoreTestsPigeonCodecReaderWriter *readerWriter = + [[FLTCoreTestsPigeonCodecReaderWriter alloc] init]; sSharedObject = [FlutterStandardMessageCodec codecWithReaderWriter:readerWriter]; }); return sSharedObject; } -void SetUpHostIntegrationCoreApi(id binaryMessenger, - NSObject *api) { - SetUpHostIntegrationCoreApiWithSuffix(binaryMessenger, api, @""); +void SetUpFLTHostIntegrationCoreApi(id binaryMessenger, + NSObject *api) { + SetUpFLTHostIntegrationCoreApiWithSuffix(binaryMessenger, api, @""); } -void SetUpHostIntegrationCoreApiWithSuffix(id binaryMessenger, - NSObject *api, - NSString *messageChannelSuffix) { +void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryMessenger, + NSObject *api, + NSString *messageChannelSuffix) { messageChannelSuffix = messageChannelSuffix.length > 0 ? [NSString stringWithFormat:@".%@", messageChannelSuffix] : @""; @@ -550,10 +705,10 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess @"HostIntegrationCoreApi.noop", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(noopWithError:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(noopWithError:)", + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(noopWithError:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { FlutterError *error; @@ -572,17 +727,17 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess @"HostIntegrationCoreApi.echoAllTypes", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { NSCAssert( [api respondsToSelector:@selector(echoAllTypes:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAllTypes:error:)", + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAllTypes:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - AllTypes *arg_everything = GetNullableObjectAtIndex(args, 0); + FLTAllTypes *arg_everything = GetNullableObjectAtIndex(args, 0); FlutterError *error; - AllTypes *output = [api echoAllTypes:arg_everything error:&error]; + FLTAllTypes *output = [api echoAllTypes:arg_everything error:&error]; callback(wrapResult(output, error)); }]; } else { @@ -597,11 +752,11 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess @"HostIntegrationCoreApi.throwError", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { NSCAssert( [api respondsToSelector:@selector(throwErrorWithError:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(throwErrorWithError:)", + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(throwErrorWithError:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { FlutterError *error; @@ -620,10 +775,10 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess @"HostIntegrationCoreApi.throwErrorFromVoid", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(throwErrorFromVoidWithError:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " @"@selector(throwErrorFromVoidWithError:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { @@ -643,10 +798,10 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess @"HostIntegrationCoreApi.throwFlutterError", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(throwFlutterErrorWithError:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " @"@selector(throwFlutterErrorWithError:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { @@ -666,10 +821,10 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess @"HostIntegrationCoreApi.echoInt", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(echoInt:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoInt:error:)", + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoInt:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; @@ -690,11 +845,12 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess @"HostIntegrationCoreApi.echoDouble", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoDouble:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoDouble:error:)", - api); + NSCAssert( + [api respondsToSelector:@selector(echoDouble:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoDouble:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; double arg_aDouble = [GetNullableObjectAtIndex(args, 0) doubleValue]; @@ -714,10 +870,10 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess @"HostIntegrationCoreApi.echoBool", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(echoBool:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoBool:error:)", + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoBool:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; @@ -738,11 +894,12 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess @"HostIntegrationCoreApi.echoString", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoString:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoString:error:)", - api); + NSCAssert( + [api respondsToSelector:@selector(echoString:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoString:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSString *arg_aString = GetNullableObjectAtIndex(args, 0); @@ -762,11 +919,11 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess @"HostIntegrationCoreApi.echoUint8List", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { NSCAssert( [api respondsToSelector:@selector(echoUint8List:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoUint8List:error:)", + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoUint8List:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; @@ -787,11 +944,12 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess @"HostIntegrationCoreApi.echoObject", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoObject:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoObject:error:)", - api); + NSCAssert( + [api respondsToSelector:@selector(echoObject:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoObject:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; id arg_anObject = GetNullableObjectAtIndex(args, 0); @@ -811,10 +969,10 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess @"HostIntegrationCoreApi.echoList", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(echoList:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoList:error:)", + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoList:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; @@ -827,283 +985,281 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess [channel setMessageHandler:nil]; } } - /// Returns the passed map, to test serialization and deserialization. + /// Returns the passed list, to test serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoMap", + @"HostIntegrationCoreApi.echoEnumList", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoMap:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoMap:error:)", - api); + NSCAssert( + [api respondsToSelector:@selector(echoEnumList:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoEnumList:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSDictionary *arg_aMap = GetNullableObjectAtIndex(args, 0); + NSArray *arg_enumList = GetNullableObjectAtIndex(args, 0); FlutterError *error; - NSDictionary *output = [api echoMap:arg_aMap error:&error]; + NSArray *output = [api echoEnumList:arg_enumList error:&error]; callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns the passed map to test nested class serialization and deserialization. + /// Returns the passed list, to test serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoClassWrapper", + @"HostIntegrationCoreApi.echoClassList", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { NSCAssert( - [api respondsToSelector:@selector(echoClassWrapper:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoClassWrapper:error:)", + [api respondsToSelector:@selector(echoClassList:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoClassList:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - AllClassesWrapper *arg_wrapper = GetNullableObjectAtIndex(args, 0); + NSArray *arg_classList = GetNullableObjectAtIndex(args, 0); FlutterError *error; - AllClassesWrapper *output = [api echoClassWrapper:arg_wrapper error:&error]; + NSArray *output = [api echoClassList:arg_classList error:&error]; callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns the passed enum to test serialization and deserialization. + /// Returns the passed list, to test serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoEnum", + @"HostIntegrationCoreApi.echoNonNullEnumList", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoEnum:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoEnum:error:)", + NSCAssert([api respondsToSelector:@selector(echoNonNullEnumList:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoNonNullEnumList:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - AnEnumBox *boxedAnEnum = GetNullableObjectAtIndex(args, 0); - AnEnum arg_anEnum = boxedAnEnum.value; + NSArray *arg_enumList = GetNullableObjectAtIndex(args, 0); FlutterError *error; - AnEnumBox *output = [api echoEnum:arg_anEnum error:&error]; + NSArray *output = [api echoNonNullEnumList:arg_enumList error:&error]; callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns the passed enum to test serialization and deserialization. + /// Returns the passed list, to test serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAnotherEnum", + @"HostIntegrationCoreApi.echoNonNullClassList", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert( - [api respondsToSelector:@selector(echoAnotherEnum:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAnotherEnum:error:)", - api); + NSCAssert([api respondsToSelector:@selector(echoNonNullClassList:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoNonNullClassList:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - AnotherEnumBox *boxedAnotherEnum = GetNullableObjectAtIndex(args, 0); - AnotherEnum arg_anotherEnum = boxedAnotherEnum.value; + NSArray *arg_classList = GetNullableObjectAtIndex(args, 0); FlutterError *error; - AnotherEnumBox *output = [api echoAnotherEnum:arg_anotherEnum error:&error]; + NSArray *output = [api echoNonNullClassList:arg_classList + error:&error]; callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns the default string. + /// Returns the passed map, to test serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoNamedDefaultString", + @"HostIntegrationCoreApi.echoMap", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoNamedDefaultString:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoNamedDefaultString:error:)", + NSCAssert([api respondsToSelector:@selector(echoMap:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoMap:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSString *arg_aString = GetNullableObjectAtIndex(args, 0); + NSDictionary *arg_map = GetNullableObjectAtIndex(args, 0); FlutterError *error; - NSString *output = [api echoNamedDefaultString:arg_aString error:&error]; + NSDictionary *output = [api echoMap:arg_map error:&error]; callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns passed in double. + /// Returns the passed map, to test serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoOptionalDefaultDouble", - messageChannelSuffix] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoStringMap", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoOptionalDefaultDouble:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoOptionalDefaultDouble:error:)", - api); + NSCAssert( + [api respondsToSelector:@selector(echoStringMap:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoStringMap:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - double arg_aDouble = [GetNullableObjectAtIndex(args, 0) doubleValue]; + NSDictionary *arg_stringMap = GetNullableObjectAtIndex(args, 0); FlutterError *error; - NSNumber *output = [api echoOptionalDefaultDouble:arg_aDouble error:&error]; + NSDictionary *output = [api echoStringMap:arg_stringMap + error:&error]; callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns passed in int. + /// Returns the passed map, to test serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoRequiredInt", + @"HostIntegrationCoreApi.echoIntMap", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { NSCAssert( - [api respondsToSelector:@selector(echoRequiredInt:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoRequiredInt:error:)", + [api respondsToSelector:@selector(echoIntMap:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoIntMap:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSInteger arg_anInt = [GetNullableObjectAtIndex(args, 0) integerValue]; + NSDictionary *arg_intMap = GetNullableObjectAtIndex(args, 0); FlutterError *error; - NSNumber *output = [api echoRequiredInt:arg_anInt error:&error]; + NSDictionary *output = [api echoIntMap:arg_intMap error:&error]; callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns the passed object, to test serialization and deserialization. + /// Returns the passed map, to test serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAllNullableTypes", + @"HostIntegrationCoreApi.echoEnumMap", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAllNullableTypes:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAllNullableTypes:error:)", - api); + NSCAssert( + [api respondsToSelector:@selector(echoEnumMap:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoEnumMap:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - AllNullableTypes *arg_everything = GetNullableObjectAtIndex(args, 0); + NSDictionary *arg_enumMap = + GetNullableObjectAtIndex(args, 0); FlutterError *error; - AllNullableTypes *output = [api echoAllNullableTypes:arg_everything error:&error]; + NSDictionary *output = [api echoEnumMap:arg_enumMap + error:&error]; callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns the passed object, to test serialization and deserialization. + /// Returns the passed map, to test serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - [NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAllNullableTypesWithoutRecursion", - messageChannelSuffix] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoClassMap", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAllNullableTypesWithoutRecursion:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAllNullableTypesWithoutRecursion:error:)", - api); + NSCAssert( + [api respondsToSelector:@selector(echoClassMap:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoClassMap:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - AllNullableTypesWithoutRecursion *arg_everything = GetNullableObjectAtIndex(args, 0); + NSDictionary *arg_classMap = + GetNullableObjectAtIndex(args, 0); FlutterError *error; - AllNullableTypesWithoutRecursion *output = - [api echoAllNullableTypesWithoutRecursion:arg_everything error:&error]; + NSDictionary *output = [api echoClassMap:arg_classMap + error:&error]; callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns the inner `aString` value from the wrapped object, to test - /// sending of nested objects. + /// Returns the passed map, to test serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.extractNestedNullableString", - messageChannelSuffix] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoNonNullStringMap", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(extractNestedNullableStringFrom:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(extractNestedNullableStringFrom:error:)", + NSCAssert([api respondsToSelector:@selector(echoNonNullStringMap:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoNonNullStringMap:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - AllClassesWrapper *arg_wrapper = GetNullableObjectAtIndex(args, 0); + NSDictionary *arg_stringMap = GetNullableObjectAtIndex(args, 0); FlutterError *error; - NSString *output = [api extractNestedNullableStringFrom:arg_wrapper error:&error]; + NSDictionary *output = [api echoNonNullStringMap:arg_stringMap + error:&error]; callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns the inner `aString` value from the wrapped object, to test - /// sending of nested objects. + /// Returns the passed map, to test serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.createNestedNullableString", - messageChannelSuffix] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoNonNullIntMap", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(createNestedObjectWithNullableString:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(createNestedObjectWithNullableString:error:)", + NSCAssert([api respondsToSelector:@selector(echoNonNullIntMap:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoNonNullIntMap:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSString *arg_nullableString = GetNullableObjectAtIndex(args, 0); + NSDictionary *arg_intMap = GetNullableObjectAtIndex(args, 0); FlutterError *error; - AllClassesWrapper *output = [api createNestedObjectWithNullableString:arg_nullableString + NSDictionary *output = [api echoNonNullIntMap:arg_intMap error:&error]; callback(wrapResult(output, error)); }]; @@ -1111,1722 +1267,1743 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess [channel setMessageHandler:nil]; } } - /// Returns passed in arguments of multiple types. + /// Returns the passed map, to test serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.sendMultipleNullableTypes", - messageChannelSuffix] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoNonNullEnumMap", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(sendMultipleNullableTypesABool: - anInt:aString:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(sendMultipleNullableTypesABool:anInt:aString:error:)", + NSCAssert([api respondsToSelector:@selector(echoNonNullEnumMap:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoNonNullEnumMap:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSNumber *arg_aNullableBool = GetNullableObjectAtIndex(args, 0); - NSNumber *arg_aNullableInt = GetNullableObjectAtIndex(args, 1); - NSString *arg_aNullableString = GetNullableObjectAtIndex(args, 2); + NSDictionary *arg_enumMap = + GetNullableObjectAtIndex(args, 0); FlutterError *error; - AllNullableTypes *output = [api sendMultipleNullableTypesABool:arg_aNullableBool - anInt:arg_aNullableInt - aString:arg_aNullableString - error:&error]; + NSDictionary *output = [api echoNonNullEnumMap:arg_enumMap + error:&error]; callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns passed in arguments of multiple types. + /// Returns the passed map, to test serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion", - messageChannelSuffix] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoNonNullClassMap", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector - (sendMultipleNullableTypesWithoutRecursionABool:anInt:aString:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(sendMultipleNullableTypesWithoutRecursionABool:anInt:aString:error:)", + NSCAssert([api respondsToSelector:@selector(echoNonNullClassMap:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoNonNullClassMap:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSNumber *arg_aNullableBool = GetNullableObjectAtIndex(args, 0); - NSNumber *arg_aNullableInt = GetNullableObjectAtIndex(args, 1); - NSString *arg_aNullableString = GetNullableObjectAtIndex(args, 2); + NSDictionary *arg_classMap = + GetNullableObjectAtIndex(args, 0); FlutterError *error; - AllNullableTypesWithoutRecursion *output = - [api sendMultipleNullableTypesWithoutRecursionABool:arg_aNullableBool - anInt:arg_aNullableInt - aString:arg_aNullableString - error:&error]; + NSDictionary *output = + [api echoNonNullClassMap:arg_classMap error:&error]; callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns passed in int. + /// Returns the passed class to test nested class serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoNullableInt", + @"HostIntegrationCoreApi.echoClassWrapper", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert( - [api respondsToSelector:@selector(echoNullableInt:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoNullableInt:error:)", - api); + NSCAssert([api respondsToSelector:@selector(echoClassWrapper:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoClassWrapper:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSNumber *arg_aNullableInt = GetNullableObjectAtIndex(args, 0); + FLTAllClassesWrapper *arg_wrapper = GetNullableObjectAtIndex(args, 0); FlutterError *error; - NSNumber *output = [api echoNullableInt:arg_aNullableInt error:&error]; + FLTAllClassesWrapper *output = [api echoClassWrapper:arg_wrapper error:&error]; callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns passed in double. + /// Returns the passed enum to test serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoNullableDouble", + @"HostIntegrationCoreApi.echoEnum", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoNullableDouble:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoNullableDouble:error:)", + NSCAssert([api respondsToSelector:@selector(echoEnum:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoEnum:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSNumber *arg_aNullableDouble = GetNullableObjectAtIndex(args, 0); + FLTAnEnumBox *boxedFLTAnEnum = GetNullableObjectAtIndex(args, 0); + FLTAnEnum arg_anEnum = boxedFLTAnEnum.value; FlutterError *error; - NSNumber *output = [api echoNullableDouble:arg_aNullableDouble error:&error]; + FLTAnEnumBox *output = [api echoEnum:arg_anEnum error:&error]; callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns the passed in boolean. + /// Returns the passed enum to test serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoNullableBool", + @"HostIntegrationCoreApi.echoAnotherEnum", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert( - [api respondsToSelector:@selector(echoNullableBool:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoNullableBool:error:)", - api); + NSCAssert([api respondsToSelector:@selector(echoAnotherEnum:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAnotherEnum:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSNumber *arg_aNullableBool = GetNullableObjectAtIndex(args, 0); + FLTAnotherEnumBox *boxedFLTAnotherEnum = GetNullableObjectAtIndex(args, 0); + FLTAnotherEnum arg_anotherEnum = boxedFLTAnotherEnum.value; FlutterError *error; - NSNumber *output = [api echoNullableBool:arg_aNullableBool error:&error]; + FLTAnotherEnumBox *output = [api echoAnotherEnum:arg_anotherEnum error:&error]; callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns the passed in string. + /// Returns the default string. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoNullableString", + @"HostIntegrationCoreApi.echoNamedDefaultString", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoNullableString:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoNullableString:error:)", + NSCAssert([api respondsToSelector:@selector(echoNamedDefaultString:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoNamedDefaultString:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSString *arg_aNullableString = GetNullableObjectAtIndex(args, 0); + NSString *arg_aString = GetNullableObjectAtIndex(args, 0); FlutterError *error; - NSString *output = [api echoNullableString:arg_aNullableString error:&error]; + NSString *output = [api echoNamedDefaultString:arg_aString error:&error]; callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns the passed in Uint8List. + /// Returns passed in double. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoNullableUint8List", - messageChannelSuffix] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoOptionalDefaultDouble", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoNullableUint8List:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoNullableUint8List:error:)", + NSCAssert([api respondsToSelector:@selector(echoOptionalDefaultDouble:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoOptionalDefaultDouble:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - FlutterStandardTypedData *arg_aNullableUint8List = GetNullableObjectAtIndex(args, 0); + double arg_aDouble = [GetNullableObjectAtIndex(args, 0) doubleValue]; FlutterError *error; - FlutterStandardTypedData *output = [api echoNullableUint8List:arg_aNullableUint8List - error:&error]; + NSNumber *output = [api echoOptionalDefaultDouble:arg_aDouble error:&error]; callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns the passed in generic Object. + /// Returns passed in int. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoNullableObject", + @"HostIntegrationCoreApi.echoRequiredInt", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoNullableObject:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoNullableObject:error:)", + NSCAssert([api respondsToSelector:@selector(echoRequiredInt:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoRequiredInt:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - id arg_aNullableObject = GetNullableObjectAtIndex(args, 0); + NSInteger arg_anInt = [GetNullableObjectAtIndex(args, 0) integerValue]; FlutterError *error; - id output = [api echoNullableObject:arg_aNullableObject error:&error]; + NSNumber *output = [api echoRequiredInt:arg_anInt error:&error]; callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns the passed list, to test serialization and deserialization. + /// Returns the passed object, to test serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoNullableList", + @"HostIntegrationCoreApi.echoAllNullableTypes", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert( - [api respondsToSelector:@selector(echoNullableList:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoNullableList:error:)", - api); + NSCAssert([api respondsToSelector:@selector(echoAllNullableTypes:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAllNullableTypes:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSArray *arg_aNullableList = GetNullableObjectAtIndex(args, 0); + FLTAllNullableTypes *arg_everything = GetNullableObjectAtIndex(args, 0); FlutterError *error; - NSArray *output = [api echoNullableList:arg_aNullableList error:&error]; + FLTAllNullableTypes *output = [api echoAllNullableTypes:arg_everything error:&error]; callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns the passed map, to test serialization and deserialization. + /// Returns the passed object, to test serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoNullableMap", - messageChannelSuffix] + initWithName: + [NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAllNullableTypesWithoutRecursion", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert( - [api respondsToSelector:@selector(echoNullableMap:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoNullableMap:error:)", - api); + NSCAssert([api respondsToSelector:@selector(echoAllNullableTypesWithoutRecursion:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAllNullableTypesWithoutRecursion:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSDictionary *arg_aNullableMap = GetNullableObjectAtIndex(args, 0); + FLTAllNullableTypesWithoutRecursion *arg_everything = GetNullableObjectAtIndex(args, 0); FlutterError *error; - NSDictionary *output = [api echoNullableMap:arg_aNullableMap error:&error]; + FLTAllNullableTypesWithoutRecursion *output = + [api echoAllNullableTypesWithoutRecursion:arg_everything error:&error]; callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } + /// Returns the inner `aString` value from the wrapped object, to test + /// sending of nested objects. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoNullableEnum", - messageChannelSuffix] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.extractNestedNullableString", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert( - [api respondsToSelector:@selector(echoNullableEnum:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoNullableEnum:error:)", - api); + NSCAssert([api respondsToSelector:@selector(extractNestedNullableStringFrom:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(extractNestedNullableStringFrom:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - AnEnumBox *arg_anEnum = GetNullableObjectAtIndex(args, 0); + FLTAllClassesWrapper *arg_wrapper = GetNullableObjectAtIndex(args, 0); FlutterError *error; - AnEnumBox *output = [api echoNullableEnum:arg_anEnum error:&error]; + NSString *output = [api extractNestedNullableStringFrom:arg_wrapper error:&error]; callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } + /// Returns the inner `aString` value from the wrapped object, to test + /// sending of nested objects. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAnotherNullableEnum", + @"HostIntegrationCoreApi.createNestedNullableString", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAnotherNullableEnum:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAnotherNullableEnum:error:)", + NSCAssert([api respondsToSelector:@selector(createNestedObjectWithNullableString:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(createNestedObjectWithNullableString:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - AnotherEnumBox *arg_anotherEnum = GetNullableObjectAtIndex(args, 0); + NSString *arg_nullableString = GetNullableObjectAtIndex(args, 0); FlutterError *error; - AnotherEnumBox *output = [api echoAnotherNullableEnum:arg_anotherEnum error:&error]; + FLTAllClassesWrapper *output = [api createNestedObjectWithNullableString:arg_nullableString + error:&error]; callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns passed in int. + /// Returns passed in arguments of multiple types. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoOptionalNullableInt", + @"HostIntegrationCoreApi.sendMultipleNullableTypes", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoOptionalNullableInt:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoOptionalNullableInt:error:)", + NSCAssert([api respondsToSelector:@selector(sendMultipleNullableTypesABool: + anInt:aString:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(sendMultipleNullableTypesABool:anInt:aString:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSNumber *arg_aNullableInt = GetNullableObjectAtIndex(args, 0); + NSNumber *arg_aNullableBool = GetNullableObjectAtIndex(args, 0); + NSNumber *arg_aNullableInt = GetNullableObjectAtIndex(args, 1); + NSString *arg_aNullableString = GetNullableObjectAtIndex(args, 2); FlutterError *error; - NSNumber *output = [api echoOptionalNullableInt:arg_aNullableInt error:&error]; + FLTAllNullableTypes *output = [api sendMultipleNullableTypesABool:arg_aNullableBool + anInt:arg_aNullableInt + aString:arg_aNullableString + error:&error]; callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns the passed in string. + /// Returns passed in arguments of multiple types. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoNamedNullableString", - messageChannelSuffix] + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoNamedNullableString:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoNamedNullableString:error:)", + NSCAssert([api respondsToSelector:@selector + (sendMultipleNullableTypesWithoutRecursionABool:anInt:aString:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(sendMultipleNullableTypesWithoutRecursionABool:anInt:aString:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSString *arg_aNullableString = GetNullableObjectAtIndex(args, 0); + NSNumber *arg_aNullableBool = GetNullableObjectAtIndex(args, 0); + NSNumber *arg_aNullableInt = GetNullableObjectAtIndex(args, 1); + NSString *arg_aNullableString = GetNullableObjectAtIndex(args, 2); FlutterError *error; - NSString *output = [api echoNamedNullableString:arg_aNullableString error:&error]; + FLTAllNullableTypesWithoutRecursion *output = + [api sendMultipleNullableTypesWithoutRecursionABool:arg_aNullableBool + anInt:arg_aNullableInt + aString:arg_aNullableString + error:&error]; callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// A no-op function taking no arguments and returning no value, to sanity - /// test basic asynchronous calling. + /// Returns passed in int. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.noopAsync", + @"HostIntegrationCoreApi.echoNullableInt", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert( - [api respondsToSelector:@selector(noopAsyncWithCompletion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(noopAsyncWithCompletion:)", - api); + NSCAssert([api respondsToSelector:@selector(echoNullableInt:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoNullableInt:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - [api noopAsyncWithCompletion:^(FlutterError *_Nullable error) { - callback(wrapResult(nil, error)); - }]; + NSArray *args = message; + NSNumber *arg_aNullableInt = GetNullableObjectAtIndex(args, 0); + FlutterError *error; + NSNumber *output = [api echoNullableInt:arg_aNullableInt error:&error]; + callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns passed in int asynchronously. + /// Returns passed in double. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncInt", + @"HostIntegrationCoreApi.echoNullableDouble", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert( - [api respondsToSelector:@selector(echoAsyncInt:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncInt:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(echoNullableDouble:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoNullableDouble:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSInteger arg_anInt = [GetNullableObjectAtIndex(args, 0) integerValue]; - [api echoAsyncInt:arg_anInt - completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + NSNumber *arg_aNullableDouble = GetNullableObjectAtIndex(args, 0); + FlutterError *error; + NSNumber *output = [api echoNullableDouble:arg_aNullableDouble error:&error]; + callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns passed in double asynchronously. + /// Returns the passed in boolean. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncDouble", + @"HostIntegrationCoreApi.echoNullableBool", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncDouble:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncDouble:completion:)", + NSCAssert([api respondsToSelector:@selector(echoNullableBool:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoNullableBool:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - double arg_aDouble = [GetNullableObjectAtIndex(args, 0) doubleValue]; - [api echoAsyncDouble:arg_aDouble - completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + NSNumber *arg_aNullableBool = GetNullableObjectAtIndex(args, 0); + FlutterError *error; + NSNumber *output = [api echoNullableBool:arg_aNullableBool error:&error]; + callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns the passed in boolean asynchronously. + /// Returns the passed in string. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncBool", + @"HostIntegrationCoreApi.echoNullableString", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncBool:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncBool:completion:)", + NSCAssert([api respondsToSelector:@selector(echoNullableString:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoNullableString:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - BOOL arg_aBool = [GetNullableObjectAtIndex(args, 0) boolValue]; - [api echoAsyncBool:arg_aBool - completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + NSString *arg_aNullableString = GetNullableObjectAtIndex(args, 0); + FlutterError *error; + NSString *output = [api echoNullableString:arg_aNullableString error:&error]; + callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns the passed string asynchronously. + /// Returns the passed in Uint8List. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncString", + @"HostIntegrationCoreApi.echoNullableUint8List", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncString:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncString:completion:)", + NSCAssert([api respondsToSelector:@selector(echoNullableUint8List:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoNullableUint8List:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSString *arg_aString = GetNullableObjectAtIndex(args, 0); - [api echoAsyncString:arg_aString - completion:^(NSString *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + FlutterStandardTypedData *arg_aNullableUint8List = GetNullableObjectAtIndex(args, 0); + FlutterError *error; + FlutterStandardTypedData *output = [api echoNullableUint8List:arg_aNullableUint8List + error:&error]; + callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns the passed in Uint8List asynchronously. + /// Returns the passed in generic Object. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncUint8List", + @"HostIntegrationCoreApi.echoNullableObject", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncUint8List:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncUint8List:completion:)", + NSCAssert([api respondsToSelector:@selector(echoNullableObject:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoNullableObject:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - FlutterStandardTypedData *arg_aUint8List = GetNullableObjectAtIndex(args, 0); - [api echoAsyncUint8List:arg_aUint8List - completion:^(FlutterStandardTypedData *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + id arg_aNullableObject = GetNullableObjectAtIndex(args, 0); + FlutterError *error; + id output = [api echoNullableObject:arg_aNullableObject error:&error]; + callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns the passed in generic Object asynchronously. + /// Returns the passed list, to test serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncObject", + @"HostIntegrationCoreApi.echoNullableList", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncObject:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncObject:completion:)", + NSCAssert([api respondsToSelector:@selector(echoNullableList:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoNullableList:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - id arg_anObject = GetNullableObjectAtIndex(args, 0); - [api echoAsyncObject:arg_anObject - completion:^(id _Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + NSArray *arg_aNullableList = GetNullableObjectAtIndex(args, 0); + FlutterError *error; + NSArray *output = [api echoNullableList:arg_aNullableList error:&error]; + callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns the passed list, to test asynchronous serialization and deserialization. + /// Returns the passed list, to test serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncList", + @"HostIntegrationCoreApi.echoNullableEnumList", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncList:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncList:completion:)", + NSCAssert([api respondsToSelector:@selector(echoNullableEnumList:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoNullableEnumList:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSArray *arg_list = GetNullableObjectAtIndex(args, 0); - [api echoAsyncList:arg_list - completion:^(NSArray *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + NSArray *arg_enumList = GetNullableObjectAtIndex(args, 0); + FlutterError *error; + NSArray *output = [api echoNullableEnumList:arg_enumList error:&error]; + callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns the passed map, to test asynchronous serialization and deserialization. + /// Returns the passed list, to test serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncMap", + @"HostIntegrationCoreApi.echoNullableClassList", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert( - [api respondsToSelector:@selector(echoAsyncMap:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncMap:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(echoNullableClassList:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoNullableClassList:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSDictionary *arg_aMap = GetNullableObjectAtIndex(args, 0); - [api echoAsyncMap:arg_aMap - completion:^(NSDictionary *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + NSArray *arg_classList = GetNullableObjectAtIndex(args, 0); + FlutterError *error; + NSArray *output = [api echoNullableClassList:arg_classList + error:&error]; + callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns the passed enum, to test asynchronous serialization and deserialization. + /// Returns the passed list, to test serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncEnum", - messageChannelSuffix] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoNullableNonNullEnumList", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncEnum:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncEnum:completion:)", + NSCAssert([api respondsToSelector:@selector(echoNullableNonNullEnumList:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoNullableNonNullEnumList:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - AnEnumBox *boxedAnEnum = GetNullableObjectAtIndex(args, 0); - AnEnum arg_anEnum = boxedAnEnum.value; - [api echoAsyncEnum:arg_anEnum - completion:^(AnEnumBox *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + NSArray *arg_enumList = GetNullableObjectAtIndex(args, 0); + FlutterError *error; + NSArray *output = [api echoNullableNonNullEnumList:arg_enumList + error:&error]; + callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns the passed enum, to test asynchronous serialization and deserialization. + /// Returns the passed list, to test serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAnotherAsyncEnum", - messageChannelSuffix] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoNullableNonNullClassList", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAnotherAsyncEnum:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAnotherAsyncEnum:completion:)", + NSCAssert([api respondsToSelector:@selector(echoNullableNonNullClassList:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoNullableNonNullClassList:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - AnotherEnumBox *boxedAnotherEnum = GetNullableObjectAtIndex(args, 0); - AnotherEnum arg_anotherEnum = boxedAnotherEnum.value; - [api echoAnotherAsyncEnum:arg_anotherEnum - completion:^(AnotherEnumBox *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + NSArray *arg_classList = GetNullableObjectAtIndex(args, 0); + FlutterError *error; + NSArray *output = [api echoNullableNonNullClassList:arg_classList + error:&error]; + callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Responds with an error from an async function returning a value. + /// Returns the passed map, to test serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.throwAsyncError", + @"HostIntegrationCoreApi.echoNullableMap", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(throwAsyncErrorWithCompletion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(throwAsyncErrorWithCompletion:)", + NSCAssert([api respondsToSelector:@selector(echoNullableMap:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoNullableMap:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - [api throwAsyncErrorWithCompletion:^(id _Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + NSArray *args = message; + NSDictionary *arg_map = GetNullableObjectAtIndex(args, 0); + FlutterError *error; + NSDictionary *output = [api echoNullableMap:arg_map error:&error]; + callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Responds with an error from an async void function. + /// Returns the passed map, to test serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.throwAsyncErrorFromVoid", - messageChannelSuffix] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoNullableStringMap", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(throwAsyncErrorFromVoidWithCompletion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(throwAsyncErrorFromVoidWithCompletion:)", + NSCAssert([api respondsToSelector:@selector(echoNullableStringMap:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoNullableStringMap:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - [api throwAsyncErrorFromVoidWithCompletion:^(FlutterError *_Nullable error) { - callback(wrapResult(nil, error)); - }]; + NSArray *args = message; + NSDictionary *arg_stringMap = GetNullableObjectAtIndex(args, 0); + FlutterError *error; + NSDictionary *output = [api echoNullableStringMap:arg_stringMap + error:&error]; + callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Responds with a Flutter error from an async function returning a value. + /// Returns the passed map, to test serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.throwAsyncFlutterError", + @"HostIntegrationCoreApi.echoNullableIntMap", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(throwAsyncFlutterErrorWithCompletion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(throwAsyncFlutterErrorWithCompletion:)", + NSCAssert([api respondsToSelector:@selector(echoNullableIntMap:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoNullableIntMap:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - [api throwAsyncFlutterErrorWithCompletion:^(id _Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + NSArray *args = message; + NSDictionary *arg_intMap = GetNullableObjectAtIndex(args, 0); + FlutterError *error; + NSDictionary *output = [api echoNullableIntMap:arg_intMap + error:&error]; + callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns the passed object, to test async serialization and deserialization. + /// Returns the passed map, to test serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncAllTypes", + @"HostIntegrationCoreApi.echoNullableEnumMap", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncAllTypes:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncAllTypes:completion:)", + NSCAssert([api respondsToSelector:@selector(echoNullableEnumMap:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoNullableEnumMap:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - AllTypes *arg_everything = GetNullableObjectAtIndex(args, 0); - [api echoAsyncAllTypes:arg_everything - completion:^(AllTypes *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + NSDictionary *arg_enumMap = + GetNullableObjectAtIndex(args, 0); + FlutterError *error; + NSDictionary *output = [api echoNullableEnumMap:arg_enumMap + error:&error]; + callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns the passed object, to test serialization and deserialization. + /// Returns the passed map, to test serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncNullableAllNullableTypes", - messageChannelSuffix] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoNullableClassMap", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableAllNullableTypes:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncNullableAllNullableTypes:completion:)", + NSCAssert([api respondsToSelector:@selector(echoNullableClassMap:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoNullableClassMap:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - AllNullableTypes *arg_everything = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableAllNullableTypes:arg_everything - completion:^(AllNullableTypes *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + NSDictionary *arg_classMap = + GetNullableObjectAtIndex(args, 0); + FlutterError *error; + NSDictionary *output = + [api echoNullableClassMap:arg_classMap error:&error]; + callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns the passed object, to test serialization and deserialization. + /// Returns the passed map, to test serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi." - @"echoAsyncNullableAllNullableTypesWithoutRecursion", + @"HostIntegrationCoreApi.echoNullableNonNullStringMap", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector - (echoAsyncNullableAllNullableTypesWithoutRecursion:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncNullableAllNullableTypesWithoutRecursion:completion:)", + NSCAssert([api respondsToSelector:@selector(echoNullableNonNullStringMap:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoNullableNonNullStringMap:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - AllNullableTypesWithoutRecursion *arg_everything = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableAllNullableTypesWithoutRecursion:arg_everything - completion:^(AllNullableTypesWithoutRecursion - *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + NSDictionary *arg_stringMap = GetNullableObjectAtIndex(args, 0); + FlutterError *error; + NSDictionary *output = + [api echoNullableNonNullStringMap:arg_stringMap error:&error]; + callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns passed in int asynchronously. + /// Returns the passed map, to test serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncNullableInt", - messageChannelSuffix] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoNullableNonNullIntMap", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableInt:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncNullableInt:completion:)", + NSCAssert([api respondsToSelector:@selector(echoNullableNonNullIntMap:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoNullableNonNullIntMap:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSNumber *arg_anInt = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableInt:arg_anInt - completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + NSDictionary *arg_intMap = GetNullableObjectAtIndex(args, 0); + FlutterError *error; + NSDictionary *output = [api echoNullableNonNullIntMap:arg_intMap + error:&error]; + callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns passed in double asynchronously. + /// Returns the passed map, to test serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncNullableDouble", + @"HostIntegrationCoreApi.echoNullableNonNullEnumMap", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableDouble:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncNullableDouble:completion:)", + NSCAssert([api respondsToSelector:@selector(echoNullableNonNullEnumMap:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoNullableNonNullEnumMap:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSNumber *arg_aDouble = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableDouble:arg_aDouble - completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + NSDictionary *arg_enumMap = + GetNullableObjectAtIndex(args, 0); + FlutterError *error; + NSDictionary *output = + [api echoNullableNonNullEnumMap:arg_enumMap error:&error]; + callback(wrapResult(output, error)); + }]; + } else { + [channel setMessageHandler:nil]; + } + } + /// Returns the passed map, to test serialization and deserialization. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoNullableNonNullClassMap", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(echoNullableNonNullClassMap:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoNullableNonNullClassMap:error:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSDictionary *arg_classMap = + GetNullableObjectAtIndex(args, 0); + FlutterError *error; + NSDictionary *output = + [api echoNullableNonNullClassMap:arg_classMap error:&error]; + callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns the passed in boolean asynchronously. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncNullableBool", + @"HostIntegrationCoreApi.echoNullableEnum", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableBool:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncNullableBool:completion:)", + NSCAssert([api respondsToSelector:@selector(echoNullableEnum:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoNullableEnum:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSNumber *arg_aBool = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableBool:arg_aBool - completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + FLTAnEnumBox *arg_anEnum = GetNullableObjectAtIndex(args, 0); + FlutterError *error; + FLTAnEnumBox *output = [api echoNullableEnum:arg_anEnum error:&error]; + callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns the passed string asynchronously. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncNullableString", + @"HostIntegrationCoreApi.echoAnotherNullableEnum", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableString:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncNullableString:completion:)", + NSCAssert([api respondsToSelector:@selector(echoAnotherNullableEnum:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAnotherNullableEnum:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSString *arg_aString = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableString:arg_aString - completion:^(NSString *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + FLTAnotherEnumBox *arg_anotherEnum = GetNullableObjectAtIndex(args, 0); + FlutterError *error; + FLTAnotherEnumBox *output = [api echoAnotherNullableEnum:arg_anotherEnum error:&error]; + callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns the passed in Uint8List asynchronously. + /// Returns passed in int. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncNullableUint8List", + @"HostIntegrationCoreApi.echoOptionalNullableInt", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableUint8List:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncNullableUint8List:completion:)", + NSCAssert([api respondsToSelector:@selector(echoOptionalNullableInt:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoOptionalNullableInt:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - FlutterStandardTypedData *arg_aUint8List = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableUint8List:arg_aUint8List - completion:^(FlutterStandardTypedData *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + NSNumber *arg_aNullableInt = GetNullableObjectAtIndex(args, 0); + FlutterError *error; + NSNumber *output = [api echoOptionalNullableInt:arg_aNullableInt error:&error]; + callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns the passed in generic Object asynchronously. + /// Returns the passed in string. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncNullableObject", + @"HostIntegrationCoreApi.echoNamedNullableString", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableObject:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncNullableObject:completion:)", + NSCAssert([api respondsToSelector:@selector(echoNamedNullableString:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoNamedNullableString:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - id arg_anObject = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableObject:arg_anObject - completion:^(id _Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + NSString *arg_aNullableString = GetNullableObjectAtIndex(args, 0); + FlutterError *error; + NSString *output = [api echoNamedNullableString:arg_aNullableString error:&error]; + callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns the passed list, to test asynchronous serialization and deserialization. + /// A no-op function taking no arguments and returning no value, to sanity + /// test basic asynchronous calling. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncNullableList", + @"HostIntegrationCoreApi.noopAsync", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableList:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncNullableList:completion:)", + NSCAssert([api respondsToSelector:@selector(noopAsyncWithCompletion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(noopAsyncWithCompletion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSArray *arg_list = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableList:arg_list - completion:^(NSArray *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api noopAsyncWithCompletion:^(FlutterError *_Nullable error) { + callback(wrapResult(nil, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } - /// Returns the passed map, to test asynchronous serialization and deserialization. + /// Returns passed in int asynchronously. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncNullableMap", + @"HostIntegrationCoreApi.echoAsyncInt", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableMap:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncNullableMap:completion:)", + NSCAssert([api respondsToSelector:@selector(echoAsyncInt:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncInt:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSDictionary *arg_aMap = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableMap:arg_aMap - completion:^(NSDictionary *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + NSInteger arg_anInt = [GetNullableObjectAtIndex(args, 0) integerValue]; + [api echoAsyncInt:arg_anInt + completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } - /// Returns the passed enum, to test asynchronous serialization and deserialization. + /// Returns passed in double asynchronously. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncNullableEnum", + @"HostIntegrationCoreApi.echoAsyncDouble", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableEnum:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncNullableEnum:completion:)", + NSCAssert([api respondsToSelector:@selector(echoAsyncDouble:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncDouble:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - AnEnumBox *arg_anEnum = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableEnum:arg_anEnum - completion:^(AnEnumBox *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + double arg_aDouble = [GetNullableObjectAtIndex(args, 0) doubleValue]; + [api echoAsyncDouble:arg_aDouble + completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } - /// Returns the passed enum, to test asynchronous serialization and deserialization. + /// Returns the passed in boolean asynchronously. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAnotherAsyncNullableEnum", - messageChannelSuffix] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncBool", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAnotherAsyncNullableEnum:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAnotherAsyncNullableEnum:completion:)", + NSCAssert([api respondsToSelector:@selector(echoAsyncBool:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncBool:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - AnotherEnumBox *arg_anotherEnum = GetNullableObjectAtIndex(args, 0); - [api echoAnotherAsyncNullableEnum:arg_anotherEnum - completion:^(AnotherEnumBox *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; - }]; - } else { + BOOL arg_aBool = [GetNullableObjectAtIndex(args, 0) boolValue]; + [api echoAsyncBool:arg_aBool + completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { [channel setMessageHandler:nil]; } } + /// Returns the passed string asynchronously. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterNoop", + @"HostIntegrationCoreApi.echoAsyncString", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterNoopWithCompletion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterNoopWithCompletion:)", + NSCAssert([api respondsToSelector:@selector(echoAsyncString:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncString:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - [api callFlutterNoopWithCompletion:^(FlutterError *_Nullable error) { - callback(wrapResult(nil, error)); - }]; + NSArray *args = message; + NSString *arg_aString = GetNullableObjectAtIndex(args, 0); + [api echoAsyncString:arg_aString + completion:^(NSString *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } + /// Returns the passed in Uint8List asynchronously. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterThrowError", + @"HostIntegrationCoreApi.echoAsyncUint8List", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterThrowErrorWithCompletion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterThrowErrorWithCompletion:)", + NSCAssert([api respondsToSelector:@selector(echoAsyncUint8List:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncUint8List:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - [api callFlutterThrowErrorWithCompletion:^(id _Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + NSArray *args = message; + FlutterStandardTypedData *arg_aUint8List = GetNullableObjectAtIndex(args, 0); + [api echoAsyncUint8List:arg_aUint8List + completion:^(FlutterStandardTypedData *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } + /// Returns the passed in generic Object asynchronously. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterThrowErrorFromVoid", - messageChannelSuffix] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncObject", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterThrowErrorFromVoidWithCompletion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterThrowErrorFromVoidWithCompletion:)", + NSCAssert([api respondsToSelector:@selector(echoAsyncObject:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncObject:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - [api callFlutterThrowErrorFromVoidWithCompletion:^(FlutterError *_Nullable error) { - callback(wrapResult(nil, error)); - }]; + NSArray *args = message; + id arg_anObject = GetNullableObjectAtIndex(args, 0); + [api echoAsyncObject:arg_anObject + completion:^(id _Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } + /// Returns the passed list, to test asynchronous serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoAllTypes", - messageChannelSuffix] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncList", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoAllTypes:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoAllTypes:completion:)", + NSCAssert([api respondsToSelector:@selector(echoAsyncList:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncList:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - AllTypes *arg_everything = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoAllTypes:arg_everything - completion:^(AllTypes *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + NSArray *arg_list = GetNullableObjectAtIndex(args, 0); + [api echoAsyncList:arg_list + completion:^(NSArray *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } + /// Returns the passed list, to test asynchronous serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoAllNullableTypes", - messageChannelSuffix] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncEnumList", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoAllNullableTypes:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoAllNullableTypes:completion:)", + NSCAssert([api respondsToSelector:@selector(echoAsyncEnumList:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncEnumList:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - AllNullableTypes *arg_everything = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoAllNullableTypes:arg_everything - completion:^(AllNullableTypes *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + NSArray *arg_enumList = GetNullableObjectAtIndex(args, 0); + [api echoAsyncEnumList:arg_enumList + completion:^(NSArray *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } + /// Returns the passed list, to test asynchronous serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - [NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterSendMultipleNullableTypes", - messageChannelSuffix] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncClassList", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector - (callFlutterSendMultipleNullableTypesABool:anInt:aString:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterSendMultipleNullableTypesABool:anInt:aString:completion:)", + NSCAssert([api respondsToSelector:@selector(echoAsyncClassList:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncClassList:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSNumber *arg_aNullableBool = GetNullableObjectAtIndex(args, 0); - NSNumber *arg_aNullableInt = GetNullableObjectAtIndex(args, 1); - NSString *arg_aNullableString = GetNullableObjectAtIndex(args, 2); - [api callFlutterSendMultipleNullableTypesABool:arg_aNullableBool - anInt:arg_aNullableInt - aString:arg_aNullableString - completion:^(AllNullableTypes *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + NSArray *arg_classList = GetNullableObjectAtIndex(args, 0); + [api echoAsyncClassList:arg_classList + completion:^(NSArray *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } + /// Returns the passed map, to test asynchronous serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi." - @"callFlutterEchoAllNullableTypesWithoutRecursion", - messageChannelSuffix] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncMap", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector - (callFlutterEchoAllNullableTypesWithoutRecursion:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoAllNullableTypesWithoutRecursion:completion:)", + NSCAssert([api respondsToSelector:@selector(echoAsyncMap:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncMap:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - AllNullableTypesWithoutRecursion *arg_everything = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoAllNullableTypesWithoutRecursion:arg_everything - completion:^(AllNullableTypesWithoutRecursion - *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + NSDictionary *arg_map = GetNullableObjectAtIndex(args, 0); + [api echoAsyncMap:arg_map + completion:^(NSDictionary *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } + /// Returns the passed map, to test asynchronous serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - [NSString stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"callFlutterSendMultipleNullableTypesWithoutRecursion", - messageChannelSuffix] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncStringMap", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert( - [api respondsToSelector:@selector - (callFlutterSendMultipleNullableTypesWithoutRecursionABool: - anInt:aString:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterSendMultipleNullableTypesWithoutRecursionABool:anInt:aString:" - @"completion:)", - api); + NSCAssert([api respondsToSelector:@selector(echoAsyncStringMap:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncStringMap:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSNumber *arg_aNullableBool = GetNullableObjectAtIndex(args, 0); - NSNumber *arg_aNullableInt = GetNullableObjectAtIndex(args, 1); - NSString *arg_aNullableString = GetNullableObjectAtIndex(args, 2); - [api callFlutterSendMultipleNullableTypesWithoutRecursionABool:arg_aNullableBool - anInt:arg_aNullableInt - aString:arg_aNullableString - completion:^( - AllNullableTypesWithoutRecursion - *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + NSDictionary *arg_stringMap = GetNullableObjectAtIndex(args, 0); + [api echoAsyncStringMap:arg_stringMap + completion:^(NSDictionary *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } + /// Returns the passed map, to test asynchronous serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoBool", + @"HostIntegrationCoreApi.echoAsyncIntMap", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoBool:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoBool:completion:)", + NSCAssert([api respondsToSelector:@selector(echoAsyncIntMap:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncIntMap:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - BOOL arg_aBool = [GetNullableObjectAtIndex(args, 0) boolValue]; - [api callFlutterEchoBool:arg_aBool - completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + NSDictionary *arg_intMap = GetNullableObjectAtIndex(args, 0); + [api echoAsyncIntMap:arg_intMap + completion:^(NSDictionary *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } + /// Returns the passed map, to test asynchronous serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoInt", + @"HostIntegrationCoreApi.echoAsyncEnumMap", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoInt:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoInt:completion:)", + NSCAssert([api respondsToSelector:@selector(echoAsyncEnumMap:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncEnumMap:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSInteger arg_anInt = [GetNullableObjectAtIndex(args, 0) integerValue]; - [api callFlutterEchoInt:arg_anInt - completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + NSDictionary *arg_enumMap = + GetNullableObjectAtIndex(args, 0); + [api echoAsyncEnumMap:arg_enumMap + completion:^(NSDictionary *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } + /// Returns the passed map, to test asynchronous serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoDouble", + @"HostIntegrationCoreApi.echoAsyncClassMap", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoDouble:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoDouble:completion:)", + NSCAssert([api respondsToSelector:@selector(echoAsyncClassMap:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncClassMap:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - double arg_aDouble = [GetNullableObjectAtIndex(args, 0) doubleValue]; - [api callFlutterEchoDouble:arg_aDouble - completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + NSDictionary *arg_classMap = + GetNullableObjectAtIndex(args, 0); + [api echoAsyncClassMap:arg_classMap + completion:^(NSDictionary *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } + /// Returns the passed enum, to test asynchronous serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoString", + @"HostIntegrationCoreApi.echoAsyncEnum", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoString:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoString:completion:)", + NSCAssert([api respondsToSelector:@selector(echoAsyncEnum:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncEnum:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSString *arg_aString = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoString:arg_aString - completion:^(NSString *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + FLTAnEnumBox *boxedFLTAnEnum = GetNullableObjectAtIndex(args, 0); + FLTAnEnum arg_anEnum = boxedFLTAnEnum.value; + [api echoAsyncEnum:arg_anEnum + completion:^(FLTAnEnumBox *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } + /// Returns the passed enum, to test asynchronous serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoUint8List", - messageChannelSuffix] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAnotherAsyncEnum", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoUint8List:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoUint8List:completion:)", + NSCAssert([api respondsToSelector:@selector(echoAnotherAsyncEnum:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAnotherAsyncEnum:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - FlutterStandardTypedData *arg_list = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoUint8List:arg_list - completion:^(FlutterStandardTypedData *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + FLTAnotherEnumBox *boxedFLTAnotherEnum = GetNullableObjectAtIndex(args, 0); + FLTAnotherEnum arg_anotherEnum = boxedFLTAnotherEnum.value; + [api echoAnotherAsyncEnum:arg_anotherEnum + completion:^(FLTAnotherEnumBox *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } + /// Responds with an error from an async function returning a value. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoList", + @"HostIntegrationCoreApi.throwAsyncError", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoList:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoList:completion:)", + NSCAssert([api respondsToSelector:@selector(throwAsyncErrorWithCompletion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(throwAsyncErrorWithCompletion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSArray *arg_list = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoList:arg_list - completion:^(NSArray *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api throwAsyncErrorWithCompletion:^(id _Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } + /// Responds with an error from an async void function. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoMap", - messageChannelSuffix] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.throwAsyncErrorFromVoid", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoMap:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoMap:completion:)", + NSCAssert([api respondsToSelector:@selector(throwAsyncErrorFromVoidWithCompletion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(throwAsyncErrorFromVoidWithCompletion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSDictionary *arg_aMap = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoMap:arg_aMap - completion:^(NSDictionary *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api throwAsyncErrorFromVoidWithCompletion:^(FlutterError *_Nullable error) { + callback(wrapResult(nil, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } + /// Responds with a Flutter error from an async function returning a value. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoEnum", + @"HostIntegrationCoreApi.throwAsyncFlutterError", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoEnum:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoEnum:completion:)", + NSCAssert([api respondsToSelector:@selector(throwAsyncFlutterErrorWithCompletion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(throwAsyncFlutterErrorWithCompletion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - AnEnumBox *boxedAnEnum = GetNullableObjectAtIndex(args, 0); - AnEnum arg_anEnum = boxedAnEnum.value; - [api callFlutterEchoEnum:arg_anEnum - completion:^(AnEnumBox *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api throwAsyncFlutterErrorWithCompletion:^(id _Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } + /// Returns the passed object, to test async serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoAnotherEnum", - messageChannelSuffix] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncAllTypes", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoAnotherEnum:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoAnotherEnum:completion:)", + NSCAssert([api respondsToSelector:@selector(echoAsyncAllTypes:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncAllTypes:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - AnotherEnumBox *boxedAnotherEnum = GetNullableObjectAtIndex(args, 0); - AnotherEnum arg_anotherEnum = boxedAnotherEnum.value; - [api callFlutterEchoAnotherEnum:arg_anotherEnum - completion:^(AnotherEnumBox *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + FLTAllTypes *arg_everything = GetNullableObjectAtIndex(args, 0); + [api echoAsyncAllTypes:arg_everything + completion:^(FLTAllTypes *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } + /// Returns the passed object, to test serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoNullableBool", - messageChannelSuffix] + initWithName:[NSString stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncNullableAllNullableTypes", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableBool:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoNullableBool:completion:)", + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableAllNullableTypes:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncNullableAllNullableTypes:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSNumber *arg_aBool = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoNullableBool:arg_aBool - completion:^(NSNumber *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + FLTAllNullableTypes *arg_everything = GetNullableObjectAtIndex(args, 0); + [api echoAsyncNullableAllNullableTypes:arg_everything + completion:^(FLTAllNullableTypes *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } + /// Returns the passed object, to test serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoNullableInt", + @"HostIntegrationCoreApi." + @"echoAsyncNullableAllNullableTypesWithoutRecursion", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableInt:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoNullableInt:completion:)", + NSCAssert([api respondsToSelector:@selector + (echoAsyncNullableAllNullableTypesWithoutRecursion:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncNullableAllNullableTypesWithoutRecursion:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSNumber *arg_anInt = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoNullableInt:arg_anInt - completion:^(NSNumber *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + FLTAllNullableTypesWithoutRecursion *arg_everything = GetNullableObjectAtIndex(args, 0); + [api echoAsyncNullableAllNullableTypesWithoutRecursion:arg_everything + completion:^(FLTAllNullableTypesWithoutRecursion + *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } + /// Returns passed in int asynchronously. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoNullableDouble", - messageChannelSuffix] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncNullableInt", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableDouble:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoNullableDouble:completion:)", + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableInt:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncNullableInt:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSNumber *arg_aDouble = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoNullableDouble:arg_aDouble - completion:^(NSNumber *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + NSNumber *arg_anInt = GetNullableObjectAtIndex(args, 0); + [api echoAsyncNullableInt:arg_anInt + completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } + /// Returns passed in double asynchronously. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoNullableString", - messageChannelSuffix] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncNullableDouble", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableString:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoNullableString:completion:)", + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableDouble:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncNullableDouble:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSString *arg_aString = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoNullableString:arg_aString - completion:^(NSString *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + NSNumber *arg_aDouble = GetNullableObjectAtIndex(args, 0); + [api echoAsyncNullableDouble:arg_aDouble + completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } + /// Returns the passed in boolean asynchronously. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoNullableUint8List", - messageChannelSuffix] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncNullableBool", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableUint8List:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoNullableUint8List:completion:)", + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableBool:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncNullableBool:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - FlutterStandardTypedData *arg_list = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoNullableUint8List:arg_list - completion:^(FlutterStandardTypedData *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + NSNumber *arg_aBool = GetNullableObjectAtIndex(args, 0); + [api echoAsyncNullableBool:arg_aBool + completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } + /// Returns the passed string asynchronously. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoNullableList", + @"HostIntegrationCoreApi.echoAsyncNullableString", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableList:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoNullableList:completion:)", + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableString:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncNullableString:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSArray *arg_list = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoNullableList:arg_list - completion:^(NSArray *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + NSString *arg_aString = GetNullableObjectAtIndex(args, 0); + [api echoAsyncNullableString:arg_aString + completion:^(NSString *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } + /// Returns the passed in Uint8List asynchronously. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoNullableMap", + @"HostIntegrationCoreApi.echoAsyncNullableUint8List", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableMap:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoNullableMap:completion:)", + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableUint8List:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncNullableUint8List:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSDictionary *arg_aMap = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoNullableMap:arg_aMap - completion:^(NSDictionary *_Nullable output, + FlutterStandardTypedData *arg_aUint8List = GetNullableObjectAtIndex(args, 0); + [api echoAsyncNullableUint8List:arg_aUint8List + completion:^(FlutterStandardTypedData *_Nullable output, FlutterError *_Nullable error) { callback(wrapResult(output, error)); }]; @@ -2835,55 +3012,353 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess [channel setMessageHandler:nil]; } } + /// Returns the passed in generic Object asynchronously. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoNullableEnum", + @"HostIntegrationCoreApi.echoAsyncNullableObject", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableEnum:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoNullableEnum:completion:)", + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableObject:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncNullableObject:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - AnEnumBox *arg_anEnum = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoNullableEnum:arg_anEnum - completion:^(AnEnumBox *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + id arg_anObject = GetNullableObjectAtIndex(args, 0); + [api echoAsyncNullableObject:arg_anObject + completion:^(id _Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } + /// Returns the passed list, to test asynchronous serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoAnotherNullableEnum", - messageChannelSuffix] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncNullableList", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoAnotherNullableEnum:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoAnotherNullableEnum:completion:)", + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableList:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncNullableList:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - AnotherEnumBox *arg_anotherEnum = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoAnotherNullableEnum:arg_anotherEnum - completion:^(AnotherEnumBox *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + NSArray *arg_list = GetNullableObjectAtIndex(args, 0); + [api echoAsyncNullableList:arg_list + completion:^(NSArray *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + /// Returns the passed list, to test asynchronous serialization and deserialization. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncNullableEnumList", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableEnumList:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncNullableEnumList:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSArray *arg_enumList = GetNullableObjectAtIndex(args, 0); + [api echoAsyncNullableEnumList:arg_enumList + completion:^(NSArray *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + /// Returns the passed list, to test asynchronous serialization and deserialization. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncNullableClassList", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableClassList:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncNullableClassList:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSArray *arg_classList = GetNullableObjectAtIndex(args, 0); + [api echoAsyncNullableClassList:arg_classList + completion:^(NSArray *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + /// Returns the passed map, to test asynchronous serialization and deserialization. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncNullableMap", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableMap:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncNullableMap:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSDictionary *arg_map = GetNullableObjectAtIndex(args, 0); + [api echoAsyncNullableMap:arg_map + completion:^(NSDictionary *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + /// Returns the passed map, to test asynchronous serialization and deserialization. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncNullableStringMap", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableStringMap:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncNullableStringMap:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSDictionary *arg_stringMap = GetNullableObjectAtIndex(args, 0); + [api echoAsyncNullableStringMap:arg_stringMap + completion:^(NSDictionary *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + /// Returns the passed map, to test asynchronous serialization and deserialization. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncNullableIntMap", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableIntMap:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncNullableIntMap:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSDictionary *arg_intMap = GetNullableObjectAtIndex(args, 0); + [api echoAsyncNullableIntMap:arg_intMap + completion:^(NSDictionary *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + /// Returns the passed map, to test asynchronous serialization and deserialization. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncNullableEnumMap", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableEnumMap:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncNullableEnumMap:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSDictionary *arg_enumMap = + GetNullableObjectAtIndex(args, 0); + [api echoAsyncNullableEnumMap:arg_enumMap + completion:^( + NSDictionary *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + /// Returns the passed map, to test asynchronous serialization and deserialization. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncNullableClassMap", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableClassMap:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncNullableClassMap:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSDictionary *arg_classMap = + GetNullableObjectAtIndex(args, 0); + [api echoAsyncNullableClassMap:arg_classMap + completion:^( + NSDictionary *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + /// Returns the passed enum, to test asynchronous serialization and deserialization. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncNullableEnum", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableEnum:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncNullableEnum:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + FLTAnEnumBox *arg_anEnum = GetNullableObjectAtIndex(args, 0); + [api + echoAsyncNullableEnum:arg_anEnum + completion:^(FLTAnEnumBox *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + /// Returns the passed enum, to test asynchronous serialization and deserialization. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAnotherAsyncNullableEnum", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(echoAnotherAsyncNullableEnum:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAnotherAsyncNullableEnum:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + FLTAnotherEnumBox *arg_anotherEnum = GetNullableObjectAtIndex(args, 0); + [api echoAnotherAsyncNullableEnum:arg_anotherEnum + completion:^(FLTAnotherEnumBox *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterNoop", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterNoopWithCompletion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterNoopWithCompletion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + [api callFlutterNoopWithCompletion:^(FlutterError *_Nullable error) { + callback(wrapResult(nil, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterThrowError", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterThrowErrorWithCompletion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterThrowErrorWithCompletion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + [api callFlutterThrowErrorWithCompletion:^(id _Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -2894,85 +3369,1930 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess initWithName: [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterSmallApiEchoString", + @"HostIntegrationCoreApi.callFlutterThrowErrorFromVoid", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterSmallApiEchoString:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterSmallApiEchoString:completion:)", + NSCAssert([api respondsToSelector:@selector(callFlutterThrowErrorFromVoidWithCompletion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterThrowErrorFromVoidWithCompletion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + [api callFlutterThrowErrorFromVoidWithCompletion:^(FlutterError *_Nullable error) { + callback(wrapResult(nil, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoAllTypes", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoAllTypes:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoAllTypes:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSString *arg_aString = GetNullableObjectAtIndex(args, 0); - [api callFlutterSmallApiEchoString:arg_aString - completion:^(NSString *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + FLTAllTypes *arg_everything = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoAllTypes:arg_everything + completion:^(FLTAllTypes *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName: + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoAllNullableTypes", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoAllNullableTypes:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoAllNullableTypes:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + FLTAllNullableTypes *arg_everything = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoAllNullableTypes:arg_everything + completion:^(FLTAllNullableTypes *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName: + [NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterSendMultipleNullableTypes", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector + (callFlutterSendMultipleNullableTypesABool:anInt:aString:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterSendMultipleNullableTypesABool:anInt:aString:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSNumber *arg_aNullableBool = GetNullableObjectAtIndex(args, 0); + NSNumber *arg_aNullableInt = GetNullableObjectAtIndex(args, 1); + NSString *arg_aNullableString = GetNullableObjectAtIndex(args, 2); + [api callFlutterSendMultipleNullableTypesABool:arg_aNullableBool + anInt:arg_aNullableInt + aString:arg_aNullableString + completion:^(FLTAllNullableTypes *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi." + @"callFlutterEchoAllNullableTypesWithoutRecursion", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector + (callFlutterEchoAllNullableTypesWithoutRecursion:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoAllNullableTypesWithoutRecursion:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + FLTAllNullableTypesWithoutRecursion *arg_everything = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoAllNullableTypesWithoutRecursion:arg_everything + completion:^(FLTAllNullableTypesWithoutRecursion + *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName: + [NSString stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + @"callFlutterSendMultipleNullableTypesWithoutRecursion", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert( + [api respondsToSelector:@selector + (callFlutterSendMultipleNullableTypesWithoutRecursionABool: + anInt:aString:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterSendMultipleNullableTypesWithoutRecursionABool:anInt:aString:" + @"completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSNumber *arg_aNullableBool = GetNullableObjectAtIndex(args, 0); + NSNumber *arg_aNullableInt = GetNullableObjectAtIndex(args, 1); + NSString *arg_aNullableString = GetNullableObjectAtIndex(args, 2); + [api callFlutterSendMultipleNullableTypesWithoutRecursionABool:arg_aNullableBool + anInt:arg_aNullableInt + aString:arg_aNullableString + completion:^( + FLTAllNullableTypesWithoutRecursion + *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoBool", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoBool:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoBool:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + BOOL arg_aBool = [GetNullableObjectAtIndex(args, 0) boolValue]; + [api callFlutterEchoBool:arg_aBool + completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoInt", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoInt:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoInt:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSInteger arg_anInt = [GetNullableObjectAtIndex(args, 0) integerValue]; + [api callFlutterEchoInt:arg_anInt + completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoDouble", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoDouble:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoDouble:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + double arg_aDouble = [GetNullableObjectAtIndex(args, 0) doubleValue]; + [api callFlutterEchoDouble:arg_aDouble + completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoString", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoString:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoString:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSString *arg_aString = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoString:arg_aString + completion:^(NSString *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoUint8List", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoUint8List:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoUint8List:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + FlutterStandardTypedData *arg_list = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoUint8List:arg_list + completion:^(FlutterStandardTypedData *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoList", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoList:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoList:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSArray *arg_list = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoList:arg_list + completion:^(NSArray *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoEnumList", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoEnumList:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoEnumList:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSArray *arg_enumList = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoEnumList:arg_enumList + completion:^(NSArray *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoClassList", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoClassList:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoClassList:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSArray *arg_classList = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoClassList:arg_classList + completion:^(NSArray *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName: + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoNonNullEnumList", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNonNullEnumList:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoNonNullEnumList:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSArray *arg_enumList = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoNonNullEnumList:arg_enumList + completion:^(NSArray *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName: + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoNonNullClassList", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNonNullClassList:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoNonNullClassList:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSArray *arg_classList = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoNonNullClassList:arg_classList + completion:^(NSArray *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoMap", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoMap:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoMap:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSDictionary *arg_map = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoMap:arg_map + completion:^(NSDictionary *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoStringMap", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoStringMap:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoStringMap:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSDictionary *arg_stringMap = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoStringMap:arg_stringMap + completion:^(NSDictionary *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoIntMap", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoIntMap:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoIntMap:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSDictionary *arg_intMap = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoIntMap:arg_intMap + completion:^(NSDictionary *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoEnumMap", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoEnumMap:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoEnumMap:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSDictionary *arg_enumMap = + GetNullableObjectAtIndex(args, 0); + [api + callFlutterEchoEnumMap:arg_enumMap + completion:^(NSDictionary *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoClassMap", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoClassMap:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoClassMap:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSDictionary *arg_classMap = + GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoClassMap:arg_classMap + completion:^( + NSDictionary *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName: + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoNonNullStringMap", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNonNullStringMap:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoNonNullStringMap:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSDictionary *arg_stringMap = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoNonNullStringMap:arg_stringMap + completion:^( + NSDictionary *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoNonNullIntMap", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNonNullIntMap:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoNonNullIntMap:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSDictionary *arg_intMap = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoNonNullIntMap:arg_intMap + completion:^(NSDictionary *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName: + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoNonNullEnumMap", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNonNullEnumMap:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoNonNullEnumMap:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSDictionary *arg_enumMap = + GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoNonNullEnumMap:arg_enumMap + completion:^( + NSDictionary *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName: + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoNonNullClassMap", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNonNullClassMap:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoNonNullClassMap:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSDictionary *arg_classMap = + GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoNonNullClassMap:arg_classMap + completion:^(NSDictionary + *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoEnum", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoEnum:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoEnum:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + FLTAnEnumBox *boxedFLTAnEnum = GetNullableObjectAtIndex(args, 0); + FLTAnEnum arg_anEnum = boxedFLTAnEnum.value; + [api callFlutterEchoEnum:arg_anEnum + completion:^(FLTAnEnumBox *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoAnotherEnum", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoAnotherEnum:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoAnotherEnum:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + FLTAnotherEnumBox *boxedFLTAnotherEnum = GetNullableObjectAtIndex(args, 0); + FLTAnotherEnum arg_anotherEnum = boxedFLTAnotherEnum.value; + [api callFlutterEchoAnotherEnum:arg_anotherEnum + completion:^(FLTAnotherEnumBox *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoNullableBool", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableBool:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoNullableBool:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSNumber *arg_aBool = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoNullableBool:arg_aBool + completion:^(NSNumber *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoNullableInt", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableInt:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoNullableInt:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSNumber *arg_anInt = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoNullableInt:arg_anInt + completion:^(NSNumber *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName: + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoNullableDouble", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableDouble:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoNullableDouble:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSNumber *arg_aDouble = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoNullableDouble:arg_aDouble + completion:^(NSNumber *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName: + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoNullableString", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableString:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoNullableString:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSString *arg_aString = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoNullableString:arg_aString + completion:^(NSString *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoNullableUint8List", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableUint8List:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoNullableUint8List:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + FlutterStandardTypedData *arg_list = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoNullableUint8List:arg_list + completion:^(FlutterStandardTypedData *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoNullableList", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableList:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoNullableList:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSArray *arg_list = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoNullableList:arg_list + completion:^(NSArray *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName: + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoNullableEnumList", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableEnumList:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoNullableEnumList:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSArray *arg_enumList = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoNullableEnumList:arg_enumList + completion:^(NSArray *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoNullableClassList", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableClassList:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoNullableClassList:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSArray *arg_classList = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoNullableClassList:arg_classList + completion:^(NSArray *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoNullableNonNullEnumList", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableNonNullEnumList: + completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoNullableNonNullEnumList:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSArray *arg_enumList = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoNullableNonNullEnumList:arg_enumList + completion:^(NSArray *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoNullableNonNullClassList", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableNonNullClassList: + completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoNullableNonNullClassList:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSArray *arg_classList = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoNullableNonNullClassList:arg_classList + completion:^( + NSArray *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoNullableMap", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableMap:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoNullableMap:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSDictionary *arg_map = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoNullableMap:arg_map + completion:^(NSDictionary *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoNullableStringMap", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableStringMap:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoNullableStringMap:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSDictionary *arg_stringMap = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoNullableStringMap:arg_stringMap + completion:^( + NSDictionary *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName: + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoNullableIntMap", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableIntMap:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoNullableIntMap:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSDictionary *arg_intMap = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoNullableIntMap:arg_intMap + completion:^(NSDictionary *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName: + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoNullableEnumMap", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableEnumMap:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoNullableEnumMap:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSDictionary *arg_enumMap = + GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoNullableEnumMap:arg_enumMap + completion:^( + NSDictionary *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName: + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoNullableClassMap", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableClassMap:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoNullableClassMap:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSDictionary *arg_classMap = + GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoNullableClassMap:arg_classMap + completion:^(NSDictionary + *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoNullableNonNullStringMap", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableNonNullStringMap: + completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoNullableNonNullStringMap:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSDictionary *arg_stringMap = GetNullableObjectAtIndex(args, 0); + [api + callFlutterEchoNullableNonNullStringMap:arg_stringMap + completion:^( + NSDictionary *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName: + [NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoNullableNonNullIntMap", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableNonNullIntMap: + completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoNullableNonNullIntMap:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSDictionary *arg_intMap = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoNullableNonNullIntMap:arg_intMap + completion:^( + NSDictionary *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName: + [NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoNullableNonNullEnumMap", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableNonNullEnumMap: + completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoNullableNonNullEnumMap:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSDictionary *arg_enumMap = + GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoNullableNonNullEnumMap:arg_enumMap + completion:^(NSDictionary + *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoNullableNonNullClassMap", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableNonNullClassMap: + completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoNullableNonNullClassMap:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSDictionary *arg_classMap = + GetNullableObjectAtIndex(args, 0); + [api + callFlutterEchoNullableNonNullClassMap:arg_classMap + completion:^(NSDictionary + *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoNullableEnum", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableEnum:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoNullableEnum:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + FLTAnEnumBox *arg_anEnum = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoNullableEnum:arg_anEnum + completion:^(FLTAnEnumBox *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoAnotherNullableEnum", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoAnotherNullableEnum:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoAnotherNullableEnum:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + FLTAnotherEnumBox *arg_anotherEnum = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoAnotherNullableEnum:arg_anotherEnum + completion:^(FLTAnotherEnumBox *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName: + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterSmallApiEchoString", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterSmallApiEchoString:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterSmallApiEchoString:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSString *arg_aString = GetNullableObjectAtIndex(args, 0); + [api callFlutterSmallApiEchoString:arg_aString + completion:^(NSString *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } +} +@interface FLTFlutterIntegrationCoreApi () +@property(nonatomic, strong) NSObject *binaryMessenger; +@property(nonatomic, strong) NSString *messageChannelSuffix; +@end + +@implementation FLTFlutterIntegrationCoreApi + +- (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger { + return [self initWithBinaryMessenger:binaryMessenger messageChannelSuffix:@""]; +} +- (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger + messageChannelSuffix:(nullable NSString *)messageChannelSuffix { + self = [self init]; + if (self) { + _binaryMessenger = binaryMessenger; + _messageChannelSuffix = [messageChannelSuffix length] == 0 + ? @"" + : [NSString stringWithFormat:@".%@", messageChannelSuffix]; + } + return self; +} +- (void)noopWithCompletion:(void (^)(FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noop", + _messageChannelSuffix]; + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:nil + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion([FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + completion(nil); + } + } else { + completion(createConnectionError(channelName)); + } + }]; +} +- (void)throwErrorWithCompletion:(void (^)(id _Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwError", + _messageChannelSuffix]; + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:nil + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + id output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)throwErrorFromVoidWithCompletion:(void (^)(FlutterError *_Nullable))completion { + NSString *channelName = + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"FlutterIntegrationCoreApi.throwErrorFromVoid", + _messageChannelSuffix]; + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:nil + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion([FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + completion(nil); + } + } else { + completion(createConnectionError(channelName)); + } + }]; +} +- (void)echoAllTypes:(FLTAllTypes *)arg_everything + completion:(void (^)(FLTAllTypes *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllTypes", + _messageChannelSuffix]; + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ arg_everything ?: [NSNull null] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + FLTAllTypes *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoAllNullableTypes:(nullable FLTAllNullableTypes *)arg_everything + completion:(void (^)(FLTAllNullableTypes *_Nullable, + FlutterError *_Nullable))completion { + NSString *channelName = + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"FlutterIntegrationCoreApi.echoAllNullableTypes", + _messageChannelSuffix]; + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ arg_everything ?: [NSNull null] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + FLTAllNullableTypes *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)sendMultipleNullableTypesABool:(nullable NSNumber *)arg_aNullableBool + anInt:(nullable NSNumber *)arg_aNullableInt + aString:(nullable NSString *)arg_aNullableString + completion:(void (^)(FLTAllNullableTypes *_Nullable, + FlutterError *_Nullable))completion { + NSString *channelName = + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"FlutterIntegrationCoreApi.sendMultipleNullableTypes", + _messageChannelSuffix]; + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ + arg_aNullableBool ?: [NSNull null], arg_aNullableInt ?: [NSNull null], + arg_aNullableString ?: [NSNull null] + ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + FLTAllNullableTypes *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoAllNullableTypesWithoutRecursion: + (nullable FLTAllNullableTypesWithoutRecursion *)arg_everything + completion: + (void (^)(FLTAllNullableTypesWithoutRecursion *_Nullable, + FlutterError *_Nullable))completion { + NSString *channelName = + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"FlutterIntegrationCoreApi.echoAllNullableTypesWithoutRecursion", + _messageChannelSuffix]; + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ arg_everything ?: [NSNull null] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + FLTAllNullableTypesWithoutRecursion *output = + reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)sendMultipleNullableTypesWithoutRecursionABool:(nullable NSNumber *)arg_aNullableBool + anInt:(nullable NSNumber *)arg_aNullableInt + aString:(nullable NSString *)arg_aNullableString + completion: + (void (^)( + FLTAllNullableTypesWithoutRecursion *_Nullable, + FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + @"sendMultipleNullableTypesWithoutRecursion", + _messageChannelSuffix]; + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ + arg_aNullableBool ?: [NSNull null], arg_aNullableInt ?: [NSNull null], + arg_aNullableString ?: [NSNull null] + ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + FLTAllNullableTypesWithoutRecursion *output = + reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoBool:(BOOL)arg_aBool + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoBool", + _messageChannelSuffix]; + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ @(arg_aBool) ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoInt:(NSInteger)arg_anInt + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoInt", + _messageChannelSuffix]; + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ @(arg_anInt) ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoDouble:(double)arg_aDouble + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoDouble", + _messageChannelSuffix]; + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ @(arg_aDouble) ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoString:(NSString *)arg_aString + completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoString", + _messageChannelSuffix]; + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ arg_aString ?: [NSNull null] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + NSString *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoUint8List:(FlutterStandardTypedData *)arg_list + completion: + (void (^)(FlutterStandardTypedData *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoUint8List", + _messageChannelSuffix]; + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ arg_list ?: [NSNull null] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + FlutterStandardTypedData *output = + reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoList:(NSArray *)arg_list + completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoList", + _messageChannelSuffix]; + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ arg_list ?: [NSNull null] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + NSArray *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoEnumList:(NSArray *)arg_enumList + completion: + (void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnumList", + _messageChannelSuffix]; + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ arg_enumList ?: [NSNull null] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + NSArray *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; } -@interface FlutterIntegrationCoreApi () -@property(nonatomic, strong) NSObject *binaryMessenger; -@property(nonatomic, strong) NSString *messageChannelSuffix; -@end - -@implementation FlutterIntegrationCoreApi - -- (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger { - return [self initWithBinaryMessenger:binaryMessenger messageChannelSuffix:@""]; +- (void)echoClassList:(NSArray *)arg_classList + completion:(void (^)(NSArray *_Nullable, + FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoClassList", + _messageChannelSuffix]; + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ arg_classList ?: [NSNull null] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + NSArray *output = + reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; } -- (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger - messageChannelSuffix:(nullable NSString *)messageChannelSuffix { - self = [self init]; - if (self) { - _binaryMessenger = binaryMessenger; - _messageChannelSuffix = [messageChannelSuffix length] == 0 - ? @"" - : [NSString stringWithFormat:@".%@", messageChannelSuffix]; - } - return self; +- (void)echoNonNullEnumList:(NSArray *)arg_enumList + completion:(void (^)(NSArray *_Nullable, + FlutterError *_Nullable))completion { + NSString *channelName = + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"FlutterIntegrationCoreApi.echoNonNullEnumList", + _messageChannelSuffix]; + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ arg_enumList ?: [NSNull null] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + NSArray *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; } -- (void)noopWithCompletion:(void (^)(FlutterError *_Nullable))completion { +- (void)echoNonNullClassList:(NSArray *)arg_classList + completion:(void (^)(NSArray *_Nullable, + FlutterError *_Nullable))completion { + NSString *channelName = + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"FlutterIntegrationCoreApi.echoNonNullClassList", + _messageChannelSuffix]; + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ arg_classList ?: [NSNull null] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + NSArray *output = + reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoMap:(NSDictionary *)arg_map + completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion { NSString *channelName = [NSString stringWithFormat: - @"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noop", + @"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoMap", _messageChannelSuffix]; FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel messageChannelWithName:channelName binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:nil + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ arg_map ?: [NSNull null] ] reply:^(NSArray *reply) { if (reply != nil) { if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); } else { - completion(nil); + NSDictionary *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); } } else { - completion(createConnectionError(channelName)); + completion(nil, createConnectionError(channelName)); } }]; } -- (void)throwErrorWithCompletion:(void (^)(id _Nullable, FlutterError *_Nullable))completion { +- (void)echoStringMap:(NSDictionary *)arg_stringMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { NSString *channelName = [NSString stringWithFormat: @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwError", + @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoStringMap", _messageChannelSuffix]; FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel messageChannelWithName:channelName binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:nil + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ arg_stringMap ?: [NSNull null] ] reply:^(NSArray *reply) { if (reply != nil) { if (reply.count > 1) { @@ -2980,7 +5300,8 @@ - (void)throwErrorWithCompletion:(void (^)(id _Nullable, FlutterError *_Nullable message:reply[1] details:reply[2]]); } else { - id output = reply[0] == [NSNull null] ? nil : reply[0]; + NSDictionary *output = + reply[0] == [NSNull null] ? nil : reply[0]; completion(output, nil); } } else { @@ -2988,43 +5309,220 @@ - (void)throwErrorWithCompletion:(void (^)(id _Nullable, FlutterError *_Nullable } }]; } -- (void)throwErrorFromVoidWithCompletion:(void (^)(FlutterError *_Nullable))completion { +- (void)echoIntMap:(NSDictionary *)arg_intMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoIntMap", + _messageChannelSuffix]; + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ arg_intMap ?: [NSNull null] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + NSDictionary *output = + reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoEnumMap:(NSDictionary *)arg_enumMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnumMap", + _messageChannelSuffix]; + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ arg_enumMap ?: [NSNull null] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + NSDictionary *output = + reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoClassMap:(NSDictionary *)arg_classMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoClassMap", + _messageChannelSuffix]; + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ arg_classMap ?: [NSNull null] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + NSDictionary *output = + reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoNonNullStringMap:(NSDictionary *)arg_stringMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"FlutterIntegrationCoreApi.throwErrorFromVoid", + @"FlutterIntegrationCoreApi.echoNonNullStringMap", _messageChannelSuffix]; FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel messageChannelWithName:channelName binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:nil + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ arg_stringMap ?: [NSNull null] ] reply:^(NSArray *reply) { if (reply != nil) { if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); } else { - completion(nil); + NSDictionary *output = + reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoNonNullIntMap:(NSDictionary *)arg_intMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + NSString *channelName = [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"FlutterIntegrationCoreApi.echoNonNullIntMap", + _messageChannelSuffix]; + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ arg_intMap ?: [NSNull null] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + NSDictionary *output = + reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoNonNullEnumMap:(NSDictionary *)arg_enumMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + NSString *channelName = + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"FlutterIntegrationCoreApi.echoNonNullEnumMap", + _messageChannelSuffix]; + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ arg_enumMap ?: [NSNull null] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + NSDictionary *output = + reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoNonNullClassMap:(NSDictionary *)arg_classMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + NSString *channelName = + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"FlutterIntegrationCoreApi.echoNonNullClassMap", + _messageChannelSuffix]; + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ arg_classMap ?: [NSNull null] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + NSDictionary *output = + reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); } } else { - completion(createConnectionError(channelName)); + completion(nil, createConnectionError(channelName)); } }]; } -- (void)echoAllTypes:(AllTypes *)arg_everything - completion:(void (^)(AllTypes *_Nullable, FlutterError *_Nullable))completion { +- (void)echoEnum:(FLTAnEnum)arg_anEnum + completion:(void (^)(FLTAnEnumBox *_Nullable, FlutterError *_Nullable))completion { NSString *channelName = [NSString stringWithFormat: @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllTypes", + @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnum", _messageChannelSuffix]; FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel messageChannelWithName:channelName binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:@[ arg_everything ?: [NSNull null] ] + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ [[FLTAnEnumBox alloc] initWithValue:arg_anEnum] ] reply:^(NSArray *reply) { if (reply != nil) { if (reply.count > 1) { @@ -3032,7 +5530,7 @@ - (void)echoAllTypes:(AllTypes *)arg_everything message:reply[1] details:reply[2]]); } else { - AllTypes *output = reply[0] == [NSNull null] ? nil : reply[0]; + FLTAnEnumBox *output = reply[0] == [NSNull null] ? nil : reply[0]; completion(output, nil); } } else { @@ -3040,19 +5538,19 @@ - (void)echoAllTypes:(AllTypes *)arg_everything } }]; } -- (void)echoAllNullableTypes:(nullable AllNullableTypes *)arg_everything - completion: - (void (^)(AllNullableTypes *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"FlutterIntegrationCoreApi.echoAllNullableTypes", - _messageChannelSuffix]; +- (void)echoAnotherEnum:(FLTAnotherEnum)arg_anotherEnum + completion: + (void (^)(FLTAnotherEnumBox *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAnotherEnum", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel messageChannelWithName:channelName binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:@[ arg_everything ?: [NSNull null] ] + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ [[FLTAnotherEnumBox alloc] initWithValue:arg_anotherEnum] ] reply:^(NSArray *reply) { if (reply != nil) { if (reply.count > 1) { @@ -3060,7 +5558,7 @@ - (void)echoAllNullableTypes:(nullable AllNullableTypes *)arg_everything message:reply[1] details:reply[2]]); } else { - AllNullableTypes *output = reply[0] == [NSNull null] ? nil : reply[0]; + FLTAnotherEnumBox *output = reply[0] == [NSNull null] ? nil : reply[0]; completion(output, nil); } } else { @@ -3068,24 +5566,18 @@ - (void)echoAllNullableTypes:(nullable AllNullableTypes *)arg_everything } }]; } -- (void)sendMultipleNullableTypesABool:(nullable NSNumber *)arg_aNullableBool - anInt:(nullable NSNumber *)arg_aNullableInt - aString:(nullable NSString *)arg_aNullableString - completion:(void (^)(AllNullableTypes *_Nullable, - FlutterError *_Nullable))completion { - NSString *channelName = - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"FlutterIntegrationCoreApi.sendMultipleNullableTypes", - _messageChannelSuffix]; +- (void)echoNullableBool:(nullable NSNumber *)arg_aBool + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableBool", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel messageChannelWithName:channelName binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:@[ - arg_aNullableBool ?: [NSNull null], arg_aNullableInt ?: [NSNull null], - arg_aNullableString ?: [NSNull null] - ] + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ arg_aBool ?: [NSNull null] ] reply:^(NSArray *reply) { if (reply != nil) { if (reply.count > 1) { @@ -3093,7 +5585,7 @@ - (void)sendMultipleNullableTypesABool:(nullable NSNumber *)arg_aNullableBool message:reply[1] details:reply[2]]); } else { - AllNullableTypes *output = reply[0] == [NSNull null] ? nil : reply[0]; + NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; completion(output, nil); } } else { @@ -3101,20 +5593,18 @@ - (void)sendMultipleNullableTypesABool:(nullable NSNumber *)arg_aNullableBool } }]; } -- (void)echoAllNullableTypesWithoutRecursion: - (nullable AllNullableTypesWithoutRecursion *)arg_everything - completion:(void (^)(AllNullableTypesWithoutRecursion *_Nullable, - FlutterError *_Nullable))completion { - NSString *channelName = - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"FlutterIntegrationCoreApi.echoAllNullableTypesWithoutRecursion", - _messageChannelSuffix]; +- (void)echoNullableInt:(nullable NSNumber *)arg_anInt + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableInt", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel messageChannelWithName:channelName binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:@[ arg_everything ?: [NSNull null] ] + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ arg_anInt ?: [NSNull null] ] reply:^(NSArray *reply) { if (reply != nil) { if (reply.count > 1) { @@ -3122,8 +5612,7 @@ - (void)echoAllNullableTypesWithoutRecursion: message:reply[1] details:reply[2]]); } else { - AllNullableTypesWithoutRecursion *output = - reply[0] == [NSNull null] ? nil : reply[0]; + NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; completion(output, nil); } } else { @@ -3131,26 +5620,18 @@ - (void)echoAllNullableTypesWithoutRecursion: } }]; } -- (void) - sendMultipleNullableTypesWithoutRecursionABool:(nullable NSNumber *)arg_aNullableBool - anInt:(nullable NSNumber *)arg_aNullableInt - aString:(nullable NSString *)arg_aNullableString - completion: - (void (^)(AllNullableTypesWithoutRecursion *_Nullable, - FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - @"sendMultipleNullableTypesWithoutRecursion", - _messageChannelSuffix]; +- (void)echoNullableDouble:(nullable NSNumber *)arg_aDouble + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"FlutterIntegrationCoreApi.echoNullableDouble", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel messageChannelWithName:channelName binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:@[ - arg_aNullableBool ?: [NSNull null], arg_aNullableInt ?: [NSNull null], - arg_aNullableString ?: [NSNull null] - ] + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ arg_aDouble ?: [NSNull null] ] reply:^(NSArray *reply) { if (reply != nil) { if (reply.count > 1) { @@ -3158,8 +5639,7 @@ - (void)echoAllNullableTypesWithoutRecursion: message:reply[1] details:reply[2]]); } else { - AllNullableTypesWithoutRecursion *output = - reply[0] == [NSNull null] ? nil : reply[0]; + NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; completion(output, nil); } } else { @@ -3167,18 +5647,18 @@ - (void)echoAllNullableTypesWithoutRecursion: } }]; } -- (void)echoBool:(BOOL)arg_aBool - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoBool", - _messageChannelSuffix]; +- (void)echoNullableString:(nullable NSString *)arg_aString + completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"FlutterIntegrationCoreApi.echoNullableString", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel messageChannelWithName:channelName binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:@[ @(arg_aBool) ] + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ arg_aString ?: [NSNull null] ] reply:^(NSArray *reply) { if (reply != nil) { if (reply.count > 1) { @@ -3186,7 +5666,7 @@ - (void)echoBool:(BOOL)arg_aBool message:reply[1] details:reply[2]]); } else { - NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; + NSString *output = reply[0] == [NSNull null] ? nil : reply[0]; completion(output, nil); } } else { @@ -3194,17 +5674,19 @@ - (void)echoBool:(BOOL)arg_aBool } }]; } -- (void)echoInt:(NSInteger)arg_anInt - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoInt", - _messageChannelSuffix]; +- (void)echoNullableUint8List:(nullable FlutterStandardTypedData *)arg_list + completion:(void (^)(FlutterStandardTypedData *_Nullable, + FlutterError *_Nullable))completion { + NSString *channelName = + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"FlutterIntegrationCoreApi.echoNullableUint8List", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel messageChannelWithName:channelName binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:@[ @(arg_anInt) ] + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ arg_list ?: [NSNull null] ] reply:^(NSArray *reply) { if (reply != nil) { if (reply.count > 1) { @@ -3212,7 +5694,8 @@ - (void)echoInt:(NSInteger)arg_anInt message:reply[1] details:reply[2]]); } else { - NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; + FlutterStandardTypedData *output = + reply[0] == [NSNull null] ? nil : reply[0]; completion(output, nil); } } else { @@ -3220,18 +5703,18 @@ - (void)echoInt:(NSInteger)arg_anInt } }]; } -- (void)echoDouble:(double)arg_aDouble - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { +- (void)echoNullableList:(nullable NSArray *)arg_list + completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion { NSString *channelName = [NSString stringWithFormat: @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoDouble", + @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableList", _messageChannelSuffix]; FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel messageChannelWithName:channelName binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:@[ @(arg_aDouble) ] + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ arg_list ?: [NSNull null] ] reply:^(NSArray *reply) { if (reply != nil) { if (reply.count > 1) { @@ -3239,7 +5722,7 @@ - (void)echoDouble:(double)arg_aDouble message:reply[1] details:reply[2]]); } else { - NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; + NSArray *output = reply[0] == [NSNull null] ? nil : reply[0]; completion(output, nil); } } else { @@ -3247,18 +5730,19 @@ - (void)echoDouble:(double)arg_aDouble } }]; } -- (void)echoString:(NSString *)arg_aString - completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoString", - _messageChannelSuffix]; +- (void)echoNullableEnumList:(nullable NSArray *)arg_enumList + completion:(void (^)(NSArray *_Nullable, + FlutterError *_Nullable))completion { + NSString *channelName = + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"FlutterIntegrationCoreApi.echoNullableEnumList", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel messageChannelWithName:channelName binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:@[ arg_aString ?: [NSNull null] ] + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ arg_enumList ?: [NSNull null] ] reply:^(NSArray *reply) { if (reply != nil) { if (reply.count > 1) { @@ -3266,7 +5750,7 @@ - (void)echoString:(NSString *)arg_aString message:reply[1] details:reply[2]]); } else { - NSString *output = reply[0] == [NSNull null] ? nil : reply[0]; + NSArray *output = reply[0] == [NSNull null] ? nil : reply[0]; completion(output, nil); } } else { @@ -3274,19 +5758,19 @@ - (void)echoString:(NSString *)arg_aString } }]; } -- (void)echoUint8List:(FlutterStandardTypedData *)arg_list - completion: - (void (^)(FlutterStandardTypedData *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoUint8List", - _messageChannelSuffix]; +- (void)echoNullableClassList:(nullable NSArray *)arg_classList + completion:(void (^)(NSArray *_Nullable, + FlutterError *_Nullable))completion { + NSString *channelName = + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"FlutterIntegrationCoreApi.echoNullableClassList", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel messageChannelWithName:channelName binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:@[ arg_list ?: [NSNull null] ] + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ arg_classList ?: [NSNull null] ] reply:^(NSArray *reply) { if (reply != nil) { if (reply.count > 1) { @@ -3294,7 +5778,7 @@ - (void)echoUint8List:(FlutterStandardTypedData *)arg_list message:reply[1] details:reply[2]]); } else { - FlutterStandardTypedData *output = + NSArray *output = reply[0] == [NSNull null] ? nil : reply[0]; completion(output, nil); } @@ -3303,18 +5787,19 @@ - (void)echoUint8List:(FlutterStandardTypedData *)arg_list } }]; } -- (void)echoList:(NSArray *)arg_list - completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoList", - _messageChannelSuffix]; +- (void)echoNullableNonNullEnumList:(nullable NSArray *)arg_enumList + completion:(void (^)(NSArray *_Nullable, + FlutterError *_Nullable))completion { + NSString *channelName = + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"FlutterIntegrationCoreApi.echoNullableNonNullEnumList", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel messageChannelWithName:channelName binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:@[ arg_list ?: [NSNull null] ] + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ arg_enumList ?: [NSNull null] ] reply:^(NSArray *reply) { if (reply != nil) { if (reply.count > 1) { @@ -3322,7 +5807,7 @@ - (void)echoList:(NSArray *)arg_list message:reply[1] details:reply[2]]); } else { - NSArray *output = reply[0] == [NSNull null] ? nil : reply[0]; + NSArray *output = reply[0] == [NSNull null] ? nil : reply[0]; completion(output, nil); } } else { @@ -3330,18 +5815,19 @@ - (void)echoList:(NSArray *)arg_list } }]; } -- (void)echoMap:(NSDictionary *)arg_aMap - completion: - (void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoMap", - _messageChannelSuffix]; +- (void)echoNullableNonNullClassList:(nullable NSArray *)arg_classList + completion:(void (^)(NSArray *_Nullable, + FlutterError *_Nullable))completion { + NSString *channelName = + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"FlutterIntegrationCoreApi.echoNullableNonNullClassList", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel messageChannelWithName:channelName binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:@[ arg_aMap ?: [NSNull null] ] + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ arg_classList ?: [NSNull null] ] reply:^(NSArray *reply) { if (reply != nil) { if (reply.count > 1) { @@ -3349,7 +5835,7 @@ - (void)echoMap:(NSDictionary *)arg_aMap message:reply[1] details:reply[2]]); } else { - NSDictionary *output = + NSArray *output = reply[0] == [NSNull null] ? nil : reply[0]; completion(output, nil); } @@ -3358,18 +5844,19 @@ - (void)echoMap:(NSDictionary *)arg_aMap } }]; } -- (void)echoEnum:(AnEnum)arg_anEnum - completion:(void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion { +- (void)echoNullableMap:(nullable NSDictionary *)arg_map + completion: + (void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion { NSString *channelName = [NSString stringWithFormat: @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnum", + @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableMap", _messageChannelSuffix]; FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel messageChannelWithName:channelName binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:@[ [[AnEnumBox alloc] initWithValue:arg_anEnum] ] + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ arg_map ?: [NSNull null] ] reply:^(NSArray *reply) { if (reply != nil) { if (reply.count > 1) { @@ -3377,7 +5864,7 @@ - (void)echoEnum:(AnEnum)arg_anEnum message:reply[1] details:reply[2]]); } else { - AnEnumBox *output = reply[0] == [NSNull null] ? nil : reply[0]; + NSDictionary *output = reply[0] == [NSNull null] ? nil : reply[0]; completion(output, nil); } } else { @@ -3385,18 +5872,19 @@ - (void)echoEnum:(AnEnum)arg_anEnum } }]; } -- (void)echoAnotherEnum:(AnotherEnum)arg_anotherEnum - completion:(void (^)(AnotherEnumBox *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAnotherEnum", - _messageChannelSuffix]; +- (void)echoNullableStringMap:(nullable NSDictionary *)arg_stringMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + NSString *channelName = + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"FlutterIntegrationCoreApi.echoNullableStringMap", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel messageChannelWithName:channelName binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:@[ [[AnotherEnumBox alloc] initWithValue:arg_anotherEnum] ] + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ arg_stringMap ?: [NSNull null] ] reply:^(NSArray *reply) { if (reply != nil) { if (reply.count > 1) { @@ -3404,7 +5892,8 @@ - (void)echoAnotherEnum:(AnotherEnum)arg_anotherEnum message:reply[1] details:reply[2]]); } else { - AnotherEnumBox *output = reply[0] == [NSNull null] ? nil : reply[0]; + NSDictionary *output = + reply[0] == [NSNull null] ? nil : reply[0]; completion(output, nil); } } else { @@ -3412,18 +5901,19 @@ - (void)echoAnotherEnum:(AnotherEnum)arg_anotherEnum } }]; } -- (void)echoNullableBool:(nullable NSNumber *)arg_aBool - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableBool", - _messageChannelSuffix]; +- (void)echoNullableIntMap:(nullable NSDictionary *)arg_intMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + NSString *channelName = + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"FlutterIntegrationCoreApi.echoNullableIntMap", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel messageChannelWithName:channelName binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:@[ arg_aBool ?: [NSNull null] ] + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ arg_intMap ?: [NSNull null] ] reply:^(NSArray *reply) { if (reply != nil) { if (reply.count > 1) { @@ -3431,7 +5921,8 @@ - (void)echoNullableBool:(nullable NSNumber *)arg_aBool message:reply[1] details:reply[2]]); } else { - NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; + NSDictionary *output = + reply[0] == [NSNull null] ? nil : reply[0]; completion(output, nil); } } else { @@ -3439,18 +5930,19 @@ - (void)echoNullableBool:(nullable NSNumber *)arg_aBool } }]; } -- (void)echoNullableInt:(nullable NSNumber *)arg_anInt - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableInt", - _messageChannelSuffix]; +- (void)echoNullableEnumMap:(nullable NSDictionary *)arg_enumMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + NSString *channelName = + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"FlutterIntegrationCoreApi.echoNullableEnumMap", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel messageChannelWithName:channelName binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:@[ arg_anInt ?: [NSNull null] ] + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ arg_enumMap ?: [NSNull null] ] reply:^(NSArray *reply) { if (reply != nil) { if (reply.count > 1) { @@ -3458,7 +5950,8 @@ - (void)echoNullableInt:(nullable NSNumber *)arg_anInt message:reply[1] details:reply[2]]); } else { - NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; + NSDictionary *output = + reply[0] == [NSNull null] ? nil : reply[0]; completion(output, nil); } } else { @@ -3466,18 +5959,20 @@ - (void)echoNullableInt:(nullable NSNumber *)arg_anInt } }]; } -- (void)echoNullableDouble:(nullable NSNumber *)arg_aDouble - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { +- (void)echoNullableClassMap: + (nullable NSDictionary *)arg_classMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"FlutterIntegrationCoreApi.echoNullableDouble", + @"FlutterIntegrationCoreApi.echoNullableClassMap", _messageChannelSuffix]; FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel messageChannelWithName:channelName binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:@[ arg_aDouble ?: [NSNull null] ] + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ arg_classMap ?: [NSNull null] ] reply:^(NSArray *reply) { if (reply != nil) { if (reply.count > 1) { @@ -3485,7 +5980,8 @@ - (void)echoNullableDouble:(nullable NSNumber *)arg_aDouble message:reply[1] details:reply[2]]); } else { - NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; + NSDictionary *output = + reply[0] == [NSNull null] ? nil : reply[0]; completion(output, nil); } } else { @@ -3493,18 +5989,19 @@ - (void)echoNullableDouble:(nullable NSNumber *)arg_aDouble } }]; } -- (void)echoNullableString:(nullable NSString *)arg_aString - completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { +- (void)echoNullableNonNullStringMap:(nullable NSDictionary *)arg_stringMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"FlutterIntegrationCoreApi.echoNullableString", + @"FlutterIntegrationCoreApi.echoNullableNonNullStringMap", _messageChannelSuffix]; FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel messageChannelWithName:channelName binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:@[ arg_aString ?: [NSNull null] ] + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ arg_stringMap ?: [NSNull null] ] reply:^(NSArray *reply) { if (reply != nil) { if (reply.count > 1) { @@ -3512,7 +6009,8 @@ - (void)echoNullableString:(nullable NSString *)arg_aString message:reply[1] details:reply[2]]); } else { - NSString *output = reply[0] == [NSNull null] ? nil : reply[0]; + NSDictionary *output = + reply[0] == [NSNull null] ? nil : reply[0]; completion(output, nil); } } else { @@ -3520,19 +6018,19 @@ - (void)echoNullableString:(nullable NSString *)arg_aString } }]; } -- (void)echoNullableUint8List:(nullable FlutterStandardTypedData *)arg_list - completion:(void (^)(FlutterStandardTypedData *_Nullable, - FlutterError *_Nullable))completion { +- (void)echoNullableNonNullIntMap:(nullable NSDictionary *)arg_intMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." - @"FlutterIntegrationCoreApi.echoNullableUint8List", + @"FlutterIntegrationCoreApi.echoNullableNonNullIntMap", _messageChannelSuffix]; FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel messageChannelWithName:channelName binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:@[ arg_list ?: [NSNull null] ] + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ arg_intMap ?: [NSNull null] ] reply:^(NSArray *reply) { if (reply != nil) { if (reply.count > 1) { @@ -3540,7 +6038,7 @@ - (void)echoNullableUint8List:(nullable FlutterStandardTypedData *)arg_list message:reply[1] details:reply[2]]); } else { - FlutterStandardTypedData *output = + NSDictionary *output = reply[0] == [NSNull null] ? nil : reply[0]; completion(output, nil); } @@ -3549,18 +6047,20 @@ - (void)echoNullableUint8List:(nullable FlutterStandardTypedData *)arg_list } }]; } -- (void)echoNullableList:(nullable NSArray *)arg_list - completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableList", - _messageChannelSuffix]; +- (void) + echoNullableNonNullEnumMap:(nullable NSDictionary *)arg_enumMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + NSString *channelName = + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"FlutterIntegrationCoreApi.echoNullableNonNullEnumMap", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel messageChannelWithName:channelName binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:@[ arg_list ?: [NSNull null] ] + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ arg_enumMap ?: [NSNull null] ] reply:^(NSArray *reply) { if (reply != nil) { if (reply.count > 1) { @@ -3568,7 +6068,8 @@ - (void)echoNullableList:(nullable NSArray *)arg_list message:reply[1] details:reply[2]]); } else { - NSArray *output = reply[0] == [NSNull null] ? nil : reply[0]; + NSDictionary *output = + reply[0] == [NSNull null] ? nil : reply[0]; completion(output, nil); } } else { @@ -3576,19 +6077,21 @@ - (void)echoNullableList:(nullable NSArray *)arg_list } }]; } -- (void)echoNullableMap:(nullable NSDictionary *)arg_aMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableMap", - _messageChannelSuffix]; +- (void)echoNullableNonNullClassMap: + (nullable NSDictionary *)arg_classMap + completion: + (void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + NSString *channelName = + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"FlutterIntegrationCoreApi.echoNullableNonNullClassMap", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel messageChannelWithName:channelName binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:@[ arg_aMap ?: [NSNull null] ] + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ arg_classMap ?: [NSNull null] ] reply:^(NSArray *reply) { if (reply != nil) { if (reply.count > 1) { @@ -3596,7 +6099,7 @@ - (void)echoNullableMap:(nullable NSDictionary *)arg_aMap message:reply[1] details:reply[2]]); } else { - NSDictionary *output = + NSDictionary *output = reply[0] == [NSNull null] ? nil : reply[0]; completion(output, nil); } @@ -3605,8 +6108,8 @@ - (void)echoNullableMap:(nullable NSDictionary *)arg_aMap } }]; } -- (void)echoNullableEnum:(nullable AnEnumBox *)arg_anEnum - completion:(void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion { +- (void)echoNullableEnum:(nullable FLTAnEnumBox *)arg_anEnum + completion:(void (^)(FLTAnEnumBox *_Nullable, FlutterError *_Nullable))completion { NSString *channelName = [NSString stringWithFormat: @"%@%@", @@ -3615,7 +6118,7 @@ - (void)echoNullableEnum:(nullable AnEnumBox *)arg_anEnum FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel messageChannelWithName:channelName binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; [channel sendMessage:@[ arg_anEnum == nil ? [NSNull null] : arg_anEnum ] reply:^(NSArray *reply) { if (reply != nil) { @@ -3624,7 +6127,7 @@ - (void)echoNullableEnum:(nullable AnEnumBox *)arg_anEnum message:reply[1] details:reply[2]]); } else { - AnEnumBox *output = reply[0] == [NSNull null] ? nil : reply[0]; + FLTAnEnumBox *output = reply[0] == [NSNull null] ? nil : reply[0]; completion(output, nil); } } else { @@ -3632,9 +6135,9 @@ - (void)echoNullableEnum:(nullable AnEnumBox *)arg_anEnum } }]; } -- (void)echoAnotherNullableEnum:(nullable AnotherEnumBox *)arg_anotherEnum - completion: - (void (^)(AnotherEnumBox *_Nullable, FlutterError *_Nullable))completion { +- (void)echoAnotherNullableEnum:(nullable FLTAnotherEnumBox *)arg_anotherEnum + completion:(void (^)(FLTAnotherEnumBox *_Nullable, + FlutterError *_Nullable))completion { NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests." @@ -3643,7 +6146,7 @@ - (void)echoAnotherNullableEnum:(nullable AnotherEnumBox *)arg_anotherEnum FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel messageChannelWithName:channelName binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; [channel sendMessage:@[ arg_anotherEnum == nil ? [NSNull null] : arg_anotherEnum ] reply:^(NSArray *reply) { if (reply != nil) { @@ -3652,7 +6155,7 @@ - (void)echoAnotherNullableEnum:(nullable AnotherEnumBox *)arg_anotherEnum message:reply[1] details:reply[2]]); } else { - AnotherEnumBox *output = reply[0] == [NSNull null] ? nil : reply[0]; + FLTAnotherEnumBox *output = reply[0] == [NSNull null] ? nil : reply[0]; completion(output, nil); } } else { @@ -3669,7 +6172,7 @@ - (void)noopAsyncWithCompletion:(void (^)(FlutterError *_Nullable))completion { FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel messageChannelWithName:channelName binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; [channel sendMessage:nil reply:^(NSArray *reply) { if (reply != nil) { @@ -3695,7 +6198,7 @@ - (void)echoAsyncString:(NSString *)arg_aString FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel messageChannelWithName:channelName binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; [channel sendMessage:@[ arg_aString ?: [NSNull null] ] reply:^(NSArray *reply) { if (reply != nil) { @@ -3714,13 +6217,14 @@ - (void)echoAsyncString:(NSString *)arg_aString } @end -void SetUpHostTrivialApi(id binaryMessenger, - NSObject *api) { - SetUpHostTrivialApiWithSuffix(binaryMessenger, api, @""); +void SetUpFLTHostTrivialApi(id binaryMessenger, + NSObject *api) { + SetUpFLTHostTrivialApiWithSuffix(binaryMessenger, api, @""); } -void SetUpHostTrivialApiWithSuffix(id binaryMessenger, - NSObject *api, NSString *messageChannelSuffix) { +void SetUpFLTHostTrivialApiWithSuffix(id binaryMessenger, + NSObject *api, + NSString *messageChannelSuffix) { messageChannelSuffix = messageChannelSuffix.length > 0 ? [NSString stringWithFormat:@".%@", messageChannelSuffix] : @""; @@ -3732,10 +6236,10 @@ void SetUpHostTrivialApiWithSuffix(id binaryMessenger, @"dev.flutter.pigeon.pigeon_integration_tests.HostTrivialApi.noop", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(noopWithError:)], - @"HostTrivialApi api (%@) doesn't respond to @selector(noopWithError:)", api); + @"FLTHostTrivialApi api (%@) doesn't respond to @selector(noopWithError:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { FlutterError *error; [api noopWithError:&error]; @@ -3746,12 +6250,14 @@ void SetUpHostTrivialApiWithSuffix(id binaryMessenger, } } } -void SetUpHostSmallApi(id binaryMessenger, NSObject *api) { - SetUpHostSmallApiWithSuffix(binaryMessenger, api, @""); +void SetUpFLTHostSmallApi(id binaryMessenger, + NSObject *api) { + SetUpFLTHostSmallApiWithSuffix(binaryMessenger, api, @""); } -void SetUpHostSmallApiWithSuffix(id binaryMessenger, - NSObject *api, NSString *messageChannelSuffix) { +void SetUpFLTHostSmallApiWithSuffix(id binaryMessenger, + NSObject *api, + NSString *messageChannelSuffix) { messageChannelSuffix = messageChannelSuffix.length > 0 ? [NSString stringWithFormat:@".%@", messageChannelSuffix] : @""; @@ -3763,10 +6269,11 @@ void SetUpHostSmallApiWithSuffix(id binaryMessenger, @"dev.flutter.pigeon.pigeon_integration_tests.HostSmallApi.echo", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(echoString:completion:)], - @"HostSmallApi api (%@) doesn't respond to @selector(echoString:completion:)", api); + @"FLTHostSmallApi api (%@) doesn't respond to @selector(echoString:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSString *arg_aString = GetNullableObjectAtIndex(args, 0); @@ -3786,10 +6293,10 @@ void SetUpHostSmallApiWithSuffix(id binaryMessenger, @"HostSmallApi.voidVoid", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(voidVoidWithCompletion:)], - @"HostSmallApi api (%@) doesn't respond to @selector(voidVoidWithCompletion:)", + @"FLTHostSmallApi api (%@) doesn't respond to @selector(voidVoidWithCompletion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { [api voidVoidWithCompletion:^(FlutterError *_Nullable error) { @@ -3801,12 +6308,12 @@ void SetUpHostSmallApiWithSuffix(id binaryMessenger, } } } -@interface FlutterSmallApi () +@interface FLTFlutterSmallApi () @property(nonatomic, strong) NSObject *binaryMessenger; @property(nonatomic, strong) NSString *messageChannelSuffix; @end -@implementation FlutterSmallApi +@implementation FLTFlutterSmallApi - (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger { return [self initWithBinaryMessenger:binaryMessenger messageChannelSuffix:@""]; @@ -3822,8 +6329,8 @@ - (instancetype)initWithBinaryMessenger:(NSObject *)bina } return self; } -- (void)echoWrappedList:(TestMessage *)arg_msg - completion:(void (^)(TestMessage *_Nullable, FlutterError *_Nullable))completion { +- (void)echoWrappedList:(FLTTestMessage *)arg_msg + completion:(void (^)(FLTTestMessage *_Nullable, FlutterError *_Nullable))completion { NSString *channelName = [NSString stringWithFormat: @"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoWrappedList", @@ -3831,7 +6338,7 @@ - (void)echoWrappedList:(TestMessage *)arg_msg FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel messageChannelWithName:channelName binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; [channel sendMessage:@[ arg_msg ?: [NSNull null] ] reply:^(NSArray *reply) { if (reply != nil) { @@ -3840,7 +6347,7 @@ - (void)echoWrappedList:(TestMessage *)arg_msg message:reply[1] details:reply[2]]); } else { - TestMessage *output = reply[0] == [NSNull null] ? nil : reply[0]; + FLTTestMessage *output = reply[0] == [NSNull null] ? nil : reply[0]; completion(output, nil); } } else { @@ -3857,7 +6364,7 @@ - (void)echoString:(NSString *)arg_aString FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel messageChannelWithName:channelName binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; [channel sendMessage:@[ arg_aString ?: [NSNull null] ] reply:^(NSArray *reply) { if (reply != nil) { diff --git a/packages/pigeon/platform_tests/shared_test_plugin_code/dart_test.yaml b/packages/pigeon/platform_tests/shared_test_plugin_code/dart_test.yaml new file mode 100644 index 000000000000..91ec220b8e22 --- /dev/null +++ b/packages/pigeon/platform_tests/shared_test_plugin_code/dart_test.yaml @@ -0,0 +1 @@ +test_on: vm diff --git a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/generated.dart b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/generated.dart index 31aff33a3f36..b7861ee4d574 100644 --- a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/generated.dart +++ b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/generated.dart @@ -3,3 +3,5 @@ // found in the LICENSE file. export 'src/generated/core_tests.gen.dart'; +export 'src/generated/proxy_api_tests.gen.dart' + show ProxyApiSuperClass, ProxyApiTestClass, ProxyApiTestEnum; diff --git a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/integration_tests.dart b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/integration_tests.dart index 40221efda701..21d76637675c 100644 --- a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/integration_tests.dart +++ b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/integration_tests.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. +// ignore_for_file: unused_local_variable + import 'package:flutter/foundation.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:integration_test/integration_test.dart'; import 'generated.dart'; -import 'src/generated/core_tests.gen.dart'; - -const int _biggerThanBigInt = 3000000000; -const int _regularInt = 42; -const double _doublePi = 3.14159; +import 'test_types.dart'; /// Possible host languages that test can target. enum TargetGenerator { @@ -35,330 +33,12 @@ enum TargetGenerator { swift, } -void _compareAllTypes(AllTypes? allTypesOne, AllTypes? allTypesTwo) { - expect(allTypesOne == null, allTypesTwo == null); - if (allTypesOne == null || allTypesTwo == null) { - return; - } - expect(allTypesOne.aBool, allTypesTwo.aBool); - expect(allTypesOne.anInt, allTypesTwo.anInt); - expect(allTypesOne.anInt64, allTypesTwo.anInt64); - expect(allTypesOne.aDouble, allTypesTwo.aDouble); - expect(allTypesOne.aString, allTypesTwo.aString); - expect(allTypesOne.aByteArray, allTypesTwo.aByteArray); - expect(allTypesOne.a4ByteArray, allTypesTwo.a4ByteArray); - expect(allTypesOne.a8ByteArray, allTypesTwo.a8ByteArray); - expect(allTypesOne.aFloatArray, allTypesTwo.aFloatArray); - expect(allTypesOne.anEnum, allTypesTwo.anEnum); - expect(allTypesOne.anObject, allTypesTwo.anObject); - expect(listEquals(allTypesOne.list, allTypesTwo.list), true); - expect(listEquals(allTypesOne.stringList, allTypesTwo.stringList), true); - expect(listEquals(allTypesOne.boolList, allTypesTwo.boolList), true); - expect(listEquals(allTypesOne.doubleList, allTypesTwo.doubleList), true); - expect(listEquals(allTypesOne.intList, allTypesTwo.intList), true); - expect(mapEquals(allTypesOne.map, allTypesTwo.map), true); -} - -void _compareAllNullableTypes(AllNullableTypes? allNullableTypesOne, - AllNullableTypes? allNullableTypesTwo) { - expect(allNullableTypesOne == null, allNullableTypesTwo == null); - if (allNullableTypesOne == null || allNullableTypesTwo == null) { - return; - } - expect(allNullableTypesOne.aNullableBool, allNullableTypesTwo.aNullableBool); - expect(allNullableTypesOne.aNullableInt, allNullableTypesTwo.aNullableInt); - expect( - allNullableTypesOne.aNullableInt64, allNullableTypesTwo.aNullableInt64); - expect( - allNullableTypesOne.aNullableDouble, allNullableTypesTwo.aNullableDouble); - expect( - allNullableTypesOne.aNullableString, allNullableTypesTwo.aNullableString); - expect(allNullableTypesOne.aNullableByteArray, - allNullableTypesTwo.aNullableByteArray); - expect(allNullableTypesOne.aNullable4ByteArray, - allNullableTypesTwo.aNullable4ByteArray); - expect(allNullableTypesOne.aNullable8ByteArray, - allNullableTypesTwo.aNullable8ByteArray); - expect(allNullableTypesOne.aNullableFloatArray, - allNullableTypesTwo.aNullableFloatArray); - expect(allNullableTypesOne.nullableNestedList?.length, - allNullableTypesTwo.nullableNestedList?.length); - // TODO(stuartmorgan): Enable this once the Dart types are fixed; see - // https://github.com/flutter/flutter/issues/116117 - //for (int i = 0; i < allNullableTypesOne.nullableNestedList!.length; i++) { - // expect(listEquals(allNullableTypesOne.nullableNestedList![i], allNullableTypesTwo.nullableNestedList![i]), - // true); - //} - expect( - mapEquals(allNullableTypesOne.nullableMapWithAnnotations, - allNullableTypesTwo.nullableMapWithAnnotations), - true); - expect( - mapEquals(allNullableTypesOne.nullableMapWithObject, - allNullableTypesTwo.nullableMapWithObject), - true); - expect( - allNullableTypesOne.aNullableObject, allNullableTypesTwo.aNullableObject); - expect(allNullableTypesOne.aNullableEnum, allNullableTypesTwo.aNullableEnum); - _compareAllNullableTypes(allNullableTypesOne.allNullableTypes, - allNullableTypesTwo.allNullableTypes); - expect(listEquals(allNullableTypesOne.list, allNullableTypesTwo.list), true); - expect( - listEquals( - allNullableTypesOne.stringList, allNullableTypesTwo.stringList), - true); - expect(listEquals(allNullableTypesOne.boolList, allNullableTypesTwo.boolList), - true); - expect( - listEquals( - allNullableTypesOne.doubleList, allNullableTypesTwo.doubleList), - true); - expect(listEquals(allNullableTypesOne.intList, allNullableTypesTwo.intList), - true); - expect(allNullableTypesOne.nestedClassList?.length, - allNullableTypesTwo.nestedClassList?.length); - for (int i = 0; i < (allNullableTypesOne.nestedClassList?.length ?? 0); i++) { - _compareAllNullableTypes(allNullableTypesOne.nestedClassList?[i], - allNullableTypesTwo.nestedClassList?[i]); - } - expect(mapEquals(allNullableTypesOne.map, allNullableTypesTwo.map), true); -} - -void __compareAllNullableTypesWithoutRecursion( - AllNullableTypesWithoutRecursion? allNullableTypesOne, - AllNullableTypesWithoutRecursion? allNullableTypesTwo) { - expect(allNullableTypesOne == null, allNullableTypesTwo == null); - if (allNullableTypesOne == null || allNullableTypesTwo == null) { - return; - } - expect(allNullableTypesOne.aNullableBool, allNullableTypesTwo.aNullableBool); - expect(allNullableTypesOne.aNullableInt, allNullableTypesTwo.aNullableInt); - expect( - allNullableTypesOne.aNullableInt64, allNullableTypesTwo.aNullableInt64); - expect( - allNullableTypesOne.aNullableDouble, allNullableTypesTwo.aNullableDouble); - expect( - allNullableTypesOne.aNullableString, allNullableTypesTwo.aNullableString); - expect(allNullableTypesOne.aNullableByteArray, - allNullableTypesTwo.aNullableByteArray); - expect(allNullableTypesOne.aNullable4ByteArray, - allNullableTypesTwo.aNullable4ByteArray); - expect(allNullableTypesOne.aNullable8ByteArray, - allNullableTypesTwo.aNullable8ByteArray); - expect(allNullableTypesOne.aNullableFloatArray, - allNullableTypesTwo.aNullableFloatArray); - expect(allNullableTypesOne.nullableNestedList?.length, - allNullableTypesTwo.nullableNestedList?.length); - // TODO(stuartmorgan): Enable this once the Dart types are fixed; see - // https://github.com/flutter/flutter/issues/116117 - //for (int i = 0; i < allNullableTypesOne.nullableNestedList!.length; i++) { - // expect(listEquals(allNullableTypesOne.nullableNestedList![i], allNullableTypesTwo.nullableNestedList![i]), - // true); - //} - expect( - mapEquals(allNullableTypesOne.nullableMapWithAnnotations, - allNullableTypesTwo.nullableMapWithAnnotations), - true); - expect( - mapEquals(allNullableTypesOne.nullableMapWithObject, - allNullableTypesTwo.nullableMapWithObject), - true); - expect( - allNullableTypesOne.aNullableObject, allNullableTypesTwo.aNullableObject); - expect(allNullableTypesOne.aNullableEnum, allNullableTypesTwo.aNullableEnum); - expect(listEquals(allNullableTypesOne.list, allNullableTypesTwo.list), true); - expect( - listEquals( - allNullableTypesOne.stringList, allNullableTypesTwo.stringList), - true); - expect(listEquals(allNullableTypesOne.boolList, allNullableTypesTwo.boolList), - true); - expect( - listEquals( - allNullableTypesOne.doubleList, allNullableTypesTwo.doubleList), - true); - expect(listEquals(allNullableTypesOne.intList, allNullableTypesTwo.intList), - true); - expect(mapEquals(allNullableTypesOne.map, allNullableTypesTwo.map), true); -} - -void _compareAllClassesWrapper( - AllClassesWrapper? wrapperOne, AllClassesWrapper? wrapperTwo) { - expect(wrapperOne == null, wrapperTwo == null); - if (wrapperOne == null || wrapperTwo == null) { - return; - } - - _compareAllNullableTypes( - wrapperOne.allNullableTypes, wrapperTwo.allNullableTypes); - __compareAllNullableTypesWithoutRecursion( - wrapperOne.allNullableTypesWithoutRecursion, - wrapperTwo.allNullableTypesWithoutRecursion, - ); - _compareAllTypes(wrapperOne.allTypes, wrapperTwo.allTypes); -} - -final Map _map = { - 'a': 1, - 'b': 2.0, - 'c': 'three', - 'd': false, - 'e': null +/// Host languages that support generating Proxy APIs. +const Set proxyApiSupportedLanguages = { + TargetGenerator.kotlin, + TargetGenerator.swift, }; -final List _list = [ - 'Thing 1', - 2, - true, - 3.14, - null, -]; - -final List _stringList = [ - 'Thing 1', - '2', - 'true', - '3.14', - null, -]; - -final List _intList = [ - 1, - 2, - 3, - 4, - null, -]; - -final List _doubleList = [ - 1, - 2.99999, - 3, - 3.14, - null, -]; - -final List _boolList = [ - true, - false, - true, - false, - null, -]; - -final AllTypes _genericAllTypes = AllTypes( - aBool: true, - anInt: _regularInt, - anInt64: _biggerThanBigInt, - aDouble: _doublePi, - aString: 'Hello host!', - aByteArray: Uint8List.fromList([1, 2, 3]), - a4ByteArray: Int32List.fromList([4, 5, 6]), - a8ByteArray: Int64List.fromList([7, 8, 9]), - aFloatArray: Float64List.fromList([2.71828, _doublePi]), - anEnum: AnEnum.fortyTwo, - // ignore: avoid_redundant_argument_values - anotherEnum: AnotherEnum.justInCase, - anObject: 1, - list: _list, - stringList: _stringList, - intList: _intList, - doubleList: _doubleList, - boolList: _boolList, - map: _map, -); - -final AllNullableTypes _genericAllNullableTypes = AllNullableTypes( - aNullableBool: true, - aNullableInt: _regularInt, - aNullableInt64: _biggerThanBigInt, - aNullableDouble: _doublePi, - aNullableString: 'Hello host!', - aNullableByteArray: Uint8List.fromList([1, 2, 3]), - aNullable4ByteArray: Int32List.fromList([4, 5, 6]), - aNullable8ByteArray: Int64List.fromList([7, 8, 9]), - aNullableFloatArray: Float64List.fromList([2.71828, _doublePi]), - nullableNestedList: >[ - [true, false], - [false, true] - ], - nullableMapWithAnnotations: {}, - nullableMapWithObject: {}, - aNullableEnum: AnEnum.fourHundredTwentyTwo, - anotherNullableEnum: AnotherEnum.justInCase, - aNullableObject: 0, - list: _list, - stringList: _stringList, - intList: _intList, - doubleList: _doubleList, - boolList: _boolList, - map: _map, -); - -final List _allNullableTypesList = [ - _genericAllNullableTypes, - AllNullableTypes(), - null, -]; - -final AllNullableTypes _recursiveAllNullableTypes = AllNullableTypes( - aNullableBool: true, - aNullableInt: _regularInt, - aNullableInt64: _biggerThanBigInt, - aNullableDouble: _doublePi, - aNullableString: 'Hello host!', - aNullableByteArray: Uint8List.fromList([1, 2, 3]), - aNullable4ByteArray: Int32List.fromList([4, 5, 6]), - aNullable8ByteArray: Int64List.fromList([7, 8, 9]), - aNullableFloatArray: Float64List.fromList([2.71828, _doublePi]), - nullableNestedList: >[ - [true, false], - [false, true] - ], - nullableMapWithAnnotations: {}, - nullableMapWithObject: {}, - aNullableEnum: AnEnum.fourHundredTwentyTwo, - anotherNullableEnum: AnotherEnum.justInCase, - aNullableObject: 0, - allNullableTypes: _genericAllNullableTypes, - list: _list, - stringList: _stringList, - intList: _intList, - doubleList: _doubleList, - boolList: _boolList, - nestedClassList: _allNullableTypesList, - map: _map, -); - -final AllNullableTypesWithoutRecursion - __genericAllNullableTypesWithoutRecursion = - AllNullableTypesWithoutRecursion( - aNullableBool: true, - aNullableInt: _regularInt, - aNullableInt64: _biggerThanBigInt, - aNullableDouble: _doublePi, - aNullableString: 'Hello host!', - aNullableByteArray: Uint8List.fromList([1, 2, 3]), - aNullable4ByteArray: Int32List.fromList([4, 5, 6]), - aNullable8ByteArray: Int64List.fromList([7, 8, 9]), - aNullableFloatArray: Float64List.fromList([2.71828, _doublePi]), - nullableNestedList: >[ - [true, false], - [false, true] - ], - nullableMapWithAnnotations: {}, - nullableMapWithObject: {}, - aNullableEnum: AnEnum.fourHundredTwentyTwo, - anotherNullableEnum: AnotherEnum.justInCase, - aNullableObject: 0, - list: _list, - stringList: _stringList, - intList: _intList, - doubleList: _doubleList, - boolList: _boolList, - map: _map, -); - /// Sets up and runs the integration tests. void runPigeonIntegrationTests(TargetGenerator targetGenerator) { IntegrationTestWidgetsFlutterBinding.ensureInitialized(); @@ -374,8 +54,8 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { (WidgetTester _) async { final HostIntegrationCoreApi api = HostIntegrationCoreApi(); - final AllTypes echoObject = await api.echoAllTypes(_genericAllTypes); - _compareAllTypes(echoObject, _genericAllTypes); + final AllTypes echoObject = await api.echoAllTypes(genericAllTypes); + compareAllTypes(echoObject, genericAllTypes); }); testWidgets('all nullable datatypes serialize and deserialize correctly', @@ -383,9 +63,9 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { final HostIntegrationCoreApi api = HostIntegrationCoreApi(); final AllNullableTypes? echoObject = - await api.echoAllNullableTypes(_recursiveAllNullableTypes); + await api.echoAllNullableTypes(recursiveAllNullableTypes); - _compareAllNullableTypes(echoObject, _recursiveAllNullableTypes); + compareAllNullableTypes(echoObject, recursiveAllNullableTypes); }); testWidgets('all null datatypes serialize and deserialize correctly', @@ -396,33 +76,33 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { final AllNullableTypes? echoNullFilledClass = await api.echoAllNullableTypes(allTypesNull); - _compareAllNullableTypes(allTypesNull, echoNullFilledClass); + compareAllNullableTypes(allTypesNull, echoNullFilledClass); }); testWidgets('Classes with list of null serialize and deserialize correctly', (WidgetTester _) async { final HostIntegrationCoreApi api = HostIntegrationCoreApi(); - final AllNullableTypes nullableListTypes = + final AllNullableTypes listTypes = AllNullableTypes(list: ['String', null]); final AllNullableTypes? echoNullFilledClass = - await api.echoAllNullableTypes(nullableListTypes); + await api.echoAllNullableTypes(listTypes); - _compareAllNullableTypes(nullableListTypes, echoNullFilledClass); + compareAllNullableTypes(listTypes, echoNullFilledClass); }); testWidgets('Classes with map of null serialize and deserialize correctly', (WidgetTester _) async { final HostIntegrationCoreApi api = HostIntegrationCoreApi(); - final AllNullableTypes nullableListTypes = AllNullableTypes( + final AllNullableTypes listTypes = AllNullableTypes( map: {'String': 'string', 'null': null}); final AllNullableTypes? echoNullFilledClass = - await api.echoAllNullableTypes(nullableListTypes); + await api.echoAllNullableTypes(listTypes); - _compareAllNullableTypes(nullableListTypes, echoNullFilledClass); + compareAllNullableTypes(listTypes, echoNullFilledClass); }); testWidgets( @@ -432,10 +112,10 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { final AllNullableTypesWithoutRecursion? echoObject = await api.echoAllNullableTypesWithoutRecursion( - __genericAllNullableTypesWithoutRecursion); + genericAllNullableTypesWithoutRecursion); - __compareAllNullableTypesWithoutRecursion( - echoObject, __genericAllNullableTypesWithoutRecursion); + compareAllNullableTypesWithoutRecursion( + echoObject, genericAllNullableTypesWithoutRecursion); }); testWidgets( @@ -448,7 +128,7 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { final AllNullableTypesWithoutRecursion? echoNullFilledClass = await api.echoAllNullableTypesWithoutRecursion(allTypesNull); - __compareAllNullableTypesWithoutRecursion( + compareAllNullableTypesWithoutRecursion( allTypesNull, echoNullFilledClass); }); @@ -457,16 +137,15 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { (WidgetTester _) async { final HostIntegrationCoreApi api = HostIntegrationCoreApi(); - final AllNullableTypesWithoutRecursion nullableListTypes = + final AllNullableTypesWithoutRecursion listTypes = AllNullableTypesWithoutRecursion( list: ['String', null], ); final AllNullableTypesWithoutRecursion? echoNullFilledClass = - await api.echoAllNullableTypesWithoutRecursion(nullableListTypes); + await api.echoAllNullableTypesWithoutRecursion(listTypes); - __compareAllNullableTypesWithoutRecursion( - nullableListTypes, echoNullFilledClass); + compareAllNullableTypesWithoutRecursion(listTypes, echoNullFilledClass); }); testWidgets( @@ -474,16 +153,15 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { (WidgetTester _) async { final HostIntegrationCoreApi api = HostIntegrationCoreApi(); - final AllNullableTypesWithoutRecursion nullableListTypes = + final AllNullableTypesWithoutRecursion listTypes = AllNullableTypesWithoutRecursion( map: {'String': 'string', 'null': null}, ); final AllNullableTypesWithoutRecursion? echoNullFilledClass = - await api.echoAllNullableTypesWithoutRecursion(nullableListTypes); + await api.echoAllNullableTypesWithoutRecursion(listTypes); - __compareAllNullableTypesWithoutRecursion( - nullableListTypes, echoNullFilledClass); + compareAllNullableTypesWithoutRecursion(listTypes, echoNullFilledClass); }); testWidgets('errors are returned correctly', (WidgetTester _) async { @@ -518,16 +196,10 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { testWidgets('nested objects can be sent correctly', (WidgetTester _) async { final HostIntegrationCoreApi api = HostIntegrationCoreApi(); - - final AllClassesWrapper sentObject = AllClassesWrapper( - allNullableTypes: _recursiveAllNullableTypes, - allNullableTypesWithoutRecursion: - __genericAllNullableTypesWithoutRecursion, - allTypes: _genericAllTypes); - + final AllClassesWrapper classWrapper = classWrapperMaker(); final String? receivedString = - await api.extractNestedNullableString(sentObject); - expect(receivedString, sentObject.allNullableTypes.aNullableString); + await api.extractNestedNullableString(classWrapper); + expect(receivedString, classWrapper.allNullableTypes.aNullableString); }); testWidgets('nested objects can be received correctly', @@ -543,30 +215,23 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { testWidgets('nested classes can serialize and deserialize correctly', (WidgetTester _) async { final HostIntegrationCoreApi api = HostIntegrationCoreApi(); - - final AllClassesWrapper sentWrapper = AllClassesWrapper( - allNullableTypes: AllNullableTypes(), - allNullableTypesWithoutRecursion: AllNullableTypesWithoutRecursion(), - allTypes: _genericAllTypes, - ); + final AllClassesWrapper classWrapper = classWrapperMaker(); final AllClassesWrapper receivedClassWrapper = - await api.echoClassWrapper(sentWrapper); - _compareAllClassesWrapper(sentWrapper, receivedClassWrapper); + await api.echoClassWrapper(classWrapper); + compareAllClassesWrapper(classWrapper, receivedClassWrapper); }); testWidgets('nested null classes can serialize and deserialize correctly', (WidgetTester _) async { final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + final AllClassesWrapper classWrapper = classWrapperMaker(); - final AllClassesWrapper sentWrapper = AllClassesWrapper( - allNullableTypes: AllNullableTypes(), - allNullableTypesWithoutRecursion: AllNullableTypesWithoutRecursion(), - ); + classWrapper.allTypes = null; final AllClassesWrapper receivedClassWrapper = - await api.echoClassWrapper(sentWrapper); - _compareAllClassesWrapper(sentWrapper, receivedClassWrapper); + await api.echoClassWrapper(classWrapper); + compareAllClassesWrapper(classWrapper, receivedClassWrapper); }); testWidgets( @@ -575,7 +240,7 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { final HostIntegrationCoreApi api = HostIntegrationCoreApi(); const String aNullableString = 'this is a String'; const bool aNullableBool = false; - const int aNullableInt = _regularInt; + const int aNullableInt = regularInt; final AllNullableTypes echoObject = await api.sendMultipleNullableTypes( aNullableBool, aNullableInt, aNullableString); @@ -602,7 +267,7 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { final HostIntegrationCoreApi api = HostIntegrationCoreApi(); const String aNullableString = 'this is a String'; const bool aNullableBool = false; - const int aNullableInt = _regularInt; + const int aNullableInt = regularInt; final AllNullableTypesWithoutRecursion echoObject = await api.sendMultipleNullableTypesWithoutRecursion( @@ -627,7 +292,7 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { testWidgets('Int serialize and deserialize correctly', (WidgetTester _) async { final HostIntegrationCoreApi api = HostIntegrationCoreApi(); - const int sentInt = _regularInt; + const int sentInt = regularInt; final int receivedInt = await api.echoInt(sentInt); expect(receivedInt, sentInt); }); @@ -636,7 +301,7 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { (WidgetTester _) async { final HostIntegrationCoreApi api = HostIntegrationCoreApi(); - const int sentInt = _biggerThanBigInt; + const int sentInt = biggerThanBigInt; final int receivedInt = await api.echoInt(sentInt); expect(receivedInt, sentInt); }); @@ -697,7 +362,7 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { expect(receivedString, sentString); // Echo a second type as well to ensure the handling is generic. - const Object sentInt = _regularInt; + const Object sentInt = regularInt; final Object receivedInt = await api.echoObject(sentInt); expect(receivedInt, sentInt); }); @@ -706,22 +371,122 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { (WidgetTester _) async { final HostIntegrationCoreApi api = HostIntegrationCoreApi(); - const List sentObject = [7, 'Hello Dart!']; - final List echoObject = await api.echoList(sentObject); - expect(listEquals(echoObject, sentObject), true); + final List echoObject = await api.echoList(list); + expect(listEquals(echoObject, list), true); + }); + + testWidgets('enum lists serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + + final List echoObject = await api.echoEnumList(enumList); + expect(listEquals(echoObject, enumList), true); + }); + + testWidgets('class lists serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + + final List echoObject = + await api.echoClassList(allNullableTypesList); + for (final (int index, AllNullableTypes? value) in echoObject.indexed) { + compareAllNullableTypes(value, allNullableTypesList[index]); + } + }); + + testWidgets('NonNull enum lists serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + + final List echoObject = + await api.echoNonNullEnumList(nonNullEnumList); + expect(listEquals(echoObject, nonNullEnumList), true); + }); + + testWidgets('NonNull class lists serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + + final List echoObject = + await api.echoNonNullClassList(nonNullAllNullableTypesList); + for (final (int index, AllNullableTypes value) in echoObject.indexed) { + compareAllNullableTypes(value, nonNullAllNullableTypesList[index]); + } }); testWidgets('maps serialize and deserialize correctly', (WidgetTester _) async { final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + final Map echoObject = await api.echoMap(map); + expect(mapEquals(echoObject, map), true); + }); - const Map sentObject = { - 'a': 1, - 'b': 2.3, - 'c': 'four', - }; - final Map echoObject = await api.echoMap(sentObject); - expect(mapEquals(echoObject, sentObject), true); + testWidgets('string maps serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + final Map echoObject = + await api.echoStringMap(stringMap); + expect(mapEquals(echoObject, stringMap), true); + }); + + testWidgets('int maps serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + final Map echoObject = await api.echoIntMap(intMap); + expect(mapEquals(echoObject, intMap), true); + }); + + testWidgets('enum maps serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + final Map echoObject = await api.echoEnumMap(enumMap); + expect(mapEquals(echoObject, enumMap), true); + }); + + testWidgets('class maps serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + final Map echoObject = + await api.echoClassMap(allNullableTypesMap); + for (final MapEntry entry + in echoObject.entries) { + compareAllNullableTypes(entry.value, allNullableTypesMap[entry.key]); + } + }); + + testWidgets('NonNull string maps serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + final Map echoObject = + await api.echoNonNullStringMap(nonNullStringMap); + expect(mapEquals(echoObject, nonNullStringMap), true); + }); + + testWidgets('NonNull int maps serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + final Map echoObject = + await api.echoNonNullIntMap(nonNullIntMap); + expect(mapEquals(echoObject, nonNullIntMap), true); + }); + + testWidgets('NonNull enum maps serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + final Map echoObject = + await api.echoNonNullEnumMap(nonNullEnumMap); + expect(mapEquals(echoObject, nonNullEnumMap), true); + }); + + testWidgets('NonNull class maps serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + final Map echoObject = + await api.echoNonNullClassMap(nonNullAllNullableTypesMap); + for (final MapEntry entry in echoObject.entries) { + compareAllNullableTypes( + entry.value, nonNullAllNullableTypesMap[entry.key]); + } }); testWidgets('enums serialize and deserialize correctly', @@ -754,7 +519,7 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { testWidgets('required named parameter', (WidgetTester _) async { final HostIntegrationCoreApi api = HostIntegrationCoreApi(); // This number corresponds with the default value of this method. - const int sentInt = _regularInt; + const int sentInt = regularInt; final int receivedInt = await api.echoRequiredInt(anInt: sentInt); expect(receivedInt, sentInt); }); @@ -798,7 +563,7 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { (WidgetTester _) async { final HostIntegrationCoreApi api = HostIntegrationCoreApi(); - const int sentInt = _regularInt; + const int sentInt = regularInt; final int? receivedInt = await api.echoNullableInt(sentInt); expect(receivedInt, sentInt); }); @@ -807,7 +572,7 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { (WidgetTester _) async { final HostIntegrationCoreApi api = HostIntegrationCoreApi(); - const int sentInt = _biggerThanBigInt; + const int sentInt = biggerThanBigInt; final int? receivedInt = await api.echoNullableInt(sentInt); expect(receivedInt, sentInt); }); @@ -910,7 +675,7 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { expect(receivedString, sentString); // Echo a second type as well to ensure the handling is generic. - const Object sentInt = _regularInt; + const Object sentInt = regularInt; final Object? receivedInt = await api.echoNullableObject(sentInt); expect(receivedInt, sentInt); }); @@ -927,24 +692,129 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { (WidgetTester _) async { final HostIntegrationCoreApi api = HostIntegrationCoreApi(); - const List sentObject = [7, 'Hello Dart!', null]; - final List? echoObject = await api.echoNullableList(sentObject); - expect(listEquals(echoObject, sentObject), true); + final List? echoObject = await api.echoNullableList(list); + expect(listEquals(echoObject, list), true); + }); + + testWidgets('nullable enum lists serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + + final List? echoObject = + await api.echoNullableEnumList(enumList); + expect(listEquals(echoObject, enumList), true); + }); + + testWidgets('nullable lists serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + + final List? echoObject = + await api.echoNullableClassList(allNullableTypesList); + for (final (int index, AllNullableTypes? value) in echoObject!.indexed) { + compareAllNullableTypes(value, allNullableTypesList[index]); + } + }); + + testWidgets( + 'nullable NonNull enum lists serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + + final List? echoObject = + await api.echoNullableNonNullEnumList(nonNullEnumList); + expect(listEquals(echoObject, nonNullEnumList), true); + }); + + testWidgets('nullable NonNull lists serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + + final List? echoObject = + await api.echoNullableClassList(nonNullAllNullableTypesList); + for (final (int index, AllNullableTypes? value) in echoObject!.indexed) { + compareAllNullableTypes(value, nonNullAllNullableTypesList[index]); + } }); testWidgets('nullable maps serialize and deserialize correctly', (WidgetTester _) async { final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + final Map? echoObject = await api.echoNullableMap(map); + expect(mapEquals(echoObject, map), true); + }); + + testWidgets('nullable string maps serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + final Map? echoObject = + await api.echoNullableStringMap(stringMap); + expect(mapEquals(echoObject, stringMap), true); + }); - const Map sentObject = { - 'a': 1, - 'b': 2.3, - 'c': 'four', - 'd': null, - }; - final Map? echoObject = - await api.echoNullableMap(sentObject); - expect(mapEquals(echoObject, sentObject), true); + testWidgets('nullable int maps serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + final Map? echoObject = await api.echoNullableIntMap(intMap); + expect(mapEquals(echoObject, intMap), true); + }); + + testWidgets('nullable enum maps serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + final Map? echoObject = + await api.echoNullableEnumMap(enumMap); + expect(mapEquals(echoObject, enumMap), true); + }); + + testWidgets('nullable class maps serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + final Map? echoObject = + await api.echoNullableClassMap(allNullableTypesMap); + for (final MapEntry entry + in echoObject!.entries) { + compareAllNullableTypes(entry.value, allNullableTypesMap[entry.key]); + } + }); + + testWidgets( + 'nullable NonNull string maps serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + final Map? echoObject = + await api.echoNullableNonNullStringMap(nonNullStringMap); + expect(mapEquals(echoObject, nonNullStringMap), true); + }); + + testWidgets('nullable NonNull int maps serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + final Map? echoObject = + await api.echoNullableNonNullIntMap(nonNullIntMap); + expect(mapEquals(echoObject, nonNullIntMap), true); + }); + + testWidgets( + 'nullable NonNull enum maps serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + final Map? echoObject = + await api.echoNullableNonNullEnumMap(nonNullEnumMap); + expect(mapEquals(echoObject, nonNullEnumMap), true); + }); + + testWidgets( + 'nullable NonNull class maps serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + final Map? echoObject = + await api.echoNullableNonNullClassMap(nonNullAllNullableTypesMap); + for (final MapEntry entry + in echoObject!.entries) { + compareAllNullableTypes( + entry.value, nonNullAllNullableTypesMap[entry.key]); + } }); testWidgets('nullable enums serialize and deserialize correctly', @@ -986,7 +856,24 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { (WidgetTester _) async { final HostIntegrationCoreApi api = HostIntegrationCoreApi(); - final Map? echoObject = await api.echoNullableMap(null); + final Map? echoObject = await api.echoNullableMap(null); + expect(mapEquals(echoObject, null), true); + }); + + testWidgets('null string maps serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + + final Map? echoObject = + await api.echoNullableStringMap(null); + expect(mapEquals(echoObject, null), true); + }); + + testWidgets('null int maps serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + + final Map? echoObject = await api.echoNullableIntMap(null); expect(mapEquals(echoObject, null), true); }); @@ -1020,7 +907,7 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { testWidgets('optional nullable parameter', (WidgetTester _) async { final HostIntegrationCoreApi api = HostIntegrationCoreApi(); - const int sentInt = _regularInt; + const int sentInt = regularInt; final int? receivedInt = await api.echoOptionalNullableInt(sentInt); expect(receivedInt, sentInt); }); @@ -1091,9 +978,9 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { (WidgetTester _) async { final HostIntegrationCoreApi api = HostIntegrationCoreApi(); - final AllTypes echoObject = await api.echoAsyncAllTypes(_genericAllTypes); + final AllTypes echoObject = await api.echoAsyncAllTypes(genericAllTypes); - _compareAllTypes(echoObject, _genericAllTypes); + compareAllTypes(echoObject, genericAllTypes); }); testWidgets( @@ -1102,9 +989,9 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { final HostIntegrationCoreApi api = HostIntegrationCoreApi(); final AllNullableTypes? echoObject = await api - .echoAsyncNullableAllNullableTypes(_recursiveAllNullableTypes); + .echoAsyncNullableAllNullableTypes(recursiveAllNullableTypes); - _compareAllNullableTypes(echoObject, _recursiveAllNullableTypes); + compareAllNullableTypes(echoObject, recursiveAllNullableTypes); }); testWidgets('all null datatypes async serialize and deserialize correctly', @@ -1115,7 +1002,7 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { final AllNullableTypes? echoNullFilledClass = await api.echoAsyncNullableAllNullableTypes(allTypesNull); - _compareAllNullableTypes(echoNullFilledClass, allTypesNull); + compareAllNullableTypes(echoNullFilledClass, allTypesNull); }); testWidgets( @@ -1125,10 +1012,10 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { final AllNullableTypesWithoutRecursion? echoObject = await api.echoAsyncNullableAllNullableTypesWithoutRecursion( - __genericAllNullableTypesWithoutRecursion); + genericAllNullableTypesWithoutRecursion); - __compareAllNullableTypesWithoutRecursion( - echoObject, __genericAllNullableTypesWithoutRecursion); + compareAllNullableTypesWithoutRecursion( + echoObject, genericAllNullableTypesWithoutRecursion); }); testWidgets( @@ -1141,7 +1028,7 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { final AllNullableTypesWithoutRecursion? echoNullFilledClass = await api .echoAsyncNullableAllNullableTypesWithoutRecursion(allTypesNull); - __compareAllNullableTypesWithoutRecursion( + compareAllNullableTypesWithoutRecursion( echoNullFilledClass, allTypesNull); }); @@ -1149,7 +1036,7 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { (WidgetTester _) async { final HostIntegrationCoreApi api = HostIntegrationCoreApi(); - const int sentInt = _regularInt; + const int sentInt = regularInt; final int receivedInt = await api.echoAsyncInt(sentInt); expect(receivedInt, sentInt); }); @@ -1158,7 +1045,7 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { (WidgetTester _) async { final HostIntegrationCoreApi api = HostIntegrationCoreApi(); - const int sentInt = _biggerThanBigInt; + const int sentInt = biggerThanBigInt; final int receivedInt = await api.echoAsyncInt(sentInt); expect(receivedInt, sentInt); }); @@ -1221,7 +1108,7 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { expect(receivedString, sentString); // Echo a second type as well to ensure the handling is generic. - const Object sentInt = _regularInt; + const Object sentInt = regularInt; final Object receivedInt = await api.echoAsyncObject(sentInt); expect(receivedInt, sentInt); }); @@ -1230,23 +1117,68 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { (WidgetTester _) async { final HostIntegrationCoreApi api = HostIntegrationCoreApi(); - const List sentObject = [7, 'Hello Dart!']; - final List echoObject = await api.echoAsyncList(sentObject); - expect(listEquals(echoObject, sentObject), true); + final List echoObject = await api.echoAsyncList(list); + expect(listEquals(echoObject, list), true); + }); + + testWidgets('enum lists serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + + final List echoObject = await api.echoAsyncEnumList(enumList); + expect(listEquals(echoObject, enumList), true); + }); + + testWidgets('class lists serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + + final List echoObject = + await api.echoAsyncClassList(allNullableTypesList); + for (final (int index, AllNullableTypes? value) in echoObject.indexed) { + compareAllNullableTypes(value, allNullableTypesList[index]); + } }); testWidgets('maps serialize and deserialize correctly', (WidgetTester _) async { final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + final Map echoObject = await api.echoAsyncMap(map); + expect(mapEquals(echoObject, map), true); + }); - const Map sentObject = { - 'a': 1, - 'b': 2.3, - 'c': 'four', - }; - final Map echoObject = - await api.echoAsyncMap(sentObject); - expect(mapEquals(echoObject, sentObject), true); + testWidgets('string maps serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + final Map echoObject = + await api.echoAsyncStringMap(stringMap); + expect(mapEquals(echoObject, stringMap), true); + }); + + testWidgets('int maps serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + final Map echoObject = await api.echoAsyncIntMap(intMap); + expect(mapEquals(echoObject, intMap), true); + }); + + testWidgets('enum maps serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + final Map echoObject = + await api.echoAsyncEnumMap(enumMap); + expect(mapEquals(echoObject, enumMap), true); + }); + + testWidgets('class maps serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + final Map echoObject = + await api.echoAsyncClassMap(allNullableTypesMap); + for (final MapEntry entry + in echoObject.entries) { + compareAllNullableTypes(entry.value, allNullableTypesMap[entry.key]); + } }); testWidgets('enums serialize and deserialize correctly', @@ -1280,7 +1212,7 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { (WidgetTester _) async { final HostIntegrationCoreApi api = HostIntegrationCoreApi(); - const int sentInt = _regularInt; + const int sentInt = regularInt; final int? receivedInt = await api.echoAsyncNullableInt(sentInt); expect(receivedInt, sentInt); }); @@ -1289,7 +1221,7 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { (WidgetTester _) async { final HostIntegrationCoreApi api = HostIntegrationCoreApi(); - const int sentInt = _biggerThanBigInt; + const int sentInt = biggerThanBigInt; final int? receivedInt = await api.echoAsyncNullableInt(sentInt); expect(receivedInt, sentInt); }); @@ -1355,7 +1287,7 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { expect(receivedString, sentString); // Echo a second type as well to ensure the handling is generic. - const Object sentInt = _regularInt; + const Object sentInt = regularInt; final Object? receivedInt = await api.echoAsyncNullableObject(sentInt); expect(receivedInt, sentInt); }); @@ -1364,24 +1296,71 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { (WidgetTester _) async { final HostIntegrationCoreApi api = HostIntegrationCoreApi(); - const List sentObject = [7, 'Hello Dart!']; - final List? echoObject = - await api.echoAsyncNullableList(sentObject); - expect(listEquals(echoObject, sentObject), true); + final List? echoObject = await api.echoAsyncNullableList(list); + expect(listEquals(echoObject, list), true); + }); + + testWidgets('nullable enum lists serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + + final List? echoObject = + await api.echoAsyncNullableEnumList(enumList); + expect(listEquals(echoObject, enumList), true); + }); + + testWidgets('nullable class lists serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + + final List? echoObject = + await api.echoAsyncNullableClassList(allNullableTypesList); + for (final (int index, AllNullableTypes? value) in echoObject!.indexed) { + compareAllNullableTypes(value, allNullableTypesList[index]); + } }); testWidgets('nullable maps serialize and deserialize correctly', (WidgetTester _) async { final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + final Map? echoObject = + await api.echoAsyncNullableMap(map); + expect(mapEquals(echoObject, map), true); + }); - const Map sentObject = { - 'a': 1, - 'b': 2.3, - 'c': 'four', - }; - final Map? echoObject = - await api.echoAsyncNullableMap(sentObject); - expect(mapEquals(echoObject, sentObject), true); + testWidgets('nullable string maps serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + final Map? echoObject = + await api.echoAsyncNullableStringMap(stringMap); + expect(mapEquals(echoObject, stringMap), true); + }); + + testWidgets('nullable int maps serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + final Map? echoObject = + await api.echoAsyncNullableIntMap(intMap); + expect(mapEquals(echoObject, intMap), true); + }); + + testWidgets('nullable enum maps serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + final Map? echoObject = + await api.echoAsyncNullableEnumMap(enumMap); + expect(mapEquals(echoObject, enumMap), true); + }); + + testWidgets('nullable class maps serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + final Map? echoObject = + await api.echoAsyncNullableClassMap(allNullableTypesMap); + for (final MapEntry entry + in echoObject!.entries) { + compareAllNullableTypes(entry.value, allNullableTypesMap[entry.key]); + } }); testWidgets('nullable enums serialize and deserialize correctly', @@ -1473,11 +1452,29 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { (WidgetTester _) async { final HostIntegrationCoreApi api = HostIntegrationCoreApi(); - final Map? echoObject = + final Map? echoObject = await api.echoAsyncNullableMap(null); expect(mapEquals(echoObject, null), true); }); + testWidgets('null string maps serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + + final Map? echoObject = + await api.echoAsyncNullableStringMap(null); + expect(mapEquals(echoObject, null), true); + }); + + testWidgets('null int maps serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + + final Map? echoObject = + await api.echoAsyncNullableIntMap(null); + expect(mapEquals(echoObject, null), true); + }); + testWidgets('null enums serialize and deserialize correctly', (WidgetTester _) async { final HostIntegrationCoreApi api = HostIntegrationCoreApi(); @@ -1572,9 +1569,9 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { final HostIntegrationCoreApi api = HostIntegrationCoreApi(); final AllTypes echoObject = - await api.callFlutterEchoAllTypes(_genericAllTypes); + await api.callFlutterEchoAllTypes(genericAllTypes); - _compareAllTypes(echoObject, _genericAllTypes); + compareAllTypes(echoObject, genericAllTypes); }); testWidgets( @@ -1583,7 +1580,7 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { final HostIntegrationCoreApi api = HostIntegrationCoreApi(); const String aNullableString = 'this is a String'; const bool aNullableBool = false; - const int aNullableInt = _regularInt; + const int aNullableInt = regularInt; final AllNullableTypes compositeObject = await api.callFlutterSendMultipleNullableTypes( @@ -1611,7 +1608,7 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { final HostIntegrationCoreApi api = HostIntegrationCoreApi(); const String aNullableString = 'this is a String'; const bool aNullableBool = false; - const int aNullableInt = _regularInt; + const int aNullableInt = regularInt; final AllNullableTypesWithoutRecursion compositeObject = await api.callFlutterSendMultipleNullableTypesWithoutRecursion( @@ -1648,7 +1645,7 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { (WidgetTester _) async { final HostIntegrationCoreApi api = HostIntegrationCoreApi(); - const int sentObject = _regularInt; + const int sentObject = regularInt; final int echoObject = await api.callFlutterEchoInt(sentObject); expect(echoObject, sentObject); }); @@ -1697,89 +1694,191 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { (WidgetTester _) async { final HostIntegrationCoreApi api = HostIntegrationCoreApi(); - const List sentObject = [7, 'Hello Dart!']; - final List echoObject = - await api.callFlutterEchoList(sentObject); - expect(listEquals(echoObject, sentObject), true); + final List echoObject = await api.callFlutterEchoList(list); + expect(listEquals(echoObject, list), true); }); - testWidgets('maps serialize and deserialize correctly', + testWidgets('enum lists serialize and deserialize correctly', (WidgetTester _) async { final HostIntegrationCoreApi api = HostIntegrationCoreApi(); - const Map sentObject = { - 'a': 1, - 'b': 2.3, - 'c': 'four', - }; - final Map echoObject = - await api.callFlutterEchoMap(sentObject); - expect(mapEquals(echoObject, sentObject), true); + final List echoObject = + await api.callFlutterEchoEnumList(enumList); + expect(listEquals(echoObject, enumList), true); }); - testWidgets('enums serialize and deserialize correctly', + testWidgets('class lists serialize and deserialize correctly', (WidgetTester _) async { final HostIntegrationCoreApi api = HostIntegrationCoreApi(); - const AnEnum sentEnum = AnEnum.three; - final AnEnum echoEnum = await api.callFlutterEchoEnum(sentEnum); - expect(echoEnum, sentEnum); + final List echoObject = + await api.callFlutterEchoClassList(allNullableTypesList); + for (final (int index, AllNullableTypes? value) in echoObject.indexed) { + compareAllNullableTypes(value, allNullableTypesList[index]); + } }); - testWidgets('enums serialize and deserialize correctly (again)', + testWidgets('NonNull enum lists serialize and deserialize correctly', (WidgetTester _) async { final HostIntegrationCoreApi api = HostIntegrationCoreApi(); - const AnotherEnum sentEnum = AnotherEnum.justInCase; - final AnotherEnum echoEnum = - await api.callFlutterEchoAnotherEnum(sentEnum); - expect(echoEnum, sentEnum); + final List echoObject = + await api.callFlutterEchoNonNullEnumList(nonNullEnumList); + expect(listEquals(echoObject, nonNullEnumList), true); }); - testWidgets('multi word enums serialize and deserialize correctly', + testWidgets('NonNull class lists serialize and deserialize correctly', (WidgetTester _) async { final HostIntegrationCoreApi api = HostIntegrationCoreApi(); - const AnEnum sentEnum = AnEnum.fortyTwo; - final AnEnum echoEnum = await api.callFlutterEchoEnum(sentEnum); - expect(echoEnum, sentEnum); + final List echoObject = await api + .callFlutterEchoNonNullClassList(nonNullAllNullableTypesList); + for (final (int index, AllNullableTypes? value) in echoObject.indexed) { + compareAllNullableTypes(value, nonNullAllNullableTypesList[index]); + } }); - testWidgets('nullable booleans serialize and deserialize correctly', + testWidgets('maps serialize and deserialize correctly', (WidgetTester _) async { final HostIntegrationCoreApi api = HostIntegrationCoreApi(); - - for (final bool? sentObject in [true, false]) { - final bool? echoObject = - await api.callFlutterEchoNullableBool(sentObject); - expect(echoObject, sentObject); - } + final Map echoObject = + await api.callFlutterEchoMap(map); + expect(mapEquals(echoObject, map), true); }); - testWidgets('null booleans serialize and deserialize correctly', + testWidgets('string maps serialize and deserialize correctly', (WidgetTester _) async { final HostIntegrationCoreApi api = HostIntegrationCoreApi(); - - const bool? sentObject = null; - final bool? echoObject = - await api.callFlutterEchoNullableBool(sentObject); - expect(echoObject, sentObject); + final Map echoObject = + await api.callFlutterEchoStringMap(stringMap); + expect(mapEquals(echoObject, stringMap), true); }); - testWidgets('nullable ints serialize and deserialize correctly', + testWidgets('int maps serialize and deserialize correctly', (WidgetTester _) async { final HostIntegrationCoreApi api = HostIntegrationCoreApi(); - - const int sentObject = _regularInt; - final int? echoObject = await api.callFlutterEchoNullableInt(sentObject); - expect(echoObject, sentObject); + final Map echoObject = + await api.callFlutterEchoIntMap(intMap); + expect(mapEquals(echoObject, intMap), true); + }); + + testWidgets('enum maps serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + final Map echoObject = + await api.callFlutterEchoEnumMap(enumMap); + expect(mapEquals(echoObject, enumMap), true); + }); + + testWidgets('class maps serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + final Map echoObject = + await api.callFlutterEchoClassMap(allNullableTypesMap); + for (final MapEntry entry + in echoObject.entries) { + compareAllNullableTypes(entry.value, allNullableTypesMap[entry.key]); + } + }); + + testWidgets('NonNull string maps serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + final Map echoObject = + await api.callFlutterEchoNonNullStringMap(nonNullStringMap); + expect(mapEquals(echoObject, nonNullStringMap), true); + }); + + testWidgets('NonNull int maps serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + final Map echoObject = + await api.callFlutterEchoNonNullIntMap(nonNullIntMap); + expect(mapEquals(echoObject, nonNullIntMap), true); + }); + + testWidgets('NonNull enum maps serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + final Map echoObject = + await api.callFlutterEchoNonNullEnumMap(nonNullEnumMap); + expect(mapEquals(echoObject, nonNullEnumMap), true); + }); + + testWidgets('NonNull class maps serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + final Map echoObject = + await api.callFlutterEchoNonNullClassMap(nonNullAllNullableTypesMap); + for (final MapEntry entry in echoObject.entries) { + compareAllNullableTypes( + entry.value, nonNullAllNullableTypesMap[entry.key]); + } + }); + + testWidgets('enums serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + + const AnEnum sentEnum = AnEnum.three; + final AnEnum echoEnum = await api.callFlutterEchoEnum(sentEnum); + expect(echoEnum, sentEnum); + }); + + testWidgets('enums serialize and deserialize correctly (again)', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + + const AnotherEnum sentEnum = AnotherEnum.justInCase; + final AnotherEnum echoEnum = + await api.callFlutterEchoAnotherEnum(sentEnum); + expect(echoEnum, sentEnum); + }); + + testWidgets('multi word enums serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + + const AnEnum sentEnum = AnEnum.fortyTwo; + final AnEnum echoEnum = await api.callFlutterEchoEnum(sentEnum); + expect(echoEnum, sentEnum); + }); + + testWidgets('nullable booleans serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + + for (final bool? sentObject in [true, false]) { + final bool? echoObject = + await api.callFlutterEchoNullableBool(sentObject); + expect(echoObject, sentObject); + } + }); + + testWidgets('null booleans serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + + const bool? sentObject = null; + final bool? echoObject = + await api.callFlutterEchoNullableBool(sentObject); + expect(echoObject, sentObject); + }); + + testWidgets('nullable ints serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + + const int sentObject = regularInt; + final int? echoObject = await api.callFlutterEchoNullableInt(sentObject); + expect(echoObject, sentObject); }); testWidgets('nullable big ints serialize and deserialize correctly', (WidgetTester _) async { final HostIntegrationCoreApi api = HostIntegrationCoreApi(); - const int sentObject = _biggerThanBigInt; + const int sentObject = biggerThanBigInt; final int? echoObject = await api.callFlutterEchoNullableInt(sentObject); expect(echoObject, sentObject); }); @@ -1862,10 +1961,51 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { (WidgetTester _) async { final HostIntegrationCoreApi api = HostIntegrationCoreApi(); - const List sentObject = [7, 'Hello Dart!']; final List? echoObject = - await api.callFlutterEchoNullableList(sentObject); - expect(listEquals(echoObject, sentObject), true); + await api.callFlutterEchoNullableList(list); + expect(listEquals(echoObject, list), true); + }); + + testWidgets('nullable enum lists serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + + final List? echoObject = + await api.callFlutterEchoNullableEnumList(enumList); + expect(listEquals(echoObject, enumList), true); + }); + + testWidgets('nullable class lists serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + + final List? echoObject = + await api.callFlutterEchoNullableClassList(allNullableTypesList); + for (final (int index, AllNullableTypes? value) in echoObject!.indexed) { + compareAllNullableTypes(value, allNullableTypesList[index]); + } + }); + + testWidgets( + 'nullable NonNull enum lists serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + + final List? echoObject = + await api.callFlutterEchoNullableNonNullEnumList(nonNullEnumList); + expect(listEquals(echoObject, nonNullEnumList), true); + }); + + testWidgets( + 'nullable NonNull class lists serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + + final List? echoObject = await api + .callFlutterEchoNullableNonNullClassList(nonNullAllNullableTypesList); + for (final (int index, AllNullableTypes? value) in echoObject!.indexed) { + compareAllNullableTypes(value, nonNullAllNullableTypesList[index]); + } }); testWidgets('null lists serialize and deserialize correctly', @@ -1880,26 +2020,103 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { testWidgets('nullable maps serialize and deserialize correctly', (WidgetTester _) async { final HostIntegrationCoreApi api = HostIntegrationCoreApi(); - - const Map sentObject = { - 'a': 1, - 'b': 2.3, - 'c': 'four', - }; - final Map? echoObject = - await api.callFlutterEchoNullableMap(sentObject); - expect(mapEquals(echoObject, sentObject), true); + final Map? echoObject = + await api.callFlutterEchoNullableMap(map); + expect(mapEquals(echoObject, map), true); }); testWidgets('null maps serialize and deserialize correctly', (WidgetTester _) async { final HostIntegrationCoreApi api = HostIntegrationCoreApi(); - final Map? echoObject = + final Map? echoObject = await api.callFlutterEchoNullableMap(null); expect(mapEquals(echoObject, null), true); }); + testWidgets('nullable string maps serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + final Map? echoObject = + await api.callFlutterEchoNullableStringMap(stringMap); + expect(mapEquals(echoObject, stringMap), true); + }); + + testWidgets('nullable int maps serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + final Map? echoObject = + await api.callFlutterEchoNullableIntMap(intMap); + expect(mapEquals(echoObject, intMap), true); + }); + + testWidgets('nullable enum maps serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + final Map? echoObject = + await api.callFlutterEchoNullableEnumMap(enumMap); + expect(mapEquals(echoObject, enumMap), true); + }); + + testWidgets('nullable class maps serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + final Map? echoObject = + await api.callFlutterEchoNullableClassMap(allNullableTypesMap); + for (final MapEntry entry + in echoObject!.entries) { + compareAllNullableTypes(entry.value, allNullableTypesMap[entry.key]); + } + }); + + testWidgets( + 'nullable NonNull string maps serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + final Map? echoObject = + await api.callFlutterEchoNullableNonNullStringMap(nonNullStringMap); + expect(mapEquals(echoObject, nonNullStringMap), true); + }); + + testWidgets('nullable NonNull int maps serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + final Map? echoObject = + await api.callFlutterEchoNullableNonNullIntMap(nonNullIntMap); + expect(mapEquals(echoObject, nonNullIntMap), true); + }); + + testWidgets( + 'nullable NonNull enum maps serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + final Map? echoObject = + await api.callFlutterEchoNullableNonNullEnumMap(nonNullEnumMap); + expect(mapEquals(echoObject, nonNullEnumMap), true); + }); + + testWidgets( + 'nullable NonNull class maps serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + final Map? echoObject = await api + .callFlutterEchoNullableNonNullClassMap(nonNullAllNullableTypesMap); + for (final MapEntry entry + in echoObject!.entries) { + compareAllNullableTypes( + entry.value, nonNullAllNullableTypesMap[entry.key]); + } + }); + + testWidgets('null maps serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + + final Map? echoObject = + await api.callFlutterEchoNullableIntMap(null); + expect(mapEquals(echoObject, null), true); + }); + testWidgets('nullable enums serialize and deserialize correctly', (WidgetTester _) async { final HostIntegrationCoreApi api = HostIntegrationCoreApi(); @@ -1948,6 +2165,655 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { }); }); + group('Proxy API Tests', () { + if (!proxyApiSupportedLanguages.contains(targetGenerator)) { + return; + } + + testWidgets('noop', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + + await expectLater(api.noop(), completes); + }); + + testWidgets('throwError', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + + await expectLater( + () => api.throwError(), + throwsA(isA()), + ); + }); + + testWidgets('throwErrorFromVoid', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + + await expectLater( + () => api.throwErrorFromVoid(), + throwsA(isA()), + ); + }); + + testWidgets('throwFlutterError', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + + await expectLater( + () => api.throwFlutterError(), + throwsA( + (dynamic e) { + return e is PlatformException && + e.code == 'code' && + e.message == 'message' && + e.details == 'details'; + }, + ), + ); + }); + + testWidgets('echoInt', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + + const int value = 0; + expect(await api.echoInt(value), value); + }); + + testWidgets('echoDouble', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + + const double value = 0.0; + expect(await api.echoDouble(value), value); + }); + + testWidgets('echoBool', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + + const bool value = true; + expect(await api.echoBool(value), value); + }); + + testWidgets('echoString', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + + const String value = 'string'; + expect(await api.echoString(value), value); + }); + + testWidgets('echoUint8List', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + + final Uint8List value = Uint8List(0); + expect(await api.echoUint8List(value), value); + }); + + testWidgets('echoObject', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + + const Object value = 'apples'; + expect(await api.echoObject(value), value); + }); + + testWidgets('echoList', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + + const List value = [1, 2]; + expect(await api.echoList(value), value); + }); + + testWidgets('echoProxyApiList', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + + final List value = [ + _createGenericProxyApiTestClass(), + _createGenericProxyApiTestClass(), + ]; + expect(await api.echoProxyApiList(value), value); + }); + + testWidgets('echoMap', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + + const Map value = {'apple': 'pie'}; + expect(await api.echoMap(value), value); + }); + + testWidgets('echoProxyApiMap', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + + final Map value = { + '42': _createGenericProxyApiTestClass(), + }; + expect(await api.echoProxyApiMap(value), value); + }); + + testWidgets('echoEnum', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + + const ProxyApiTestEnum value = ProxyApiTestEnum.three; + expect(await api.echoEnum(value), value); + }); + + testWidgets('echoProxyApi', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + + final ProxyApiSuperClass value = ProxyApiSuperClass(); + expect(await api.echoProxyApi(value), value); + }); + + testWidgets('echoNullableInt', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + expect(await api.echoNullableInt(null), null); + expect(await api.echoNullableInt(1), 1); + }); + + testWidgets('echoNullableDouble', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + expect(await api.echoNullableDouble(null), null); + expect(await api.echoNullableDouble(1.0), 1.0); + }); + + testWidgets('echoNullableBool', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + expect(await api.echoNullableBool(null), null); + expect(await api.echoNullableBool(false), false); + }); + + testWidgets('echoNullableString', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + expect(await api.echoNullableString(null), null); + expect(await api.echoNullableString('aString'), 'aString'); + }); + + testWidgets('echoNullableUint8List', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + expect(await api.echoNullableUint8List(null), null); + expect(await api.echoNullableUint8List(Uint8List(0)), Uint8List(0)); + }); + + testWidgets('echoNullableObject', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + expect(await api.echoNullableObject(null), null); + expect(await api.echoNullableObject('aString'), 'aString'); + }); + + testWidgets('echoNullableList', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + expect(await api.echoNullableList(null), null); + expect(await api.echoNullableList([1]), [1]); + }); + + testWidgets('echoNullableMap', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + expect(await api.echoNullableMap(null), null); + expect( + await api.echoNullableMap({'value': 1}), + {'value': 1}, + ); + }); + + testWidgets('echoNullableEnum', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + expect(await api.echoNullableEnum(null), null); + expect( + await api.echoNullableEnum(ProxyApiTestEnum.one), + ProxyApiTestEnum.one, + ); + }); + + testWidgets('echoNullableProxyApi', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + expect(await api.echoNullableProxyApi(null), null); + + final ProxyApiSuperClass proxyApi = ProxyApiSuperClass(); + expect( + await api.echoNullableProxyApi(proxyApi), + proxyApi, + ); + }); + + testWidgets('noopAsync', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + await expectLater(api.noopAsync(), completes); + }); + + testWidgets('echoAsyncInt', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + + const int value = 0; + expect(await api.echoAsyncInt(value), value); + }); + + testWidgets('echoAsyncDouble', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + + const double value = 0.0; + expect(await api.echoAsyncDouble(value), value); + }); + + testWidgets('echoAsyncBool', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + + const bool value = false; + expect(await api.echoAsyncBool(value), value); + }); + + testWidgets('echoAsyncString', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + + const String value = 'ping'; + expect(await api.echoAsyncString(value), value); + }); + + testWidgets('echoAsyncUint8List', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + + final Uint8List value = Uint8List(0); + expect(await api.echoAsyncUint8List(value), value); + }); + + testWidgets('echoAsyncObject', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + + const Object value = 0; + expect(await api.echoAsyncObject(value), value); + }); + + testWidgets('echoAsyncList', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + + const List value = ['apple', 'pie']; + expect(await api.echoAsyncList(value), value); + }); + + testWidgets('echoAsyncMap', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + + final Map value = { + 'something': ProxyApiSuperClass(), + }; + expect(await api.echoAsyncMap(value), value); + }); + + testWidgets('echoAsyncEnum', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + + const ProxyApiTestEnum value = ProxyApiTestEnum.two; + expect(await api.echoAsyncEnum(value), value); + }); + + testWidgets('throwAsyncError', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + + await expectLater( + () => api.throwAsyncError(), + throwsA(isA()), + ); + }); + + testWidgets('throwAsyncErrorFromVoid', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + + await expectLater( + () => api.throwAsyncErrorFromVoid(), + throwsA(isA()), + ); + }); + + testWidgets('throwAsyncFlutterError', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + + await expectLater( + () => api.throwAsyncFlutterError(), + throwsA( + (dynamic e) { + return e is PlatformException && + e.code == 'code' && + e.message == 'message' && + e.details == 'details'; + }, + ), + ); + }); + + testWidgets('echoAsyncNullableInt', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + expect(await api.echoAsyncNullableInt(null), null); + expect(await api.echoAsyncNullableInt(1), 1); + }); + + testWidgets('echoAsyncNullableDouble', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + expect(await api.echoAsyncNullableDouble(null), null); + expect(await api.echoAsyncNullableDouble(2.0), 2.0); + }); + + testWidgets('echoAsyncNullableBool', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + expect(await api.echoAsyncNullableBool(null), null); + expect(await api.echoAsyncNullableBool(true), true); + }); + + testWidgets('echoAsyncNullableString', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + expect(await api.echoAsyncNullableString(null), null); + expect(await api.echoAsyncNullableString('aString'), 'aString'); + }); + + testWidgets('echoAsyncNullableUint8List', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + expect(await api.echoAsyncNullableUint8List(null), null); + expect( + await api.echoAsyncNullableUint8List(Uint8List(0)), + Uint8List(0), + ); + }); + + testWidgets('echoAsyncNullableObject', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + expect(await api.echoAsyncNullableObject(null), null); + expect(await api.echoAsyncNullableObject(1), 1); + }); + + testWidgets('echoAsyncNullableList', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + expect(await api.echoAsyncNullableList(null), null); + expect(await api.echoAsyncNullableList([1]), [1]); + }); + + testWidgets('echoAsyncNullableMap', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + expect(await api.echoAsyncNullableMap(null), null); + expect( + await api.echoAsyncNullableMap({'banana': 1}), + {'banana': 1}, + ); + }); + + testWidgets('echoAsyncNullableEnum', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + expect(await api.echoAsyncNullableEnum(null), null); + expect( + await api.echoAsyncNullableEnum(ProxyApiTestEnum.one), + ProxyApiTestEnum.one, + ); + }); + + testWidgets('staticNoop', (_) async { + await expectLater(ProxyApiTestClass.staticNoop(), completes); + }); + + testWidgets('echoStaticString', (_) async { + const String value = 'static string'; + expect(await ProxyApiTestClass.echoStaticString(value), value); + }); + + testWidgets('staticAsyncNoop', (_) async { + await expectLater(ProxyApiTestClass.staticAsyncNoop(), completes); + }); + + testWidgets('callFlutterNoop', (_) async { + bool called = false; + final ProxyApiTestClass api = _createGenericProxyApiTestClass( + flutterNoop: (ProxyApiTestClass instance) async { + called = true; + }, + ); + + await api.callFlutterNoop(); + expect(called, isTrue); + }); + + testWidgets('callFlutterThrowError', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass( + flutterThrowError: (_) { + throw FlutterError('this is an error'); + }, + ); + + await expectLater( + api.callFlutterThrowError(), + throwsA( + isA().having( + (PlatformException exception) => exception.message, + 'message', + equals('this is an error'), + ), + ), + ); + }); + + testWidgets('callFlutterThrowErrorFromVoid', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass( + flutterThrowErrorFromVoid: (_) { + throw FlutterError('this is an error'); + }, + ); + + await expectLater( + api.callFlutterThrowErrorFromVoid(), + throwsA( + isA().having( + (PlatformException exception) => exception.message, + 'message', + equals('this is an error'), + ), + ), + ); + }); + + testWidgets('callFlutterEchoBool', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass( + flutterEchoBool: (_, bool aBool) => aBool, + ); + + const bool value = true; + expect(await api.callFlutterEchoBool(value), value); + }); + + testWidgets('callFlutterEchoInt', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass( + flutterEchoInt: (_, int anInt) => anInt, + ); + + const int value = 0; + expect(await api.callFlutterEchoInt(value), value); + }); + + testWidgets('callFlutterEchoDouble', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass( + flutterEchoDouble: (_, double aDouble) => aDouble, + ); + + const double value = 0.0; + expect(await api.callFlutterEchoDouble(value), value); + }); + + testWidgets('callFlutterEchoString', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass( + flutterEchoString: (_, String aString) => aString, + ); + + const String value = 'a string'; + expect(await api.callFlutterEchoString(value), value); + }); + + testWidgets('callFlutterEchoUint8List', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass( + flutterEchoUint8List: (_, Uint8List aUint8List) => aUint8List, + ); + + final Uint8List value = Uint8List(0); + expect(await api.callFlutterEchoUint8List(value), value); + }); + + testWidgets('callFlutterEchoList', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass( + flutterEchoList: (_, List aList) => aList, + ); + + final List value = [0, 0.0, true, ProxyApiSuperClass()]; + expect(await api.callFlutterEchoList(value), value); + }); + + testWidgets('callFlutterEchoProxyApiList', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass( + flutterEchoProxyApiList: (_, List aList) => aList, + ); + + final List value = [ + _createGenericProxyApiTestClass(), + ]; + expect(await api.callFlutterEchoProxyApiList(value), value); + }); + + testWidgets('callFlutterEchoMap', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass( + flutterEchoMap: (_, Map aMap) => aMap, + ); + + final Map value = { + 'a String': 4, + }; + expect(await api.callFlutterEchoMap(value), value); + }); + + testWidgets('callFlutterEchoProxyApiMap', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass( + flutterEchoProxyApiMap: (_, Map aMap) => + aMap, + ); + + final Map value = + { + 'a String': _createGenericProxyApiTestClass(), + }; + expect(await api.callFlutterEchoProxyApiMap(value), value); + }); + + testWidgets('callFlutterEchoEnum', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass( + flutterEchoEnum: (_, ProxyApiTestEnum anEnum) => anEnum, + ); + + const ProxyApiTestEnum value = ProxyApiTestEnum.three; + expect(await api.callFlutterEchoEnum(value), value); + }); + + testWidgets('callFlutterEchoProxyApi', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass( + flutterEchoProxyApi: (_, ProxyApiSuperClass aProxyApi) => aProxyApi, + ); + + final ProxyApiSuperClass value = ProxyApiSuperClass(); + expect(await api.callFlutterEchoProxyApi(value), value); + }); + + testWidgets('callFlutterEchoNullableBool', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass( + flutterEchoNullableBool: (_, bool? aBool) => aBool, + ); + expect(await api.callFlutterEchoNullableBool(null), null); + expect(await api.callFlutterEchoNullableBool(true), true); + }); + + testWidgets('callFlutterEchoNullableInt', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass( + flutterEchoNullableInt: (_, int? anInt) => anInt, + ); + expect(await api.callFlutterEchoNullableInt(null), null); + expect(await api.callFlutterEchoNullableInt(1), 1); + }); + + testWidgets('callFlutterEchoNullableDouble', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass( + flutterEchoNullableDouble: (_, double? aDouble) => aDouble, + ); + expect(await api.callFlutterEchoNullableDouble(null), null); + expect(await api.callFlutterEchoNullableDouble(1.0), 1.0); + }); + + testWidgets('callFlutterEchoNullableString', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass( + flutterEchoNullableString: (_, String? aString) => aString, + ); + expect(await api.callFlutterEchoNullableString(null), null); + expect(await api.callFlutterEchoNullableString('aString'), 'aString'); + }); + + testWidgets('callFlutterEchoNullableUint8List', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass( + flutterEchoNullableUint8List: (_, Uint8List? aUint8List) => aUint8List, + ); + expect(await api.callFlutterEchoNullableUint8List(null), null); + expect( + await api.callFlutterEchoNullableUint8List(Uint8List(0)), + Uint8List(0), + ); + }); + + testWidgets('callFlutterEchoNullableList', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass( + flutterEchoNullableList: (_, List? aList) => aList, + ); + expect(await api.callFlutterEchoNullableList(null), null); + expect(await api.callFlutterEchoNullableList([0]), [0]); + }); + + testWidgets('callFlutterEchoNullableMap', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass( + flutterEchoNullableMap: (_, Map? aMap) => aMap, + ); + expect(await api.callFlutterEchoNullableMap(null), null); + expect( + await api.callFlutterEchoNullableMap({'str': 0}), + {'str': 0}, + ); + }); + + testWidgets('callFlutterEchoNullableEnum', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass( + flutterEchoNullableEnum: (_, ProxyApiTestEnum? anEnum) => anEnum, + ); + expect(await api.callFlutterEchoNullableEnum(null), null); + expect( + await api.callFlutterEchoNullableEnum(ProxyApiTestEnum.two), + ProxyApiTestEnum.two, + ); + }); + + testWidgets('callFlutterEchoNullableProxyApi', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass( + flutterEchoNullableProxyApi: (_, ProxyApiSuperClass? aProxyApi) => + aProxyApi, + ); + + expect(await api.callFlutterEchoNullableProxyApi(null), null); + + final ProxyApiSuperClass proxyApi = ProxyApiSuperClass(); + expect(await api.callFlutterEchoNullableProxyApi(proxyApi), proxyApi); + }); + + testWidgets('callFlutterNoopAsync', (_) async { + bool called = false; + final ProxyApiTestClass api = _createGenericProxyApiTestClass( + flutterNoopAsync: (ProxyApiTestClass instance) async { + called = true; + }, + ); + + await api.callFlutterNoopAsync(); + expect(called, isTrue); + }); + + testWidgets('callFlutterEchoAsyncString', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass( + flutterEchoAsyncString: (_, String aString) async => aString, + ); + + const String value = 'a string'; + expect(await api.callFlutterEchoAsyncString(value), value); + }); + }); + group('Flutter API with suffix', () { setUp(() { FlutterSmallApi.setUp( @@ -1969,6 +2835,11 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { expect(echoObject, sentObject); }); }); + + testWidgets('Unused data class still generate', (_) async { + final UnusedClass unused = UnusedClass(); + expect(unused, unused); + }); } class _FlutterApiTestImplementation implements FlutterIntegrationCoreApi { @@ -2038,7 +2909,57 @@ class _FlutterApiTestImplementation implements FlutterIntegrationCoreApi { List echoList(List list) => list; @override - Map echoMap(Map aMap) => aMap; + List echoEnumList(List enumList) => enumList; + + @override + List echoClassList(List classList) { + return classList; + } + + @override + List echoNonNullEnumList(List enumList) => enumList; + + @override + List echoNonNullClassList( + List classList) { + return classList; + } + + @override + Map echoMap(Map map) => map; + + @override + Map echoStringMap(Map stringMap) => + stringMap; + + @override + Map echoIntMap(Map intMap) => intMap; + + @override + Map echoEnumMap(Map enumMap) => enumMap; + + @override + Map echoClassMap( + Map classMap) { + return classMap; + } + + @override + Map echoNonNullStringMap(Map stringMap) => + stringMap; + + @override + Map echoNonNullIntMap(Map intMap) => intMap; + + @override + Map echoNonNullEnumMap(Map enumMap) => + enumMap; + + @override + Map echoNonNullClassMap( + Map classMap) { + return classMap; + } @override AnEnum echoEnum(AnEnum anEnum) => anEnum; @@ -2059,7 +2980,70 @@ class _FlutterApiTestImplementation implements FlutterIntegrationCoreApi { List? echoNullableList(List? list) => list; @override - Map? echoNullableMap(Map? aMap) => aMap; + List? echoNullableEnumList(List? enumList) => enumList; + + @override + List? echoNullableClassList( + List? classList) { + return classList; + } + + @override + List? echoNullableNonNullEnumList(List? enumList) { + return enumList; + } + + @override + List? echoNullableNonNullClassList( + List? classList) { + return classList; + } + + @override + Map? echoNullableMap(Map? map) => map; + + @override + Map? echoNullableStringMap( + Map? stringMap) { + return stringMap; + } + + @override + Map? echoNullableIntMap(Map? intMap) => intMap; + + @override + Map? echoNullableEnumMap(Map? enumMap) { + return enumMap; + } + + @override + Map? echoNullableClassMap( + Map? classMap) { + return classMap; + } + + @override + Map? echoNullableNonNullStringMap( + Map? stringMap) { + return stringMap; + } + + @override + Map? echoNullableNonNullIntMap(Map? intMap) { + return intMap; + } + + @override + Map? echoNullableNonNullEnumMap( + Map? enumMap) { + return enumMap; + } + + @override + Map? echoNullableNonNullClassMap( + Map? classMap) { + return classMap; + } @override String? echoNullableString(String? aString) => aString; @@ -2093,3 +3077,142 @@ class _SmallFlutterApi implements FlutterSmallApi { return msg; } } + +ProxyApiTestClass _createGenericProxyApiTestClass({ + void Function(ProxyApiTestClass instance)? flutterNoop, + Object? Function(ProxyApiTestClass instance)? flutterThrowError, + void Function( + ProxyApiTestClass instance, + )? flutterThrowErrorFromVoid, + bool Function( + ProxyApiTestClass instance, + bool aBool, + )? flutterEchoBool, + int Function( + ProxyApiTestClass instance, + int anInt, + )? flutterEchoInt, + double Function( + ProxyApiTestClass instance, + double aDouble, + )? flutterEchoDouble, + String Function( + ProxyApiTestClass instance, + String aString, + )? flutterEchoString, + Uint8List Function( + ProxyApiTestClass instance, + Uint8List aList, + )? flutterEchoUint8List, + List Function( + ProxyApiTestClass instance, + List aList, + )? flutterEchoList, + List Function( + ProxyApiTestClass instance, + List aList, + )? flutterEchoProxyApiList, + Map Function( + ProxyApiTestClass instance, + Map aMap, + )? flutterEchoMap, + Map Function( + ProxyApiTestClass instance, + Map aMap, + )? flutterEchoProxyApiMap, + ProxyApiTestEnum Function( + ProxyApiTestClass instance, + ProxyApiTestEnum anEnum, + )? flutterEchoEnum, + ProxyApiSuperClass Function( + ProxyApiTestClass instance, + ProxyApiSuperClass aProxyApi, + )? flutterEchoProxyApi, + bool? Function( + ProxyApiTestClass instance, + bool? aBool, + )? flutterEchoNullableBool, + int? Function( + ProxyApiTestClass instance, + int? anInt, + )? flutterEchoNullableInt, + double? Function( + ProxyApiTestClass instance, + double? aDouble, + )? flutterEchoNullableDouble, + String? Function( + ProxyApiTestClass instance, + String? aString, + )? flutterEchoNullableString, + Uint8List? Function( + ProxyApiTestClass instance, + Uint8List? aList, + )? flutterEchoNullableUint8List, + List? Function( + ProxyApiTestClass instance, + List? aList, + )? flutterEchoNullableList, + Map? Function( + ProxyApiTestClass instance, + Map? aMap, + )? flutterEchoNullableMap, + ProxyApiTestEnum? Function( + ProxyApiTestClass instance, + ProxyApiTestEnum? anEnum, + )? flutterEchoNullableEnum, + ProxyApiSuperClass? Function( + ProxyApiTestClass instance, + ProxyApiSuperClass? aProxyApi, + )? flutterEchoNullableProxyApi, + Future Function(ProxyApiTestClass instance)? flutterNoopAsync, + Future Function( + ProxyApiTestClass instance, + String aString, + )? flutterEchoAsyncString, +}) { + return ProxyApiTestClass( + aBool: true, + anInt: 0, + aDouble: 0.0, + aString: '', + aUint8List: Uint8List(0), + aList: const [], + aMap: const {}, + anEnum: ProxyApiTestEnum.one, + aProxyApi: ProxyApiSuperClass(), + boolParam: true, + intParam: 0, + doubleParam: 0.0, + stringParam: '', + aUint8ListParam: Uint8List(0), + listParam: const [], + mapParam: const {}, + enumParam: ProxyApiTestEnum.one, + proxyApiParam: ProxyApiSuperClass(), + flutterNoop: flutterNoop, + flutterThrowError: flutterThrowError, + flutterThrowErrorFromVoid: flutterThrowErrorFromVoid, + flutterEchoBool: flutterEchoBool, + flutterEchoInt: flutterEchoInt, + flutterEchoDouble: flutterEchoDouble, + flutterEchoString: flutterEchoString, + flutterEchoUint8List: flutterEchoUint8List, + flutterEchoList: flutterEchoList, + flutterEchoProxyApiList: flutterEchoProxyApiList, + flutterEchoMap: flutterEchoMap, + flutterEchoProxyApiMap: flutterEchoProxyApiMap, + flutterEchoEnum: flutterEchoEnum, + flutterEchoProxyApi: flutterEchoProxyApi, + flutterEchoNullableBool: flutterEchoNullableBool, + flutterEchoNullableInt: flutterEchoNullableInt, + flutterEchoNullableDouble: flutterEchoNullableDouble, + flutterEchoNullableString: flutterEchoNullableString, + flutterEchoNullableUint8List: flutterEchoNullableUint8List, + flutterEchoNullableList: flutterEchoNullableList, + flutterEchoNullableMap: flutterEchoNullableMap, + flutterEchoNullableEnum: flutterEchoNullableEnum, + flutterEchoNullableProxyApi: flutterEchoNullableProxyApi, + flutterNoopAsync: flutterNoopAsync, + flutterEchoAsyncString: flutterEchoAsyncString, + ); +} diff --git a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/background_platform_channels.gen.dart b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/background_platform_channels.gen.dart index 9fb5e58df030..3bcbaaff4703 100644 --- a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/background_platform_channels.gen.dart +++ b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/background_platform_channels.gen.dart @@ -21,6 +21,23 @@ PlatformException _createConnectionError(String channelName) { class _PigeonCodec extends StandardMessageCodec { const _PigeonCodec(); + @override + void writeValue(WriteBuffer buffer, Object? value) { + if (value is int) { + buffer.putUint8(4); + buffer.putInt64(value); + } else { + super.writeValue(buffer, value); + } + } + + @override + Object? readValueOfType(int type, ReadBuffer buffer) { + switch (type) { + default: + return super.readValueOfType(type, buffer); + } + } } class BackgroundApi2Host { diff --git a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/core_tests.gen.dart b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/core_tests.gen.dart index 762b5d77502f..234361ada5ae 100644 --- a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/core_tests.gen.dart +++ b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/core_tests.gen.dart @@ -42,6 +42,27 @@ enum AnotherEnum { justInCase, } +class UnusedClass { + UnusedClass({ + this.aField, + }); + + Object? aField; + + Object encode() { + return [ + aField, + ]; + } + + static UnusedClass decode(Object result) { + result as List; + return UnusedClass( + aField: result[0], + ); + } +} + /// A class containing all supported types. class AllTypes { AllTypes({ @@ -62,7 +83,17 @@ class AllTypes { required this.intList, required this.doubleList, required this.boolList, + required this.enumList, + required this.objectList, + required this.listList, + required this.mapList, required this.map, + required this.stringMap, + required this.intMap, + required this.enumMap, + required this.objectMap, + required this.listMap, + required this.mapMap, }); bool aBool; @@ -91,16 +122,36 @@ class AllTypes { List list; - List stringList; + List stringList; + + List intList; + + List doubleList; + + List boolList; - List intList; + List enumList; - List doubleList; + List objectList; - List boolList; + List> listList; + + List> mapList; Map map; + Map stringMap; + + Map intMap; + + Map enumMap; + + Map objectMap; + + Map> listMap; + + Map> mapMap; + Object encode() { return [ aBool, @@ -120,7 +171,17 @@ class AllTypes { intList, doubleList, boolList, + enumList, + objectList, + listList, + mapList, map, + stringMap, + intMap, + enumMap, + objectMap, + listMap, + mapMap, ]; } @@ -140,11 +201,23 @@ class AllTypes { aString: result[10]! as String, anObject: result[11]!, list: result[12]! as List, - stringList: (result[13] as List?)!.cast(), - intList: (result[14] as List?)!.cast(), - doubleList: (result[15] as List?)!.cast(), - boolList: (result[16] as List?)!.cast(), - map: result[17]! as Map, + stringList: (result[13] as List?)!.cast(), + intList: (result[14] as List?)!.cast(), + doubleList: (result[15] as List?)!.cast(), + boolList: (result[16] as List?)!.cast(), + enumList: (result[17] as List?)!.cast(), + objectList: (result[18] as List?)!.cast(), + listList: (result[19] as List?)!.cast>(), + mapList: (result[20] as List?)!.cast>(), + map: result[21]! as Map, + stringMap: (result[22] as Map?)!.cast(), + intMap: (result[23] as Map?)!.cast(), + enumMap: (result[24] as Map?)!.cast(), + objectMap: (result[25] as Map?)!.cast(), + listMap: + (result[26] as Map?)!.cast>(), + mapMap: (result[27] as Map?)! + .cast>(), ); } } @@ -160,9 +233,6 @@ class AllNullableTypes { this.aNullable4ByteArray, this.aNullable8ByteArray, this.aNullableFloatArray, - this.nullableNestedList, - this.nullableMapWithAnnotations, - this.nullableMapWithObject, this.aNullableEnum, this.anotherNullableEnum, this.aNullableString, @@ -173,8 +243,19 @@ class AllNullableTypes { this.intList, this.doubleList, this.boolList, - this.nestedClassList, + this.enumList, + this.objectList, + this.listList, + this.mapList, + this.recursiveClassList, this.map, + this.stringMap, + this.intMap, + this.enumMap, + this.objectMap, + this.listMap, + this.mapMap, + this.recursiveClassMap, }); bool? aNullableBool; @@ -193,12 +274,6 @@ class AllNullableTypes { Float64List? aNullableFloatArray; - List?>? nullableNestedList; - - Map? nullableMapWithAnnotations; - - Map? nullableMapWithObject; - AnEnum? aNullableEnum; AnotherEnum? anotherNullableEnum; @@ -219,10 +294,32 @@ class AllNullableTypes { List? boolList; - List? nestedClassList; + List? enumList; + + List? objectList; + + List?>? listList; + + List?>? mapList; + + List? recursiveClassList; Map? map; + Map? stringMap; + + Map? intMap; + + Map? enumMap; + + Map? objectMap; + + Map?>? listMap; + + Map?>? mapMap; + + Map? recursiveClassMap; + Object encode() { return [ aNullableBool, @@ -233,9 +330,6 @@ class AllNullableTypes { aNullable4ByteArray, aNullable8ByteArray, aNullableFloatArray, - nullableNestedList, - nullableMapWithAnnotations, - nullableMapWithObject, aNullableEnum, anotherNullableEnum, aNullableString, @@ -246,8 +340,19 @@ class AllNullableTypes { intList, doubleList, boolList, - nestedClassList, + enumList, + objectList, + listList, + mapList, + recursiveClassList, map, + stringMap, + intMap, + enumMap, + objectMap, + listMap, + mapMap, + recursiveClassMap, ]; } @@ -262,24 +367,35 @@ class AllNullableTypes { aNullable4ByteArray: result[5] as Int32List?, aNullable8ByteArray: result[6] as Int64List?, aNullableFloatArray: result[7] as Float64List?, - nullableNestedList: (result[8] as List?)?.cast?>(), - nullableMapWithAnnotations: - (result[9] as Map?)?.cast(), - nullableMapWithObject: - (result[10] as Map?)?.cast(), - aNullableEnum: result[11] as AnEnum?, - anotherNullableEnum: result[12] as AnotherEnum?, - aNullableString: result[13] as String?, - aNullableObject: result[14], - allNullableTypes: result[15] as AllNullableTypes?, - list: result[16] as List?, - stringList: (result[17] as List?)?.cast(), - intList: (result[18] as List?)?.cast(), - doubleList: (result[19] as List?)?.cast(), - boolList: (result[20] as List?)?.cast(), - nestedClassList: - (result[21] as List?)?.cast(), - map: result[22] as Map?, + aNullableEnum: result[8] as AnEnum?, + anotherNullableEnum: result[9] as AnotherEnum?, + aNullableString: result[10] as String?, + aNullableObject: result[11], + allNullableTypes: result[12] as AllNullableTypes?, + list: result[13] as List?, + stringList: (result[14] as List?)?.cast(), + intList: (result[15] as List?)?.cast(), + doubleList: (result[16] as List?)?.cast(), + boolList: (result[17] as List?)?.cast(), + enumList: (result[18] as List?)?.cast(), + objectList: (result[19] as List?)?.cast(), + listList: (result[20] as List?)?.cast?>(), + mapList: (result[21] as List?)?.cast?>(), + recursiveClassList: + (result[22] as List?)?.cast(), + map: result[23] as Map?, + stringMap: + (result[24] as Map?)?.cast(), + intMap: (result[25] as Map?)?.cast(), + enumMap: (result[26] as Map?)?.cast(), + objectMap: + (result[27] as Map?)?.cast(), + listMap: + (result[28] as Map?)?.cast?>(), + mapMap: (result[29] as Map?) + ?.cast?>(), + recursiveClassMap: (result[30] as Map?) + ?.cast(), ); } } @@ -297,9 +413,6 @@ class AllNullableTypesWithoutRecursion { this.aNullable4ByteArray, this.aNullable8ByteArray, this.aNullableFloatArray, - this.nullableNestedList, - this.nullableMapWithAnnotations, - this.nullableMapWithObject, this.aNullableEnum, this.anotherNullableEnum, this.aNullableString, @@ -309,7 +422,17 @@ class AllNullableTypesWithoutRecursion { this.intList, this.doubleList, this.boolList, + this.enumList, + this.objectList, + this.listList, + this.mapList, this.map, + this.stringMap, + this.intMap, + this.enumMap, + this.objectMap, + this.listMap, + this.mapMap, }); bool? aNullableBool; @@ -328,12 +451,6 @@ class AllNullableTypesWithoutRecursion { Float64List? aNullableFloatArray; - List?>? nullableNestedList; - - Map? nullableMapWithAnnotations; - - Map? nullableMapWithObject; - AnEnum? aNullableEnum; AnotherEnum? anotherNullableEnum; @@ -352,8 +469,28 @@ class AllNullableTypesWithoutRecursion { List? boolList; + List? enumList; + + List? objectList; + + List?>? listList; + + List?>? mapList; + Map? map; + Map? stringMap; + + Map? intMap; + + Map? enumMap; + + Map? objectMap; + + Map?>? listMap; + + Map?>? mapMap; + Object encode() { return [ aNullableBool, @@ -364,9 +501,6 @@ class AllNullableTypesWithoutRecursion { aNullable4ByteArray, aNullable8ByteArray, aNullableFloatArray, - nullableNestedList, - nullableMapWithAnnotations, - nullableMapWithObject, aNullableEnum, anotherNullableEnum, aNullableString, @@ -376,7 +510,17 @@ class AllNullableTypesWithoutRecursion { intList, doubleList, boolList, + enumList, + objectList, + listList, + mapList, map, + stringMap, + intMap, + enumMap, + objectMap, + listMap, + mapMap, ]; } @@ -391,21 +535,30 @@ class AllNullableTypesWithoutRecursion { aNullable4ByteArray: result[5] as Int32List?, aNullable8ByteArray: result[6] as Int64List?, aNullableFloatArray: result[7] as Float64List?, - nullableNestedList: (result[8] as List?)?.cast?>(), - nullableMapWithAnnotations: - (result[9] as Map?)?.cast(), - nullableMapWithObject: - (result[10] as Map?)?.cast(), - aNullableEnum: result[11] as AnEnum?, - anotherNullableEnum: result[12] as AnotherEnum?, - aNullableString: result[13] as String?, - aNullableObject: result[14], - list: result[15] as List?, - stringList: (result[16] as List?)?.cast(), - intList: (result[17] as List?)?.cast(), - doubleList: (result[18] as List?)?.cast(), - boolList: (result[19] as List?)?.cast(), - map: result[20] as Map?, + aNullableEnum: result[8] as AnEnum?, + anotherNullableEnum: result[9] as AnotherEnum?, + aNullableString: result[10] as String?, + aNullableObject: result[11], + list: result[12] as List?, + stringList: (result[13] as List?)?.cast(), + intList: (result[14] as List?)?.cast(), + doubleList: (result[15] as List?)?.cast(), + boolList: (result[16] as List?)?.cast(), + enumList: (result[17] as List?)?.cast(), + objectList: (result[18] as List?)?.cast(), + listList: (result[19] as List?)?.cast?>(), + mapList: (result[20] as List?)?.cast?>(), + map: result[21] as Map?, + stringMap: + (result[22] as Map?)?.cast(), + intMap: (result[23] as Map?)?.cast(), + enumMap: (result[24] as Map?)?.cast(), + objectMap: + (result[25] as Map?)?.cast(), + listMap: + (result[26] as Map?)?.cast?>(), + mapMap: (result[27] as Map?) + ?.cast?>(), ); } } @@ -420,6 +573,10 @@ class AllClassesWrapper { required this.allNullableTypes, this.allNullableTypesWithoutRecursion, this.allTypes, + required this.classList, + this.nullableClassList, + required this.classMap, + this.nullableClassMap, }); AllNullableTypes allNullableTypes; @@ -428,11 +585,23 @@ class AllClassesWrapper { AllTypes? allTypes; + List classList; + + List? nullableClassList; + + Map classMap; + + Map? nullableClassMap; + Object encode() { return [ allNullableTypes, allNullableTypesWithoutRecursion, allTypes, + classList, + nullableClassList, + classMap, + nullableClassMap, ]; } @@ -443,6 +612,12 @@ class AllClassesWrapper { allNullableTypesWithoutRecursion: result[1] as AllNullableTypesWithoutRecursion?, allTypes: result[2] as AllTypes?, + classList: (result[3] as List?)!.cast(), + nullableClassList: (result[4] as List?) + ?.cast(), + classMap: (result[5] as Map?)!.cast(), + nullableClassMap: (result[6] as Map?) + ?.cast(), ); } } @@ -473,27 +648,33 @@ class _PigeonCodec extends StandardMessageCodec { const _PigeonCodec(); @override void writeValue(WriteBuffer buffer, Object? value) { - if (value is AnEnum) { + if (value is int) { + buffer.putUint8(4); + buffer.putInt64(value); + } else if (value is AnEnum) { buffer.putUint8(129); writeValue(buffer, value.index); } else if (value is AnotherEnum) { buffer.putUint8(130); writeValue(buffer, value.index); - } else if (value is AllTypes) { + } else if (value is UnusedClass) { buffer.putUint8(131); writeValue(buffer, value.encode()); - } else if (value is AllNullableTypes) { + } else if (value is AllTypes) { buffer.putUint8(132); writeValue(buffer, value.encode()); - } else if (value is AllNullableTypesWithoutRecursion) { + } else if (value is AllNullableTypes) { buffer.putUint8(133); writeValue(buffer, value.encode()); - } else if (value is AllClassesWrapper) { + } else if (value is AllNullableTypesWithoutRecursion) { buffer.putUint8(134); writeValue(buffer, value.encode()); - } else if (value is TestMessage) { + } else if (value is AllClassesWrapper) { buffer.putUint8(135); writeValue(buffer, value.encode()); + } else if (value is TestMessage) { + buffer.putUint8(136); + writeValue(buffer, value.encode()); } else { super.writeValue(buffer, value); } @@ -509,14 +690,16 @@ class _PigeonCodec extends StandardMessageCodec { final int? value = readValue(buffer) as int?; return value == null ? null : AnotherEnum.values[value]; case 131: - return AllTypes.decode(readValue(buffer)!); + return UnusedClass.decode(readValue(buffer)!); case 132: - return AllNullableTypes.decode(readValue(buffer)!); + return AllTypes.decode(readValue(buffer)!); case 133: - return AllNullableTypesWithoutRecursion.decode(readValue(buffer)!); + return AllNullableTypes.decode(readValue(buffer)!); case 134: - return AllClassesWrapper.decode(readValue(buffer)!); + return AllNullableTypesWithoutRecursion.decode(readValue(buffer)!); case 135: + return AllClassesWrapper.decode(readValue(buffer)!); + case 136: return TestMessage.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -882,10 +1065,10 @@ class HostIntegrationCoreApi { } } - /// Returns the passed map, to test serialization and deserialization. - Future> echoMap(Map aMap) async { + /// Returns the passed list, to test serialization and deserialization. + Future> echoEnumList(List enumList) async { final String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoMap$pigeonVar_messageChannelSuffix'; + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoEnumList$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, @@ -893,7 +1076,7 @@ class HostIntegrationCoreApi { binaryMessenger: pigeonVar_binaryMessenger, ); final List? pigeonVar_replyList = - await pigeonVar_channel.send([aMap]) as List?; + await pigeonVar_channel.send([enumList]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -908,15 +1091,15 @@ class HostIntegrationCoreApi { message: 'Host platform returned null value for non-null return value.', ); } else { - return (pigeonVar_replyList[0] as Map?)! - .cast(); + return (pigeonVar_replyList[0] as List?)!.cast(); } } - /// Returns the passed map to test nested class serialization and deserialization. - Future echoClassWrapper(AllClassesWrapper wrapper) async { + /// Returns the passed list, to test serialization and deserialization. + Future> echoClassList( + List classList) async { final String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoClassWrapper$pigeonVar_messageChannelSuffix'; + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoClassList$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, @@ -924,7 +1107,7 @@ class HostIntegrationCoreApi { binaryMessenger: pigeonVar_binaryMessenger, ); final List? pigeonVar_replyList = - await pigeonVar_channel.send([wrapper]) as List?; + await pigeonVar_channel.send([classList]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -939,14 +1122,15 @@ class HostIntegrationCoreApi { message: 'Host platform returned null value for non-null return value.', ); } else { - return (pigeonVar_replyList[0] as AllClassesWrapper?)!; + return (pigeonVar_replyList[0] as List?)! + .cast(); } } - /// Returns the passed enum to test serialization and deserialization. - Future echoEnum(AnEnum anEnum) async { + /// Returns the passed list, to test serialization and deserialization. + Future> echoNonNullEnumList(List enumList) async { final String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoEnum$pigeonVar_messageChannelSuffix'; + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNonNullEnumList$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, @@ -954,7 +1138,7 @@ class HostIntegrationCoreApi { binaryMessenger: pigeonVar_binaryMessenger, ); final List? pigeonVar_replyList = - await pigeonVar_channel.send([anEnum]) as List?; + await pigeonVar_channel.send([enumList]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -969,14 +1153,15 @@ class HostIntegrationCoreApi { message: 'Host platform returned null value for non-null return value.', ); } else { - return (pigeonVar_replyList[0] as AnEnum?)!; + return (pigeonVar_replyList[0] as List?)!.cast(); } } - /// Returns the passed enum to test serialization and deserialization. - Future echoAnotherEnum(AnotherEnum anotherEnum) async { + /// Returns the passed list, to test serialization and deserialization. + Future> echoNonNullClassList( + List classList) async { final String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAnotherEnum$pigeonVar_messageChannelSuffix'; + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNonNullClassList$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, @@ -984,7 +1169,7 @@ class HostIntegrationCoreApi { binaryMessenger: pigeonVar_binaryMessenger, ); final List? pigeonVar_replyList = - await pigeonVar_channel.send([anotherEnum]) as List?; + await pigeonVar_channel.send([classList]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -999,14 +1184,15 @@ class HostIntegrationCoreApi { message: 'Host platform returned null value for non-null return value.', ); } else { - return (pigeonVar_replyList[0] as AnotherEnum?)!; + return (pigeonVar_replyList[0] as List?)! + .cast(); } } - /// Returns the default string. - Future echoNamedDefaultString({String aString = 'default'}) async { + /// Returns the passed map, to test serialization and deserialization. + Future> echoMap(Map map) async { final String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNamedDefaultString$pigeonVar_messageChannelSuffix'; + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoMap$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, @@ -1014,7 +1200,7 @@ class HostIntegrationCoreApi { binaryMessenger: pigeonVar_binaryMessenger, ); final List? pigeonVar_replyList = - await pigeonVar_channel.send([aString]) as List?; + await pigeonVar_channel.send([map]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -1029,14 +1215,16 @@ class HostIntegrationCoreApi { message: 'Host platform returned null value for non-null return value.', ); } else { - return (pigeonVar_replyList[0] as String?)!; + return (pigeonVar_replyList[0] as Map?)! + .cast(); } } - /// Returns passed in double. - Future echoOptionalDefaultDouble([double aDouble = 3.14]) async { + /// Returns the passed map, to test serialization and deserialization. + Future> echoStringMap( + Map stringMap) async { final String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoOptionalDefaultDouble$pigeonVar_messageChannelSuffix'; + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoStringMap$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, @@ -1044,7 +1232,7 @@ class HostIntegrationCoreApi { binaryMessenger: pigeonVar_binaryMessenger, ); final List? pigeonVar_replyList = - await pigeonVar_channel.send([aDouble]) as List?; + await pigeonVar_channel.send([stringMap]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -1059,14 +1247,15 @@ class HostIntegrationCoreApi { message: 'Host platform returned null value for non-null return value.', ); } else { - return (pigeonVar_replyList[0] as double?)!; + return (pigeonVar_replyList[0] as Map?)! + .cast(); } } - /// Returns passed in int. - Future echoRequiredInt({required int anInt}) async { + /// Returns the passed map, to test serialization and deserialization. + Future> echoIntMap(Map intMap) async { final String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoRequiredInt$pigeonVar_messageChannelSuffix'; + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoIntMap$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, @@ -1074,7 +1263,7 @@ class HostIntegrationCoreApi { binaryMessenger: pigeonVar_binaryMessenger, ); final List? pigeonVar_replyList = - await pigeonVar_channel.send([anInt]) as List?; + await pigeonVar_channel.send([intMap]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -1089,15 +1278,16 @@ class HostIntegrationCoreApi { message: 'Host platform returned null value for non-null return value.', ); } else { - return (pigeonVar_replyList[0] as int?)!; + return (pigeonVar_replyList[0] as Map?)! + .cast(); } } - /// Returns the passed object, to test serialization and deserialization. - Future echoAllNullableTypes( - AllNullableTypes? everything) async { + /// Returns the passed map, to test serialization and deserialization. + Future> echoEnumMap( + Map enumMap) async { final String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllNullableTypes$pigeonVar_messageChannelSuffix'; + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoEnumMap$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, @@ -1105,7 +1295,7 @@ class HostIntegrationCoreApi { binaryMessenger: pigeonVar_binaryMessenger, ); final List? pigeonVar_replyList = - await pigeonVar_channel.send([everything]) as List?; + await pigeonVar_channel.send([enumMap]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -1114,17 +1304,22 @@ class HostIntegrationCoreApi { message: pigeonVar_replyList[1] as String?, details: pigeonVar_replyList[2], ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); } else { - return (pigeonVar_replyList[0] as AllNullableTypes?); + return (pigeonVar_replyList[0] as Map?)! + .cast(); } } - /// Returns the passed object, to test serialization and deserialization. - Future - echoAllNullableTypesWithoutRecursion( - AllNullableTypesWithoutRecursion? everything) async { + /// Returns the passed map, to test serialization and deserialization. + Future> echoClassMap( + Map classMap) async { final String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllNullableTypesWithoutRecursion$pigeonVar_messageChannelSuffix'; + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoClassMap$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, @@ -1132,7 +1327,7 @@ class HostIntegrationCoreApi { binaryMessenger: pigeonVar_binaryMessenger, ); final List? pigeonVar_replyList = - await pigeonVar_channel.send([everything]) as List?; + await pigeonVar_channel.send([classMap]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -1141,16 +1336,22 @@ class HostIntegrationCoreApi { message: pigeonVar_replyList[1] as String?, details: pigeonVar_replyList[2], ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); } else { - return (pigeonVar_replyList[0] as AllNullableTypesWithoutRecursion?); + return (pigeonVar_replyList[0] as Map?)! + .cast(); } } - /// Returns the inner `aString` value from the wrapped object, to test - /// sending of nested objects. - Future extractNestedNullableString(AllClassesWrapper wrapper) async { + /// Returns the passed map, to test serialization and deserialization. + Future> echoNonNullStringMap( + Map stringMap) async { final String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.extractNestedNullableString$pigeonVar_messageChannelSuffix'; + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNonNullStringMap$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, @@ -1158,7 +1359,7 @@ class HostIntegrationCoreApi { binaryMessenger: pigeonVar_binaryMessenger, ); final List? pigeonVar_replyList = - await pigeonVar_channel.send([wrapper]) as List?; + await pigeonVar_channel.send([stringMap]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -1167,25 +1368,29 @@ class HostIntegrationCoreApi { message: pigeonVar_replyList[1] as String?, details: pigeonVar_replyList[2], ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); } else { - return (pigeonVar_replyList[0] as String?); + return (pigeonVar_replyList[0] as Map?)! + .cast(); } } - /// Returns the inner `aString` value from the wrapped object, to test - /// sending of nested objects. - Future createNestedNullableString( - String? nullableString) async { + /// Returns the passed map, to test serialization and deserialization. + Future> echoNonNullIntMap(Map intMap) async { final String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.createNestedNullableString$pigeonVar_messageChannelSuffix'; + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNonNullIntMap$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final List? pigeonVar_replyList = await pigeonVar_channel - .send([nullableString]) as List?; + final List? pigeonVar_replyList = + await pigeonVar_channel.send([intMap]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -1200,24 +1405,24 @@ class HostIntegrationCoreApi { message: 'Host platform returned null value for non-null return value.', ); } else { - return (pigeonVar_replyList[0] as AllClassesWrapper?)!; + return (pigeonVar_replyList[0] as Map?)! + .cast(); } } - /// Returns passed in arguments of multiple types. - Future sendMultipleNullableTypes( - bool? aNullableBool, int? aNullableInt, String? aNullableString) async { + /// Returns the passed map, to test serialization and deserialization. + Future> echoNonNullEnumMap( + Map enumMap) async { final String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.sendMultipleNullableTypes$pigeonVar_messageChannelSuffix'; + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNonNullEnumMap$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final List? pigeonVar_replyList = await pigeonVar_channel - .send([aNullableBool, aNullableInt, aNullableString]) - as List?; + final List? pigeonVar_replyList = + await pigeonVar_channel.send([enumMap]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -1232,25 +1437,24 @@ class HostIntegrationCoreApi { message: 'Host platform returned null value for non-null return value.', ); } else { - return (pigeonVar_replyList[0] as AllNullableTypes?)!; + return (pigeonVar_replyList[0] as Map?)! + .cast(); } } - /// Returns passed in arguments of multiple types. - Future - sendMultipleNullableTypesWithoutRecursion(bool? aNullableBool, - int? aNullableInt, String? aNullableString) async { + /// Returns the passed map, to test serialization and deserialization. + Future> echoNonNullClassMap( + Map classMap) async { final String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion$pigeonVar_messageChannelSuffix'; + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNonNullClassMap$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final List? pigeonVar_replyList = await pigeonVar_channel - .send([aNullableBool, aNullableInt, aNullableString]) - as List?; + final List? pigeonVar_replyList = + await pigeonVar_channel.send([classMap]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -1265,14 +1469,15 @@ class HostIntegrationCoreApi { message: 'Host platform returned null value for non-null return value.', ); } else { - return (pigeonVar_replyList[0] as AllNullableTypesWithoutRecursion?)!; + return (pigeonVar_replyList[0] as Map?)! + .cast(); } } - /// Returns passed in int. - Future echoNullableInt(int? aNullableInt) async { + /// Returns the passed class to test nested class serialization and deserialization. + Future echoClassWrapper(AllClassesWrapper wrapper) async { final String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableInt$pigeonVar_messageChannelSuffix'; + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoClassWrapper$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, @@ -1280,7 +1485,7 @@ class HostIntegrationCoreApi { binaryMessenger: pigeonVar_binaryMessenger, ); final List? pigeonVar_replyList = - await pigeonVar_channel.send([aNullableInt]) as List?; + await pigeonVar_channel.send([wrapper]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -1289,23 +1494,28 @@ class HostIntegrationCoreApi { message: pigeonVar_replyList[1] as String?, details: pigeonVar_replyList[2], ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); } else { - return (pigeonVar_replyList[0] as int?); + return (pigeonVar_replyList[0] as AllClassesWrapper?)!; } } - /// Returns passed in double. - Future echoNullableDouble(double? aNullableDouble) async { + /// Returns the passed enum to test serialization and deserialization. + Future echoEnum(AnEnum anEnum) async { final String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableDouble$pigeonVar_messageChannelSuffix'; + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoEnum$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final List? pigeonVar_replyList = await pigeonVar_channel - .send([aNullableDouble]) as List?; + final List? pigeonVar_replyList = + await pigeonVar_channel.send([anEnum]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -1314,23 +1524,28 @@ class HostIntegrationCoreApi { message: pigeonVar_replyList[1] as String?, details: pigeonVar_replyList[2], ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); } else { - return (pigeonVar_replyList[0] as double?); + return (pigeonVar_replyList[0] as AnEnum?)!; } } - /// Returns the passed in boolean. - Future echoNullableBool(bool? aNullableBool) async { + /// Returns the passed enum to test serialization and deserialization. + Future echoAnotherEnum(AnotherEnum anotherEnum) async { final String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableBool$pigeonVar_messageChannelSuffix'; + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAnotherEnum$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final List? pigeonVar_replyList = await pigeonVar_channel - .send([aNullableBool]) as List?; + final List? pigeonVar_replyList = + await pigeonVar_channel.send([anotherEnum]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -1339,23 +1554,28 @@ class HostIntegrationCoreApi { message: pigeonVar_replyList[1] as String?, details: pigeonVar_replyList[2], ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); } else { - return (pigeonVar_replyList[0] as bool?); + return (pigeonVar_replyList[0] as AnotherEnum?)!; } } - /// Returns the passed in string. - Future echoNullableString(String? aNullableString) async { + /// Returns the default string. + Future echoNamedDefaultString({String aString = 'default'}) async { final String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableString$pigeonVar_messageChannelSuffix'; + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNamedDefaultString$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final List? pigeonVar_replyList = await pigeonVar_channel - .send([aNullableString]) as List?; + final List? pigeonVar_replyList = + await pigeonVar_channel.send([aString]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -1364,24 +1584,28 @@ class HostIntegrationCoreApi { message: pigeonVar_replyList[1] as String?, details: pigeonVar_replyList[2], ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); } else { - return (pigeonVar_replyList[0] as String?); + return (pigeonVar_replyList[0] as String?)!; } } - /// Returns the passed in Uint8List. - Future echoNullableUint8List( - Uint8List? aNullableUint8List) async { + /// Returns passed in double. + Future echoOptionalDefaultDouble([double aDouble = 3.14]) async { final String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableUint8List$pigeonVar_messageChannelSuffix'; + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoOptionalDefaultDouble$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final List? pigeonVar_replyList = await pigeonVar_channel - .send([aNullableUint8List]) as List?; + final List? pigeonVar_replyList = + await pigeonVar_channel.send([aDouble]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -1390,23 +1614,28 @@ class HostIntegrationCoreApi { message: pigeonVar_replyList[1] as String?, details: pigeonVar_replyList[2], ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); } else { - return (pigeonVar_replyList[0] as Uint8List?); + return (pigeonVar_replyList[0] as double?)!; } } - /// Returns the passed in generic Object. - Future echoNullableObject(Object? aNullableObject) async { + /// Returns passed in int. + Future echoRequiredInt({required int anInt}) async { final String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableObject$pigeonVar_messageChannelSuffix'; + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoRequiredInt$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final List? pigeonVar_replyList = await pigeonVar_channel - .send([aNullableObject]) as List?; + final List? pigeonVar_replyList = + await pigeonVar_channel.send([anInt]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -1415,23 +1644,29 @@ class HostIntegrationCoreApi { message: pigeonVar_replyList[1] as String?, details: pigeonVar_replyList[2], ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); } else { - return pigeonVar_replyList[0]; + return (pigeonVar_replyList[0] as int?)!; } } - /// Returns the passed list, to test serialization and deserialization. - Future?> echoNullableList(List? aNullableList) async { + /// Returns the passed object, to test serialization and deserialization. + Future echoAllNullableTypes( + AllNullableTypes? everything) async { final String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableList$pigeonVar_messageChannelSuffix'; + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllNullableTypes$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final List? pigeonVar_replyList = await pigeonVar_channel - .send([aNullableList]) as List?; + final List? pigeonVar_replyList = + await pigeonVar_channel.send([everything]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -1441,15 +1676,16 @@ class HostIntegrationCoreApi { details: pigeonVar_replyList[2], ); } else { - return (pigeonVar_replyList[0] as List?)?.cast(); + return (pigeonVar_replyList[0] as AllNullableTypes?); } } - /// Returns the passed map, to test serialization and deserialization. - Future?> echoNullableMap( - Map? aNullableMap) async { + /// Returns the passed object, to test serialization and deserialization. + Future + echoAllNullableTypesWithoutRecursion( + AllNullableTypesWithoutRecursion? everything) async { final String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableMap$pigeonVar_messageChannelSuffix'; + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllNullableTypesWithoutRecursion$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, @@ -1457,7 +1693,7 @@ class HostIntegrationCoreApi { binaryMessenger: pigeonVar_binaryMessenger, ); final List? pigeonVar_replyList = - await pigeonVar_channel.send([aNullableMap]) as List?; + await pigeonVar_channel.send([everything]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -1467,14 +1703,15 @@ class HostIntegrationCoreApi { details: pigeonVar_replyList[2], ); } else { - return (pigeonVar_replyList[0] as Map?) - ?.cast(); + return (pigeonVar_replyList[0] as AllNullableTypesWithoutRecursion?); } } - Future echoNullableEnum(AnEnum? anEnum) async { + /// Returns the inner `aString` value from the wrapped object, to test + /// sending of nested objects. + Future extractNestedNullableString(AllClassesWrapper wrapper) async { final String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableEnum$pigeonVar_messageChannelSuffix'; + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.extractNestedNullableString$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, @@ -1482,7 +1719,7 @@ class HostIntegrationCoreApi { binaryMessenger: pigeonVar_binaryMessenger, ); final List? pigeonVar_replyList = - await pigeonVar_channel.send([anEnum]) as List?; + await pigeonVar_channel.send([wrapper]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -1492,21 +1729,24 @@ class HostIntegrationCoreApi { details: pigeonVar_replyList[2], ); } else { - return (pigeonVar_replyList[0] as AnEnum?); + return (pigeonVar_replyList[0] as String?); } } - Future echoAnotherNullableEnum(AnotherEnum? anotherEnum) async { + /// Returns the inner `aString` value from the wrapped object, to test + /// sending of nested objects. + Future createNestedNullableString( + String? nullableString) async { final String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAnotherNullableEnum$pigeonVar_messageChannelSuffix'; + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.createNestedNullableString$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final List? pigeonVar_replyList = - await pigeonVar_channel.send([anotherEnum]) as List?; + final List? pigeonVar_replyList = await pigeonVar_channel + .send([nullableString]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -1515,23 +1755,30 @@ class HostIntegrationCoreApi { message: pigeonVar_replyList[1] as String?, details: pigeonVar_replyList[2], ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); } else { - return (pigeonVar_replyList[0] as AnotherEnum?); + return (pigeonVar_replyList[0] as AllClassesWrapper?)!; } } - /// Returns passed in int. - Future echoOptionalNullableInt([int? aNullableInt]) async { + /// Returns passed in arguments of multiple types. + Future sendMultipleNullableTypes( + bool? aNullableBool, int? aNullableInt, String? aNullableString) async { final String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoOptionalNullableInt$pigeonVar_messageChannelSuffix'; + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.sendMultipleNullableTypes$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final List? pigeonVar_replyList = - await pigeonVar_channel.send([aNullableInt]) as List?; + final List? pigeonVar_replyList = await pigeonVar_channel + .send([aNullableBool, aNullableInt, aNullableString]) + as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -1540,15 +1787,22 @@ class HostIntegrationCoreApi { message: pigeonVar_replyList[1] as String?, details: pigeonVar_replyList[2], ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); } else { - return (pigeonVar_replyList[0] as int?); + return (pigeonVar_replyList[0] as AllNullableTypes?)!; } } - /// Returns the passed in string. - Future echoNamedNullableString({String? aNullableString}) async { + /// Returns passed in arguments of multiple types. + Future + sendMultipleNullableTypesWithoutRecursion(bool? aNullableBool, + int? aNullableInt, String? aNullableString) async { final String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNamedNullableString$pigeonVar_messageChannelSuffix'; + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, @@ -1556,7 +1810,8 @@ class HostIntegrationCoreApi { binaryMessenger: pigeonVar_binaryMessenger, ); final List? pigeonVar_replyList = await pigeonVar_channel - .send([aNullableString]) as List?; + .send([aNullableBool, aNullableInt, aNullableString]) + as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -1565,16 +1820,20 @@ class HostIntegrationCoreApi { message: pigeonVar_replyList[1] as String?, details: pigeonVar_replyList[2], ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); } else { - return (pigeonVar_replyList[0] as String?); + return (pigeonVar_replyList[0] as AllNullableTypesWithoutRecursion?)!; } } - /// A no-op function taking no arguments and returning no value, to sanity - /// test basic asynchronous calling. - Future noopAsync() async { + /// Returns passed in int. + Future echoNullableInt(int? aNullableInt) async { final String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.noopAsync$pigeonVar_messageChannelSuffix'; + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableInt$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, @@ -1582,7 +1841,7 @@ class HostIntegrationCoreApi { binaryMessenger: pigeonVar_binaryMessenger, ); final List? pigeonVar_replyList = - await pigeonVar_channel.send(null) as List?; + await pigeonVar_channel.send([aNullableInt]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -1592,22 +1851,22 @@ class HostIntegrationCoreApi { details: pigeonVar_replyList[2], ); } else { - return; + return (pigeonVar_replyList[0] as int?); } } - /// Returns passed in int asynchronously. - Future echoAsyncInt(int anInt) async { + /// Returns passed in double. + Future echoNullableDouble(double? aNullableDouble) async { final String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncInt$pigeonVar_messageChannelSuffix'; + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableDouble$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final List? pigeonVar_replyList = - await pigeonVar_channel.send([anInt]) as List?; + final List? pigeonVar_replyList = await pigeonVar_channel + .send([aNullableDouble]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -1616,28 +1875,23 @@ class HostIntegrationCoreApi { message: pigeonVar_replyList[1] as String?, details: pigeonVar_replyList[2], ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); } else { - return (pigeonVar_replyList[0] as int?)!; + return (pigeonVar_replyList[0] as double?); } } - /// Returns passed in double asynchronously. - Future echoAsyncDouble(double aDouble) async { + /// Returns the passed in boolean. + Future echoNullableBool(bool? aNullableBool) async { final String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncDouble$pigeonVar_messageChannelSuffix'; + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableBool$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final List? pigeonVar_replyList = - await pigeonVar_channel.send([aDouble]) as List?; + final List? pigeonVar_replyList = await pigeonVar_channel + .send([aNullableBool]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -1646,28 +1900,23 @@ class HostIntegrationCoreApi { message: pigeonVar_replyList[1] as String?, details: pigeonVar_replyList[2], ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); } else { - return (pigeonVar_replyList[0] as double?)!; + return (pigeonVar_replyList[0] as bool?); } } - /// Returns the passed in boolean asynchronously. - Future echoAsyncBool(bool aBool) async { + /// Returns the passed in string. + Future echoNullableString(String? aNullableString) async { final String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncBool$pigeonVar_messageChannelSuffix'; + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableString$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final List? pigeonVar_replyList = - await pigeonVar_channel.send([aBool]) as List?; + final List? pigeonVar_replyList = await pigeonVar_channel + .send([aNullableString]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -1676,28 +1925,24 @@ class HostIntegrationCoreApi { message: pigeonVar_replyList[1] as String?, details: pigeonVar_replyList[2], ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); } else { - return (pigeonVar_replyList[0] as bool?)!; + return (pigeonVar_replyList[0] as String?); } } - /// Returns the passed string asynchronously. - Future echoAsyncString(String aString) async { + /// Returns the passed in Uint8List. + Future echoNullableUint8List( + Uint8List? aNullableUint8List) async { final String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncString$pigeonVar_messageChannelSuffix'; + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableUint8List$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final List? pigeonVar_replyList = - await pigeonVar_channel.send([aString]) as List?; + final List? pigeonVar_replyList = await pigeonVar_channel + .send([aNullableUint8List]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -1706,28 +1951,23 @@ class HostIntegrationCoreApi { message: pigeonVar_replyList[1] as String?, details: pigeonVar_replyList[2], ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); } else { - return (pigeonVar_replyList[0] as String?)!; + return (pigeonVar_replyList[0] as Uint8List?); } } - /// Returns the passed in Uint8List asynchronously. - Future echoAsyncUint8List(Uint8List aUint8List) async { + /// Returns the passed in generic Object. + Future echoNullableObject(Object? aNullableObject) async { final String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncUint8List$pigeonVar_messageChannelSuffix'; + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableObject$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final List? pigeonVar_replyList = - await pigeonVar_channel.send([aUint8List]) as List?; + final List? pigeonVar_replyList = await pigeonVar_channel + .send([aNullableObject]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -1736,28 +1976,23 @@ class HostIntegrationCoreApi { message: pigeonVar_replyList[1] as String?, details: pigeonVar_replyList[2], ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); } else { - return (pigeonVar_replyList[0] as Uint8List?)!; + return pigeonVar_replyList[0]; } } - /// Returns the passed in generic Object asynchronously. - Future echoAsyncObject(Object anObject) async { + /// Returns the passed list, to test serialization and deserialization. + Future?> echoNullableList(List? aNullableList) async { final String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncObject$pigeonVar_messageChannelSuffix'; + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableList$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final List? pigeonVar_replyList = - await pigeonVar_channel.send([anObject]) as List?; + final List? pigeonVar_replyList = await pigeonVar_channel + .send([aNullableList]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -1766,20 +2001,15 @@ class HostIntegrationCoreApi { message: pigeonVar_replyList[1] as String?, details: pigeonVar_replyList[2], ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); } else { - return pigeonVar_replyList[0]!; + return (pigeonVar_replyList[0] as List?)?.cast(); } } - /// Returns the passed list, to test asynchronous serialization and deserialization. - Future> echoAsyncList(List list) async { + /// Returns the passed list, to test serialization and deserialization. + Future?> echoNullableEnumList(List? enumList) async { final String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncList$pigeonVar_messageChannelSuffix'; + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableEnumList$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, @@ -1787,7 +2017,7 @@ class HostIntegrationCoreApi { binaryMessenger: pigeonVar_binaryMessenger, ); final List? pigeonVar_replyList = - await pigeonVar_channel.send([list]) as List?; + await pigeonVar_channel.send([enumList]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -1796,20 +2026,16 @@ class HostIntegrationCoreApi { message: pigeonVar_replyList[1] as String?, details: pigeonVar_replyList[2], ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); } else { - return (pigeonVar_replyList[0] as List?)!.cast(); + return (pigeonVar_replyList[0] as List?)?.cast(); } } - /// Returns the passed map, to test asynchronous serialization and deserialization. - Future> echoAsyncMap(Map aMap) async { + /// Returns the passed list, to test serialization and deserialization. + Future?> echoNullableClassList( + List? classList) async { final String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncMap$pigeonVar_messageChannelSuffix'; + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableClassList$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, @@ -1817,7 +2043,7 @@ class HostIntegrationCoreApi { binaryMessenger: pigeonVar_binaryMessenger, ); final List? pigeonVar_replyList = - await pigeonVar_channel.send([aMap]) as List?; + await pigeonVar_channel.send([classList]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -1826,21 +2052,17 @@ class HostIntegrationCoreApi { message: pigeonVar_replyList[1] as String?, details: pigeonVar_replyList[2], ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); } else { - return (pigeonVar_replyList[0] as Map?)! - .cast(); + return (pigeonVar_replyList[0] as List?) + ?.cast(); } } - /// Returns the passed enum, to test asynchronous serialization and deserialization. - Future echoAsyncEnum(AnEnum anEnum) async { + /// Returns the passed list, to test serialization and deserialization. + Future?> echoNullableNonNullEnumList( + List? enumList) async { final String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncEnum$pigeonVar_messageChannelSuffix'; + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableNonNullEnumList$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, @@ -1848,7 +2070,7 @@ class HostIntegrationCoreApi { binaryMessenger: pigeonVar_binaryMessenger, ); final List? pigeonVar_replyList = - await pigeonVar_channel.send([anEnum]) as List?; + await pigeonVar_channel.send([enumList]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -1857,20 +2079,16 @@ class HostIntegrationCoreApi { message: pigeonVar_replyList[1] as String?, details: pigeonVar_replyList[2], ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); } else { - return (pigeonVar_replyList[0] as AnEnum?)!; + return (pigeonVar_replyList[0] as List?)?.cast(); } } - /// Returns the passed enum, to test asynchronous serialization and deserialization. - Future echoAnotherAsyncEnum(AnotherEnum anotherEnum) async { + /// Returns the passed list, to test serialization and deserialization. + Future?> echoNullableNonNullClassList( + List? classList) async { final String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAnotherAsyncEnum$pigeonVar_messageChannelSuffix'; + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableNonNullClassList$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, @@ -1878,7 +2096,7 @@ class HostIntegrationCoreApi { binaryMessenger: pigeonVar_binaryMessenger, ); final List? pigeonVar_replyList = - await pigeonVar_channel.send([anotherEnum]) as List?; + await pigeonVar_channel.send([classList]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -1887,20 +2105,17 @@ class HostIntegrationCoreApi { message: pigeonVar_replyList[1] as String?, details: pigeonVar_replyList[2], ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); } else { - return (pigeonVar_replyList[0] as AnotherEnum?)!; + return (pigeonVar_replyList[0] as List?) + ?.cast(); } } - /// Responds with an error from an async function returning a value. - Future throwAsyncError() async { + /// Returns the passed map, to test serialization and deserialization. + Future?> echoNullableMap( + Map? map) async { final String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncError$pigeonVar_messageChannelSuffix'; + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableMap$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, @@ -1908,7 +2123,7 @@ class HostIntegrationCoreApi { binaryMessenger: pigeonVar_binaryMessenger, ); final List? pigeonVar_replyList = - await pigeonVar_channel.send(null) as List?; + await pigeonVar_channel.send([map]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -1918,14 +2133,16 @@ class HostIntegrationCoreApi { details: pigeonVar_replyList[2], ); } else { - return pigeonVar_replyList[0]; + return (pigeonVar_replyList[0] as Map?) + ?.cast(); } } - /// Responds with an error from an async void function. - Future throwAsyncErrorFromVoid() async { + /// Returns the passed map, to test serialization and deserialization. + Future?> echoNullableStringMap( + Map? stringMap) async { final String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncErrorFromVoid$pigeonVar_messageChannelSuffix'; + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableStringMap$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, @@ -1933,7 +2150,7 @@ class HostIntegrationCoreApi { binaryMessenger: pigeonVar_binaryMessenger, ); final List? pigeonVar_replyList = - await pigeonVar_channel.send(null) as List?; + await pigeonVar_channel.send([stringMap]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -1943,14 +2160,15 @@ class HostIntegrationCoreApi { details: pigeonVar_replyList[2], ); } else { - return; + return (pigeonVar_replyList[0] as Map?) + ?.cast(); } } - /// Responds with a Flutter error from an async function returning a value. - Future throwAsyncFlutterError() async { + /// Returns the passed map, to test serialization and deserialization. + Future?> echoNullableIntMap(Map? intMap) async { final String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncFlutterError$pigeonVar_messageChannelSuffix'; + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableIntMap$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, @@ -1958,7 +2176,7 @@ class HostIntegrationCoreApi { binaryMessenger: pigeonVar_binaryMessenger, ); final List? pigeonVar_replyList = - await pigeonVar_channel.send(null) as List?; + await pigeonVar_channel.send([intMap]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -1968,14 +2186,16 @@ class HostIntegrationCoreApi { details: pigeonVar_replyList[2], ); } else { - return pigeonVar_replyList[0]; + return (pigeonVar_replyList[0] as Map?) + ?.cast(); } } - /// Returns the passed object, to test async serialization and deserialization. - Future echoAsyncAllTypes(AllTypes everything) async { + /// Returns the passed map, to test serialization and deserialization. + Future?> echoNullableEnumMap( + Map? enumMap) async { final String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncAllTypes$pigeonVar_messageChannelSuffix'; + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableEnumMap$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, @@ -1983,7 +2203,7 @@ class HostIntegrationCoreApi { binaryMessenger: pigeonVar_binaryMessenger, ); final List? pigeonVar_replyList = - await pigeonVar_channel.send([everything]) as List?; + await pigeonVar_channel.send([enumMap]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -1992,21 +2212,17 @@ class HostIntegrationCoreApi { message: pigeonVar_replyList[1] as String?, details: pigeonVar_replyList[2], ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); } else { - return (pigeonVar_replyList[0] as AllTypes?)!; + return (pigeonVar_replyList[0] as Map?) + ?.cast(); } } - /// Returns the passed object, to test serialization and deserialization. - Future echoAsyncNullableAllNullableTypes( - AllNullableTypes? everything) async { + /// Returns the passed map, to test serialization and deserialization. + Future?> echoNullableClassMap( + Map? classMap) async { final String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypes$pigeonVar_messageChannelSuffix'; + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableClassMap$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, @@ -2014,7 +2230,7 @@ class HostIntegrationCoreApi { binaryMessenger: pigeonVar_binaryMessenger, ); final List? pigeonVar_replyList = - await pigeonVar_channel.send([everything]) as List?; + await pigeonVar_channel.send([classMap]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -2024,16 +2240,16 @@ class HostIntegrationCoreApi { details: pigeonVar_replyList[2], ); } else { - return (pigeonVar_replyList[0] as AllNullableTypes?); + return (pigeonVar_replyList[0] as Map?) + ?.cast(); } } - /// Returns the passed object, to test serialization and deserialization. - Future - echoAsyncNullableAllNullableTypesWithoutRecursion( - AllNullableTypesWithoutRecursion? everything) async { + /// Returns the passed map, to test serialization and deserialization. + Future?> echoNullableNonNullStringMap( + Map? stringMap) async { final String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypesWithoutRecursion$pigeonVar_messageChannelSuffix'; + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableNonNullStringMap$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, @@ -2041,7 +2257,7 @@ class HostIntegrationCoreApi { binaryMessenger: pigeonVar_binaryMessenger, ); final List? pigeonVar_replyList = - await pigeonVar_channel.send([everything]) as List?; + await pigeonVar_channel.send([stringMap]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -2051,14 +2267,16 @@ class HostIntegrationCoreApi { details: pigeonVar_replyList[2], ); } else { - return (pigeonVar_replyList[0] as AllNullableTypesWithoutRecursion?); + return (pigeonVar_replyList[0] as Map?) + ?.cast(); } } - /// Returns passed in int asynchronously. - Future echoAsyncNullableInt(int? anInt) async { + /// Returns the passed map, to test serialization and deserialization. + Future?> echoNullableNonNullIntMap( + Map? intMap) async { final String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableInt$pigeonVar_messageChannelSuffix'; + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableNonNullIntMap$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, @@ -2066,7 +2284,7 @@ class HostIntegrationCoreApi { binaryMessenger: pigeonVar_binaryMessenger, ); final List? pigeonVar_replyList = - await pigeonVar_channel.send([anInt]) as List?; + await pigeonVar_channel.send([intMap]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -2076,14 +2294,16 @@ class HostIntegrationCoreApi { details: pigeonVar_replyList[2], ); } else { - return (pigeonVar_replyList[0] as int?); + return (pigeonVar_replyList[0] as Map?) + ?.cast(); } } - /// Returns passed in double asynchronously. - Future echoAsyncNullableDouble(double? aDouble) async { + /// Returns the passed map, to test serialization and deserialization. + Future?> echoNullableNonNullEnumMap( + Map? enumMap) async { final String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableDouble$pigeonVar_messageChannelSuffix'; + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableNonNullEnumMap$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, @@ -2091,7 +2311,7 @@ class HostIntegrationCoreApi { binaryMessenger: pigeonVar_binaryMessenger, ); final List? pigeonVar_replyList = - await pigeonVar_channel.send([aDouble]) as List?; + await pigeonVar_channel.send([enumMap]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -2101,14 +2321,16 @@ class HostIntegrationCoreApi { details: pigeonVar_replyList[2], ); } else { - return (pigeonVar_replyList[0] as double?); + return (pigeonVar_replyList[0] as Map?) + ?.cast(); } } - /// Returns the passed in boolean asynchronously. - Future echoAsyncNullableBool(bool? aBool) async { + /// Returns the passed map, to test serialization and deserialization. + Future?> echoNullableNonNullClassMap( + Map? classMap) async { final String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableBool$pigeonVar_messageChannelSuffix'; + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableNonNullClassMap$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, @@ -2116,7 +2338,7 @@ class HostIntegrationCoreApi { binaryMessenger: pigeonVar_binaryMessenger, ); final List? pigeonVar_replyList = - await pigeonVar_channel.send([aBool]) as List?; + await pigeonVar_channel.send([classMap]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -2126,14 +2348,14 @@ class HostIntegrationCoreApi { details: pigeonVar_replyList[2], ); } else { - return (pigeonVar_replyList[0] as bool?); + return (pigeonVar_replyList[0] as Map?) + ?.cast(); } } - /// Returns the passed string asynchronously. - Future echoAsyncNullableString(String? aString) async { + Future echoNullableEnum(AnEnum? anEnum) async { final String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableString$pigeonVar_messageChannelSuffix'; + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableEnum$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, @@ -2141,7 +2363,7 @@ class HostIntegrationCoreApi { binaryMessenger: pigeonVar_binaryMessenger, ); final List? pigeonVar_replyList = - await pigeonVar_channel.send([aString]) as List?; + await pigeonVar_channel.send([anEnum]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -2151,14 +2373,13 @@ class HostIntegrationCoreApi { details: pigeonVar_replyList[2], ); } else { - return (pigeonVar_replyList[0] as String?); + return (pigeonVar_replyList[0] as AnEnum?); } } - /// Returns the passed in Uint8List asynchronously. - Future echoAsyncNullableUint8List(Uint8List? aUint8List) async { + Future echoAnotherNullableEnum(AnotherEnum? anotherEnum) async { final String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableUint8List$pigeonVar_messageChannelSuffix'; + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAnotherNullableEnum$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, @@ -2166,7 +2387,7 @@ class HostIntegrationCoreApi { binaryMessenger: pigeonVar_binaryMessenger, ); final List? pigeonVar_replyList = - await pigeonVar_channel.send([aUint8List]) as List?; + await pigeonVar_channel.send([anotherEnum]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -2176,14 +2397,14 @@ class HostIntegrationCoreApi { details: pigeonVar_replyList[2], ); } else { - return (pigeonVar_replyList[0] as Uint8List?); + return (pigeonVar_replyList[0] as AnotherEnum?); } } - /// Returns the passed in generic Object asynchronously. - Future echoAsyncNullableObject(Object? anObject) async { + /// Returns passed in int. + Future echoOptionalNullableInt([int? aNullableInt]) async { final String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableObject$pigeonVar_messageChannelSuffix'; + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoOptionalNullableInt$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, @@ -2191,7 +2412,7 @@ class HostIntegrationCoreApi { binaryMessenger: pigeonVar_binaryMessenger, ); final List? pigeonVar_replyList = - await pigeonVar_channel.send([anObject]) as List?; + await pigeonVar_channel.send([aNullableInt]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -2201,22 +2422,22 @@ class HostIntegrationCoreApi { details: pigeonVar_replyList[2], ); } else { - return pigeonVar_replyList[0]; + return (pigeonVar_replyList[0] as int?); } } - /// Returns the passed list, to test asynchronous serialization and deserialization. - Future?> echoAsyncNullableList(List? list) async { + /// Returns the passed in string. + Future echoNamedNullableString({String? aNullableString}) async { final String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableList$pigeonVar_messageChannelSuffix'; + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNamedNullableString$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final List? pigeonVar_replyList = - await pigeonVar_channel.send([list]) as List?; + final List? pigeonVar_replyList = await pigeonVar_channel + .send([aNullableString]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -2226,15 +2447,15 @@ class HostIntegrationCoreApi { details: pigeonVar_replyList[2], ); } else { - return (pigeonVar_replyList[0] as List?)?.cast(); + return (pigeonVar_replyList[0] as String?); } } - /// Returns the passed map, to test asynchronous serialization and deserialization. - Future?> echoAsyncNullableMap( - Map? aMap) async { + /// A no-op function taking no arguments and returning no value, to sanity + /// test basic asynchronous calling. + Future noopAsync() async { final String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableMap$pigeonVar_messageChannelSuffix'; + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.noopAsync$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, @@ -2242,7 +2463,7 @@ class HostIntegrationCoreApi { binaryMessenger: pigeonVar_binaryMessenger, ); final List? pigeonVar_replyList = - await pigeonVar_channel.send([aMap]) as List?; + await pigeonVar_channel.send(null) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -2252,15 +2473,14 @@ class HostIntegrationCoreApi { details: pigeonVar_replyList[2], ); } else { - return (pigeonVar_replyList[0] as Map?) - ?.cast(); + return; } } - /// Returns the passed enum, to test asynchronous serialization and deserialization. - Future echoAsyncNullableEnum(AnEnum? anEnum) async { + /// Returns passed in int asynchronously. + Future echoAsyncInt(int anInt) async { final String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableEnum$pigeonVar_messageChannelSuffix'; + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncInt$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, @@ -2268,7 +2488,7 @@ class HostIntegrationCoreApi { binaryMessenger: pigeonVar_binaryMessenger, ); final List? pigeonVar_replyList = - await pigeonVar_channel.send([anEnum]) as List?; + await pigeonVar_channel.send([anInt]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -2277,16 +2497,20 @@ class HostIntegrationCoreApi { message: pigeonVar_replyList[1] as String?, details: pigeonVar_replyList[2], ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); } else { - return (pigeonVar_replyList[0] as AnEnum?); + return (pigeonVar_replyList[0] as int?)!; } } - /// Returns the passed enum, to test asynchronous serialization and deserialization. - Future echoAnotherAsyncNullableEnum( - AnotherEnum? anotherEnum) async { + /// Returns passed in double asynchronously. + Future echoAsyncDouble(double aDouble) async { final String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAnotherAsyncNullableEnum$pigeonVar_messageChannelSuffix'; + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncDouble$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, @@ -2294,7 +2518,7 @@ class HostIntegrationCoreApi { binaryMessenger: pigeonVar_binaryMessenger, ); final List? pigeonVar_replyList = - await pigeonVar_channel.send([anotherEnum]) as List?; + await pigeonVar_channel.send([aDouble]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -2303,14 +2527,20 @@ class HostIntegrationCoreApi { message: pigeonVar_replyList[1] as String?, details: pigeonVar_replyList[2], ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); } else { - return (pigeonVar_replyList[0] as AnotherEnum?); + return (pigeonVar_replyList[0] as double?)!; } } - Future callFlutterNoop() async { + /// Returns the passed in boolean asynchronously. + Future echoAsyncBool(bool aBool) async { final String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterNoop$pigeonVar_messageChannelSuffix'; + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncBool$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, @@ -2318,7 +2548,7 @@ class HostIntegrationCoreApi { binaryMessenger: pigeonVar_binaryMessenger, ); final List? pigeonVar_replyList = - await pigeonVar_channel.send(null) as List?; + await pigeonVar_channel.send([aBool]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -2327,14 +2557,20 @@ class HostIntegrationCoreApi { message: pigeonVar_replyList[1] as String?, details: pigeonVar_replyList[2], ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); } else { - return; + return (pigeonVar_replyList[0] as bool?)!; } } - Future callFlutterThrowError() async { + /// Returns the passed string asynchronously. + Future echoAsyncString(String aString) async { final String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterThrowError$pigeonVar_messageChannelSuffix'; + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncString$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, @@ -2342,7 +2578,7 @@ class HostIntegrationCoreApi { binaryMessenger: pigeonVar_binaryMessenger, ); final List? pigeonVar_replyList = - await pigeonVar_channel.send(null) as List?; + await pigeonVar_channel.send([aString]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -2351,14 +2587,20 @@ class HostIntegrationCoreApi { message: pigeonVar_replyList[1] as String?, details: pigeonVar_replyList[2], ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); } else { - return pigeonVar_replyList[0]; + return (pigeonVar_replyList[0] as String?)!; } } - Future callFlutterThrowErrorFromVoid() async { + /// Returns the passed in Uint8List asynchronously. + Future echoAsyncUint8List(Uint8List aUint8List) async { final String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterThrowErrorFromVoid$pigeonVar_messageChannelSuffix'; + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncUint8List$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, @@ -2366,7 +2608,7 @@ class HostIntegrationCoreApi { binaryMessenger: pigeonVar_binaryMessenger, ); final List? pigeonVar_replyList = - await pigeonVar_channel.send(null) as List?; + await pigeonVar_channel.send([aUint8List]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -2375,14 +2617,20 @@ class HostIntegrationCoreApi { message: pigeonVar_replyList[1] as String?, details: pigeonVar_replyList[2], ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); } else { - return; + return (pigeonVar_replyList[0] as Uint8List?)!; } } - Future callFlutterEchoAllTypes(AllTypes everything) async { + /// Returns the passed in generic Object asynchronously. + Future echoAsyncObject(Object anObject) async { final String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllTypes$pigeonVar_messageChannelSuffix'; + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncObject$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, @@ -2390,7 +2638,7 @@ class HostIntegrationCoreApi { binaryMessenger: pigeonVar_binaryMessenger, ); final List? pigeonVar_replyList = - await pigeonVar_channel.send([everything]) as List?; + await pigeonVar_channel.send([anObject]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -2405,14 +2653,14 @@ class HostIntegrationCoreApi { message: 'Host platform returned null value for non-null return value.', ); } else { - return (pigeonVar_replyList[0] as AllTypes?)!; + return pigeonVar_replyList[0]!; } } - Future callFlutterEchoAllNullableTypes( - AllNullableTypes? everything) async { + /// Returns the passed list, to test asynchronous serialization and deserialization. + Future> echoAsyncList(List list) async { final String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllNullableTypes$pigeonVar_messageChannelSuffix'; + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncList$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, @@ -2420,7 +2668,7 @@ class HostIntegrationCoreApi { binaryMessenger: pigeonVar_binaryMessenger, ); final List? pigeonVar_replyList = - await pigeonVar_channel.send([everything]) as List?; + await pigeonVar_channel.send([list]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -2429,24 +2677,28 @@ class HostIntegrationCoreApi { message: pigeonVar_replyList[1] as String?, details: pigeonVar_replyList[2], ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); } else { - return (pigeonVar_replyList[0] as AllNullableTypes?); + return (pigeonVar_replyList[0] as List?)!.cast(); } } - Future callFlutterSendMultipleNullableTypes( - bool? aNullableBool, int? aNullableInt, String? aNullableString) async { + /// Returns the passed list, to test asynchronous serialization and deserialization. + Future> echoAsyncEnumList(List enumList) async { final String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypes$pigeonVar_messageChannelSuffix'; + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncEnumList$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final List? pigeonVar_replyList = await pigeonVar_channel - .send([aNullableBool, aNullableInt, aNullableString]) - as List?; + final List? pigeonVar_replyList = + await pigeonVar_channel.send([enumList]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -2461,15 +2713,15 @@ class HostIntegrationCoreApi { message: 'Host platform returned null value for non-null return value.', ); } else { - return (pigeonVar_replyList[0] as AllNullableTypes?)!; + return (pigeonVar_replyList[0] as List?)!.cast(); } } - Future - callFlutterEchoAllNullableTypesWithoutRecursion( - AllNullableTypesWithoutRecursion? everything) async { + /// Returns the passed list, to test asynchronous serialization and deserialization. + Future> echoAsyncClassList( + List classList) async { final String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllNullableTypesWithoutRecursion$pigeonVar_messageChannelSuffix'; + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncClassList$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, @@ -2477,7 +2729,7 @@ class HostIntegrationCoreApi { binaryMessenger: pigeonVar_binaryMessenger, ); final List? pigeonVar_replyList = - await pigeonVar_channel.send([everything]) as List?; + await pigeonVar_channel.send([classList]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -2486,25 +2738,29 @@ class HostIntegrationCoreApi { message: pigeonVar_replyList[1] as String?, details: pigeonVar_replyList[2], ); - } else { - return (pigeonVar_replyList[0] as AllNullableTypesWithoutRecursion?); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } else { + return (pigeonVar_replyList[0] as List?)! + .cast(); } } - Future - callFlutterSendMultipleNullableTypesWithoutRecursion(bool? aNullableBool, - int? aNullableInt, String? aNullableString) async { + /// Returns the passed map, to test asynchronous serialization and deserialization. + Future> echoAsyncMap(Map map) async { final String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypesWithoutRecursion$pigeonVar_messageChannelSuffix'; + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncMap$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, pigeonChannelCodec, binaryMessenger: pigeonVar_binaryMessenger, ); - final List? pigeonVar_replyList = await pigeonVar_channel - .send([aNullableBool, aNullableInt, aNullableString]) - as List?; + final List? pigeonVar_replyList = + await pigeonVar_channel.send([map]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -2519,13 +2775,16 @@ class HostIntegrationCoreApi { message: 'Host platform returned null value for non-null return value.', ); } else { - return (pigeonVar_replyList[0] as AllNullableTypesWithoutRecursion?)!; + return (pigeonVar_replyList[0] as Map?)! + .cast(); } } - Future callFlutterEchoBool(bool aBool) async { + /// Returns the passed map, to test asynchronous serialization and deserialization. + Future> echoAsyncStringMap( + Map stringMap) async { final String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoBool$pigeonVar_messageChannelSuffix'; + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncStringMap$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, @@ -2533,7 +2792,7 @@ class HostIntegrationCoreApi { binaryMessenger: pigeonVar_binaryMessenger, ); final List? pigeonVar_replyList = - await pigeonVar_channel.send([aBool]) as List?; + await pigeonVar_channel.send([stringMap]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -2548,13 +2807,15 @@ class HostIntegrationCoreApi { message: 'Host platform returned null value for non-null return value.', ); } else { - return (pigeonVar_replyList[0] as bool?)!; + return (pigeonVar_replyList[0] as Map?)! + .cast(); } } - Future callFlutterEchoInt(int anInt) async { + /// Returns the passed map, to test asynchronous serialization and deserialization. + Future> echoAsyncIntMap(Map intMap) async { final String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoInt$pigeonVar_messageChannelSuffix'; + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncIntMap$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, @@ -2562,7 +2823,7 @@ class HostIntegrationCoreApi { binaryMessenger: pigeonVar_binaryMessenger, ); final List? pigeonVar_replyList = - await pigeonVar_channel.send([anInt]) as List?; + await pigeonVar_channel.send([intMap]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -2577,13 +2838,16 @@ class HostIntegrationCoreApi { message: 'Host platform returned null value for non-null return value.', ); } else { - return (pigeonVar_replyList[0] as int?)!; + return (pigeonVar_replyList[0] as Map?)! + .cast(); } } - Future callFlutterEchoDouble(double aDouble) async { + /// Returns the passed map, to test asynchronous serialization and deserialization. + Future> echoAsyncEnumMap( + Map enumMap) async { final String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoDouble$pigeonVar_messageChannelSuffix'; + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncEnumMap$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, @@ -2591,7 +2855,7 @@ class HostIntegrationCoreApi { binaryMessenger: pigeonVar_binaryMessenger, ); final List? pigeonVar_replyList = - await pigeonVar_channel.send([aDouble]) as List?; + await pigeonVar_channel.send([enumMap]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -2606,13 +2870,16 @@ class HostIntegrationCoreApi { message: 'Host platform returned null value for non-null return value.', ); } else { - return (pigeonVar_replyList[0] as double?)!; + return (pigeonVar_replyList[0] as Map?)! + .cast(); } } - Future callFlutterEchoString(String aString) async { + /// Returns the passed map, to test asynchronous serialization and deserialization. + Future> echoAsyncClassMap( + Map classMap) async { final String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoString$pigeonVar_messageChannelSuffix'; + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncClassMap$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, @@ -2620,7 +2887,7 @@ class HostIntegrationCoreApi { binaryMessenger: pigeonVar_binaryMessenger, ); final List? pigeonVar_replyList = - await pigeonVar_channel.send([aString]) as List?; + await pigeonVar_channel.send([classMap]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -2635,13 +2902,15 @@ class HostIntegrationCoreApi { message: 'Host platform returned null value for non-null return value.', ); } else { - return (pigeonVar_replyList[0] as String?)!; + return (pigeonVar_replyList[0] as Map?)! + .cast(); } } - Future callFlutterEchoUint8List(Uint8List list) async { + /// Returns the passed enum, to test asynchronous serialization and deserialization. + Future echoAsyncEnum(AnEnum anEnum) async { final String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoUint8List$pigeonVar_messageChannelSuffix'; + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncEnum$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, @@ -2649,7 +2918,7 @@ class HostIntegrationCoreApi { binaryMessenger: pigeonVar_binaryMessenger, ); final List? pigeonVar_replyList = - await pigeonVar_channel.send([list]) as List?; + await pigeonVar_channel.send([anEnum]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -2664,13 +2933,14 @@ class HostIntegrationCoreApi { message: 'Host platform returned null value for non-null return value.', ); } else { - return (pigeonVar_replyList[0] as Uint8List?)!; + return (pigeonVar_replyList[0] as AnEnum?)!; } } - Future> callFlutterEchoList(List list) async { + /// Returns the passed enum, to test asynchronous serialization and deserialization. + Future echoAnotherAsyncEnum(AnotherEnum anotherEnum) async { final String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoList$pigeonVar_messageChannelSuffix'; + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAnotherAsyncEnum$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, @@ -2678,7 +2948,7 @@ class HostIntegrationCoreApi { binaryMessenger: pigeonVar_binaryMessenger, ); final List? pigeonVar_replyList = - await pigeonVar_channel.send([list]) as List?; + await pigeonVar_channel.send([anotherEnum]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -2693,14 +2963,14 @@ class HostIntegrationCoreApi { message: 'Host platform returned null value for non-null return value.', ); } else { - return (pigeonVar_replyList[0] as List?)!.cast(); + return (pigeonVar_replyList[0] as AnotherEnum?)!; } } - Future> callFlutterEchoMap( - Map aMap) async { + /// Responds with an error from an async function returning a value. + Future throwAsyncError() async { final String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoMap$pigeonVar_messageChannelSuffix'; + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncError$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, @@ -2708,7 +2978,7 @@ class HostIntegrationCoreApi { binaryMessenger: pigeonVar_binaryMessenger, ); final List? pigeonVar_replyList = - await pigeonVar_channel.send([aMap]) as List?; + await pigeonVar_channel.send(null) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -2717,20 +2987,15 @@ class HostIntegrationCoreApi { message: pigeonVar_replyList[1] as String?, details: pigeonVar_replyList[2], ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); } else { - return (pigeonVar_replyList[0] as Map?)! - .cast(); + return pigeonVar_replyList[0]; } } - Future callFlutterEchoEnum(AnEnum anEnum) async { + /// Responds with an error from an async void function. + Future throwAsyncErrorFromVoid() async { final String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoEnum$pigeonVar_messageChannelSuffix'; + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncErrorFromVoid$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, @@ -2738,7 +3003,7 @@ class HostIntegrationCoreApi { binaryMessenger: pigeonVar_binaryMessenger, ); final List? pigeonVar_replyList = - await pigeonVar_channel.send([anEnum]) as List?; + await pigeonVar_channel.send(null) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -2747,20 +3012,40 @@ class HostIntegrationCoreApi { message: pigeonVar_replyList[1] as String?, details: pigeonVar_replyList[2], ); - } else if (pigeonVar_replyList[0] == null) { + } else { + return; + } + } + + /// Responds with a Flutter error from an async function returning a value. + Future throwAsyncFlutterError() async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncFlutterError$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { - return (pigeonVar_replyList[0] as AnEnum?)!; + return pigeonVar_replyList[0]; } } - Future callFlutterEchoAnotherEnum( - AnotherEnum anotherEnum) async { + /// Returns the passed object, to test async serialization and deserialization. + Future echoAsyncAllTypes(AllTypes everything) async { final String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAnotherEnum$pigeonVar_messageChannelSuffix'; + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncAllTypes$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, @@ -2768,7 +3053,7 @@ class HostIntegrationCoreApi { binaryMessenger: pigeonVar_binaryMessenger, ); final List? pigeonVar_replyList = - await pigeonVar_channel.send([anotherEnum]) as List?; + await pigeonVar_channel.send([everything]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -2783,13 +3068,15 @@ class HostIntegrationCoreApi { message: 'Host platform returned null value for non-null return value.', ); } else { - return (pigeonVar_replyList[0] as AnotherEnum?)!; + return (pigeonVar_replyList[0] as AllTypes?)!; } } - Future callFlutterEchoNullableBool(bool? aBool) async { + /// Returns the passed object, to test serialization and deserialization. + Future echoAsyncNullableAllNullableTypes( + AllNullableTypes? everything) async { final String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableBool$pigeonVar_messageChannelSuffix'; + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypes$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, @@ -2797,7 +3084,7 @@ class HostIntegrationCoreApi { binaryMessenger: pigeonVar_binaryMessenger, ); final List? pigeonVar_replyList = - await pigeonVar_channel.send([aBool]) as List?; + await pigeonVar_channel.send([everything]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -2807,13 +3094,41 @@ class HostIntegrationCoreApi { details: pigeonVar_replyList[2], ); } else { - return (pigeonVar_replyList[0] as bool?); + return (pigeonVar_replyList[0] as AllNullableTypes?); } } - Future callFlutterEchoNullableInt(int? anInt) async { + /// Returns the passed object, to test serialization and deserialization. + Future + echoAsyncNullableAllNullableTypesWithoutRecursion( + AllNullableTypesWithoutRecursion? everything) async { final String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableInt$pigeonVar_messageChannelSuffix'; + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypesWithoutRecursion$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([everything]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return (pigeonVar_replyList[0] as AllNullableTypesWithoutRecursion?); + } + } + + /// Returns passed in int asynchronously. + Future echoAsyncNullableInt(int? anInt) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableInt$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, @@ -2835,9 +3150,10 @@ class HostIntegrationCoreApi { } } - Future callFlutterEchoNullableDouble(double? aDouble) async { + /// Returns passed in double asynchronously. + Future echoAsyncNullableDouble(double? aDouble) async { final String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableDouble$pigeonVar_messageChannelSuffix'; + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableDouble$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, @@ -2859,9 +3175,35 @@ class HostIntegrationCoreApi { } } - Future callFlutterEchoNullableString(String? aString) async { + /// Returns the passed in boolean asynchronously. + Future echoAsyncNullableBool(bool? aBool) async { final String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableString$pigeonVar_messageChannelSuffix'; + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableBool$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([aBool]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return (pigeonVar_replyList[0] as bool?); + } + } + + /// Returns the passed string asynchronously. + Future echoAsyncNullableString(String? aString) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableString$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, @@ -2883,9 +3225,10 @@ class HostIntegrationCoreApi { } } - Future callFlutterEchoNullableUint8List(Uint8List? list) async { + /// Returns the passed in Uint8List asynchronously. + Future echoAsyncNullableUint8List(Uint8List? aUint8List) async { final String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableUint8List$pigeonVar_messageChannelSuffix'; + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableUint8List$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, @@ -2893,7 +3236,7 @@ class HostIntegrationCoreApi { binaryMessenger: pigeonVar_binaryMessenger, ); final List? pigeonVar_replyList = - await pigeonVar_channel.send([list]) as List?; + await pigeonVar_channel.send([aUint8List]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -2907,10 +3250,10 @@ class HostIntegrationCoreApi { } } - Future?> callFlutterEchoNullableList( - List? list) async { + /// Returns the passed in generic Object asynchronously. + Future echoAsyncNullableObject(Object? anObject) async { final String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableList$pigeonVar_messageChannelSuffix'; + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableObject$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, @@ -2918,7 +3261,7 @@ class HostIntegrationCoreApi { binaryMessenger: pigeonVar_binaryMessenger, ); final List? pigeonVar_replyList = - await pigeonVar_channel.send([list]) as List?; + await pigeonVar_channel.send([anObject]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -2928,14 +3271,14 @@ class HostIntegrationCoreApi { details: pigeonVar_replyList[2], ); } else { - return (pigeonVar_replyList[0] as List?)?.cast(); + return pigeonVar_replyList[0]; } } - Future?> callFlutterEchoNullableMap( - Map? aMap) async { + /// Returns the passed list, to test asynchronous serialization and deserialization. + Future?> echoAsyncNullableList(List? list) async { final String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableMap$pigeonVar_messageChannelSuffix'; + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableList$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, @@ -2943,7 +3286,7 @@ class HostIntegrationCoreApi { binaryMessenger: pigeonVar_binaryMessenger, ); final List? pigeonVar_replyList = - await pigeonVar_channel.send([aMap]) as List?; + await pigeonVar_channel.send([list]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -2953,14 +3296,15 @@ class HostIntegrationCoreApi { details: pigeonVar_replyList[2], ); } else { - return (pigeonVar_replyList[0] as Map?) - ?.cast(); + return (pigeonVar_replyList[0] as List?)?.cast(); } } - Future callFlutterEchoNullableEnum(AnEnum? anEnum) async { + /// Returns the passed list, to test asynchronous serialization and deserialization. + Future?> echoAsyncNullableEnumList( + List? enumList) async { final String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableEnum$pigeonVar_messageChannelSuffix'; + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableEnumList$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, @@ -2968,7 +3312,7 @@ class HostIntegrationCoreApi { binaryMessenger: pigeonVar_binaryMessenger, ); final List? pigeonVar_replyList = - await pigeonVar_channel.send([anEnum]) as List?; + await pigeonVar_channel.send([enumList]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -2978,14 +3322,15 @@ class HostIntegrationCoreApi { details: pigeonVar_replyList[2], ); } else { - return (pigeonVar_replyList[0] as AnEnum?); + return (pigeonVar_replyList[0] as List?)?.cast(); } } - Future callFlutterEchoAnotherNullableEnum( - AnotherEnum? anotherEnum) async { + /// Returns the passed list, to test asynchronous serialization and deserialization. + Future?> echoAsyncNullableClassList( + List? classList) async { final String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAnotherNullableEnum$pigeonVar_messageChannelSuffix'; + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableClassList$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, @@ -2993,7 +3338,7 @@ class HostIntegrationCoreApi { binaryMessenger: pigeonVar_binaryMessenger, ); final List? pigeonVar_replyList = - await pigeonVar_channel.send([anotherEnum]) as List?; + await pigeonVar_channel.send([classList]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -3003,13 +3348,16 @@ class HostIntegrationCoreApi { details: pigeonVar_replyList[2], ); } else { - return (pigeonVar_replyList[0] as AnotherEnum?); + return (pigeonVar_replyList[0] as List?) + ?.cast(); } } - Future callFlutterSmallApiEchoString(String aString) async { + /// Returns the passed map, to test asynchronous serialization and deserialization. + Future?> echoAsyncNullableMap( + Map? map) async { final String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSmallApiEchoString$pigeonVar_messageChannelSuffix'; + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableMap$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, @@ -3017,7 +3365,7 @@ class HostIntegrationCoreApi { binaryMessenger: pigeonVar_binaryMessenger, ); final List? pigeonVar_replyList = - await pigeonVar_channel.send([aString]) as List?; + await pigeonVar_channel.send([map]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -3026,136 +3374,2359 @@ class HostIntegrationCoreApi { message: pigeonVar_replyList[1] as String?, details: pigeonVar_replyList[2], ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); } else { - return (pigeonVar_replyList[0] as String?)!; + return (pigeonVar_replyList[0] as Map?) + ?.cast(); } } -} - -/// The core interface that the Dart platform_test code implements for host -/// integration tests to call into. -abstract class FlutterIntegrationCoreApi { - static const MessageCodec pigeonChannelCodec = _PigeonCodec(); - /// A no-op function taking no arguments and returning no value, to sanity - /// test basic calling. - void noop(); - - /// Responds with an error from an async function returning a value. - Object? throwError(); - - /// Responds with an error from an async void function. - void throwErrorFromVoid(); + /// Returns the passed map, to test asynchronous serialization and deserialization. + Future?> echoAsyncNullableStringMap( + Map? stringMap) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableStringMap$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([stringMap]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return (pigeonVar_replyList[0] as Map?) + ?.cast(); + } + } - /// Returns the passed object, to test serialization and deserialization. - AllTypes echoAllTypes(AllTypes everything); + /// Returns the passed map, to test asynchronous serialization and deserialization. + Future?> echoAsyncNullableIntMap( + Map? intMap) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableIntMap$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([intMap]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return (pigeonVar_replyList[0] as Map?) + ?.cast(); + } + } - /// Returns the passed object, to test serialization and deserialization. - AllNullableTypes? echoAllNullableTypes(AllNullableTypes? everything); + /// Returns the passed map, to test asynchronous serialization and deserialization. + Future?> echoAsyncNullableEnumMap( + Map? enumMap) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableEnumMap$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([enumMap]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return (pigeonVar_replyList[0] as Map?) + ?.cast(); + } + } - /// Returns passed in arguments of multiple types. - /// - /// Tests multiple-arity FlutterApi handling. - AllNullableTypes sendMultipleNullableTypes( - bool? aNullableBool, int? aNullableInt, String? aNullableString); + /// Returns the passed map, to test asynchronous serialization and deserialization. + Future?> echoAsyncNullableClassMap( + Map? classMap) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableClassMap$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([classMap]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return (pigeonVar_replyList[0] as Map?) + ?.cast(); + } + } - /// Returns the passed object, to test serialization and deserialization. - AllNullableTypesWithoutRecursion? echoAllNullableTypesWithoutRecursion( - AllNullableTypesWithoutRecursion? everything); + /// Returns the passed enum, to test asynchronous serialization and deserialization. + Future echoAsyncNullableEnum(AnEnum? anEnum) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableEnum$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([anEnum]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return (pigeonVar_replyList[0] as AnEnum?); + } + } - /// Returns passed in arguments of multiple types. - /// - /// Tests multiple-arity FlutterApi handling. - AllNullableTypesWithoutRecursion sendMultipleNullableTypesWithoutRecursion( - bool? aNullableBool, int? aNullableInt, String? aNullableString); + /// Returns the passed enum, to test asynchronous serialization and deserialization. + Future echoAnotherAsyncNullableEnum( + AnotherEnum? anotherEnum) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAnotherAsyncNullableEnum$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([anotherEnum]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return (pigeonVar_replyList[0] as AnotherEnum?); + } + } - /// Returns the passed boolean, to test serialization and deserialization. - bool echoBool(bool aBool); + Future callFlutterNoop() async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterNoop$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return; + } + } - /// Returns the passed int, to test serialization and deserialization. - int echoInt(int anInt); + Future callFlutterThrowError() async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterThrowError$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return pigeonVar_replyList[0]; + } + } - /// Returns the passed double, to test serialization and deserialization. - double echoDouble(double aDouble); + Future callFlutterThrowErrorFromVoid() async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterThrowErrorFromVoid$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return; + } + } - /// Returns the passed string, to test serialization and deserialization. - String echoString(String aString); + Future callFlutterEchoAllTypes(AllTypes everything) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllTypes$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([everything]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } else { + return (pigeonVar_replyList[0] as AllTypes?)!; + } + } - /// Returns the passed byte list, to test serialization and deserialization. - Uint8List echoUint8List(Uint8List list); - - /// Returns the passed list, to test serialization and deserialization. - List echoList(List list); - - /// Returns the passed map, to test serialization and deserialization. - Map echoMap(Map aMap); - - /// Returns the passed enum to test serialization and deserialization. - AnEnum echoEnum(AnEnum anEnum); - - /// Returns the passed enum to test serialization and deserialization. - AnotherEnum echoAnotherEnum(AnotherEnum anotherEnum); - - /// Returns the passed boolean, to test serialization and deserialization. - bool? echoNullableBool(bool? aBool); - - /// Returns the passed int, to test serialization and deserialization. - int? echoNullableInt(int? anInt); + Future callFlutterEchoAllNullableTypes( + AllNullableTypes? everything) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllNullableTypes$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([everything]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return (pigeonVar_replyList[0] as AllNullableTypes?); + } + } - /// Returns the passed double, to test serialization and deserialization. - double? echoNullableDouble(double? aDouble); + Future callFlutterSendMultipleNullableTypes( + bool? aNullableBool, int? aNullableInt, String? aNullableString) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypes$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = await pigeonVar_channel + .send([aNullableBool, aNullableInt, aNullableString]) + as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } else { + return (pigeonVar_replyList[0] as AllNullableTypes?)!; + } + } - /// Returns the passed string, to test serialization and deserialization. - String? echoNullableString(String? aString); + Future + callFlutterEchoAllNullableTypesWithoutRecursion( + AllNullableTypesWithoutRecursion? everything) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllNullableTypesWithoutRecursion$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([everything]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return (pigeonVar_replyList[0] as AllNullableTypesWithoutRecursion?); + } + } - /// Returns the passed byte list, to test serialization and deserialization. - Uint8List? echoNullableUint8List(Uint8List? list); + Future + callFlutterSendMultipleNullableTypesWithoutRecursion(bool? aNullableBool, + int? aNullableInt, String? aNullableString) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypesWithoutRecursion$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = await pigeonVar_channel + .send([aNullableBool, aNullableInt, aNullableString]) + as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } else { + return (pigeonVar_replyList[0] as AllNullableTypesWithoutRecursion?)!; + } + } - /// Returns the passed list, to test serialization and deserialization. - List? echoNullableList(List? list); + Future callFlutterEchoBool(bool aBool) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoBool$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([aBool]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } else { + return (pigeonVar_replyList[0] as bool?)!; + } + } - /// Returns the passed map, to test serialization and deserialization. - Map? echoNullableMap(Map? aMap); + Future callFlutterEchoInt(int anInt) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoInt$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([anInt]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } else { + return (pigeonVar_replyList[0] as int?)!; + } + } - /// Returns the passed enum to test serialization and deserialization. - AnEnum? echoNullableEnum(AnEnum? anEnum); + Future callFlutterEchoDouble(double aDouble) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoDouble$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([aDouble]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } else { + return (pigeonVar_replyList[0] as double?)!; + } + } - /// Returns the passed enum to test serialization and deserialization. - AnotherEnum? echoAnotherNullableEnum(AnotherEnum? anotherEnum); + Future callFlutterEchoString(String aString) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoString$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([aString]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } else { + return (pigeonVar_replyList[0] as String?)!; + } + } - /// A no-op function taking no arguments and returning no value, to sanity - /// test basic asynchronous calling. - Future noopAsync(); + Future callFlutterEchoUint8List(Uint8List list) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoUint8List$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([list]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } else { + return (pigeonVar_replyList[0] as Uint8List?)!; + } + } - /// Returns the passed in generic Object asynchronously. - Future echoAsyncString(String aString); + Future> callFlutterEchoList(List list) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoList$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([list]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } else { + return (pigeonVar_replyList[0] as List?)!.cast(); + } + } - static void setUp( - FlutterIntegrationCoreApi? api, { - BinaryMessenger? binaryMessenger, - String messageChannelSuffix = '', - }) { - messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + Future> callFlutterEchoEnumList(List enumList) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoEnumList$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([enumList]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } else { + return (pigeonVar_replyList[0] as List?)!.cast(); + } + } + + Future> callFlutterEchoClassList( + List classList) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoClassList$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([classList]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } else { + return (pigeonVar_replyList[0] as List?)! + .cast(); + } + } + + Future> callFlutterEchoNonNullEnumList( + List enumList) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNonNullEnumList$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([enumList]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } else { + return (pigeonVar_replyList[0] as List?)!.cast(); + } + } + + Future> callFlutterEchoNonNullClassList( + List classList) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNonNullClassList$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([classList]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } else { + return (pigeonVar_replyList[0] as List?)! + .cast(); + } + } + + Future> callFlutterEchoMap( + Map map) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoMap$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([map]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } else { + return (pigeonVar_replyList[0] as Map?)! + .cast(); + } + } + + Future> callFlutterEchoStringMap( + Map stringMap) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoStringMap$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([stringMap]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } else { + return (pigeonVar_replyList[0] as Map?)! + .cast(); + } + } + + Future> callFlutterEchoIntMap(Map intMap) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoIntMap$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([intMap]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } else { + return (pigeonVar_replyList[0] as Map?)! + .cast(); + } + } + + Future> callFlutterEchoEnumMap( + Map enumMap) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoEnumMap$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([enumMap]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } else { + return (pigeonVar_replyList[0] as Map?)! + .cast(); + } + } + + Future> callFlutterEchoClassMap( + Map classMap) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoClassMap$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([classMap]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } else { + return (pigeonVar_replyList[0] as Map?)! + .cast(); + } + } + + Future> callFlutterEchoNonNullStringMap( + Map stringMap) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNonNullStringMap$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([stringMap]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } else { + return (pigeonVar_replyList[0] as Map?)! + .cast(); + } + } + + Future> callFlutterEchoNonNullIntMap( + Map intMap) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNonNullIntMap$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([intMap]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } else { + return (pigeonVar_replyList[0] as Map?)! + .cast(); + } + } + + Future> callFlutterEchoNonNullEnumMap( + Map enumMap) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNonNullEnumMap$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([enumMap]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } else { + return (pigeonVar_replyList[0] as Map?)! + .cast(); + } + } + + Future> callFlutterEchoNonNullClassMap( + Map classMap) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNonNullClassMap$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([classMap]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } else { + return (pigeonVar_replyList[0] as Map?)! + .cast(); + } + } + + Future callFlutterEchoEnum(AnEnum anEnum) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoEnum$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([anEnum]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } else { + return (pigeonVar_replyList[0] as AnEnum?)!; + } + } + + Future callFlutterEchoAnotherEnum( + AnotherEnum anotherEnum) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAnotherEnum$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([anotherEnum]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } else { + return (pigeonVar_replyList[0] as AnotherEnum?)!; + } + } + + Future callFlutterEchoNullableBool(bool? aBool) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableBool$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([aBool]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return (pigeonVar_replyList[0] as bool?); + } + } + + Future callFlutterEchoNullableInt(int? anInt) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableInt$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([anInt]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return (pigeonVar_replyList[0] as int?); + } + } + + Future callFlutterEchoNullableDouble(double? aDouble) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableDouble$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([aDouble]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return (pigeonVar_replyList[0] as double?); + } + } + + Future callFlutterEchoNullableString(String? aString) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableString$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([aString]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return (pigeonVar_replyList[0] as String?); + } + } + + Future callFlutterEchoNullableUint8List(Uint8List? list) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableUint8List$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([list]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return (pigeonVar_replyList[0] as Uint8List?); + } + } + + Future?> callFlutterEchoNullableList( + List? list) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableList$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([list]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return (pigeonVar_replyList[0] as List?)?.cast(); + } + } + + Future?> callFlutterEchoNullableEnumList( + List? enumList) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableEnumList$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([enumList]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return (pigeonVar_replyList[0] as List?)?.cast(); + } + } + + Future?> callFlutterEchoNullableClassList( + List? classList) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableClassList$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([classList]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return (pigeonVar_replyList[0] as List?) + ?.cast(); + } + } + + Future?> callFlutterEchoNullableNonNullEnumList( + List? enumList) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableNonNullEnumList$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([enumList]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return (pigeonVar_replyList[0] as List?)?.cast(); + } + } + + Future?> callFlutterEchoNullableNonNullClassList( + List? classList) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableNonNullClassList$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([classList]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return (pigeonVar_replyList[0] as List?) + ?.cast(); + } + } + + Future?> callFlutterEchoNullableMap( + Map? map) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableMap$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([map]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return (pigeonVar_replyList[0] as Map?) + ?.cast(); + } + } + + Future?> callFlutterEchoNullableStringMap( + Map? stringMap) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableStringMap$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([stringMap]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return (pigeonVar_replyList[0] as Map?) + ?.cast(); + } + } + + Future?> callFlutterEchoNullableIntMap( + Map? intMap) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableIntMap$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([intMap]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return (pigeonVar_replyList[0] as Map?) + ?.cast(); + } + } + + Future?> callFlutterEchoNullableEnumMap( + Map? enumMap) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableEnumMap$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([enumMap]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return (pigeonVar_replyList[0] as Map?) + ?.cast(); + } + } + + Future?> callFlutterEchoNullableClassMap( + Map? classMap) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableClassMap$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([classMap]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return (pigeonVar_replyList[0] as Map?) + ?.cast(); + } + } + + Future?> callFlutterEchoNullableNonNullStringMap( + Map? stringMap) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableNonNullStringMap$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([stringMap]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return (pigeonVar_replyList[0] as Map?) + ?.cast(); + } + } + + Future?> callFlutterEchoNullableNonNullIntMap( + Map? intMap) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableNonNullIntMap$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([intMap]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return (pigeonVar_replyList[0] as Map?) + ?.cast(); + } + } + + Future?> callFlutterEchoNullableNonNullEnumMap( + Map? enumMap) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableNonNullEnumMap$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([enumMap]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return (pigeonVar_replyList[0] as Map?) + ?.cast(); + } + } + + Future?> callFlutterEchoNullableNonNullClassMap( + Map? classMap) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableNonNullClassMap$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([classMap]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return (pigeonVar_replyList[0] as Map?) + ?.cast(); + } + } + + Future callFlutterEchoNullableEnum(AnEnum? anEnum) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableEnum$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([anEnum]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return (pigeonVar_replyList[0] as AnEnum?); + } + } + + Future callFlutterEchoAnotherNullableEnum( + AnotherEnum? anotherEnum) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAnotherNullableEnum$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([anotherEnum]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return (pigeonVar_replyList[0] as AnotherEnum?); + } + } + + Future callFlutterSmallApiEchoString(String aString) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSmallApiEchoString$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([aString]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } else { + return (pigeonVar_replyList[0] as String?)!; + } + } +} + +/// The core interface that the Dart platform_test code implements for host +/// integration tests to call into. +abstract class FlutterIntegrationCoreApi { + static const MessageCodec pigeonChannelCodec = _PigeonCodec(); + + /// A no-op function taking no arguments and returning no value, to sanity + /// test basic calling. + void noop(); + + /// Responds with an error from an async function returning a value. + Object? throwError(); + + /// Responds with an error from an async void function. + void throwErrorFromVoid(); + + /// Returns the passed object, to test serialization and deserialization. + AllTypes echoAllTypes(AllTypes everything); + + /// Returns the passed object, to test serialization and deserialization. + AllNullableTypes? echoAllNullableTypes(AllNullableTypes? everything); + + /// Returns passed in arguments of multiple types. + /// + /// Tests multiple-arity FlutterApi handling. + AllNullableTypes sendMultipleNullableTypes( + bool? aNullableBool, int? aNullableInt, String? aNullableString); + + /// Returns the passed object, to test serialization and deserialization. + AllNullableTypesWithoutRecursion? echoAllNullableTypesWithoutRecursion( + AllNullableTypesWithoutRecursion? everything); + + /// Returns passed in arguments of multiple types. + /// + /// Tests multiple-arity FlutterApi handling. + AllNullableTypesWithoutRecursion sendMultipleNullableTypesWithoutRecursion( + bool? aNullableBool, int? aNullableInt, String? aNullableString); + + /// Returns the passed boolean, to test serialization and deserialization. + bool echoBool(bool aBool); + + /// Returns the passed int, to test serialization and deserialization. + int echoInt(int anInt); + + /// Returns the passed double, to test serialization and deserialization. + double echoDouble(double aDouble); + + /// Returns the passed string, to test serialization and deserialization. + String echoString(String aString); + + /// Returns the passed byte list, to test serialization and deserialization. + Uint8List echoUint8List(Uint8List list); + + /// Returns the passed list, to test serialization and deserialization. + List echoList(List list); + + /// Returns the passed list, to test serialization and deserialization. + List echoEnumList(List enumList); + + /// Returns the passed list, to test serialization and deserialization. + List echoClassList(List classList); + + /// Returns the passed list, to test serialization and deserialization. + List echoNonNullEnumList(List enumList); + + /// Returns the passed list, to test serialization and deserialization. + List echoNonNullClassList(List classList); + + /// Returns the passed map, to test serialization and deserialization. + Map echoMap(Map map); + + /// Returns the passed map, to test serialization and deserialization. + Map echoStringMap(Map stringMap); + + /// Returns the passed map, to test serialization and deserialization. + Map echoIntMap(Map intMap); + + /// Returns the passed map, to test serialization and deserialization. + Map echoEnumMap(Map enumMap); + + /// Returns the passed map, to test serialization and deserialization. + Map echoClassMap( + Map classMap); + + /// Returns the passed map, to test serialization and deserialization. + Map echoNonNullStringMap(Map stringMap); + + /// Returns the passed map, to test serialization and deserialization. + Map echoNonNullIntMap(Map intMap); + + /// Returns the passed map, to test serialization and deserialization. + Map echoNonNullEnumMap(Map enumMap); + + /// Returns the passed map, to test serialization and deserialization. + Map echoNonNullClassMap( + Map classMap); + + /// Returns the passed enum to test serialization and deserialization. + AnEnum echoEnum(AnEnum anEnum); + + /// Returns the passed enum to test serialization and deserialization. + AnotherEnum echoAnotherEnum(AnotherEnum anotherEnum); + + /// Returns the passed boolean, to test serialization and deserialization. + bool? echoNullableBool(bool? aBool); + + /// Returns the passed int, to test serialization and deserialization. + int? echoNullableInt(int? anInt); + + /// Returns the passed double, to test serialization and deserialization. + double? echoNullableDouble(double? aDouble); + + /// Returns the passed string, to test serialization and deserialization. + String? echoNullableString(String? aString); + + /// Returns the passed byte list, to test serialization and deserialization. + Uint8List? echoNullableUint8List(Uint8List? list); + + /// Returns the passed list, to test serialization and deserialization. + List? echoNullableList(List? list); + + /// Returns the passed list, to test serialization and deserialization. + List? echoNullableEnumList(List? enumList); + + /// Returns the passed list, to test serialization and deserialization. + List? echoNullableClassList( + List? classList); + + /// Returns the passed list, to test serialization and deserialization. + List? echoNullableNonNullEnumList(List? enumList); + + /// Returns the passed list, to test serialization and deserialization. + List? echoNullableNonNullClassList( + List? classList); + + /// Returns the passed map, to test serialization and deserialization. + Map? echoNullableMap(Map? map); + + /// Returns the passed map, to test serialization and deserialization. + Map? echoNullableStringMap( + Map? stringMap); + + /// Returns the passed map, to test serialization and deserialization. + Map? echoNullableIntMap(Map? intMap); + + /// Returns the passed map, to test serialization and deserialization. + Map? echoNullableEnumMap(Map? enumMap); + + /// Returns the passed map, to test serialization and deserialization. + Map? echoNullableClassMap( + Map? classMap); + + /// Returns the passed map, to test serialization and deserialization. + Map? echoNullableNonNullStringMap( + Map? stringMap); + + /// Returns the passed map, to test serialization and deserialization. + Map? echoNullableNonNullIntMap(Map? intMap); + + /// Returns the passed map, to test serialization and deserialization. + Map? echoNullableNonNullEnumMap(Map? enumMap); + + /// Returns the passed map, to test serialization and deserialization. + Map? echoNullableNonNullClassMap( + Map? classMap); + + /// Returns the passed enum to test serialization and deserialization. + AnEnum? echoNullableEnum(AnEnum? anEnum); + + /// Returns the passed enum to test serialization and deserialization. + AnotherEnum? echoAnotherNullableEnum(AnotherEnum? anotherEnum); + + /// A no-op function taking no arguments and returning no value, to sanity + /// test basic asynchronous calling. + Future noopAsync(); + + /// Returns the passed in generic Object asynchronously. + Future echoAsyncString(String aString); + + static void setUp( + FlutterIntegrationCoreApi? api, { + BinaryMessenger? binaryMessenger, + String messageChannelSuffix = '', + }) { + messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + { + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noop$messageChannelSuffix', + pigeonChannelCodec, + binaryMessenger: binaryMessenger); + if (api == null) { + pigeonVar_channel.setMessageHandler(null); + } else { + pigeonVar_channel.setMessageHandler((Object? message) async { + try { + api.noop(); + return wrapResponse(empty: true); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } + }); + } + } + { + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwError$messageChannelSuffix', + pigeonChannelCodec, + binaryMessenger: binaryMessenger); + if (api == null) { + pigeonVar_channel.setMessageHandler(null); + } else { + pigeonVar_channel.setMessageHandler((Object? message) async { + try { + final Object? output = api.throwError(); + return wrapResponse(result: output); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } + }); + } + } + { + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwErrorFromVoid$messageChannelSuffix', + pigeonChannelCodec, + binaryMessenger: binaryMessenger); + if (api == null) { + pigeonVar_channel.setMessageHandler(null); + } else { + pigeonVar_channel.setMessageHandler((Object? message) async { + try { + api.throwErrorFromVoid(); + return wrapResponse(empty: true); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } + }); + } + } + { + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllTypes$messageChannelSuffix', + pigeonChannelCodec, + binaryMessenger: binaryMessenger); + if (api == null) { + pigeonVar_channel.setMessageHandler(null); + } else { + pigeonVar_channel.setMessageHandler((Object? message) async { + assert(message != null, + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllTypes was null.'); + final List args = (message as List?)!; + final AllTypes? arg_everything = (args[0] as AllTypes?); + assert(arg_everything != null, + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllTypes was null, expected non-null AllTypes.'); + try { + final AllTypes output = api.echoAllTypes(arg_everything!); + return wrapResponse(result: output); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } + }); + } + } + { + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypes$messageChannelSuffix', + pigeonChannelCodec, + binaryMessenger: binaryMessenger); + if (api == null) { + pigeonVar_channel.setMessageHandler(null); + } else { + pigeonVar_channel.setMessageHandler((Object? message) async { + assert(message != null, + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypes was null.'); + final List args = (message as List?)!; + final AllNullableTypes? arg_everything = + (args[0] as AllNullableTypes?); + try { + final AllNullableTypes? output = + api.echoAllNullableTypes(arg_everything); + return wrapResponse(result: output); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } + }); + } + } + { + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypes$messageChannelSuffix', + pigeonChannelCodec, + binaryMessenger: binaryMessenger); + if (api == null) { + pigeonVar_channel.setMessageHandler(null); + } else { + pigeonVar_channel.setMessageHandler((Object? message) async { + assert(message != null, + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypes was null.'); + final List args = (message as List?)!; + final bool? arg_aNullableBool = (args[0] as bool?); + final int? arg_aNullableInt = (args[1] as int?); + final String? arg_aNullableString = (args[2] as String?); + try { + final AllNullableTypes output = api.sendMultipleNullableTypes( + arg_aNullableBool, arg_aNullableInt, arg_aNullableString); + return wrapResponse(result: output); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } + }); + } + } + { + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypesWithoutRecursion$messageChannelSuffix', + pigeonChannelCodec, + binaryMessenger: binaryMessenger); + if (api == null) { + pigeonVar_channel.setMessageHandler(null); + } else { + pigeonVar_channel.setMessageHandler((Object? message) async { + assert(message != null, + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypesWithoutRecursion was null.'); + final List args = (message as List?)!; + final AllNullableTypesWithoutRecursion? arg_everything = + (args[0] as AllNullableTypesWithoutRecursion?); + try { + final AllNullableTypesWithoutRecursion? output = + api.echoAllNullableTypesWithoutRecursion(arg_everything); + return wrapResponse(result: output); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } + }); + } + } + { + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion$messageChannelSuffix', + pigeonChannelCodec, + binaryMessenger: binaryMessenger); + if (api == null) { + pigeonVar_channel.setMessageHandler(null); + } else { + pigeonVar_channel.setMessageHandler((Object? message) async { + assert(message != null, + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion was null.'); + final List args = (message as List?)!; + final bool? arg_aNullableBool = (args[0] as bool?); + final int? arg_aNullableInt = (args[1] as int?); + final String? arg_aNullableString = (args[2] as String?); + try { + final AllNullableTypesWithoutRecursion output = + api.sendMultipleNullableTypesWithoutRecursion( + arg_aNullableBool, arg_aNullableInt, arg_aNullableString); + return wrapResponse(result: output); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } + }); + } + } + { + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoBool$messageChannelSuffix', + pigeonChannelCodec, + binaryMessenger: binaryMessenger); + if (api == null) { + pigeonVar_channel.setMessageHandler(null); + } else { + pigeonVar_channel.setMessageHandler((Object? message) async { + assert(message != null, + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoBool was null.'); + final List args = (message as List?)!; + final bool? arg_aBool = (args[0] as bool?); + assert(arg_aBool != null, + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoBool was null, expected non-null bool.'); + try { + final bool output = api.echoBool(arg_aBool!); + return wrapResponse(result: output); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } + }); + } + } + { + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoInt$messageChannelSuffix', + pigeonChannelCodec, + binaryMessenger: binaryMessenger); + if (api == null) { + pigeonVar_channel.setMessageHandler(null); + } else { + pigeonVar_channel.setMessageHandler((Object? message) async { + assert(message != null, + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoInt was null.'); + final List args = (message as List?)!; + final int? arg_anInt = (args[0] as int?); + assert(arg_anInt != null, + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoInt was null, expected non-null int.'); + try { + final int output = api.echoInt(arg_anInt!); + return wrapResponse(result: output); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } + }); + } + } + { + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoDouble$messageChannelSuffix', + pigeonChannelCodec, + binaryMessenger: binaryMessenger); + if (api == null) { + pigeonVar_channel.setMessageHandler(null); + } else { + pigeonVar_channel.setMessageHandler((Object? message) async { + assert(message != null, + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoDouble was null.'); + final List args = (message as List?)!; + final double? arg_aDouble = (args[0] as double?); + assert(arg_aDouble != null, + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoDouble was null, expected non-null double.'); + try { + final double output = api.echoDouble(arg_aDouble!); + return wrapResponse(result: output); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } + }); + } + } + { + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoString$messageChannelSuffix', + pigeonChannelCodec, + binaryMessenger: binaryMessenger); + if (api == null) { + pigeonVar_channel.setMessageHandler(null); + } else { + pigeonVar_channel.setMessageHandler((Object? message) async { + assert(message != null, + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoString was null.'); + final List args = (message as List?)!; + final String? arg_aString = (args[0] as String?); + assert(arg_aString != null, + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoString was null, expected non-null String.'); + try { + final String output = api.echoString(arg_aString!); + return wrapResponse(result: output); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } + }); + } + } + { + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoUint8List$messageChannelSuffix', + pigeonChannelCodec, + binaryMessenger: binaryMessenger); + if (api == null) { + pigeonVar_channel.setMessageHandler(null); + } else { + pigeonVar_channel.setMessageHandler((Object? message) async { + assert(message != null, + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoUint8List was null.'); + final List args = (message as List?)!; + final Uint8List? arg_list = (args[0] as Uint8List?); + assert(arg_list != null, + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoUint8List was null, expected non-null Uint8List.'); + try { + final Uint8List output = api.echoUint8List(arg_list!); + return wrapResponse(result: output); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } + }); + } + } + { + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoList$messageChannelSuffix', + pigeonChannelCodec, + binaryMessenger: binaryMessenger); + if (api == null) { + pigeonVar_channel.setMessageHandler(null); + } else { + pigeonVar_channel.setMessageHandler((Object? message) async { + assert(message != null, + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoList was null.'); + final List args = (message as List?)!; + final List? arg_list = + (args[0] as List?)?.cast(); + assert(arg_list != null, + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoList was null, expected non-null List.'); + try { + final List output = api.echoList(arg_list!); + return wrapResponse(result: output); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } + }); + } + } + { + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnumList$messageChannelSuffix', + pigeonChannelCodec, + binaryMessenger: binaryMessenger); + if (api == null) { + pigeonVar_channel.setMessageHandler(null); + } else { + pigeonVar_channel.setMessageHandler((Object? message) async { + assert(message != null, + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnumList was null.'); + final List args = (message as List?)!; + final List? arg_enumList = + (args[0] as List?)?.cast(); + assert(arg_enumList != null, + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnumList was null, expected non-null List.'); + try { + final List output = api.echoEnumList(arg_enumList!); + return wrapResponse(result: output); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } + }); + } + } + { + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoClassList$messageChannelSuffix', + pigeonChannelCodec, + binaryMessenger: binaryMessenger); + if (api == null) { + pigeonVar_channel.setMessageHandler(null); + } else { + pigeonVar_channel.setMessageHandler((Object? message) async { + assert(message != null, + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoClassList was null.'); + final List args = (message as List?)!; + final List? arg_classList = + (args[0] as List?)?.cast(); + assert(arg_classList != null, + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoClassList was null, expected non-null List.'); + try { + final List output = + api.echoClassList(arg_classList!); + return wrapResponse(result: output); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } + }); + } + } + { + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNonNullEnumList$messageChannelSuffix', + pigeonChannelCodec, + binaryMessenger: binaryMessenger); + if (api == null) { + pigeonVar_channel.setMessageHandler(null); + } else { + pigeonVar_channel.setMessageHandler((Object? message) async { + assert(message != null, + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNonNullEnumList was null.'); + final List args = (message as List?)!; + final List? arg_enumList = + (args[0] as List?)?.cast(); + assert(arg_enumList != null, + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNonNullEnumList was null, expected non-null List.'); + try { + final List output = api.echoNonNullEnumList(arg_enumList!); + return wrapResponse(result: output); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } + }); + } + } + { + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNonNullClassList$messageChannelSuffix', + pigeonChannelCodec, + binaryMessenger: binaryMessenger); + if (api == null) { + pigeonVar_channel.setMessageHandler(null); + } else { + pigeonVar_channel.setMessageHandler((Object? message) async { + assert(message != null, + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNonNullClassList was null.'); + final List args = (message as List?)!; + final List? arg_classList = + (args[0] as List?)?.cast(); + assert(arg_classList != null, + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNonNullClassList was null, expected non-null List.'); + try { + final List output = + api.echoNonNullClassList(arg_classList!); + return wrapResponse(result: output); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } + }); + } + } + { + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoMap$messageChannelSuffix', + pigeonChannelCodec, + binaryMessenger: binaryMessenger); + if (api == null) { + pigeonVar_channel.setMessageHandler(null); + } else { + pigeonVar_channel.setMessageHandler((Object? message) async { + assert(message != null, + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoMap was null.'); + final List args = (message as List?)!; + final Map? arg_map = + (args[0] as Map?)?.cast(); + assert(arg_map != null, + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoMap was null, expected non-null Map.'); + try { + final Map output = api.echoMap(arg_map!); + return wrapResponse(result: output); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } + }); + } + } + { + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoStringMap$messageChannelSuffix', + pigeonChannelCodec, + binaryMessenger: binaryMessenger); + if (api == null) { + pigeonVar_channel.setMessageHandler(null); + } else { + pigeonVar_channel.setMessageHandler((Object? message) async { + assert(message != null, + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoStringMap was null.'); + final List args = (message as List?)!; + final Map? arg_stringMap = + (args[0] as Map?)?.cast(); + assert(arg_stringMap != null, + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoStringMap was null, expected non-null Map.'); + try { + final Map output = + api.echoStringMap(arg_stringMap!); + return wrapResponse(result: output); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } + }); + } + } { final BasicMessageChannel< Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noop$messageChannelSuffix', + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoIntMap$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_channel.setMessageHandler((Object? message) async { + assert(message != null, + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoIntMap was null.'); + final List args = (message as List?)!; + final Map? arg_intMap = + (args[0] as Map?)?.cast(); + assert(arg_intMap != null, + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoIntMap was null, expected non-null Map.'); try { - api.noop(); - return wrapResponse(empty: true); + final Map output = api.echoIntMap(arg_intMap!); + return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); } catch (e) { @@ -3169,15 +5740,22 @@ abstract class FlutterIntegrationCoreApi { final BasicMessageChannel< Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwError$messageChannelSuffix', + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnumMap$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_channel.setMessageHandler((Object? message) async { + assert(message != null, + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnumMap was null.'); + final List args = (message as List?)!; + final Map? arg_enumMap = + (args[0] as Map?)?.cast(); + assert(arg_enumMap != null, + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnumMap was null, expected non-null Map.'); try { - final Object? output = api.throwError(); + final Map output = api.echoEnumMap(arg_enumMap!); return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -3192,16 +5770,25 @@ abstract class FlutterIntegrationCoreApi { final BasicMessageChannel< Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwErrorFromVoid$messageChannelSuffix', + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoClassMap$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_channel.setMessageHandler((Object? message) async { + assert(message != null, + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoClassMap was null.'); + final List args = (message as List?)!; + final Map? arg_classMap = + (args[0] as Map?) + ?.cast(); + assert(arg_classMap != null, + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoClassMap was null, expected non-null Map.'); try { - api.throwErrorFromVoid(); - return wrapResponse(empty: true); + final Map output = + api.echoClassMap(arg_classMap!); + return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); } catch (e) { @@ -3215,7 +5802,7 @@ abstract class FlutterIntegrationCoreApi { final BasicMessageChannel< Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllTypes$messageChannelSuffix', + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNonNullStringMap$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { @@ -3223,13 +5810,15 @@ abstract class FlutterIntegrationCoreApi { } else { pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllTypes was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNonNullStringMap was null.'); final List args = (message as List?)!; - final AllTypes? arg_everything = (args[0] as AllTypes?); - assert(arg_everything != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllTypes was null, expected non-null AllTypes.'); + final Map? arg_stringMap = + (args[0] as Map?)?.cast(); + assert(arg_stringMap != null, + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNonNullStringMap was null, expected non-null Map.'); try { - final AllTypes output = api.echoAllTypes(arg_everything!); + final Map output = + api.echoNonNullStringMap(arg_stringMap!); return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -3244,7 +5833,7 @@ abstract class FlutterIntegrationCoreApi { final BasicMessageChannel< Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypes$messageChannelSuffix', + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNonNullIntMap$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { @@ -3252,13 +5841,14 @@ abstract class FlutterIntegrationCoreApi { } else { pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypes was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNonNullIntMap was null.'); final List args = (message as List?)!; - final AllNullableTypes? arg_everything = - (args[0] as AllNullableTypes?); + final Map? arg_intMap = + (args[0] as Map?)?.cast(); + assert(arg_intMap != null, + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNonNullIntMap was null, expected non-null Map.'); try { - final AllNullableTypes? output = - api.echoAllNullableTypes(arg_everything); + final Map output = api.echoNonNullIntMap(arg_intMap!); return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -3273,7 +5863,7 @@ abstract class FlutterIntegrationCoreApi { final BasicMessageChannel< Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypes$messageChannelSuffix', + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNonNullEnumMap$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { @@ -3281,14 +5871,15 @@ abstract class FlutterIntegrationCoreApi { } else { pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypes was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNonNullEnumMap was null.'); final List args = (message as List?)!; - final bool? arg_aNullableBool = (args[0] as bool?); - final int? arg_aNullableInt = (args[1] as int?); - final String? arg_aNullableString = (args[2] as String?); + final Map? arg_enumMap = + (args[0] as Map?)?.cast(); + assert(arg_enumMap != null, + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNonNullEnumMap was null, expected non-null Map.'); try { - final AllNullableTypes output = api.sendMultipleNullableTypes( - arg_aNullableBool, arg_aNullableInt, arg_aNullableString); + final Map output = + api.echoNonNullEnumMap(arg_enumMap!); return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -3303,7 +5894,7 @@ abstract class FlutterIntegrationCoreApi { final BasicMessageChannel< Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypesWithoutRecursion$messageChannelSuffix', + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNonNullClassMap$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { @@ -3311,13 +5902,16 @@ abstract class FlutterIntegrationCoreApi { } else { pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypesWithoutRecursion was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNonNullClassMap was null.'); final List args = (message as List?)!; - final AllNullableTypesWithoutRecursion? arg_everything = - (args[0] as AllNullableTypesWithoutRecursion?); + final Map? arg_classMap = + (args[0] as Map?) + ?.cast(); + assert(arg_classMap != null, + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNonNullClassMap was null, expected non-null Map.'); try { - final AllNullableTypesWithoutRecursion? output = - api.echoAllNullableTypesWithoutRecursion(arg_everything); + final Map output = + api.echoNonNullClassMap(arg_classMap!); return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -3332,7 +5926,7 @@ abstract class FlutterIntegrationCoreApi { final BasicMessageChannel< Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion$messageChannelSuffix', + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnum$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { @@ -3340,15 +5934,13 @@ abstract class FlutterIntegrationCoreApi { } else { pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnum was null.'); final List args = (message as List?)!; - final bool? arg_aNullableBool = (args[0] as bool?); - final int? arg_aNullableInt = (args[1] as int?); - final String? arg_aNullableString = (args[2] as String?); + final AnEnum? arg_anEnum = (args[0] as AnEnum?); + assert(arg_anEnum != null, + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnum was null, expected non-null AnEnum.'); try { - final AllNullableTypesWithoutRecursion output = - api.sendMultipleNullableTypesWithoutRecursion( - arg_aNullableBool, arg_aNullableInt, arg_aNullableString); + final AnEnum output = api.echoEnum(arg_anEnum!); return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -3363,7 +5955,7 @@ abstract class FlutterIntegrationCoreApi { final BasicMessageChannel< Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoBool$messageChannelSuffix', + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAnotherEnum$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { @@ -3371,13 +5963,40 @@ abstract class FlutterIntegrationCoreApi { } else { pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoBool was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAnotherEnum was null.'); + final List args = (message as List?)!; + final AnotherEnum? arg_anotherEnum = (args[0] as AnotherEnum?); + assert(arg_anotherEnum != null, + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAnotherEnum was null, expected non-null AnotherEnum.'); + try { + final AnotherEnum output = api.echoAnotherEnum(arg_anotherEnum!); + return wrapResponse(result: output); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } + }); + } + } + { + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableBool$messageChannelSuffix', + pigeonChannelCodec, + binaryMessenger: binaryMessenger); + if (api == null) { + pigeonVar_channel.setMessageHandler(null); + } else { + pigeonVar_channel.setMessageHandler((Object? message) async { + assert(message != null, + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableBool was null.'); final List args = (message as List?)!; final bool? arg_aBool = (args[0] as bool?); - assert(arg_aBool != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoBool was null, expected non-null bool.'); try { - final bool output = api.echoBool(arg_aBool!); + final bool? output = api.echoNullableBool(arg_aBool); return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -3392,7 +6011,7 @@ abstract class FlutterIntegrationCoreApi { final BasicMessageChannel< Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoInt$messageChannelSuffix', + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableInt$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { @@ -3400,13 +6019,11 @@ abstract class FlutterIntegrationCoreApi { } else { pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoInt was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableInt was null.'); final List args = (message as List?)!; final int? arg_anInt = (args[0] as int?); - assert(arg_anInt != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoInt was null, expected non-null int.'); try { - final int output = api.echoInt(arg_anInt!); + final int? output = api.echoNullableInt(arg_anInt); return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -3421,7 +6038,7 @@ abstract class FlutterIntegrationCoreApi { final BasicMessageChannel< Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoDouble$messageChannelSuffix', + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableDouble$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { @@ -3429,13 +6046,11 @@ abstract class FlutterIntegrationCoreApi { } else { pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoDouble was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableDouble was null.'); final List args = (message as List?)!; final double? arg_aDouble = (args[0] as double?); - assert(arg_aDouble != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoDouble was null, expected non-null double.'); try { - final double output = api.echoDouble(arg_aDouble!); + final double? output = api.echoNullableDouble(arg_aDouble); return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -3450,7 +6065,7 @@ abstract class FlutterIntegrationCoreApi { final BasicMessageChannel< Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoString$messageChannelSuffix', + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableString$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { @@ -3458,13 +6073,11 @@ abstract class FlutterIntegrationCoreApi { } else { pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoString was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableString was null.'); final List args = (message as List?)!; final String? arg_aString = (args[0] as String?); - assert(arg_aString != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoString was null, expected non-null String.'); try { - final String output = api.echoString(arg_aString!); + final String? output = api.echoNullableString(arg_aString); return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -3479,7 +6092,7 @@ abstract class FlutterIntegrationCoreApi { final BasicMessageChannel< Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoUint8List$messageChannelSuffix', + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableUint8List$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { @@ -3487,13 +6100,11 @@ abstract class FlutterIntegrationCoreApi { } else { pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoUint8List was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableUint8List was null.'); final List args = (message as List?)!; final Uint8List? arg_list = (args[0] as Uint8List?); - assert(arg_list != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoUint8List was null, expected non-null Uint8List.'); try { - final Uint8List output = api.echoUint8List(arg_list!); + final Uint8List? output = api.echoNullableUint8List(arg_list); return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -3508,7 +6119,7 @@ abstract class FlutterIntegrationCoreApi { final BasicMessageChannel< Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoList$messageChannelSuffix', + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableList$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { @@ -3516,14 +6127,12 @@ abstract class FlutterIntegrationCoreApi { } else { pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoList was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableList was null.'); final List args = (message as List?)!; final List? arg_list = (args[0] as List?)?.cast(); - assert(arg_list != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoList was null, expected non-null List.'); try { - final List output = api.echoList(arg_list!); + final List? output = api.echoNullableList(arg_list); return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -3538,7 +6147,7 @@ abstract class FlutterIntegrationCoreApi { final BasicMessageChannel< Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoMap$messageChannelSuffix', + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableEnumList$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { @@ -3546,14 +6155,13 @@ abstract class FlutterIntegrationCoreApi { } else { pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoMap was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableEnumList was null.'); final List args = (message as List?)!; - final Map? arg_aMap = - (args[0] as Map?)?.cast(); - assert(arg_aMap != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoMap was null, expected non-null Map.'); + final List? arg_enumList = + (args[0] as List?)?.cast(); try { - final Map output = api.echoMap(arg_aMap!); + final List? output = + api.echoNullableEnumList(arg_enumList); return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -3568,7 +6176,7 @@ abstract class FlutterIntegrationCoreApi { final BasicMessageChannel< Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnum$messageChannelSuffix', + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableClassList$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { @@ -3576,13 +6184,13 @@ abstract class FlutterIntegrationCoreApi { } else { pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnum was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableClassList was null.'); final List args = (message as List?)!; - final AnEnum? arg_anEnum = (args[0] as AnEnum?); - assert(arg_anEnum != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnum was null, expected non-null AnEnum.'); + final List? arg_classList = + (args[0] as List?)?.cast(); try { - final AnEnum output = api.echoEnum(arg_anEnum!); + final List? output = + api.echoNullableClassList(arg_classList); return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -3597,7 +6205,7 @@ abstract class FlutterIntegrationCoreApi { final BasicMessageChannel< Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAnotherEnum$messageChannelSuffix', + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableNonNullEnumList$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { @@ -3605,13 +6213,13 @@ abstract class FlutterIntegrationCoreApi { } else { pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAnotherEnum was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableNonNullEnumList was null.'); final List args = (message as List?)!; - final AnotherEnum? arg_anotherEnum = (args[0] as AnotherEnum?); - assert(arg_anotherEnum != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAnotherEnum was null, expected non-null AnotherEnum.'); + final List? arg_enumList = + (args[0] as List?)?.cast(); try { - final AnotherEnum output = api.echoAnotherEnum(arg_anotherEnum!); + final List? output = + api.echoNullableNonNullEnumList(arg_enumList); return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -3626,7 +6234,7 @@ abstract class FlutterIntegrationCoreApi { final BasicMessageChannel< Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableBool$messageChannelSuffix', + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableNonNullClassList$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { @@ -3634,11 +6242,13 @@ abstract class FlutterIntegrationCoreApi { } else { pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableBool was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableNonNullClassList was null.'); final List args = (message as List?)!; - final bool? arg_aBool = (args[0] as bool?); + final List? arg_classList = + (args[0] as List?)?.cast(); try { - final bool? output = api.echoNullableBool(arg_aBool); + final List? output = + api.echoNullableNonNullClassList(arg_classList); return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -3653,7 +6263,7 @@ abstract class FlutterIntegrationCoreApi { final BasicMessageChannel< Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableInt$messageChannelSuffix', + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableMap$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { @@ -3661,11 +6271,12 @@ abstract class FlutterIntegrationCoreApi { } else { pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableInt was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableMap was null.'); final List args = (message as List?)!; - final int? arg_anInt = (args[0] as int?); + final Map? arg_map = + (args[0] as Map?)?.cast(); try { - final int? output = api.echoNullableInt(arg_anInt); + final Map? output = api.echoNullableMap(arg_map); return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -3680,7 +6291,7 @@ abstract class FlutterIntegrationCoreApi { final BasicMessageChannel< Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableDouble$messageChannelSuffix', + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableStringMap$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { @@ -3688,11 +6299,13 @@ abstract class FlutterIntegrationCoreApi { } else { pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableDouble was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableStringMap was null.'); final List args = (message as List?)!; - final double? arg_aDouble = (args[0] as double?); + final Map? arg_stringMap = + (args[0] as Map?)?.cast(); try { - final double? output = api.echoNullableDouble(arg_aDouble); + final Map? output = + api.echoNullableStringMap(arg_stringMap); return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -3707,7 +6320,7 @@ abstract class FlutterIntegrationCoreApi { final BasicMessageChannel< Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableString$messageChannelSuffix', + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableIntMap$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { @@ -3715,11 +6328,12 @@ abstract class FlutterIntegrationCoreApi { } else { pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableString was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableIntMap was null.'); final List args = (message as List?)!; - final String? arg_aString = (args[0] as String?); + final Map? arg_intMap = + (args[0] as Map?)?.cast(); try { - final String? output = api.echoNullableString(arg_aString); + final Map? output = api.echoNullableIntMap(arg_intMap); return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -3734,7 +6348,7 @@ abstract class FlutterIntegrationCoreApi { final BasicMessageChannel< Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableUint8List$messageChannelSuffix', + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableEnumMap$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { @@ -3742,11 +6356,13 @@ abstract class FlutterIntegrationCoreApi { } else { pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableUint8List was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableEnumMap was null.'); final List args = (message as List?)!; - final Uint8List? arg_list = (args[0] as Uint8List?); + final Map? arg_enumMap = + (args[0] as Map?)?.cast(); try { - final Uint8List? output = api.echoNullableUint8List(arg_list); + final Map? output = + api.echoNullableEnumMap(arg_enumMap); return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -3761,7 +6377,7 @@ abstract class FlutterIntegrationCoreApi { final BasicMessageChannel< Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableList$messageChannelSuffix', + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableClassMap$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { @@ -3769,12 +6385,14 @@ abstract class FlutterIntegrationCoreApi { } else { pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableList was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableClassMap was null.'); final List args = (message as List?)!; - final List? arg_list = - (args[0] as List?)?.cast(); + final Map? arg_classMap = + (args[0] as Map?) + ?.cast(); try { - final List? output = api.echoNullableList(arg_list); + final Map? output = + api.echoNullableClassMap(arg_classMap); return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -3789,7 +6407,7 @@ abstract class FlutterIntegrationCoreApi { final BasicMessageChannel< Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableMap$messageChannelSuffix', + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableNonNullStringMap$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { @@ -3797,12 +6415,101 @@ abstract class FlutterIntegrationCoreApi { } else { pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableMap was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableNonNullStringMap was null.'); + final List args = (message as List?)!; + final Map? arg_stringMap = + (args[0] as Map?)?.cast(); + try { + final Map? output = + api.echoNullableNonNullStringMap(arg_stringMap); + return wrapResponse(result: output); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } + }); + } + } + { + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableNonNullIntMap$messageChannelSuffix', + pigeonChannelCodec, + binaryMessenger: binaryMessenger); + if (api == null) { + pigeonVar_channel.setMessageHandler(null); + } else { + pigeonVar_channel.setMessageHandler((Object? message) async { + assert(message != null, + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableNonNullIntMap was null.'); + final List args = (message as List?)!; + final Map? arg_intMap = + (args[0] as Map?)?.cast(); + try { + final Map? output = + api.echoNullableNonNullIntMap(arg_intMap); + return wrapResponse(result: output); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } + }); + } + } + { + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableNonNullEnumMap$messageChannelSuffix', + pigeonChannelCodec, + binaryMessenger: binaryMessenger); + if (api == null) { + pigeonVar_channel.setMessageHandler(null); + } else { + pigeonVar_channel.setMessageHandler((Object? message) async { + assert(message != null, + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableNonNullEnumMap was null.'); + final List args = (message as List?)!; + final Map? arg_enumMap = + (args[0] as Map?)?.cast(); + try { + final Map? output = + api.echoNullableNonNullEnumMap(arg_enumMap); + return wrapResponse(result: output); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } + }); + } + } + { + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableNonNullClassMap$messageChannelSuffix', + pigeonChannelCodec, + binaryMessenger: binaryMessenger); + if (api == null) { + pigeonVar_channel.setMessageHandler(null); + } else { + pigeonVar_channel.setMessageHandler((Object? message) async { + assert(message != null, + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableNonNullClassMap was null.'); final List args = (message as List?)!; - final Map? arg_aMap = - (args[0] as Map?)?.cast(); + final Map? arg_classMap = + (args[0] as Map?) + ?.cast(); try { - final Map? output = api.echoNullableMap(arg_aMap); + final Map? output = + api.echoNullableNonNullClassMap(arg_classMap); return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); diff --git a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/enum.gen.dart b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/enum.gen.dart index c20e922fdead..6dfbc13452ca 100644 --- a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/enum.gen.dart +++ b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/enum.gen.dart @@ -72,7 +72,10 @@ class _PigeonCodec extends StandardMessageCodec { const _PigeonCodec(); @override void writeValue(WriteBuffer buffer, Object? value) { - if (value is EnumState) { + if (value is int) { + buffer.putUint8(4); + buffer.putInt64(value); + } else if (value is EnumState) { buffer.putUint8(129); writeValue(buffer, value.index); } else if (value is DataWithEnum) { diff --git a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/flutter_unittests.gen.dart b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/flutter_unittests.gen.dart index 07e0958447ec..c1a8d542e512 100644 --- a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/flutter_unittests.gen.dart +++ b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/flutter_unittests.gen.dart @@ -112,7 +112,10 @@ class _PigeonCodec extends StandardMessageCodec { const _PigeonCodec(); @override void writeValue(WriteBuffer buffer, Object? value) { - if (value is FlutterSearchRequest) { + if (value is int) { + buffer.putUint8(4); + buffer.putInt64(value); + } else if (value is FlutterSearchRequest) { buffer.putUint8(129); writeValue(buffer, value.encode()); } else if (value is FlutterSearchReply) { diff --git a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/message.gen.dart b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/message.gen.dart index 19c10427c3d5..6a63637da6f6 100644 --- a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/message.gen.dart +++ b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/message.gen.dart @@ -144,7 +144,10 @@ class _PigeonCodec extends StandardMessageCodec { const _PigeonCodec(); @override void writeValue(WriteBuffer buffer, Object? value) { - if (value is MessageRequestState) { + if (value is int) { + buffer.putUint8(4); + buffer.putInt64(value); + } else if (value is MessageRequestState) { buffer.putUint8(129); writeValue(buffer, value.index); } else if (value is MessageSearchRequest) { diff --git a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/multiple_arity.gen.dart b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/multiple_arity.gen.dart index 0ccb1f5e643e..05197c29c3ce 100644 --- a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/multiple_arity.gen.dart +++ b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/multiple_arity.gen.dart @@ -32,6 +32,23 @@ List wrapResponse( class _PigeonCodec extends StandardMessageCodec { const _PigeonCodec(); + @override + void writeValue(WriteBuffer buffer, Object? value) { + if (value is int) { + buffer.putUint8(4); + buffer.putInt64(value); + } else { + super.writeValue(buffer, value); + } + } + + @override + Object? readValueOfType(int type, ReadBuffer buffer) { + switch (type) { + default: + return super.readValueOfType(type, buffer); + } + } } class MultipleArityHostApi { diff --git a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/non_null_fields.gen.dart b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/non_null_fields.gen.dart index ce1117141384..c7a84edb7ab0 100644 --- a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/non_null_fields.gen.dart +++ b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/non_null_fields.gen.dart @@ -127,7 +127,10 @@ class _PigeonCodec extends StandardMessageCodec { const _PigeonCodec(); @override void writeValue(WriteBuffer buffer, Object? value) { - if (value is ReplyType) { + if (value is int) { + buffer.putUint8(4); + buffer.putInt64(value); + } else if (value is ReplyType) { buffer.putUint8(129); writeValue(buffer, value.index); } else if (value is NonNullFieldSearchRequest) { diff --git a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/null_fields.gen.dart b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/null_fields.gen.dart index 672dccad4a3f..9ef352f4a45e 100644 --- a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/null_fields.gen.dart +++ b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/null_fields.gen.dart @@ -106,7 +106,10 @@ class _PigeonCodec extends StandardMessageCodec { const _PigeonCodec(); @override void writeValue(WriteBuffer buffer, Object? value) { - if (value is NullFieldsSearchReplyType) { + if (value is int) { + buffer.putUint8(4); + buffer.putInt64(value); + } else if (value is NullFieldsSearchReplyType) { buffer.putUint8(129); writeValue(buffer, value.index); } else if (value is NullFieldsSearchRequest) { diff --git a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/nullable_returns.gen.dart b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/nullable_returns.gen.dart index 6f69283f744e..99cb3a3bf928 100644 --- a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/nullable_returns.gen.dart +++ b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/nullable_returns.gen.dart @@ -32,6 +32,23 @@ List wrapResponse( class _PigeonCodec extends StandardMessageCodec { const _PigeonCodec(); + @override + void writeValue(WriteBuffer buffer, Object? value) { + if (value is int) { + buffer.putUint8(4); + buffer.putInt64(value); + } else { + super.writeValue(buffer, value); + } + } + + @override + Object? readValueOfType(int type, ReadBuffer buffer) { + switch (type) { + default: + return super.readValueOfType(type, buffer); + } + } } class NullableReturnHostApi { diff --git a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/primitive.gen.dart b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/primitive.gen.dart index 552938c43ae6..e6f864538078 100644 --- a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/primitive.gen.dart +++ b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/primitive.gen.dart @@ -32,6 +32,23 @@ List wrapResponse( class _PigeonCodec extends StandardMessageCodec { const _PigeonCodec(); + @override + void writeValue(WriteBuffer buffer, Object? value) { + if (value is int) { + buffer.putUint8(4); + buffer.putInt64(value); + } else { + super.writeValue(buffer, value); + } + } + + @override + Object? readValueOfType(int type, ReadBuffer buffer) { + switch (type) { + default: + return super.readValueOfType(type, buffer); + } + } } class PrimitiveHostApi { diff --git a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/proxy_api_tests.gen.dart b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/proxy_api_tests.gen.dart index 977356f8ae17..54d95c4149b7 100644 --- a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/proxy_api_tests.gen.dart +++ b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/proxy_api_tests.gen.dart @@ -42,9 +42,9 @@ abstract class PigeonInternalProxyApiBaseClass { /// Construct a [PigeonInternalProxyApiBaseClass]. PigeonInternalProxyApiBaseClass({ this.pigeon_binaryMessenger, - PigeonInternalInstanceManager? pigeon_instanceManager, + PigeonInstanceManager? pigeon_instanceManager, }) : pigeon_instanceManager = - pigeon_instanceManager ?? PigeonInternalInstanceManager.instance; + pigeon_instanceManager ?? PigeonInstanceManager.instance; /// Sends and receives binary data across the Flutter platform barrier. /// @@ -55,12 +55,12 @@ abstract class PigeonInternalProxyApiBaseClass { /// Maintains instances stored to communicate with native language objects. @protected - final PigeonInternalInstanceManager pigeon_instanceManager; + final PigeonInstanceManager pigeon_instanceManager; /// Instantiates and returns a functionally identical object to oneself. /// /// Outside of tests, this method should only ever be called by - /// [PigeonInternalInstanceManager]. + /// [PigeonInstanceManager]. /// /// Subclasses should always override their parent's implementation of this /// method. @@ -83,10 +83,9 @@ abstract class PigeonInternalProxyApiBaseClass { /// is added as a weak reference with the same identifier. This prevents a /// scenario where the weak referenced instance was released and then later /// returned by the host platform. -class PigeonInternalInstanceManager { - /// Constructs a [PigeonInternalInstanceManager]. - PigeonInternalInstanceManager( - {required void Function(int) onWeakReferenceRemoved}) { +class PigeonInstanceManager { + /// Constructs a [PigeonInstanceManager]. + PigeonInstanceManager({required void Function(int) onWeakReferenceRemoved}) { this.onWeakReferenceRemoved = (int identifier) { _weakInstances.remove(identifier); onWeakReferenceRemoved(identifier); @@ -100,12 +99,12 @@ class PigeonInternalInstanceManager { // 0 <= n < 2^16. static const int _maxDartCreatedIdentifier = 65536; - /// The default [PigeonInternalInstanceManager] used by ProxyApis. + /// The default [PigeonInstanceManager] used by ProxyApis. /// /// On creation, this manager makes a call to clear the native /// InstanceManager. This is to prevent identifier conflicts after a host /// restart. - static final PigeonInternalInstanceManager instance = _initInstance(); + static final PigeonInstanceManager instance = _initInstance(); // Expando is used because it doesn't prevent its keys from becoming // inaccessible. This allows the manager to efficiently retrieve an identifier @@ -127,14 +126,13 @@ class PigeonInternalInstanceManager { /// or becomes inaccessible. late final void Function(int) onWeakReferenceRemoved; - static PigeonInternalInstanceManager _initInstance() { + static PigeonInstanceManager _initInstance() { WidgetsFlutterBinding.ensureInitialized(); final _PigeonInternalInstanceManagerApi api = _PigeonInternalInstanceManagerApi(); - // Clears the native `PigeonInternalInstanceManager` on the initial use of the Dart one. + // Clears the native `PigeonInstanceManager` on the initial use of the Dart one. api.clear(); - final PigeonInternalInstanceManager instanceManager = - PigeonInternalInstanceManager( + final PigeonInstanceManager instanceManager = PigeonInstanceManager( onWeakReferenceRemoved: (int identifier) { api.removeStrongReference(identifier); }, @@ -147,6 +145,8 @@ class PigeonInternalInstanceManager { pigeon_instanceManager: instanceManager); ProxyApiInterface.pigeon_setUpMessageHandlers( pigeon_instanceManager: instanceManager); + ClassWithApiRequirement.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); return instanceManager; } @@ -284,7 +284,7 @@ class PigeonInternalInstanceManager { } } -/// Generated API for managing the Dart and native `PigeonInternalInstanceManager`s. +/// Generated API for managing the Dart and native `PigeonInstanceManager`s. class _PigeonInternalInstanceManagerApi { /// Constructor for [_PigeonInternalInstanceManagerApi]. _PigeonInternalInstanceManagerApi({BinaryMessenger? binaryMessenger}) @@ -292,19 +292,18 @@ class _PigeonInternalInstanceManagerApi { final BinaryMessenger? pigeonVar_binaryMessenger; - static const MessageCodec pigeonChannelCodec = - StandardMessageCodec(); + static const MessageCodec pigeonChannelCodec = _PigeonCodec(); static void setUpMessageHandlers({ bool pigeon_clearHandlers = false, BinaryMessenger? binaryMessenger, - PigeonInternalInstanceManager? instanceManager, + PigeonInstanceManager? instanceManager, }) { { final BasicMessageChannel< Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.pigeon_integration_tests.PigeonInternalInstanceManagerApi.removeStrongReference', + 'dev.flutter.pigeon.pigeon_integration_tests.PigeonInternalInstanceManager.removeStrongReference', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (pigeon_clearHandlers) { @@ -312,13 +311,13 @@ class _PigeonInternalInstanceManagerApi { } else { pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.PigeonInternalInstanceManagerApi.removeStrongReference was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.PigeonInternalInstanceManager.removeStrongReference was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.PigeonInternalInstanceManagerApi.removeStrongReference was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.PigeonInternalInstanceManager.removeStrongReference was null, expected non-null int.'); try { - (instanceManager ?? PigeonInternalInstanceManager.instance) + (instanceManager ?? PigeonInstanceManager.instance) .remove(arg_identifier!); return wrapResponse(empty: true); } on PlatformException catch (e) { @@ -334,7 +333,7 @@ class _PigeonInternalInstanceManagerApi { Future removeStrongReference(int identifier) async { const String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.PigeonInternalInstanceManagerApi.removeStrongReference'; + 'dev.flutter.pigeon.pigeon_integration_tests.PigeonInternalInstanceManager.removeStrongReference'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, @@ -356,12 +355,12 @@ class _PigeonInternalInstanceManagerApi { } } - /// Clear the native `PigeonInternalInstanceManager`. + /// Clear the native `PigeonInstanceManager`. /// /// This is typically called after a hot restart. Future clear() async { const String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.PigeonInternalInstanceManagerApi.clear'; + 'dev.flutter.pigeon.pigeon_integration_tests.PigeonInternalInstanceManager.clear'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, @@ -386,7 +385,7 @@ class _PigeonInternalInstanceManagerApi { class _PigeonInternalProxyApiBaseCodec extends _PigeonCodec { const _PigeonInternalProxyApiBaseCodec(this.instanceManager); - final PigeonInternalInstanceManager instanceManager; + final PigeonInstanceManager instanceManager; @override void writeValue(WriteBuffer buffer, Object? value) { if (value is PigeonInternalProxyApiBaseClass) { @@ -419,7 +418,10 @@ class _PigeonCodec extends StandardMessageCodec { const _PigeonCodec(); @override void writeValue(WriteBuffer buffer, Object? value) { - if (value is ProxyApiTestEnum) { + if (value is int) { + buffer.putUint8(4); + buffer.putInt64(value); + } else if (value is ProxyApiTestEnum) { buffer.putUint8(129); writeValue(buffer, value.index); } else { @@ -580,7 +582,7 @@ class ProxyApiTestClass extends ProxyApiSuperClass /// Constructs [ProxyApiTestClass] without creating the associated native object. /// /// This should only be used by subclasses created by this library or to - /// create copies for an [PigeonInternalInstanceManager]. + /// create copies for an [PigeonInstanceManager]. @protected ProxyApiTestClass.pigeon_detached({ super.pigeon_binaryMessenger, @@ -689,7 +691,7 @@ class ProxyApiTestClass extends ProxyApiSuperClass /// ); /// ``` /// - /// Alternatively, [PigeonInternalInstanceManager.removeWeakReference] can be used to + /// Alternatively, [PigeonInstanceManager.removeWeakReference] can be used to /// release the associated Native object manually. final void Function(ProxyApiTestClass pigeon_instance)? flutterNoop; @@ -710,7 +712,7 @@ class ProxyApiTestClass extends ProxyApiSuperClass /// ); /// ``` /// - /// Alternatively, [PigeonInternalInstanceManager.removeWeakReference] can be used to + /// Alternatively, [PigeonInstanceManager.removeWeakReference] can be used to /// release the associated Native object manually. final Object? Function(ProxyApiTestClass pigeon_instance)? flutterThrowError; @@ -731,7 +733,7 @@ class ProxyApiTestClass extends ProxyApiSuperClass /// ); /// ``` /// - /// Alternatively, [PigeonInternalInstanceManager.removeWeakReference] can be used to + /// Alternatively, [PigeonInstanceManager.removeWeakReference] can be used to /// release the associated Native object manually. final void Function(ProxyApiTestClass pigeon_instance)? flutterThrowErrorFromVoid; @@ -753,7 +755,7 @@ class ProxyApiTestClass extends ProxyApiSuperClass /// ); /// ``` /// - /// Alternatively, [PigeonInternalInstanceManager.removeWeakReference] can be used to + /// Alternatively, [PigeonInstanceManager.removeWeakReference] can be used to /// release the associated Native object manually. final bool Function( ProxyApiTestClass pigeon_instance, @@ -777,7 +779,7 @@ class ProxyApiTestClass extends ProxyApiSuperClass /// ); /// ``` /// - /// Alternatively, [PigeonInternalInstanceManager.removeWeakReference] can be used to + /// Alternatively, [PigeonInstanceManager.removeWeakReference] can be used to /// release the associated Native object manually. final int Function( ProxyApiTestClass pigeon_instance, @@ -801,7 +803,7 @@ class ProxyApiTestClass extends ProxyApiSuperClass /// ); /// ``` /// - /// Alternatively, [PigeonInternalInstanceManager.removeWeakReference] can be used to + /// Alternatively, [PigeonInstanceManager.removeWeakReference] can be used to /// release the associated Native object manually. final double Function( ProxyApiTestClass pigeon_instance, @@ -825,7 +827,7 @@ class ProxyApiTestClass extends ProxyApiSuperClass /// ); /// ``` /// - /// Alternatively, [PigeonInternalInstanceManager.removeWeakReference] can be used to + /// Alternatively, [PigeonInstanceManager.removeWeakReference] can be used to /// release the associated Native object manually. final String Function( ProxyApiTestClass pigeon_instance, @@ -849,7 +851,7 @@ class ProxyApiTestClass extends ProxyApiSuperClass /// ); /// ``` /// - /// Alternatively, [PigeonInternalInstanceManager.removeWeakReference] can be used to + /// Alternatively, [PigeonInstanceManager.removeWeakReference] can be used to /// release the associated Native object manually. final Uint8List Function( ProxyApiTestClass pigeon_instance, @@ -873,7 +875,7 @@ class ProxyApiTestClass extends ProxyApiSuperClass /// ); /// ``` /// - /// Alternatively, [PigeonInternalInstanceManager.removeWeakReference] can be used to + /// Alternatively, [PigeonInstanceManager.removeWeakReference] can be used to /// release the associated Native object manually. final List Function( ProxyApiTestClass pigeon_instance, @@ -898,7 +900,7 @@ class ProxyApiTestClass extends ProxyApiSuperClass /// ); /// ``` /// - /// Alternatively, [PigeonInternalInstanceManager.removeWeakReference] can be used to + /// Alternatively, [PigeonInstanceManager.removeWeakReference] can be used to /// release the associated Native object manually. final List Function( ProxyApiTestClass pigeon_instance, @@ -922,7 +924,7 @@ class ProxyApiTestClass extends ProxyApiSuperClass /// ); /// ``` /// - /// Alternatively, [PigeonInternalInstanceManager.removeWeakReference] can be used to + /// Alternatively, [PigeonInstanceManager.removeWeakReference] can be used to /// release the associated Native object manually. final Map Function( ProxyApiTestClass pigeon_instance, @@ -947,7 +949,7 @@ class ProxyApiTestClass extends ProxyApiSuperClass /// ); /// ``` /// - /// Alternatively, [PigeonInternalInstanceManager.removeWeakReference] can be used to + /// Alternatively, [PigeonInstanceManager.removeWeakReference] can be used to /// release the associated Native object manually. final Map Function( ProxyApiTestClass pigeon_instance, @@ -971,7 +973,7 @@ class ProxyApiTestClass extends ProxyApiSuperClass /// ); /// ``` /// - /// Alternatively, [PigeonInternalInstanceManager.removeWeakReference] can be used to + /// Alternatively, [PigeonInstanceManager.removeWeakReference] can be used to /// release the associated Native object manually. final ProxyApiTestEnum Function( ProxyApiTestClass pigeon_instance, @@ -995,7 +997,7 @@ class ProxyApiTestClass extends ProxyApiSuperClass /// ); /// ``` /// - /// Alternatively, [PigeonInternalInstanceManager.removeWeakReference] can be used to + /// Alternatively, [PigeonInstanceManager.removeWeakReference] can be used to /// release the associated Native object manually. final ProxyApiSuperClass Function( ProxyApiTestClass pigeon_instance, @@ -1019,7 +1021,7 @@ class ProxyApiTestClass extends ProxyApiSuperClass /// ); /// ``` /// - /// Alternatively, [PigeonInternalInstanceManager.removeWeakReference] can be used to + /// Alternatively, [PigeonInstanceManager.removeWeakReference] can be used to /// release the associated Native object manually. final bool? Function( ProxyApiTestClass pigeon_instance, @@ -1043,7 +1045,7 @@ class ProxyApiTestClass extends ProxyApiSuperClass /// ); /// ``` /// - /// Alternatively, [PigeonInternalInstanceManager.removeWeakReference] can be used to + /// Alternatively, [PigeonInstanceManager.removeWeakReference] can be used to /// release the associated Native object manually. final int? Function( ProxyApiTestClass pigeon_instance, @@ -1067,7 +1069,7 @@ class ProxyApiTestClass extends ProxyApiSuperClass /// ); /// ``` /// - /// Alternatively, [PigeonInternalInstanceManager.removeWeakReference] can be used to + /// Alternatively, [PigeonInstanceManager.removeWeakReference] can be used to /// release the associated Native object manually. final double? Function( ProxyApiTestClass pigeon_instance, @@ -1091,7 +1093,7 @@ class ProxyApiTestClass extends ProxyApiSuperClass /// ); /// ``` /// - /// Alternatively, [PigeonInternalInstanceManager.removeWeakReference] can be used to + /// Alternatively, [PigeonInstanceManager.removeWeakReference] can be used to /// release the associated Native object manually. final String? Function( ProxyApiTestClass pigeon_instance, @@ -1115,7 +1117,7 @@ class ProxyApiTestClass extends ProxyApiSuperClass /// ); /// ``` /// - /// Alternatively, [PigeonInternalInstanceManager.removeWeakReference] can be used to + /// Alternatively, [PigeonInstanceManager.removeWeakReference] can be used to /// release the associated Native object manually. final Uint8List? Function( ProxyApiTestClass pigeon_instance, @@ -1139,7 +1141,7 @@ class ProxyApiTestClass extends ProxyApiSuperClass /// ); /// ``` /// - /// Alternatively, [PigeonInternalInstanceManager.removeWeakReference] can be used to + /// Alternatively, [PigeonInstanceManager.removeWeakReference] can be used to /// release the associated Native object manually. final List? Function( ProxyApiTestClass pigeon_instance, @@ -1163,7 +1165,7 @@ class ProxyApiTestClass extends ProxyApiSuperClass /// ); /// ``` /// - /// Alternatively, [PigeonInternalInstanceManager.removeWeakReference] can be used to + /// Alternatively, [PigeonInstanceManager.removeWeakReference] can be used to /// release the associated Native object manually. final Map? Function( ProxyApiTestClass pigeon_instance, @@ -1187,7 +1189,7 @@ class ProxyApiTestClass extends ProxyApiSuperClass /// ); /// ``` /// - /// Alternatively, [PigeonInternalInstanceManager.removeWeakReference] can be used to + /// Alternatively, [PigeonInstanceManager.removeWeakReference] can be used to /// release the associated Native object manually. final ProxyApiTestEnum? Function( ProxyApiTestClass pigeon_instance, @@ -1211,7 +1213,7 @@ class ProxyApiTestClass extends ProxyApiSuperClass /// ); /// ``` /// - /// Alternatively, [PigeonInternalInstanceManager.removeWeakReference] can be used to + /// Alternatively, [PigeonInstanceManager.removeWeakReference] can be used to /// release the associated Native object manually. final ProxyApiSuperClass? Function( ProxyApiTestClass pigeon_instance, @@ -1236,7 +1238,7 @@ class ProxyApiTestClass extends ProxyApiSuperClass /// ); /// ``` /// - /// Alternatively, [PigeonInternalInstanceManager.removeWeakReference] can be used to + /// Alternatively, [PigeonInstanceManager.removeWeakReference] can be used to /// release the associated Native object manually. final Future Function(ProxyApiTestClass pigeon_instance)? flutterNoopAsync; @@ -1258,7 +1260,7 @@ class ProxyApiTestClass extends ProxyApiSuperClass /// ); /// ``` /// - /// Alternatively, [PigeonInternalInstanceManager.removeWeakReference] can be used to + /// Alternatively, [PigeonInstanceManager.removeWeakReference] can be used to /// release the associated Native object manually. final Future Function( ProxyApiTestClass pigeon_instance, @@ -1276,7 +1278,7 @@ class ProxyApiTestClass extends ProxyApiSuperClass static void pigeon_setUpMessageHandlers({ bool pigeon_clearHandlers = false, BinaryMessenger? pigeon_binaryMessenger, - PigeonInternalInstanceManager? pigeon_instanceManager, + PigeonInstanceManager? pigeon_instanceManager, ProxyApiTestClass Function( bool aBool, int anInt, @@ -1388,7 +1390,7 @@ class ProxyApiTestClass extends ProxyApiSuperClass }) { final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = _PigeonInternalProxyApiBaseCodec( - pigeon_instanceManager ?? PigeonInternalInstanceManager.instance); + pigeon_instanceManager ?? PigeonInstanceManager.instance); final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger; { final BasicMessageChannel< @@ -1451,7 +1453,7 @@ class ProxyApiTestClass extends ProxyApiSuperClass final ProxyApiSuperClass? arg_aNullableProxyApi = (args[18] as ProxyApiSuperClass?); try { - (pigeon_instanceManager ?? PigeonInternalInstanceManager.instance) + (pigeon_instanceManager ?? PigeonInstanceManager.instance) .addHostCreatedInstance( pigeon_newInstance?.call( arg_aBool!, @@ -2428,12 +2430,10 @@ class ProxyApiTestClass extends ProxyApiSuperClass final ProxyApiSuperClass pigeonVar_instance = ProxyApiSuperClass.pigeon_detached(); final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = - _PigeonInternalProxyApiBaseCodec( - PigeonInternalInstanceManager.instance); + _PigeonInternalProxyApiBaseCodec(PigeonInstanceManager.instance); final BinaryMessenger pigeonVar_binaryMessenger = ServicesBinding.instance.defaultBinaryMessenger; - final int pigeonVar_instanceIdentifier = PigeonInternalInstanceManager - .instance + final int pigeonVar_instanceIdentifier = PigeonInstanceManager.instance .addDartCreatedInstance(pigeonVar_instance); () async { const String pigeonVar_channelName = @@ -2807,8 +2807,8 @@ class ProxyApiTestClass extends ProxyApiSuperClass /// Returns the passed list with ProxyApis, to test serialization and /// deserialization. - Future> echoProxyApiList( - List aList) async { + Future> echoProxyApiList( + List aList) async { final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = _pigeonVar_codecProxyApiTestClass; final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; @@ -2837,7 +2837,7 @@ class ProxyApiTestClass extends ProxyApiSuperClass ); } else { return (pigeonVar_replyList[0] as List?)! - .cast(); + .cast(); } } @@ -2877,8 +2877,8 @@ class ProxyApiTestClass extends ProxyApiSuperClass /// Returns the passed map with ProxyApis, to test serialization and /// deserialization. - Future> echoProxyApiMap( - Map aMap) async { + Future> echoProxyApiMap( + Map aMap) async { final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = _pigeonVar_codecProxyApiTestClass; final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; @@ -2907,7 +2907,7 @@ class ProxyApiTestClass extends ProxyApiSuperClass ); } else { return (pigeonVar_replyList[0] as Map?)! - .cast(); + .cast(); } } @@ -3929,11 +3929,11 @@ class ProxyApiTestClass extends ProxyApiSuperClass static Future staticNoop({ BinaryMessenger? pigeon_binaryMessenger, - PigeonInternalInstanceManager? pigeon_instanceManager, + PigeonInstanceManager? pigeon_instanceManager, }) async { final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = _PigeonInternalProxyApiBaseCodec( - pigeon_instanceManager ?? PigeonInternalInstanceManager.instance); + pigeon_instanceManager ?? PigeonInstanceManager.instance); final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; const String pigeonVar_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.staticNoop'; @@ -3961,11 +3961,11 @@ class ProxyApiTestClass extends ProxyApiSuperClass static Future echoStaticString( String aString, { BinaryMessenger? pigeon_binaryMessenger, - PigeonInternalInstanceManager? pigeon_instanceManager, + PigeonInstanceManager? pigeon_instanceManager, }) async { final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = _PigeonInternalProxyApiBaseCodec( - pigeon_instanceManager ?? PigeonInternalInstanceManager.instance); + pigeon_instanceManager ?? PigeonInstanceManager.instance); final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; const String pigeonVar_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoStaticString'; @@ -3997,11 +3997,11 @@ class ProxyApiTestClass extends ProxyApiSuperClass static Future staticAsyncNoop({ BinaryMessenger? pigeon_binaryMessenger, - PigeonInternalInstanceManager? pigeon_instanceManager, + PigeonInstanceManager? pigeon_instanceManager, }) async { final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = _PigeonInternalProxyApiBaseCodec( - pigeon_instanceManager ?? PigeonInternalInstanceManager.instance); + pigeon_instanceManager ?? PigeonInstanceManager.instance); final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; const String pigeonVar_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.staticAsyncNoop'; @@ -4866,7 +4866,7 @@ class ProxyApiSuperClass extends PigeonInternalProxyApiBaseClass { /// Constructs [ProxyApiSuperClass] without creating the associated native object. /// /// This should only be used by subclasses created by this library or to - /// create copies for an [PigeonInternalInstanceManager]. + /// create copies for an [PigeonInstanceManager]. @protected ProxyApiSuperClass.pigeon_detached({ super.pigeon_binaryMessenger, @@ -4880,12 +4880,12 @@ class ProxyApiSuperClass extends PigeonInternalProxyApiBaseClass { static void pigeon_setUpMessageHandlers({ bool pigeon_clearHandlers = false, BinaryMessenger? pigeon_binaryMessenger, - PigeonInternalInstanceManager? pigeon_instanceManager, + PigeonInstanceManager? pigeon_instanceManager, ProxyApiSuperClass Function()? pigeon_newInstance, }) { final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = _PigeonInternalProxyApiBaseCodec( - pigeon_instanceManager ?? PigeonInternalInstanceManager.instance); + pigeon_instanceManager ?? PigeonInstanceManager.instance); final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger; { final BasicMessageChannel< @@ -4905,7 +4905,7 @@ class ProxyApiSuperClass extends PigeonInternalProxyApiBaseClass { assert(arg_pigeon_instanceIdentifier != null, 'Argument for dev.flutter.pigeon.pigeon_integration_tests.ProxyApiSuperClass.pigeon_newInstance was null, expected non-null int.'); try { - (pigeon_instanceManager ?? PigeonInternalInstanceManager.instance) + (pigeon_instanceManager ?? PigeonInstanceManager.instance) .addHostCreatedInstance( pigeon_newInstance?.call() ?? ProxyApiSuperClass.pigeon_detached( @@ -4967,7 +4967,7 @@ class ProxyApiInterface extends PigeonInternalProxyApiBaseClass { /// Constructs [ProxyApiInterface] without creating the associated native object. /// /// This should only be used by subclasses created by this library or to - /// create copies for an [PigeonInternalInstanceManager]. + /// create copies for an [PigeonInstanceManager]. @protected ProxyApiInterface.pigeon_detached({ super.pigeon_binaryMessenger, @@ -4992,20 +4992,20 @@ class ProxyApiInterface extends PigeonInternalProxyApiBaseClass { /// ); /// ``` /// - /// Alternatively, [PigeonInternalInstanceManager.removeWeakReference] can be used to + /// Alternatively, [PigeonInstanceManager.removeWeakReference] can be used to /// release the associated Native object manually. final void Function(ProxyApiInterface pigeon_instance)? anInterfaceMethod; static void pigeon_setUpMessageHandlers({ bool pigeon_clearHandlers = false, BinaryMessenger? pigeon_binaryMessenger, - PigeonInternalInstanceManager? pigeon_instanceManager, + PigeonInstanceManager? pigeon_instanceManager, ProxyApiInterface Function()? pigeon_newInstance, void Function(ProxyApiInterface pigeon_instance)? anInterfaceMethod, }) { final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = _PigeonInternalProxyApiBaseCodec( - pigeon_instanceManager ?? PigeonInternalInstanceManager.instance); + pigeon_instanceManager ?? PigeonInstanceManager.instance); final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger; { final BasicMessageChannel< @@ -5025,7 +5025,7 @@ class ProxyApiInterface extends PigeonInternalProxyApiBaseClass { assert(arg_pigeon_instanceIdentifier != null, 'Argument for dev.flutter.pigeon.pigeon_integration_tests.ProxyApiInterface.pigeon_newInstance was null, expected non-null int.'); try { - (pigeon_instanceManager ?? PigeonInternalInstanceManager.instance) + (pigeon_instanceManager ?? PigeonInstanceManager.instance) .addHostCreatedInstance( pigeon_newInstance?.call() ?? ProxyApiInterface.pigeon_detached( @@ -5087,3 +5087,137 @@ class ProxyApiInterface extends PigeonInternalProxyApiBaseClass { ); } } + +class ClassWithApiRequirement extends PigeonInternalProxyApiBaseClass { + ClassWithApiRequirement({ + super.pigeon_binaryMessenger, + super.pigeon_instanceManager, + }) { + final int pigeonVar_instanceIdentifier = + pigeon_instanceManager.addDartCreatedInstance(this); + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecClassWithApiRequirement; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + () async { + const String pigeonVar_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.ClassWithApiRequirement.pigeon_defaultConstructor'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = await pigeonVar_channel + .send([pigeonVar_instanceIdentifier]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return; + } + }(); + } + + /// Constructs [ClassWithApiRequirement] without creating the associated native object. + /// + /// This should only be used by subclasses created by this library or to + /// create copies for an [PigeonInstanceManager]. + @protected + ClassWithApiRequirement.pigeon_detached({ + super.pigeon_binaryMessenger, + super.pigeon_instanceManager, + }); + + late final _PigeonInternalProxyApiBaseCodec + _pigeonVar_codecClassWithApiRequirement = + _PigeonInternalProxyApiBaseCodec(pigeon_instanceManager); + + static void pigeon_setUpMessageHandlers({ + bool pigeon_clearHandlers = false, + BinaryMessenger? pigeon_binaryMessenger, + PigeonInstanceManager? pigeon_instanceManager, + ClassWithApiRequirement Function()? pigeon_newInstance, + }) { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _PigeonInternalProxyApiBaseCodec( + pigeon_instanceManager ?? PigeonInstanceManager.instance); + final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger; + { + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.ClassWithApiRequirement.pigeon_newInstance', + pigeonChannelCodec, + binaryMessenger: binaryMessenger); + if (pigeon_clearHandlers) { + pigeonVar_channel.setMessageHandler(null); + } else { + pigeonVar_channel.setMessageHandler((Object? message) async { + assert(message != null, + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.ClassWithApiRequirement.pigeon_newInstance was null.'); + final List args = (message as List?)!; + final int? arg_pigeon_instanceIdentifier = (args[0] as int?); + assert(arg_pigeon_instanceIdentifier != null, + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.ClassWithApiRequirement.pigeon_newInstance was null, expected non-null int.'); + try { + (pigeon_instanceManager ?? PigeonInstanceManager.instance) + .addHostCreatedInstance( + pigeon_newInstance?.call() ?? + ClassWithApiRequirement.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + ), + arg_pigeon_instanceIdentifier!, + ); + return wrapResponse(empty: true); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } + }); + } + } + } + + Future aMethod() async { + final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = + _pigeonVar_codecClassWithApiRequirement; + final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; + const String pigeonVar_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.ClassWithApiRequirement.aMethod'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([this]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return; + } + } + + @override + ClassWithApiRequirement pigeon_copy() { + return ClassWithApiRequirement.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + ); + } +} diff --git a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/test_types.dart b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/test_types.dart new file mode 100644 index 000000000000..40d35dc67940 --- /dev/null +++ b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/test_types.dart @@ -0,0 +1,692 @@ +// 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/foundation.dart'; +import 'package:flutter_test/flutter_test.dart'; + +import 'generated.dart'; + +const int biggerThanBigInt = 3000000000; +const int regularInt = 42; +const double doublePi = 3.14159; + +void compareComplexLists(List? listOne, List? listTwo) { + expect(listOne == null, listTwo == null); + if (listOne == null || listTwo == null) { + return; + } + expect(listOne.length, listTwo.length); + for (int i = 0; i < listOne.length; i++) { + if (listOne[i] is List) { + compareComplexLists( + listOne[i] as List, listTwo[i] as List); + } else if (listOne[i] is Map) { + compareComplexMaps(listOne[i] as Map, + listTwo[i] as Map); + } else if (listOne[i] is AllTypes) { + compareAllTypes(listOne[i] as AllTypes, listTwo[i] as AllTypes); + } else if (listOne[i] is AllNullableTypes) { + compareAllNullableTypes( + listOne[i] as AllNullableTypes, listTwo[i] as AllNullableTypes); + } else if (listOne[i] is AllNullableTypesWithoutRecursion) { + compareAllNullableTypesWithoutRecursion( + listOne[i] as AllNullableTypesWithoutRecursion, + listTwo[i] as AllNullableTypesWithoutRecursion); + } else if (listOne[i] is AllClassesWrapper) { + compareAllClassesWrapper( + listOne[i] as AllClassesWrapper, listTwo[i] as AllClassesWrapper); + } else { + expect(listOne[i], listTwo[i]); + } + } +} + +void compareComplexMaps( + Map? mapOne, Map? mapTwo) { + expect(mapOne == null, mapTwo == null); + if (mapOne == null || mapTwo == null) { + return; + } + expect(mapOne.length, mapTwo.length); + for (final dynamic key in mapOne.keys) { + if (mapOne[key] is List) { + compareComplexLists( + mapOne[key] as List, mapTwo[key] as List); + } else if (mapOne[key] is Map) { + compareComplexMaps(mapOne[key] as Map, + mapTwo[key] as Map); + } else if (mapOne[key] is AllTypes) { + compareAllTypes(mapOne[key] as AllTypes, mapTwo[key] as AllTypes); + } else if (mapOne[key] is AllNullableTypes) { + compareAllNullableTypes( + mapOne[key] as AllNullableTypes, mapTwo[key] as AllNullableTypes); + } else if (mapOne[key] is AllNullableTypesWithoutRecursion) { + compareAllNullableTypesWithoutRecursion( + mapOne[key] as AllNullableTypesWithoutRecursion, + mapTwo[key] as AllNullableTypesWithoutRecursion); + } else if (mapOne[key] is AllClassesWrapper) { + compareAllClassesWrapper( + mapOne[key] as AllClassesWrapper, mapTwo[key] as AllClassesWrapper); + } else { + expect(mapOne[key], mapTwo[key]); + } + } +} + +void compareAllNullableTypesWithoutRecursion( + AllNullableTypesWithoutRecursion? allNullableTypesOne, + AllNullableTypesWithoutRecursion? allNullableTypesTwo) { + expect(allNullableTypesOne == null, allNullableTypesTwo == null); + if (allNullableTypesOne == null || allNullableTypesTwo == null) { + return; + } + expect(allNullableTypesOne.aNullableBool, allNullableTypesTwo.aNullableBool); + expect(allNullableTypesOne.aNullableInt, allNullableTypesTwo.aNullableInt); + expect( + allNullableTypesOne.aNullableInt64, allNullableTypesTwo.aNullableInt64); + expect( + allNullableTypesOne.aNullableDouble, allNullableTypesTwo.aNullableDouble); + expect( + allNullableTypesOne.aNullableString, allNullableTypesTwo.aNullableString); + expect(allNullableTypesOne.aNullableByteArray, + allNullableTypesTwo.aNullableByteArray); + expect(allNullableTypesOne.aNullable4ByteArray, + allNullableTypesTwo.aNullable4ByteArray); + expect(allNullableTypesOne.aNullable8ByteArray, + allNullableTypesTwo.aNullable8ByteArray); + expect(allNullableTypesOne.aNullableFloatArray, + allNullableTypesTwo.aNullableFloatArray); + expect( + allNullableTypesOne.aNullableObject, allNullableTypesTwo.aNullableObject); + expect(allNullableTypesOne.aNullableEnum, allNullableTypesTwo.aNullableEnum); + compareComplexLists(allNullableTypesOne.list, allNullableTypesTwo.list); + compareComplexLists( + allNullableTypesOne.stringList, allNullableTypesTwo.stringList); + compareComplexLists( + allNullableTypesOne.boolList, allNullableTypesTwo.boolList); + compareComplexLists( + allNullableTypesOne.doubleList, allNullableTypesTwo.doubleList); + compareComplexLists(allNullableTypesOne.intList, allNullableTypesTwo.intList); + compareComplexLists( + allNullableTypesOne.enumList, allNullableTypesTwo.enumList); + compareComplexLists( + allNullableTypesOne.objectList, allNullableTypesTwo.objectList); + compareComplexLists( + allNullableTypesOne.listList, allNullableTypesTwo.listList); + compareComplexLists(allNullableTypesOne.mapList, allNullableTypesTwo.mapList); + compareComplexMaps(allNullableTypesOne.map, allNullableTypesTwo.map); + compareComplexMaps( + allNullableTypesOne.stringMap, allNullableTypesTwo.stringMap); + compareComplexMaps(allNullableTypesOne.intMap, allNullableTypesTwo.intMap); + compareComplexMaps(allNullableTypesOne.enumMap, allNullableTypesTwo.enumMap); + compareComplexMaps( + allNullableTypesOne.objectMap, allNullableTypesTwo.objectMap); + compareComplexMaps(allNullableTypesOne.listMap, allNullableTypesTwo.listMap); + compareComplexMaps(allNullableTypesOne.mapMap, allNullableTypesTwo.mapMap); +} + +void compareAllTypes(AllTypes? allTypesOne, AllTypes? allTypesTwo) { + expect(allTypesOne == null, allTypesTwo == null); + if (allTypesOne == null || allTypesTwo == null) { + return; + } + expect(allTypesOne.aBool, allTypesTwo.aBool); + expect(allTypesOne.anInt, allTypesTwo.anInt); + expect(allTypesOne.anInt64, allTypesTwo.anInt64); + expect(allTypesOne.aDouble, allTypesTwo.aDouble); + expect(allTypesOne.aString, allTypesTwo.aString); + expect(allTypesOne.aByteArray, allTypesTwo.aByteArray); + expect(allTypesOne.a4ByteArray, allTypesTwo.a4ByteArray); + expect(allTypesOne.a8ByteArray, allTypesTwo.a8ByteArray); + expect(allTypesOne.aFloatArray, allTypesTwo.aFloatArray); + expect(allTypesOne.anEnum, allTypesTwo.anEnum); + expect(allTypesOne.anObject, allTypesTwo.anObject); + compareComplexLists(allTypesOne.list, allTypesTwo.list); + compareComplexLists(allTypesOne.stringList, allTypesTwo.stringList); + compareComplexLists(allTypesOne.boolList, allTypesTwo.boolList); + compareComplexLists(allTypesOne.doubleList, allTypesTwo.doubleList); + compareComplexLists(allTypesOne.intList, allTypesTwo.intList); + compareComplexLists(allTypesOne.enumList, allTypesTwo.enumList); + compareComplexLists(allTypesOne.objectList, allTypesTwo.objectList); + compareComplexLists(allTypesOne.listList, allTypesTwo.listList); + compareComplexLists(allTypesOne.mapList, allTypesTwo.mapList); + compareComplexMaps(allTypesOne.map, allTypesTwo.map); + compareComplexMaps(allTypesOne.stringMap, allTypesTwo.stringMap); + compareComplexMaps(allTypesOne.intMap, allTypesTwo.intMap); + compareComplexMaps(allTypesOne.enumMap, allTypesTwo.enumMap); + compareComplexMaps(allTypesOne.objectMap, allTypesTwo.objectMap); + compareComplexMaps(allTypesOne.listMap, allTypesTwo.listMap); + compareComplexMaps(allTypesOne.mapMap, allTypesTwo.mapMap); +} + +void compareAllNullableTypes(AllNullableTypes? allNullableTypesOne, + AllNullableTypes? allNullableTypesTwo) { + expect(allNullableTypesOne == null, allNullableTypesTwo == null); + if (allNullableTypesOne == null || allNullableTypesTwo == null) { + return; + } + expect(allNullableTypesOne.aNullableBool, allNullableTypesTwo.aNullableBool); + expect(allNullableTypesOne.aNullableInt, allNullableTypesTwo.aNullableInt); + expect( + allNullableTypesOne.aNullableInt64, allNullableTypesTwo.aNullableInt64); + expect( + allNullableTypesOne.aNullableDouble, allNullableTypesTwo.aNullableDouble); + expect( + allNullableTypesOne.aNullableString, allNullableTypesTwo.aNullableString); + expect(allNullableTypesOne.aNullableByteArray, + allNullableTypesTwo.aNullableByteArray); + expect(allNullableTypesOne.aNullable4ByteArray, + allNullableTypesTwo.aNullable4ByteArray); + expect(allNullableTypesOne.aNullable8ByteArray, + allNullableTypesTwo.aNullable8ByteArray); + expect(allNullableTypesOne.aNullableFloatArray, + allNullableTypesTwo.aNullableFloatArray); + expect( + allNullableTypesOne.aNullableObject, allNullableTypesTwo.aNullableObject); + expect(allNullableTypesOne.aNullableEnum, allNullableTypesTwo.aNullableEnum); + compareAllNullableTypes(allNullableTypesOne.allNullableTypes, + allNullableTypesTwo.allNullableTypes); + compareComplexLists(allNullableTypesOne.list, allNullableTypesTwo.list); + compareComplexLists( + allNullableTypesOne.stringList, allNullableTypesTwo.stringList); + compareComplexLists( + allNullableTypesOne.boolList, allNullableTypesTwo.boolList); + compareComplexLists( + allNullableTypesOne.doubleList, allNullableTypesTwo.doubleList); + compareComplexLists(allNullableTypesOne.intList, allNullableTypesTwo.intList); + compareComplexLists( + allNullableTypesOne.enumList, allNullableTypesTwo.enumList); + compareComplexLists( + allNullableTypesOne.objectList, allNullableTypesTwo.objectList); + compareComplexLists( + allNullableTypesOne.listList, allNullableTypesTwo.listList); + compareComplexLists(allNullableTypesOne.recursiveClassList, + allNullableTypesTwo.recursiveClassList); + compareComplexLists(allNullableTypesOne.mapList, allNullableTypesTwo.mapList); + compareComplexMaps(allNullableTypesOne.map, allNullableTypesTwo.map); + compareComplexMaps( + allNullableTypesOne.stringMap, allNullableTypesTwo.stringMap); + compareComplexMaps(allNullableTypesOne.intMap, allNullableTypesTwo.intMap); + compareComplexMaps(allNullableTypesOne.enumMap, allNullableTypesTwo.enumMap); + compareComplexMaps( + allNullableTypesOne.objectMap, allNullableTypesTwo.objectMap); + compareComplexMaps(allNullableTypesOne.listMap, allNullableTypesTwo.listMap); + compareComplexMaps(allNullableTypesOne.mapMap, allNullableTypesTwo.mapMap); + compareComplexMaps(allNullableTypesOne.recursiveClassMap, + allNullableTypesTwo.recursiveClassMap); +} + +void compareAllClassesWrapper( + AllClassesWrapper? wrapperOne, AllClassesWrapper? wrapperTwo) { + expect(wrapperOne == null, wrapperTwo == null); + if (wrapperOne == null || wrapperTwo == null) { + return; + } + + compareAllNullableTypes( + wrapperOne.allNullableTypes, wrapperTwo.allNullableTypes); + compareAllNullableTypesWithoutRecursion( + wrapperOne.allNullableTypesWithoutRecursion, + wrapperTwo.allNullableTypesWithoutRecursion, + ); + compareAllTypes(wrapperOne.allTypes, wrapperTwo.allTypes); + + for (int i = 0; i < (wrapperOne.classList.length); i++) { + compareAllTypes(wrapperOne.classList[i], wrapperTwo.classList[i]); + } + + for (int i = 0; i < (wrapperOne.nullableClassList?.length ?? 0); i++) { + compareAllNullableTypesWithoutRecursion( + wrapperOne.nullableClassList![i], wrapperTwo.nullableClassList![i]); + } + compareComplexMaps(wrapperOne.classMap, wrapperTwo.classMap); + compareComplexMaps(wrapperOne.nullableClassMap, wrapperTwo.nullableClassMap); +} + +final List nonNullList = [ + 'Thing 1', + 2, + true, + 3.14, +]; + +final List nonNullStringList = [ + 'Thing 1', + '2', + 'true', + '3.14', +]; + +final List nonNullIntList = [ + 1, + 2, + 3, + 4, +]; + +final List nonNullDoubleList = [ + 1, + 2.99999, + 3, + 3.14, +]; + +final List nonNullBoolList = [ + true, + false, + true, + false, +]; + +final List nonNullEnumList = [ + AnEnum.one, + AnEnum.two, + AnEnum.three, + AnEnum.fortyTwo, + AnEnum.fourHundredTwentyTwo, +]; + +final List> nonNullListList = >[ + nonNullList, + nonNullStringList, + nonNullIntList, + nonNullDoubleList, + nonNullBoolList, + nonNullEnumList, +]; + +final Map nonNullMap = { + 'a': 1, + 'b': 2.0, + 'c': 'three', + 'd': false, +}; + +final Map nonNullStringMap = { + 'a': '1', + 'b': '2.0', + 'c': 'three', + 'd': 'false', +}; + +final Map nonNullIntMap = { + 0: 0, + 1: 1, + 2: 3, + 4: -1, +}; + +final Map nonNullDoubleMap = { + 0.0: 0, + 1.1: 2.0, + 3: 0.3, + -.4: -0.2, +}; + +final Map nonNullBoolMap = { + 0: true, + 1: false, + 2: true, +}; + +final Map nonNullEnumMap = { + AnEnum.one: AnEnum.one, + AnEnum.two: AnEnum.two, + AnEnum.three: AnEnum.three, + AnEnum.fortyTwo: AnEnum.fortyTwo, +}; + +final Map> nonNullListMap = >{ + 0: nonNullList, + 1: nonNullStringList, + 2: nonNullDoubleList, + 4: nonNullIntList, + 5: nonNullBoolList, + 6: nonNullEnumList, +}; + +final Map> nonNullMapMap = >{ + 0: nonNullMap, + 1: nonNullStringMap, + 2: nonNullDoubleMap, + 4: nonNullIntMap, + 5: nonNullBoolMap, + 6: nonNullEnumMap, +}; + +final List> nonNullMapList = >[ + nonNullMap, + nonNullStringMap, + nonNullDoubleMap, + nonNullIntMap, + nonNullBoolMap, + nonNullEnumMap, +]; + +final List list = [ + 'Thing 1', + 2, + true, + 3.14, + null, +]; + +final List stringList = [ + 'Thing 1', + '2', + 'true', + '3.14', + null, +]; + +final List intList = [ + 1, + 2, + 3, + 4, + null, +]; + +final List doubleList = [ + 1, + 2.99999, + 3, + 3.14, + null, +]; + +final List boolList = [ + true, + false, + true, + false, + null, +]; + +final List enumList = [ + AnEnum.one, + AnEnum.two, + AnEnum.three, + AnEnum.fortyTwo, + AnEnum.fourHundredTwentyTwo, + null +]; + +final List?> listList = ?>[ + list, + stringList, + intList, + doubleList, + boolList, + enumList, + null +]; + +final Map map = { + 'a': 1, + 'b': 2.0, + 'c': 'three', + 'd': false, + 'e': null +}; + +final Map stringMap = { + 'a': '1', + 'b': '2.0', + 'c': 'three', + 'd': 'false', + 'e': 'null', + 'f': null +}; + +final Map intMap = { + 0: 0, + 1: 1, + 2: 3, + 4: -1, + 5: null, +}; + +final Map doubleMap = { + 0.0: 0, + 1.1: 2.0, + 3: 0.3, + -.4: -0.2, + 1111111111111111.11111111111111111111111111111111111111111111: null +}; + +final Map boolMap = { + 0: true, + 1: false, + 2: true, + 3: null, +}; + +final Map enumMap = { + AnEnum.one: AnEnum.one, + AnEnum.two: AnEnum.two, + AnEnum.three: AnEnum.three, + AnEnum.fortyTwo: AnEnum.fortyTwo, + AnEnum.fourHundredTwentyTwo: null, +}; + +final Map?> listMap = ?>{ + 0: list, + 1: stringList, + 2: doubleList, + 4: intList, + 5: boolList, + 6: enumList, + 7: null +}; + +final Map?> mapMap = ?>{ + 0: map, + 1: stringMap, + 2: doubleMap, + 4: intMap, + 5: boolMap, + 6: enumMap, + 7: null +}; + +final List?> mapList = ?>[ + map, + stringMap, + doubleMap, + intMap, + boolMap, + enumMap, + null +]; + +final AllNullableTypesWithoutRecursion genericAllNullableTypesWithoutRecursion = + AllNullableTypesWithoutRecursion( + aNullableBool: true, + aNullableInt: regularInt, + aNullableInt64: biggerThanBigInt, + aNullableDouble: doublePi, + aNullableString: 'Hello host!', + aNullableByteArray: Uint8List.fromList([1, 2, 3]), + aNullable4ByteArray: Int32List.fromList([4, 5, 6]), + aNullable8ByteArray: Int64List.fromList([7, 8, 9]), + aNullableFloatArray: Float64List.fromList([2.71828, doublePi]), + aNullableEnum: AnEnum.fourHundredTwentyTwo, + aNullableObject: 0, + list: list, + stringList: stringList, + intList: intList, + doubleList: doubleList, + boolList: boolList, + enumList: enumList, + objectList: list, + listList: listList, + mapList: mapList, + map: map, + stringMap: stringMap, + intMap: intMap, + enumMap: enumMap, + objectMap: map, + listMap: listMap, + mapMap: mapMap, +); + +final List + allNullableTypesWithoutRecursionClassList = + [ + genericAllNullableTypesWithoutRecursion, + AllNullableTypesWithoutRecursion(), + null, +]; + +final Map + allNullableTypesWithoutRecursionClassMap = + { + 0: genericAllNullableTypesWithoutRecursion, + 1: AllNullableTypesWithoutRecursion(), + 2: null, +}; + +final AllTypes genericAllTypes = AllTypes( + aBool: true, + anInt: regularInt, + anInt64: biggerThanBigInt, + aDouble: doublePi, + aString: 'Hello host!', + aByteArray: Uint8List.fromList([1, 2, 3]), + a4ByteArray: Int32List.fromList([4, 5, 6]), + a8ByteArray: Int64List.fromList([7, 8, 9]), + aFloatArray: Float64List.fromList([2.71828, doublePi]), + anEnum: AnEnum.fortyTwo, + anObject: 1, + list: list, + stringList: nonNullStringList, + intList: nonNullIntList, + doubleList: nonNullDoubleList, + boolList: nonNullBoolList, + enumList: nonNullEnumList, + objectList: nonNullList, + listList: nonNullListList, + mapList: nonNullMapList, + map: nonNullMap, + stringMap: nonNullStringMap, + intMap: nonNullIntMap, + // doubleMap: nonNullDoubleMap, + // boolMap: nonNullBoolMap, + enumMap: nonNullEnumMap, + objectMap: nonNullMap, + listMap: nonNullListMap, + mapMap: nonNullMapMap, +); + +final List allTypesClassList = [ + genericAllTypes, + null, +]; + +final Map allTypesClassMap = { + 0: genericAllTypes, + 1: null, +}; + +final AllNullableTypes genericAllNullableTypes = AllNullableTypes( + aNullableBool: true, + aNullableInt: regularInt, + aNullableInt64: biggerThanBigInt, + aNullableDouble: doublePi, + aNullableString: 'Hello host!', + aNullableByteArray: Uint8List.fromList([1, 2, 3]), + aNullable4ByteArray: Int32List.fromList([4, 5, 6]), + aNullable8ByteArray: Int64List.fromList([7, 8, 9]), + aNullableFloatArray: Float64List.fromList([2.71828, doublePi]), + aNullableEnum: AnEnum.fourHundredTwentyTwo, + aNullableObject: 0, + list: list, + stringList: stringList, + intList: intList, + doubleList: doubleList, + boolList: boolList, + enumList: enumList, + objectList: list, + listList: listList, + mapList: mapList, + map: map, + stringMap: stringMap, + intMap: intMap, + enumMap: enumMap, + objectMap: map, + listMap: listMap, + mapMap: mapMap, +); + +final List nonNullAllNullableTypesList = [ + genericAllNullableTypes, + AllNullableTypes(), +]; + +final Map nonNullAllNullableTypesMap = + { + 0: genericAllNullableTypes, + 1: AllNullableTypes(), +}; + +final List allNullableTypesList = [ + genericAllNullableTypes, + AllNullableTypes(), + null, +]; + +final Map allNullableTypesMap = + { + 0: genericAllNullableTypes, + 1: AllNullableTypes(), + 2: null, +}; + +final AllNullableTypes recursiveAllNullableTypes = AllNullableTypes( + aNullableBool: true, + aNullableInt: regularInt, + aNullableInt64: biggerThanBigInt, + aNullableDouble: doublePi, + aNullableString: 'Hello host!', + aNullableByteArray: Uint8List.fromList([1, 2, 3]), + aNullable4ByteArray: Int32List.fromList([4, 5, 6]), + aNullable8ByteArray: Int64List.fromList([7, 8, 9]), + aNullableFloatArray: Float64List.fromList([2.71828, doublePi]), + aNullableEnum: AnEnum.fourHundredTwentyTwo, + aNullableObject: 0, + allNullableTypes: genericAllNullableTypes, + list: list, + stringList: stringList, + intList: intList, + doubleList: doubleList, + boolList: boolList, + enumList: enumList, + objectList: list, + listList: listList, + mapList: mapList, + recursiveClassList: allNullableTypesList, + map: map, + stringMap: stringMap, + intMap: intMap, + enumMap: enumMap, + objectMap: map, + listMap: listMap, + mapMap: mapMap, + recursiveClassMap: allNullableTypesMap, +); + +AllClassesWrapper classWrapperMaker() { + return AllClassesWrapper( + allNullableTypes: recursiveAllNullableTypes, + allNullableTypesWithoutRecursion: genericAllNullableTypesWithoutRecursion, + allTypes: genericAllTypes, + classList: allTypesClassList, + classMap: allTypesClassMap, + nullableClassList: allNullableTypesWithoutRecursionClassList, + nullableClassMap: allNullableTypesWithoutRecursionClassMap, + ); +} 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 0ce9b7bf5db1..f0ab70f80712 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.4 + mockito: ^5.4.4 diff --git a/packages/pigeon/platform_tests/shared_test_plugin_code/test/instance_manager_test.dart b/packages/pigeon/platform_tests/shared_test_plugin_code/test/instance_manager_test.dart index 1b64950e0a97..f28cb077dea0 100644 --- a/packages/pigeon/platform_tests/shared_test_plugin_code/test/instance_manager_test.dart +++ b/packages/pigeon/platform_tests/shared_test_plugin_code/test/instance_manager_test.dart @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// This file specifically tests the test PigeonInternalInstanceManager generated by core_tests. +// This file specifically tests the test PigeonInstanceManager generated by core_tests. import 'package:flutter_test/flutter_test.dart'; import 'package:shared_test_plugin_code/src/generated/proxy_api_tests.gen.dart'; @@ -10,8 +10,8 @@ import 'package:shared_test_plugin_code/src/generated/proxy_api_tests.gen.dart'; void main() { group('InstanceManager', () { test('addHostCreatedInstance', () { - final PigeonInternalInstanceManager instanceManager = - PigeonInternalInstanceManager(onWeakReferenceRemoved: (_) {}); + final PigeonInstanceManager instanceManager = + PigeonInstanceManager(onWeakReferenceRemoved: (_) {}); final CopyableObject object = CopyableObject( pigeon_instanceManager: instanceManager, @@ -27,8 +27,8 @@ void main() { }); test('addHostCreatedInstance prevents already used objects and ids', () { - final PigeonInternalInstanceManager instanceManager = - PigeonInternalInstanceManager(onWeakReferenceRemoved: (_) {}); + final PigeonInstanceManager instanceManager = + PigeonInstanceManager(onWeakReferenceRemoved: (_) {}); final CopyableObject object = CopyableObject( pigeon_instanceManager: instanceManager, @@ -51,8 +51,8 @@ void main() { }); test('addFlutterCreatedInstance', () { - final PigeonInternalInstanceManager instanceManager = - PigeonInternalInstanceManager(onWeakReferenceRemoved: (_) {}); + final PigeonInstanceManager instanceManager = + PigeonInstanceManager(onWeakReferenceRemoved: (_) {}); final CopyableObject object = CopyableObject( pigeon_instanceManager: instanceManager, @@ -70,9 +70,8 @@ void main() { test('removeWeakReference', () { int? weakInstanceId; - final PigeonInternalInstanceManager instanceManager = - PigeonInternalInstanceManager( - onWeakReferenceRemoved: (int instanceId) { + final PigeonInstanceManager instanceManager = + PigeonInstanceManager(onWeakReferenceRemoved: (int instanceId) { weakInstanceId = instanceId; }); @@ -91,8 +90,8 @@ void main() { }); test('removeWeakReference removes only weak reference', () { - final PigeonInternalInstanceManager instanceManager = - PigeonInternalInstanceManager(onWeakReferenceRemoved: (_) {}); + final PigeonInstanceManager instanceManager = + PigeonInstanceManager(onWeakReferenceRemoved: (_) {}); final CopyableObject object = CopyableObject( pigeon_instanceManager: instanceManager, @@ -108,8 +107,8 @@ void main() { }); test('removeStrongReference', () { - final PigeonInternalInstanceManager instanceManager = - PigeonInternalInstanceManager(onWeakReferenceRemoved: (_) {}); + final PigeonInstanceManager instanceManager = + PigeonInstanceManager(onWeakReferenceRemoved: (_) {}); final CopyableObject object = CopyableObject( pigeon_instanceManager: instanceManager, @@ -122,8 +121,8 @@ void main() { }); test('removeStrongReference removes only strong reference', () { - final PigeonInternalInstanceManager instanceManager = - PigeonInternalInstanceManager(onWeakReferenceRemoved: (_) {}); + final PigeonInstanceManager instanceManager = + PigeonInstanceManager(onWeakReferenceRemoved: (_) {}); final CopyableObject object = CopyableObject( pigeon_instanceManager: instanceManager, @@ -138,8 +137,8 @@ void main() { }); test('getInstance can add a new weak reference', () { - final PigeonInternalInstanceManager instanceManager = - PigeonInternalInstanceManager(onWeakReferenceRemoved: (_) {}); + final PigeonInstanceManager instanceManager = + PigeonInstanceManager(onWeakReferenceRemoved: (_) {}); final CopyableObject object = CopyableObject( pigeon_instanceManager: instanceManager, diff --git a/packages/pigeon/platform_tests/shared_test_plugin_code/test/test_message.gen.dart b/packages/pigeon/platform_tests/shared_test_plugin_code/test/test_message.gen.dart index a67e2644e7f1..62f677202322 100644 --- a/packages/pigeon/platform_tests/shared_test_plugin_code/test/test_message.gen.dart +++ b/packages/pigeon/platform_tests/shared_test_plugin_code/test/test_message.gen.dart @@ -18,7 +18,10 @@ class _PigeonCodec extends StandardMessageCodec { const _PigeonCodec(); @override void writeValue(WriteBuffer buffer, Object? value) { - if (value is MessageRequestState) { + if (value is int) { + buffer.putUint8(4); + buffer.putInt64(value); + } else if (value is MessageRequestState) { buffer.putUint8(129); writeValue(buffer, value.index); } else if (value is MessageSearchRequest) { diff --git a/packages/pigeon/platform_tests/test_plugin/android/build.gradle b/packages/pigeon/platform_tests/test_plugin/android/build.gradle index 45bfa87d931b..2ed864258e26 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 = '2.0.10' + ext.kotlin_version = '2.0.20' repositories { google() mavenCentral() @@ -25,19 +25,16 @@ apply plugin: 'com.android.library' apply plugin: 'kotlin-android' android { - // Conditional for compatibility with AGP <4.2. - if (project.android.hasProperty("namespace")) { - namespace 'com.example.test_plugin' - } + namespace 'com.example.test_plugin' compileSdk 34 compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_11 + targetCompatibility JavaVersion.VERSION_11 } kotlinOptions { - jvmTarget = '1.8' + jvmTarget = '11' allWarningsAsErrors = true } diff --git a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/.gitignore b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/.gitignore index a870aa16cae1..5f3fcaf31604 100644 --- a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/.gitignore +++ b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/.gitignore @@ -3,4 +3,9 @@ # such as a flag to suppress version stamp generation. *.kt !TestPlugin.kt -!CoreTests.gen.kt \ No newline at end of file +!CoreTests.gen.kt +# This contains the declaration of the test classes wrapped by the ProxyApi tests and the +# implemetations of their APIs. +!ProxyApiTestApiImpls.kt +# Including this makes it easier to review code generation changes. +!ProxyApiTests.gen.kt 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 2bf1533b71a6..c5ba2d8b0ca0 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 @@ -60,6 +60,22 @@ enum class AnotherEnum(val raw: Int) { } } +/** Generated class from Pigeon that represents data sent in messages. */ +data class UnusedClass(val aField: Any? = null) { + companion object { + fun fromList(pigeonVar_list: List): UnusedClass { + val aField = pigeonVar_list[0] + return UnusedClass(aField) + } + } + + fun toList(): List { + return listOf( + aField, + ) + } +} + /** * A class containing all supported types. * @@ -79,17 +95,27 @@ data class AllTypes( val aString: String, val anObject: Any, val list: List, - val stringList: List, - val intList: List, - val doubleList: List, - val boolList: List, - val map: Map + val stringList: List, + val intList: List, + val doubleList: List, + val boolList: List, + val enumList: List, + val objectList: List, + val listList: List>, + val mapList: List>, + val map: Map, + val stringMap: Map, + val intMap: Map, + val enumMap: Map, + val objectMap: Map, + val listMap: Map>, + val mapMap: Map> ) { companion object { fun fromList(pigeonVar_list: List): AllTypes { val aBool = pigeonVar_list[0] as Boolean - val anInt = pigeonVar_list[1].let { num -> if (num is Int) num.toLong() else num as Long } - val anInt64 = pigeonVar_list[2].let { num -> if (num is Int) num.toLong() else num as Long } + val anInt = pigeonVar_list[1] as Long + val anInt64 = pigeonVar_list[2] as Long val aDouble = pigeonVar_list[3] as Double val aByteArray = pigeonVar_list[4] as ByteArray val a4ByteArray = pigeonVar_list[5] as IntArray @@ -100,11 +126,21 @@ data class AllTypes( val aString = pigeonVar_list[10] as String val anObject = pigeonVar_list[11] as Any val list = pigeonVar_list[12] as List - val stringList = pigeonVar_list[13] as List - val intList = pigeonVar_list[14] as List - val doubleList = pigeonVar_list[15] as List - val boolList = pigeonVar_list[16] as List - val map = pigeonVar_list[17] as Map + val stringList = pigeonVar_list[13] as List + val intList = pigeonVar_list[14] as List + val doubleList = pigeonVar_list[15] as List + val boolList = pigeonVar_list[16] as List + val enumList = pigeonVar_list[17] as List + val objectList = pigeonVar_list[18] as List + val listList = pigeonVar_list[19] as List> + val mapList = pigeonVar_list[20] as List> + val map = pigeonVar_list[21] as Map + val stringMap = pigeonVar_list[22] as Map + val intMap = pigeonVar_list[23] as Map + val enumMap = pigeonVar_list[24] as Map + val objectMap = pigeonVar_list[25] as Map + val listMap = pigeonVar_list[26] as Map> + val mapMap = pigeonVar_list[27] as Map> return AllTypes( aBool, anInt, @@ -123,7 +159,17 @@ data class AllTypes( intList, doubleList, boolList, - map) + enumList, + objectList, + listList, + mapList, + map, + stringMap, + intMap, + enumMap, + objectMap, + listMap, + mapMap) } } @@ -146,7 +192,17 @@ data class AllTypes( intList, doubleList, boolList, + enumList, + objectList, + listList, + mapList, map, + stringMap, + intMap, + enumMap, + objectMap, + listMap, + mapMap, ) } } @@ -165,9 +221,6 @@ data class AllNullableTypes( val aNullable4ByteArray: IntArray? = null, val aNullable8ByteArray: LongArray? = null, val aNullableFloatArray: DoubleArray? = null, - val nullableNestedList: List?>? = null, - val nullableMapWithAnnotations: Map? = null, - val nullableMapWithObject: Map? = null, val aNullableEnum: AnEnum? = null, val anotherNullableEnum: AnotherEnum? = null, val aNullableString: String? = null, @@ -178,36 +231,53 @@ data class AllNullableTypes( val intList: List? = null, val doubleList: List? = null, val boolList: List? = null, - val nestedClassList: List? = null, - val map: Map? = null + val enumList: List? = null, + val objectList: List? = null, + val listList: List?>? = null, + val mapList: List?>? = null, + val recursiveClassList: List? = null, + val map: Map? = null, + val stringMap: Map? = null, + val intMap: Map? = null, + val enumMap: Map? = null, + val objectMap: Map? = null, + val listMap: Map?>? = null, + val mapMap: Map?>? = null, + val recursiveClassMap: Map? = null ) { companion object { fun fromList(pigeonVar_list: List): AllNullableTypes { val aNullableBool = pigeonVar_list[0] as Boolean? - val aNullableInt = - pigeonVar_list[1].let { num -> if (num is Int) num.toLong() else num as Long? } - val aNullableInt64 = - pigeonVar_list[2].let { num -> if (num is Int) num.toLong() else num as Long? } + val aNullableInt = pigeonVar_list[1] as Long? + val aNullableInt64 = pigeonVar_list[2] as Long? val aNullableDouble = pigeonVar_list[3] as Double? val aNullableByteArray = pigeonVar_list[4] as ByteArray? val aNullable4ByteArray = pigeonVar_list[5] as IntArray? val aNullable8ByteArray = pigeonVar_list[6] as LongArray? val aNullableFloatArray = pigeonVar_list[7] as DoubleArray? - val nullableNestedList = pigeonVar_list[8] as List?>? - val nullableMapWithAnnotations = pigeonVar_list[9] as Map? - val nullableMapWithObject = pigeonVar_list[10] as Map? - val aNullableEnum = pigeonVar_list[11] as AnEnum? - val anotherNullableEnum = pigeonVar_list[12] as AnotherEnum? - val aNullableString = pigeonVar_list[13] as String? - val aNullableObject = pigeonVar_list[14] - val allNullableTypes = pigeonVar_list[15] as AllNullableTypes? - val list = pigeonVar_list[16] as List? - val stringList = pigeonVar_list[17] as List? - val intList = pigeonVar_list[18] as List? - val doubleList = pigeonVar_list[19] as List? - val boolList = pigeonVar_list[20] as List? - val nestedClassList = pigeonVar_list[21] as List? - val map = pigeonVar_list[22] as Map? + val aNullableEnum = pigeonVar_list[8] as AnEnum? + val anotherNullableEnum = pigeonVar_list[9] as AnotherEnum? + val aNullableString = pigeonVar_list[10] as String? + val aNullableObject = pigeonVar_list[11] + val allNullableTypes = pigeonVar_list[12] as AllNullableTypes? + val list = pigeonVar_list[13] as List? + val stringList = pigeonVar_list[14] as List? + val intList = pigeonVar_list[15] as List? + val doubleList = pigeonVar_list[16] as List? + val boolList = pigeonVar_list[17] as List? + val enumList = pigeonVar_list[18] as List? + val objectList = pigeonVar_list[19] as List? + val listList = pigeonVar_list[20] as List?>? + val mapList = pigeonVar_list[21] as List?>? + val recursiveClassList = pigeonVar_list[22] as List? + val map = pigeonVar_list[23] as Map? + val stringMap = pigeonVar_list[24] as Map? + val intMap = pigeonVar_list[25] as Map? + val enumMap = pigeonVar_list[26] as Map? + val objectMap = pigeonVar_list[27] as Map? + val listMap = pigeonVar_list[28] as Map?>? + val mapMap = pigeonVar_list[29] as Map?>? + val recursiveClassMap = pigeonVar_list[30] as Map? return AllNullableTypes( aNullableBool, aNullableInt, @@ -217,9 +287,6 @@ data class AllNullableTypes( aNullable4ByteArray, aNullable8ByteArray, aNullableFloatArray, - nullableNestedList, - nullableMapWithAnnotations, - nullableMapWithObject, aNullableEnum, anotherNullableEnum, aNullableString, @@ -230,8 +297,19 @@ data class AllNullableTypes( intList, doubleList, boolList, - nestedClassList, - map) + enumList, + objectList, + listList, + mapList, + recursiveClassList, + map, + stringMap, + intMap, + enumMap, + objectMap, + listMap, + mapMap, + recursiveClassMap) } } @@ -245,9 +323,6 @@ data class AllNullableTypes( aNullable4ByteArray, aNullable8ByteArray, aNullableFloatArray, - nullableNestedList, - nullableMapWithAnnotations, - nullableMapWithObject, aNullableEnum, anotherNullableEnum, aNullableString, @@ -258,8 +333,19 @@ data class AllNullableTypes( intList, doubleList, boolList, - nestedClassList, + enumList, + objectList, + listList, + mapList, + recursiveClassList, map, + stringMap, + intMap, + enumMap, + objectMap, + listMap, + mapMap, + recursiveClassMap, ) } } @@ -279,9 +365,6 @@ data class AllNullableTypesWithoutRecursion( val aNullable4ByteArray: IntArray? = null, val aNullable8ByteArray: LongArray? = null, val aNullableFloatArray: DoubleArray? = null, - val nullableNestedList: List?>? = null, - val nullableMapWithAnnotations: Map? = null, - val nullableMapWithObject: Map? = null, val aNullableEnum: AnEnum? = null, val anotherNullableEnum: AnotherEnum? = null, val aNullableString: String? = null, @@ -291,33 +374,48 @@ data class AllNullableTypesWithoutRecursion( val intList: List? = null, val doubleList: List? = null, val boolList: List? = null, - val map: Map? = null + val enumList: List? = null, + val objectList: List? = null, + val listList: List?>? = null, + val mapList: List?>? = null, + val map: Map? = null, + val stringMap: Map? = null, + val intMap: Map? = null, + val enumMap: Map? = null, + val objectMap: Map? = null, + val listMap: Map?>? = null, + val mapMap: Map?>? = null ) { companion object { fun fromList(pigeonVar_list: List): AllNullableTypesWithoutRecursion { val aNullableBool = pigeonVar_list[0] as Boolean? - val aNullableInt = - pigeonVar_list[1].let { num -> if (num is Int) num.toLong() else num as Long? } - val aNullableInt64 = - pigeonVar_list[2].let { num -> if (num is Int) num.toLong() else num as Long? } + val aNullableInt = pigeonVar_list[1] as Long? + val aNullableInt64 = pigeonVar_list[2] as Long? val aNullableDouble = pigeonVar_list[3] as Double? val aNullableByteArray = pigeonVar_list[4] as ByteArray? val aNullable4ByteArray = pigeonVar_list[5] as IntArray? val aNullable8ByteArray = pigeonVar_list[6] as LongArray? val aNullableFloatArray = pigeonVar_list[7] as DoubleArray? - val nullableNestedList = pigeonVar_list[8] as List?>? - val nullableMapWithAnnotations = pigeonVar_list[9] as Map? - val nullableMapWithObject = pigeonVar_list[10] as Map? - val aNullableEnum = pigeonVar_list[11] as AnEnum? - val anotherNullableEnum = pigeonVar_list[12] as AnotherEnum? - val aNullableString = pigeonVar_list[13] as String? - val aNullableObject = pigeonVar_list[14] - val list = pigeonVar_list[15] as List? - val stringList = pigeonVar_list[16] as List? - val intList = pigeonVar_list[17] as List? - val doubleList = pigeonVar_list[18] as List? - val boolList = pigeonVar_list[19] as List? - val map = pigeonVar_list[20] as Map? + val aNullableEnum = pigeonVar_list[8] as AnEnum? + val anotherNullableEnum = pigeonVar_list[9] as AnotherEnum? + val aNullableString = pigeonVar_list[10] as String? + val aNullableObject = pigeonVar_list[11] + val list = pigeonVar_list[12] as List? + val stringList = pigeonVar_list[13] as List? + val intList = pigeonVar_list[14] as List? + val doubleList = pigeonVar_list[15] as List? + val boolList = pigeonVar_list[16] as List? + val enumList = pigeonVar_list[17] as List? + val objectList = pigeonVar_list[18] as List? + val listList = pigeonVar_list[19] as List?>? + val mapList = pigeonVar_list[20] as List?>? + val map = pigeonVar_list[21] as Map? + val stringMap = pigeonVar_list[22] as Map? + val intMap = pigeonVar_list[23] as Map? + val enumMap = pigeonVar_list[24] as Map? + val objectMap = pigeonVar_list[25] as Map? + val listMap = pigeonVar_list[26] as Map?>? + val mapMap = pigeonVar_list[27] as Map?>? return AllNullableTypesWithoutRecursion( aNullableBool, aNullableInt, @@ -327,9 +425,6 @@ data class AllNullableTypesWithoutRecursion( aNullable4ByteArray, aNullable8ByteArray, aNullableFloatArray, - nullableNestedList, - nullableMapWithAnnotations, - nullableMapWithObject, aNullableEnum, anotherNullableEnum, aNullableString, @@ -339,7 +434,17 @@ data class AllNullableTypesWithoutRecursion( intList, doubleList, boolList, - map) + enumList, + objectList, + listList, + mapList, + map, + stringMap, + intMap, + enumMap, + objectMap, + listMap, + mapMap) } } @@ -353,9 +458,6 @@ data class AllNullableTypesWithoutRecursion( aNullable4ByteArray, aNullable8ByteArray, aNullableFloatArray, - nullableNestedList, - nullableMapWithAnnotations, - nullableMapWithObject, aNullableEnum, anotherNullableEnum, aNullableString, @@ -365,7 +467,17 @@ data class AllNullableTypesWithoutRecursion( intList, doubleList, boolList, + enumList, + objectList, + listList, + mapList, map, + stringMap, + intMap, + enumMap, + objectMap, + listMap, + mapMap, ) } } @@ -382,14 +494,29 @@ data class AllNullableTypesWithoutRecursion( data class AllClassesWrapper( val allNullableTypes: AllNullableTypes, val allNullableTypesWithoutRecursion: AllNullableTypesWithoutRecursion? = null, - val allTypes: AllTypes? = null + val allTypes: AllTypes? = null, + val classList: List, + val nullableClassList: List? = null, + val classMap: Map, + val nullableClassMap: Map? = null ) { companion object { fun fromList(pigeonVar_list: List): AllClassesWrapper { val allNullableTypes = pigeonVar_list[0] as AllNullableTypes val allNullableTypesWithoutRecursion = pigeonVar_list[1] as AllNullableTypesWithoutRecursion? val allTypes = pigeonVar_list[2] as AllTypes? - return AllClassesWrapper(allNullableTypes, allNullableTypesWithoutRecursion, allTypes) + val classList = pigeonVar_list[3] as List + val nullableClassList = pigeonVar_list[4] as List? + val classMap = pigeonVar_list[5] as Map + val nullableClassMap = pigeonVar_list[6] as Map? + return AllClassesWrapper( + allNullableTypes, + allNullableTypesWithoutRecursion, + allTypes, + classList, + nullableClassList, + classMap, + nullableClassMap) } } @@ -398,6 +525,10 @@ data class AllClassesWrapper( allNullableTypes, allNullableTypesWithoutRecursion, allTypes, + classList, + nullableClassList, + classMap, + nullableClassMap, ) } } @@ -422,30 +553,33 @@ data class TestMessage(val testList: List? = null) { } } -private object CoreTestsPigeonCodec : StandardMessageCodec() { +private open class CoreTestsPigeonCodec : StandardMessageCodec() { override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { return when (type) { 129.toByte() -> { - return (readValue(buffer) as Int?)?.let { AnEnum.ofRaw(it) } + return (readValue(buffer) as Long?)?.let { AnEnum.ofRaw(it.toInt()) } } 130.toByte() -> { - return (readValue(buffer) as Int?)?.let { AnotherEnum.ofRaw(it) } + return (readValue(buffer) as Long?)?.let { AnotherEnum.ofRaw(it.toInt()) } } 131.toByte() -> { - return (readValue(buffer) as? List)?.let { AllTypes.fromList(it) } + return (readValue(buffer) as? List)?.let { UnusedClass.fromList(it) } } 132.toByte() -> { - return (readValue(buffer) as? List)?.let { AllNullableTypes.fromList(it) } + return (readValue(buffer) as? List)?.let { AllTypes.fromList(it) } } 133.toByte() -> { + return (readValue(buffer) as? List)?.let { AllNullableTypes.fromList(it) } + } + 134.toByte() -> { return (readValue(buffer) as? List)?.let { AllNullableTypesWithoutRecursion.fromList(it) } } - 134.toByte() -> { + 135.toByte() -> { return (readValue(buffer) as? List)?.let { AllClassesWrapper.fromList(it) } } - 135.toByte() -> { + 136.toByte() -> { return (readValue(buffer) as? List)?.let { TestMessage.fromList(it) } } else -> super.readValueOfType(type, buffer) @@ -462,26 +596,30 @@ private object CoreTestsPigeonCodec : StandardMessageCodec() { stream.write(130) writeValue(stream, value.raw) } - is AllTypes -> { + is UnusedClass -> { stream.write(131) writeValue(stream, value.toList()) } - is AllNullableTypes -> { + is AllTypes -> { stream.write(132) writeValue(stream, value.toList()) } - is AllNullableTypesWithoutRecursion -> { + is AllNullableTypes -> { stream.write(133) writeValue(stream, value.toList()) } - is AllClassesWrapper -> { + is AllNullableTypesWithoutRecursion -> { stream.write(134) writeValue(stream, value.toList()) } - is TestMessage -> { + is AllClassesWrapper -> { stream.write(135) writeValue(stream, value.toList()) } + is TestMessage -> { + stream.write(136) + writeValue(stream, value.toList()) + } else -> super.writeValue(stream, value) } } @@ -518,9 +656,33 @@ interface HostIntegrationCoreApi { fun echoObject(anObject: Any): Any /** Returns the passed list, to test serialization and deserialization. */ fun echoList(list: List): List + /** Returns the passed list, to test serialization and deserialization. */ + fun echoEnumList(enumList: List): List + /** Returns the passed list, to test serialization and deserialization. */ + fun echoClassList(classList: List): List + /** Returns the passed list, to test serialization and deserialization. */ + fun echoNonNullEnumList(enumList: List): List + /** Returns the passed list, to test serialization and deserialization. */ + fun echoNonNullClassList(classList: List): List + /** Returns the passed map, to test serialization and deserialization. */ + fun echoMap(map: Map): Map + /** Returns the passed map, to test serialization and deserialization. */ + fun echoStringMap(stringMap: Map): Map + /** Returns the passed map, to test serialization and deserialization. */ + fun echoIntMap(intMap: Map): Map + /** Returns the passed map, to test serialization and deserialization. */ + fun echoEnumMap(enumMap: Map): Map /** Returns the passed map, to test serialization and deserialization. */ - fun echoMap(aMap: Map): Map - /** Returns the passed map to test nested class serialization and deserialization. */ + fun echoClassMap(classMap: Map): Map + /** Returns the passed map, to test serialization and deserialization. */ + fun echoNonNullStringMap(stringMap: Map): Map + /** Returns the passed map, to test serialization and deserialization. */ + fun echoNonNullIntMap(intMap: Map): Map + /** Returns the passed map, to test serialization and deserialization. */ + fun echoNonNullEnumMap(enumMap: Map): Map + /** Returns the passed map, to test serialization and deserialization. */ + fun echoNonNullClassMap(classMap: Map): Map + /** Returns the passed class to test nested class serialization and deserialization. */ fun echoClassWrapper(wrapper: AllClassesWrapper): AllClassesWrapper /** Returns the passed enum to test serialization and deserialization. */ fun echoEnum(anEnum: AnEnum): AnEnum @@ -572,8 +734,34 @@ interface HostIntegrationCoreApi { fun echoNullableObject(aNullableObject: Any?): Any? /** Returns the passed list, to test serialization and deserialization. */ fun echoNullableList(aNullableList: List?): List? + /** Returns the passed list, to test serialization and deserialization. */ + fun echoNullableEnumList(enumList: List?): List? + /** Returns the passed list, to test serialization and deserialization. */ + fun echoNullableClassList(classList: List?): List? + /** Returns the passed list, to test serialization and deserialization. */ + fun echoNullableNonNullEnumList(enumList: List?): List? + /** Returns the passed list, to test serialization and deserialization. */ + fun echoNullableNonNullClassList(classList: List?): List? /** Returns the passed map, to test serialization and deserialization. */ - fun echoNullableMap(aNullableMap: Map?): Map? + fun echoNullableMap(map: Map?): Map? + /** Returns the passed map, to test serialization and deserialization. */ + fun echoNullableStringMap(stringMap: Map?): Map? + /** Returns the passed map, to test serialization and deserialization. */ + fun echoNullableIntMap(intMap: Map?): Map? + /** Returns the passed map, to test serialization and deserialization. */ + fun echoNullableEnumMap(enumMap: Map?): Map? + /** Returns the passed map, to test serialization and deserialization. */ + fun echoNullableClassMap(classMap: Map?): Map? + /** Returns the passed map, to test serialization and deserialization. */ + fun echoNullableNonNullStringMap(stringMap: Map?): Map? + /** Returns the passed map, to test serialization and deserialization. */ + fun echoNullableNonNullIntMap(intMap: Map?): Map? + /** Returns the passed map, to test serialization and deserialization. */ + fun echoNullableNonNullEnumMap(enumMap: Map?): Map? + /** Returns the passed map, to test serialization and deserialization. */ + fun echoNullableNonNullClassMap( + classMap: Map? + ): Map? fun echoNullableEnum(anEnum: AnEnum?): AnEnum? @@ -601,8 +789,32 @@ interface HostIntegrationCoreApi { fun echoAsyncObject(anObject: Any, callback: (Result) -> Unit) /** Returns the passed list, to test asynchronous serialization and deserialization. */ fun echoAsyncList(list: List, callback: (Result>) -> Unit) + /** Returns the passed list, to test asynchronous serialization and deserialization. */ + fun echoAsyncEnumList(enumList: List, callback: (Result>) -> Unit) + /** Returns the passed list, to test asynchronous serialization and deserialization. */ + fun echoAsyncClassList( + classList: List, + callback: (Result>) -> Unit + ) + /** Returns the passed map, to test asynchronous serialization and deserialization. */ + fun echoAsyncMap(map: Map, callback: (Result>) -> Unit) + /** Returns the passed map, to test asynchronous serialization and deserialization. */ + fun echoAsyncStringMap( + stringMap: Map, + callback: (Result>) -> Unit + ) + /** Returns the passed map, to test asynchronous serialization and deserialization. */ + fun echoAsyncIntMap(intMap: Map, callback: (Result>) -> Unit) + /** Returns the passed map, to test asynchronous serialization and deserialization. */ + fun echoAsyncEnumMap( + enumMap: Map, + callback: (Result>) -> Unit + ) /** Returns the passed map, to test asynchronous serialization and deserialization. */ - fun echoAsyncMap(aMap: Map, callback: (Result>) -> Unit) + fun echoAsyncClassMap( + classMap: Map, + callback: (Result>) -> Unit + ) /** Returns the passed enum, to test asynchronous serialization and deserialization. */ fun echoAsyncEnum(anEnum: AnEnum, callback: (Result) -> Unit) /** Returns the passed enum, to test asynchronous serialization and deserialization. */ @@ -639,10 +851,37 @@ interface HostIntegrationCoreApi { fun echoAsyncNullableObject(anObject: Any?, callback: (Result) -> Unit) /** Returns the passed list, to test asynchronous serialization and deserialization. */ fun echoAsyncNullableList(list: List?, callback: (Result?>) -> Unit) + /** Returns the passed list, to test asynchronous serialization and deserialization. */ + fun echoAsyncNullableEnumList( + enumList: List?, + callback: (Result?>) -> Unit + ) + /** Returns the passed list, to test asynchronous serialization and deserialization. */ + fun echoAsyncNullableClassList( + classList: List?, + callback: (Result?>) -> Unit + ) + /** Returns the passed map, to test asynchronous serialization and deserialization. */ + fun echoAsyncNullableMap(map: Map?, callback: (Result?>) -> Unit) + /** Returns the passed map, to test asynchronous serialization and deserialization. */ + fun echoAsyncNullableStringMap( + stringMap: Map?, + callback: (Result?>) -> Unit + ) + /** Returns the passed map, to test asynchronous serialization and deserialization. */ + fun echoAsyncNullableIntMap( + intMap: Map?, + callback: (Result?>) -> Unit + ) + /** Returns the passed map, to test asynchronous serialization and deserialization. */ + fun echoAsyncNullableEnumMap( + enumMap: Map?, + callback: (Result?>) -> Unit + ) /** Returns the passed map, to test asynchronous serialization and deserialization. */ - fun echoAsyncNullableMap( - aMap: Map?, - callback: (Result?>) -> Unit + fun echoAsyncNullableClassMap( + classMap: Map?, + callback: (Result?>) -> Unit ) /** Returns the passed enum, to test asynchronous serialization and deserialization. */ fun echoAsyncNullableEnum(anEnum: AnEnum?, callback: (Result) -> Unit) @@ -696,7 +935,64 @@ interface HostIntegrationCoreApi { fun callFlutterEchoList(list: List, callback: (Result>) -> Unit) - fun callFlutterEchoMap(aMap: Map, callback: (Result>) -> Unit) + fun callFlutterEchoEnumList(enumList: List, callback: (Result>) -> Unit) + + fun callFlutterEchoClassList( + classList: List, + callback: (Result>) -> Unit + ) + + fun callFlutterEchoNonNullEnumList( + enumList: List, + callback: (Result>) -> Unit + ) + + fun callFlutterEchoNonNullClassList( + classList: List, + callback: (Result>) -> Unit + ) + + fun callFlutterEchoMap(map: Map, callback: (Result>) -> Unit) + + fun callFlutterEchoStringMap( + stringMap: Map, + callback: (Result>) -> Unit + ) + + fun callFlutterEchoIntMap( + intMap: Map, + callback: (Result>) -> Unit + ) + + fun callFlutterEchoEnumMap( + enumMap: Map, + callback: (Result>) -> Unit + ) + + fun callFlutterEchoClassMap( + classMap: Map, + callback: (Result>) -> Unit + ) + + fun callFlutterEchoNonNullStringMap( + stringMap: Map, + callback: (Result>) -> Unit + ) + + fun callFlutterEchoNonNullIntMap( + intMap: Map, + callback: (Result>) -> Unit + ) + + fun callFlutterEchoNonNullEnumMap( + enumMap: Map, + callback: (Result>) -> Unit + ) + + fun callFlutterEchoNonNullClassMap( + classMap: Map, + callback: (Result>) -> Unit + ) fun callFlutterEchoEnum(anEnum: AnEnum, callback: (Result) -> Unit) @@ -714,9 +1010,69 @@ interface HostIntegrationCoreApi { fun callFlutterEchoNullableList(list: List?, callback: (Result?>) -> Unit) + fun callFlutterEchoNullableEnumList( + enumList: List?, + callback: (Result?>) -> Unit + ) + + fun callFlutterEchoNullableClassList( + classList: List?, + callback: (Result?>) -> Unit + ) + + fun callFlutterEchoNullableNonNullEnumList( + enumList: List?, + callback: (Result?>) -> Unit + ) + + fun callFlutterEchoNullableNonNullClassList( + classList: List?, + callback: (Result?>) -> Unit + ) + fun callFlutterEchoNullableMap( - aMap: Map?, - callback: (Result?>) -> Unit + map: Map?, + callback: (Result?>) -> Unit + ) + + fun callFlutterEchoNullableStringMap( + stringMap: Map?, + callback: (Result?>) -> Unit + ) + + fun callFlutterEchoNullableIntMap( + intMap: Map?, + callback: (Result?>) -> Unit + ) + + fun callFlutterEchoNullableEnumMap( + enumMap: Map?, + callback: (Result?>) -> Unit + ) + + fun callFlutterEchoNullableClassMap( + classMap: Map?, + callback: (Result?>) -> Unit + ) + + fun callFlutterEchoNullableNonNullStringMap( + stringMap: Map?, + callback: (Result?>) -> Unit + ) + + fun callFlutterEchoNullableNonNullIntMap( + intMap: Map?, + callback: (Result?>) -> Unit + ) + + fun callFlutterEchoNullableNonNullEnumMap( + enumMap: Map?, + callback: (Result?>) -> Unit + ) + + fun callFlutterEchoNullableNonNullClassMap( + classMap: Map?, + callback: (Result?>) -> Unit ) fun callFlutterEchoNullableEnum(anEnum: AnEnum?, callback: (Result) -> Unit) @@ -730,7 +1086,7 @@ interface HostIntegrationCoreApi { companion object { /** The codec used by HostIntegrationCoreApi. */ - val codec: MessageCodec by lazy { CoreTestsPigeonCodec } + val codec: MessageCodec by lazy { CoreTestsPigeonCodec() } /** * Sets up an instance of `HostIntegrationCoreApi` to handle messages through the * `binaryMessenger`. @@ -856,7 +1212,7 @@ interface HostIntegrationCoreApi { if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val anIntArg = args[0].let { num -> if (num is Int) num.toLong() else num as Long } + val anIntArg = args[0] as Long val wrapped: List = try { listOf(api.echoInt(anIntArg)) @@ -1005,15 +1361,15 @@ interface HostIntegrationCoreApi { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoMap$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoEnumList$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val aMapArg = args[0] as Map + val enumListArg = args[0] as List val wrapped: List = try { - listOf(api.echoMap(aMapArg)) + listOf(api.echoEnumList(enumListArg)) } catch (exception: Throwable) { wrapError(exception) } @@ -1027,15 +1383,15 @@ interface HostIntegrationCoreApi { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoClassWrapper$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoClassList$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val wrapperArg = args[0] as AllClassesWrapper + val classListArg = args[0] as List val wrapped: List = try { - listOf(api.echoClassWrapper(wrapperArg)) + listOf(api.echoClassList(classListArg)) } catch (exception: Throwable) { wrapError(exception) } @@ -1049,15 +1405,15 @@ interface HostIntegrationCoreApi { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoEnum$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNonNullEnumList$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val anEnumArg = args[0] as AnEnum + val enumListArg = args[0] as List val wrapped: List = try { - listOf(api.echoEnum(anEnumArg)) + listOf(api.echoNonNullEnumList(enumListArg)) } catch (exception: Throwable) { wrapError(exception) } @@ -1071,15 +1427,15 @@ interface HostIntegrationCoreApi { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAnotherEnum$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNonNullClassList$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val anotherEnumArg = args[0] as AnotherEnum + val classListArg = args[0] as List val wrapped: List = try { - listOf(api.echoAnotherEnum(anotherEnumArg)) + listOf(api.echoNonNullClassList(classListArg)) } catch (exception: Throwable) { wrapError(exception) } @@ -1093,15 +1449,15 @@ interface HostIntegrationCoreApi { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNamedDefaultString$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoMap$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val aStringArg = args[0] as String + val mapArg = args[0] as Map val wrapped: List = try { - listOf(api.echoNamedDefaultString(aStringArg)) + listOf(api.echoMap(mapArg)) } catch (exception: Throwable) { wrapError(exception) } @@ -1115,15 +1471,15 @@ interface HostIntegrationCoreApi { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoOptionalDefaultDouble$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoStringMap$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val aDoubleArg = args[0] as Double + val stringMapArg = args[0] as Map val wrapped: List = try { - listOf(api.echoOptionalDefaultDouble(aDoubleArg)) + listOf(api.echoStringMap(stringMapArg)) } catch (exception: Throwable) { wrapError(exception) } @@ -1137,15 +1493,15 @@ interface HostIntegrationCoreApi { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoRequiredInt$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoIntMap$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val anIntArg = args[0].let { num -> if (num is Int) num.toLong() else num as Long } + val intMapArg = args[0] as Map val wrapped: List = try { - listOf(api.echoRequiredInt(anIntArg)) + listOf(api.echoIntMap(intMapArg)) } catch (exception: Throwable) { wrapError(exception) } @@ -1159,15 +1515,15 @@ interface HostIntegrationCoreApi { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllNullableTypes$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoEnumMap$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val everythingArg = args[0] as AllNullableTypes? + val enumMapArg = args[0] as Map val wrapped: List = try { - listOf(api.echoAllNullableTypes(everythingArg)) + listOf(api.echoEnumMap(enumMapArg)) } catch (exception: Throwable) { wrapError(exception) } @@ -1181,15 +1537,15 @@ interface HostIntegrationCoreApi { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllNullableTypesWithoutRecursion$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoClassMap$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val everythingArg = args[0] as AllNullableTypesWithoutRecursion? + val classMapArg = args[0] as Map val wrapped: List = try { - listOf(api.echoAllNullableTypesWithoutRecursion(everythingArg)) + listOf(api.echoClassMap(classMapArg)) } catch (exception: Throwable) { wrapError(exception) } @@ -1203,15 +1559,15 @@ interface HostIntegrationCoreApi { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.extractNestedNullableString$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNonNullStringMap$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val wrapperArg = args[0] as AllClassesWrapper + val stringMapArg = args[0] as Map val wrapped: List = try { - listOf(api.extractNestedNullableString(wrapperArg)) + listOf(api.echoNonNullStringMap(stringMapArg)) } catch (exception: Throwable) { wrapError(exception) } @@ -1225,15 +1581,15 @@ interface HostIntegrationCoreApi { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.createNestedNullableString$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNonNullIntMap$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val nullableStringArg = args[0] as String? + val intMapArg = args[0] as Map val wrapped: List = try { - listOf(api.createNestedNullableString(nullableStringArg)) + listOf(api.echoNonNullIntMap(intMapArg)) } catch (exception: Throwable) { wrapError(exception) } @@ -1247,20 +1603,15 @@ interface HostIntegrationCoreApi { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.sendMultipleNullableTypes$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNonNullEnumMap$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val aNullableBoolArg = args[0] as Boolean? - val aNullableIntArg = - args[1].let { num -> if (num is Int) num.toLong() else num as Long? } - val aNullableStringArg = args[2] as String? + val enumMapArg = args[0] as Map val wrapped: List = try { - listOf( - api.sendMultipleNullableTypes( - aNullableBoolArg, aNullableIntArg, aNullableStringArg)) + listOf(api.echoNonNullEnumMap(enumMapArg)) } catch (exception: Throwable) { wrapError(exception) } @@ -1274,20 +1625,15 @@ interface HostIntegrationCoreApi { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNonNullClassMap$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val aNullableBoolArg = args[0] as Boolean? - val aNullableIntArg = - args[1].let { num -> if (num is Int) num.toLong() else num as Long? } - val aNullableStringArg = args[2] as String? + val classMapArg = args[0] as Map val wrapped: List = try { - listOf( - api.sendMultipleNullableTypesWithoutRecursion( - aNullableBoolArg, aNullableIntArg, aNullableStringArg)) + listOf(api.echoNonNullClassMap(classMapArg)) } catch (exception: Throwable) { wrapError(exception) } @@ -1301,16 +1647,15 @@ interface HostIntegrationCoreApi { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableInt$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoClassWrapper$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val aNullableIntArg = - args[0].let { num -> if (num is Int) num.toLong() else num as Long? } + val wrapperArg = args[0] as AllClassesWrapper val wrapped: List = try { - listOf(api.echoNullableInt(aNullableIntArg)) + listOf(api.echoClassWrapper(wrapperArg)) } catch (exception: Throwable) { wrapError(exception) } @@ -1324,15 +1669,15 @@ interface HostIntegrationCoreApi { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableDouble$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoEnum$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val aNullableDoubleArg = args[0] as Double? + val anEnumArg = args[0] as AnEnum val wrapped: List = try { - listOf(api.echoNullableDouble(aNullableDoubleArg)) + listOf(api.echoEnum(anEnumArg)) } catch (exception: Throwable) { wrapError(exception) } @@ -1346,15 +1691,15 @@ interface HostIntegrationCoreApi { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableBool$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAnotherEnum$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val aNullableBoolArg = args[0] as Boolean? + val anotherEnumArg = args[0] as AnotherEnum val wrapped: List = try { - listOf(api.echoNullableBool(aNullableBoolArg)) + listOf(api.echoAnotherEnum(anotherEnumArg)) } catch (exception: Throwable) { wrapError(exception) } @@ -1368,15 +1713,15 @@ interface HostIntegrationCoreApi { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableString$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNamedDefaultString$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val aNullableStringArg = args[0] as String? + val aStringArg = args[0] as String val wrapped: List = try { - listOf(api.echoNullableString(aNullableStringArg)) + listOf(api.echoNamedDefaultString(aStringArg)) } catch (exception: Throwable) { wrapError(exception) } @@ -1390,15 +1735,15 @@ interface HostIntegrationCoreApi { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableUint8List$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoOptionalDefaultDouble$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val aNullableUint8ListArg = args[0] as ByteArray? + val aDoubleArg = args[0] as Double val wrapped: List = try { - listOf(api.echoNullableUint8List(aNullableUint8ListArg)) + listOf(api.echoOptionalDefaultDouble(aDoubleArg)) } catch (exception: Throwable) { wrapError(exception) } @@ -1412,15 +1757,15 @@ interface HostIntegrationCoreApi { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableObject$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoRequiredInt$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val aNullableObjectArg = args[0] + val anIntArg = args[0] as Long val wrapped: List = try { - listOf(api.echoNullableObject(aNullableObjectArg)) + listOf(api.echoRequiredInt(anIntArg)) } catch (exception: Throwable) { wrapError(exception) } @@ -1434,15 +1779,15 @@ interface HostIntegrationCoreApi { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableList$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllNullableTypes$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val aNullableListArg = args[0] as List? + val everythingArg = args[0] as AllNullableTypes? val wrapped: List = try { - listOf(api.echoNullableList(aNullableListArg)) + listOf(api.echoAllNullableTypes(everythingArg)) } catch (exception: Throwable) { wrapError(exception) } @@ -1456,15 +1801,15 @@ interface HostIntegrationCoreApi { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableMap$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllNullableTypesWithoutRecursion$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val aNullableMapArg = args[0] as Map? + val everythingArg = args[0] as AllNullableTypesWithoutRecursion? val wrapped: List = try { - listOf(api.echoNullableMap(aNullableMapArg)) + listOf(api.echoAllNullableTypesWithoutRecursion(everythingArg)) } catch (exception: Throwable) { wrapError(exception) } @@ -1478,15 +1823,15 @@ interface HostIntegrationCoreApi { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableEnum$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.extractNestedNullableString$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val anEnumArg = args[0] as AnEnum? + val wrapperArg = args[0] as AllClassesWrapper val wrapped: List = try { - listOf(api.echoNullableEnum(anEnumArg)) + listOf(api.extractNestedNullableString(wrapperArg)) } catch (exception: Throwable) { wrapError(exception) } @@ -1500,15 +1845,15 @@ interface HostIntegrationCoreApi { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAnotherNullableEnum$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.createNestedNullableString$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val anotherEnumArg = args[0] as AnotherEnum? + val nullableStringArg = args[0] as String? val wrapped: List = try { - listOf(api.echoAnotherNullableEnum(anotherEnumArg)) + listOf(api.createNestedNullableString(nullableStringArg)) } catch (exception: Throwable) { wrapError(exception) } @@ -1522,16 +1867,19 @@ interface HostIntegrationCoreApi { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoOptionalNullableInt$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.sendMultipleNullableTypes$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val aNullableIntArg = - args[0].let { num -> if (num is Int) num.toLong() else num as Long? } + val aNullableBoolArg = args[0] as Boolean? + val aNullableIntArg = args[1] as Long? + val aNullableStringArg = args[2] as String? val wrapped: List = try { - listOf(api.echoOptionalNullableInt(aNullableIntArg)) + listOf( + api.sendMultipleNullableTypes( + aNullableBoolArg, aNullableIntArg, aNullableStringArg)) } catch (exception: Throwable) { wrapError(exception) } @@ -1545,15 +1893,19 @@ interface HostIntegrationCoreApi { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNamedNullableString$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val aNullableStringArg = args[0] as String? + val aNullableBoolArg = args[0] as Boolean? + val aNullableIntArg = args[1] as Long? + val aNullableStringArg = args[2] as String? val wrapped: List = try { - listOf(api.echoNamedNullableString(aNullableStringArg)) + listOf( + api.sendMultipleNullableTypesWithoutRecursion( + aNullableBoolArg, aNullableIntArg, aNullableStringArg)) } catch (exception: Throwable) { wrapError(exception) } @@ -1567,42 +1919,41 @@ interface HostIntegrationCoreApi { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.noopAsync$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableInt$separatedMessageChannelSuffix", codec) if (api != null) { - channel.setMessageHandler { _, reply -> - api.noopAsync { result: Result -> - val error = result.exceptionOrNull() - if (error != null) { - reply.reply(wrapError(error)) - } else { - reply.reply(wrapResult(null)) - } - } - } - } else { - channel.setMessageHandler(null) - } - } + channel.setMessageHandler { message, reply -> + val args = message as List + val aNullableIntArg = args[0] as Long? + val wrapped: List = + try { + listOf(api.echoNullableInt(aNullableIntArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } run { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncInt$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableDouble$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val anIntArg = args[0].let { num -> if (num is Int) num.toLong() else num as Long } - api.echoAsyncInt(anIntArg) { result: Result -> - val error = result.exceptionOrNull() - if (error != null) { - reply.reply(wrapError(error)) - } else { - val data = result.getOrNull() - reply.reply(wrapResult(data)) - } - } + val aNullableDoubleArg = args[0] as Double? + val wrapped: List = + try { + listOf(api.echoNullableDouble(aNullableDoubleArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) } } else { channel.setMessageHandler(null) @@ -1612,21 +1963,19 @@ interface HostIntegrationCoreApi { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncDouble$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableBool$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val aDoubleArg = args[0] as Double - api.echoAsyncDouble(aDoubleArg) { result: Result -> - val error = result.exceptionOrNull() - if (error != null) { - reply.reply(wrapError(error)) - } else { - val data = result.getOrNull() - reply.reply(wrapResult(data)) - } - } + val aNullableBoolArg = args[0] as Boolean? + val wrapped: List = + try { + listOf(api.echoNullableBool(aNullableBoolArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) } } else { channel.setMessageHandler(null) @@ -1636,21 +1985,19 @@ interface HostIntegrationCoreApi { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncBool$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableString$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val aBoolArg = args[0] as Boolean - api.echoAsyncBool(aBoolArg) { result: Result -> - val error = result.exceptionOrNull() - if (error != null) { - reply.reply(wrapError(error)) - } else { - val data = result.getOrNull() - reply.reply(wrapResult(data)) - } - } + val aNullableStringArg = args[0] as String? + val wrapped: List = + try { + listOf(api.echoNullableString(aNullableStringArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) } } else { channel.setMessageHandler(null) @@ -1660,21 +2007,19 @@ interface HostIntegrationCoreApi { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncString$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableUint8List$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val aStringArg = args[0] as String - api.echoAsyncString(aStringArg) { result: Result -> - val error = result.exceptionOrNull() - if (error != null) { - reply.reply(wrapError(error)) - } else { - val data = result.getOrNull() - reply.reply(wrapResult(data)) - } - } + val aNullableUint8ListArg = args[0] as ByteArray? + val wrapped: List = + try { + listOf(api.echoNullableUint8List(aNullableUint8ListArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) } } else { channel.setMessageHandler(null) @@ -1684,21 +2029,19 @@ interface HostIntegrationCoreApi { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncUint8List$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableObject$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val aUint8ListArg = args[0] as ByteArray - api.echoAsyncUint8List(aUint8ListArg) { result: Result -> - val error = result.exceptionOrNull() - if (error != null) { - reply.reply(wrapError(error)) - } else { - val data = result.getOrNull() - reply.reply(wrapResult(data)) - } - } + val aNullableObjectArg = args[0] + val wrapped: List = + try { + listOf(api.echoNullableObject(aNullableObjectArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) } } else { channel.setMessageHandler(null) @@ -1708,21 +2051,19 @@ interface HostIntegrationCoreApi { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncObject$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableList$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val anObjectArg = args[0] as Any - api.echoAsyncObject(anObjectArg) { result: Result -> - val error = result.exceptionOrNull() - if (error != null) { - reply.reply(wrapError(error)) - } else { - val data = result.getOrNull() - reply.reply(wrapResult(data)) - } - } + val aNullableListArg = args[0] as List? + val wrapped: List = + try { + listOf(api.echoNullableList(aNullableListArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) } } else { channel.setMessageHandler(null) @@ -1732,21 +2073,19 @@ interface HostIntegrationCoreApi { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncList$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableEnumList$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val listArg = args[0] as List - api.echoAsyncList(listArg) { result: Result> -> - val error = result.exceptionOrNull() - if (error != null) { - reply.reply(wrapError(error)) - } else { - val data = result.getOrNull() - reply.reply(wrapResult(data)) - } - } + val enumListArg = args[0] as List? + val wrapped: List = + try { + listOf(api.echoNullableEnumList(enumListArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) } } else { channel.setMessageHandler(null) @@ -1756,21 +2095,19 @@ interface HostIntegrationCoreApi { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncMap$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableClassList$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val aMapArg = args[0] as Map - api.echoAsyncMap(aMapArg) { result: Result> -> - val error = result.exceptionOrNull() - if (error != null) { - reply.reply(wrapError(error)) - } else { - val data = result.getOrNull() - reply.reply(wrapResult(data)) - } - } + val classListArg = args[0] as List? + val wrapped: List = + try { + listOf(api.echoNullableClassList(classListArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) } } else { channel.setMessageHandler(null) @@ -1780,21 +2117,19 @@ interface HostIntegrationCoreApi { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncEnum$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableNonNullEnumList$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val anEnumArg = args[0] as AnEnum - api.echoAsyncEnum(anEnumArg) { result: Result -> - val error = result.exceptionOrNull() - if (error != null) { - reply.reply(wrapError(error)) - } else { - val data = result.getOrNull() - reply.reply(wrapResult(data)) - } - } + val enumListArg = args[0] as List? + val wrapped: List = + try { + listOf(api.echoNullableNonNullEnumList(enumListArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) } } else { channel.setMessageHandler(null) @@ -1804,21 +2139,19 @@ interface HostIntegrationCoreApi { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAnotherAsyncEnum$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableNonNullClassList$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val anotherEnumArg = args[0] as AnotherEnum - api.echoAnotherAsyncEnum(anotherEnumArg) { result: Result -> - val error = result.exceptionOrNull() - if (error != null) { - reply.reply(wrapError(error)) - } else { - val data = result.getOrNull() - reply.reply(wrapResult(data)) - } - } + val classListArg = args[0] as List? + val wrapped: List = + try { + listOf(api.echoNullableNonNullClassList(classListArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) } } else { channel.setMessageHandler(null) @@ -1828,19 +2161,19 @@ interface HostIntegrationCoreApi { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncError$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableMap$separatedMessageChannelSuffix", codec) if (api != null) { - channel.setMessageHandler { _, reply -> - api.throwAsyncError { result: Result -> - val error = result.exceptionOrNull() - if (error != null) { - reply.reply(wrapError(error)) - } else { - val data = result.getOrNull() - reply.reply(wrapResult(data)) - } - } + channel.setMessageHandler { message, reply -> + val args = message as List + val mapArg = args[0] as Map? + val wrapped: List = + try { + listOf(api.echoNullableMap(mapArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) } } else { channel.setMessageHandler(null) @@ -1850,18 +2183,19 @@ interface HostIntegrationCoreApi { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncErrorFromVoid$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableStringMap$separatedMessageChannelSuffix", codec) if (api != null) { - channel.setMessageHandler { _, reply -> - api.throwAsyncErrorFromVoid { result: Result -> - val error = result.exceptionOrNull() - if (error != null) { - reply.reply(wrapError(error)) - } else { - reply.reply(wrapResult(null)) - } - } + channel.setMessageHandler { message, reply -> + val args = message as List + val stringMapArg = args[0] as Map? + val wrapped: List = + try { + listOf(api.echoNullableStringMap(stringMapArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) } } else { channel.setMessageHandler(null) @@ -1871,19 +2205,19 @@ interface HostIntegrationCoreApi { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncFlutterError$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableIntMap$separatedMessageChannelSuffix", codec) if (api != null) { - channel.setMessageHandler { _, reply -> - api.throwAsyncFlutterError { result: Result -> - val error = result.exceptionOrNull() - if (error != null) { - reply.reply(wrapError(error)) - } else { - val data = result.getOrNull() - reply.reply(wrapResult(data)) - } - } + channel.setMessageHandler { message, reply -> + val args = message as List + val intMapArg = args[0] as Map? + val wrapped: List = + try { + listOf(api.echoNullableIntMap(intMapArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) } } else { channel.setMessageHandler(null) @@ -1893,21 +2227,19 @@ interface HostIntegrationCoreApi { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncAllTypes$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableEnumMap$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val everythingArg = args[0] as AllTypes - api.echoAsyncAllTypes(everythingArg) { result: Result -> - val error = result.exceptionOrNull() - if (error != null) { - reply.reply(wrapError(error)) - } else { - val data = result.getOrNull() - reply.reply(wrapResult(data)) - } - } + val enumMapArg = args[0] as Map? + val wrapped: List = + try { + listOf(api.echoNullableEnumMap(enumMapArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) } } else { channel.setMessageHandler(null) @@ -1917,22 +2249,19 @@ interface HostIntegrationCoreApi { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypes$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableClassMap$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val everythingArg = args[0] as AllNullableTypes? - api.echoAsyncNullableAllNullableTypes(everythingArg) { result: Result - -> - val error = result.exceptionOrNull() - if (error != null) { - reply.reply(wrapError(error)) - } else { - val data = result.getOrNull() - reply.reply(wrapResult(data)) - } - } + val classMapArg = args[0] as Map? + val wrapped: List = + try { + listOf(api.echoNullableClassMap(classMapArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) } } else { channel.setMessageHandler(null) @@ -1942,22 +2271,19 @@ interface HostIntegrationCoreApi { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypesWithoutRecursion$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableNonNullStringMap$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val everythingArg = args[0] as AllNullableTypesWithoutRecursion? - api.echoAsyncNullableAllNullableTypesWithoutRecursion(everythingArg) { - result: Result -> - val error = result.exceptionOrNull() - if (error != null) { - reply.reply(wrapError(error)) - } else { - val data = result.getOrNull() - reply.reply(wrapResult(data)) - } - } + val stringMapArg = args[0] as Map? + val wrapped: List = + try { + listOf(api.echoNullableNonNullStringMap(stringMapArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) } } else { channel.setMessageHandler(null) @@ -1967,21 +2293,19 @@ interface HostIntegrationCoreApi { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableInt$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableNonNullIntMap$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val anIntArg = args[0].let { num -> if (num is Int) num.toLong() else num as Long? } - api.echoAsyncNullableInt(anIntArg) { result: Result -> - val error = result.exceptionOrNull() - if (error != null) { - reply.reply(wrapError(error)) - } else { - val data = result.getOrNull() - reply.reply(wrapResult(data)) - } - } + val intMapArg = args[0] as Map? + val wrapped: List = + try { + listOf(api.echoNullableNonNullIntMap(intMapArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) } } else { channel.setMessageHandler(null) @@ -1991,21 +2315,19 @@ interface HostIntegrationCoreApi { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableDouble$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableNonNullEnumMap$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val aDoubleArg = args[0] as Double? - api.echoAsyncNullableDouble(aDoubleArg) { result: Result -> - val error = result.exceptionOrNull() - if (error != null) { - reply.reply(wrapError(error)) - } else { - val data = result.getOrNull() - reply.reply(wrapResult(data)) - } - } + val enumMapArg = args[0] as Map? + val wrapped: List = + try { + listOf(api.echoNullableNonNullEnumMap(enumMapArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) } } else { channel.setMessageHandler(null) @@ -2015,21 +2337,19 @@ interface HostIntegrationCoreApi { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableBool$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableNonNullClassMap$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val aBoolArg = args[0] as Boolean? - api.echoAsyncNullableBool(aBoolArg) { result: Result -> - val error = result.exceptionOrNull() - if (error != null) { - reply.reply(wrapError(error)) - } else { - val data = result.getOrNull() - reply.reply(wrapResult(data)) - } - } + val classMapArg = args[0] as Map? + val wrapped: List = + try { + listOf(api.echoNullableNonNullClassMap(classMapArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) } } else { channel.setMessageHandler(null) @@ -2039,21 +2359,19 @@ interface HostIntegrationCoreApi { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableString$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableEnum$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val aStringArg = args[0] as String? - api.echoAsyncNullableString(aStringArg) { result: Result -> - val error = result.exceptionOrNull() - if (error != null) { - reply.reply(wrapError(error)) - } else { - val data = result.getOrNull() - reply.reply(wrapResult(data)) - } - } + val anEnumArg = args[0] as AnEnum? + val wrapped: List = + try { + listOf(api.echoNullableEnum(anEnumArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) } } else { channel.setMessageHandler(null) @@ -2063,21 +2381,19 @@ interface HostIntegrationCoreApi { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableUint8List$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAnotherNullableEnum$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val aUint8ListArg = args[0] as ByteArray? - api.echoAsyncNullableUint8List(aUint8ListArg) { result: Result -> - val error = result.exceptionOrNull() - if (error != null) { - reply.reply(wrapError(error)) - } else { - val data = result.getOrNull() - reply.reply(wrapResult(data)) - } - } + val anotherEnumArg = args[0] as AnotherEnum? + val wrapped: List = + try { + listOf(api.echoAnotherNullableEnum(anotherEnumArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) } } else { channel.setMessageHandler(null) @@ -2087,19 +2403,60 @@ interface HostIntegrationCoreApi { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableObject$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoOptionalNullableInt$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val anObjectArg = args[0] - api.echoAsyncNullableObject(anObjectArg) { result: Result -> + val aNullableIntArg = args[0] as Long? + val wrapped: List = + try { + listOf(api.echoOptionalNullableInt(aNullableIntArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNamedNullableString$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val aNullableStringArg = args[0] as String? + val wrapped: List = + try { + listOf(api.echoNamedNullableString(aNullableStringArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.noopAsync$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { _, reply -> + api.noopAsync { result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) } else { - val data = result.getOrNull() - reply.reply(wrapResult(data)) + reply.reply(wrapResult(null)) } } } @@ -2111,13 +2468,13 @@ interface HostIntegrationCoreApi { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableList$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncInt$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val listArg = args[0] as List? - api.echoAsyncNullableList(listArg) { result: Result?> -> + val anIntArg = args[0] as Long + api.echoAsyncInt(anIntArg) { result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -2135,13 +2492,13 @@ interface HostIntegrationCoreApi { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableMap$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncDouble$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val aMapArg = args[0] as Map? - api.echoAsyncNullableMap(aMapArg) { result: Result?> -> + val aDoubleArg = args[0] as Double + api.echoAsyncDouble(aDoubleArg) { result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -2159,13 +2516,13 @@ interface HostIntegrationCoreApi { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableEnum$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncBool$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val anEnumArg = args[0] as AnEnum? - api.echoAsyncNullableEnum(anEnumArg) { result: Result -> + val aBoolArg = args[0] as Boolean + api.echoAsyncBool(aBoolArg) { result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -2183,13 +2540,13 @@ interface HostIntegrationCoreApi { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAnotherAsyncNullableEnum$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncString$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val anotherEnumArg = args[0] as AnotherEnum? - api.echoAnotherAsyncNullableEnum(anotherEnumArg) { result: Result -> + val aStringArg = args[0] as String + api.echoAsyncString(aStringArg) { result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -2207,16 +2564,19 @@ interface HostIntegrationCoreApi { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterNoop$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncUint8List$separatedMessageChannelSuffix", codec) if (api != null) { - channel.setMessageHandler { _, reply -> - api.callFlutterNoop { result: Result -> + channel.setMessageHandler { message, reply -> + val args = message as List + val aUint8ListArg = args[0] as ByteArray + api.echoAsyncUint8List(aUint8ListArg) { result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) } else { - reply.reply(wrapResult(null)) + val data = result.getOrNull() + reply.reply(wrapResult(data)) } } } @@ -2228,11 +2588,13 @@ interface HostIntegrationCoreApi { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterThrowError$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncObject$separatedMessageChannelSuffix", codec) if (api != null) { - channel.setMessageHandler { _, reply -> - api.callFlutterThrowError { result: Result -> + channel.setMessageHandler { message, reply -> + val args = message as List + val anObjectArg = args[0] as Any + api.echoAsyncObject(anObjectArg) { result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -2250,16 +2612,19 @@ interface HostIntegrationCoreApi { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterThrowErrorFromVoid$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncList$separatedMessageChannelSuffix", codec) if (api != null) { - channel.setMessageHandler { _, reply -> - api.callFlutterThrowErrorFromVoid { result: Result -> + channel.setMessageHandler { message, reply -> + val args = message as List + val listArg = args[0] as List + api.echoAsyncList(listArg) { result: Result> -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) } else { - reply.reply(wrapResult(null)) + val data = result.getOrNull() + reply.reply(wrapResult(data)) } } } @@ -2271,13 +2636,13 @@ interface HostIntegrationCoreApi { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllTypes$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncEnumList$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val everythingArg = args[0] as AllTypes - api.callFlutterEchoAllTypes(everythingArg) { result: Result -> + val enumListArg = args[0] as List + api.echoAsyncEnumList(enumListArg) { result: Result> -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -2295,14 +2660,13 @@ interface HostIntegrationCoreApi { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllNullableTypes$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncClassList$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val everythingArg = args[0] as AllNullableTypes? - api.callFlutterEchoAllNullableTypes(everythingArg) { result: Result - -> + val classListArg = args[0] as List + api.echoAsyncClassList(classListArg) { result: Result> -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -2320,26 +2684,21 @@ interface HostIntegrationCoreApi { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypes$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncMap$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val aNullableBoolArg = args[0] as Boolean? - val aNullableIntArg = - args[1].let { num -> if (num is Int) num.toLong() else num as Long? } - val aNullableStringArg = args[2] as String? - api.callFlutterSendMultipleNullableTypes( - aNullableBoolArg, aNullableIntArg, aNullableStringArg) { - result: Result -> - val error = result.exceptionOrNull() - if (error != null) { - reply.reply(wrapError(error)) - } else { - val data = result.getOrNull() - reply.reply(wrapResult(data)) - } - } + val mapArg = args[0] as Map + api.echoAsyncMap(mapArg) { result: Result> -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } } } else { channel.setMessageHandler(null) @@ -2349,14 +2708,13 @@ interface HostIntegrationCoreApi { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllNullableTypesWithoutRecursion$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncStringMap$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val everythingArg = args[0] as AllNullableTypesWithoutRecursion? - api.callFlutterEchoAllNullableTypesWithoutRecursion(everythingArg) { - result: Result -> + val stringMapArg = args[0] as Map + api.echoAsyncStringMap(stringMapArg) { result: Result> -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -2374,26 +2732,21 @@ interface HostIntegrationCoreApi { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypesWithoutRecursion$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncIntMap$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val aNullableBoolArg = args[0] as Boolean? - val aNullableIntArg = - args[1].let { num -> if (num is Int) num.toLong() else num as Long? } - val aNullableStringArg = args[2] as String? - api.callFlutterSendMultipleNullableTypesWithoutRecursion( - aNullableBoolArg, aNullableIntArg, aNullableStringArg) { - result: Result -> - val error = result.exceptionOrNull() - if (error != null) { - reply.reply(wrapError(error)) - } else { - val data = result.getOrNull() - reply.reply(wrapResult(data)) - } - } + val intMapArg = args[0] as Map + api.echoAsyncIntMap(intMapArg) { result: Result> -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } } } else { channel.setMessageHandler(null) @@ -2403,13 +2756,13 @@ interface HostIntegrationCoreApi { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoBool$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncEnumMap$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val aBoolArg = args[0] as Boolean - api.callFlutterEchoBool(aBoolArg) { result: Result -> + val enumMapArg = args[0] as Map + api.echoAsyncEnumMap(enumMapArg) { result: Result> -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -2427,13 +2780,13 @@ interface HostIntegrationCoreApi { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoInt$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncClassMap$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val anIntArg = args[0].let { num -> if (num is Int) num.toLong() else num as Long } - api.callFlutterEchoInt(anIntArg) { result: Result -> + val classMapArg = args[0] as Map + api.echoAsyncClassMap(classMapArg) { result: Result> -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -2451,13 +2804,13 @@ interface HostIntegrationCoreApi { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoDouble$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncEnum$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val aDoubleArg = args[0] as Double - api.callFlutterEchoDouble(aDoubleArg) { result: Result -> + val anEnumArg = args[0] as AnEnum + api.echoAsyncEnum(anEnumArg) { result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -2475,13 +2828,13 @@ interface HostIntegrationCoreApi { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoString$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAnotherAsyncEnum$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val aStringArg = args[0] as String - api.callFlutterEchoString(aStringArg) { result: Result -> + val anotherEnumArg = args[0] as AnotherEnum + api.echoAnotherAsyncEnum(anotherEnumArg) { result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -2499,13 +2852,78 @@ interface HostIntegrationCoreApi { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoUint8List$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncError$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { _, reply -> + api.throwAsyncError { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncErrorFromVoid$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { _, reply -> + api.throwAsyncErrorFromVoid { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + reply.reply(wrapResult(null)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncFlutterError$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { _, reply -> + api.throwAsyncFlutterError { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncAllTypes$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val listArg = args[0] as ByteArray - api.callFlutterEchoUint8List(listArg) { result: Result -> + val everythingArg = args[0] as AllTypes + api.echoAsyncAllTypes(everythingArg) { result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -2523,13 +2941,14 @@ interface HostIntegrationCoreApi { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoList$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypes$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val listArg = args[0] as List - api.callFlutterEchoList(listArg) { result: Result> -> + val everythingArg = args[0] as AllNullableTypes? + api.echoAsyncNullableAllNullableTypes(everythingArg) { result: Result + -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -2547,13 +2966,14 @@ interface HostIntegrationCoreApi { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoMap$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypesWithoutRecursion$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val aMapArg = args[0] as Map - api.callFlutterEchoMap(aMapArg) { result: Result> -> + val everythingArg = args[0] as AllNullableTypesWithoutRecursion? + api.echoAsyncNullableAllNullableTypesWithoutRecursion(everythingArg) { + result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -2571,13 +2991,13 @@ interface HostIntegrationCoreApi { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoEnum$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableInt$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val anEnumArg = args[0] as AnEnum - api.callFlutterEchoEnum(anEnumArg) { result: Result -> + val anIntArg = args[0] as Long? + api.echoAsyncNullableInt(anIntArg) { result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -2595,13 +3015,13 @@ interface HostIntegrationCoreApi { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAnotherEnum$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableDouble$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val anotherEnumArg = args[0] as AnotherEnum - api.callFlutterEchoAnotherEnum(anotherEnumArg) { result: Result -> + val aDoubleArg = args[0] as Double? + api.echoAsyncNullableDouble(aDoubleArg) { result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -2619,13 +3039,13 @@ interface HostIntegrationCoreApi { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableBool$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableBool$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val aBoolArg = args[0] as Boolean? - api.callFlutterEchoNullableBool(aBoolArg) { result: Result -> + api.echoAsyncNullableBool(aBoolArg) { result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -2643,13 +3063,13 @@ interface HostIntegrationCoreApi { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableInt$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableString$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val anIntArg = args[0].let { num -> if (num is Int) num.toLong() else num as Long? } - api.callFlutterEchoNullableInt(anIntArg) { result: Result -> + val aStringArg = args[0] as String? + api.echoAsyncNullableString(aStringArg) { result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -2667,13 +3087,13 @@ interface HostIntegrationCoreApi { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableDouble$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableUint8List$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val aDoubleArg = args[0] as Double? - api.callFlutterEchoNullableDouble(aDoubleArg) { result: Result -> + val aUint8ListArg = args[0] as ByteArray? + api.echoAsyncNullableUint8List(aUint8ListArg) { result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -2691,13 +3111,13 @@ interface HostIntegrationCoreApi { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableString$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableObject$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val aStringArg = args[0] as String? - api.callFlutterEchoNullableString(aStringArg) { result: Result -> + val anObjectArg = args[0] + api.echoAsyncNullableObject(anObjectArg) { result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -2715,13 +3135,13 @@ interface HostIntegrationCoreApi { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableUint8List$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableList$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val listArg = args[0] as ByteArray? - api.callFlutterEchoNullableUint8List(listArg) { result: Result -> + val listArg = args[0] as List? + api.echoAsyncNullableList(listArg) { result: Result?> -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -2739,13 +3159,13 @@ interface HostIntegrationCoreApi { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableList$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableEnumList$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val listArg = args[0] as List? - api.callFlutterEchoNullableList(listArg) { result: Result?> -> + val enumListArg = args[0] as List? + api.echoAsyncNullableEnumList(enumListArg) { result: Result?> -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -2763,13 +3183,14 @@ interface HostIntegrationCoreApi { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableMap$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableClassList$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val aMapArg = args[0] as Map? - api.callFlutterEchoNullableMap(aMapArg) { result: Result?> -> + val classListArg = args[0] as List? + api.echoAsyncNullableClassList(classListArg) { result: Result?> + -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -2787,13 +3208,13 @@ interface HostIntegrationCoreApi { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableEnum$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableMap$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val anEnumArg = args[0] as AnEnum? - api.callFlutterEchoNullableEnum(anEnumArg) { result: Result -> + val mapArg = args[0] as Map? + api.echoAsyncNullableMap(mapArg) { result: Result?> -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -2811,13 +3232,13 @@ interface HostIntegrationCoreApi { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAnotherNullableEnum$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableStringMap$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val anotherEnumArg = args[0] as AnotherEnum? - api.callFlutterEchoAnotherNullableEnum(anotherEnumArg) { result: Result -> + val stringMapArg = args[0] as Map? + api.echoAsyncNullableStringMap(stringMapArg) { result: Result?> -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -2835,13 +3256,13 @@ interface HostIntegrationCoreApi { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSmallApiEchoString$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableIntMap$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val aStringArg = args[0] as String - api.callFlutterSmallApiEchoString(aStringArg) { result: Result -> + val intMapArg = args[0] as Map? + api.echoAsyncNullableIntMap(intMapArg) { result: Result?> -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -2855,55 +3276,1556 @@ interface HostIntegrationCoreApi { channel.setMessageHandler(null) } } - } - } -} -/** - * The core interface that the Dart platform_test code implements for host integration tests to call - * into. - * - * Generated class from Pigeon that represents Flutter messages that can be called from Kotlin. - */ -class FlutterIntegrationCoreApi( - private val binaryMessenger: BinaryMessenger, - private val messageChannelSuffix: String = "" -) { - companion object { - /** The codec used by FlutterIntegrationCoreApi. */ - val codec: MessageCodec by lazy { CoreTestsPigeonCodec } - } - /** A no-op function taking no arguments and returning no value, to sanity test basic calling. */ - fun noop(callback: (Result) -> Unit) { - val separatedMessageChannelSuffix = - if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noop$separatedMessageChannelSuffix" - val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(null) { - if (it is List<*>) { - if (it.size > 1) { - callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableEnumMap$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val enumMapArg = args[0] as Map? + api.echoAsyncNullableEnumMap(enumMapArg) { result: Result?> -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } } else { - callback(Result.success(Unit)) + channel.setMessageHandler(null) } - } else { - callback(Result.failure(createConnectionError(channelName))) } - } - } - /** Responds with an error from an async function returning a value. */ - fun throwError(callback: (Result) -> Unit) { - val separatedMessageChannelSuffix = - if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwError$separatedMessageChannelSuffix" - val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(null) { - if (it is List<*>) { + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableClassMap$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val classMapArg = args[0] as Map? + api.echoAsyncNullableClassMap(classMapArg) { + result: Result?> -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableEnum$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val anEnumArg = args[0] as AnEnum? + api.echoAsyncNullableEnum(anEnumArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAnotherAsyncNullableEnum$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val anotherEnumArg = args[0] as AnotherEnum? + api.echoAnotherAsyncNullableEnum(anotherEnumArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterNoop$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { _, reply -> + api.callFlutterNoop { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + reply.reply(wrapResult(null)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterThrowError$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { _, reply -> + api.callFlutterThrowError { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterThrowErrorFromVoid$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { _, reply -> + api.callFlutterThrowErrorFromVoid { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + reply.reply(wrapResult(null)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllTypes$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val everythingArg = args[0] as AllTypes + api.callFlutterEchoAllTypes(everythingArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllNullableTypes$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val everythingArg = args[0] as AllNullableTypes? + api.callFlutterEchoAllNullableTypes(everythingArg) { result: Result + -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypes$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val aNullableBoolArg = args[0] as Boolean? + val aNullableIntArg = args[1] as Long? + val aNullableStringArg = args[2] as String? + api.callFlutterSendMultipleNullableTypes( + aNullableBoolArg, aNullableIntArg, aNullableStringArg) { + result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllNullableTypesWithoutRecursion$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val everythingArg = args[0] as AllNullableTypesWithoutRecursion? + api.callFlutterEchoAllNullableTypesWithoutRecursion(everythingArg) { + result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypesWithoutRecursion$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val aNullableBoolArg = args[0] as Boolean? + val aNullableIntArg = args[1] as Long? + val aNullableStringArg = args[2] as String? + api.callFlutterSendMultipleNullableTypesWithoutRecursion( + aNullableBoolArg, aNullableIntArg, aNullableStringArg) { + result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoBool$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val aBoolArg = args[0] as Boolean + api.callFlutterEchoBool(aBoolArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoInt$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val anIntArg = args[0] as Long + api.callFlutterEchoInt(anIntArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoDouble$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val aDoubleArg = args[0] as Double + api.callFlutterEchoDouble(aDoubleArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoString$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val aStringArg = args[0] as String + api.callFlutterEchoString(aStringArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoUint8List$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val listArg = args[0] as ByteArray + api.callFlutterEchoUint8List(listArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoList$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val listArg = args[0] as List + api.callFlutterEchoList(listArg) { result: Result> -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoEnumList$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val enumListArg = args[0] as List + api.callFlutterEchoEnumList(enumListArg) { result: Result> -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoClassList$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val classListArg = args[0] as List + api.callFlutterEchoClassList(classListArg) { result: Result> -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNonNullEnumList$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val enumListArg = args[0] as List + api.callFlutterEchoNonNullEnumList(enumListArg) { result: Result> -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNonNullClassList$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val classListArg = args[0] as List + api.callFlutterEchoNonNullClassList(classListArg) { + result: Result> -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoMap$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val mapArg = args[0] as Map + api.callFlutterEchoMap(mapArg) { result: Result> -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoStringMap$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val stringMapArg = args[0] as Map + api.callFlutterEchoStringMap(stringMapArg) { result: Result> -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoIntMap$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val intMapArg = args[0] as Map + api.callFlutterEchoIntMap(intMapArg) { result: Result> -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoEnumMap$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val enumMapArg = args[0] as Map + api.callFlutterEchoEnumMap(enumMapArg) { result: Result> -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoClassMap$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val classMapArg = args[0] as Map + api.callFlutterEchoClassMap(classMapArg) { result: Result> + -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNonNullStringMap$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val stringMapArg = args[0] as Map + api.callFlutterEchoNonNullStringMap(stringMapArg) { result: Result> + -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNonNullIntMap$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val intMapArg = args[0] as Map + api.callFlutterEchoNonNullIntMap(intMapArg) { result: Result> -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNonNullEnumMap$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val enumMapArg = args[0] as Map + api.callFlutterEchoNonNullEnumMap(enumMapArg) { result: Result> -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNonNullClassMap$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val classMapArg = args[0] as Map + api.callFlutterEchoNonNullClassMap(classMapArg) { + result: Result> -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoEnum$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val anEnumArg = args[0] as AnEnum + api.callFlutterEchoEnum(anEnumArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAnotherEnum$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val anotherEnumArg = args[0] as AnotherEnum + api.callFlutterEchoAnotherEnum(anotherEnumArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableBool$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val aBoolArg = args[0] as Boolean? + api.callFlutterEchoNullableBool(aBoolArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableInt$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val anIntArg = args[0] as Long? + api.callFlutterEchoNullableInt(anIntArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableDouble$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val aDoubleArg = args[0] as Double? + api.callFlutterEchoNullableDouble(aDoubleArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableString$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val aStringArg = args[0] as String? + api.callFlutterEchoNullableString(aStringArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableUint8List$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val listArg = args[0] as ByteArray? + api.callFlutterEchoNullableUint8List(listArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableList$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val listArg = args[0] as List? + api.callFlutterEchoNullableList(listArg) { result: Result?> -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableEnumList$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val enumListArg = args[0] as List? + api.callFlutterEchoNullableEnumList(enumListArg) { result: Result?> -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableClassList$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val classListArg = args[0] as List? + api.callFlutterEchoNullableClassList(classListArg) { + result: Result?> -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableNonNullEnumList$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val enumListArg = args[0] as List? + api.callFlutterEchoNullableNonNullEnumList(enumListArg) { result: Result?> + -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableNonNullClassList$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val classListArg = args[0] as List? + api.callFlutterEchoNullableNonNullClassList(classListArg) { + result: Result?> -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableMap$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val mapArg = args[0] as Map? + api.callFlutterEchoNullableMap(mapArg) { result: Result?> -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableStringMap$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val stringMapArg = args[0] as Map? + api.callFlutterEchoNullableStringMap(stringMapArg) { + result: Result?> -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableIntMap$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val intMapArg = args[0] as Map? + api.callFlutterEchoNullableIntMap(intMapArg) { result: Result?> -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableEnumMap$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val enumMapArg = args[0] as Map? + api.callFlutterEchoNullableEnumMap(enumMapArg) { result: Result?> + -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableClassMap$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val classMapArg = args[0] as Map? + api.callFlutterEchoNullableClassMap(classMapArg) { + result: Result?> -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableNonNullStringMap$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val stringMapArg = args[0] as Map? + api.callFlutterEchoNullableNonNullStringMap(stringMapArg) { + result: Result?> -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableNonNullIntMap$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val intMapArg = args[0] as Map? + api.callFlutterEchoNullableNonNullIntMap(intMapArg) { result: Result?> + -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableNonNullEnumMap$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val enumMapArg = args[0] as Map? + api.callFlutterEchoNullableNonNullEnumMap(enumMapArg) { + result: Result?> -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableNonNullClassMap$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val classMapArg = args[0] as Map? + api.callFlutterEchoNullableNonNullClassMap(classMapArg) { + result: Result?> -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableEnum$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val anEnumArg = args[0] as AnEnum? + api.callFlutterEchoNullableEnum(anEnumArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAnotherNullableEnum$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val anotherEnumArg = args[0] as AnotherEnum? + api.callFlutterEchoAnotherNullableEnum(anotherEnumArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSmallApiEchoString$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val aStringArg = args[0] as String + api.callFlutterSmallApiEchoString(aStringArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + } + } +} +/** + * The core interface that the Dart platform_test code implements for host integration tests to call + * into. + * + * Generated class from Pigeon that represents Flutter messages that can be called from Kotlin. + */ +class FlutterIntegrationCoreApi( + private val binaryMessenger: BinaryMessenger, + private val messageChannelSuffix: String = "" +) { + companion object { + /** The codec used by FlutterIntegrationCoreApi. */ + val codec: MessageCodec by lazy { CoreTestsPigeonCodec() } + } + /** A no-op function taking no arguments and returning no value, to sanity test basic calling. */ + fun noop(callback: (Result) -> Unit) { + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noop$separatedMessageChannelSuffix" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(null) { + if (it is List<*>) { + if (it.size > 1) { + callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + /** Responds with an error from an async function returning a value. */ + fun throwError(callback: (Result) -> Unit) { + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwError$separatedMessageChannelSuffix" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(null) { + if (it is List<*>) { + if (it.size > 1) { + 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)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + /** Responds with an error from an async void function. */ + fun throwErrorFromVoid(callback: (Result) -> Unit) { + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwErrorFromVoid$separatedMessageChannelSuffix" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(null) { + if (it is List<*>) { + if (it.size > 1) { + callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + /** Returns the passed object, to test serialization and deserialization. */ + fun echoAllTypes(everythingArg: AllTypes, callback: (Result) -> Unit) { + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllTypes$separatedMessageChannelSuffix" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(everythingArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) + } else if (it[0] == null) { + callback( + Result.failure( + FlutterError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) + } else { + val output = it[0] as AllTypes + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + /** Returns the passed object, to test serialization and deserialization. */ + fun echoAllNullableTypes( + everythingArg: AllNullableTypes?, + callback: (Result) -> Unit + ) { + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypes$separatedMessageChannelSuffix" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(everythingArg)) { + if (it is List<*>) { + if (it.size > 1) { + 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)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + /** + * Returns passed in arguments of multiple types. + * + * Tests multiple-arity FlutterApi handling. + */ + fun sendMultipleNullableTypes( + aNullableBoolArg: Boolean?, + aNullableIntArg: Long?, + aNullableStringArg: String?, + callback: (Result) -> Unit + ) { + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypes$separatedMessageChannelSuffix" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(aNullableBoolArg, aNullableIntArg, aNullableStringArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) + } else if (it[0] == null) { + callback( + Result.failure( + FlutterError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) + } else { + val output = it[0] as AllNullableTypes + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + /** Returns the passed object, to test serialization and deserialization. */ + fun echoAllNullableTypesWithoutRecursion( + everythingArg: AllNullableTypesWithoutRecursion?, + callback: (Result) -> Unit + ) { + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypesWithoutRecursion$separatedMessageChannelSuffix" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(everythingArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + val output = it[0] as AllNullableTypesWithoutRecursion? + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + /** + * Returns passed in arguments of multiple types. + * + * Tests multiple-arity FlutterApi handling. + */ + fun sendMultipleNullableTypesWithoutRecursion( + aNullableBoolArg: Boolean?, + aNullableIntArg: Long?, + aNullableStringArg: String?, + callback: (Result) -> Unit + ) { + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion$separatedMessageChannelSuffix" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(aNullableBoolArg, aNullableIntArg, aNullableStringArg)) { + if (it is List<*>) { if (it.size > 1) { callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) + } else if (it[0] == null) { + callback( + Result.failure( + FlutterError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) } else { - val output = it[0] + val output = it[0] as AllNullableTypesWithoutRecursion callback(Result.success(output)) } } else { @@ -2911,33 +4833,41 @@ class FlutterIntegrationCoreApi( } } } - /** Responds with an error from an async void function. */ - fun throwErrorFromVoid(callback: (Result) -> Unit) { + /** Returns the passed boolean, to test serialization and deserialization. */ + fun echoBool(aBoolArg: Boolean, callback: (Result) -> Unit) { val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwErrorFromVoid$separatedMessageChannelSuffix" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoBool$separatedMessageChannelSuffix" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(null) { + channel.send(listOf(aBoolArg)) { if (it is List<*>) { if (it.size > 1) { callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) + } else if (it[0] == null) { + callback( + Result.failure( + FlutterError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) } else { - callback(Result.success(Unit)) + val output = it[0] as Boolean + callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) } } } - /** Returns the passed object, to test serialization and deserialization. */ - fun echoAllTypes(everythingArg: AllTypes, callback: (Result) -> Unit) { + /** Returns the passed int, to test serialization and deserialization. */ + fun echoInt(anIntArg: Long, callback: (Result) -> Unit) { val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllTypes$separatedMessageChannelSuffix" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoInt$separatedMessageChannelSuffix" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(listOf(everythingArg)) { + channel.send(listOf(anIntArg)) { if (it is List<*>) { if (it.size > 1) { callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) @@ -2949,7 +4879,7 @@ class FlutterIntegrationCoreApi( "Flutter api returned null value for non-null return value.", ""))) } else { - val output = it[0] as AllTypes + val output = it[0] as Long callback(Result.success(output)) } } else { @@ -2957,22 +4887,53 @@ class FlutterIntegrationCoreApi( } } } - /** Returns the passed object, to test serialization and deserialization. */ - fun echoAllNullableTypes( - everythingArg: AllNullableTypes?, - callback: (Result) -> Unit - ) { + /** Returns the passed double, to test serialization and deserialization. */ + fun echoDouble(aDoubleArg: Double, callback: (Result) -> Unit) { val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypes$separatedMessageChannelSuffix" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoDouble$separatedMessageChannelSuffix" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(listOf(everythingArg)) { + channel.send(listOf(aDoubleArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) + } else if (it[0] == null) { + callback( + Result.failure( + FlutterError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) + } else { + val output = it[0] as Double + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + /** Returns the passed string, to test serialization and deserialization. */ + fun echoString(aStringArg: String, callback: (Result) -> Unit) { + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoString$separatedMessageChannelSuffix" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(aStringArg)) { if (it is List<*>) { if (it.size > 1) { callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) + } else if (it[0] == null) { + callback( + Result.failure( + FlutterError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) } else { - val output = it[0] as AllNullableTypes? + val output = it[0] as String callback(Result.success(output)) } } else { @@ -2980,23 +4941,98 @@ class FlutterIntegrationCoreApi( } } } - /** - * Returns passed in arguments of multiple types. - * - * Tests multiple-arity FlutterApi handling. - */ - fun sendMultipleNullableTypes( - aNullableBoolArg: Boolean?, - aNullableIntArg: Long?, - aNullableStringArg: String?, - callback: (Result) -> Unit + /** Returns the passed byte list, to test serialization and deserialization. */ + fun echoUint8List(listArg: ByteArray, callback: (Result) -> Unit) { + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoUint8List$separatedMessageChannelSuffix" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(listArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) + } else if (it[0] == null) { + callback( + Result.failure( + FlutterError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) + } else { + val output = it[0] as ByteArray + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + /** Returns the passed list, to test serialization and deserialization. */ + fun echoList(listArg: List, callback: (Result>) -> Unit) { + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoList$separatedMessageChannelSuffix" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(listArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) + } else if (it[0] == null) { + callback( + Result.failure( + FlutterError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) + } else { + val output = it[0] as List + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + /** Returns the passed list, to test serialization and deserialization. */ + fun echoEnumList(enumListArg: List, callback: (Result>) -> Unit) { + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnumList$separatedMessageChannelSuffix" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(enumListArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) + } else if (it[0] == null) { + callback( + Result.failure( + FlutterError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) + } else { + val output = it[0] as List + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + /** Returns the passed list, to test serialization and deserialization. */ + fun echoClassList( + classListArg: List, + callback: (Result>) -> Unit ) { val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypes$separatedMessageChannelSuffix" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoClassList$separatedMessageChannelSuffix" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(listOf(aNullableBoolArg, aNullableIntArg, aNullableStringArg)) { + channel.send(listOf(classListArg)) { if (it is List<*>) { if (it.size > 1) { callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) @@ -3008,7 +5044,7 @@ class FlutterIntegrationCoreApi( "Flutter api returned null value for non-null return value.", ""))) } else { - val output = it[0] as AllNullableTypes + val output = it[0] as List callback(Result.success(output)) } } else { @@ -3016,22 +5052,56 @@ class FlutterIntegrationCoreApi( } } } - /** Returns the passed object, to test serialization and deserialization. */ - fun echoAllNullableTypesWithoutRecursion( - everythingArg: AllNullableTypesWithoutRecursion?, - callback: (Result) -> Unit + /** Returns the passed list, to test serialization and deserialization. */ + fun echoNonNullEnumList(enumListArg: List, callback: (Result>) -> Unit) { + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNonNullEnumList$separatedMessageChannelSuffix" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(enumListArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) + } else if (it[0] == null) { + callback( + Result.failure( + FlutterError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) + } else { + val output = it[0] as List + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + /** Returns the passed list, to test serialization and deserialization. */ + fun echoNonNullClassList( + classListArg: List, + callback: (Result>) -> Unit ) { val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypesWithoutRecursion$separatedMessageChannelSuffix" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNonNullClassList$separatedMessageChannelSuffix" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(listOf(everythingArg)) { + channel.send(listOf(classListArg)) { if (it is List<*>) { if (it.size > 1) { callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) + } else if (it[0] == null) { + callback( + Result.failure( + FlutterError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) } else { - val output = it[0] as AllNullableTypesWithoutRecursion? + val output = it[0] as List callback(Result.success(output)) } } else { @@ -3039,23 +5109,44 @@ class FlutterIntegrationCoreApi( } } } - /** - * Returns passed in arguments of multiple types. - * - * Tests multiple-arity FlutterApi handling. - */ - fun sendMultipleNullableTypesWithoutRecursion( - aNullableBoolArg: Boolean?, - aNullableIntArg: Long?, - aNullableStringArg: String?, - callback: (Result) -> Unit + /** Returns the passed map, to test serialization and deserialization. */ + fun echoMap(mapArg: Map, callback: (Result>) -> Unit) { + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoMap$separatedMessageChannelSuffix" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(mapArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) + } else if (it[0] == null) { + callback( + Result.failure( + FlutterError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) + } else { + val output = it[0] as Map + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + /** Returns the passed map, to test serialization and deserialization. */ + fun echoStringMap( + stringMapArg: Map, + callback: (Result>) -> Unit ) { val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion$separatedMessageChannelSuffix" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoStringMap$separatedMessageChannelSuffix" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(listOf(aNullableBoolArg, aNullableIntArg, aNullableStringArg)) { + channel.send(listOf(stringMapArg)) { if (it is List<*>) { if (it.size > 1) { callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) @@ -3067,7 +5158,7 @@ class FlutterIntegrationCoreApi( "Flutter api returned null value for non-null return value.", ""))) } else { - val output = it[0] as AllNullableTypesWithoutRecursion + val output = it[0] as Map callback(Result.success(output)) } } else { @@ -3075,14 +5166,14 @@ class FlutterIntegrationCoreApi( } } } - /** Returns the passed boolean, to test serialization and deserialization. */ - fun echoBool(aBoolArg: Boolean, callback: (Result) -> Unit) { + /** Returns the passed map, to test serialization and deserialization. */ + fun echoIntMap(intMapArg: Map, callback: (Result>) -> Unit) { val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoBool$separatedMessageChannelSuffix" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoIntMap$separatedMessageChannelSuffix" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(listOf(aBoolArg)) { + channel.send(listOf(intMapArg)) { if (it is List<*>) { if (it.size > 1) { callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) @@ -3094,7 +5185,7 @@ class FlutterIntegrationCoreApi( "Flutter api returned null value for non-null return value.", ""))) } else { - val output = it[0] as Boolean + val output = it[0] as Map callback(Result.success(output)) } } else { @@ -3102,14 +5193,17 @@ class FlutterIntegrationCoreApi( } } } - /** Returns the passed int, to test serialization and deserialization. */ - fun echoInt(anIntArg: Long, callback: (Result) -> Unit) { + /** Returns the passed map, to test serialization and deserialization. */ + fun echoEnumMap( + enumMapArg: Map, + callback: (Result>) -> Unit + ) { val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoInt$separatedMessageChannelSuffix" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnumMap$separatedMessageChannelSuffix" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(listOf(anIntArg)) { + channel.send(listOf(enumMapArg)) { if (it is List<*>) { if (it.size > 1) { callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) @@ -3121,7 +5215,7 @@ class FlutterIntegrationCoreApi( "Flutter api returned null value for non-null return value.", ""))) } else { - val output = it[0].let { num -> if (num is Int) num.toLong() else num as Long } + val output = it[0] as Map callback(Result.success(output)) } } else { @@ -3129,14 +5223,17 @@ class FlutterIntegrationCoreApi( } } } - /** Returns the passed double, to test serialization and deserialization. */ - fun echoDouble(aDoubleArg: Double, callback: (Result) -> Unit) { + /** Returns the passed map, to test serialization and deserialization. */ + fun echoClassMap( + classMapArg: Map, + callback: (Result>) -> Unit + ) { val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoDouble$separatedMessageChannelSuffix" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoClassMap$separatedMessageChannelSuffix" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(listOf(aDoubleArg)) { + channel.send(listOf(classMapArg)) { if (it is List<*>) { if (it.size > 1) { callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) @@ -3148,7 +5245,7 @@ class FlutterIntegrationCoreApi( "Flutter api returned null value for non-null return value.", ""))) } else { - val output = it[0] as Double + val output = it[0] as Map callback(Result.success(output)) } } else { @@ -3156,14 +5253,17 @@ class FlutterIntegrationCoreApi( } } } - /** Returns the passed string, to test serialization and deserialization. */ - fun echoString(aStringArg: String, callback: (Result) -> Unit) { + /** Returns the passed map, to test serialization and deserialization. */ + fun echoNonNullStringMap( + stringMapArg: Map, + callback: (Result>) -> Unit + ) { val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoString$separatedMessageChannelSuffix" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNonNullStringMap$separatedMessageChannelSuffix" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(listOf(aStringArg)) { + channel.send(listOf(stringMapArg)) { if (it is List<*>) { if (it.size > 1) { callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) @@ -3175,7 +5275,7 @@ class FlutterIntegrationCoreApi( "Flutter api returned null value for non-null return value.", ""))) } else { - val output = it[0] as String + val output = it[0] as Map callback(Result.success(output)) } } else { @@ -3183,14 +5283,14 @@ class FlutterIntegrationCoreApi( } } } - /** Returns the passed byte list, to test serialization and deserialization. */ - fun echoUint8List(listArg: ByteArray, callback: (Result) -> Unit) { + /** Returns the passed map, to test serialization and deserialization. */ + fun echoNonNullIntMap(intMapArg: Map, callback: (Result>) -> Unit) { val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoUint8List$separatedMessageChannelSuffix" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNonNullIntMap$separatedMessageChannelSuffix" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(listOf(listArg)) { + channel.send(listOf(intMapArg)) { if (it is List<*>) { if (it.size > 1) { callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) @@ -3202,7 +5302,7 @@ class FlutterIntegrationCoreApi( "Flutter api returned null value for non-null return value.", ""))) } else { - val output = it[0] as ByteArray + val output = it[0] as Map callback(Result.success(output)) } } else { @@ -3210,14 +5310,17 @@ class FlutterIntegrationCoreApi( } } } - /** Returns the passed list, to test serialization and deserialization. */ - fun echoList(listArg: List, callback: (Result>) -> Unit) { + /** Returns the passed map, to test serialization and deserialization. */ + fun echoNonNullEnumMap( + enumMapArg: Map, + callback: (Result>) -> Unit + ) { val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoList$separatedMessageChannelSuffix" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNonNullEnumMap$separatedMessageChannelSuffix" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(listOf(listArg)) { + channel.send(listOf(enumMapArg)) { if (it is List<*>) { if (it.size > 1) { callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) @@ -3229,7 +5332,7 @@ class FlutterIntegrationCoreApi( "Flutter api returned null value for non-null return value.", ""))) } else { - val output = it[0] as List + val output = it[0] as Map callback(Result.success(output)) } } else { @@ -3238,13 +5341,16 @@ class FlutterIntegrationCoreApi( } } /** Returns the passed map, to test serialization and deserialization. */ - fun echoMap(aMapArg: Map, callback: (Result>) -> Unit) { + fun echoNonNullClassMap( + classMapArg: Map, + callback: (Result>) -> Unit + ) { val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoMap$separatedMessageChannelSuffix" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNonNullClassMap$separatedMessageChannelSuffix" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(listOf(aMapArg)) { + channel.send(listOf(classMapArg)) { if (it is List<*>) { if (it.size > 1) { callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) @@ -3256,7 +5362,7 @@ class FlutterIntegrationCoreApi( "Flutter api returned null value for non-null return value.", ""))) } else { - val output = it[0] as Map + val output = it[0] as Map callback(Result.success(output)) } } else { @@ -3350,7 +5456,7 @@ class FlutterIntegrationCoreApi( if (it.size > 1) { callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) } else { - val output = it[0].let { num -> if (num is Int) num.toLong() else num as Long? } + val output = it[0] as Long? callback(Result.success(output)) } } else { @@ -3438,22 +5544,295 @@ class FlutterIntegrationCoreApi( } } } - /** Returns the passed map, to test serialization and deserialization. */ - fun echoNullableMap( - aMapArg: Map?, - callback: (Result?>) -> Unit + /** Returns the passed list, to test serialization and deserialization. */ + fun echoNullableEnumList( + enumListArg: List?, + callback: (Result?>) -> Unit + ) { + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableEnumList$separatedMessageChannelSuffix" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(enumListArg)) { + if (it is List<*>) { + if (it.size > 1) { + 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)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + /** Returns the passed list, to test serialization and deserialization. */ + fun echoNullableClassList( + classListArg: List?, + callback: (Result?>) -> Unit + ) { + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableClassList$separatedMessageChannelSuffix" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(classListArg)) { + if (it is List<*>) { + if (it.size > 1) { + 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)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + /** Returns the passed list, to test serialization and deserialization. */ + fun echoNullableNonNullEnumList( + enumListArg: List?, + callback: (Result?>) -> Unit + ) { + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableNonNullEnumList$separatedMessageChannelSuffix" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(enumListArg)) { + if (it is List<*>) { + if (it.size > 1) { + 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)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + /** Returns the passed list, to test serialization and deserialization. */ + fun echoNullableNonNullClassList( + classListArg: List?, + callback: (Result?>) -> Unit ) { + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableNonNullClassList$separatedMessageChannelSuffix" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(classListArg)) { + if (it is List<*>) { + if (it.size > 1) { + 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)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + /** Returns the passed map, to test serialization and deserialization. */ + fun echoNullableMap(mapArg: Map?, callback: (Result?>) -> Unit) { val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" val channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableMap$separatedMessageChannelSuffix" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(listOf(aMapArg)) { + channel.send(listOf(mapArg)) { + if (it is List<*>) { + if (it.size > 1) { + 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)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + /** Returns the passed map, to test serialization and deserialization. */ + fun echoNullableStringMap( + stringMapArg: Map?, + callback: (Result?>) -> Unit + ) { + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableStringMap$separatedMessageChannelSuffix" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(stringMapArg)) { + if (it is List<*>) { + if (it.size > 1) { + 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)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + /** Returns the passed map, to test serialization and deserialization. */ + fun echoNullableIntMap( + intMapArg: Map?, + callback: (Result?>) -> Unit + ) { + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableIntMap$separatedMessageChannelSuffix" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(intMapArg)) { + if (it is List<*>) { + if (it.size > 1) { + 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)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + /** Returns the passed map, to test serialization and deserialization. */ + fun echoNullableEnumMap( + enumMapArg: Map?, + callback: (Result?>) -> Unit + ) { + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableEnumMap$separatedMessageChannelSuffix" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(enumMapArg)) { + if (it is List<*>) { + if (it.size > 1) { + 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)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + /** Returns the passed map, to test serialization and deserialization. */ + fun echoNullableClassMap( + classMapArg: Map?, + callback: (Result?>) -> Unit + ) { + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableClassMap$separatedMessageChannelSuffix" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(classMapArg)) { + if (it is List<*>) { + if (it.size > 1) { + 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)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + /** Returns the passed map, to test serialization and deserialization. */ + fun echoNullableNonNullStringMap( + stringMapArg: Map?, + callback: (Result?>) -> Unit + ) { + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableNonNullStringMap$separatedMessageChannelSuffix" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(stringMapArg)) { + if (it is List<*>) { + if (it.size > 1) { + 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)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + /** Returns the passed map, to test serialization and deserialization. */ + fun echoNullableNonNullIntMap( + intMapArg: Map?, + callback: (Result?>) -> Unit + ) { + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableNonNullIntMap$separatedMessageChannelSuffix" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(intMapArg)) { + if (it is List<*>) { + if (it.size > 1) { + 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)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + /** Returns the passed map, to test serialization and deserialization. */ + fun echoNullableNonNullEnumMap( + enumMapArg: Map?, + callback: (Result?>) -> Unit + ) { + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableNonNullEnumMap$separatedMessageChannelSuffix" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(enumMapArg)) { + if (it is List<*>) { + if (it.size > 1) { + 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)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + /** Returns the passed map, to test serialization and deserialization. */ + fun echoNullableNonNullClassMap( + classMapArg: Map?, + callback: (Result?>) -> Unit + ) { + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableNonNullClassMap$separatedMessageChannelSuffix" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(classMapArg)) { if (it is List<*>) { if (it.size > 1) { callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) } else { - val output = it[0] as Map? + val output = it[0] as Map? callback(Result.success(output)) } } else { @@ -3564,7 +5943,7 @@ interface HostTrivialApi { companion object { /** The codec used by HostTrivialApi. */ - val codec: MessageCodec by lazy { CoreTestsPigeonCodec } + val codec: MessageCodec by lazy { CoreTestsPigeonCodec() } /** Sets up an instance of `HostTrivialApi` to handle messages through the `binaryMessenger`. */ @JvmOverloads fun setUp( @@ -3610,7 +5989,7 @@ interface HostSmallApi { companion object { /** The codec used by HostSmallApi. */ - val codec: MessageCodec by lazy { CoreTestsPigeonCodec } + val codec: MessageCodec by lazy { CoreTestsPigeonCodec() } /** Sets up an instance of `HostSmallApi` to handle messages through the `binaryMessenger`. */ @JvmOverloads fun setUp( @@ -3679,7 +6058,7 @@ class FlutterSmallApi( ) { companion object { /** The codec used by FlutterSmallApi. */ - val codec: MessageCodec by lazy { CoreTestsPigeonCodec } + val codec: MessageCodec by lazy { CoreTestsPigeonCodec() } } fun echoWrappedList(msgArg: TestMessage, callback: (Result) -> Unit) { diff --git a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTestApiImpls.kt b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTestApiImpls.kt new file mode 100644 index 000000000000..bfe6e4257e79 --- /dev/null +++ b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTestApiImpls.kt @@ -0,0 +1,699 @@ +// 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. + +package com.example.test_plugin + +import androidx.annotation.RequiresApi +import io.flutter.plugin.common.BinaryMessenger + +class ProxyApiTestClass : ProxyApiSuperClass(), ProxyApiInterface + +open class ProxyApiSuperClass + +interface ProxyApiInterface + +@RequiresApi(25) class ClassWithApiRequirement + +class ProxyApiRegistrar(binaryMessenger: BinaryMessenger) : + ProxyApiTestsPigeonProxyApiRegistrar(binaryMessenger) { + override fun getPigeonApiProxyApiTestClass(): PigeonApiProxyApiTestClass { + return ProxyApiTestClassApi(this) + } + + override fun getPigeonApiProxyApiSuperClass(): PigeonApiProxyApiSuperClass { + return ProxyApiSuperClassApi(this) + } + + override fun getPigeonApiClassWithApiRequirement(): PigeonApiClassWithApiRequirement { + return ClassWithApiRequirementApi(this) + } +} + +class ProxyApiTestClassApi(override val pigeonRegistrar: ProxyApiRegistrar) : + PigeonApiProxyApiTestClass(pigeonRegistrar) { + + override fun pigeon_defaultConstructor( + aBool: Boolean, + anInt: Long, + aDouble: Double, + aString: String, + aUint8List: ByteArray, + aList: List, + aMap: Map, + anEnum: ProxyApiTestEnum, + aProxyApi: ProxyApiSuperClass, + aNullableBool: Boolean?, + aNullableInt: Long?, + aNullableDouble: Double?, + aNullableString: String?, + aNullableUint8List: ByteArray?, + aNullableList: List?, + aNullableMap: Map?, + aNullableEnum: ProxyApiTestEnum?, + aNullableProxyApi: ProxyApiSuperClass?, + boolParam: Boolean, + intParam: Long, + doubleParam: Double, + stringParam: String, + aUint8ListParam: ByteArray, + listParam: List, + mapParam: Map, + enumParam: ProxyApiTestEnum, + proxyApiParam: ProxyApiSuperClass, + nullableBoolParam: Boolean?, + nullableIntParam: Long?, + nullableDoubleParam: Double?, + nullableStringParam: String?, + nullableUint8ListParam: ByteArray?, + nullableListParam: List?, + nullableMapParam: Map?, + nullableEnumParam: ProxyApiTestEnum?, + nullableProxyApiParam: ProxyApiSuperClass? + ): ProxyApiTestClass { + return ProxyApiTestClass() + } + + override fun attachedField(pigeon_instance: ProxyApiTestClass): ProxyApiSuperClass { + return ProxyApiSuperClass() + } + + override fun staticAttachedField(): ProxyApiSuperClass { + return ProxyApiSuperClass() + } + + override fun aBool(pigeon_instance: ProxyApiTestClass): Boolean { + return true + } + + override fun anInt(pigeon_instance: ProxyApiTestClass): Long { + return 0 + } + + override fun aDouble(pigeon_instance: ProxyApiTestClass): Double { + return 0.0 + } + + override fun aString(pigeon_instance: ProxyApiTestClass): String { + return "" + } + + override fun aUint8List(pigeon_instance: ProxyApiTestClass): ByteArray { + return byteArrayOf() + } + + override fun aList(pigeon_instance: ProxyApiTestClass): List { + return listOf() + } + + override fun aMap(pigeon_instance: ProxyApiTestClass): Map { + return mapOf() + } + + override fun anEnum(pigeon_instance: ProxyApiTestClass): ProxyApiTestEnum { + return ProxyApiTestEnum.ONE + } + + override fun aProxyApi(pigeon_instance: ProxyApiTestClass): ProxyApiSuperClass { + return ProxyApiSuperClass() + } + + override fun aNullableBool(pigeon_instance: ProxyApiTestClass): Boolean? { + return null + } + + override fun aNullableInt(pigeon_instance: ProxyApiTestClass): Long? { + return null + } + + override fun aNullableDouble(pigeon_instance: ProxyApiTestClass): Double? { + return null + } + + override fun aNullableString(pigeon_instance: ProxyApiTestClass): String? { + return null + } + + override fun aNullableUint8List(pigeon_instance: ProxyApiTestClass): ByteArray? { + return null + } + + override fun aNullableList(pigeon_instance: ProxyApiTestClass): List? { + return null + } + + override fun aNullableMap(pigeon_instance: ProxyApiTestClass): Map? { + return null + } + + override fun aNullableEnum(pigeon_instance: ProxyApiTestClass): ProxyApiTestEnum? { + return null + } + + override fun aNullableProxyApi(pigeon_instance: ProxyApiTestClass): ProxyApiSuperClass? { + return null + } + + override fun noop(pigeon_instance: ProxyApiTestClass) {} + + override fun throwError(pigeon_instance: ProxyApiTestClass): Any? { + throw Exception("message") + } + + override fun throwErrorFromVoid(pigeon_instance: ProxyApiTestClass) { + throw Exception("message") + } + + override fun throwFlutterError(pigeon_instance: ProxyApiTestClass): Any? { + throw ProxyApiTestsError("code", "message", "details") + } + + override fun echoInt(pigeon_instance: ProxyApiTestClass, anInt: Long): Long { + return anInt + } + + override fun echoDouble(pigeon_instance: ProxyApiTestClass, aDouble: Double): Double { + return aDouble + } + + override fun echoBool(pigeon_instance: ProxyApiTestClass, aBool: Boolean): Boolean { + return aBool + } + + override fun echoString(pigeon_instance: ProxyApiTestClass, aString: String): String { + return aString + } + + override fun echoUint8List(pigeon_instance: ProxyApiTestClass, aUint8List: ByteArray): ByteArray { + return aUint8List + } + + override fun echoObject(pigeon_instance: ProxyApiTestClass, anObject: Any): Any { + return anObject + } + + override fun echoList(pigeon_instance: ProxyApiTestClass, aList: List): List { + return aList + } + + override fun echoProxyApiList( + pigeon_instance: ProxyApiTestClass, + aList: List + ): List { + return aList + } + + override fun echoMap( + pigeon_instance: ProxyApiTestClass, + aMap: Map + ): Map { + return aMap + } + + override fun echoProxyApiMap( + pigeon_instance: ProxyApiTestClass, + aMap: Map + ): Map { + return aMap + } + + override fun echoEnum( + pigeon_instance: ProxyApiTestClass, + anEnum: ProxyApiTestEnum + ): ProxyApiTestEnum { + return anEnum + } + + override fun echoProxyApi( + pigeon_instance: ProxyApiTestClass, + aProxyApi: ProxyApiSuperClass + ): ProxyApiSuperClass { + return aProxyApi + } + + override fun echoNullableInt(pigeon_instance: ProxyApiTestClass, aNullableInt: Long?): Long? { + return aNullableInt + } + + override fun echoNullableDouble( + pigeon_instance: ProxyApiTestClass, + aNullableDouble: Double? + ): Double? { + return aNullableDouble + } + + override fun echoNullableBool( + pigeon_instance: ProxyApiTestClass, + aNullableBool: Boolean? + ): Boolean? { + return aNullableBool + } + + override fun echoNullableString( + pigeon_instance: ProxyApiTestClass, + aNullableString: String? + ): String? { + return aNullableString + } + + override fun echoNullableUint8List( + pigeon_instance: ProxyApiTestClass, + aNullableUint8List: ByteArray? + ): ByteArray? { + return aNullableUint8List + } + + override fun echoNullableObject(pigeon_instance: ProxyApiTestClass, aNullableObject: Any?): Any? { + return aNullableObject + } + + override fun echoNullableList( + pigeon_instance: ProxyApiTestClass, + aNullableList: List? + ): List? { + return aNullableList + } + + override fun echoNullableMap( + pigeon_instance: ProxyApiTestClass, + aNullableMap: Map? + ): Map? { + return aNullableMap + } + + override fun echoNullableEnum( + pigeon_instance: ProxyApiTestClass, + aNullableEnum: ProxyApiTestEnum? + ): ProxyApiTestEnum? { + return aNullableEnum + } + + override fun echoNullableProxyApi( + pigeon_instance: ProxyApiTestClass, + aNullableProxyApi: ProxyApiSuperClass? + ): ProxyApiSuperClass? { + return aNullableProxyApi + } + + override fun noopAsync(pigeon_instance: ProxyApiTestClass, callback: (Result) -> Unit) { + callback(Result.success(Unit)) + } + + override fun echoAsyncInt( + pigeon_instance: ProxyApiTestClass, + anInt: Long, + callback: (Result) -> Unit + ) { + callback(Result.success(anInt)) + } + + override fun echoAsyncDouble( + pigeon_instance: ProxyApiTestClass, + aDouble: Double, + callback: (Result) -> Unit + ) { + callback(Result.success(aDouble)) + } + + override fun echoAsyncBool( + pigeon_instance: ProxyApiTestClass, + aBool: Boolean, + callback: (Result) -> Unit + ) { + callback(Result.success(aBool)) + } + + override fun echoAsyncString( + pigeon_instance: ProxyApiTestClass, + aString: String, + callback: (Result) -> Unit + ) { + callback(Result.success(aString)) + } + + override fun echoAsyncUint8List( + pigeon_instance: ProxyApiTestClass, + aUint8List: ByteArray, + callback: (Result) -> Unit + ) { + callback(Result.success(aUint8List)) + } + + override fun echoAsyncObject( + pigeon_instance: ProxyApiTestClass, + anObject: Any, + callback: (Result) -> Unit + ) { + callback(Result.success(anObject)) + } + + override fun echoAsyncList( + pigeon_instance: ProxyApiTestClass, + aList: List, + callback: (Result>) -> Unit + ) { + callback(Result.success(aList)) + } + + override fun echoAsyncMap( + pigeon_instance: ProxyApiTestClass, + aMap: Map, + callback: (Result>) -> Unit + ) { + callback(Result.success(aMap)) + } + + override fun echoAsyncEnum( + pigeon_instance: ProxyApiTestClass, + anEnum: ProxyApiTestEnum, + callback: (Result) -> Unit + ) { + callback(Result.success(anEnum)) + } + + override fun throwAsyncError( + pigeon_instance: ProxyApiTestClass, + callback: (Result) -> Unit + ) { + callback(Result.failure(Exception("message"))) + } + + override fun throwAsyncErrorFromVoid( + pigeon_instance: ProxyApiTestClass, + callback: (Result) -> Unit + ) { + callback(Result.failure(Exception("message"))) + } + + override fun throwAsyncFlutterError( + pigeon_instance: ProxyApiTestClass, + callback: (Result) -> Unit + ) { + callback(Result.failure(ProxyApiTestsError("code", "message", "details"))) + } + + override fun echoAsyncNullableInt( + pigeon_instance: ProxyApiTestClass, + anInt: Long?, + callback: (Result) -> Unit + ) { + callback(Result.success(anInt)) + } + + override fun echoAsyncNullableDouble( + pigeon_instance: ProxyApiTestClass, + aDouble: Double?, + callback: (Result) -> Unit + ) { + callback(Result.success(aDouble)) + } + + override fun echoAsyncNullableBool( + pigeon_instance: ProxyApiTestClass, + aBool: Boolean?, + callback: (Result) -> Unit + ) { + callback(Result.success(aBool)) + } + + override fun echoAsyncNullableString( + pigeon_instance: ProxyApiTestClass, + aString: String?, + callback: (Result) -> Unit + ) { + callback(Result.success(aString)) + } + + override fun echoAsyncNullableUint8List( + pigeon_instance: ProxyApiTestClass, + aUint8List: ByteArray?, + callback: (Result) -> Unit + ) { + callback(Result.success(aUint8List)) + } + + override fun echoAsyncNullableObject( + pigeon_instance: ProxyApiTestClass, + anObject: Any?, + callback: (Result) -> Unit + ) { + callback(Result.success(anObject)) + } + + override fun echoAsyncNullableList( + pigeon_instance: ProxyApiTestClass, + aList: List?, + callback: (Result?>) -> Unit + ) { + callback(Result.success(aList)) + } + + override fun echoAsyncNullableMap( + pigeon_instance: ProxyApiTestClass, + aMap: Map?, + callback: (Result?>) -> Unit + ) { + callback(Result.success(aMap)) + } + + override fun echoAsyncNullableEnum( + pigeon_instance: ProxyApiTestClass, + anEnum: ProxyApiTestEnum?, + callback: (Result) -> Unit + ) { + callback(Result.success(anEnum)) + } + + override fun staticNoop() {} + + override fun echoStaticString(aString: String): String { + return aString + } + + override fun staticAsyncNoop(callback: (Result) -> Unit) { + callback(Result.success(Unit)) + } + + override fun callFlutterNoop( + pigeon_instance: ProxyApiTestClass, + callback: (Result) -> Unit + ) { + flutterNoop(pigeon_instance, callback) + } + + override fun callFlutterThrowError( + pigeon_instance: ProxyApiTestClass, + callback: (Result) -> Unit + ) { + flutterThrowError(pigeon_instance) { result -> + val exception = result.exceptionOrNull() + callback(Result.failure(exception!!)) + } + } + + override fun callFlutterThrowErrorFromVoid( + pigeon_instance: ProxyApiTestClass, + callback: (Result) -> Unit + ) { + flutterThrowErrorFromVoid(pigeon_instance) { result -> + val exception = result.exceptionOrNull() + callback(Result.failure(exception!!)) + } + } + + override fun callFlutterEchoBool( + pigeon_instance: ProxyApiTestClass, + aBool: Boolean, + callback: (Result) -> Unit + ) { + flutterEchoBool(pigeon_instance, aBool, callback) + } + + override fun callFlutterEchoInt( + pigeon_instance: ProxyApiTestClass, + anInt: Long, + callback: (Result) -> Unit + ) { + flutterEchoInt(pigeon_instance, anInt, callback) + } + + override fun callFlutterEchoDouble( + pigeon_instance: ProxyApiTestClass, + aDouble: Double, + callback: (Result) -> Unit + ) { + flutterEchoDouble(pigeon_instance, aDouble, callback) + } + + override fun callFlutterEchoString( + pigeon_instance: ProxyApiTestClass, + aString: String, + callback: (Result) -> Unit + ) { + flutterEchoString(pigeon_instance, aString, callback) + } + + override fun callFlutterEchoUint8List( + pigeon_instance: ProxyApiTestClass, + aUint8List: ByteArray, + callback: (Result) -> Unit + ) { + flutterEchoUint8List(pigeon_instance, aUint8List, callback) + } + + override fun callFlutterEchoList( + pigeon_instance: ProxyApiTestClass, + aList: List, + callback: (Result>) -> Unit + ) { + flutterEchoList(pigeon_instance, aList, callback) + } + + override fun callFlutterEchoProxyApiList( + pigeon_instance: ProxyApiTestClass, + aList: List, + callback: (Result>) -> Unit + ) { + flutterEchoProxyApiList(pigeon_instance, aList, callback) + } + + override fun callFlutterEchoMap( + pigeon_instance: ProxyApiTestClass, + aMap: Map, + callback: (Result>) -> Unit + ) { + flutterEchoMap(pigeon_instance, aMap, callback) + } + + override fun callFlutterEchoProxyApiMap( + pigeon_instance: ProxyApiTestClass, + aMap: Map, + callback: (Result>) -> Unit + ) { + flutterEchoProxyApiMap(pigeon_instance, aMap, callback) + } + + override fun callFlutterEchoEnum( + pigeon_instance: ProxyApiTestClass, + anEnum: ProxyApiTestEnum, + callback: (Result) -> Unit + ) { + flutterEchoEnum(pigeon_instance, anEnum, callback) + } + + override fun callFlutterEchoProxyApi( + pigeon_instance: ProxyApiTestClass, + aProxyApi: ProxyApiSuperClass, + callback: (Result) -> Unit + ) { + flutterEchoProxyApi(pigeon_instance, aProxyApi, callback) + } + + override fun callFlutterEchoNullableBool( + pigeon_instance: ProxyApiTestClass, + aBool: Boolean?, + callback: (Result) -> Unit + ) { + flutterEchoNullableBool(pigeon_instance, aBool, callback) + } + + override fun callFlutterEchoNullableInt( + pigeon_instance: ProxyApiTestClass, + anInt: Long?, + callback: (Result) -> Unit + ) { + flutterEchoNullableInt(pigeon_instance, anInt, callback) + } + + override fun callFlutterEchoNullableDouble( + pigeon_instance: ProxyApiTestClass, + aDouble: Double?, + callback: (Result) -> Unit + ) { + flutterEchoNullableDouble(pigeon_instance, aDouble, callback) + } + + override fun callFlutterEchoNullableString( + pigeon_instance: ProxyApiTestClass, + aString: String?, + callback: (Result) -> Unit + ) { + flutterEchoNullableString(pigeon_instance, aString, callback) + } + + override fun callFlutterEchoNullableUint8List( + pigeon_instance: ProxyApiTestClass, + aUint8List: ByteArray?, + callback: (Result) -> Unit + ) { + flutterEchoNullableUint8List(pigeon_instance, aUint8List, callback) + } + + override fun callFlutterEchoNullableList( + pigeon_instance: ProxyApiTestClass, + aList: List?, + callback: (Result?>) -> Unit + ) { + flutterEchoNullableList(pigeon_instance, aList, callback) + } + + override fun callFlutterEchoNullableMap( + pigeon_instance: ProxyApiTestClass, + aMap: Map?, + callback: (Result?>) -> Unit + ) { + flutterEchoNullableMap(pigeon_instance, aMap, callback) + } + + override fun callFlutterEchoNullableEnum( + pigeon_instance: ProxyApiTestClass, + anEnum: ProxyApiTestEnum?, + callback: (Result) -> Unit + ) { + flutterEchoNullableEnum(pigeon_instance, anEnum, callback) + } + + override fun callFlutterEchoNullableProxyApi( + pigeon_instance: ProxyApiTestClass, + aProxyApi: ProxyApiSuperClass?, + callback: (Result) -> Unit + ) { + flutterEchoNullableProxyApi(pigeon_instance, aProxyApi, callback) + } + + override fun callFlutterNoopAsync( + pigeon_instance: ProxyApiTestClass, + callback: (Result) -> Unit + ) { + flutterNoopAsync(pigeon_instance, callback) + } + + override fun callFlutterEchoAsyncString( + pigeon_instance: ProxyApiTestClass, + aString: String, + callback: (Result) -> Unit + ) { + flutterEchoAsyncString(pigeon_instance, aString, callback) + } +} + +class ProxyApiSuperClassApi(override val pigeonRegistrar: ProxyApiRegistrar) : + PigeonApiProxyApiSuperClass(pigeonRegistrar) { + override fun pigeon_defaultConstructor(): ProxyApiSuperClass { + return ProxyApiSuperClass() + } + + override fun aSuperMethod(pigeon_instance: ProxyApiSuperClass) {} +} + +class ClassWithApiRequirementApi(override val pigeonRegistrar: ProxyApiRegistrar) : + PigeonApiClassWithApiRequirement(pigeonRegistrar) { + @RequiresApi(25) + override fun pigeon_defaultConstructor(): ClassWithApiRequirement { + return ClassWithApiRequirement() + } + + override fun aMethod(pigeon_instance: ClassWithApiRequirement) { + // Do nothing + } +} diff --git a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt new file mode 100644 index 000000000000..184a5b00f599 --- /dev/null +++ b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt @@ -0,0 +1,4291 @@ +// 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, do not edit directly. +// See also: https://pub.dev/packages/pigeon +@file:Suppress("UNCHECKED_CAST", "ArrayInDataClass") + +package com.example.test_plugin + +import android.util.Log +import io.flutter.plugin.common.BasicMessageChannel +import io.flutter.plugin.common.BinaryMessenger +import io.flutter.plugin.common.MessageCodec +import io.flutter.plugin.common.StandardMessageCodec +import java.io.ByteArrayOutputStream +import java.nio.ByteBuffer + +private fun wrapResult(result: Any?): List { + return listOf(result) +} + +private fun wrapError(exception: Throwable): List { + return if (exception is ProxyApiTestsError) { + listOf(exception.code, exception.message, exception.details) + } else { + listOf( + exception.javaClass.simpleName, + exception.toString(), + "Cause: " + exception.cause + ", Stacktrace: " + Log.getStackTraceString(exception)) + } +} + +private fun createConnectionError(channelName: String): ProxyApiTestsError { + return ProxyApiTestsError( + "channel-error", "Unable to establish connection on channel: '$channelName'.", "") +} + +/** + * Error class for passing custom error details to Flutter via a thrown PlatformException. + * + * @property code The error code. + * @property message The error message. + * @property details The error details. Must be a datatype supported by the api codec. + */ +class ProxyApiTestsError( + val code: String, + override val message: String? = null, + val details: Any? = null +) : Throwable() +/** + * Maintains instances used to communicate with the corresponding objects in Dart. + * + * Objects stored in this container are represented by an object in Dart that is also stored in an + * InstanceManager with the same identifier. + * + * When an instance is added with an identifier, either can be used to retrieve the other. + * + * Added instances are added as a weak reference and a strong reference. When the strong reference + * is removed with [remove] and the weak reference is deallocated, the + * `finalizationListener.onFinalize` is called with the instance's identifier. However, if the + * strong reference is removed and then the identifier is retrieved with the intention to pass the + * identifier to Dart (e.g. calling [getIdentifierForStrongReference]), the strong reference to the + * instance is recreated. The strong reference will then need to be removed manually again. + */ +@Suppress("UNCHECKED_CAST", "MemberVisibilityCanBePrivate") +class ProxyApiTestsPigeonInstanceManager( + private val finalizationListener: PigeonFinalizationListener +) { + /** Interface for listening when a weak reference of an instance is removed from the manager. */ + interface PigeonFinalizationListener { + fun onFinalize(identifier: Long) + } + + private val identifiers = java.util.WeakHashMap() + private val weakInstances = HashMap>() + private val strongInstances = HashMap() + private val referenceQueue = java.lang.ref.ReferenceQueue() + private val weakReferencesToIdentifiers = HashMap, Long>() + private val handler = android.os.Handler(android.os.Looper.getMainLooper()) + private var nextIdentifier: Long = minHostCreatedIdentifier + private var hasFinalizationListenerStopped = false + + /** + * Modifies the time interval used to define how often this instance removes garbage collected + * weak references to native Android objects that this instance was managing. + */ + var clearFinalizedWeakReferencesInterval: Long = 3000 + set(value) { + handler.removeCallbacks { this.releaseAllFinalizedInstances() } + field = value + releaseAllFinalizedInstances() + } + + init { + handler.postDelayed({ releaseAllFinalizedInstances() }, clearFinalizedWeakReferencesInterval) + } + + companion object { + // Identifiers are locked to a specific range to avoid collisions with objects + // created simultaneously from Dart. + // Host uses identifiers >= 2^16 and Dart is expected to use values n where, + // 0 <= n < 2^16. + private const val minHostCreatedIdentifier: Long = 65536 + private const val tag = "PigeonInstanceManager" + + /** + * Instantiate a new manager with a listener for garbage collected weak references. + * + * When the manager is no longer needed, [stopFinalizationListener] must be called. + */ + fun create( + finalizationListener: PigeonFinalizationListener + ): ProxyApiTestsPigeonInstanceManager { + return ProxyApiTestsPigeonInstanceManager(finalizationListener) + } + } + + /** + * Removes `identifier` and return its associated strongly referenced instance, if present, from + * the manager. + */ + fun remove(identifier: Long): T? { + logWarningIfFinalizationListenerHasStopped() + return strongInstances.remove(identifier) as T? + } + + /** + * Retrieves the identifier paired with an instance, if present, otherwise `null`. + * + * If the manager contains a strong reference to `instance`, it will return the identifier + * associated with `instance`. If the manager contains only a weak reference to `instance`, a new + * strong reference to `instance` will be added and will need to be removed again with [remove]. + * + * If this method returns a nonnull identifier, this method also expects the Dart + * `ProxyApiTestsPigeonInstanceManager` to have, or recreate, a weak reference to the Dart + * instance the identifier is associated with. + */ + fun getIdentifierForStrongReference(instance: Any?): Long? { + logWarningIfFinalizationListenerHasStopped() + val identifier = identifiers[instance] + if (identifier != null) { + strongInstances[identifier] = instance!! + } + return identifier + } + + /** + * Adds a new instance that was instantiated from Dart. + * + * The same instance can be added multiple times, but each identifier must be unique. This allows + * two objects that are equivalent (e.g. the `equals` method returns true and their hashcodes are + * equal) to both be added. + * + * [identifier] must be >= 0 and unique. + */ + fun addDartCreatedInstance(instance: Any, identifier: Long) { + logWarningIfFinalizationListenerHasStopped() + addInstance(instance, identifier) + } + + /** + * Adds a new unique instance that was instantiated from the host platform. + * + * [identifier] must be >= 0 and unique. + */ + fun addHostCreatedInstance(instance: Any): Long { + logWarningIfFinalizationListenerHasStopped() + require(!containsInstance(instance)) { + "Instance of ${instance.javaClass} has already been added." + } + val identifier = nextIdentifier++ + addInstance(instance, identifier) + return identifier + } + + /** Retrieves the instance associated with identifier, if present, otherwise `null`. */ + fun getInstance(identifier: Long): T? { + logWarningIfFinalizationListenerHasStopped() + val instance = weakInstances[identifier] as java.lang.ref.WeakReference? + return instance?.get() + } + + /** Returns whether this manager contains the given `instance`. */ + fun containsInstance(instance: Any?): Boolean { + logWarningIfFinalizationListenerHasStopped() + return identifiers.containsKey(instance) + } + + /** + * Stops the periodic run of the [PigeonFinalizationListener] for instances that have been garbage + * collected. + * + * The InstanceManager can continue to be used, but the [PigeonFinalizationListener] will no + * longer be called and methods will log a warning. + */ + fun stopFinalizationListener() { + handler.removeCallbacks { this.releaseAllFinalizedInstances() } + hasFinalizationListenerStopped = true + } + + /** + * Removes all of the instances from this manager. + * + * The manager will be empty after this call returns. + */ + fun clear() { + identifiers.clear() + weakInstances.clear() + strongInstances.clear() + weakReferencesToIdentifiers.clear() + } + + /** + * Whether the [PigeonFinalizationListener] is still being called for instances that are garbage + * collected. + * + * See [stopFinalizationListener]. + */ + fun hasFinalizationListenerStopped(): Boolean { + return hasFinalizationListenerStopped + } + + private fun releaseAllFinalizedInstances() { + if (hasFinalizationListenerStopped()) { + return + } + var reference: java.lang.ref.WeakReference? + while ((referenceQueue.poll() as java.lang.ref.WeakReference?).also { reference = it } != + null) { + val identifier = weakReferencesToIdentifiers.remove(reference) + if (identifier != null) { + weakInstances.remove(identifier) + strongInstances.remove(identifier) + finalizationListener.onFinalize(identifier) + } + } + handler.postDelayed({ releaseAllFinalizedInstances() }, clearFinalizedWeakReferencesInterval) + } + + private fun addInstance(instance: Any, identifier: Long) { + require(identifier >= 0) { "Identifier must be >= 0: $identifier" } + require(!weakInstances.containsKey(identifier)) { + "Identifier has already been added: $identifier" + } + val weakReference = java.lang.ref.WeakReference(instance, referenceQueue) + identifiers[instance] = identifier + weakInstances[identifier] = weakReference + weakReferencesToIdentifiers[weakReference] = identifier + strongInstances[identifier] = instance + } + + private fun logWarningIfFinalizationListenerHasStopped() { + if (hasFinalizationListenerStopped()) { + Log.w( + tag, + "The manager was used after calls to the PigeonFinalizationListener has been stopped.") + } + } +} + +/** Generated API for managing the Dart and native `InstanceManager`s. */ +private class ProxyApiTestsPigeonInstanceManagerApi(val binaryMessenger: BinaryMessenger) { + companion object { + /** The codec used by ProxyApiTestsPigeonInstanceManagerApi. */ + val codec: MessageCodec by lazy { ProxyApiTestsPigeonCodec() } + + /** + * Sets up an instance of `ProxyApiTestsPigeonInstanceManagerApi` to handle messages from the + * `binaryMessenger`. + */ + fun setUpMessageHandlers( + binaryMessenger: BinaryMessenger, + instanceManager: ProxyApiTestsPigeonInstanceManager? + ) { + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.PigeonInternalInstanceManager.removeStrongReference", + codec) + if (instanceManager != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val identifierArg = args[0] as Long + val wrapped: List = + try { + instanceManager.remove(identifierArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.PigeonInternalInstanceManager.clear", + codec) + if (instanceManager != null) { + channel.setMessageHandler { _, reply -> + val wrapped: List = + try { + instanceManager.clear() + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + } + } + + fun removeStrongReference(identifierArg: Long, callback: (Result) -> Unit) { + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.PigeonInternalInstanceManager.removeStrongReference" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(identifierArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } +} +/** + * Provides implementations for each ProxyApi implementation and provides access to resources needed + * by any implementation. + */ +abstract class ProxyApiTestsPigeonProxyApiRegistrar(val binaryMessenger: BinaryMessenger) { + /** Whether APIs should ignore calling to Dart. */ + public var ignoreCallsToDart = false + val instanceManager: ProxyApiTestsPigeonInstanceManager + private var _codec: MessageCodec? = null + val codec: MessageCodec + get() { + if (_codec == null) { + _codec = ProxyApiTestsPigeonProxyApiBaseCodec(this) + } + return _codec!! + } + + init { + val api = ProxyApiTestsPigeonInstanceManagerApi(binaryMessenger) + instanceManager = + ProxyApiTestsPigeonInstanceManager.create( + object : ProxyApiTestsPigeonInstanceManager.PigeonFinalizationListener { + override fun onFinalize(identifier: Long) { + api.removeStrongReference(identifier) { + if (it.isFailure) { + Log.e( + "PigeonProxyApiRegistrar", + "Failed to remove Dart strong reference with identifier: $identifier") + } + } + } + }) + } + /** + * An implementation of [PigeonApiProxyApiTestClass] used to add a new Dart instance of + * `ProxyApiTestClass` to the Dart `InstanceManager`. + */ + abstract fun getPigeonApiProxyApiTestClass(): PigeonApiProxyApiTestClass + + /** + * An implementation of [PigeonApiProxyApiSuperClass] used to add a new Dart instance of + * `ProxyApiSuperClass` to the Dart `InstanceManager`. + */ + abstract fun getPigeonApiProxyApiSuperClass(): PigeonApiProxyApiSuperClass + + /** + * An implementation of [PigeonApiProxyApiInterface] used to add a new Dart instance of + * `ProxyApiInterface` to the Dart `InstanceManager`. + */ + open fun getPigeonApiProxyApiInterface(): PigeonApiProxyApiInterface { + return PigeonApiProxyApiInterface(this) + } + + /** + * An implementation of [PigeonApiClassWithApiRequirement] used to add a new Dart instance of + * `ClassWithApiRequirement` to the Dart `InstanceManager`. + */ + abstract fun getPigeonApiClassWithApiRequirement(): PigeonApiClassWithApiRequirement + + fun setUp() { + ProxyApiTestsPigeonInstanceManagerApi.setUpMessageHandlers(binaryMessenger, instanceManager) + PigeonApiProxyApiTestClass.setUpMessageHandlers( + binaryMessenger, getPigeonApiProxyApiTestClass()) + PigeonApiProxyApiSuperClass.setUpMessageHandlers( + binaryMessenger, getPigeonApiProxyApiSuperClass()) + PigeonApiClassWithApiRequirement.setUpMessageHandlers( + binaryMessenger, getPigeonApiClassWithApiRequirement()) + } + + fun tearDown() { + ProxyApiTestsPigeonInstanceManagerApi.setUpMessageHandlers(binaryMessenger, null) + PigeonApiProxyApiTestClass.setUpMessageHandlers(binaryMessenger, null) + PigeonApiProxyApiSuperClass.setUpMessageHandlers(binaryMessenger, null) + PigeonApiClassWithApiRequirement.setUpMessageHandlers(binaryMessenger, null) + } +} + +private class ProxyApiTestsPigeonProxyApiBaseCodec( + val registrar: ProxyApiTestsPigeonProxyApiRegistrar +) : ProxyApiTestsPigeonCodec() { + override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { + return when (type) { + 128.toByte() -> { + return registrar.instanceManager.getInstance(readValue(buffer) as Long) + } + else -> super.readValueOfType(type, buffer) + } + } + + override fun writeValue(stream: ByteArrayOutputStream, value: Any?) { + if (value is Boolean || + value is ByteArray || + value is Double || + value is DoubleArray || + value is FloatArray || + value is Int || + value is IntArray || + value is List<*> || + value is Long || + value is LongArray || + value is Map<*, *> || + value is String || + value is ProxyApiTestEnum || + value == null) { + super.writeValue(stream, value) + return + } + + if (value is ProxyApiTestClass) { + registrar.getPigeonApiProxyApiTestClass().pigeon_newInstance(value) {} + } else if (value is com.example.test_plugin.ProxyApiSuperClass) { + registrar.getPigeonApiProxyApiSuperClass().pigeon_newInstance(value) {} + } else if (value is ProxyApiInterface) { + registrar.getPigeonApiProxyApiInterface().pigeon_newInstance(value) {} + } else if (android.os.Build.VERSION.SDK_INT >= 25 && value is ClassWithApiRequirement) { + registrar.getPigeonApiClassWithApiRequirement().pigeon_newInstance(value) {} + } + + when { + registrar.instanceManager.containsInstance(value) -> { + stream.write(128) + writeValue(stream, registrar.instanceManager.getIdentifierForStrongReference(value)) + } + else -> + throw IllegalArgumentException( + "Unsupported value: '$value' of type '${value.javaClass.name}'") + } + } +} + +enum class ProxyApiTestEnum(val raw: Int) { + ONE(0), + TWO(1), + THREE(2); + + companion object { + fun ofRaw(raw: Int): ProxyApiTestEnum? { + return values().firstOrNull { it.raw == raw } + } + } +} + +private open class ProxyApiTestsPigeonCodec : StandardMessageCodec() { + override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { + return when (type) { + 129.toByte() -> { + return (readValue(buffer) as Long?)?.let { ProxyApiTestEnum.ofRaw(it.toInt()) } + } + else -> super.readValueOfType(type, buffer) + } + } + + override fun writeValue(stream: ByteArrayOutputStream, value: Any?) { + when (value) { + is ProxyApiTestEnum -> { + stream.write(129) + writeValue(stream, value.raw) + } + else -> super.writeValue(stream, value) + } + } +} + +/** + * The core ProxyApi test class that each supported host language must implement in platform_tests + * integration tests. + */ +@Suppress("UNCHECKED_CAST") +abstract class PigeonApiProxyApiTestClass( + open val pigeonRegistrar: ProxyApiTestsPigeonProxyApiRegistrar +) { + abstract fun pigeon_defaultConstructor( + aBool: Boolean, + anInt: Long, + aDouble: Double, + aString: String, + aUint8List: ByteArray, + aList: List, + aMap: Map, + anEnum: ProxyApiTestEnum, + aProxyApi: com.example.test_plugin.ProxyApiSuperClass, + aNullableBool: Boolean?, + aNullableInt: Long?, + aNullableDouble: Double?, + aNullableString: String?, + aNullableUint8List: ByteArray?, + aNullableList: List?, + aNullableMap: Map?, + aNullableEnum: ProxyApiTestEnum?, + aNullableProxyApi: com.example.test_plugin.ProxyApiSuperClass?, + boolParam: Boolean, + intParam: Long, + doubleParam: Double, + stringParam: String, + aUint8ListParam: ByteArray, + listParam: List, + mapParam: Map, + enumParam: ProxyApiTestEnum, + proxyApiParam: com.example.test_plugin.ProxyApiSuperClass, + nullableBoolParam: Boolean?, + nullableIntParam: Long?, + nullableDoubleParam: Double?, + nullableStringParam: String?, + nullableUint8ListParam: ByteArray?, + nullableListParam: List?, + nullableMapParam: Map?, + nullableEnumParam: ProxyApiTestEnum?, + nullableProxyApiParam: com.example.test_plugin.ProxyApiSuperClass? + ): ProxyApiTestClass + + abstract fun attachedField( + pigeon_instance: ProxyApiTestClass + ): com.example.test_plugin.ProxyApiSuperClass + + abstract fun staticAttachedField(): com.example.test_plugin.ProxyApiSuperClass + + abstract fun aBool(pigeon_instance: ProxyApiTestClass): Boolean + + abstract fun anInt(pigeon_instance: ProxyApiTestClass): Long + + abstract fun aDouble(pigeon_instance: ProxyApiTestClass): Double + + abstract fun aString(pigeon_instance: ProxyApiTestClass): String + + abstract fun aUint8List(pigeon_instance: ProxyApiTestClass): ByteArray + + abstract fun aList(pigeon_instance: ProxyApiTestClass): List + + abstract fun aMap(pigeon_instance: ProxyApiTestClass): Map + + abstract fun anEnum(pigeon_instance: ProxyApiTestClass): ProxyApiTestEnum + + abstract fun aProxyApi( + pigeon_instance: ProxyApiTestClass + ): com.example.test_plugin.ProxyApiSuperClass + + abstract fun aNullableBool(pigeon_instance: ProxyApiTestClass): Boolean? + + abstract fun aNullableInt(pigeon_instance: ProxyApiTestClass): Long? + + abstract fun aNullableDouble(pigeon_instance: ProxyApiTestClass): Double? + + abstract fun aNullableString(pigeon_instance: ProxyApiTestClass): String? + + abstract fun aNullableUint8List(pigeon_instance: ProxyApiTestClass): ByteArray? + + abstract fun aNullableList(pigeon_instance: ProxyApiTestClass): List? + + abstract fun aNullableMap(pigeon_instance: ProxyApiTestClass): Map? + + abstract fun aNullableEnum(pigeon_instance: ProxyApiTestClass): ProxyApiTestEnum? + + abstract fun aNullableProxyApi( + pigeon_instance: ProxyApiTestClass + ): com.example.test_plugin.ProxyApiSuperClass? + + /** A no-op function taking no arguments and returning no value, to sanity test basic calling. */ + abstract fun noop(pigeon_instance: ProxyApiTestClass) + + /** Returns an error, to test error handling. */ + abstract fun throwError(pigeon_instance: ProxyApiTestClass): Any? + + /** Returns an error from a void function, to test error handling. */ + abstract fun throwErrorFromVoid(pigeon_instance: ProxyApiTestClass) + + /** Returns a Flutter error, to test error handling. */ + abstract fun throwFlutterError(pigeon_instance: ProxyApiTestClass): Any? + + /** Returns passed in int. */ + abstract fun echoInt(pigeon_instance: ProxyApiTestClass, anInt: Long): Long + + /** Returns passed in double. */ + abstract fun echoDouble(pigeon_instance: ProxyApiTestClass, aDouble: Double): Double + + /** Returns the passed in boolean. */ + abstract fun echoBool(pigeon_instance: ProxyApiTestClass, aBool: Boolean): Boolean + + /** Returns the passed in string. */ + abstract fun echoString(pigeon_instance: ProxyApiTestClass, aString: String): String + + /** Returns the passed in Uint8List. */ + abstract fun echoUint8List(pigeon_instance: ProxyApiTestClass, aUint8List: ByteArray): ByteArray + + /** Returns the passed in generic Object. */ + abstract fun echoObject(pigeon_instance: ProxyApiTestClass, anObject: Any): Any + + /** Returns the passed list, to test serialization and deserialization. */ + abstract fun echoList(pigeon_instance: ProxyApiTestClass, aList: List): List + + /** Returns the passed list with ProxyApis, to test serialization and deserialization. */ + abstract fun echoProxyApiList( + pigeon_instance: ProxyApiTestClass, + aList: List + ): List + + /** Returns the passed map, to test serialization and deserialization. */ + abstract fun echoMap( + pigeon_instance: ProxyApiTestClass, + aMap: Map + ): Map + + /** Returns the passed map with ProxyApis, to test serialization and deserialization. */ + abstract fun echoProxyApiMap( + pigeon_instance: ProxyApiTestClass, + aMap: Map + ): Map + + /** Returns the passed enum to test serialization and deserialization. */ + abstract fun echoEnum( + pigeon_instance: ProxyApiTestClass, + anEnum: ProxyApiTestEnum + ): ProxyApiTestEnum + + /** Returns the passed ProxyApi to test serialization and deserialization. */ + abstract fun echoProxyApi( + pigeon_instance: ProxyApiTestClass, + aProxyApi: com.example.test_plugin.ProxyApiSuperClass + ): com.example.test_plugin.ProxyApiSuperClass + + /** Returns passed in int. */ + abstract fun echoNullableInt(pigeon_instance: ProxyApiTestClass, aNullableInt: Long?): Long? + + /** Returns passed in double. */ + abstract fun echoNullableDouble( + pigeon_instance: ProxyApiTestClass, + aNullableDouble: Double? + ): Double? + + /** Returns the passed in boolean. */ + abstract fun echoNullableBool( + pigeon_instance: ProxyApiTestClass, + aNullableBool: Boolean? + ): Boolean? + + /** Returns the passed in string. */ + abstract fun echoNullableString( + pigeon_instance: ProxyApiTestClass, + aNullableString: String? + ): String? + + /** Returns the passed in Uint8List. */ + abstract fun echoNullableUint8List( + pigeon_instance: ProxyApiTestClass, + aNullableUint8List: ByteArray? + ): ByteArray? + + /** Returns the passed in generic Object. */ + abstract fun echoNullableObject(pigeon_instance: ProxyApiTestClass, aNullableObject: Any?): Any? + + /** Returns the passed list, to test serialization and deserialization. */ + abstract fun echoNullableList( + pigeon_instance: ProxyApiTestClass, + aNullableList: List? + ): List? + + /** Returns the passed map, to test serialization and deserialization. */ + abstract fun echoNullableMap( + pigeon_instance: ProxyApiTestClass, + aNullableMap: Map? + ): Map? + + abstract fun echoNullableEnum( + pigeon_instance: ProxyApiTestClass, + aNullableEnum: ProxyApiTestEnum? + ): ProxyApiTestEnum? + + /** Returns the passed ProxyApi to test serialization and deserialization. */ + abstract fun echoNullableProxyApi( + pigeon_instance: ProxyApiTestClass, + aNullableProxyApi: com.example.test_plugin.ProxyApiSuperClass? + ): com.example.test_plugin.ProxyApiSuperClass? + + /** + * A no-op function taking no arguments and returning no value, to sanity test basic asynchronous + * calling. + */ + abstract fun noopAsync(pigeon_instance: ProxyApiTestClass, callback: (Result) -> Unit) + + /** Returns passed in int asynchronously. */ + abstract fun echoAsyncInt( + pigeon_instance: ProxyApiTestClass, + anInt: Long, + callback: (Result) -> Unit + ) + + /** Returns passed in double asynchronously. */ + abstract fun echoAsyncDouble( + pigeon_instance: ProxyApiTestClass, + aDouble: Double, + callback: (Result) -> Unit + ) + + /** Returns the passed in boolean asynchronously. */ + abstract fun echoAsyncBool( + pigeon_instance: ProxyApiTestClass, + aBool: Boolean, + callback: (Result) -> Unit + ) + + /** Returns the passed string asynchronously. */ + abstract fun echoAsyncString( + pigeon_instance: ProxyApiTestClass, + aString: String, + callback: (Result) -> Unit + ) + + /** Returns the passed in Uint8List asynchronously. */ + abstract fun echoAsyncUint8List( + pigeon_instance: ProxyApiTestClass, + aUint8List: ByteArray, + callback: (Result) -> Unit + ) + + /** Returns the passed in generic Object asynchronously. */ + abstract fun echoAsyncObject( + pigeon_instance: ProxyApiTestClass, + anObject: Any, + callback: (Result) -> Unit + ) + + /** Returns the passed list, to test asynchronous serialization and deserialization. */ + abstract fun echoAsyncList( + pigeon_instance: ProxyApiTestClass, + aList: List, + callback: (Result>) -> Unit + ) + + /** Returns the passed map, to test asynchronous serialization and deserialization. */ + abstract fun echoAsyncMap( + pigeon_instance: ProxyApiTestClass, + aMap: Map, + callback: (Result>) -> Unit + ) + + /** Returns the passed enum, to test asynchronous serialization and deserialization. */ + abstract fun echoAsyncEnum( + pigeon_instance: ProxyApiTestClass, + anEnum: ProxyApiTestEnum, + callback: (Result) -> Unit + ) + + /** Responds with an error from an async function returning a value. */ + abstract fun throwAsyncError(pigeon_instance: ProxyApiTestClass, callback: (Result) -> Unit) + + /** Responds with an error from an async void function. */ + abstract fun throwAsyncErrorFromVoid( + pigeon_instance: ProxyApiTestClass, + callback: (Result) -> Unit + ) + + /** Responds with a Flutter error from an async function returning a value. */ + abstract fun throwAsyncFlutterError( + pigeon_instance: ProxyApiTestClass, + callback: (Result) -> Unit + ) + + /** Returns passed in int asynchronously. */ + abstract fun echoAsyncNullableInt( + pigeon_instance: ProxyApiTestClass, + anInt: Long?, + callback: (Result) -> Unit + ) + + /** Returns passed in double asynchronously. */ + abstract fun echoAsyncNullableDouble( + pigeon_instance: ProxyApiTestClass, + aDouble: Double?, + callback: (Result) -> Unit + ) + + /** Returns the passed in boolean asynchronously. */ + abstract fun echoAsyncNullableBool( + pigeon_instance: ProxyApiTestClass, + aBool: Boolean?, + callback: (Result) -> Unit + ) + + /** Returns the passed string asynchronously. */ + abstract fun echoAsyncNullableString( + pigeon_instance: ProxyApiTestClass, + aString: String?, + callback: (Result) -> Unit + ) + + /** Returns the passed in Uint8List asynchronously. */ + abstract fun echoAsyncNullableUint8List( + pigeon_instance: ProxyApiTestClass, + aUint8List: ByteArray?, + callback: (Result) -> Unit + ) + + /** Returns the passed in generic Object asynchronously. */ + abstract fun echoAsyncNullableObject( + pigeon_instance: ProxyApiTestClass, + anObject: Any?, + callback: (Result) -> Unit + ) + + /** Returns the passed list, to test asynchronous serialization and deserialization. */ + abstract fun echoAsyncNullableList( + pigeon_instance: ProxyApiTestClass, + aList: List?, + callback: (Result?>) -> Unit + ) + + /** Returns the passed map, to test asynchronous serialization and deserialization. */ + abstract fun echoAsyncNullableMap( + pigeon_instance: ProxyApiTestClass, + aMap: Map?, + callback: (Result?>) -> Unit + ) + + /** Returns the passed enum, to test asynchronous serialization and deserialization. */ + abstract fun echoAsyncNullableEnum( + pigeon_instance: ProxyApiTestClass, + anEnum: ProxyApiTestEnum?, + callback: (Result) -> Unit + ) + + abstract fun staticNoop() + + abstract fun echoStaticString(aString: String): String + + abstract fun staticAsyncNoop(callback: (Result) -> Unit) + + abstract fun callFlutterNoop(pigeon_instance: ProxyApiTestClass, callback: (Result) -> Unit) + + abstract fun callFlutterThrowError( + pigeon_instance: ProxyApiTestClass, + callback: (Result) -> Unit + ) + + abstract fun callFlutterThrowErrorFromVoid( + pigeon_instance: ProxyApiTestClass, + callback: (Result) -> Unit + ) + + abstract fun callFlutterEchoBool( + pigeon_instance: ProxyApiTestClass, + aBool: Boolean, + callback: (Result) -> Unit + ) + + abstract fun callFlutterEchoInt( + pigeon_instance: ProxyApiTestClass, + anInt: Long, + callback: (Result) -> Unit + ) + + abstract fun callFlutterEchoDouble( + pigeon_instance: ProxyApiTestClass, + aDouble: Double, + callback: (Result) -> Unit + ) + + abstract fun callFlutterEchoString( + pigeon_instance: ProxyApiTestClass, + aString: String, + callback: (Result) -> Unit + ) + + abstract fun callFlutterEchoUint8List( + pigeon_instance: ProxyApiTestClass, + aUint8List: ByteArray, + callback: (Result) -> Unit + ) + + abstract fun callFlutterEchoList( + pigeon_instance: ProxyApiTestClass, + aList: List, + callback: (Result>) -> Unit + ) + + abstract fun callFlutterEchoProxyApiList( + pigeon_instance: ProxyApiTestClass, + aList: List, + callback: (Result>) -> Unit + ) + + abstract fun callFlutterEchoMap( + pigeon_instance: ProxyApiTestClass, + aMap: Map, + callback: (Result>) -> Unit + ) + + abstract fun callFlutterEchoProxyApiMap( + pigeon_instance: ProxyApiTestClass, + aMap: Map, + callback: (Result>) -> Unit + ) + + abstract fun callFlutterEchoEnum( + pigeon_instance: ProxyApiTestClass, + anEnum: ProxyApiTestEnum, + callback: (Result) -> Unit + ) + + abstract fun callFlutterEchoProxyApi( + pigeon_instance: ProxyApiTestClass, + aProxyApi: com.example.test_plugin.ProxyApiSuperClass, + callback: (Result) -> Unit + ) + + abstract fun callFlutterEchoNullableBool( + pigeon_instance: ProxyApiTestClass, + aBool: Boolean?, + callback: (Result) -> Unit + ) + + abstract fun callFlutterEchoNullableInt( + pigeon_instance: ProxyApiTestClass, + anInt: Long?, + callback: (Result) -> Unit + ) + + abstract fun callFlutterEchoNullableDouble( + pigeon_instance: ProxyApiTestClass, + aDouble: Double?, + callback: (Result) -> Unit + ) + + abstract fun callFlutterEchoNullableString( + pigeon_instance: ProxyApiTestClass, + aString: String?, + callback: (Result) -> Unit + ) + + abstract fun callFlutterEchoNullableUint8List( + pigeon_instance: ProxyApiTestClass, + aUint8List: ByteArray?, + callback: (Result) -> Unit + ) + + abstract fun callFlutterEchoNullableList( + pigeon_instance: ProxyApiTestClass, + aList: List?, + callback: (Result?>) -> Unit + ) + + abstract fun callFlutterEchoNullableMap( + pigeon_instance: ProxyApiTestClass, + aMap: Map?, + callback: (Result?>) -> Unit + ) + + abstract fun callFlutterEchoNullableEnum( + pigeon_instance: ProxyApiTestClass, + anEnum: ProxyApiTestEnum?, + callback: (Result) -> Unit + ) + + abstract fun callFlutterEchoNullableProxyApi( + pigeon_instance: ProxyApiTestClass, + aProxyApi: com.example.test_plugin.ProxyApiSuperClass?, + callback: (Result) -> Unit + ) + + abstract fun callFlutterNoopAsync( + pigeon_instance: ProxyApiTestClass, + callback: (Result) -> Unit + ) + + abstract fun callFlutterEchoAsyncString( + pigeon_instance: ProxyApiTestClass, + aString: String, + callback: (Result) -> Unit + ) + + companion object { + @Suppress("LocalVariableName") + fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiProxyApiTestClass?) { + val codec = api?.pigeonRegistrar?.codec ?: ProxyApiTestsPigeonCodec() + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.pigeon_defaultConstructor", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_identifierArg = args[0] as Long + val aBoolArg = args[1] as Boolean + val anIntArg = args[2] as Long + val aDoubleArg = args[3] as Double + val aStringArg = args[4] as String + val aUint8ListArg = args[5] as ByteArray + val aListArg = args[6] as List + val aMapArg = args[7] as Map + val anEnumArg = args[8] as ProxyApiTestEnum + val aProxyApiArg = args[9] as com.example.test_plugin.ProxyApiSuperClass + val aNullableBoolArg = args[10] as Boolean? + val aNullableIntArg = args[11] as Long? + val aNullableDoubleArg = args[12] as Double? + val aNullableStringArg = args[13] as String? + val aNullableUint8ListArg = args[14] as ByteArray? + val aNullableListArg = args[15] as List? + val aNullableMapArg = args[16] as Map? + val aNullableEnumArg = args[17] as ProxyApiTestEnum? + val aNullableProxyApiArg = args[18] as com.example.test_plugin.ProxyApiSuperClass? + val boolParamArg = args[19] as Boolean + val intParamArg = args[20] as Long + val doubleParamArg = args[21] as Double + val stringParamArg = args[22] as String + val aUint8ListParamArg = args[23] as ByteArray + val listParamArg = args[24] as List + val mapParamArg = args[25] as Map + val enumParamArg = args[26] as ProxyApiTestEnum + val proxyApiParamArg = args[27] as com.example.test_plugin.ProxyApiSuperClass + val nullableBoolParamArg = args[28] as Boolean? + val nullableIntParamArg = args[29] as Long? + val nullableDoubleParamArg = args[30] as Double? + val nullableStringParamArg = args[31] as String? + val nullableUint8ListParamArg = args[32] as ByteArray? + val nullableListParamArg = args[33] as List? + val nullableMapParamArg = args[34] as Map? + val nullableEnumParamArg = args[35] as ProxyApiTestEnum? + val nullableProxyApiParamArg = args[36] as com.example.test_plugin.ProxyApiSuperClass? + val wrapped: List = + try { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + api.pigeon_defaultConstructor( + aBoolArg, + anIntArg, + aDoubleArg, + aStringArg, + aUint8ListArg, + aListArg, + aMapArg, + anEnumArg, + aProxyApiArg, + aNullableBoolArg, + aNullableIntArg, + aNullableDoubleArg, + aNullableStringArg, + aNullableUint8ListArg, + aNullableListArg, + aNullableMapArg, + aNullableEnumArg, + aNullableProxyApiArg, + boolParamArg, + intParamArg, + doubleParamArg, + stringParamArg, + aUint8ListParamArg, + listParamArg, + mapParamArg, + enumParamArg, + proxyApiParamArg, + nullableBoolParamArg, + nullableIntParamArg, + nullableDoubleParamArg, + nullableStringParamArg, + nullableUint8ListParamArg, + nullableListParamArg, + nullableMapParamArg, + nullableEnumParamArg, + nullableProxyApiParamArg), + pigeon_identifierArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.attachedField", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val pigeon_identifierArg = args[1] as Long + val wrapped: List = + try { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + api.attachedField(pigeon_instanceArg), pigeon_identifierArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.staticAttachedField", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_identifierArg = args[0] as Long + val wrapped: List = + try { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + api.staticAttachedField(), pigeon_identifierArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.noop", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val wrapped: List = + try { + api.noop(pigeon_instanceArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.throwError", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val wrapped: List = + try { + listOf(api.throwError(pigeon_instanceArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.throwErrorFromVoid", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val wrapped: List = + try { + api.throwErrorFromVoid(pigeon_instanceArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.throwFlutterError", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val wrapped: List = + try { + listOf(api.throwFlutterError(pigeon_instanceArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoInt", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val anIntArg = args[1] as Long + val wrapped: List = + try { + listOf(api.echoInt(pigeon_instanceArg, anIntArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoDouble", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aDoubleArg = args[1] as Double + val wrapped: List = + try { + listOf(api.echoDouble(pigeon_instanceArg, aDoubleArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoBool", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aBoolArg = args[1] as Boolean + val wrapped: List = + try { + listOf(api.echoBool(pigeon_instanceArg, aBoolArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoString", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aStringArg = args[1] as String + val wrapped: List = + try { + listOf(api.echoString(pigeon_instanceArg, aStringArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoUint8List", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aUint8ListArg = args[1] as ByteArray + val wrapped: List = + try { + listOf(api.echoUint8List(pigeon_instanceArg, aUint8ListArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoObject", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val anObjectArg = args[1] as Any + val wrapped: List = + try { + listOf(api.echoObject(pigeon_instanceArg, anObjectArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoList", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aListArg = args[1] as List + val wrapped: List = + try { + listOf(api.echoList(pigeon_instanceArg, aListArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoProxyApiList", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aListArg = args[1] as List + val wrapped: List = + try { + listOf(api.echoProxyApiList(pigeon_instanceArg, aListArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoMap", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aMapArg = args[1] as Map + val wrapped: List = + try { + listOf(api.echoMap(pigeon_instanceArg, aMapArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoProxyApiMap", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aMapArg = args[1] as Map + val wrapped: List = + try { + listOf(api.echoProxyApiMap(pigeon_instanceArg, aMapArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoEnum", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val anEnumArg = args[1] as ProxyApiTestEnum + val wrapped: List = + try { + listOf(api.echoEnum(pigeon_instanceArg, anEnumArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoProxyApi", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aProxyApiArg = args[1] as com.example.test_plugin.ProxyApiSuperClass + val wrapped: List = + try { + listOf(api.echoProxyApi(pigeon_instanceArg, aProxyApiArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableInt", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aNullableIntArg = args[1] as Long? + val wrapped: List = + try { + listOf(api.echoNullableInt(pigeon_instanceArg, aNullableIntArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableDouble", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aNullableDoubleArg = args[1] as Double? + val wrapped: List = + try { + listOf(api.echoNullableDouble(pigeon_instanceArg, aNullableDoubleArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableBool", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aNullableBoolArg = args[1] as Boolean? + val wrapped: List = + try { + listOf(api.echoNullableBool(pigeon_instanceArg, aNullableBoolArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableString", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aNullableStringArg = args[1] as String? + val wrapped: List = + try { + listOf(api.echoNullableString(pigeon_instanceArg, aNullableStringArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableUint8List", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aNullableUint8ListArg = args[1] as ByteArray? + val wrapped: List = + try { + listOf(api.echoNullableUint8List(pigeon_instanceArg, aNullableUint8ListArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableObject", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aNullableObjectArg = args[1] + val wrapped: List = + try { + listOf(api.echoNullableObject(pigeon_instanceArg, aNullableObjectArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableList", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aNullableListArg = args[1] as List? + val wrapped: List = + try { + listOf(api.echoNullableList(pigeon_instanceArg, aNullableListArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableMap", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aNullableMapArg = args[1] as Map? + val wrapped: List = + try { + listOf(api.echoNullableMap(pigeon_instanceArg, aNullableMapArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableEnum", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aNullableEnumArg = args[1] as ProxyApiTestEnum? + val wrapped: List = + try { + listOf(api.echoNullableEnum(pigeon_instanceArg, aNullableEnumArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableProxyApi", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aNullableProxyApiArg = args[1] as com.example.test_plugin.ProxyApiSuperClass? + val wrapped: List = + try { + listOf(api.echoNullableProxyApi(pigeon_instanceArg, aNullableProxyApiArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.noopAsync", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + api.noopAsync(pigeon_instanceArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + reply.reply(wrapResult(null)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncInt", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val anIntArg = args[1] as Long + api.echoAsyncInt(pigeon_instanceArg, anIntArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncDouble", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aDoubleArg = args[1] as Double + api.echoAsyncDouble(pigeon_instanceArg, aDoubleArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncBool", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aBoolArg = args[1] as Boolean + api.echoAsyncBool(pigeon_instanceArg, aBoolArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncString", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aStringArg = args[1] as String + api.echoAsyncString(pigeon_instanceArg, aStringArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncUint8List", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aUint8ListArg = args[1] as ByteArray + api.echoAsyncUint8List(pigeon_instanceArg, aUint8ListArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncObject", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val anObjectArg = args[1] as Any + api.echoAsyncObject(pigeon_instanceArg, anObjectArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncList", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aListArg = args[1] as List + api.echoAsyncList(pigeon_instanceArg, aListArg) { result: Result> -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncMap", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aMapArg = args[1] as Map + api.echoAsyncMap(pigeon_instanceArg, aMapArg) { result: Result> -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncEnum", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val anEnumArg = args[1] as ProxyApiTestEnum + api.echoAsyncEnum(pigeon_instanceArg, anEnumArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.throwAsyncError", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + api.throwAsyncError(pigeon_instanceArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.throwAsyncErrorFromVoid", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + api.throwAsyncErrorFromVoid(pigeon_instanceArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + reply.reply(wrapResult(null)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.throwAsyncFlutterError", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + api.throwAsyncFlutterError(pigeon_instanceArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableInt", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val anIntArg = args[1] as Long? + api.echoAsyncNullableInt(pigeon_instanceArg, anIntArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableDouble", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aDoubleArg = args[1] as Double? + api.echoAsyncNullableDouble(pigeon_instanceArg, aDoubleArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableBool", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aBoolArg = args[1] as Boolean? + api.echoAsyncNullableBool(pigeon_instanceArg, aBoolArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableString", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aStringArg = args[1] as String? + api.echoAsyncNullableString(pigeon_instanceArg, aStringArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableUint8List", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aUint8ListArg = args[1] as ByteArray? + api.echoAsyncNullableUint8List(pigeon_instanceArg, aUint8ListArg) { + result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableObject", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val anObjectArg = args[1] + api.echoAsyncNullableObject(pigeon_instanceArg, anObjectArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableList", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aListArg = args[1] as List? + api.echoAsyncNullableList(pigeon_instanceArg, aListArg) { result: Result?> -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableMap", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aMapArg = args[1] as Map? + api.echoAsyncNullableMap(pigeon_instanceArg, aMapArg) { + result: Result?> -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableEnum", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val anEnumArg = args[1] as ProxyApiTestEnum? + api.echoAsyncNullableEnum(pigeon_instanceArg, anEnumArg) { + result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.staticNoop", + codec) + if (api != null) { + channel.setMessageHandler { _, reply -> + val wrapped: List = + try { + api.staticNoop() + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoStaticString", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val aStringArg = args[0] as String + val wrapped: List = + try { + listOf(api.echoStaticString(aStringArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.staticAsyncNoop", + codec) + if (api != null) { + channel.setMessageHandler { _, reply -> + api.staticAsyncNoop { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + reply.reply(wrapResult(null)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterNoop", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + api.callFlutterNoop(pigeon_instanceArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + reply.reply(wrapResult(null)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterThrowError", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + api.callFlutterThrowError(pigeon_instanceArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterThrowErrorFromVoid", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + api.callFlutterThrowErrorFromVoid(pigeon_instanceArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + reply.reply(wrapResult(null)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoBool", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aBoolArg = args[1] as Boolean + api.callFlutterEchoBool(pigeon_instanceArg, aBoolArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoInt", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val anIntArg = args[1] as Long + api.callFlutterEchoInt(pigeon_instanceArg, anIntArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoDouble", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aDoubleArg = args[1] as Double + api.callFlutterEchoDouble(pigeon_instanceArg, aDoubleArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoString", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aStringArg = args[1] as String + api.callFlutterEchoString(pigeon_instanceArg, aStringArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoUint8List", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aUint8ListArg = args[1] as ByteArray + api.callFlutterEchoUint8List(pigeon_instanceArg, aUint8ListArg) { + result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoList", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aListArg = args[1] as List + api.callFlutterEchoList(pigeon_instanceArg, aListArg) { result: Result> -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoProxyApiList", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aListArg = args[1] as List + api.callFlutterEchoProxyApiList(pigeon_instanceArg, aListArg) { + result: Result> -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoMap", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aMapArg = args[1] as Map + api.callFlutterEchoMap(pigeon_instanceArg, aMapArg) { result: Result> + -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoProxyApiMap", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aMapArg = args[1] as Map + api.callFlutterEchoProxyApiMap(pigeon_instanceArg, aMapArg) { + result: Result> -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoEnum", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val anEnumArg = args[1] as ProxyApiTestEnum + api.callFlutterEchoEnum(pigeon_instanceArg, anEnumArg) { + result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoProxyApi", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aProxyApiArg = args[1] as com.example.test_plugin.ProxyApiSuperClass + api.callFlutterEchoProxyApi(pigeon_instanceArg, aProxyApiArg) { + result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableBool", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aBoolArg = args[1] as Boolean? + api.callFlutterEchoNullableBool(pigeon_instanceArg, aBoolArg) { result: Result + -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableInt", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val anIntArg = args[1] as Long? + api.callFlutterEchoNullableInt(pigeon_instanceArg, anIntArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableDouble", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aDoubleArg = args[1] as Double? + api.callFlutterEchoNullableDouble(pigeon_instanceArg, aDoubleArg) { + result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableString", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aStringArg = args[1] as String? + api.callFlutterEchoNullableString(pigeon_instanceArg, aStringArg) { + result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableUint8List", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aUint8ListArg = args[1] as ByteArray? + api.callFlutterEchoNullableUint8List(pigeon_instanceArg, aUint8ListArg) { + result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableList", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aListArg = args[1] as List? + api.callFlutterEchoNullableList(pigeon_instanceArg, aListArg) { + result: Result?> -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableMap", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aMapArg = args[1] as Map? + api.callFlutterEchoNullableMap(pigeon_instanceArg, aMapArg) { + result: Result?> -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableEnum", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val anEnumArg = args[1] as ProxyApiTestEnum? + api.callFlutterEchoNullableEnum(pigeon_instanceArg, anEnumArg) { + result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableProxyApi", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aProxyApiArg = args[1] as com.example.test_plugin.ProxyApiSuperClass? + api.callFlutterEchoNullableProxyApi(pigeon_instanceArg, aProxyApiArg) { + result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterNoopAsync", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + api.callFlutterNoopAsync(pigeon_instanceArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + reply.reply(wrapResult(null)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoAsyncString", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aStringArg = args[1] as String + api.callFlutterEchoAsyncString(pigeon_instanceArg, aStringArg) { result: Result + -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + } + } + + @Suppress("LocalVariableName", "FunctionName") + /** Creates a Dart instance of ProxyApiTestClass and attaches it to [pigeon_instanceArg]. */ + fun pigeon_newInstance(pigeon_instanceArg: ProxyApiTestClass, callback: (Result) -> Unit) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } + if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + Result.success(Unit) + return + } + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val aBoolArg = aBool(pigeon_instanceArg) + val anIntArg = anInt(pigeon_instanceArg) + val aDoubleArg = aDouble(pigeon_instanceArg) + val aStringArg = aString(pigeon_instanceArg) + val aUint8ListArg = aUint8List(pigeon_instanceArg) + val aListArg = aList(pigeon_instanceArg) + val aMapArg = aMap(pigeon_instanceArg) + val anEnumArg = anEnum(pigeon_instanceArg) + val aProxyApiArg = aProxyApi(pigeon_instanceArg) + val aNullableBoolArg = aNullableBool(pigeon_instanceArg) + val aNullableIntArg = aNullableInt(pigeon_instanceArg) + val aNullableDoubleArg = aNullableDouble(pigeon_instanceArg) + val aNullableStringArg = aNullableString(pigeon_instanceArg) + val aNullableUint8ListArg = aNullableUint8List(pigeon_instanceArg) + val aNullableListArg = aNullableList(pigeon_instanceArg) + val aNullableMapArg = aNullableMap(pigeon_instanceArg) + val aNullableEnumArg = aNullableEnum(pigeon_instanceArg) + val aNullableProxyApiArg = aNullableProxyApi(pigeon_instanceArg) + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.pigeon_newInstance" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send( + listOf( + pigeon_identifierArg, + aBoolArg, + anIntArg, + aDoubleArg, + aStringArg, + aUint8ListArg, + aListArg, + aMapArg, + anEnumArg, + aProxyApiArg, + aNullableBoolArg, + aNullableIntArg, + aNullableDoubleArg, + aNullableStringArg, + aNullableUint8ListArg, + aNullableListArg, + aNullableMapArg, + aNullableEnumArg, + aNullableProxyApiArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** A no-op function taking no arguments and returning no value, to sanity test basic calling. */ + fun flutterNoop(pigeon_instanceArg: ProxyApiTestClass, callback: (Result) -> Unit) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterNoop" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** Responds with an error from an async function returning a value. */ + fun flutterThrowError(pigeon_instanceArg: ProxyApiTestClass, callback: (Result) -> Unit) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterThrowError" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + val output = it[0] + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** Responds with an error from an async void function. */ + fun flutterThrowErrorFromVoid( + pigeon_instanceArg: ProxyApiTestClass, + callback: (Result) -> Unit + ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterThrowErrorFromVoid" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** Returns the passed boolean, to test serialization and deserialization. */ + fun flutterEchoBool( + pigeon_instanceArg: ProxyApiTestClass, + aBoolArg: Boolean, + callback: (Result) -> Unit + ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoBool" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg, aBoolArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else if (it[0] == null) { + callback( + Result.failure( + ProxyApiTestsError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) + } else { + val output = it[0] as Boolean + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** Returns the passed int, to test serialization and deserialization. */ + fun flutterEchoInt( + pigeon_instanceArg: ProxyApiTestClass, + anIntArg: Long, + callback: (Result) -> Unit + ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoInt" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg, anIntArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else if (it[0] == null) { + callback( + Result.failure( + ProxyApiTestsError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) + } else { + val output = it[0] as Long + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** Returns the passed double, to test serialization and deserialization. */ + fun flutterEchoDouble( + pigeon_instanceArg: ProxyApiTestClass, + aDoubleArg: Double, + callback: (Result) -> Unit + ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoDouble" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg, aDoubleArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else if (it[0] == null) { + callback( + Result.failure( + ProxyApiTestsError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) + } else { + val output = it[0] as Double + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** Returns the passed string, to test serialization and deserialization. */ + fun flutterEchoString( + pigeon_instanceArg: ProxyApiTestClass, + aStringArg: String, + callback: (Result) -> Unit + ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoString" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg, aStringArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else if (it[0] == null) { + callback( + Result.failure( + ProxyApiTestsError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) + } else { + val output = it[0] as String + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** Returns the passed byte list, to test serialization and deserialization. */ + fun flutterEchoUint8List( + pigeon_instanceArg: ProxyApiTestClass, + aListArg: ByteArray, + callback: (Result) -> Unit + ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoUint8List" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg, aListArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else if (it[0] == null) { + callback( + Result.failure( + ProxyApiTestsError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) + } else { + val output = it[0] as ByteArray + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** Returns the passed list, to test serialization and deserialization. */ + fun flutterEchoList( + pigeon_instanceArg: ProxyApiTestClass, + aListArg: List, + callback: (Result>) -> Unit + ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoList" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg, aListArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else if (it[0] == null) { + callback( + Result.failure( + ProxyApiTestsError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) + } else { + val output = it[0] as List + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** Returns the passed list with ProxyApis, to test serialization and deserialization. */ + fun flutterEchoProxyApiList( + pigeon_instanceArg: ProxyApiTestClass, + aListArg: List, + callback: (Result>) -> Unit + ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoProxyApiList" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg, aListArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else if (it[0] == null) { + callback( + Result.failure( + ProxyApiTestsError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) + } else { + val output = it[0] as List + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** Returns the passed map, to test serialization and deserialization. */ + fun flutterEchoMap( + pigeon_instanceArg: ProxyApiTestClass, + aMapArg: Map, + callback: (Result>) -> Unit + ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoMap" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg, aMapArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else if (it[0] == null) { + callback( + Result.failure( + ProxyApiTestsError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) + } else { + val output = it[0] as Map + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** Returns the passed map with ProxyApis, to test serialization and deserialization. */ + fun flutterEchoProxyApiMap( + pigeon_instanceArg: ProxyApiTestClass, + aMapArg: Map, + callback: (Result>) -> Unit + ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoProxyApiMap" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg, aMapArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else if (it[0] == null) { + callback( + Result.failure( + ProxyApiTestsError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) + } else { + val output = it[0] as Map + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** Returns the passed enum to test serialization and deserialization. */ + fun flutterEchoEnum( + pigeon_instanceArg: ProxyApiTestClass, + anEnumArg: ProxyApiTestEnum, + callback: (Result) -> Unit + ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoEnum" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg, anEnumArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else if (it[0] == null) { + callback( + Result.failure( + ProxyApiTestsError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) + } else { + val output = it[0] as ProxyApiTestEnum + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** Returns the passed ProxyApi to test serialization and deserialization. */ + fun flutterEchoProxyApi( + pigeon_instanceArg: ProxyApiTestClass, + aProxyApiArg: com.example.test_plugin.ProxyApiSuperClass, + callback: (Result) -> Unit + ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoProxyApi" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg, aProxyApiArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else if (it[0] == null) { + callback( + Result.failure( + ProxyApiTestsError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) + } else { + val output = it[0] as com.example.test_plugin.ProxyApiSuperClass + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** Returns the passed boolean, to test serialization and deserialization. */ + fun flutterEchoNullableBool( + pigeon_instanceArg: ProxyApiTestClass, + aBoolArg: Boolean?, + callback: (Result) -> Unit + ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableBool" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg, aBoolArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + val output = it[0] as Boolean? + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** Returns the passed int, to test serialization and deserialization. */ + fun flutterEchoNullableInt( + pigeon_instanceArg: ProxyApiTestClass, + anIntArg: Long?, + callback: (Result) -> Unit + ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableInt" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg, anIntArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + val output = it[0] as Long? + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** Returns the passed double, to test serialization and deserialization. */ + fun flutterEchoNullableDouble( + pigeon_instanceArg: ProxyApiTestClass, + aDoubleArg: Double?, + callback: (Result) -> Unit + ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableDouble" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg, aDoubleArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + val output = it[0] as Double? + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** Returns the passed string, to test serialization and deserialization. */ + fun flutterEchoNullableString( + pigeon_instanceArg: ProxyApiTestClass, + aStringArg: String?, + callback: (Result) -> Unit + ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableString" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg, aStringArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + val output = it[0] as String? + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** Returns the passed byte list, to test serialization and deserialization. */ + fun flutterEchoNullableUint8List( + pigeon_instanceArg: ProxyApiTestClass, + aListArg: ByteArray?, + callback: (Result) -> Unit + ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableUint8List" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg, aListArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + val output = it[0] as ByteArray? + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** Returns the passed list, to test serialization and deserialization. */ + fun flutterEchoNullableList( + pigeon_instanceArg: ProxyApiTestClass, + aListArg: List?, + callback: (Result?>) -> Unit + ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableList" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg, aListArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + val output = it[0] as List? + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** Returns the passed map, to test serialization and deserialization. */ + fun flutterEchoNullableMap( + pigeon_instanceArg: ProxyApiTestClass, + aMapArg: Map?, + callback: (Result?>) -> Unit + ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableMap" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg, aMapArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + val output = it[0] as Map? + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** Returns the passed enum to test serialization and deserialization. */ + fun flutterEchoNullableEnum( + pigeon_instanceArg: ProxyApiTestClass, + anEnumArg: ProxyApiTestEnum?, + callback: (Result) -> Unit + ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableEnum" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg, anEnumArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + val output = it[0] as ProxyApiTestEnum? + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** Returns the passed ProxyApi to test serialization and deserialization. */ + fun flutterEchoNullableProxyApi( + pigeon_instanceArg: ProxyApiTestClass, + aProxyApiArg: com.example.test_plugin.ProxyApiSuperClass?, + callback: (Result) -> Unit + ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableProxyApi" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg, aProxyApiArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + val output = it[0] as com.example.test_plugin.ProxyApiSuperClass? + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** + * A no-op function taking no arguments and returning no value, to sanity test basic asynchronous + * calling. + */ + fun flutterNoopAsync(pigeon_instanceArg: ProxyApiTestClass, callback: (Result) -> Unit) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterNoopAsync" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** Returns the passed in generic Object asynchronously. */ + fun flutterEchoAsyncString( + pigeon_instanceArg: ProxyApiTestClass, + aStringArg: String, + callback: (Result) -> Unit + ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoAsyncString" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg, aStringArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else if (it[0] == null) { + callback( + Result.failure( + ProxyApiTestsError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) + } else { + val output = it[0] as String + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + @Suppress("FunctionName") + /** An implementation of [PigeonApiProxyApiSuperClass] used to access callback methods */ + fun pigeon_getPigeonApiProxyApiSuperClass(): PigeonApiProxyApiSuperClass { + return pigeonRegistrar.getPigeonApiProxyApiSuperClass() + } + + @Suppress("FunctionName") + /** An implementation of [PigeonApiProxyApiInterface] used to access callback methods */ + fun pigeon_getPigeonApiProxyApiInterface(): PigeonApiProxyApiInterface { + return pigeonRegistrar.getPigeonApiProxyApiInterface() + } +} +/** ProxyApi to serve as a super class to the core ProxyApi class. */ +@Suppress("UNCHECKED_CAST") +abstract class PigeonApiProxyApiSuperClass( + open val pigeonRegistrar: ProxyApiTestsPigeonProxyApiRegistrar +) { + abstract fun pigeon_defaultConstructor(): com.example.test_plugin.ProxyApiSuperClass + + abstract fun aSuperMethod(pigeon_instance: com.example.test_plugin.ProxyApiSuperClass) + + companion object { + @Suppress("LocalVariableName") + fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiProxyApiSuperClass?) { + val codec = api?.pigeonRegistrar?.codec ?: ProxyApiTestsPigeonCodec() + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiSuperClass.pigeon_defaultConstructor", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_identifierArg = args[0] as Long + val wrapped: List = + try { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + api.pigeon_defaultConstructor(), pigeon_identifierArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiSuperClass.aSuperMethod", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as com.example.test_plugin.ProxyApiSuperClass + val wrapped: List = + try { + api.aSuperMethod(pigeon_instanceArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + } + } + + @Suppress("LocalVariableName", "FunctionName") + /** Creates a Dart instance of ProxyApiSuperClass and attaches it to [pigeon_instanceArg]. */ + fun pigeon_newInstance( + pigeon_instanceArg: com.example.test_plugin.ProxyApiSuperClass, + callback: (Result) -> Unit + ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } + if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + Result.success(Unit) + return + } + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiSuperClass.pigeon_newInstance" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_identifierArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } +} +/** ProxyApi to serve as an interface to the core ProxyApi class. */ +@Suppress("UNCHECKED_CAST") +open class PigeonApiProxyApiInterface( + open val pigeonRegistrar: ProxyApiTestsPigeonProxyApiRegistrar +) { + @Suppress("LocalVariableName", "FunctionName") + /** Creates a Dart instance of ProxyApiInterface and attaches it to [pigeon_instanceArg]. */ + fun pigeon_newInstance(pigeon_instanceArg: ProxyApiInterface, callback: (Result) -> Unit) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } + if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + Result.success(Unit) + return + } + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiInterface.pigeon_newInstance" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_identifierArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + fun anInterfaceMethod(pigeon_instanceArg: ProxyApiInterface, callback: (Result) -> Unit) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiInterface.anInterfaceMethod" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } +} + +@Suppress("UNCHECKED_CAST") +abstract class PigeonApiClassWithApiRequirement( + open val pigeonRegistrar: ProxyApiTestsPigeonProxyApiRegistrar +) { + @androidx.annotation.RequiresApi(api = 25) + abstract fun pigeon_defaultConstructor(): ClassWithApiRequirement + + @androidx.annotation.RequiresApi(api = 25) + abstract fun aMethod(pigeon_instance: ClassWithApiRequirement) + + companion object { + @Suppress("LocalVariableName") + fun setUpMessageHandlers( + binaryMessenger: BinaryMessenger, + api: PigeonApiClassWithApiRequirement? + ) { + val codec = api?.pigeonRegistrar?.codec ?: ProxyApiTestsPigeonCodec() + if (android.os.Build.VERSION.SDK_INT >= 25) { + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ClassWithApiRequirement.pigeon_defaultConstructor", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_identifierArg = args[0] as Long + val wrapped: List = + try { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + api.pigeon_defaultConstructor(), pigeon_identifierArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + } else { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ClassWithApiRequirement.pigeon_defaultConstructor", + codec) + if (api != null) { + channel.setMessageHandler { _, reply -> + reply.reply( + wrapError( + UnsupportedOperationException( + "Call references class `ClassWithApiRequirement`, which requires api version 25."))) + } + } else { + channel.setMessageHandler(null) + } + } + if (android.os.Build.VERSION.SDK_INT >= 25) { + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ClassWithApiRequirement.aMethod", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ClassWithApiRequirement + val wrapped: List = + try { + api.aMethod(pigeon_instanceArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + } else { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ClassWithApiRequirement.aMethod", + codec) + if (api != null) { + channel.setMessageHandler { _, reply -> + reply.reply( + wrapError( + UnsupportedOperationException( + "Call references class `ClassWithApiRequirement`, which requires api version 25."))) + } + } else { + channel.setMessageHandler(null) + } + } + } + } + + @Suppress("LocalVariableName", "FunctionName") + /** Creates a Dart instance of ClassWithApiRequirement and attaches it to [pigeon_instanceArg]. */ + @androidx.annotation.RequiresApi(api = 25) + fun pigeon_newInstance( + pigeon_instanceArg: ClassWithApiRequirement, + callback: (Result) -> Unit + ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } + if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { + Result.success(Unit) + return + } + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ClassWithApiRequirement.pigeon_newInstance" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_identifierArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } +} 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 4c5a1f983b95..9563941624d7 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 @@ -12,6 +12,7 @@ class TestPlugin : FlutterPlugin, HostIntegrationCoreApi { private var flutterApi: FlutterIntegrationCoreApi? = null private var flutterSmallApiOne: FlutterSmallApi? = null private var flutterSmallApiTwo: FlutterSmallApi? = null + private var proxyApiRegistrar: ProxyApiRegistrar? = null override fun onAttachedToEngine(binding: FlutterPluginBinding) { HostIntegrationCoreApi.setUp(binding.binaryMessenger, this) @@ -22,9 +23,14 @@ class TestPlugin : FlutterPlugin, HostIntegrationCoreApi { flutterApi = FlutterIntegrationCoreApi(binding.binaryMessenger) flutterSmallApiOne = FlutterSmallApi(binding.binaryMessenger, "suffixOne") flutterSmallApiTwo = FlutterSmallApi(binding.binaryMessenger, "suffixTwo") + + proxyApiRegistrar = ProxyApiRegistrar(binding.binaryMessenger) + proxyApiRegistrar!!.setUp() } - override fun onDetachedFromEngine(binding: FlutterPluginBinding) {} + override fun onDetachedFromEngine(binding: FlutterPlugin.FlutterPluginBinding) { + proxyApiRegistrar?.tearDown() + } // HostIntegrationCoreApi @@ -84,8 +90,60 @@ class TestPlugin : FlutterPlugin, HostIntegrationCoreApi { return list } - override fun echoMap(aMap: Map): Map { - return aMap + override fun echoEnumList(enumList: List): List { + return enumList + } + + override fun echoClassList(classList: List): List { + return classList + } + + override fun echoNonNullEnumList(enumList: List): List { + return enumList + } + + override fun echoNonNullClassList(classList: List): List { + return classList + } + + override fun echoMap(map: Map): Map { + return map + } + + override fun echoStringMap(stringMap: Map): Map { + return stringMap + } + + override fun echoIntMap(intMap: Map): Map { + return intMap + } + + override fun echoEnumMap(enumMap: Map): Map { + return enumMap + } + + override fun echoClassMap( + classMap: Map + ): Map { + return classMap + } + + override fun echoNonNullStringMap(stringMap: Map): Map { + return stringMap + } + + override fun echoNonNullIntMap(intMap: Map): Map { + return intMap + } + + override fun echoNonNullEnumMap(enumMap: Map): Map { + return enumMap + } + + override fun echoNonNullClassMap( + classMap: Map + ): Map { + return classMap } override fun echoClassWrapper(wrapper: AllClassesWrapper): AllClassesWrapper { @@ -117,7 +175,10 @@ class TestPlugin : FlutterPlugin, HostIntegrationCoreApi { } override fun createNestedNullableString(nullableString: String?): AllClassesWrapper { - return AllClassesWrapper(AllNullableTypes(aNullableString = nullableString)) + return AllClassesWrapper( + AllNullableTypes(aNullableString = nullableString), + classList = arrayOf().toList(), + classMap = HashMap()) } override fun sendMultipleNullableTypes( @@ -170,8 +231,64 @@ class TestPlugin : FlutterPlugin, HostIntegrationCoreApi { return aNullableList } - override fun echoNullableMap(aNullableMap: Map?): Map? { - return aNullableMap + override fun echoNullableEnumList(enumList: List?): List? { + return enumList + } + + override fun echoNullableClassList( + classList: List? + ): List? { + return classList + } + + override fun echoNullableNonNullEnumList(enumList: List?): List? { + return enumList + } + + override fun echoNullableNonNullClassList( + classList: List? + ): List? { + return classList + } + + override fun echoNullableMap(map: Map?): Map? { + return map + } + + override fun echoNullableStringMap(stringMap: Map?): Map? { + return stringMap + } + + override fun echoNullableIntMap(intMap: Map?): Map? { + return intMap + } + + override fun echoNullableEnumMap(enumMap: Map?): Map? { + return enumMap + } + + override fun echoNullableClassMap( + classMap: Map? + ): Map? { + return classMap + } + + override fun echoNullableNonNullStringMap(stringMap: Map?): Map? { + return stringMap + } + + override fun echoNullableNonNullIntMap(intMap: Map?): Map? { + return intMap + } + + override fun echoNullableNonNullEnumMap(enumMap: Map?): Map? { + return enumMap + } + + override fun echoNullableNonNullClassMap( + classMap: Map? + ): Map? { + return classMap } override fun echoNullableEnum(anEnum: AnEnum?): AnEnum? { @@ -252,11 +369,50 @@ class TestPlugin : FlutterPlugin, HostIntegrationCoreApi { callback(Result.success(list)) } - override fun echoAsyncMap( - aMap: Map, - callback: (Result>) -> Unit + override fun echoAsyncEnumList( + enumList: List, + callback: (Result>) -> Unit + ) { + callback(Result.success(enumList)) + } + + override fun echoAsyncClassList( + classList: List, + callback: (Result>) -> Unit + ) { + callback(Result.success(classList)) + } + + override fun echoAsyncMap(map: Map, callback: (Result>) -> Unit) { + callback(Result.success(map)) + } + + override fun echoAsyncStringMap( + stringMap: Map, + callback: (Result>) -> Unit + ) { + callback(Result.success(stringMap)) + } + + override fun echoAsyncIntMap( + intMap: Map, + callback: (Result>) -> Unit + ) { + callback(Result.success(intMap)) + } + + override fun echoAsyncEnumMap( + enumMap: Map, + callback: (Result>) -> Unit + ) { + callback(Result.success(enumMap)) + } + + override fun echoAsyncClassMap( + classMap: Map, + callback: (Result>) -> Unit ) { - callback(Result.success(aMap)) + callback(Result.success(classMap)) } override fun echoAsyncEnum(anEnum: AnEnum, callback: (Result) -> Unit) { @@ -301,11 +457,53 @@ class TestPlugin : FlutterPlugin, HostIntegrationCoreApi { callback(Result.success(list)) } + override fun echoAsyncNullableEnumList( + enumList: List?, + callback: (Result?>) -> Unit + ) { + callback(Result.success(enumList)) + } + + override fun echoAsyncNullableClassList( + classList: List?, + callback: (Result?>) -> Unit + ) { + callback(Result.success(classList)) + } + override fun echoAsyncNullableMap( - aMap: Map?, - callback: (Result?>) -> Unit + map: Map?, + callback: (Result?>) -> Unit + ) { + callback(Result.success(map)) + } + + override fun echoAsyncNullableStringMap( + stringMap: Map?, + callback: (Result?>) -> Unit ) { - callback(Result.success(aMap)) + callback(Result.success(stringMap)) + } + + override fun echoAsyncNullableIntMap( + intMap: Map?, + callback: (Result?>) -> Unit + ) { + callback(Result.success(intMap)) + } + + override fun echoAsyncNullableEnumMap( + enumMap: Map?, + callback: (Result?>) -> Unit + ) { + callback(Result.success(enumMap)) + } + + override fun echoAsyncNullableClassMap( + classMap: Map?, + callback: (Result?>) -> Unit + ) { + callback(Result.success(classMap)) } override fun echoAsyncNullableEnum(anEnum: AnEnum?, callback: (Result) -> Unit) { @@ -389,11 +587,95 @@ class TestPlugin : FlutterPlugin, HostIntegrationCoreApi { flutterApi!!.echoList(list) { echo -> callback(echo) } } + override fun callFlutterEchoEnumList( + enumList: List, + callback: (Result>) -> Unit + ) { + flutterApi!!.echoEnumList(enumList) { echo -> callback(echo) } + } + + override fun callFlutterEchoClassList( + classList: List, + callback: (Result>) -> Unit + ) { + flutterApi!!.echoClassList(classList) { echo -> callback(echo) } + } + + override fun callFlutterEchoNonNullEnumList( + enumList: List, + callback: (Result>) -> Unit + ) { + flutterApi!!.echoNonNullEnumList(enumList) { echo -> callback(echo) } + } + + override fun callFlutterEchoNonNullClassList( + classList: List, + callback: (Result>) -> Unit + ) { + flutterApi!!.echoNonNullClassList(classList) { echo -> callback(echo) } + } + override fun callFlutterEchoMap( - aMap: Map, - callback: (Result>) -> Unit + map: Map, + callback: (Result>) -> Unit + ) { + flutterApi!!.echoMap(map) { echo -> callback(echo) } + } + + override fun callFlutterEchoStringMap( + stringMap: Map, + callback: (Result>) -> Unit ) { - flutterApi!!.echoMap(aMap) { echo -> callback(echo) } + flutterApi!!.echoStringMap(stringMap) { echo -> callback(echo) } + } + + override fun callFlutterEchoIntMap( + intMap: Map, + callback: (Result>) -> Unit + ) { + flutterApi!!.echoIntMap(intMap) { echo -> callback(echo) } + } + + override fun callFlutterEchoEnumMap( + enumMap: Map, + callback: (Result>) -> Unit + ) { + flutterApi!!.echoEnumMap(enumMap) { echo -> callback(echo) } + } + + override fun callFlutterEchoClassMap( + classMap: Map, + callback: (Result>) -> Unit + ) { + flutterApi!!.echoClassMap(classMap) { echo -> callback(echo) } + } + + override fun callFlutterEchoNonNullStringMap( + stringMap: Map, + callback: (Result>) -> Unit + ) { + flutterApi!!.echoNonNullStringMap(stringMap) { echo -> callback(echo) } + } + + override fun callFlutterEchoNonNullIntMap( + intMap: Map, + callback: (Result>) -> Unit + ) { + flutterApi!!.echoNonNullIntMap(intMap) { echo -> callback(echo) } + } + + override fun callFlutterEchoNonNullEnumMap( + enumMap: Map, + callback: (Result>) -> Unit + ) { + flutterApi!!.echoNonNullEnumMap(enumMap) { echo -> callback(echo) } + } + + override fun callFlutterEchoNonNullClassMap( + classMap: Map, + callback: (Result>) -> Unit + ) { + flutterApi!!.echoNonNullClassMap(classMap) { echo -> callback(echo) } } override fun callFlutterEchoEnum(anEnum: AnEnum, callback: (Result) -> Unit) { @@ -450,11 +732,95 @@ class TestPlugin : FlutterPlugin, HostIntegrationCoreApi { flutterApi!!.echoNullableList(list) { echo -> callback(echo) } } + override fun callFlutterEchoNullableEnumList( + enumList: List?, + callback: (Result?>) -> Unit + ) { + flutterApi!!.echoNullableEnumList(enumList) { echo -> callback(echo) } + } + + override fun callFlutterEchoNullableClassList( + classList: List?, + callback: (Result?>) -> Unit + ) { + flutterApi!!.echoNullableClassList(classList) { echo -> callback(echo) } + } + + override fun callFlutterEchoNullableNonNullEnumList( + enumList: List?, + callback: (Result?>) -> Unit + ) { + flutterApi!!.echoNullableNonNullEnumList(enumList) { echo -> callback(echo) } + } + + override fun callFlutterEchoNullableNonNullClassList( + classList: List?, + callback: (Result?>) -> Unit + ) { + flutterApi!!.echoNullableNonNullClassList(classList) { echo -> callback(echo) } + } + override fun callFlutterEchoNullableMap( - aMap: Map?, - callback: (Result?>) -> Unit + map: Map?, + callback: (Result?>) -> Unit + ) { + flutterApi!!.echoNullableMap(map) { echo -> callback(echo) } + } + + override fun callFlutterEchoNullableStringMap( + stringMap: Map?, + callback: (Result?>) -> Unit ) { - flutterApi!!.echoNullableMap(aMap) { echo -> callback(echo) } + flutterApi!!.echoNullableStringMap(stringMap) { echo -> callback(echo) } + } + + override fun callFlutterEchoNullableIntMap( + intMap: Map?, + callback: (Result?>) -> Unit + ) { + flutterApi!!.echoNullableIntMap(intMap) { echo -> callback(echo) } + } + + override fun callFlutterEchoNullableEnumMap( + enumMap: Map?, + callback: (Result?>) -> Unit + ) { + flutterApi!!.echoNullableEnumMap(enumMap) { echo -> callback(echo) } + } + + override fun callFlutterEchoNullableClassMap( + classMap: Map?, + callback: (Result?>) -> Unit + ) { + flutterApi!!.echoNullableClassMap(classMap) { echo -> callback(echo) } + } + + override fun callFlutterEchoNullableNonNullStringMap( + stringMap: Map?, + callback: (Result?>) -> Unit + ) { + flutterApi!!.echoNullableNonNullStringMap(stringMap) { echo -> callback(echo) } + } + + override fun callFlutterEchoNullableNonNullIntMap( + intMap: Map?, + callback: (Result?>) -> Unit + ) { + flutterApi!!.echoNullableNonNullIntMap(intMap) { echo -> callback(echo) } + } + + override fun callFlutterEchoNullableNonNullEnumMap( + enumMap: Map?, + callback: (Result?>) -> Unit + ) { + flutterApi!!.echoNullableNonNullEnumMap(enumMap) { echo -> callback(echo) } + } + + override fun callFlutterEchoNullableNonNullClassMap( + classMap: Map?, + callback: (Result?>) -> Unit + ) { + flutterApi!!.echoNullableNonNullClassMap(classMap) { echo -> callback(echo) } } override fun callFlutterEchoNullableEnum(anEnum: AnEnum?, callback: (Result) -> Unit) { @@ -481,6 +847,10 @@ class TestPlugin : FlutterPlugin, HostIntegrationCoreApi { } } } + + fun testUnusedClassesGenerate(): UnusedClass { + return UnusedClass() + } } class TestPluginWithSuffix : HostSmallApi { diff --git a/packages/pigeon/platform_tests/test_plugin/android/src/test/kotlin/com/example/test_plugin/AllDatatypesTest.kt b/packages/pigeon/platform_tests/test_plugin/android/src/test/kotlin/com/example/test_plugin/AllDatatypesTest.kt index 5834f34310ad..aa42535f718c 100644 --- a/packages/pigeon/platform_tests/test_plugin/android/src/test/kotlin/com/example/test_plugin/AllDatatypesTest.kt +++ b/packages/pigeon/platform_tests/test_plugin/android/src/test/kotlin/com/example/test_plugin/AllDatatypesTest.kt @@ -11,7 +11,6 @@ import java.nio.ByteBuffer import java.util.ArrayList import org.junit.Assert.assertEquals import org.junit.Assert.assertNotNull -import org.junit.Assert.assertNull import org.junit.Assert.assertTrue import org.junit.Test @@ -58,7 +57,6 @@ internal class AllDatatypesTest { assertTrue(firstTypes.aNullable4ByteArray.contentEquals(secondTypes.aNullable4ByteArray)) assertTrue(firstTypes.aNullable8ByteArray.contentEquals(secondTypes.aNullable8ByteArray)) assertTrue(firstTypes.aNullableFloatArray.contentEquals(secondTypes.aNullableFloatArray)) - assertEquals(firstTypes.nullableMapWithObject, secondTypes.nullableMapWithObject) assertEquals(firstTypes.aNullableObject, secondTypes.aNullableObject) assertEquals(firstTypes.aNullableEnum, secondTypes.aNullableEnum) assertEquals(firstTypes.anotherNullableEnum, secondTypes.anotherNullableEnum) @@ -67,7 +65,13 @@ internal class AllDatatypesTest { assertEquals(firstTypes.doubleList, secondTypes.doubleList) assertEquals(firstTypes.intList, secondTypes.intList) assertEquals(firstTypes.stringList, secondTypes.stringList) + assertEquals(firstTypes.listList, secondTypes.listList) + assertEquals(firstTypes.mapList, secondTypes.mapList) assertEquals(firstTypes.map, secondTypes.map) + assertEquals(firstTypes.stringMap, secondTypes.stringMap) + assertEquals(firstTypes.intMap, secondTypes.intMap) + assertEquals(firstTypes.listMap, secondTypes.listMap) + assertEquals(firstTypes.mapMap, secondTypes.mapMap) } @Test @@ -100,6 +104,7 @@ internal class AllDatatypesTest { @Test fun testHasValues() { + val stringList = listOf("string", "another one") val everything = AllNullableTypes( aNullableBool = false, @@ -110,14 +115,21 @@ internal class AllDatatypesTest { aNullable4ByteArray = intArrayOf(1, 2, 3, 4), aNullable8ByteArray = longArrayOf(1, 2, 3, 4), aNullableFloatArray = doubleArrayOf(0.5, 0.25, 1.5, 1.25), - nullableMapWithObject = mapOf("hello" to 1234), aNullableObject = 0, list = listOf(1, 2, 3), - stringList = listOf("string", "another one"), + stringList = stringList, boolList = listOf(true, false), intList = listOf(1, 2), doubleList = listOf(1.1, 2.2), - map = mapOf("hello" to 1234)) + objectList = listOf(1, 2, 3), + listList = listOf(stringList, stringList.toList()), + mapList = listOf(mapOf("hello" to 1234), mapOf("hello" to 1234)), + map = mapOf("hello" to 1234), + stringMap = mapOf("hello" to "you"), + intMap = mapOf(1L to 0L), + objectMap = mapOf("hello" to 1234), + listMap = mapOf(1L to stringList), + mapMap = mapOf(1L to mapOf())) val binaryMessenger = mockk() val api = FlutterIntegrationCoreApi(binaryMessenger) @@ -141,43 +153,4 @@ internal class AllDatatypesTest { assertTrue(didCall) } - - @Test - fun testIntegerToLong() { - val everything = AllNullableTypes(aNullableInt = 123L) - val list = everything.toList() - assertNotNull(list) - assertNull(list.first()) - assertNotNull(list[1]) - assertTrue(list[1] == 123L) - - val list2 = - listOf( - null, - 123, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null) - val everything2 = AllNullableTypes.fromList(list2) - - assertEquals(everything.aNullableInt, everything2.aNullableInt) - } } diff --git a/packages/pigeon/platform_tests/test_plugin/android/src/test/kotlin/com/example/test_plugin/EnumTest.kt b/packages/pigeon/platform_tests/test_plugin/android/src/test/kotlin/com/example/test_plugin/EnumTest.kt deleted file mode 100644 index acdc6192c016..000000000000 --- a/packages/pigeon/platform_tests/test_plugin/android/src/test/kotlin/com/example/test_plugin/EnumTest.kt +++ /dev/null @@ -1,80 +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. - -package com.example.test_plugin - -import io.flutter.plugin.common.BinaryMessenger -import io.mockk.every -import io.mockk.mockk -import io.mockk.slot -import io.mockk.verify -import java.nio.ByteBuffer -import java.util.ArrayList -import org.junit.Assert.assertEquals -import org.junit.Assert.assertNotNull -import org.junit.Assert.assertTrue -import org.junit.Test - -internal class EnumTest { - - @Test - fun testEchoHost() { - val binaryMessenger = mockk() - val api = mockk() - - val channelName = "dev.flutter.pigeon.pigeon_integration_tests.EnumApi2Host.echo" - val input = DataWithEnum(EnumState.SNAKE_CASE) - - val handlerSlot = slot() - - every { binaryMessenger.setMessageHandler(channelName, capture(handlerSlot)) } returns Unit - every { api.echo(any()) } returnsArgument 0 - - EnumApi2Host.setUp(binaryMessenger, api) - - val codec = EnumApi2Host.codec - val message = codec.encodeMessage(listOf(input)) - message?.rewind() - handlerSlot.captured.onMessage(message) { - it?.rewind() - @Suppress("UNCHECKED_CAST") val wrapped = codec.decodeMessage(it) as List? - assertNotNull(wrapped) - wrapped?.let { - assertNotNull(wrapped[0]) - assertEquals(input, wrapped[0]) - } - } - - verify { binaryMessenger.setMessageHandler(channelName, handlerSlot.captured) } - verify { api.echo(input) } - } - - @Test - fun testEchoFlutter() { - val binaryMessenger = mockk() - val api = EnumApi2Flutter(binaryMessenger) - - val input = DataWithEnum(EnumState.SNAKE_CASE) - - every { binaryMessenger.send(any(), any(), any()) } answers - { - val codec = EnumApi2Flutter.codec - val message = arg(1) - val reply = arg(2) - message.position(0) - val args = codec.decodeMessage(message) as ArrayList<*> - val replyData = codec.encodeMessage(args) - replyData?.position(0) - reply.reply(replyData) - } - - var didCall = false - api.echo(input) { - didCall = true - assertEquals(input, it.getOrNull()) - } - - assertTrue(didCall) - } -} diff --git a/packages/pigeon/platform_tests/test_plugin/android/src/test/kotlin/com/example/test_plugin/InstanceManagerTest.kt b/packages/pigeon/platform_tests/test_plugin/android/src/test/kotlin/com/example/test_plugin/InstanceManagerTest.kt new file mode 100644 index 000000000000..438ccfd1f444 --- /dev/null +++ b/packages/pigeon/platform_tests/test_plugin/android/src/test/kotlin/com/example/test_plugin/InstanceManagerTest.kt @@ -0,0 +1,129 @@ +// 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. + +package com.example.test_plugin + +import junit.framework.TestCase.assertEquals +import junit.framework.TestCase.assertFalse +import junit.framework.TestCase.assertNotNull +import junit.framework.TestCase.assertNull +import junit.framework.TestCase.assertTrue +import org.junit.Test + +class InstanceManagerTest { + @Test + fun addDartCreatedInstance() { + val instanceManager: ProxyApiTestsPigeonInstanceManager = createInstanceManager() + val testObject = Any() + instanceManager.addDartCreatedInstance(testObject, 0) + + assertEquals(testObject, instanceManager.getInstance(0)) + assertEquals(0L, instanceManager.getIdentifierForStrongReference(testObject)) + assertTrue(instanceManager.containsInstance(testObject)) + + instanceManager.stopFinalizationListener() + } + + @Test + fun addHostCreatedInstance() { + val instanceManager: ProxyApiTestsPigeonInstanceManager = createInstanceManager() + val testObject = Any() + val identifier: Long = instanceManager.addHostCreatedInstance(testObject) + + assertNotNull(instanceManager.getInstance(identifier)) + assertEquals(testObject, instanceManager.getInstance(identifier)) + assertTrue(instanceManager.containsInstance(testObject)) + + instanceManager.stopFinalizationListener() + } + + @Test + fun remove() { + val instanceManager: ProxyApiTestsPigeonInstanceManager = createInstanceManager() + var testObject: Any? = Any() + instanceManager.addDartCreatedInstance(testObject!!, 0) + assertEquals(testObject, instanceManager.remove(0)) + + // To allow for object to be garbage collected. + @Suppress("UNUSED_VALUE") + testObject = null + Runtime.getRuntime().gc() + assertNull(instanceManager.getInstance(0)) + + instanceManager.stopFinalizationListener() + } + + @Test + fun clear() { + val instanceManager: ProxyApiTestsPigeonInstanceManager = createInstanceManager() + val instance = Any() + instanceManager.addDartCreatedInstance(instance, 0) + + assertTrue(instanceManager.containsInstance(instance)) + instanceManager.clear() + assertFalse(instanceManager.containsInstance(instance)) + + instanceManager.stopFinalizationListener() + } + + @Test + fun canAddSameObjectWithAddDartCreatedInstance() { + val instanceManager: ProxyApiTestsPigeonInstanceManager = createInstanceManager() + val instance = Any() + instanceManager.addDartCreatedInstance(instance, 0) + instanceManager.addDartCreatedInstance(instance, 1) + + assertTrue(instanceManager.containsInstance(instance)) + assertEquals(instanceManager.getInstance(0), instance) + assertEquals(instanceManager.getInstance(1), instance) + + instanceManager.stopFinalizationListener() + } + + @Test(expected = IllegalArgumentException::class) + fun cannotAddSameObjectsWithAddHostCreatedInstance() { + val instanceManager: ProxyApiTestsPigeonInstanceManager = createInstanceManager() + val instance = Any() + instanceManager.addHostCreatedInstance(instance) + instanceManager.addHostCreatedInstance(instance) + + instanceManager.stopFinalizationListener() + } + + @Test(expected = IllegalArgumentException::class) + fun cannotUseIdentifierLessThanZero() { + val instanceManager: ProxyApiTestsPigeonInstanceManager = createInstanceManager() + instanceManager.addDartCreatedInstance(Any(), -1) + instanceManager.stopFinalizationListener() + } + + @Test(expected = IllegalArgumentException::class) + fun identifiersMustBeUnique() { + val instanceManager: ProxyApiTestsPigeonInstanceManager = createInstanceManager() + instanceManager.addDartCreatedInstance(Any(), 0) + instanceManager.addDartCreatedInstance(Any(), 0) + + instanceManager.stopFinalizationListener() + } + + @Test + fun managerIsUsableWhileListenerHasStopped() { + val instanceManager: ProxyApiTestsPigeonInstanceManager = createInstanceManager() + instanceManager.stopFinalizationListener() + val instance = Any() + val identifier: Long = 0 + instanceManager.addDartCreatedInstance(instance, identifier) + + assertEquals(instanceManager.getInstance(identifier), instance) + assertEquals(instanceManager.getIdentifierForStrongReference(instance), identifier) + assertTrue(instanceManager.containsInstance(instance)) + } + + private fun createInstanceManager(): ProxyApiTestsPigeonInstanceManager { + return ProxyApiTestsPigeonInstanceManager.create( + object : ProxyApiTestsPigeonInstanceManager.PigeonFinalizationListener { + override fun onFinalize(identifier: Long) {} + }) + } +} diff --git a/packages/pigeon/platform_tests/test_plugin/android/src/test/kotlin/com/example/test_plugin/PrimitiveTest.kt b/packages/pigeon/platform_tests/test_plugin/android/src/test/kotlin/com/example/test_plugin/PrimitiveTest.kt index 047c5b3c2196..5f496eb0d3d6 100644 --- a/packages/pigeon/platform_tests/test_plugin/android/src/test/kotlin/com/example/test_plugin/PrimitiveTest.kt +++ b/packages/pigeon/platform_tests/test_plugin/android/src/test/kotlin/com/example/test_plugin/PrimitiveTest.kt @@ -21,7 +21,7 @@ class PrimitiveTest { val binaryMessenger = mockk(relaxed = true) val api = mockk(relaxed = true) - val input = 1 + val input = 1L val channelName = "dev.flutter.pigeon.pigeon_integration_tests.PrimitiveHostApi.anInt" val handlerSlot = slot() @@ -38,7 +38,7 @@ class PrimitiveTest { it?.rewind() @Suppress("UNCHECKED_CAST") val wrapped = codec.decodeMessage(it) as List? assertNotNull(wrapped) - wrapped?.let { assertEquals(input.toLong(), wrapped[0]) } + wrapped?.let { assertEquals(input, wrapped[0]) } } verify { binaryMessenger.setMessageHandler(channelName, handlerSlot.captured) } diff --git a/packages/pigeon/platform_tests/test_plugin/example/.gitignore b/packages/pigeon/platform_tests/test_plugin/example/.gitignore index 24476c5d1eb5..6c319542b342 100644 --- a/packages/pigeon/platform_tests/test_plugin/example/.gitignore +++ b/packages/pigeon/platform_tests/test_plugin/example/.gitignore @@ -5,9 +5,11 @@ *.swp .DS_Store .atom/ +.build/ .buildlog/ .history .svn/ +.swiftpm/ migrate_working_dir/ # IntelliJ related diff --git a/packages/pigeon/platform_tests/test_plugin/example/android/app/build.gradle b/packages/pigeon/platform_tests/test_plugin/example/android/app/build.gradle index 92b34cf1b3e7..9f40fc4d2323 100644 --- a/packages/pigeon/platform_tests/test_plugin/example/android/app/build.gradle +++ b/packages/pigeon/platform_tests/test_plugin/example/android/app/build.gradle @@ -31,12 +31,12 @@ android { ndkVersion flutter.ndkVersion compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_11 + targetCompatibility JavaVersion.VERSION_11 } kotlinOptions { - jvmTarget = '1.8' + jvmTarget = '11' } sourceSets { diff --git a/packages/pigeon/platform_tests/test_plugin/example/android/build.gradle b/packages/pigeon/platform_tests/test_plugin/example/android/build.gradle index 29f83a737883..b7ab9808de13 100644 --- a/packages/pigeon/platform_tests/test_plugin/example/android/build.gradle +++ b/packages/pigeon/platform_tests/test_plugin/example/android/build.gradle @@ -6,7 +6,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:7.4.2' + classpath 'com.android.tools.build:gradle:8.5.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } 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..3c85cfe057a1 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-8.7-all.zip diff --git a/packages/pigeon/platform_tests/test_plugin/example/ios/Runner.xcodeproj/project.pbxproj b/packages/pigeon/platform_tests/test_plugin/example/ios/Runner.xcodeproj/project.pbxproj index c0ccf06b3f23..ea266506b36d 100644 --- a/packages/pigeon/platform_tests/test_plugin/example/ios/Runner.xcodeproj/project.pbxproj +++ b/packages/pigeon/platform_tests/test_plugin/example/ios/Runner.xcodeproj/project.pbxproj @@ -25,6 +25,7 @@ 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 6885ADFFF3D912887C317B7C /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 786308B4AA81D1B6AA2FA10F /* Pods_Runner.framework */; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; + 8F85C49D2BBB14F30053FB60 /* InstanceManagerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F85C49C2BBB14F30053FB60 /* InstanceManagerTests.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 */; }; @@ -79,6 +80,7 @@ 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 786308B4AA81D1B6AA2FA10F /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; + 8F85C49C2BBB14F30053FB60 /* InstanceManagerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InstanceManagerTests.swift; 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; }; @@ -130,6 +132,7 @@ 33A341B7291ECCA100D34E0F /* RunnerTests.swift */, E04641F92A46270400661C9E /* NSNullFieldTests.swift */, 33A341CA291ECDFD00D34E0F /* Utils.swift */, + 8F85C49C2BBB14F30053FB60 /* InstanceManagerTests.swift */, ); path = RunnerTests; sourceTree = ""; @@ -407,6 +410,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 8F85C49D2BBB14F30053FB60 /* InstanceManagerTests.swift in Sources */, 33A341D0291ECDFD00D34E0F /* EchoBinaryMessenger.swift in Sources */, 33A341D3291ECDFD00D34E0F /* PrimitiveTests.swift in Sources */, 33A341D4291ECDFD00D34E0F /* HandlerBinaryMessenger.swift in Sources */, diff --git a/packages/pigeon/platform_tests/test_plugin/example/ios/RunnerTests/AllDatatypesTests.swift b/packages/pigeon/platform_tests/test_plugin/example/ios/RunnerTests/AllDatatypesTests.swift index 76877a809787..d35390a794cf 100644 --- a/packages/pigeon/platform_tests/test_plugin/example/ios/RunnerTests/AllDatatypesTests.swift +++ b/packages/pigeon/platform_tests/test_plugin/example/ios/RunnerTests/AllDatatypesTests.swift @@ -28,15 +28,15 @@ class AllDatatypesTests: XCTestCase { XCTAssertNil(res!.aNullable4ByteArray) XCTAssertNil(res!.aNullable8ByteArray) XCTAssertNil(res!.aNullableFloatArray) - XCTAssertNil(res!.nullableNestedList) - XCTAssertNil(res!.nullableMapWithAnnotations) - XCTAssertNil(res!.nullableMapWithObject) - XCTAssertNil(res!.map) XCTAssertNil(res!.list) XCTAssertNil(res!.boolList) XCTAssertNil(res!.intList) XCTAssertNil(res!.doubleList) XCTAssertNil(res!.stringList) + XCTAssertNil(res!.listList) + XCTAssertNil(res!.map) + XCTAssertNil(res!.stringMap) + XCTAssertNil(res!.intMap) expectation.fulfill() case .failure(_): return @@ -56,16 +56,21 @@ class AllDatatypesTests: XCTestCase { aNullable4ByteArray: FlutterStandardTypedData(int32: "1234".data(using: .utf8)!), aNullable8ByteArray: FlutterStandardTypedData(int64: "12345678".data(using: .utf8)!), aNullableFloatArray: FlutterStandardTypedData(float64: "12345678".data(using: .utf8)!), - nullableNestedList: [[true, false], [true]], - nullableMapWithAnnotations: ["hello": "world"], - nullableMapWithObject: ["hello": 1234, "goodbye": "world"], aNullableString: "123", list: ["string", 2], stringList: ["string", "another one"], intList: [1, 2], doubleList: [1.1, 2.2], boolList: [true, false], - map: ["hello": 1234] + objectList: ["string", 2], + listList: [[true], [false]], + mapList: [["hello": 1234], ["hello": 1234]], + map: ["hello": 1234], + stringMap: ["hello": "you"], + intMap: [1: 0], + objectMap: ["hello": 1234], + listMap: [1234: ["string", 2]], + mapMap: [1234: ["hello": 1234]] ) let binaryMessenger = EchoBinaryMessenger(codec: CoreTestsPigeonCodec.shared) @@ -85,15 +90,36 @@ class AllDatatypesTests: XCTestCase { XCTAssertEqual(res!.aNullable4ByteArray, everything.aNullable4ByteArray) XCTAssertEqual(res!.aNullable8ByteArray, everything.aNullable8ByteArray) XCTAssertEqual(res!.aNullableFloatArray, everything.aNullableFloatArray) - XCTAssertEqual(res!.nullableNestedList, everything.nullableNestedList) - XCTAssertEqual(res!.nullableMapWithAnnotations, everything.nullableMapWithAnnotations) - XCTAssert(equalsDictionary(res!.nullableMapWithObject, everything.nullableMapWithObject)) XCTAssert(equalsList(res!.list, everything.list)) XCTAssert(equalsList(res!.stringList, everything.stringList)) XCTAssert(equalsList(res!.intList, everything.intList)) XCTAssert(equalsList(res!.doubleList, everything.doubleList)) XCTAssert(equalsList(res!.boolList, everything.boolList)) + XCTAssert(equalsList(res!.objectList, everything.objectList)) + if res!.listList != nil { + for (index, list) in res!.listList!.enumerated() { + XCTAssert(equalsList(list, everything.listList![index])) + } + } + if res!.mapList != nil { + for (index, map) in res!.mapList!.enumerated() { + XCTAssert(equalsDictionary(map, everything.mapList![index])) + } + } XCTAssert(equalsDictionary(res!.map, everything.map)) + XCTAssert(equalsDictionary(res!.stringMap, everything.stringMap)) + XCTAssert(equalsDictionary(res!.intMap, everything.intMap)) + XCTAssert(equalsDictionary(res!.objectMap, everything.objectMap)) + if res!.listMap != nil { + for (index, list) in res!.listMap! { + XCTAssert(equalsList(list, everything.listMap![index]!)) + } + } + if res!.mapMap != nil { + for (index, map) in res!.mapMap! { + XCTAssert(equalsDictionary(map, everything.mapMap![index]!)) + } + } expectation.fulfill() return case .failure(_): diff --git a/packages/pigeon/platform_tests/test_plugin/example/ios/RunnerTests/InstanceManagerTests.swift b/packages/pigeon/platform_tests/test_plugin/example/ios/RunnerTests/InstanceManagerTests.swift new file mode 100644 index 000000000000..2031b078dbf8 --- /dev/null +++ b/packages/pigeon/platform_tests/test_plugin/example/ios/RunnerTests/InstanceManagerTests.swift @@ -0,0 +1,143 @@ +// 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 XCTest + +@testable import test_plugin + +final class InstanceManagerTests: XCTestCase { + func testAddDartCreatedInstance() { + let finalizerDelegate = EmptyFinalizerDelegate() + let instanceManager = ProxyApiTestsPigeonInstanceManager(finalizerDelegate: finalizerDelegate) + let object = NSObject() + + instanceManager.addDartCreatedInstance(object, withIdentifier: 0) + XCTAssertEqual(instanceManager.instance(forIdentifier: 0), object) + XCTAssertEqual(instanceManager.identifierWithStrongReference(forInstance: object), 0) + } + + func testAddHostCreatedInstance() { + let finalizerDelegate = EmptyFinalizerDelegate() + let instanceManager = ProxyApiTestsPigeonInstanceManager(finalizerDelegate: finalizerDelegate) + let object = NSObject() + _ = instanceManager.addHostCreatedInstance(object) + + let identifier = instanceManager.identifierWithStrongReference(forInstance: object) + XCTAssertEqual(instanceManager.instance(forIdentifier: try XCTUnwrap(identifier)), object) + } + + func testRemoveInstance() { + let finalizerDelegate = EmptyFinalizerDelegate() + let instanceManager = ProxyApiTestsPigeonInstanceManager(finalizerDelegate: finalizerDelegate) + let object = NSObject() + + instanceManager.addDartCreatedInstance(object, withIdentifier: 0) + + XCTAssertEqual(try! instanceManager.removeInstance(withIdentifier: 0), object) + XCTAssertEqual(instanceManager.strongInstanceCount, 0) + } + + func testFinalizerCallsDelegateMethod() { + let finalizerDelegate = TestFinalizerDelegate() + + var object: NSObject? = NSObject() + ProxyApiTestsPigeonInternalFinalizer.attach( + to: object!, identifier: 0, delegate: finalizerDelegate) + + object = nil + XCTAssertEqual(finalizerDelegate.lastHandledIdentifier, 0) + } + + func testRemoveAllObjects() { + let finalizerDelegate = EmptyFinalizerDelegate() + let instanceManager = ProxyApiTestsPigeonInstanceManager(finalizerDelegate: finalizerDelegate) + let object = NSObject() + + instanceManager.addDartCreatedInstance(object, withIdentifier: 0) + try? instanceManager.removeAllObjects() + + XCTAssertEqual(instanceManager.strongInstanceCount, 0) + XCTAssertEqual(instanceManager.weakInstanceCount, 0) + } + + func testCanAddSameObjectWithAddDartCreatedInstance() { + let finalizerDelegate = EmptyFinalizerDelegate() + let instanceManager = ProxyApiTestsPigeonInstanceManager(finalizerDelegate: finalizerDelegate) + let object = NSObject() + + instanceManager.addDartCreatedInstance(object, withIdentifier: 0) + instanceManager.addDartCreatedInstance(object, withIdentifier: 1) + + let instance1: NSObject? = instanceManager.instance(forIdentifier: 0) + let instance2: NSObject? = instanceManager.instance(forIdentifier: 1) + + XCTAssertEqual(instance1, instance2) + } + + func testObjectsAreStoredWithPointerHashcode() { + let finalizerDelegate = EmptyFinalizerDelegate() + let instanceManager = ProxyApiTestsPigeonInstanceManager(finalizerDelegate: finalizerDelegate) + + class EquatableClass: Equatable { + static func == (lhs: EquatableClass, rhs: EquatableClass) -> Bool { + return true + } + } + + let instance1 = EquatableClass() + let instance2 = EquatableClass() + + // Ensure instances are considered equal. + XCTAssertTrue(instance1 == instance2) + + _ = instanceManager.addHostCreatedInstance(instance1) + _ = instanceManager.addHostCreatedInstance(instance2) + + XCTAssertNotEqual( + instanceManager.identifierWithStrongReference(forInstance: instance1), + instanceManager.identifierWithStrongReference(forInstance: instance2)) + } + + func testInstanceManagerCanBeDeallocated() { + let binaryMessenger = MockBinaryMessenger( + codec: FlutterStandardMessageCodec.sharedInstance()) + + var registrar: ProxyApiTestsPigeonProxyApiRegistrar? = ProxyApiTestsPigeonProxyApiRegistrar( + binaryMessenger: binaryMessenger, apiDelegate: ProxyApiDelegate()) + + // Add the scenario where the InstanceManager contains an instance that contains a ProxyApi implementation + class TestClass { + let api: PigeonApiProxyApiTestClass + + init(_ api: PigeonApiProxyApiTestClass) { + self.api = api + } + } + _ = registrar!.instanceManager.addHostCreatedInstance( + TestClass(registrar!.apiDelegate.pigeonApiProxyApiTestClass(registrar!))) + + registrar!.setUp() + registrar!.tearDown() + + let finalizerDelegate = TestFinalizerDelegate() + + ProxyApiTestsPigeonInternalFinalizer.attach( + to: registrar!.instanceManager, identifier: 0, delegate: finalizerDelegate) + registrar = nil + XCTAssertEqual(finalizerDelegate.lastHandledIdentifier, 0) + } +} + +class EmptyFinalizerDelegate: ProxyApiTestsPigeonInternalFinalizerDelegate { + func onDeinit(identifier: Int64) {} +} + +class TestFinalizerDelegate: ProxyApiTestsPigeonInternalFinalizerDelegate { + var lastHandledIdentifier: Int64? + + func onDeinit(identifier: Int64) { + lastHandledIdentifier = identifier + } +} diff --git a/packages/pigeon/platform_tests/test_plugin/example/ios/RunnerTests/PrimitiveTests.swift b/packages/pigeon/platform_tests/test_plugin/example/ios/RunnerTests/PrimitiveTests.swift index 2f99f45f1e91..71e98552277d 100644 --- a/packages/pigeon/platform_tests/test_plugin/example/ios/RunnerTests/PrimitiveTests.swift +++ b/packages/pigeon/platform_tests/test_plugin/example/ios/RunnerTests/PrimitiveTests.swift @@ -12,7 +12,7 @@ class MockPrimitiveHostApi: PrimitiveHostApi { func aBool(value: Bool) -> Bool { value } func aString(value: String) -> String { value } func aDouble(value: Double) -> Double { value } - func aMap(value: [AnyHashable: Any?]) -> [AnyHashable: Any?] { value } + func aMap(value: [AnyHashable?: Any?]) -> [AnyHashable?: Any?] { value } func aList(value: [Any?]) -> [Any?] { value } func anInt32List(value: FlutterStandardTypedData) -> FlutterStandardTypedData { value } func aBoolList(value: [Bool?]) -> [Bool?] { value } diff --git a/packages/pigeon/platform_tests/test_plugin/example/ios/RunnerTests/Utils.swift b/packages/pigeon/platform_tests/test_plugin/example/ios/RunnerTests/Utils.swift index c244147bede2..552fc83bf923 100644 --- a/packages/pigeon/platform_tests/test_plugin/example/ios/RunnerTests/Utils.swift +++ b/packages/pigeon/platform_tests/test_plugin/example/ios/RunnerTests/Utils.swift @@ -26,7 +26,7 @@ func equalsList(_ x: [Any?]?, _ y: [Any?]?) -> Bool { return (0.. Bool { +func equalsDictionary(_ x: [AnyHashable?: Any?]?, _ y: [AnyHashable?: Any?]?) -> Bool { if x == nil, y == nil { return true } diff --git a/packages/pigeon/platform_tests/test_plugin/ios/Classes/.gitignore b/packages/pigeon/platform_tests/test_plugin/ios/Classes/.gitignore index 65eaa145c8ac..18ad850358d9 100644 --- a/packages/pigeon/platform_tests/test_plugin/ios/Classes/.gitignore +++ b/packages/pigeon/platform_tests/test_plugin/ios/Classes/.gitignore @@ -2,4 +2,8 @@ # changes on generated files. This will need a way to avoid unnecessary churn, # such as a flag to suppress version stamp generation. *.gen.swift -!CoreTests.gen.swift \ No newline at end of file +!CoreTests.gen.swift +# Keeping this makes it easier to review changes to ProxyApi generation. +!ProxyApiTests.gen.swift +# Contains the class declartions for testing ProxyApis. +!ProxyApiTestClass.swift diff --git a/packages/pigeon/platform_tests/test_plugin/ios/Classes/CoreTests.gen.swift b/packages/pigeon/platform_tests/test_plugin/ios/Classes/CoreTests.gen.swift index 00fd797edcef..2b2001d6aa44 100644 --- a/packages/pigeon/platform_tests/test_plugin/ios/Classes/CoreTests.gen.swift +++ b/packages/pigeon/platform_tests/test_plugin/ios/Classes/CoreTests.gen.swift @@ -86,6 +86,25 @@ enum AnotherEnum: Int { case justInCase = 0 } +/// Generated class from Pigeon that represents data sent in messages. +struct UnusedClass { + var aField: Any? = nil + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> UnusedClass? { + let aField: Any? = pigeonVar_list[0] + + return UnusedClass( + aField: aField + ) + } + func toList() -> [Any?] { + return [ + aField + ] + } +} + /// A class containing all supported types. /// /// Generated class from Pigeon that represents data sent in messages. @@ -103,19 +122,27 @@ struct AllTypes { var aString: String var anObject: Any var list: [Any?] - var stringList: [String?] - var intList: [Int64?] - var doubleList: [Double?] - var boolList: [Bool?] - var map: [AnyHashable: Any?] + var stringList: [String] + var intList: [Int64] + var doubleList: [Double] + var boolList: [Bool] + var enumList: [AnEnum] + var objectList: [Any] + var listList: [[Any?]] + var mapList: [[AnyHashable?: Any?]] + var map: [AnyHashable?: Any?] + var stringMap: [String: String] + var intMap: [Int64: Int64] + var enumMap: [AnEnum: AnEnum] + var objectMap: [AnyHashable: Any] + var listMap: [Int64: [Any?]] + var mapMap: [Int64: [AnyHashable?: Any?]] // swift-format-ignore: AlwaysUseLowerCamelCase static func fromList(_ pigeonVar_list: [Any?]) -> AllTypes? { let aBool = pigeonVar_list[0] as! Bool - let anInt = - pigeonVar_list[1] is Int64 ? pigeonVar_list[1] as! Int64 : Int64(pigeonVar_list[1] as! Int32) - let anInt64 = - pigeonVar_list[2] is Int64 ? pigeonVar_list[2] as! Int64 : Int64(pigeonVar_list[2] as! Int32) + let anInt = pigeonVar_list[1] as! Int64 + let anInt64 = pigeonVar_list[2] as! Int64 let aDouble = pigeonVar_list[3] as! Double let aByteArray = pigeonVar_list[4] as! FlutterStandardTypedData let a4ByteArray = pigeonVar_list[5] as! FlutterStandardTypedData @@ -126,11 +153,21 @@ struct AllTypes { let aString = pigeonVar_list[10] as! String let anObject = pigeonVar_list[11]! let list = pigeonVar_list[12] as! [Any?] - let stringList = pigeonVar_list[13] as! [String?] - let intList = pigeonVar_list[14] as! [Int64?] - let doubleList = pigeonVar_list[15] as! [Double?] - let boolList = pigeonVar_list[16] as! [Bool?] - let map = pigeonVar_list[17] as! [AnyHashable: Any?] + let stringList = pigeonVar_list[13] as! [String] + let intList = pigeonVar_list[14] as! [Int64] + let doubleList = pigeonVar_list[15] as! [Double] + let boolList = pigeonVar_list[16] as! [Bool] + let enumList = pigeonVar_list[17] as! [AnEnum] + let objectList = pigeonVar_list[18] as! [Any] + let listList = pigeonVar_list[19] as! [[Any?]] + let mapList = pigeonVar_list[20] as! [[AnyHashable?: Any?]] + let map = pigeonVar_list[21] as! [AnyHashable?: Any?] + let stringMap = pigeonVar_list[22] as! [String: String] + let intMap = pigeonVar_list[23] as! [Int64: Int64] + let enumMap = pigeonVar_list[24] as? [AnEnum: AnEnum] + let objectMap = pigeonVar_list[25] as! [AnyHashable: Any] + let listMap = pigeonVar_list[26] as! [Int64: [Any?]] + let mapMap = pigeonVar_list[27] as! [Int64: [AnyHashable?: Any?]] return AllTypes( aBool: aBool, @@ -150,7 +187,17 @@ struct AllTypes { intList: intList, doubleList: doubleList, boolList: boolList, - map: map + enumList: enumList, + objectList: objectList, + listList: listList, + mapList: mapList, + map: map, + stringMap: stringMap, + intMap: intMap, + enumMap: enumMap!, + objectMap: objectMap, + listMap: listMap, + mapMap: mapMap ) } func toList() -> [Any?] { @@ -172,7 +219,17 @@ struct AllTypes { intList, doubleList, boolList, + enumList, + objectList, + listList, + mapList, map, + stringMap, + intMap, + enumMap, + objectMap, + listMap, + mapMap, ] } } @@ -190,9 +247,6 @@ class AllNullableTypes { aNullable4ByteArray: FlutterStandardTypedData? = nil, aNullable8ByteArray: FlutterStandardTypedData? = nil, aNullableFloatArray: FlutterStandardTypedData? = nil, - nullableNestedList: [[Bool?]?]? = nil, - nullableMapWithAnnotations: [String?: String?]? = nil, - nullableMapWithObject: [String?: Any?]? = nil, aNullableEnum: AnEnum? = nil, anotherNullableEnum: AnotherEnum? = nil, aNullableString: String? = nil, @@ -203,8 +257,19 @@ class AllNullableTypes { intList: [Int64?]? = nil, doubleList: [Double?]? = nil, boolList: [Bool?]? = nil, - nestedClassList: [AllNullableTypes?]? = nil, - map: [AnyHashable: Any?]? = nil + enumList: [AnEnum?]? = nil, + objectList: [Any?]? = nil, + listList: [[Any?]?]? = nil, + mapList: [[AnyHashable?: Any?]?]? = nil, + recursiveClassList: [AllNullableTypes?]? = nil, + map: [AnyHashable?: Any?]? = nil, + stringMap: [String?: String?]? = nil, + intMap: [Int64?: Int64?]? = nil, + enumMap: [AnEnum?: AnEnum?]? = nil, + objectMap: [AnyHashable?: Any?]? = nil, + listMap: [Int64?: [Any?]?]? = nil, + mapMap: [Int64?: [AnyHashable?: Any?]?]? = nil, + recursiveClassMap: [Int64?: AllNullableTypes?]? = nil ) { self.aNullableBool = aNullableBool self.aNullableInt = aNullableInt @@ -214,9 +279,6 @@ class AllNullableTypes { self.aNullable4ByteArray = aNullable4ByteArray self.aNullable8ByteArray = aNullable8ByteArray self.aNullableFloatArray = aNullableFloatArray - self.nullableNestedList = nullableNestedList - self.nullableMapWithAnnotations = nullableMapWithAnnotations - self.nullableMapWithObject = nullableMapWithObject self.aNullableEnum = aNullableEnum self.anotherNullableEnum = anotherNullableEnum self.aNullableString = aNullableString @@ -227,8 +289,19 @@ class AllNullableTypes { self.intList = intList self.doubleList = doubleList self.boolList = boolList - self.nestedClassList = nestedClassList + self.enumList = enumList + self.objectList = objectList + self.listList = listList + self.mapList = mapList + self.recursiveClassList = recursiveClassList self.map = map + self.stringMap = stringMap + self.intMap = intMap + self.enumMap = enumMap + self.objectMap = objectMap + self.listMap = listMap + self.mapMap = mapMap + self.recursiveClassMap = recursiveClassMap } var aNullableBool: Bool? var aNullableInt: Int64? @@ -238,9 +311,6 @@ class AllNullableTypes { var aNullable4ByteArray: FlutterStandardTypedData? var aNullable8ByteArray: FlutterStandardTypedData? var aNullableFloatArray: FlutterStandardTypedData? - var nullableNestedList: [[Bool?]?]? - var nullableMapWithAnnotations: [String?: String?]? - var nullableMapWithObject: [String?: Any?]? var aNullableEnum: AnEnum? var anotherNullableEnum: AnotherEnum? var aNullableString: String? @@ -251,42 +321,53 @@ class AllNullableTypes { var intList: [Int64?]? var doubleList: [Double?]? var boolList: [Bool?]? - var nestedClassList: [AllNullableTypes?]? - var map: [AnyHashable: Any?]? + var enumList: [AnEnum?]? + var objectList: [Any?]? + var listList: [[Any?]?]? + var mapList: [[AnyHashable?: Any?]?]? + var recursiveClassList: [AllNullableTypes?]? + var map: [AnyHashable?: Any?]? + var stringMap: [String?: String?]? + var intMap: [Int64?: Int64?]? + var enumMap: [AnEnum?: AnEnum?]? + var objectMap: [AnyHashable?: Any?]? + var listMap: [Int64?: [Any?]?]? + var mapMap: [Int64?: [AnyHashable?: Any?]?]? + var recursiveClassMap: [Int64?: AllNullableTypes?]? // swift-format-ignore: AlwaysUseLowerCamelCase static func fromList(_ pigeonVar_list: [Any?]) -> AllNullableTypes? { let aNullableBool: Bool? = nilOrValue(pigeonVar_list[0]) - let aNullableInt: Int64? = - isNullish(pigeonVar_list[1]) - ? nil - : (pigeonVar_list[1] is Int64? - ? pigeonVar_list[1] as! Int64? : Int64(pigeonVar_list[1] as! Int32)) - let aNullableInt64: Int64? = - isNullish(pigeonVar_list[2]) - ? nil - : (pigeonVar_list[2] is Int64? - ? pigeonVar_list[2] as! Int64? : Int64(pigeonVar_list[2] as! Int32)) + let aNullableInt: Int64? = nilOrValue(pigeonVar_list[1]) + let aNullableInt64: Int64? = nilOrValue(pigeonVar_list[2]) let aNullableDouble: Double? = nilOrValue(pigeonVar_list[3]) let aNullableByteArray: FlutterStandardTypedData? = nilOrValue(pigeonVar_list[4]) let aNullable4ByteArray: FlutterStandardTypedData? = nilOrValue(pigeonVar_list[5]) let aNullable8ByteArray: FlutterStandardTypedData? = nilOrValue(pigeonVar_list[6]) let aNullableFloatArray: FlutterStandardTypedData? = nilOrValue(pigeonVar_list[7]) - let nullableNestedList: [[Bool?]?]? = nilOrValue(pigeonVar_list[8]) - let nullableMapWithAnnotations: [String?: String?]? = nilOrValue(pigeonVar_list[9]) - let nullableMapWithObject: [String?: Any?]? = nilOrValue(pigeonVar_list[10]) - let aNullableEnum: AnEnum? = nilOrValue(pigeonVar_list[11]) - let anotherNullableEnum: AnotherEnum? = nilOrValue(pigeonVar_list[12]) - let aNullableString: String? = nilOrValue(pigeonVar_list[13]) - let aNullableObject: Any? = pigeonVar_list[14] - let allNullableTypes: AllNullableTypes? = nilOrValue(pigeonVar_list[15]) - let list: [Any?]? = nilOrValue(pigeonVar_list[16]) - let stringList: [String?]? = nilOrValue(pigeonVar_list[17]) - let intList: [Int64?]? = nilOrValue(pigeonVar_list[18]) - let doubleList: [Double?]? = nilOrValue(pigeonVar_list[19]) - let boolList: [Bool?]? = nilOrValue(pigeonVar_list[20]) - let nestedClassList: [AllNullableTypes?]? = nilOrValue(pigeonVar_list[21]) - let map: [AnyHashable: Any?]? = nilOrValue(pigeonVar_list[22]) + let aNullableEnum: AnEnum? = nilOrValue(pigeonVar_list[8]) + let anotherNullableEnum: AnotherEnum? = nilOrValue(pigeonVar_list[9]) + let aNullableString: String? = nilOrValue(pigeonVar_list[10]) + let aNullableObject: Any? = pigeonVar_list[11] + let allNullableTypes: AllNullableTypes? = nilOrValue(pigeonVar_list[12]) + let list: [Any?]? = nilOrValue(pigeonVar_list[13]) + let stringList: [String?]? = nilOrValue(pigeonVar_list[14]) + let intList: [Int64?]? = nilOrValue(pigeonVar_list[15]) + let doubleList: [Double?]? = nilOrValue(pigeonVar_list[16]) + let boolList: [Bool?]? = nilOrValue(pigeonVar_list[17]) + let enumList: [AnEnum?]? = nilOrValue(pigeonVar_list[18]) + let objectList: [Any?]? = nilOrValue(pigeonVar_list[19]) + let listList: [[Any?]?]? = nilOrValue(pigeonVar_list[20]) + let mapList: [[AnyHashable?: Any?]?]? = nilOrValue(pigeonVar_list[21]) + let recursiveClassList: [AllNullableTypes?]? = nilOrValue(pigeonVar_list[22]) + let map: [AnyHashable?: Any?]? = nilOrValue(pigeonVar_list[23]) + let stringMap: [String?: String?]? = nilOrValue(pigeonVar_list[24]) + let intMap: [Int64?: Int64?]? = nilOrValue(pigeonVar_list[25]) + let enumMap: [AnEnum?: AnEnum?]? = pigeonVar_list[26] as? [AnEnum?: AnEnum?] + let objectMap: [AnyHashable?: Any?]? = nilOrValue(pigeonVar_list[27]) + let listMap: [Int64?: [Any?]?]? = nilOrValue(pigeonVar_list[28]) + let mapMap: [Int64?: [AnyHashable?: Any?]?]? = nilOrValue(pigeonVar_list[29]) + let recursiveClassMap: [Int64?: AllNullableTypes?]? = nilOrValue(pigeonVar_list[30]) return AllNullableTypes( aNullableBool: aNullableBool, @@ -297,9 +378,6 @@ class AllNullableTypes { aNullable4ByteArray: aNullable4ByteArray, aNullable8ByteArray: aNullable8ByteArray, aNullableFloatArray: aNullableFloatArray, - nullableNestedList: nullableNestedList, - nullableMapWithAnnotations: nullableMapWithAnnotations, - nullableMapWithObject: nullableMapWithObject, aNullableEnum: aNullableEnum, anotherNullableEnum: anotherNullableEnum, aNullableString: aNullableString, @@ -310,8 +388,19 @@ class AllNullableTypes { intList: intList, doubleList: doubleList, boolList: boolList, - nestedClassList: nestedClassList, - map: map + enumList: enumList, + objectList: objectList, + listList: listList, + mapList: mapList, + recursiveClassList: recursiveClassList, + map: map, + stringMap: stringMap, + intMap: intMap, + enumMap: enumMap, + objectMap: objectMap, + listMap: listMap, + mapMap: mapMap, + recursiveClassMap: recursiveClassMap ) } func toList() -> [Any?] { @@ -324,9 +413,6 @@ class AllNullableTypes { aNullable4ByteArray, aNullable8ByteArray, aNullableFloatArray, - nullableNestedList, - nullableMapWithAnnotations, - nullableMapWithObject, aNullableEnum, anotherNullableEnum, aNullableString, @@ -337,8 +423,19 @@ class AllNullableTypes { intList, doubleList, boolList, - nestedClassList, + enumList, + objectList, + listList, + mapList, + recursiveClassList, map, + stringMap, + intMap, + enumMap, + objectMap, + listMap, + mapMap, + recursiveClassMap, ] } } @@ -357,9 +454,6 @@ struct AllNullableTypesWithoutRecursion { var aNullable4ByteArray: FlutterStandardTypedData? = nil var aNullable8ByteArray: FlutterStandardTypedData? = nil var aNullableFloatArray: FlutterStandardTypedData? = nil - var nullableNestedList: [[Bool?]?]? = nil - var nullableMapWithAnnotations: [String?: String?]? = nil - var nullableMapWithObject: [String?: Any?]? = nil var aNullableEnum: AnEnum? = nil var anotherNullableEnum: AnotherEnum? = nil var aNullableString: String? = nil @@ -369,39 +463,48 @@ struct AllNullableTypesWithoutRecursion { var intList: [Int64?]? = nil var doubleList: [Double?]? = nil var boolList: [Bool?]? = nil - var map: [AnyHashable: Any?]? = nil + var enumList: [AnEnum?]? = nil + var objectList: [Any?]? = nil + var listList: [[Any?]?]? = nil + var mapList: [[AnyHashable?: Any?]?]? = nil + var map: [AnyHashable?: Any?]? = nil + var stringMap: [String?: String?]? = nil + var intMap: [Int64?: Int64?]? = nil + var enumMap: [AnEnum?: AnEnum?]? = nil + var objectMap: [AnyHashable?: Any?]? = nil + var listMap: [Int64?: [Any?]?]? = nil + var mapMap: [Int64?: [AnyHashable?: Any?]?]? = nil // swift-format-ignore: AlwaysUseLowerCamelCase static func fromList(_ pigeonVar_list: [Any?]) -> AllNullableTypesWithoutRecursion? { let aNullableBool: Bool? = nilOrValue(pigeonVar_list[0]) - let aNullableInt: Int64? = - isNullish(pigeonVar_list[1]) - ? nil - : (pigeonVar_list[1] is Int64? - ? pigeonVar_list[1] as! Int64? : Int64(pigeonVar_list[1] as! Int32)) - let aNullableInt64: Int64? = - isNullish(pigeonVar_list[2]) - ? nil - : (pigeonVar_list[2] is Int64? - ? pigeonVar_list[2] as! Int64? : Int64(pigeonVar_list[2] as! Int32)) + let aNullableInt: Int64? = nilOrValue(pigeonVar_list[1]) + let aNullableInt64: Int64? = nilOrValue(pigeonVar_list[2]) let aNullableDouble: Double? = nilOrValue(pigeonVar_list[3]) let aNullableByteArray: FlutterStandardTypedData? = nilOrValue(pigeonVar_list[4]) let aNullable4ByteArray: FlutterStandardTypedData? = nilOrValue(pigeonVar_list[5]) let aNullable8ByteArray: FlutterStandardTypedData? = nilOrValue(pigeonVar_list[6]) let aNullableFloatArray: FlutterStandardTypedData? = nilOrValue(pigeonVar_list[7]) - let nullableNestedList: [[Bool?]?]? = nilOrValue(pigeonVar_list[8]) - let nullableMapWithAnnotations: [String?: String?]? = nilOrValue(pigeonVar_list[9]) - let nullableMapWithObject: [String?: Any?]? = nilOrValue(pigeonVar_list[10]) - let aNullableEnum: AnEnum? = nilOrValue(pigeonVar_list[11]) - let anotherNullableEnum: AnotherEnum? = nilOrValue(pigeonVar_list[12]) - let aNullableString: String? = nilOrValue(pigeonVar_list[13]) - let aNullableObject: Any? = pigeonVar_list[14] - let list: [Any?]? = nilOrValue(pigeonVar_list[15]) - let stringList: [String?]? = nilOrValue(pigeonVar_list[16]) - let intList: [Int64?]? = nilOrValue(pigeonVar_list[17]) - let doubleList: [Double?]? = nilOrValue(pigeonVar_list[18]) - let boolList: [Bool?]? = nilOrValue(pigeonVar_list[19]) - let map: [AnyHashable: Any?]? = nilOrValue(pigeonVar_list[20]) + let aNullableEnum: AnEnum? = nilOrValue(pigeonVar_list[8]) + let anotherNullableEnum: AnotherEnum? = nilOrValue(pigeonVar_list[9]) + let aNullableString: String? = nilOrValue(pigeonVar_list[10]) + let aNullableObject: Any? = pigeonVar_list[11] + let list: [Any?]? = nilOrValue(pigeonVar_list[12]) + let stringList: [String?]? = nilOrValue(pigeonVar_list[13]) + let intList: [Int64?]? = nilOrValue(pigeonVar_list[14]) + let doubleList: [Double?]? = nilOrValue(pigeonVar_list[15]) + let boolList: [Bool?]? = nilOrValue(pigeonVar_list[16]) + let enumList: [AnEnum?]? = nilOrValue(pigeonVar_list[17]) + let objectList: [Any?]? = nilOrValue(pigeonVar_list[18]) + let listList: [[Any?]?]? = nilOrValue(pigeonVar_list[19]) + let mapList: [[AnyHashable?: Any?]?]? = nilOrValue(pigeonVar_list[20]) + let map: [AnyHashable?: Any?]? = nilOrValue(pigeonVar_list[21]) + let stringMap: [String?: String?]? = nilOrValue(pigeonVar_list[22]) + let intMap: [Int64?: Int64?]? = nilOrValue(pigeonVar_list[23]) + let enumMap: [AnEnum?: AnEnum?]? = pigeonVar_list[24] as? [AnEnum?: AnEnum?] + let objectMap: [AnyHashable?: Any?]? = nilOrValue(pigeonVar_list[25]) + let listMap: [Int64?: [Any?]?]? = nilOrValue(pigeonVar_list[26]) + let mapMap: [Int64?: [AnyHashable?: Any?]?]? = nilOrValue(pigeonVar_list[27]) return AllNullableTypesWithoutRecursion( aNullableBool: aNullableBool, @@ -412,9 +515,6 @@ struct AllNullableTypesWithoutRecursion { aNullable4ByteArray: aNullable4ByteArray, aNullable8ByteArray: aNullable8ByteArray, aNullableFloatArray: aNullableFloatArray, - nullableNestedList: nullableNestedList, - nullableMapWithAnnotations: nullableMapWithAnnotations, - nullableMapWithObject: nullableMapWithObject, aNullableEnum: aNullableEnum, anotherNullableEnum: anotherNullableEnum, aNullableString: aNullableString, @@ -424,7 +524,17 @@ struct AllNullableTypesWithoutRecursion { intList: intList, doubleList: doubleList, boolList: boolList, - map: map + enumList: enumList, + objectList: objectList, + listList: listList, + mapList: mapList, + map: map, + stringMap: stringMap, + intMap: intMap, + enumMap: enumMap, + objectMap: objectMap, + listMap: listMap, + mapMap: mapMap ) } func toList() -> [Any?] { @@ -437,9 +547,6 @@ struct AllNullableTypesWithoutRecursion { aNullable4ByteArray, aNullable8ByteArray, aNullableFloatArray, - nullableNestedList, - nullableMapWithAnnotations, - nullableMapWithObject, aNullableEnum, anotherNullableEnum, aNullableString, @@ -449,7 +556,17 @@ struct AllNullableTypesWithoutRecursion { intList, doubleList, boolList, + enumList, + objectList, + listList, + mapList, map, + stringMap, + intMap, + enumMap, + objectMap, + listMap, + mapMap, ] } } @@ -465,6 +582,10 @@ struct AllClassesWrapper { var allNullableTypes: AllNullableTypes var allNullableTypesWithoutRecursion: AllNullableTypesWithoutRecursion? = nil var allTypes: AllTypes? = nil + var classList: [AllTypes?] + var nullableClassList: [AllNullableTypesWithoutRecursion?]? = nil + var classMap: [Int64?: AllTypes?] + var nullableClassMap: [Int64?: AllNullableTypesWithoutRecursion?]? = nil // swift-format-ignore: AlwaysUseLowerCamelCase static func fromList(_ pigeonVar_list: [Any?]) -> AllClassesWrapper? { @@ -472,11 +593,20 @@ struct AllClassesWrapper { let allNullableTypesWithoutRecursion: AllNullableTypesWithoutRecursion? = nilOrValue( pigeonVar_list[1]) let allTypes: AllTypes? = nilOrValue(pigeonVar_list[2]) + let classList = pigeonVar_list[3] as! [AllTypes?] + let nullableClassList: [AllNullableTypesWithoutRecursion?]? = nilOrValue(pigeonVar_list[4]) + let classMap = pigeonVar_list[5] as! [Int64?: AllTypes?] + let nullableClassMap: [Int64?: AllNullableTypesWithoutRecursion?]? = nilOrValue( + pigeonVar_list[6]) return AllClassesWrapper( allNullableTypes: allNullableTypes, allNullableTypesWithoutRecursion: allNullableTypesWithoutRecursion, - allTypes: allTypes + allTypes: allTypes, + classList: classList, + nullableClassList: nullableClassList, + classMap: classMap, + nullableClassMap: nullableClassMap ) } func toList() -> [Any?] { @@ -484,6 +614,10 @@ struct AllClassesWrapper { allNullableTypes, allNullableTypesWithoutRecursion, allTypes, + classList, + nullableClassList, + classMap, + nullableClassMap, ] } } @@ -513,26 +647,28 @@ private class CoreTestsPigeonCodecReader: FlutterStandardReader { override func readValue(ofType type: UInt8) -> Any? { switch type { case 129: - let enumResultAsInt: Int? = nilOrValue(self.readValue() as? Int) + let enumResultAsInt: Int? = nilOrValue(self.readValue() as! Int?) if let enumResultAsInt = enumResultAsInt { return AnEnum(rawValue: enumResultAsInt) } return nil case 130: - let enumResultAsInt: Int? = nilOrValue(self.readValue() as? Int) + let enumResultAsInt: Int? = nilOrValue(self.readValue() as! Int?) if let enumResultAsInt = enumResultAsInt { return AnotherEnum(rawValue: enumResultAsInt) } return nil case 131: - return AllTypes.fromList(self.readValue() as! [Any?]) + return UnusedClass.fromList(self.readValue() as! [Any?]) case 132: - return AllNullableTypes.fromList(self.readValue() as! [Any?]) + return AllTypes.fromList(self.readValue() as! [Any?]) case 133: - return AllNullableTypesWithoutRecursion.fromList(self.readValue() as! [Any?]) + return AllNullableTypes.fromList(self.readValue() as! [Any?]) case 134: - return AllClassesWrapper.fromList(self.readValue() as! [Any?]) + return AllNullableTypesWithoutRecursion.fromList(self.readValue() as! [Any?]) case 135: + return AllClassesWrapper.fromList(self.readValue() as! [Any?]) + case 136: return TestMessage.fromList(self.readValue() as! [Any?]) default: return super.readValue(ofType: type) @@ -548,21 +684,24 @@ private class CoreTestsPigeonCodecWriter: FlutterStandardWriter { } else if let value = value as? AnotherEnum { super.writeByte(130) super.writeValue(value.rawValue) - } else if let value = value as? AllTypes { + } else if let value = value as? UnusedClass { super.writeByte(131) super.writeValue(value.toList()) - } else if let value = value as? AllNullableTypes { + } else if let value = value as? AllTypes { super.writeByte(132) super.writeValue(value.toList()) - } else if let value = value as? AllNullableTypesWithoutRecursion { + } else if let value = value as? AllNullableTypes { super.writeByte(133) super.writeValue(value.toList()) - } else if let value = value as? AllClassesWrapper { + } else if let value = value as? AllNullableTypesWithoutRecursion { super.writeByte(134) super.writeValue(value.toList()) - } else if let value = value as? TestMessage { + } else if let value = value as? AllClassesWrapper { super.writeByte(135) super.writeValue(value.toList()) + } else if let value = value as? TestMessage { + super.writeByte(136) + super.writeValue(value.toList()) } else { super.writeValue(value) } @@ -613,9 +752,33 @@ protocol HostIntegrationCoreApi { func echo(_ anObject: Any) throws -> Any /// Returns the passed list, to test serialization and deserialization. func echo(_ list: [Any?]) throws -> [Any?] + /// Returns the passed list, to test serialization and deserialization. + func echo(enumList: [AnEnum?]) throws -> [AnEnum?] + /// Returns the passed list, to test serialization and deserialization. + func echo(classList: [AllNullableTypes?]) throws -> [AllNullableTypes?] + /// Returns the passed list, to test serialization and deserialization. + func echoNonNull(enumList: [AnEnum]) throws -> [AnEnum] + /// Returns the passed list, to test serialization and deserialization. + func echoNonNull(classList: [AllNullableTypes]) throws -> [AllNullableTypes] + /// Returns the passed map, to test serialization and deserialization. + func echo(_ map: [AnyHashable?: Any?]) throws -> [AnyHashable?: Any?] + /// Returns the passed map, to test serialization and deserialization. + func echo(stringMap: [String?: String?]) throws -> [String?: String?] + /// Returns the passed map, to test serialization and deserialization. + func echo(intMap: [Int64?: Int64?]) throws -> [Int64?: Int64?] + /// Returns the passed map, to test serialization and deserialization. + func echo(enumMap: [AnEnum?: AnEnum?]) throws -> [AnEnum?: AnEnum?] + /// Returns the passed map, to test serialization and deserialization. + func echo(classMap: [Int64?: AllNullableTypes?]) throws -> [Int64?: AllNullableTypes?] /// Returns the passed map, to test serialization and deserialization. - func echo(_ aMap: [String?: Any?]) throws -> [String?: Any?] - /// Returns the passed map to test nested class serialization and deserialization. + func echoNonNull(stringMap: [String: String]) throws -> [String: String] + /// Returns the passed map, to test serialization and deserialization. + func echoNonNull(intMap: [Int64: Int64]) throws -> [Int64: Int64] + /// Returns the passed map, to test serialization and deserialization. + func echoNonNull(enumMap: [AnEnum: AnEnum]) throws -> [AnEnum: AnEnum] + /// Returns the passed map, to test serialization and deserialization. + func echoNonNull(classMap: [Int64: AllNullableTypes]) throws -> [Int64: AllNullableTypes] + /// Returns the passed class to test nested class serialization and deserialization. func echo(_ wrapper: AllClassesWrapper) throws -> AllClassesWrapper /// Returns the passed enum to test serialization and deserialization. func echo(_ anEnum: AnEnum) throws -> AnEnum @@ -660,8 +823,33 @@ protocol HostIntegrationCoreApi { func echo(_ aNullableObject: Any?) throws -> Any? /// Returns the passed list, to test serialization and deserialization. func echoNullable(_ aNullableList: [Any?]?) throws -> [Any?]? + /// Returns the passed list, to test serialization and deserialization. + func echoNullable(enumList: [AnEnum?]?) throws -> [AnEnum?]? + /// Returns the passed list, to test serialization and deserialization. + func echoNullable(classList: [AllNullableTypes?]?) throws -> [AllNullableTypes?]? + /// Returns the passed list, to test serialization and deserialization. + func echoNullableNonNull(enumList: [AnEnum]?) throws -> [AnEnum]? + /// Returns the passed list, to test serialization and deserialization. + func echoNullableNonNull(classList: [AllNullableTypes]?) throws -> [AllNullableTypes]? + /// Returns the passed map, to test serialization and deserialization. + func echoNullable(_ map: [AnyHashable?: Any?]?) throws -> [AnyHashable?: Any?]? /// Returns the passed map, to test serialization and deserialization. - func echoNullable(_ aNullableMap: [String?: Any?]?) throws -> [String?: Any?]? + func echoNullable(stringMap: [String?: String?]?) throws -> [String?: String?]? + /// Returns the passed map, to test serialization and deserialization. + func echoNullable(intMap: [Int64?: Int64?]?) throws -> [Int64?: Int64?]? + /// Returns the passed map, to test serialization and deserialization. + func echoNullable(enumMap: [AnEnum?: AnEnum?]?) throws -> [AnEnum?: AnEnum?]? + /// Returns the passed map, to test serialization and deserialization. + func echoNullable(classMap: [Int64?: AllNullableTypes?]?) throws -> [Int64?: AllNullableTypes?]? + /// Returns the passed map, to test serialization and deserialization. + func echoNullableNonNull(stringMap: [String: String]?) throws -> [String: String]? + /// Returns the passed map, to test serialization and deserialization. + func echoNullableNonNull(intMap: [Int64: Int64]?) throws -> [Int64: Int64]? + /// Returns the passed map, to test serialization and deserialization. + func echoNullableNonNull(enumMap: [AnEnum: AnEnum]?) throws -> [AnEnum: AnEnum]? + /// Returns the passed map, to test serialization and deserialization. + func echoNullableNonNull(classMap: [Int64: AllNullableTypes]?) throws -> [Int64: + AllNullableTypes]? func echoNullable(_ anEnum: AnEnum?) throws -> AnEnum? func echoNullable(_ anotherEnum: AnotherEnum?) throws -> AnotherEnum? /// Returns passed in int. @@ -687,9 +875,30 @@ protocol HostIntegrationCoreApi { func echoAsync(_ anObject: Any, completion: @escaping (Result) -> Void) /// Returns the passed list, to test asynchronous serialization and deserialization. func echoAsync(_ list: [Any?], completion: @escaping (Result<[Any?], Error>) -> Void) + /// Returns the passed list, to test asynchronous serialization and deserialization. + func echoAsync(enumList: [AnEnum?], completion: @escaping (Result<[AnEnum?], Error>) -> Void) + /// Returns the passed list, to test asynchronous serialization and deserialization. + func echoAsync( + classList: [AllNullableTypes?], + completion: @escaping (Result<[AllNullableTypes?], Error>) -> Void) + /// Returns the passed map, to test asynchronous serialization and deserialization. + func echoAsync( + _ map: [AnyHashable?: Any?], completion: @escaping (Result<[AnyHashable?: Any?], Error>) -> Void + ) + /// Returns the passed map, to test asynchronous serialization and deserialization. + func echoAsync( + stringMap: [String?: String?], completion: @escaping (Result<[String?: String?], Error>) -> Void + ) /// Returns the passed map, to test asynchronous serialization and deserialization. func echoAsync( - _ aMap: [String?: Any?], completion: @escaping (Result<[String?: Any?], Error>) -> Void) + intMap: [Int64?: Int64?], completion: @escaping (Result<[Int64?: Int64?], Error>) -> Void) + /// Returns the passed map, to test asynchronous serialization and deserialization. + func echoAsync( + enumMap: [AnEnum?: AnEnum?], completion: @escaping (Result<[AnEnum?: AnEnum?], Error>) -> Void) + /// Returns the passed map, to test asynchronous serialization and deserialization. + func echoAsync( + classMap: [Int64?: AllNullableTypes?], + completion: @escaping (Result<[Int64?: AllNullableTypes?], Error>) -> Void) /// Returns the passed enum, to test asynchronous serialization and deserialization. func echoAsync(_ anEnum: AnEnum, completion: @escaping (Result) -> Void) /// Returns the passed enum, to test asynchronous serialization and deserialization. @@ -727,9 +936,32 @@ protocol HostIntegrationCoreApi { func echoAsyncNullable(_ anObject: Any?, completion: @escaping (Result) -> Void) /// Returns the passed list, to test asynchronous serialization and deserialization. func echoAsyncNullable(_ list: [Any?]?, completion: @escaping (Result<[Any?]?, Error>) -> Void) + /// Returns the passed list, to test asynchronous serialization and deserialization. + func echoAsyncNullable( + enumList: [AnEnum?]?, completion: @escaping (Result<[AnEnum?]?, Error>) -> Void) + /// Returns the passed list, to test asynchronous serialization and deserialization. + func echoAsyncNullable( + classList: [AllNullableTypes?]?, + completion: @escaping (Result<[AllNullableTypes?]?, Error>) -> Void) + /// Returns the passed map, to test asynchronous serialization and deserialization. + func echoAsyncNullable( + _ map: [AnyHashable?: Any?]?, + completion: @escaping (Result<[AnyHashable?: Any?]?, Error>) -> Void) + /// Returns the passed map, to test asynchronous serialization and deserialization. + func echoAsyncNullable( + stringMap: [String?: String?]?, + completion: @escaping (Result<[String?: String?]?, Error>) -> Void) + /// Returns the passed map, to test asynchronous serialization and deserialization. + func echoAsyncNullable( + intMap: [Int64?: Int64?]?, completion: @escaping (Result<[Int64?: Int64?]?, Error>) -> Void) + /// Returns the passed map, to test asynchronous serialization and deserialization. + func echoAsyncNullable( + enumMap: [AnEnum?: AnEnum?]?, completion: @escaping (Result<[AnEnum?: AnEnum?]?, Error>) -> Void + ) /// Returns the passed map, to test asynchronous serialization and deserialization. func echoAsyncNullable( - _ aMap: [String?: Any?]?, completion: @escaping (Result<[String?: Any?]?, Error>) -> Void) + classMap: [Int64?: AllNullableTypes?]?, + completion: @escaping (Result<[Int64?: AllNullableTypes?]?, Error>) -> Void) /// Returns the passed enum, to test asynchronous serialization and deserialization. func echoAsyncNullable(_ anEnum: AnEnum?, completion: @escaping (Result) -> Void) /// Returns the passed enum, to test asynchronous serialization and deserialization. @@ -761,7 +993,37 @@ protocol HostIntegrationCoreApi { completion: @escaping (Result) -> Void) func callFlutterEcho(_ list: [Any?], completion: @escaping (Result<[Any?], Error>) -> Void) func callFlutterEcho( - _ aMap: [String?: Any?], completion: @escaping (Result<[String?: Any?], Error>) -> Void) + enumList: [AnEnum?], completion: @escaping (Result<[AnEnum?], Error>) -> Void) + func callFlutterEcho( + classList: [AllNullableTypes?], + completion: @escaping (Result<[AllNullableTypes?], Error>) -> Void) + func callFlutterEchoNonNull( + enumList: [AnEnum], completion: @escaping (Result<[AnEnum], Error>) -> Void) + func callFlutterEchoNonNull( + classList: [AllNullableTypes], completion: @escaping (Result<[AllNullableTypes], Error>) -> Void + ) + func callFlutterEcho( + _ map: [AnyHashable?: Any?], completion: @escaping (Result<[AnyHashable?: Any?], Error>) -> Void + ) + func callFlutterEcho( + stringMap: [String?: String?], completion: @escaping (Result<[String?: String?], Error>) -> Void + ) + func callFlutterEcho( + intMap: [Int64?: Int64?], completion: @escaping (Result<[Int64?: Int64?], Error>) -> Void) + func callFlutterEcho( + enumMap: [AnEnum?: AnEnum?], completion: @escaping (Result<[AnEnum?: AnEnum?], Error>) -> Void) + func callFlutterEcho( + classMap: [Int64?: AllNullableTypes?], + completion: @escaping (Result<[Int64?: AllNullableTypes?], Error>) -> Void) + func callFlutterEchoNonNull( + stringMap: [String: String], completion: @escaping (Result<[String: String], Error>) -> Void) + func callFlutterEchoNonNull( + intMap: [Int64: Int64], completion: @escaping (Result<[Int64: Int64], Error>) -> Void) + func callFlutterEchoNonNull( + enumMap: [AnEnum: AnEnum], completion: @escaping (Result<[AnEnum: AnEnum], Error>) -> Void) + func callFlutterEchoNonNull( + classMap: [Int64: AllNullableTypes], + completion: @escaping (Result<[Int64: AllNullableTypes], Error>) -> Void) func callFlutterEcho(_ anEnum: AnEnum, completion: @escaping (Result) -> Void) func callFlutterEcho( _ anotherEnum: AnotherEnum, completion: @escaping (Result) -> Void) @@ -778,7 +1040,38 @@ protocol HostIntegrationCoreApi { func callFlutterEchoNullable( _ list: [Any?]?, completion: @escaping (Result<[Any?]?, Error>) -> Void) func callFlutterEchoNullable( - _ aMap: [String?: Any?]?, completion: @escaping (Result<[String?: Any?]?, Error>) -> Void) + enumList: [AnEnum?]?, completion: @escaping (Result<[AnEnum?]?, Error>) -> Void) + func callFlutterEchoNullable( + classList: [AllNullableTypes?]?, + completion: @escaping (Result<[AllNullableTypes?]?, Error>) -> Void) + func callFlutterEchoNullableNonNull( + enumList: [AnEnum]?, completion: @escaping (Result<[AnEnum]?, Error>) -> Void) + func callFlutterEchoNullableNonNull( + classList: [AllNullableTypes]?, + completion: @escaping (Result<[AllNullableTypes]?, Error>) -> Void) + func callFlutterEchoNullable( + _ map: [AnyHashable?: Any?]?, + completion: @escaping (Result<[AnyHashable?: Any?]?, Error>) -> Void) + func callFlutterEchoNullable( + stringMap: [String?: String?]?, + completion: @escaping (Result<[String?: String?]?, Error>) -> Void) + func callFlutterEchoNullable( + intMap: [Int64?: Int64?]?, completion: @escaping (Result<[Int64?: Int64?]?, Error>) -> Void) + func callFlutterEchoNullable( + enumMap: [AnEnum?: AnEnum?]?, completion: @escaping (Result<[AnEnum?: AnEnum?]?, Error>) -> Void + ) + func callFlutterEchoNullable( + classMap: [Int64?: AllNullableTypes?]?, + completion: @escaping (Result<[Int64?: AllNullableTypes?]?, Error>) -> Void) + func callFlutterEchoNullableNonNull( + stringMap: [String: String]?, completion: @escaping (Result<[String: String]?, Error>) -> Void) + func callFlutterEchoNullableNonNull( + intMap: [Int64: Int64]?, completion: @escaping (Result<[Int64: Int64]?, Error>) -> Void) + func callFlutterEchoNullableNonNull( + enumMap: [AnEnum: AnEnum]?, completion: @escaping (Result<[AnEnum: AnEnum]?, Error>) -> Void) + func callFlutterEchoNullableNonNull( + classMap: [Int64: AllNullableTypes]?, + completion: @escaping (Result<[Int64: AllNullableTypes]?, Error>) -> Void) func callFlutterEchoNullable( _ anEnum: AnEnum?, completion: @escaping (Result) -> Void) func callFlutterEchoNullable( @@ -892,7 +1185,7 @@ class HostIntegrationCoreApiSetup { if let api = api { echoIntChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let anIntArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) + let anIntArg = args[0] as! Int64 do { let result = try api.echo(anIntArg) reply(wrapResult(result)) @@ -1017,6 +1310,82 @@ class HostIntegrationCoreApiSetup { } else { echoListChannel.setMessageHandler(nil) } + /// Returns the passed list, to test serialization and deserialization. + let echoEnumListChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoEnumList\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoEnumListChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let enumListArg = args[0] as! [AnEnum?] + do { + let result = try api.echo(enumList: enumListArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoEnumListChannel.setMessageHandler(nil) + } + /// Returns the passed list, to test serialization and deserialization. + let echoClassListChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoClassList\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoClassListChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let classListArg = args[0] as! [AllNullableTypes?] + do { + let result = try api.echo(classList: classListArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoClassListChannel.setMessageHandler(nil) + } + /// Returns the passed list, to test serialization and deserialization. + let echoNonNullEnumListChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNonNullEnumList\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoNonNullEnumListChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let enumListArg = args[0] as! [AnEnum] + do { + let result = try api.echoNonNull(enumList: enumListArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoNonNullEnumListChannel.setMessageHandler(nil) + } + /// Returns the passed list, to test serialization and deserialization. + let echoNonNullClassListChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNonNullClassList\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoNonNullClassListChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let classListArg = args[0] as! [AllNullableTypes] + do { + let result = try api.echoNonNull(classList: classListArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoNonNullClassListChannel.setMessageHandler(nil) + } /// Returns the passed map, to test serialization and deserialization. let echoMapChannel = FlutterBasicMessageChannel( name: @@ -1025,9 +1394,9 @@ class HostIntegrationCoreApiSetup { if let api = api { echoMapChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let aMapArg = args[0] as! [String?: Any?] + let mapArg = args[0] as! [AnyHashable?: Any?] do { - let result = try api.echo(aMapArg) + let result = try api.echo(mapArg) reply(wrapResult(result)) } catch { reply(wrapError(error)) @@ -1036,7 +1405,159 @@ class HostIntegrationCoreApiSetup { } else { echoMapChannel.setMessageHandler(nil) } - /// Returns the passed map to test nested class serialization and deserialization. + /// Returns the passed map, to test serialization and deserialization. + let echoStringMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoStringMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoStringMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let stringMapArg = args[0] as! [String?: String?] + do { + let result = try api.echo(stringMap: stringMapArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoStringMapChannel.setMessageHandler(nil) + } + /// Returns the passed map, to test serialization and deserialization. + let echoIntMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoIntMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoIntMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let intMapArg = args[0] as! [Int64?: Int64?] + do { + let result = try api.echo(intMap: intMapArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoIntMapChannel.setMessageHandler(nil) + } + /// Returns the passed map, to test serialization and deserialization. + let echoEnumMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoEnumMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoEnumMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let enumMapArg = args[0] as? [AnEnum?: AnEnum?] + do { + let result = try api.echo(enumMap: enumMapArg!) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoEnumMapChannel.setMessageHandler(nil) + } + /// Returns the passed map, to test serialization and deserialization. + let echoClassMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoClassMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoClassMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let classMapArg = args[0] as! [Int64?: AllNullableTypes?] + do { + let result = try api.echo(classMap: classMapArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoClassMapChannel.setMessageHandler(nil) + } + /// Returns the passed map, to test serialization and deserialization. + let echoNonNullStringMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNonNullStringMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoNonNullStringMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let stringMapArg = args[0] as! [String: String] + do { + let result = try api.echoNonNull(stringMap: stringMapArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoNonNullStringMapChannel.setMessageHandler(nil) + } + /// Returns the passed map, to test serialization and deserialization. + let echoNonNullIntMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNonNullIntMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoNonNullIntMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let intMapArg = args[0] as! [Int64: Int64] + do { + let result = try api.echoNonNull(intMap: intMapArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoNonNullIntMapChannel.setMessageHandler(nil) + } + /// Returns the passed map, to test serialization and deserialization. + let echoNonNullEnumMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNonNullEnumMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoNonNullEnumMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let enumMapArg = args[0] as? [AnEnum: AnEnum] + do { + let result = try api.echoNonNull(enumMap: enumMapArg!) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoNonNullEnumMapChannel.setMessageHandler(nil) + } + /// Returns the passed map, to test serialization and deserialization. + let echoNonNullClassMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNonNullClassMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoNonNullClassMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let classMapArg = args[0] as! [Int64: AllNullableTypes] + do { + let result = try api.echoNonNull(classMap: classMapArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoNonNullClassMapChannel.setMessageHandler(nil) + } + /// Returns the passed class to test nested class serialization and deserialization. let echoClassWrapperChannel = FlutterBasicMessageChannel( name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoClassWrapper\(channelSuffix)", @@ -1139,7 +1660,7 @@ class HostIntegrationCoreApiSetup { if let api = api { echoRequiredIntChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let anIntArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) + let anIntArg = args[0] as! Int64 do { let result = try api.echoRequired(anIntArg) reply(wrapResult(result)) @@ -1237,9 +1758,7 @@ class HostIntegrationCoreApiSetup { sendMultipleNullableTypesChannel.setMessageHandler { message, reply in let args = message as! [Any?] let aNullableBoolArg: Bool? = nilOrValue(args[0]) - let aNullableIntArg: Int64? = - isNullish(args[1]) - ? nil : (args[1] is Int64? ? args[1] as! Int64? : Int64(args[1] as! Int32)) + let aNullableIntArg: Int64? = nilOrValue(args[1]) let aNullableStringArg: String? = nilOrValue(args[2]) do { let result = try api.sendMultipleNullableTypes( @@ -1261,9 +1780,7 @@ class HostIntegrationCoreApiSetup { sendMultipleNullableTypesWithoutRecursionChannel.setMessageHandler { message, reply in let args = message as! [Any?] let aNullableBoolArg: Bool? = nilOrValue(args[0]) - let aNullableIntArg: Int64? = - isNullish(args[1]) - ? nil : (args[1] is Int64? ? args[1] as! Int64? : Int64(args[1] as! Int32)) + let aNullableIntArg: Int64? = nilOrValue(args[1]) let aNullableStringArg: String? = nilOrValue(args[2]) do { let result = try api.sendMultipleNullableTypesWithoutRecursion( @@ -1284,9 +1801,7 @@ class HostIntegrationCoreApiSetup { if let api = api { echoNullableIntChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let aNullableIntArg: Int64? = - isNullish(args[0]) - ? nil : (args[0] is Int64? ? args[0] as! Int64? : Int64(args[0] as! Int32)) + let aNullableIntArg: Int64? = nilOrValue(args[0]) do { let result = try api.echo(aNullableIntArg) reply(wrapResult(result)) @@ -1411,17 +1926,93 @@ class HostIntegrationCoreApiSetup { } else { echoNullableListChannel.setMessageHandler(nil) } - /// Returns the passed map, to test serialization and deserialization. - let echoNullableMapChannel = FlutterBasicMessageChannel( + /// Returns the passed list, to test serialization and deserialization. + let echoNullableEnumListChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableEnumList\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoNullableEnumListChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let enumListArg: [AnEnum?]? = nilOrValue(args[0]) + do { + let result = try api.echoNullable(enumList: enumListArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoNullableEnumListChannel.setMessageHandler(nil) + } + /// Returns the passed list, to test serialization and deserialization. + let echoNullableClassListChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableClassList\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoNullableClassListChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let classListArg: [AllNullableTypes?]? = nilOrValue(args[0]) + do { + let result = try api.echoNullable(classList: classListArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoNullableClassListChannel.setMessageHandler(nil) + } + /// Returns the passed list, to test serialization and deserialization. + let echoNullableNonNullEnumListChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableNonNullEnumList\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoNullableNonNullEnumListChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let enumListArg: [AnEnum]? = nilOrValue(args[0]) + do { + let result = try api.echoNullableNonNull(enumList: enumListArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoNullableNonNullEnumListChannel.setMessageHandler(nil) + } + /// Returns the passed list, to test serialization and deserialization. + let echoNullableNonNullClassListChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableNonNullClassList\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoNullableNonNullClassListChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let classListArg: [AllNullableTypes]? = nilOrValue(args[0]) + do { + let result = try api.echoNullableNonNull(classList: classListArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoNullableNonNullClassListChannel.setMessageHandler(nil) + } + /// Returns the passed map, to test serialization and deserialization. + let echoNullableMapChannel = FlutterBasicMessageChannel( name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableMap\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoNullableMapChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let aNullableMapArg: [String?: Any?]? = nilOrValue(args[0]) + let mapArg: [AnyHashable?: Any?]? = nilOrValue(args[0]) do { - let result = try api.echoNullable(aNullableMapArg) + let result = try api.echoNullable(mapArg) reply(wrapResult(result)) } catch { reply(wrapError(error)) @@ -1430,6 +2021,158 @@ class HostIntegrationCoreApiSetup { } else { echoNullableMapChannel.setMessageHandler(nil) } + /// Returns the passed map, to test serialization and deserialization. + let echoNullableStringMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableStringMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoNullableStringMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let stringMapArg: [String?: String?]? = nilOrValue(args[0]) + do { + let result = try api.echoNullable(stringMap: stringMapArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoNullableStringMapChannel.setMessageHandler(nil) + } + /// Returns the passed map, to test serialization and deserialization. + let echoNullableIntMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableIntMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoNullableIntMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let intMapArg: [Int64?: Int64?]? = nilOrValue(args[0]) + do { + let result = try api.echoNullable(intMap: intMapArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoNullableIntMapChannel.setMessageHandler(nil) + } + /// Returns the passed map, to test serialization and deserialization. + let echoNullableEnumMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableEnumMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoNullableEnumMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let enumMapArg: [AnEnum?: AnEnum?]? = args[0] as? [AnEnum?: AnEnum?] + do { + let result = try api.echoNullable(enumMap: enumMapArg!) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoNullableEnumMapChannel.setMessageHandler(nil) + } + /// Returns the passed map, to test serialization and deserialization. + let echoNullableClassMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableClassMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoNullableClassMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let classMapArg: [Int64?: AllNullableTypes?]? = nilOrValue(args[0]) + do { + let result = try api.echoNullable(classMap: classMapArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoNullableClassMapChannel.setMessageHandler(nil) + } + /// Returns the passed map, to test serialization and deserialization. + let echoNullableNonNullStringMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableNonNullStringMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoNullableNonNullStringMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let stringMapArg: [String: String]? = nilOrValue(args[0]) + do { + let result = try api.echoNullableNonNull(stringMap: stringMapArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoNullableNonNullStringMapChannel.setMessageHandler(nil) + } + /// Returns the passed map, to test serialization and deserialization. + let echoNullableNonNullIntMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableNonNullIntMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoNullableNonNullIntMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let intMapArg: [Int64: Int64]? = nilOrValue(args[0]) + do { + let result = try api.echoNullableNonNull(intMap: intMapArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoNullableNonNullIntMapChannel.setMessageHandler(nil) + } + /// Returns the passed map, to test serialization and deserialization. + let echoNullableNonNullEnumMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableNonNullEnumMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoNullableNonNullEnumMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let enumMapArg: [AnEnum: AnEnum]? = args[0] as? [AnEnum: AnEnum] + do { + let result = try api.echoNullableNonNull(enumMap: enumMapArg!) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoNullableNonNullEnumMapChannel.setMessageHandler(nil) + } + /// Returns the passed map, to test serialization and deserialization. + let echoNullableNonNullClassMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableNonNullClassMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoNullableNonNullClassMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let classMapArg: [Int64: AllNullableTypes]? = nilOrValue(args[0]) + do { + let result = try api.echoNullableNonNull(classMap: classMapArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoNullableNonNullClassMapChannel.setMessageHandler(nil) + } let echoNullableEnumChannel = FlutterBasicMessageChannel( name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableEnum\(channelSuffix)", @@ -1474,9 +2217,7 @@ class HostIntegrationCoreApiSetup { if let api = api { echoOptionalNullableIntChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let aNullableIntArg: Int64? = - isNullish(args[0]) - ? nil : (args[0] is Int64? ? args[0] as! Int64? : Int64(args[0] as! Int32)) + let aNullableIntArg: Int64? = nilOrValue(args[0]) do { let result = try api.echoOptional(aNullableIntArg) reply(wrapResult(result)) @@ -1534,7 +2275,7 @@ class HostIntegrationCoreApiSetup { if let api = api { echoAsyncIntChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let anIntArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) + let anIntArg = args[0] as! Int64 api.echoAsync(anIntArg) { result in switch result { case .success(let res): @@ -1673,6 +2414,48 @@ class HostIntegrationCoreApiSetup { } else { echoAsyncListChannel.setMessageHandler(nil) } + /// Returns the passed list, to test asynchronous serialization and deserialization. + let echoAsyncEnumListChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncEnumList\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoAsyncEnumListChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let enumListArg = args[0] as! [AnEnum?] + api.echoAsync(enumList: enumListArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + echoAsyncEnumListChannel.setMessageHandler(nil) + } + /// Returns the passed list, to test asynchronous serialization and deserialization. + let echoAsyncClassListChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncClassList\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoAsyncClassListChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let classListArg = args[0] as! [AllNullableTypes?] + api.echoAsync(classList: classListArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + echoAsyncClassListChannel.setMessageHandler(nil) + } /// Returns the passed map, to test asynchronous serialization and deserialization. let echoAsyncMapChannel = FlutterBasicMessageChannel( name: @@ -1681,8 +2464,8 @@ class HostIntegrationCoreApiSetup { if let api = api { echoAsyncMapChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let aMapArg = args[0] as! [String?: Any?] - api.echoAsync(aMapArg) { result in + let mapArg = args[0] as! [AnyHashable?: Any?] + api.echoAsync(mapArg) { result in switch result { case .success(let res): reply(wrapResult(res)) @@ -1694,6 +2477,90 @@ class HostIntegrationCoreApiSetup { } else { echoAsyncMapChannel.setMessageHandler(nil) } + /// Returns the passed map, to test asynchronous serialization and deserialization. + let echoAsyncStringMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncStringMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoAsyncStringMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let stringMapArg = args[0] as! [String?: String?] + api.echoAsync(stringMap: stringMapArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + echoAsyncStringMapChannel.setMessageHandler(nil) + } + /// Returns the passed map, to test asynchronous serialization and deserialization. + let echoAsyncIntMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncIntMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoAsyncIntMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let intMapArg = args[0] as! [Int64?: Int64?] + api.echoAsync(intMap: intMapArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + echoAsyncIntMapChannel.setMessageHandler(nil) + } + /// Returns the passed map, to test asynchronous serialization and deserialization. + let echoAsyncEnumMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncEnumMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoAsyncEnumMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let enumMapArg = args[0] as? [AnEnum?: AnEnum?] + api.echoAsync(enumMap: enumMapArg!) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + echoAsyncEnumMapChannel.setMessageHandler(nil) + } + /// Returns the passed map, to test asynchronous serialization and deserialization. + let echoAsyncClassMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncClassMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoAsyncClassMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let classMapArg = args[0] as! [Int64?: AllNullableTypes?] + api.echoAsync(classMap: classMapArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + echoAsyncClassMapChannel.setMessageHandler(nil) + } /// Returns the passed enum, to test asynchronous serialization and deserialization. let echoAsyncEnumChannel = FlutterBasicMessageChannel( name: @@ -1864,9 +2731,7 @@ class HostIntegrationCoreApiSetup { if let api = api { echoAsyncNullableIntChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let anIntArg: Int64? = - isNullish(args[0]) - ? nil : (args[0] is Int64? ? args[0] as! Int64? : Int64(args[0] as! Int32)) + let anIntArg: Int64? = nilOrValue(args[0]) api.echoAsyncNullable(anIntArg) { result in switch result { case .success(let res): @@ -2005,16 +2870,16 @@ class HostIntegrationCoreApiSetup { } else { echoAsyncNullableListChannel.setMessageHandler(nil) } - /// Returns the passed map, to test asynchronous serialization and deserialization. - let echoAsyncNullableMapChannel = FlutterBasicMessageChannel( + /// Returns the passed list, to test asynchronous serialization and deserialization. + let echoAsyncNullableEnumListChannel = FlutterBasicMessageChannel( name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableMap\(channelSuffix)", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableEnumList\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { - echoAsyncNullableMapChannel.setMessageHandler { message, reply in + echoAsyncNullableEnumListChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let aMapArg: [String?: Any?]? = nilOrValue(args[0]) - api.echoAsyncNullable(aMapArg) { result in + let enumListArg: [AnEnum?]? = nilOrValue(args[0]) + api.echoAsyncNullable(enumList: enumListArg) { result in switch result { case .success(let res): reply(wrapResult(res)) @@ -2024,10 +2889,136 @@ class HostIntegrationCoreApiSetup { } } } else { - echoAsyncNullableMapChannel.setMessageHandler(nil) + echoAsyncNullableEnumListChannel.setMessageHandler(nil) } - /// Returns the passed enum, to test asynchronous serialization and deserialization. - let echoAsyncNullableEnumChannel = FlutterBasicMessageChannel( + /// Returns the passed list, to test asynchronous serialization and deserialization. + let echoAsyncNullableClassListChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableClassList\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoAsyncNullableClassListChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let classListArg: [AllNullableTypes?]? = nilOrValue(args[0]) + api.echoAsyncNullable(classList: classListArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + echoAsyncNullableClassListChannel.setMessageHandler(nil) + } + /// Returns the passed map, to test asynchronous serialization and deserialization. + let echoAsyncNullableMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoAsyncNullableMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let mapArg: [AnyHashable?: Any?]? = nilOrValue(args[0]) + api.echoAsyncNullable(mapArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + echoAsyncNullableMapChannel.setMessageHandler(nil) + } + /// Returns the passed map, to test asynchronous serialization and deserialization. + let echoAsyncNullableStringMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableStringMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoAsyncNullableStringMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let stringMapArg: [String?: String?]? = nilOrValue(args[0]) + api.echoAsyncNullable(stringMap: stringMapArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + echoAsyncNullableStringMapChannel.setMessageHandler(nil) + } + /// Returns the passed map, to test asynchronous serialization and deserialization. + let echoAsyncNullableIntMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableIntMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoAsyncNullableIntMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let intMapArg: [Int64?: Int64?]? = nilOrValue(args[0]) + api.echoAsyncNullable(intMap: intMapArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + echoAsyncNullableIntMapChannel.setMessageHandler(nil) + } + /// Returns the passed map, to test asynchronous serialization and deserialization. + let echoAsyncNullableEnumMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableEnumMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoAsyncNullableEnumMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let enumMapArg: [AnEnum?: AnEnum?]? = args[0] as? [AnEnum?: AnEnum?] + api.echoAsyncNullable(enumMap: enumMapArg!) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + echoAsyncNullableEnumMapChannel.setMessageHandler(nil) + } + /// Returns the passed map, to test asynchronous serialization and deserialization. + let echoAsyncNullableClassMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableClassMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoAsyncNullableClassMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let classMapArg: [Int64?: AllNullableTypes?]? = nilOrValue(args[0]) + api.echoAsyncNullable(classMap: classMapArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + echoAsyncNullableClassMapChannel.setMessageHandler(nil) + } + /// Returns the passed enum, to test asynchronous serialization and deserialization. + let echoAsyncNullableEnumChannel = FlutterBasicMessageChannel( name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableEnum\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) @@ -2170,9 +3161,7 @@ class HostIntegrationCoreApiSetup { callFlutterSendMultipleNullableTypesChannel.setMessageHandler { message, reply in let args = message as! [Any?] let aNullableBoolArg: Bool? = nilOrValue(args[0]) - let aNullableIntArg: Int64? = - isNullish(args[1]) - ? nil : (args[1] is Int64? ? args[1] as! Int64? : Int64(args[1] as! Int32)) + let aNullableIntArg: Int64? = nilOrValue(args[1]) let aNullableStringArg: String? = nilOrValue(args[2]) api.callFlutterSendMultipleNullableTypes( aBool: aNullableBoolArg, anInt: aNullableIntArg, aString: aNullableStringArg @@ -2217,9 +3206,7 @@ class HostIntegrationCoreApiSetup { message, reply in let args = message as! [Any?] let aNullableBoolArg: Bool? = nilOrValue(args[0]) - let aNullableIntArg: Int64? = - isNullish(args[1]) - ? nil : (args[1] is Int64? ? args[1] as! Int64? : Int64(args[1] as! Int32)) + let aNullableIntArg: Int64? = nilOrValue(args[1]) let aNullableStringArg: String? = nilOrValue(args[2]) api.callFlutterSendMultipleNullableTypesWithoutRecursion( aBool: aNullableBoolArg, anInt: aNullableIntArg, aString: aNullableStringArg @@ -2262,7 +3249,7 @@ class HostIntegrationCoreApiSetup { if let api = api { callFlutterEchoIntChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let anIntArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) + let anIntArg = args[0] as! Int64 api.callFlutterEcho(anIntArg) { result in switch result { case .success(let res): @@ -2355,6 +3342,86 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoListChannel.setMessageHandler(nil) } + let callFlutterEchoEnumListChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoEnumList\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoEnumListChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let enumListArg = args[0] as! [AnEnum?] + api.callFlutterEcho(enumList: enumListArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoEnumListChannel.setMessageHandler(nil) + } + let callFlutterEchoClassListChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoClassList\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoClassListChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let classListArg = args[0] as! [AllNullableTypes?] + api.callFlutterEcho(classList: classListArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoClassListChannel.setMessageHandler(nil) + } + let callFlutterEchoNonNullEnumListChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNonNullEnumList\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoNonNullEnumListChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let enumListArg = args[0] as! [AnEnum] + api.callFlutterEchoNonNull(enumList: enumListArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoNonNullEnumListChannel.setMessageHandler(nil) + } + let callFlutterEchoNonNullClassListChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNonNullClassList\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoNonNullClassListChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let classListArg = args[0] as! [AllNullableTypes] + api.callFlutterEchoNonNull(classList: classListArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoNonNullClassListChannel.setMessageHandler(nil) + } let callFlutterEchoMapChannel = FlutterBasicMessageChannel( name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoMap\(channelSuffix)", @@ -2362,8 +3429,8 @@ class HostIntegrationCoreApiSetup { if let api = api { callFlutterEchoMapChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let aMapArg = args[0] as! [String?: Any?] - api.callFlutterEcho(aMapArg) { result in + let mapArg = args[0] as! [AnyHashable?: Any?] + api.callFlutterEcho(mapArg) { result in switch result { case .success(let res): reply(wrapResult(res)) @@ -2375,15 +3442,15 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoMapChannel.setMessageHandler(nil) } - let callFlutterEchoEnumChannel = FlutterBasicMessageChannel( + let callFlutterEchoStringMapChannel = FlutterBasicMessageChannel( name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoEnum\(channelSuffix)", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoStringMap\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { - callFlutterEchoEnumChannel.setMessageHandler { message, reply in + callFlutterEchoStringMapChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let anEnumArg = args[0] as! AnEnum - api.callFlutterEcho(anEnumArg) { result in + let stringMapArg = args[0] as! [String?: String?] + api.callFlutterEcho(stringMap: stringMapArg) { result in switch result { case .success(let res): reply(wrapResult(res)) @@ -2393,17 +3460,17 @@ class HostIntegrationCoreApiSetup { } } } else { - callFlutterEchoEnumChannel.setMessageHandler(nil) + callFlutterEchoStringMapChannel.setMessageHandler(nil) } - let callFlutterEchoAnotherEnumChannel = FlutterBasicMessageChannel( + let callFlutterEchoIntMapChannel = FlutterBasicMessageChannel( name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAnotherEnum\(channelSuffix)", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoIntMap\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { - callFlutterEchoAnotherEnumChannel.setMessageHandler { message, reply in + callFlutterEchoIntMapChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let anotherEnumArg = args[0] as! AnotherEnum - api.callFlutterEcho(anotherEnumArg) { result in + let intMapArg = args[0] as! [Int64?: Int64?] + api.callFlutterEcho(intMap: intMapArg) { result in switch result { case .success(let res): reply(wrapResult(res)) @@ -2413,17 +3480,17 @@ class HostIntegrationCoreApiSetup { } } } else { - callFlutterEchoAnotherEnumChannel.setMessageHandler(nil) + callFlutterEchoIntMapChannel.setMessageHandler(nil) } - let callFlutterEchoNullableBoolChannel = FlutterBasicMessageChannel( + let callFlutterEchoEnumMapChannel = FlutterBasicMessageChannel( name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableBool\(channelSuffix)", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoEnumMap\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { - callFlutterEchoNullableBoolChannel.setMessageHandler { message, reply in + callFlutterEchoEnumMapChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let aBoolArg: Bool? = nilOrValue(args[0]) - api.callFlutterEchoNullable(aBoolArg) { result in + let enumMapArg = args[0] as? [AnEnum?: AnEnum?] + api.callFlutterEcho(enumMap: enumMapArg!) { result in switch result { case .success(let res): reply(wrapResult(res)) @@ -2433,19 +3500,17 @@ class HostIntegrationCoreApiSetup { } } } else { - callFlutterEchoNullableBoolChannel.setMessageHandler(nil) + callFlutterEchoEnumMapChannel.setMessageHandler(nil) } - let callFlutterEchoNullableIntChannel = FlutterBasicMessageChannel( + let callFlutterEchoClassMapChannel = FlutterBasicMessageChannel( name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableInt\(channelSuffix)", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoClassMap\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { - callFlutterEchoNullableIntChannel.setMessageHandler { message, reply in + callFlutterEchoClassMapChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let anIntArg: Int64? = - isNullish(args[0]) - ? nil : (args[0] is Int64? ? args[0] as! Int64? : Int64(args[0] as! Int32)) - api.callFlutterEchoNullable(anIntArg) { result in + let classMapArg = args[0] as! [Int64?: AllNullableTypes?] + api.callFlutterEcho(classMap: classMapArg) { result in switch result { case .success(let res): reply(wrapResult(res)) @@ -2455,17 +3520,17 @@ class HostIntegrationCoreApiSetup { } } } else { - callFlutterEchoNullableIntChannel.setMessageHandler(nil) + callFlutterEchoClassMapChannel.setMessageHandler(nil) } - let callFlutterEchoNullableDoubleChannel = FlutterBasicMessageChannel( + let callFlutterEchoNonNullStringMapChannel = FlutterBasicMessageChannel( name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableDouble\(channelSuffix)", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNonNullStringMap\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { - callFlutterEchoNullableDoubleChannel.setMessageHandler { message, reply in + callFlutterEchoNonNullStringMapChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let aDoubleArg: Double? = nilOrValue(args[0]) - api.callFlutterEchoNullable(aDoubleArg) { result in + let stringMapArg = args[0] as! [String: String] + api.callFlutterEchoNonNull(stringMap: stringMapArg) { result in switch result { case .success(let res): reply(wrapResult(res)) @@ -2475,17 +3540,17 @@ class HostIntegrationCoreApiSetup { } } } else { - callFlutterEchoNullableDoubleChannel.setMessageHandler(nil) + callFlutterEchoNonNullStringMapChannel.setMessageHandler(nil) } - let callFlutterEchoNullableStringChannel = FlutterBasicMessageChannel( + let callFlutterEchoNonNullIntMapChannel = FlutterBasicMessageChannel( name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableString\(channelSuffix)", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNonNullIntMap\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { - callFlutterEchoNullableStringChannel.setMessageHandler { message, reply in + callFlutterEchoNonNullIntMapChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let aStringArg: String? = nilOrValue(args[0]) - api.callFlutterEchoNullable(aStringArg) { result in + let intMapArg = args[0] as! [Int64: Int64] + api.callFlutterEchoNonNull(intMap: intMapArg) { result in switch result { case .success(let res): reply(wrapResult(res)) @@ -2495,17 +3560,17 @@ class HostIntegrationCoreApiSetup { } } } else { - callFlutterEchoNullableStringChannel.setMessageHandler(nil) + callFlutterEchoNonNullIntMapChannel.setMessageHandler(nil) } - let callFlutterEchoNullableUint8ListChannel = FlutterBasicMessageChannel( + let callFlutterEchoNonNullEnumMapChannel = FlutterBasicMessageChannel( name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableUint8List\(channelSuffix)", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNonNullEnumMap\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { - callFlutterEchoNullableUint8ListChannel.setMessageHandler { message, reply in + callFlutterEchoNonNullEnumMapChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let listArg: FlutterStandardTypedData? = nilOrValue(args[0]) - api.callFlutterEchoNullable(listArg) { result in + let enumMapArg = args[0] as? [AnEnum: AnEnum] + api.callFlutterEchoNonNull(enumMap: enumMapArg!) { result in switch result { case .success(let res): reply(wrapResult(res)) @@ -2515,17 +3580,17 @@ class HostIntegrationCoreApiSetup { } } } else { - callFlutterEchoNullableUint8ListChannel.setMessageHandler(nil) + callFlutterEchoNonNullEnumMapChannel.setMessageHandler(nil) } - let callFlutterEchoNullableListChannel = FlutterBasicMessageChannel( + let callFlutterEchoNonNullClassMapChannel = FlutterBasicMessageChannel( name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableList\(channelSuffix)", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNonNullClassMap\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { - callFlutterEchoNullableListChannel.setMessageHandler { message, reply in + callFlutterEchoNonNullClassMapChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let listArg: [Any?]? = nilOrValue(args[0]) - api.callFlutterEchoNullable(listArg) { result in + let classMapArg = args[0] as! [Int64: AllNullableTypes] + api.callFlutterEchoNonNull(classMap: classMapArg) { result in switch result { case .success(let res): reply(wrapResult(res)) @@ -2535,17 +3600,17 @@ class HostIntegrationCoreApiSetup { } } } else { - callFlutterEchoNullableListChannel.setMessageHandler(nil) + callFlutterEchoNonNullClassMapChannel.setMessageHandler(nil) } - let callFlutterEchoNullableMapChannel = FlutterBasicMessageChannel( + let callFlutterEchoEnumChannel = FlutterBasicMessageChannel( name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableMap\(channelSuffix)", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoEnum\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { - callFlutterEchoNullableMapChannel.setMessageHandler { message, reply in + callFlutterEchoEnumChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let aMapArg: [String?: Any?]? = nilOrValue(args[0]) - api.callFlutterEchoNullable(aMapArg) { result in + let anEnumArg = args[0] as! AnEnum + api.callFlutterEcho(anEnumArg) { result in switch result { case .success(let res): reply(wrapResult(res)) @@ -2555,17 +3620,17 @@ class HostIntegrationCoreApiSetup { } } } else { - callFlutterEchoNullableMapChannel.setMessageHandler(nil) + callFlutterEchoEnumChannel.setMessageHandler(nil) } - let callFlutterEchoNullableEnumChannel = FlutterBasicMessageChannel( + let callFlutterEchoAnotherEnumChannel = FlutterBasicMessageChannel( name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableEnum\(channelSuffix)", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAnotherEnum\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { - callFlutterEchoNullableEnumChannel.setMessageHandler { message, reply in + callFlutterEchoAnotherEnumChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let anEnumArg: AnEnum? = nilOrValue(args[0]) - api.callFlutterEchoNullable(anEnumArg) { result in + let anotherEnumArg = args[0] as! AnotherEnum + api.callFlutterEcho(anotherEnumArg) { result in switch result { case .success(let res): reply(wrapResult(res)) @@ -2575,17 +3640,17 @@ class HostIntegrationCoreApiSetup { } } } else { - callFlutterEchoNullableEnumChannel.setMessageHandler(nil) + callFlutterEchoAnotherEnumChannel.setMessageHandler(nil) } - let callFlutterEchoAnotherNullableEnumChannel = FlutterBasicMessageChannel( + let callFlutterEchoNullableBoolChannel = FlutterBasicMessageChannel( name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAnotherNullableEnum\(channelSuffix)", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableBool\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { - callFlutterEchoAnotherNullableEnumChannel.setMessageHandler { message, reply in + callFlutterEchoNullableBoolChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let anotherEnumArg: AnotherEnum? = nilOrValue(args[0]) - api.callFlutterEchoNullable(anotherEnumArg) { result in + let aBoolArg: Bool? = nilOrValue(args[0]) + api.callFlutterEchoNullable(aBoolArg) { result in switch result { case .success(let res): reply(wrapResult(res)) @@ -2595,17 +3660,17 @@ class HostIntegrationCoreApiSetup { } } } else { - callFlutterEchoAnotherNullableEnumChannel.setMessageHandler(nil) + callFlutterEchoNullableBoolChannel.setMessageHandler(nil) } - let callFlutterSmallApiEchoStringChannel = FlutterBasicMessageChannel( + let callFlutterEchoNullableIntChannel = FlutterBasicMessageChannel( name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSmallApiEchoString\(channelSuffix)", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableInt\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { - callFlutterSmallApiEchoStringChannel.setMessageHandler { message, reply in + callFlutterEchoNullableIntChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let aStringArg = args[0] as! String - api.callFlutterSmallApiEcho(aStringArg) { result in + let anIntArg: Int64? = nilOrValue(args[0]) + api.callFlutterEchoNullable(anIntArg) { result in switch result { case .success(let res): reply(wrapResult(res)) @@ -2615,122 +3680,1156 @@ class HostIntegrationCoreApiSetup { } } } else { - callFlutterSmallApiEchoStringChannel.setMessageHandler(nil) + callFlutterEchoNullableIntChannel.setMessageHandler(nil) } - } -} -/// The core interface that the Dart platform_test code implements for host -/// integration tests to call into. -/// -/// Generated protocol from Pigeon that represents Flutter messages that can be called from Swift. -protocol FlutterIntegrationCoreApiProtocol { - /// A no-op function taking no arguments and returning no value, to sanity - /// test basic calling. - func noop(completion: @escaping (Result) -> Void) - /// Responds with an error from an async function returning a value. - func throwError(completion: @escaping (Result) -> Void) - /// Responds with an error from an async void function. + let callFlutterEchoNullableDoubleChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableDouble\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoNullableDoubleChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let aDoubleArg: Double? = nilOrValue(args[0]) + api.callFlutterEchoNullable(aDoubleArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoNullableDoubleChannel.setMessageHandler(nil) + } + let callFlutterEchoNullableStringChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableString\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoNullableStringChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let aStringArg: String? = nilOrValue(args[0]) + api.callFlutterEchoNullable(aStringArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoNullableStringChannel.setMessageHandler(nil) + } + let callFlutterEchoNullableUint8ListChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableUint8List\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoNullableUint8ListChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let listArg: FlutterStandardTypedData? = nilOrValue(args[0]) + api.callFlutterEchoNullable(listArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoNullableUint8ListChannel.setMessageHandler(nil) + } + let callFlutterEchoNullableListChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableList\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoNullableListChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let listArg: [Any?]? = nilOrValue(args[0]) + api.callFlutterEchoNullable(listArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoNullableListChannel.setMessageHandler(nil) + } + let callFlutterEchoNullableEnumListChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableEnumList\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoNullableEnumListChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let enumListArg: [AnEnum?]? = nilOrValue(args[0]) + api.callFlutterEchoNullable(enumList: enumListArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoNullableEnumListChannel.setMessageHandler(nil) + } + let callFlutterEchoNullableClassListChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableClassList\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoNullableClassListChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let classListArg: [AllNullableTypes?]? = nilOrValue(args[0]) + api.callFlutterEchoNullable(classList: classListArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoNullableClassListChannel.setMessageHandler(nil) + } + let callFlutterEchoNullableNonNullEnumListChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableNonNullEnumList\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoNullableNonNullEnumListChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let enumListArg: [AnEnum]? = nilOrValue(args[0]) + api.callFlutterEchoNullableNonNull(enumList: enumListArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoNullableNonNullEnumListChannel.setMessageHandler(nil) + } + let callFlutterEchoNullableNonNullClassListChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableNonNullClassList\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoNullableNonNullClassListChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let classListArg: [AllNullableTypes]? = nilOrValue(args[0]) + api.callFlutterEchoNullableNonNull(classList: classListArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoNullableNonNullClassListChannel.setMessageHandler(nil) + } + let callFlutterEchoNullableMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoNullableMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let mapArg: [AnyHashable?: Any?]? = nilOrValue(args[0]) + api.callFlutterEchoNullable(mapArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoNullableMapChannel.setMessageHandler(nil) + } + let callFlutterEchoNullableStringMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableStringMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoNullableStringMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let stringMapArg: [String?: String?]? = nilOrValue(args[0]) + api.callFlutterEchoNullable(stringMap: stringMapArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoNullableStringMapChannel.setMessageHandler(nil) + } + let callFlutterEchoNullableIntMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableIntMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoNullableIntMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let intMapArg: [Int64?: Int64?]? = nilOrValue(args[0]) + api.callFlutterEchoNullable(intMap: intMapArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoNullableIntMapChannel.setMessageHandler(nil) + } + let callFlutterEchoNullableEnumMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableEnumMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoNullableEnumMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let enumMapArg: [AnEnum?: AnEnum?]? = args[0] as? [AnEnum?: AnEnum?] + api.callFlutterEchoNullable(enumMap: enumMapArg!) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoNullableEnumMapChannel.setMessageHandler(nil) + } + let callFlutterEchoNullableClassMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableClassMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoNullableClassMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let classMapArg: [Int64?: AllNullableTypes?]? = nilOrValue(args[0]) + api.callFlutterEchoNullable(classMap: classMapArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoNullableClassMapChannel.setMessageHandler(nil) + } + let callFlutterEchoNullableNonNullStringMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableNonNullStringMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoNullableNonNullStringMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let stringMapArg: [String: String]? = nilOrValue(args[0]) + api.callFlutterEchoNullableNonNull(stringMap: stringMapArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoNullableNonNullStringMapChannel.setMessageHandler(nil) + } + let callFlutterEchoNullableNonNullIntMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableNonNullIntMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoNullableNonNullIntMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let intMapArg: [Int64: Int64]? = nilOrValue(args[0]) + api.callFlutterEchoNullableNonNull(intMap: intMapArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoNullableNonNullIntMapChannel.setMessageHandler(nil) + } + let callFlutterEchoNullableNonNullEnumMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableNonNullEnumMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoNullableNonNullEnumMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let enumMapArg: [AnEnum: AnEnum]? = args[0] as? [AnEnum: AnEnum] + api.callFlutterEchoNullableNonNull(enumMap: enumMapArg!) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoNullableNonNullEnumMapChannel.setMessageHandler(nil) + } + let callFlutterEchoNullableNonNullClassMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableNonNullClassMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoNullableNonNullClassMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let classMapArg: [Int64: AllNullableTypes]? = nilOrValue(args[0]) + api.callFlutterEchoNullableNonNull(classMap: classMapArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoNullableNonNullClassMapChannel.setMessageHandler(nil) + } + let callFlutterEchoNullableEnumChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableEnum\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoNullableEnumChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let anEnumArg: AnEnum? = nilOrValue(args[0]) + api.callFlutterEchoNullable(anEnumArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoNullableEnumChannel.setMessageHandler(nil) + } + let callFlutterEchoAnotherNullableEnumChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAnotherNullableEnum\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoAnotherNullableEnumChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let anotherEnumArg: AnotherEnum? = nilOrValue(args[0]) + api.callFlutterEchoNullable(anotherEnumArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoAnotherNullableEnumChannel.setMessageHandler(nil) + } + let callFlutterSmallApiEchoStringChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSmallApiEchoString\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterSmallApiEchoStringChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let aStringArg = args[0] as! String + api.callFlutterSmallApiEcho(aStringArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterSmallApiEchoStringChannel.setMessageHandler(nil) + } + } +} +/// The core interface that the Dart platform_test code implements for host +/// integration tests to call into. +/// +/// Generated protocol from Pigeon that represents Flutter messages that can be called from Swift. +protocol FlutterIntegrationCoreApiProtocol { + /// A no-op function taking no arguments and returning no value, to sanity + /// test basic calling. + func noop(completion: @escaping (Result) -> Void) + /// Responds with an error from an async function returning a value. + func throwError(completion: @escaping (Result) -> Void) + /// Responds with an error from an async void function. func throwErrorFromVoid(completion: @escaping (Result) -> Void) /// Returns the passed object, to test serialization and deserialization. func echo( - _ everythingArg: AllTypes, completion: @escaping (Result) -> Void) + _ everythingArg: AllTypes, completion: @escaping (Result) -> Void) + /// Returns the passed object, to test serialization and deserialization. + func echoNullable( + _ everythingArg: AllNullableTypes?, + completion: @escaping (Result) -> Void) + /// Returns passed in arguments of multiple types. + /// + /// Tests multiple-arity FlutterApi handling. + func sendMultipleNullableTypes( + aBool aNullableBoolArg: Bool?, anInt aNullableIntArg: Int64?, + aString aNullableStringArg: String?, + completion: @escaping (Result) -> Void) + /// Returns the passed object, to test serialization and deserialization. + func echoNullable( + _ everythingArg: AllNullableTypesWithoutRecursion?, + completion: @escaping (Result) -> Void) + /// Returns passed in arguments of multiple types. + /// + /// Tests multiple-arity FlutterApi handling. + func sendMultipleNullableTypesWithoutRecursion( + aBool aNullableBoolArg: Bool?, anInt aNullableIntArg: Int64?, + aString aNullableStringArg: String?, + completion: @escaping (Result) -> Void) + /// Returns the passed boolean, to test serialization and deserialization. + func echo(_ aBoolArg: Bool, completion: @escaping (Result) -> Void) + /// Returns the passed int, to test serialization and deserialization. + func echo(_ anIntArg: Int64, completion: @escaping (Result) -> Void) + /// Returns the passed double, to test serialization and deserialization. + func echo(_ aDoubleArg: Double, completion: @escaping (Result) -> Void) + /// Returns the passed string, to test serialization and deserialization. + func echo(_ aStringArg: String, completion: @escaping (Result) -> Void) + /// Returns the passed byte list, to test serialization and deserialization. + func echo( + _ listArg: FlutterStandardTypedData, + completion: @escaping (Result) -> Void) + /// Returns the passed list, to test serialization and deserialization. + func echo(_ listArg: [Any?], completion: @escaping (Result<[Any?], PigeonError>) -> Void) + /// Returns the passed list, to test serialization and deserialization. + func echo( + enumList enumListArg: [AnEnum?], completion: @escaping (Result<[AnEnum?], PigeonError>) -> Void) + /// Returns the passed list, to test serialization and deserialization. + func echo( + classList classListArg: [AllNullableTypes?], + completion: @escaping (Result<[AllNullableTypes?], PigeonError>) -> Void) + /// Returns the passed list, to test serialization and deserialization. + func echoNonNull( + enumList enumListArg: [AnEnum], completion: @escaping (Result<[AnEnum], PigeonError>) -> Void) + /// Returns the passed list, to test serialization and deserialization. + func echoNonNull( + classList classListArg: [AllNullableTypes], + completion: @escaping (Result<[AllNullableTypes], PigeonError>) -> Void) + /// Returns the passed map, to test serialization and deserialization. + func echo( + _ mapArg: [AnyHashable?: Any?], + completion: @escaping (Result<[AnyHashable?: Any?], PigeonError>) -> Void) + /// Returns the passed map, to test serialization and deserialization. + func echo( + stringMap stringMapArg: [String?: String?], + completion: @escaping (Result<[String?: String?], PigeonError>) -> Void) + /// Returns the passed map, to test serialization and deserialization. + func echo( + intMap intMapArg: [Int64?: Int64?], + completion: @escaping (Result<[Int64?: Int64?], PigeonError>) -> Void) + /// Returns the passed map, to test serialization and deserialization. + func echo( + enumMap enumMapArg: [AnEnum?: AnEnum?], + completion: @escaping (Result<[AnEnum?: AnEnum?], PigeonError>) -> Void) + /// Returns the passed map, to test serialization and deserialization. + func echo( + classMap classMapArg: [Int64?: AllNullableTypes?], + completion: @escaping (Result<[Int64?: AllNullableTypes?], PigeonError>) -> Void) + /// Returns the passed map, to test serialization and deserialization. + func echoNonNull( + stringMap stringMapArg: [String: String], + completion: @escaping (Result<[String: String], PigeonError>) -> Void) + /// Returns the passed map, to test serialization and deserialization. + func echoNonNull( + intMap intMapArg: [Int64: Int64], + completion: @escaping (Result<[Int64: Int64], PigeonError>) -> Void) + /// Returns the passed map, to test serialization and deserialization. + func echoNonNull( + enumMap enumMapArg: [AnEnum: AnEnum], + completion: @escaping (Result<[AnEnum: AnEnum], PigeonError>) -> Void) + /// Returns the passed map, to test serialization and deserialization. + func echoNonNull( + classMap classMapArg: [Int64: AllNullableTypes], + completion: @escaping (Result<[Int64: AllNullableTypes], PigeonError>) -> Void) + /// Returns the passed enum to test serialization and deserialization. + func echo(_ anEnumArg: AnEnum, completion: @escaping (Result) -> Void) + /// Returns the passed enum to test serialization and deserialization. + func echo( + _ anotherEnumArg: AnotherEnum, completion: @escaping (Result) -> Void) + /// Returns the passed boolean, to test serialization and deserialization. + func echoNullable(_ aBoolArg: Bool?, completion: @escaping (Result) -> Void) + /// Returns the passed int, to test serialization and deserialization. + func echoNullable(_ anIntArg: Int64?, completion: @escaping (Result) -> Void) + /// Returns the passed double, to test serialization and deserialization. + func echoNullable( + _ aDoubleArg: Double?, completion: @escaping (Result) -> Void) + /// Returns the passed string, to test serialization and deserialization. + func echoNullable( + _ aStringArg: String?, completion: @escaping (Result) -> Void) + /// Returns the passed byte list, to test serialization and deserialization. + func echoNullable( + _ listArg: FlutterStandardTypedData?, + completion: @escaping (Result) -> Void) + /// Returns the passed list, to test serialization and deserialization. + func echoNullable( + _ listArg: [Any?]?, completion: @escaping (Result<[Any?]?, PigeonError>) -> Void) + /// Returns the passed list, to test serialization and deserialization. + func echoNullable( + enumList enumListArg: [AnEnum?]?, + completion: @escaping (Result<[AnEnum?]?, PigeonError>) -> Void) + /// Returns the passed list, to test serialization and deserialization. + func echoNullable( + classList classListArg: [AllNullableTypes?]?, + completion: @escaping (Result<[AllNullableTypes?]?, PigeonError>) -> Void) + /// Returns the passed list, to test serialization and deserialization. + func echoNullableNonNull( + enumList enumListArg: [AnEnum]?, completion: @escaping (Result<[AnEnum]?, PigeonError>) -> Void) + /// Returns the passed list, to test serialization and deserialization. + func echoNullableNonNull( + classList classListArg: [AllNullableTypes]?, + completion: @escaping (Result<[AllNullableTypes]?, PigeonError>) -> Void) + /// Returns the passed map, to test serialization and deserialization. + func echoNullable( + _ mapArg: [AnyHashable?: Any?]?, + completion: @escaping (Result<[AnyHashable?: Any?]?, PigeonError>) -> Void) + /// Returns the passed map, to test serialization and deserialization. + func echoNullable( + stringMap stringMapArg: [String?: String?]?, + completion: @escaping (Result<[String?: String?]?, PigeonError>) -> Void) + /// Returns the passed map, to test serialization and deserialization. + func echoNullable( + intMap intMapArg: [Int64?: Int64?]?, + completion: @escaping (Result<[Int64?: Int64?]?, PigeonError>) -> Void) + /// Returns the passed map, to test serialization and deserialization. + func echoNullable( + enumMap enumMapArg: [AnEnum?: AnEnum?]?, + completion: @escaping (Result<[AnEnum?: AnEnum?]?, PigeonError>) -> Void) + /// Returns the passed map, to test serialization and deserialization. + func echoNullable( + classMap classMapArg: [Int64?: AllNullableTypes?]?, + completion: @escaping (Result<[Int64?: AllNullableTypes?]?, PigeonError>) -> Void) + /// Returns the passed map, to test serialization and deserialization. + func echoNullableNonNull( + stringMap stringMapArg: [String: String]?, + completion: @escaping (Result<[String: String]?, PigeonError>) -> Void) + /// Returns the passed map, to test serialization and deserialization. + func echoNullableNonNull( + intMap intMapArg: [Int64: Int64]?, + completion: @escaping (Result<[Int64: Int64]?, PigeonError>) -> Void) + /// Returns the passed map, to test serialization and deserialization. + func echoNullableNonNull( + enumMap enumMapArg: [AnEnum: AnEnum]?, + completion: @escaping (Result<[AnEnum: AnEnum]?, PigeonError>) -> Void) + /// Returns the passed map, to test serialization and deserialization. + func echoNullableNonNull( + classMap classMapArg: [Int64: AllNullableTypes]?, + completion: @escaping (Result<[Int64: AllNullableTypes]?, PigeonError>) -> Void) + /// Returns the passed enum to test serialization and deserialization. + func echoNullable( + _ anEnumArg: AnEnum?, completion: @escaping (Result) -> Void) + /// Returns the passed enum to test serialization and deserialization. + func echoNullable( + _ anotherEnumArg: AnotherEnum?, + completion: @escaping (Result) -> Void) + /// A no-op function taking no arguments and returning no value, to sanity + /// test basic asynchronous calling. + func noopAsync(completion: @escaping (Result) -> Void) + /// Returns the passed in generic Object asynchronously. + func echoAsync(_ aStringArg: String, completion: @escaping (Result) -> Void) +} +class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { + private let binaryMessenger: FlutterBinaryMessenger + private let messageChannelSuffix: String + init(binaryMessenger: FlutterBinaryMessenger, messageChannelSuffix: String = "") { + self.binaryMessenger = binaryMessenger + self.messageChannelSuffix = messageChannelSuffix.count > 0 ? ".\(messageChannelSuffix)" : "" + } + var codec: CoreTestsPigeonCodec { + return CoreTestsPigeonCodec.shared + } + /// A no-op function taking no arguments and returning no value, to sanity + /// test basic calling. + func noop(completion: @escaping (Result) -> Void) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noop\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage(nil) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(Void())) + } + } + } + /// Responds with an error from an async function returning a value. + func throwError(completion: @escaping (Result) -> Void) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwError\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage(nil) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + let result: Any? = listResponse[0] + completion(.success(result)) + } + } + } + /// Responds with an error from an async void function. + func throwErrorFromVoid(completion: @escaping (Result) -> Void) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwErrorFromVoid\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage(nil) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(Void())) + } + } + } + /// Returns the passed object, to test serialization and deserialization. + func echo( + _ everythingArg: AllTypes, completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllTypes\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([everythingArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else if listResponse[0] == nil { + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) + } else { + let result = listResponse[0] as! AllTypes + completion(.success(result)) + } + } + } /// Returns the passed object, to test serialization and deserialization. func echoNullable( _ everythingArg: AllNullableTypes?, - completion: @escaping (Result) -> Void) + completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypes\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([everythingArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + let result: AllNullableTypes? = nilOrValue(listResponse[0]) + completion(.success(result)) + } + } + } /// Returns passed in arguments of multiple types. /// /// Tests multiple-arity FlutterApi handling. func sendMultipleNullableTypes( aBool aNullableBoolArg: Bool?, anInt aNullableIntArg: Int64?, aString aNullableStringArg: String?, - completion: @escaping (Result) -> Void) + completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypes\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([aNullableBoolArg, aNullableIntArg, aNullableStringArg] as [Any?]) { + response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else if listResponse[0] == nil { + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) + } else { + let result = listResponse[0] as! AllNullableTypes + completion(.success(result)) + } + } + } /// Returns the passed object, to test serialization and deserialization. func echoNullable( _ everythingArg: AllNullableTypesWithoutRecursion?, - completion: @escaping (Result) -> Void) + completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypesWithoutRecursion\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([everythingArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + let result: AllNullableTypesWithoutRecursion? = nilOrValue(listResponse[0]) + completion(.success(result)) + } + } + } /// Returns passed in arguments of multiple types. /// /// Tests multiple-arity FlutterApi handling. func sendMultipleNullableTypesWithoutRecursion( aBool aNullableBoolArg: Bool?, anInt aNullableIntArg: Int64?, aString aNullableStringArg: String?, - completion: @escaping (Result) -> Void) + completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([aNullableBoolArg, aNullableIntArg, aNullableStringArg] as [Any?]) { + response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else if listResponse[0] == nil { + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) + } else { + let result = listResponse[0] as! AllNullableTypesWithoutRecursion + completion(.success(result)) + } + } + } /// Returns the passed boolean, to test serialization and deserialization. - func echo(_ aBoolArg: Bool, completion: @escaping (Result) -> Void) + func echo(_ aBoolArg: Bool, completion: @escaping (Result) -> Void) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoBool\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([aBoolArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else if listResponse[0] == nil { + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) + } else { + let result = listResponse[0] as! Bool + completion(.success(result)) + } + } + } /// Returns the passed int, to test serialization and deserialization. - func echo(_ anIntArg: Int64, completion: @escaping (Result) -> Void) + func echo(_ anIntArg: Int64, completion: @escaping (Result) -> Void) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoInt\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([anIntArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else if listResponse[0] == nil { + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) + } else { + let result = listResponse[0] as! Int64 + completion(.success(result)) + } + } + } /// Returns the passed double, to test serialization and deserialization. - func echo(_ aDoubleArg: Double, completion: @escaping (Result) -> Void) + func echo(_ aDoubleArg: Double, completion: @escaping (Result) -> Void) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoDouble\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([aDoubleArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else if listResponse[0] == nil { + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) + } else { + let result = listResponse[0] as! Double + completion(.success(result)) + } + } + } /// Returns the passed string, to test serialization and deserialization. - func echo(_ aStringArg: String, completion: @escaping (Result) -> Void) + func echo(_ aStringArg: String, completion: @escaping (Result) -> Void) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoString\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([aStringArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else if listResponse[0] == nil { + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) + } else { + let result = listResponse[0] as! String + completion(.success(result)) + } + } + } /// Returns the passed byte list, to test serialization and deserialization. func echo( _ listArg: FlutterStandardTypedData, - completion: @escaping (Result) -> Void) + completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoUint8List\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([listArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else if listResponse[0] == nil { + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) + } else { + let result = listResponse[0] as! FlutterStandardTypedData + completion(.success(result)) + } + } + } + /// Returns the passed list, to test serialization and deserialization. + func echo(_ listArg: [Any?], completion: @escaping (Result<[Any?], PigeonError>) -> Void) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoList\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([listArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else if listResponse[0] == nil { + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) + } else { + let result = listResponse[0] as! [Any?] + completion(.success(result)) + } + } + } + /// Returns the passed list, to test serialization and deserialization. + func echo( + enumList enumListArg: [AnEnum?], completion: @escaping (Result<[AnEnum?], PigeonError>) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnumList\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([enumListArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else if listResponse[0] == nil { + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) + } else { + let result = listResponse[0] as! [AnEnum?] + completion(.success(result)) + } + } + } + /// Returns the passed list, to test serialization and deserialization. + func echo( + classList classListArg: [AllNullableTypes?], + completion: @escaping (Result<[AllNullableTypes?], PigeonError>) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoClassList\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([classListArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else if listResponse[0] == nil { + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) + } else { + let result = listResponse[0] as! [AllNullableTypes?] + completion(.success(result)) + } + } + } /// Returns the passed list, to test serialization and deserialization. - func echo(_ listArg: [Any?], completion: @escaping (Result<[Any?], PigeonError>) -> Void) - /// Returns the passed map, to test serialization and deserialization. - func echo( - _ aMapArg: [String?: Any?], completion: @escaping (Result<[String?: Any?], PigeonError>) -> Void - ) - /// Returns the passed enum to test serialization and deserialization. - func echo(_ anEnumArg: AnEnum, completion: @escaping (Result) -> Void) - /// Returns the passed enum to test serialization and deserialization. - func echo( - _ anotherEnumArg: AnotherEnum, completion: @escaping (Result) -> Void) - /// Returns the passed boolean, to test serialization and deserialization. - func echoNullable(_ aBoolArg: Bool?, completion: @escaping (Result) -> Void) - /// Returns the passed int, to test serialization and deserialization. - func echoNullable(_ anIntArg: Int64?, completion: @escaping (Result) -> Void) - /// Returns the passed double, to test serialization and deserialization. - func echoNullable( - _ aDoubleArg: Double?, completion: @escaping (Result) -> Void) - /// Returns the passed string, to test serialization and deserialization. - func echoNullable( - _ aStringArg: String?, completion: @escaping (Result) -> Void) - /// Returns the passed byte list, to test serialization and deserialization. - func echoNullable( - _ listArg: FlutterStandardTypedData?, - completion: @escaping (Result) -> Void) + func echoNonNull( + enumList enumListArg: [AnEnum], completion: @escaping (Result<[AnEnum], PigeonError>) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNonNullEnumList\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([enumListArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else if listResponse[0] == nil { + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) + } else { + let result = listResponse[0] as! [AnEnum] + completion(.success(result)) + } + } + } /// Returns the passed list, to test serialization and deserialization. - func echoNullable( - _ listArg: [Any?]?, completion: @escaping (Result<[Any?]?, PigeonError>) -> Void) - /// Returns the passed map, to test serialization and deserialization. - func echoNullable( - _ aMapArg: [String?: Any?]?, - completion: @escaping (Result<[String?: Any?]?, PigeonError>) -> Void) - /// Returns the passed enum to test serialization and deserialization. - func echoNullable( - _ anEnumArg: AnEnum?, completion: @escaping (Result) -> Void) - /// Returns the passed enum to test serialization and deserialization. - func echoNullable( - _ anotherEnumArg: AnotherEnum?, - completion: @escaping (Result) -> Void) - /// A no-op function taking no arguments and returning no value, to sanity - /// test basic asynchronous calling. - func noopAsync(completion: @escaping (Result) -> Void) - /// Returns the passed in generic Object asynchronously. - func echoAsync(_ aStringArg: String, completion: @escaping (Result) -> Void) -} -class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { - private let binaryMessenger: FlutterBinaryMessenger - private let messageChannelSuffix: String - init(binaryMessenger: FlutterBinaryMessenger, messageChannelSuffix: String = "") { - self.binaryMessenger = binaryMessenger - self.messageChannelSuffix = messageChannelSuffix.count > 0 ? ".\(messageChannelSuffix)" : "" + func echoNonNull( + classList classListArg: [AllNullableTypes], + completion: @escaping (Result<[AllNullableTypes], PigeonError>) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNonNullClassList\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([classListArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else if listResponse[0] == nil { + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) + } else { + let result = listResponse[0] as! [AllNullableTypes] + completion(.success(result)) + } + } } - var codec: CoreTestsPigeonCodec { - return CoreTestsPigeonCodec.shared + /// Returns the passed map, to test serialization and deserialization. + func echo( + _ mapArg: [AnyHashable?: Any?], + completion: @escaping (Result<[AnyHashable?: Any?], PigeonError>) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoMap\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([mapArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else if listResponse[0] == nil { + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) + } else { + let result = listResponse[0] as! [AnyHashable?: Any?] + completion(.success(result)) + } + } } - /// A no-op function taking no arguments and returning no value, to sanity - /// test basic calling. - func noop(completion: @escaping (Result) -> Void) { + /// Returns the passed map, to test serialization and deserialization. + func echo( + stringMap stringMapArg: [String?: String?], + completion: @escaping (Result<[String?: String?], PigeonError>) -> Void + ) { let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noop\(messageChannelSuffix)" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoStringMap\(messageChannelSuffix)" let channel = FlutterBasicMessageChannel( name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage(nil) { response in + channel.sendMessage([stringMapArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -2740,18 +4839,28 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let message: String? = nilOrValue(listResponse[1]) let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) + } else if listResponse[0] == nil { + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) } else { - completion(.success(Void())) + let result = listResponse[0] as! [String?: String?] + completion(.success(result)) } } } - /// Responds with an error from an async function returning a value. - func throwError(completion: @escaping (Result) -> Void) { + /// Returns the passed map, to test serialization and deserialization. + func echo( + intMap intMapArg: [Int64?: Int64?], + completion: @escaping (Result<[Int64?: Int64?], PigeonError>) -> Void + ) { let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwError\(messageChannelSuffix)" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoIntMap\(messageChannelSuffix)" let channel = FlutterBasicMessageChannel( name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage(nil) { response in + channel.sendMessage([intMapArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -2761,19 +4870,28 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let message: String? = nilOrValue(listResponse[1]) let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) + } else if listResponse[0] == nil { + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) } else { - let result: Any? = listResponse[0] + let result = listResponse[0] as! [Int64?: Int64?] completion(.success(result)) } } } - /// Responds with an error from an async void function. - func throwErrorFromVoid(completion: @escaping (Result) -> Void) { + /// Returns the passed map, to test serialization and deserialization. + func echo( + enumMap enumMapArg: [AnEnum?: AnEnum?], + completion: @escaping (Result<[AnEnum?: AnEnum?], PigeonError>) -> Void + ) { let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwErrorFromVoid\(messageChannelSuffix)" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnumMap\(messageChannelSuffix)" let channel = FlutterBasicMessageChannel( name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage(nil) { response in + channel.sendMessage([enumMapArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -2783,20 +4901,28 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let message: String? = nilOrValue(listResponse[1]) let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) + } else if listResponse[0] == nil { + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) } else { - completion(.success(Void())) + let result = listResponse[0] as? [AnEnum?: AnEnum?] + completion(.success(result!)) } } } - /// Returns the passed object, to test serialization and deserialization. + /// Returns the passed map, to test serialization and deserialization. func echo( - _ everythingArg: AllTypes, completion: @escaping (Result) -> Void + classMap classMapArg: [Int64?: AllNullableTypes?], + completion: @escaping (Result<[Int64?: AllNullableTypes?], PigeonError>) -> Void ) { let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllTypes\(messageChannelSuffix)" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoClassMap\(messageChannelSuffix)" let channel = FlutterBasicMessageChannel( name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([everythingArg] as [Any?]) { response in + channel.sendMessage([classMapArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -2813,21 +4939,52 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) } else { - let result = listResponse[0] as! AllTypes + let result = listResponse[0] as! [Int64?: AllNullableTypes?] completion(.success(result)) } } } - /// Returns the passed object, to test serialization and deserialization. - func echoNullable( - _ everythingArg: AllNullableTypes?, - completion: @escaping (Result) -> Void + /// Returns the passed map, to test serialization and deserialization. + func echoNonNull( + stringMap stringMapArg: [String: String], + completion: @escaping (Result<[String: String], PigeonError>) -> Void ) { let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypes\(messageChannelSuffix)" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNonNullStringMap\(messageChannelSuffix)" let channel = FlutterBasicMessageChannel( name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([everythingArg] as [Any?]) { response in + channel.sendMessage([stringMapArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else if listResponse[0] == nil { + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) + } else { + let result = listResponse[0] as! [String: String] + completion(.success(result)) + } + } + } + /// Returns the passed map, to test serialization and deserialization. + func echoNonNull( + intMap intMapArg: [Int64: Int64], + completion: @escaping (Result<[Int64: Int64], PigeonError>) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNonNullIntMap\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([intMapArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -2837,26 +4994,59 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let message: String? = nilOrValue(listResponse[1]) let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) + } else if listResponse[0] == nil { + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) } else { - let result: AllNullableTypes? = nilOrValue(listResponse[0]) + let result = listResponse[0] as! [Int64: Int64] completion(.success(result)) } } } - /// Returns passed in arguments of multiple types. - /// - /// Tests multiple-arity FlutterApi handling. - func sendMultipleNullableTypes( - aBool aNullableBoolArg: Bool?, anInt aNullableIntArg: Int64?, - aString aNullableStringArg: String?, - completion: @escaping (Result) -> Void + /// Returns the passed map, to test serialization and deserialization. + func echoNonNull( + enumMap enumMapArg: [AnEnum: AnEnum], + completion: @escaping (Result<[AnEnum: AnEnum], PigeonError>) -> Void ) { let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypes\(messageChannelSuffix)" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNonNullEnumMap\(messageChannelSuffix)" let channel = FlutterBasicMessageChannel( name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([aNullableBoolArg, aNullableIntArg, aNullableStringArg] as [Any?]) { - response in + channel.sendMessage([enumMapArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else if listResponse[0] == nil { + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) + } else { + let result = listResponse[0] as? [AnEnum: AnEnum] + completion(.success(result!)) + } + } + } + /// Returns the passed map, to test serialization and deserialization. + func echoNonNull( + classMap classMapArg: [Int64: AllNullableTypes], + completion: @escaping (Result<[Int64: AllNullableTypes], PigeonError>) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNonNullClassMap\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([classMapArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -2873,21 +5063,18 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) } else { - let result = listResponse[0] as! AllNullableTypes + let result = listResponse[0] as! [Int64: AllNullableTypes] completion(.success(result)) } } } - /// Returns the passed object, to test serialization and deserialization. - func echoNullable( - _ everythingArg: AllNullableTypesWithoutRecursion?, - completion: @escaping (Result) -> Void - ) { + /// Returns the passed enum to test serialization and deserialization. + func echo(_ anEnumArg: AnEnum, completion: @escaping (Result) -> Void) { let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypesWithoutRecursion\(messageChannelSuffix)" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnum\(messageChannelSuffix)" let channel = FlutterBasicMessageChannel( name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([everythingArg] as [Any?]) { response in + channel.sendMessage([anEnumArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -2897,26 +5084,27 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let message: String? = nilOrValue(listResponse[1]) let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) + } else if listResponse[0] == nil { + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) } else { - let result: AllNullableTypesWithoutRecursion? = nilOrValue(listResponse[0]) + let result = listResponse[0] as! AnEnum completion(.success(result)) } } } - /// Returns passed in arguments of multiple types. - /// - /// Tests multiple-arity FlutterApi handling. - func sendMultipleNullableTypesWithoutRecursion( - aBool aNullableBoolArg: Bool?, anInt aNullableIntArg: Int64?, - aString aNullableStringArg: String?, - completion: @escaping (Result) -> Void + /// Returns the passed enum to test serialization and deserialization. + func echo( + _ anotherEnumArg: AnotherEnum, completion: @escaping (Result) -> Void ) { let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion\(messageChannelSuffix)" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAnotherEnum\(messageChannelSuffix)" let channel = FlutterBasicMessageChannel( name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([aNullableBoolArg, aNullableIntArg, aNullableStringArg] as [Any?]) { - response in + channel.sendMessage([anotherEnumArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -2933,15 +5121,15 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) } else { - let result = listResponse[0] as! AllNullableTypesWithoutRecursion + let result = listResponse[0] as! AnotherEnum completion(.success(result)) } } } /// Returns the passed boolean, to test serialization and deserialization. - func echo(_ aBoolArg: Bool, completion: @escaping (Result) -> Void) { + func echoNullable(_ aBoolArg: Bool?, completion: @escaping (Result) -> Void) { let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoBool\(messageChannelSuffix)" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableBool\(messageChannelSuffix)" let channel = FlutterBasicMessageChannel( name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([aBoolArg] as [Any?]) { response in @@ -2954,22 +5142,17 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let message: String? = nilOrValue(listResponse[1]) let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) - } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) } else { - let result = listResponse[0] as! Bool + let result: Bool? = nilOrValue(listResponse[0]) completion(.success(result)) } } } /// Returns the passed int, to test serialization and deserialization. - func echo(_ anIntArg: Int64, completion: @escaping (Result) -> Void) { + func echoNullable(_ anIntArg: Int64?, completion: @escaping (Result) -> Void) + { let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoInt\(messageChannelSuffix)" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableInt\(messageChannelSuffix)" let channel = FlutterBasicMessageChannel( name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([anIntArg] as [Any?]) { response in @@ -2982,23 +5165,18 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let message: String? = nilOrValue(listResponse[1]) let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) - } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) } else { - let result = - listResponse[0] is Int64 ? listResponse[0] as! Int64 : Int64(listResponse[0] as! Int32) + let result: Int64? = nilOrValue(listResponse[0]) completion(.success(result)) } } } /// Returns the passed double, to test serialization and deserialization. - func echo(_ aDoubleArg: Double, completion: @escaping (Result) -> Void) { + func echoNullable( + _ aDoubleArg: Double?, completion: @escaping (Result) -> Void + ) { let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoDouble\(messageChannelSuffix)" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableDouble\(messageChannelSuffix)" let channel = FlutterBasicMessageChannel( name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([aDoubleArg] as [Any?]) { response in @@ -3011,22 +5189,18 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let message: String? = nilOrValue(listResponse[1]) let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) - } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) } else { - let result = listResponse[0] as! Double + let result: Double? = nilOrValue(listResponse[0]) completion(.success(result)) } } } /// Returns the passed string, to test serialization and deserialization. - func echo(_ aStringArg: String, completion: @escaping (Result) -> Void) { + func echoNullable( + _ aStringArg: String?, completion: @escaping (Result) -> Void + ) { let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoString\(messageChannelSuffix)" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableString\(messageChannelSuffix)" let channel = FlutterBasicMessageChannel( name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([aStringArg] as [Any?]) { response in @@ -3039,25 +5213,19 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let message: String? = nilOrValue(listResponse[1]) let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) - } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) } else { - let result = listResponse[0] as! String + let result: String? = nilOrValue(listResponse[0]) completion(.success(result)) } } } /// Returns the passed byte list, to test serialization and deserialization. - func echo( - _ listArg: FlutterStandardTypedData, - completion: @escaping (Result) -> Void + func echoNullable( + _ listArg: FlutterStandardTypedData?, + completion: @escaping (Result) -> Void ) { let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoUint8List\(messageChannelSuffix)" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableUint8List\(messageChannelSuffix)" let channel = FlutterBasicMessageChannel( name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([listArg] as [Any?]) { response in @@ -3070,22 +5238,18 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let message: String? = nilOrValue(listResponse[1]) let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) - } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) } else { - let result = listResponse[0] as! FlutterStandardTypedData + let result: FlutterStandardTypedData? = nilOrValue(listResponse[0]) completion(.success(result)) } } } /// Returns the passed list, to test serialization and deserialization. - func echo(_ listArg: [Any?], completion: @escaping (Result<[Any?], PigeonError>) -> Void) { + func echoNullable( + _ listArg: [Any?]?, completion: @escaping (Result<[Any?]?, PigeonError>) -> Void + ) { let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoList\(messageChannelSuffix)" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableList\(messageChannelSuffix)" let channel = FlutterBasicMessageChannel( name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([listArg] as [Any?]) { response in @@ -3098,27 +5262,22 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let message: String? = nilOrValue(listResponse[1]) let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) - } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) } else { - let result = listResponse[0] as! [Any?] + let result: [Any?]? = nilOrValue(listResponse[0]) completion(.success(result)) } } } - /// Returns the passed map, to test serialization and deserialization. - func echo( - _ aMapArg: [String?: Any?], completion: @escaping (Result<[String?: Any?], PigeonError>) -> Void + /// Returns the passed list, to test serialization and deserialization. + func echoNullable( + enumList enumListArg: [AnEnum?]?, + completion: @escaping (Result<[AnEnum?]?, PigeonError>) -> Void ) { let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoMap\(messageChannelSuffix)" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableEnumList\(messageChannelSuffix)" let channel = FlutterBasicMessageChannel( name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([aMapArg] as [Any?]) { response in + channel.sendMessage([enumListArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -3128,25 +5287,22 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let message: String? = nilOrValue(listResponse[1]) let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) - } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) } else { - let result = listResponse[0] as! [String?: Any?] + let result: [AnEnum?]? = nilOrValue(listResponse[0]) completion(.success(result)) } } } - /// Returns the passed enum to test serialization and deserialization. - func echo(_ anEnumArg: AnEnum, completion: @escaping (Result) -> Void) { + /// Returns the passed list, to test serialization and deserialization. + func echoNullable( + classList classListArg: [AllNullableTypes?]?, + completion: @escaping (Result<[AllNullableTypes?]?, PigeonError>) -> Void + ) { let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnum\(messageChannelSuffix)" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableClassList\(messageChannelSuffix)" let channel = FlutterBasicMessageChannel( name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([anEnumArg] as [Any?]) { response in + channel.sendMessage([classListArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -3156,27 +5312,21 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let message: String? = nilOrValue(listResponse[1]) let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) - } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) } else { - let result = listResponse[0] as! AnEnum + let result: [AllNullableTypes?]? = nilOrValue(listResponse[0]) completion(.success(result)) } } } - /// Returns the passed enum to test serialization and deserialization. - func echo( - _ anotherEnumArg: AnotherEnum, completion: @escaping (Result) -> Void + /// Returns the passed list, to test serialization and deserialization. + func echoNullableNonNull( + enumList enumListArg: [AnEnum]?, completion: @escaping (Result<[AnEnum]?, PigeonError>) -> Void ) { let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAnotherEnum\(messageChannelSuffix)" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableNonNullEnumList\(messageChannelSuffix)" let channel = FlutterBasicMessageChannel( name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([anotherEnumArg] as [Any?]) { response in + channel.sendMessage([enumListArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -3186,25 +5336,22 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let message: String? = nilOrValue(listResponse[1]) let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) - } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) } else { - let result = listResponse[0] as! AnotherEnum + let result: [AnEnum]? = nilOrValue(listResponse[0]) completion(.success(result)) } } } - /// Returns the passed boolean, to test serialization and deserialization. - func echoNullable(_ aBoolArg: Bool?, completion: @escaping (Result) -> Void) { + /// Returns the passed list, to test serialization and deserialization. + func echoNullableNonNull( + classList classListArg: [AllNullableTypes]?, + completion: @escaping (Result<[AllNullableTypes]?, PigeonError>) -> Void + ) { let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableBool\(messageChannelSuffix)" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableNonNullClassList\(messageChannelSuffix)" let channel = FlutterBasicMessageChannel( name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([aBoolArg] as [Any?]) { response in + channel.sendMessage([classListArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -3215,19 +5362,21 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else { - let result: Bool? = nilOrValue(listResponse[0]) + let result: [AllNullableTypes]? = nilOrValue(listResponse[0]) completion(.success(result)) } } } - /// Returns the passed int, to test serialization and deserialization. - func echoNullable(_ anIntArg: Int64?, completion: @escaping (Result) -> Void) - { + /// Returns the passed map, to test serialization and deserialization. + func echoNullable( + _ mapArg: [AnyHashable?: Any?]?, + completion: @escaping (Result<[AnyHashable?: Any?]?, PigeonError>) -> Void + ) { let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableInt\(messageChannelSuffix)" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableMap\(messageChannelSuffix)" let channel = FlutterBasicMessageChannel( name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([anIntArg] as [Any?]) { response in + channel.sendMessage([mapArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -3238,24 +5387,21 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else { - let result: Int64? = - isNullish(listResponse[0]) - ? nil - : (listResponse[0] is Int64? - ? listResponse[0] as! Int64? : Int64(listResponse[0] as! Int32)) + let result: [AnyHashable?: Any?]? = nilOrValue(listResponse[0]) completion(.success(result)) } } } - /// Returns the passed double, to test serialization and deserialization. + /// Returns the passed map, to test serialization and deserialization. func echoNullable( - _ aDoubleArg: Double?, completion: @escaping (Result) -> Void + stringMap stringMapArg: [String?: String?]?, + completion: @escaping (Result<[String?: String?]?, PigeonError>) -> Void ) { let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableDouble\(messageChannelSuffix)" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableStringMap\(messageChannelSuffix)" let channel = FlutterBasicMessageChannel( name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([aDoubleArg] as [Any?]) { response in + channel.sendMessage([stringMapArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -3266,20 +5412,21 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else { - let result: Double? = nilOrValue(listResponse[0]) + let result: [String?: String?]? = nilOrValue(listResponse[0]) completion(.success(result)) } } } - /// Returns the passed string, to test serialization and deserialization. + /// Returns the passed map, to test serialization and deserialization. func echoNullable( - _ aStringArg: String?, completion: @escaping (Result) -> Void + intMap intMapArg: [Int64?: Int64?]?, + completion: @escaping (Result<[Int64?: Int64?]?, PigeonError>) -> Void ) { let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableString\(messageChannelSuffix)" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableIntMap\(messageChannelSuffix)" let channel = FlutterBasicMessageChannel( name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([aStringArg] as [Any?]) { response in + channel.sendMessage([intMapArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -3290,21 +5437,21 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else { - let result: String? = nilOrValue(listResponse[0]) + let result: [Int64?: Int64?]? = nilOrValue(listResponse[0]) completion(.success(result)) } } } - /// Returns the passed byte list, to test serialization and deserialization. + /// Returns the passed map, to test serialization and deserialization. func echoNullable( - _ listArg: FlutterStandardTypedData?, - completion: @escaping (Result) -> Void + enumMap enumMapArg: [AnEnum?: AnEnum?]?, + completion: @escaping (Result<[AnEnum?: AnEnum?]?, PigeonError>) -> Void ) { let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableUint8List\(messageChannelSuffix)" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableEnumMap\(messageChannelSuffix)" let channel = FlutterBasicMessageChannel( name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([listArg] as [Any?]) { response in + channel.sendMessage([enumMapArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -3315,20 +5462,21 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else { - let result: FlutterStandardTypedData? = nilOrValue(listResponse[0]) - completion(.success(result)) + let result: [AnEnum?: AnEnum?]? = listResponse[0] as? [AnEnum?: AnEnum?] + completion(.success(result!)) } } } - /// Returns the passed list, to test serialization and deserialization. + /// Returns the passed map, to test serialization and deserialization. func echoNullable( - _ listArg: [Any?]?, completion: @escaping (Result<[Any?]?, PigeonError>) -> Void + classMap classMapArg: [Int64?: AllNullableTypes?]?, + completion: @escaping (Result<[Int64?: AllNullableTypes?]?, PigeonError>) -> Void ) { let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableList\(messageChannelSuffix)" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableClassMap\(messageChannelSuffix)" let channel = FlutterBasicMessageChannel( name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([listArg] as [Any?]) { response in + channel.sendMessage([classMapArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -3339,21 +5487,96 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else { - let result: [Any?]? = nilOrValue(listResponse[0]) + let result: [Int64?: AllNullableTypes?]? = nilOrValue(listResponse[0]) completion(.success(result)) } } } /// Returns the passed map, to test serialization and deserialization. - func echoNullable( - _ aMapArg: [String?: Any?]?, - completion: @escaping (Result<[String?: Any?]?, PigeonError>) -> Void + func echoNullableNonNull( + stringMap stringMapArg: [String: String]?, + completion: @escaping (Result<[String: String]?, PigeonError>) -> Void ) { let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableMap\(messageChannelSuffix)" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableNonNullStringMap\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([stringMapArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + let result: [String: String]? = nilOrValue(listResponse[0]) + completion(.success(result)) + } + } + } + /// Returns the passed map, to test serialization and deserialization. + func echoNullableNonNull( + intMap intMapArg: [Int64: Int64]?, + completion: @escaping (Result<[Int64: Int64]?, PigeonError>) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableNonNullIntMap\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([intMapArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + let result: [Int64: Int64]? = nilOrValue(listResponse[0]) + completion(.success(result)) + } + } + } + /// Returns the passed map, to test serialization and deserialization. + func echoNullableNonNull( + enumMap enumMapArg: [AnEnum: AnEnum]?, + completion: @escaping (Result<[AnEnum: AnEnum]?, PigeonError>) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableNonNullEnumMap\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([enumMapArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + let result: [AnEnum: AnEnum]? = listResponse[0] as? [AnEnum: AnEnum] + completion(.success(result!)) + } + } + } + /// Returns the passed map, to test serialization and deserialization. + func echoNullableNonNull( + classMap classMapArg: [Int64: AllNullableTypes]?, + completion: @escaping (Result<[Int64: AllNullableTypes]?, PigeonError>) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableNonNullClassMap\(messageChannelSuffix)" let channel = FlutterBasicMessageChannel( name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([aMapArg] as [Any?]) { response in + channel.sendMessage([classMapArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -3364,7 +5587,7 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else { - let result: [String?: Any?]? = nilOrValue(listResponse[0]) + let result: [Int64: AllNullableTypes]? = nilOrValue(listResponse[0]) completion(.success(result)) } } diff --git a/packages/pigeon/platform_tests/test_plugin/ios/Classes/ProxyApiTestClass.swift b/packages/pigeon/platform_tests/test_plugin/ios/Classes/ProxyApiTestClass.swift new file mode 100644 index 000000000000..04a14c4e69fe --- /dev/null +++ b/packages/pigeon/platform_tests/test_plugin/ios/Classes/ProxyApiTestClass.swift @@ -0,0 +1,14 @@ +// 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 Foundation + +class ProxyApiTestClass: ProxyApiSuperClass, ProxyApiInterface {} + +open class ProxyApiSuperClass {} + +protocol ProxyApiInterface {} + +@available(iOS 15, *) +class ClassWithApiRequirement {} diff --git a/packages/pigeon/platform_tests/test_plugin/ios/Classes/ProxyApiTests.gen.swift b/packages/pigeon/platform_tests/test_plugin/ios/Classes/ProxyApiTests.gen.swift new file mode 100644 index 000000000000..d3a699ca47a9 --- /dev/null +++ b/packages/pigeon/platform_tests/test_plugin/ios/Classes/ProxyApiTests.gen.swift @@ -0,0 +1,4191 @@ +// 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, do not edit directly. +// See also: https://pub.dev/packages/pigeon + +import Foundation + +#if os(iOS) + import Flutter +#elseif os(macOS) + import FlutterMacOS +#else + #error("Unsupported platform.") +#endif + +/// Error class for passing custom error details to Dart side. +final class ProxyApiTestsError: Error { + let code: String + let message: String? + let details: Any? + + init(code: String, message: String?, details: Any?) { + self.code = code + self.message = message + self.details = details + } + + var localizedDescription: String { + return + "ProxyApiTestsError(code: \(code), message: \(message ?? ""), details: \(details ?? "")" + } +} + +private func wrapResult(_ result: Any?) -> [Any?] { + return [result] +} + +private func wrapError(_ error: Any) -> [Any?] { + if let pigeonError = error as? ProxyApiTestsError { + return [ + pigeonError.code, + pigeonError.message, + pigeonError.details, + ] + } + if let flutterError = error as? FlutterError { + return [ + flutterError.code, + flutterError.message, + flutterError.details, + ] + } + return [ + "\(error)", + "\(type(of: error))", + "Stacktrace: \(Thread.callStackSymbols)", + ] +} + +private func createConnectionError(withChannelName channelName: String) -> ProxyApiTestsError { + return ProxyApiTestsError( + code: "channel-error", message: "Unable to establish connection on channel: '\(channelName)'.", + details: "") +} + +private func isNullish(_ value: Any?) -> Bool { + return value is NSNull || value == nil +} + +private func nilOrValue(_ value: Any?) -> T? { + if value is NSNull { return nil } + return value as! T? +} +/// Handles the callback when an object is deallocated. +protocol ProxyApiTestsPigeonInternalFinalizerDelegate: AnyObject { + /// Invoked when the strong reference of an object is deallocated in an `InstanceManager`. + func onDeinit(identifier: Int64) +} + +// Attaches to an object to receive a callback when the object is deallocated. +internal final class ProxyApiTestsPigeonInternalFinalizer { + private static let associatedObjectKey = malloc(1)! + + private let identifier: Int64 + // Reference to the delegate is weak because the callback should be ignored if the + // `InstanceManager` is deallocated. + private weak var delegate: ProxyApiTestsPigeonInternalFinalizerDelegate? + + private init(identifier: Int64, delegate: ProxyApiTestsPigeonInternalFinalizerDelegate) { + self.identifier = identifier + self.delegate = delegate + } + + internal static func attach( + to instance: AnyObject, identifier: Int64, + delegate: ProxyApiTestsPigeonInternalFinalizerDelegate + ) { + let finalizer = ProxyApiTestsPigeonInternalFinalizer(identifier: identifier, delegate: delegate) + objc_setAssociatedObject(instance, associatedObjectKey, finalizer, .OBJC_ASSOCIATION_RETAIN) + } + + static func detach(from instance: AnyObject) { + objc_setAssociatedObject(instance, associatedObjectKey, nil, .OBJC_ASSOCIATION_ASSIGN) + } + + deinit { + delegate?.onDeinit(identifier: identifier) + } +} + +/// Maintains instances used to communicate with the corresponding objects in Dart. +/// +/// Objects stored in this container are represented by an object in Dart that is also stored in +/// an InstanceManager with the same identifier. +/// +/// When an instance is added with an identifier, either can be used to retrieve the other. +/// +/// Added instances are added as a weak reference and a strong reference. When the strong +/// reference is removed and the weak reference is deallocated,`ProxyApiTestsPigeonInternalFinalizerDelegate.onDeinit` +/// is called with the instance's identifier. However, if the strong reference is removed and then the identifier is +/// retrieved with the intention to pass the identifier to Dart (e.g. by calling `identifierWithStrongReference`), +/// the strong reference to the instance is re-added. The strong reference will then need to be removed manually +/// again. +/// +/// Accessing and inserting to an InstanceManager is thread safe. +final class ProxyApiTestsPigeonInstanceManager { + // Identifiers are locked to a specific range to avoid collisions with objects + // created simultaneously from Dart. + // Host uses identifiers >= 2^16 and Dart is expected to use values n where, + // 0 <= n < 2^16. + private static let minHostCreatedIdentifier: Int64 = 65536 + + private let lockQueue = DispatchQueue(label: "ProxyApiTestsPigeonInstanceManager") + private let identifiers: NSMapTable = NSMapTable( + keyOptions: [.weakMemory, .objectPointerPersonality], valueOptions: .strongMemory) + private let weakInstances: NSMapTable = NSMapTable( + keyOptions: .strongMemory, valueOptions: [.weakMemory, .objectPointerPersonality]) + private let strongInstances: NSMapTable = NSMapTable( + keyOptions: .strongMemory, valueOptions: [.strongMemory, .objectPointerPersonality]) + private let finalizerDelegate: ProxyApiTestsPigeonInternalFinalizerDelegate + private var nextIdentifier: Int64 = minHostCreatedIdentifier + + public init(finalizerDelegate: ProxyApiTestsPigeonInternalFinalizerDelegate) { + self.finalizerDelegate = finalizerDelegate + } + + /// Adds a new instance that was instantiated from Dart. + /// + /// The same instance can be added multiple times, but each identifier must be unique. This allows + /// two objects that are equivalent (e.g. conforms to `Equatable`) to both be added. + /// + /// - Parameters: + /// - instance: the instance to be stored + /// - identifier: the identifier to be paired with instance. This value must be >= 0 and unique + func addDartCreatedInstance(_ instance: AnyObject, withIdentifier identifier: Int64) { + lockQueue.async { + self.addInstance(instance, withIdentifier: identifier) + } + } + + /// Adds a new instance that was instantiated from the host platform. + /// + /// - Parameters: + /// - instance: the instance to be stored. This must be unique to all other added instances. + /// - Returns: the unique identifier (>= 0) stored with instance + func addHostCreatedInstance(_ instance: AnyObject) -> Int64 { + assert(!containsInstance(instance), "Instance of \(instance) has already been added.") + var identifier: Int64 = -1 + lockQueue.sync { + identifier = nextIdentifier + nextIdentifier += 1 + self.addInstance(instance, withIdentifier: identifier) + } + return identifier + } + + /// Removes `instanceIdentifier` and its associated strongly referenced instance, if present, from the manager. + /// + /// - Parameters: + /// - instanceIdentifier: the identifier paired to an instance. + /// - Returns: removed instance if the manager contains the given identifier, otherwise `nil` if + /// the manager doesn't contain the value + func removeInstance(withIdentifier instanceIdentifier: Int64) throws -> T? { + var instance: AnyObject? = nil + lockQueue.sync { + instance = strongInstances.object(forKey: NSNumber(value: instanceIdentifier)) + strongInstances.removeObject(forKey: NSNumber(value: instanceIdentifier)) + } + return instance as? T + } + + /// Retrieves the instance associated with identifier. + /// + /// - Parameters: + /// - instanceIdentifier: the identifier associated with an instance + /// - Returns: the instance associated with `instanceIdentifier` if the manager contains the value, otherwise + /// `nil` if the manager doesn't contain the value + func instance(forIdentifier instanceIdentifier: Int64) -> T? { + var instance: AnyObject? = nil + lockQueue.sync { + instance = weakInstances.object(forKey: NSNumber(value: instanceIdentifier)) + } + return instance as? T + } + + private func addInstance(_ instance: AnyObject, withIdentifier identifier: Int64) { + assert(identifier >= 0) + assert( + weakInstances.object(forKey: identifier as NSNumber) == nil, + "Identifier has already been added: \(identifier)") + identifiers.setObject(NSNumber(value: identifier), forKey: instance) + weakInstances.setObject(instance, forKey: NSNumber(value: identifier)) + strongInstances.setObject(instance, forKey: NSNumber(value: identifier)) + ProxyApiTestsPigeonInternalFinalizer.attach( + to: instance, identifier: identifier, delegate: finalizerDelegate) + } + + /// Retrieves the identifier paired with an instance. + /// + /// If the manager contains a strong reference to `instance`, it will return the identifier + /// associated with `instance`. If the manager contains only a weak reference to `instance`, a new + /// strong reference to `instance` will be added and will need to be removed again with `removeInstance`. + /// + /// If this method returns a nonnull identifier, this method also expects the Dart + /// `ProxyApiTestsPigeonInstanceManager` to have, or recreate, a weak reference to the Dart instance the + /// identifier is associated with. + /// + /// - Parameters: + /// - instance: an instance that may be stored in the manager + /// - Returns: the identifier associated with `instance` if the manager contains the value, otherwise + /// `nil` if the manager doesn't contain the value + func identifierWithStrongReference(forInstance instance: AnyObject) -> Int64? { + var identifier: Int64? = nil + lockQueue.sync { + if let existingIdentifier = identifiers.object(forKey: instance)?.int64Value { + strongInstances.setObject(instance, forKey: NSNumber(value: existingIdentifier)) + identifier = existingIdentifier + } + } + return identifier + } + + /// Whether this manager contains the given `instance`. + /// + /// - Parameters: + /// - instance: the instance whose presence in this manager is to be tested + /// - Returns: whether this manager contains the given `instance` + func containsInstance(_ instance: AnyObject) -> Bool { + var containsInstance = false + lockQueue.sync { + containsInstance = identifiers.object(forKey: instance) != nil + } + return containsInstance + } + + /// Removes all of the instances from this manager. + /// + /// The manager will be empty after this call returns. + func removeAllObjects() throws { + lockQueue.sync { + identifiers.removeAllObjects() + weakInstances.removeAllObjects() + strongInstances.removeAllObjects() + nextIdentifier = ProxyApiTestsPigeonInstanceManager.minHostCreatedIdentifier + } + } + + /// The number of instances stored as a strong reference. + /// + /// For debugging and testing purposes. + internal var strongInstanceCount: Int { + var count: Int = 0 + lockQueue.sync { + count = strongInstances.count + } + return count + } + + /// The number of instances stored as a weak reference. + /// + /// For debugging and testing purposes. NSMapTables that store keys or objects as weak + /// reference will be reclaimed non-deterministically. + internal var weakInstanceCount: Int { + var count: Int = 0 + lockQueue.sync { + count = weakInstances.count + } + return count + } +} + +private class ProxyApiTestsPigeonInstanceManagerApi { + /// The codec used for serializing messages. + var codec: FlutterStandardMessageCodec { ProxyApiTestsPigeonCodec.shared } + + /// Handles sending and receiving messages with Dart. + unowned let binaryMessenger: FlutterBinaryMessenger + + init(binaryMessenger: FlutterBinaryMessenger) { + self.binaryMessenger = binaryMessenger + } + + /// Sets up an instance of `ProxyApiTestsPigeonInstanceManagerApi` to handle messages through the `binaryMessenger`. + static func setUpMessageHandlers( + binaryMessenger: FlutterBinaryMessenger, instanceManager: ProxyApiTestsPigeonInstanceManager? + ) { + let codec = ProxyApiTestsPigeonCodec.shared + let removeStrongReferenceChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.PigeonInternalInstanceManager.removeStrongReference", + binaryMessenger: binaryMessenger, codec: codec) + if let instanceManager = instanceManager { + removeStrongReferenceChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let identifierArg = args[0] as! Int64 + do { + let _: AnyObject? = try instanceManager.removeInstance(withIdentifier: identifierArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + removeStrongReferenceChannel.setMessageHandler(nil) + } + let clearChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.PigeonInternalInstanceManager.clear", + binaryMessenger: binaryMessenger, codec: codec) + if let instanceManager = instanceManager { + clearChannel.setMessageHandler { _, reply in + do { + try instanceManager.removeAllObjects() + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + clearChannel.setMessageHandler(nil) + } + } + + /// Sends a message to the Dart `InstanceManager` to remove the strong reference of the instance associated with `identifier`. + func removeStrongReference( + identifier identifierArg: Int64, + completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.PigeonInternalInstanceManager.removeStrongReference" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([identifierArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(ProxyApiTestsError(code: code, message: message, details: details))) + } else { + completion(.success(Void())) + } + } + } +} +protocol ProxyApiTestsPigeonProxyApiDelegate { + /// An implementation of [PigeonApiProxyApiTestClass] used to add a new Dart instance of + /// `ProxyApiTestClass` to the Dart `InstanceManager` and make calls to Dart. + func pigeonApiProxyApiTestClass(_ registrar: ProxyApiTestsPigeonProxyApiRegistrar) + -> PigeonApiProxyApiTestClass + /// An implementation of [PigeonApiProxyApiSuperClass] used to add a new Dart instance of + /// `ProxyApiSuperClass` to the Dart `InstanceManager` and make calls to Dart. + func pigeonApiProxyApiSuperClass(_ registrar: ProxyApiTestsPigeonProxyApiRegistrar) + -> PigeonApiProxyApiSuperClass + /// An implementation of [PigeonApiProxyApiInterface] used to add a new Dart instance of + /// `ProxyApiInterface` to the Dart `InstanceManager` and make calls to Dart. + func pigeonApiProxyApiInterface(_ registrar: ProxyApiTestsPigeonProxyApiRegistrar) + -> PigeonApiProxyApiInterface + /// An implementation of [PigeonApiClassWithApiRequirement] used to add a new Dart instance of + /// `ClassWithApiRequirement` to the Dart `InstanceManager` and make calls to Dart. + func pigeonApiClassWithApiRequirement(_ registrar: ProxyApiTestsPigeonProxyApiRegistrar) + -> PigeonApiClassWithApiRequirement +} + +extension ProxyApiTestsPigeonProxyApiDelegate { + func pigeonApiProxyApiInterface(_ registrar: ProxyApiTestsPigeonProxyApiRegistrar) + -> PigeonApiProxyApiInterface + { + return PigeonApiProxyApiInterface( + pigeonRegistrar: registrar, delegate: PigeonApiDelegateProxyApiInterface()) + } +} + +open class ProxyApiTestsPigeonProxyApiRegistrar { + let binaryMessenger: FlutterBinaryMessenger + let apiDelegate: ProxyApiTestsPigeonProxyApiDelegate + let instanceManager: ProxyApiTestsPigeonInstanceManager + /// Whether APIs should ignore calling to Dart. + public var ignoreCallsToDart = false + private var _codec: FlutterStandardMessageCodec? + var codec: FlutterStandardMessageCodec { + if _codec == nil { + _codec = FlutterStandardMessageCodec( + readerWriter: ProxyApiTestsPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: self)) + } + return _codec! + } + + private class InstanceManagerApiFinalizerDelegate: ProxyApiTestsPigeonInternalFinalizerDelegate { + let api: ProxyApiTestsPigeonInstanceManagerApi + + init(_ api: ProxyApiTestsPigeonInstanceManagerApi) { + self.api = api + } + + public func onDeinit(identifier: Int64) { + api.removeStrongReference(identifier: identifier) { + _ in + } + } + } + + init(binaryMessenger: FlutterBinaryMessenger, apiDelegate: ProxyApiTestsPigeonProxyApiDelegate) { + self.binaryMessenger = binaryMessenger + self.apiDelegate = apiDelegate + self.instanceManager = ProxyApiTestsPigeonInstanceManager( + finalizerDelegate: InstanceManagerApiFinalizerDelegate( + ProxyApiTestsPigeonInstanceManagerApi(binaryMessenger: binaryMessenger))) + } + + func setUp() { + ProxyApiTestsPigeonInstanceManagerApi.setUpMessageHandlers( + binaryMessenger: binaryMessenger, instanceManager: instanceManager) + PigeonApiProxyApiTestClass.setUpMessageHandlers( + binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiProxyApiTestClass(self)) + PigeonApiProxyApiSuperClass.setUpMessageHandlers( + binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiProxyApiSuperClass(self)) + PigeonApiClassWithApiRequirement.setUpMessageHandlers( + binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiClassWithApiRequirement(self)) + } + func tearDown() { + ProxyApiTestsPigeonInstanceManagerApi.setUpMessageHandlers( + binaryMessenger: binaryMessenger, instanceManager: nil) + PigeonApiProxyApiTestClass.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) + PigeonApiProxyApiSuperClass.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) + PigeonApiClassWithApiRequirement.setUpMessageHandlers( + binaryMessenger: binaryMessenger, api: nil) + } +} +private class ProxyApiTestsPigeonInternalProxyApiCodecReaderWriter: FlutterStandardReaderWriter { + unowned let pigeonRegistrar: ProxyApiTestsPigeonProxyApiRegistrar + + private class ProxyApiTestsPigeonInternalProxyApiCodecReader: ProxyApiTestsPigeonCodecReader { + unowned let pigeonRegistrar: ProxyApiTestsPigeonProxyApiRegistrar + + init(data: Data, pigeonRegistrar: ProxyApiTestsPigeonProxyApiRegistrar) { + self.pigeonRegistrar = pigeonRegistrar + super.init(data: data) + } + + override func readValue(ofType type: UInt8) -> Any? { + switch type { + case 128: + let identifier = self.readValue() + let instance: AnyObject? = pigeonRegistrar.instanceManager.instance( + forIdentifier: identifier is Int64 ? identifier as! Int64 : Int64(identifier as! Int32)) + return instance + default: + return super.readValue(ofType: type) + } + } + } + + private class ProxyApiTestsPigeonInternalProxyApiCodecWriter: ProxyApiTestsPigeonCodecWriter { + unowned let pigeonRegistrar: ProxyApiTestsPigeonProxyApiRegistrar + + init(data: NSMutableData, pigeonRegistrar: ProxyApiTestsPigeonProxyApiRegistrar) { + self.pigeonRegistrar = pigeonRegistrar + super.init(data: data) + } + + override func writeValue(_ value: Any) { + if value is [Any] || value is Bool || value is Data || value is [AnyHashable: Any] + || value is Double || value is FlutterStandardTypedData || value is Int64 || value is String + || value is ProxyApiTestEnum + { + super.writeValue(value) + return + } + + if let instance = value as? ProxyApiTestClass { + pigeonRegistrar.apiDelegate.pigeonApiProxyApiTestClass(pigeonRegistrar).pigeonNewInstance( + pigeonInstance: instance + ) { _ in } + super.writeByte(128) + super.writeValue( + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) + return + } + + if let instance = value as? ProxyApiSuperClass { + pigeonRegistrar.apiDelegate.pigeonApiProxyApiSuperClass(pigeonRegistrar).pigeonNewInstance( + pigeonInstance: instance + ) { _ in } + super.writeByte(128) + super.writeValue( + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) + return + } + + if let instance = value as? ProxyApiInterface { + pigeonRegistrar.apiDelegate.pigeonApiProxyApiInterface(pigeonRegistrar).pigeonNewInstance( + pigeonInstance: instance + ) { _ in } + super.writeByte(128) + super.writeValue( + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) + return + } + + if #available(iOS 15.0.0, macOS 10.0.0, *), let instance = value as? ClassWithApiRequirement { + pigeonRegistrar.apiDelegate.pigeonApiClassWithApiRequirement(pigeonRegistrar) + .pigeonNewInstance( + pigeonInstance: instance + ) { _ in } + super.writeByte(128) + super.writeValue( + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) + return + } + + if let instance = value as AnyObject?, + pigeonRegistrar.instanceManager.containsInstance(instance) + { + super.writeByte(128) + super.writeValue( + pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance)!) + } else { + print("Unsupported value: \(value) of \(type(of: value))") + assert(false, "Unsupported value for ProxyApiTestsPigeonInternalProxyApiCodecWriter") + } + + } + } + + init(pigeonRegistrar: ProxyApiTestsPigeonProxyApiRegistrar) { + self.pigeonRegistrar = pigeonRegistrar + } + + override func reader(with data: Data) -> FlutterStandardReader { + return ProxyApiTestsPigeonInternalProxyApiCodecReader( + data: data, pigeonRegistrar: pigeonRegistrar) + } + + override func writer(with data: NSMutableData) -> FlutterStandardWriter { + return ProxyApiTestsPigeonInternalProxyApiCodecWriter( + data: data, pigeonRegistrar: pigeonRegistrar) + } +} + +enum ProxyApiTestEnum: Int { + case one = 0 + case two = 1 + case three = 2 +} + +private class ProxyApiTestsPigeonCodecReader: FlutterStandardReader { + override func readValue(ofType type: UInt8) -> Any? { + switch type { + case 129: + let enumResultAsInt: Int? = nilOrValue(self.readValue() as! Int?) + if let enumResultAsInt = enumResultAsInt { + return ProxyApiTestEnum(rawValue: enumResultAsInt) + } + return nil + default: + return super.readValue(ofType: type) + } + } +} + +private class ProxyApiTestsPigeonCodecWriter: FlutterStandardWriter { + override func writeValue(_ value: Any) { + if let value = value as? ProxyApiTestEnum { + super.writeByte(129) + super.writeValue(value.rawValue) + } else { + super.writeValue(value) + } + } +} + +private class ProxyApiTestsPigeonCodecReaderWriter: FlutterStandardReaderWriter { + override func reader(with data: Data) -> FlutterStandardReader { + return ProxyApiTestsPigeonCodecReader(data: data) + } + + override func writer(with data: NSMutableData) -> FlutterStandardWriter { + return ProxyApiTestsPigeonCodecWriter(data: data) + } +} + +class ProxyApiTestsPigeonCodec: FlutterStandardMessageCodec, @unchecked Sendable { + static let shared = ProxyApiTestsPigeonCodec(readerWriter: ProxyApiTestsPigeonCodecReaderWriter()) +} + +protocol PigeonApiDelegateProxyApiTestClass { + func pigeonDefaultConstructor( + pigeonApi: PigeonApiProxyApiTestClass, aBool: Bool, anInt: Int64, aDouble: Double, + aString: String, aUint8List: FlutterStandardTypedData, aList: [Any?], aMap: [String?: Any?], + anEnum: ProxyApiTestEnum, aProxyApi: ProxyApiSuperClass, aNullableBool: Bool?, + aNullableInt: Int64?, aNullableDouble: Double?, aNullableString: String?, + aNullableUint8List: FlutterStandardTypedData?, aNullableList: [Any?]?, + aNullableMap: [String?: Any?]?, aNullableEnum: ProxyApiTestEnum?, + aNullableProxyApi: ProxyApiSuperClass?, boolParam: Bool, intParam: Int64, doubleParam: Double, + stringParam: String, aUint8ListParam: FlutterStandardTypedData, listParam: [Any?], + mapParam: [String?: Any?], enumParam: ProxyApiTestEnum, proxyApiParam: ProxyApiSuperClass, + nullableBoolParam: Bool?, nullableIntParam: Int64?, nullableDoubleParam: Double?, + nullableStringParam: String?, nullableUint8ListParam: FlutterStandardTypedData?, + nullableListParam: [Any?]?, nullableMapParam: [String?: Any?]?, + nullableEnumParam: ProxyApiTestEnum?, nullableProxyApiParam: ProxyApiSuperClass? + ) throws -> ProxyApiTestClass + func attachedField(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) + throws -> ProxyApiSuperClass + func staticAttachedField(pigeonApi: PigeonApiProxyApiTestClass) throws -> ProxyApiSuperClass + func aBool(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) throws + -> Bool + func anInt(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) throws + -> Int64 + func aDouble(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) throws + -> Double + func aString(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) throws + -> String + func aUint8List(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) throws + -> FlutterStandardTypedData + func aList(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) throws + -> [Any?] + func aMap(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) throws + -> [String?: Any?] + func anEnum(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) throws + -> ProxyApiTestEnum + func aProxyApi(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) throws + -> ProxyApiSuperClass + func aNullableBool(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) + throws -> Bool? + func aNullableInt(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) throws + -> Int64? + func aNullableDouble(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) + throws -> Double? + func aNullableString(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) + throws -> String? + func aNullableUint8List(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) + throws -> FlutterStandardTypedData? + func aNullableList(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) + throws -> [Any?]? + func aNullableMap(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) throws + -> [String?: Any?]? + func aNullableEnum(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) + throws -> ProxyApiTestEnum? + func aNullableProxyApi(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) + throws -> ProxyApiSuperClass? + /// A no-op function taking no arguments and returning no value, to sanity + /// test basic calling. + func noop(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) throws + /// Returns an error, to test error handling. + func throwError(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) throws + -> Any? + /// Returns an error from a void function, to test error handling. + func throwErrorFromVoid(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) + throws + /// Returns a Flutter error, to test error handling. + func throwFlutterError(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) + throws -> Any? + /// Returns passed in int. + func echoInt( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, anInt: Int64 + ) throws -> Int64 + /// Returns passed in double. + func echoDouble( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aDouble: Double + ) throws -> Double + /// Returns the passed in boolean. + func echoBool( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aBool: Bool + ) throws -> Bool + /// Returns the passed in string. + func echoString( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aString: String + ) throws -> String + /// Returns the passed in Uint8List. + func echoUint8List( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aUint8List: FlutterStandardTypedData + ) throws -> FlutterStandardTypedData + /// Returns the passed in generic Object. + func echoObject( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, anObject: Any + ) throws -> Any + /// Returns the passed list, to test serialization and deserialization. + func echoList( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aList: [Any?] + ) throws -> [Any?] + /// Returns the passed list with ProxyApis, to test serialization and + /// deserialization. + func echoProxyApiList( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aList: [ProxyApiTestClass] + ) throws -> [ProxyApiTestClass] + /// Returns the passed map, to test serialization and deserialization. + func echoMap( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aMap: [String?: Any?] + ) throws -> [String?: Any?] + /// Returns the passed map with ProxyApis, to test serialization and + /// deserialization. + func echoProxyApiMap( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aMap: [String: ProxyApiTestClass] + ) throws -> [String: ProxyApiTestClass] + /// Returns the passed enum to test serialization and deserialization. + func echoEnum( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + anEnum: ProxyApiTestEnum + ) throws -> ProxyApiTestEnum + /// Returns the passed ProxyApi to test serialization and deserialization. + func echoProxyApi( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aProxyApi: ProxyApiSuperClass + ) throws -> ProxyApiSuperClass + /// Returns passed in int. + func echoNullableInt( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aNullableInt: Int64? + ) throws -> Int64? + /// Returns passed in double. + func echoNullableDouble( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aNullableDouble: Double? + ) throws -> Double? + /// Returns the passed in boolean. + func echoNullableBool( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aNullableBool: Bool? + ) throws -> Bool? + /// Returns the passed in string. + func echoNullableString( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aNullableString: String? + ) throws -> String? + /// Returns the passed in Uint8List. + func echoNullableUint8List( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aNullableUint8List: FlutterStandardTypedData? + ) throws -> FlutterStandardTypedData? + /// Returns the passed in generic Object. + func echoNullableObject( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aNullableObject: Any? + ) throws -> Any? + /// Returns the passed list, to test serialization and deserialization. + func echoNullableList( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aNullableList: [Any?]? + ) throws -> [Any?]? + /// Returns the passed map, to test serialization and deserialization. + func echoNullableMap( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aNullableMap: [String?: Any?]? + ) throws -> [String?: Any?]? + func echoNullableEnum( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aNullableEnum: ProxyApiTestEnum? + ) throws -> ProxyApiTestEnum? + /// Returns the passed ProxyApi to test serialization and deserialization. + func echoNullableProxyApi( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aNullableProxyApi: ProxyApiSuperClass? + ) throws -> ProxyApiSuperClass? + /// A no-op function taking no arguments and returning no value, to sanity + /// test basic asynchronous calling. + func noopAsync( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + completion: @escaping (Result) -> Void) + /// Returns passed in int asynchronously. + func echoAsyncInt( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, anInt: Int64, + completion: @escaping (Result) -> Void) + /// Returns passed in double asynchronously. + func echoAsyncDouble( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aDouble: Double, + completion: @escaping (Result) -> Void) + /// Returns the passed in boolean asynchronously. + func echoAsyncBool( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aBool: Bool, + completion: @escaping (Result) -> Void) + /// Returns the passed string asynchronously. + func echoAsyncString( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aString: String, + completion: @escaping (Result) -> Void) + /// Returns the passed in Uint8List asynchronously. + func echoAsyncUint8List( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aUint8List: FlutterStandardTypedData, + completion: @escaping (Result) -> Void) + /// Returns the passed in generic Object asynchronously. + func echoAsyncObject( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, anObject: Any, + completion: @escaping (Result) -> Void) + /// Returns the passed list, to test asynchronous serialization and deserialization. + func echoAsyncList( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aList: [Any?], + completion: @escaping (Result<[Any?], Error>) -> Void) + /// Returns the passed map, to test asynchronous serialization and deserialization. + func echoAsyncMap( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aMap: [String?: Any?], + completion: @escaping (Result<[String?: Any?], Error>) -> Void) + /// Returns the passed enum, to test asynchronous serialization and deserialization. + func echoAsyncEnum( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + anEnum: ProxyApiTestEnum, completion: @escaping (Result) -> Void) + /// Responds with an error from an async function returning a value. + func throwAsyncError( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + completion: @escaping (Result) -> Void) + /// Responds with an error from an async void function. + func throwAsyncErrorFromVoid( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + completion: @escaping (Result) -> Void) + /// Responds with a Flutter error from an async function returning a value. + func throwAsyncFlutterError( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + completion: @escaping (Result) -> Void) + /// Returns passed in int asynchronously. + func echoAsyncNullableInt( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, anInt: Int64?, + completion: @escaping (Result) -> Void) + /// Returns passed in double asynchronously. + func echoAsyncNullableDouble( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aDouble: Double?, + completion: @escaping (Result) -> Void) + /// Returns the passed in boolean asynchronously. + func echoAsyncNullableBool( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aBool: Bool?, + completion: @escaping (Result) -> Void) + /// Returns the passed string asynchronously. + func echoAsyncNullableString( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aString: String?, + completion: @escaping (Result) -> Void) + /// Returns the passed in Uint8List asynchronously. + func echoAsyncNullableUint8List( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aUint8List: FlutterStandardTypedData?, + completion: @escaping (Result) -> Void) + /// Returns the passed in generic Object asynchronously. + func echoAsyncNullableObject( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, anObject: Any?, + completion: @escaping (Result) -> Void) + /// Returns the passed list, to test asynchronous serialization and deserialization. + func echoAsyncNullableList( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aList: [Any?]?, + completion: @escaping (Result<[Any?]?, Error>) -> Void) + /// Returns the passed map, to test asynchronous serialization and deserialization. + func echoAsyncNullableMap( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aMap: [String?: Any?]?, completion: @escaping (Result<[String?: Any?]?, Error>) -> Void) + /// Returns the passed enum, to test asynchronous serialization and deserialization. + func echoAsyncNullableEnum( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + anEnum: ProxyApiTestEnum?, completion: @escaping (Result) -> Void) + func staticNoop(pigeonApi: PigeonApiProxyApiTestClass) throws + func echoStaticString(pigeonApi: PigeonApiProxyApiTestClass, aString: String) throws -> String + func staticAsyncNoop( + pigeonApi: PigeonApiProxyApiTestClass, completion: @escaping (Result) -> Void) + func callFlutterNoop( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + completion: @escaping (Result) -> Void) + func callFlutterThrowError( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + completion: @escaping (Result) -> Void) + func callFlutterThrowErrorFromVoid( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + completion: @escaping (Result) -> Void) + func callFlutterEchoBool( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aBool: Bool, + completion: @escaping (Result) -> Void) + func callFlutterEchoInt( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, anInt: Int64, + completion: @escaping (Result) -> Void) + func callFlutterEchoDouble( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aDouble: Double, + completion: @escaping (Result) -> Void) + func callFlutterEchoString( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aString: String, + completion: @escaping (Result) -> Void) + func callFlutterEchoUint8List( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aUint8List: FlutterStandardTypedData, + completion: @escaping (Result) -> Void) + func callFlutterEchoList( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aList: [Any?], + completion: @escaping (Result<[Any?], Error>) -> Void) + func callFlutterEchoProxyApiList( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aList: [ProxyApiTestClass?], completion: @escaping (Result<[ProxyApiTestClass?], Error>) -> Void + ) + func callFlutterEchoMap( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aMap: [String?: Any?], + completion: @escaping (Result<[String?: Any?], Error>) -> Void) + func callFlutterEchoProxyApiMap( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aMap: [String?: ProxyApiTestClass?], + completion: @escaping (Result<[String?: ProxyApiTestClass?], Error>) -> Void) + func callFlutterEchoEnum( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + anEnum: ProxyApiTestEnum, completion: @escaping (Result) -> Void) + func callFlutterEchoProxyApi( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aProxyApi: ProxyApiSuperClass, completion: @escaping (Result) -> Void + ) + func callFlutterEchoNullableBool( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aBool: Bool?, + completion: @escaping (Result) -> Void) + func callFlutterEchoNullableInt( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, anInt: Int64?, + completion: @escaping (Result) -> Void) + func callFlutterEchoNullableDouble( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aDouble: Double?, + completion: @escaping (Result) -> Void) + func callFlutterEchoNullableString( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aString: String?, + completion: @escaping (Result) -> Void) + func callFlutterEchoNullableUint8List( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aUint8List: FlutterStandardTypedData?, + completion: @escaping (Result) -> Void) + func callFlutterEchoNullableList( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aList: [Any?]?, + completion: @escaping (Result<[Any?]?, Error>) -> Void) + func callFlutterEchoNullableMap( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aMap: [String?: Any?]?, completion: @escaping (Result<[String?: Any?]?, Error>) -> Void) + func callFlutterEchoNullableEnum( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + anEnum: ProxyApiTestEnum?, completion: @escaping (Result) -> Void) + func callFlutterEchoNullableProxyApi( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aProxyApi: ProxyApiSuperClass?, + completion: @escaping (Result) -> Void) + func callFlutterNoopAsync( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + completion: @escaping (Result) -> Void) + func callFlutterEchoAsyncString( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aString: String, + completion: @escaping (Result) -> Void) +} + +protocol PigeonApiProtocolProxyApiTestClass { + /// A no-op function taking no arguments and returning no value, to sanity + /// test basic calling. + func flutterNoop( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, + completion: @escaping (Result) -> Void) + /// Responds with an error from an async function returning a value. + func flutterThrowError( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, + completion: @escaping (Result) -> Void) + /// Responds with an error from an async void function. + func flutterThrowErrorFromVoid( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, + completion: @escaping (Result) -> Void) + /// Returns the passed boolean, to test serialization and deserialization. + func flutterEchoBool( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aBool aBoolArg: Bool, + completion: @escaping (Result) -> Void) + /// Returns the passed int, to test serialization and deserialization. + func flutterEchoInt( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, anInt anIntArg: Int64, + completion: @escaping (Result) -> Void) + /// Returns the passed double, to test serialization and deserialization. + func flutterEchoDouble( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aDouble aDoubleArg: Double, + completion: @escaping (Result) -> Void) + /// Returns the passed string, to test serialization and deserialization. + func flutterEchoString( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aString aStringArg: String, + completion: @escaping (Result) -> Void) + /// Returns the passed byte list, to test serialization and deserialization. + func flutterEchoUint8List( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aList aListArg: FlutterStandardTypedData, + completion: @escaping (Result) -> Void) + /// Returns the passed list, to test serialization and deserialization. + func flutterEchoList( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aList aListArg: [Any?], + completion: @escaping (Result<[Any?], ProxyApiTestsError>) -> Void) + /// Returns the passed list with ProxyApis, to test serialization and + /// deserialization. + func flutterEchoProxyApiList( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aList aListArg: [ProxyApiTestClass?], + completion: @escaping (Result<[ProxyApiTestClass?], ProxyApiTestsError>) -> Void) + /// Returns the passed map, to test serialization and deserialization. + func flutterEchoMap( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aMap aMapArg: [String?: Any?], + completion: @escaping (Result<[String?: Any?], ProxyApiTestsError>) -> Void) + /// Returns the passed map with ProxyApis, to test serialization and + /// deserialization. + func flutterEchoProxyApiMap( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, + aMap aMapArg: [String?: ProxyApiTestClass?], + completion: @escaping (Result<[String?: ProxyApiTestClass?], ProxyApiTestsError>) -> Void) + /// Returns the passed enum to test serialization and deserialization. + func flutterEchoEnum( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, anEnum anEnumArg: ProxyApiTestEnum, + completion: @escaping (Result) -> Void) + /// Returns the passed ProxyApi to test serialization and deserialization. + func flutterEchoProxyApi( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aProxyApi aProxyApiArg: ProxyApiSuperClass, + completion: @escaping (Result) -> Void) + /// Returns the passed boolean, to test serialization and deserialization. + func flutterEchoNullableBool( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aBool aBoolArg: Bool?, + completion: @escaping (Result) -> Void) + /// Returns the passed int, to test serialization and deserialization. + func flutterEchoNullableInt( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, anInt anIntArg: Int64?, + completion: @escaping (Result) -> Void) + /// Returns the passed double, to test serialization and deserialization. + func flutterEchoNullableDouble( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aDouble aDoubleArg: Double?, + completion: @escaping (Result) -> Void) + /// Returns the passed string, to test serialization and deserialization. + func flutterEchoNullableString( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aString aStringArg: String?, + completion: @escaping (Result) -> Void) + /// Returns the passed byte list, to test serialization and deserialization. + func flutterEchoNullableUint8List( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aList aListArg: FlutterStandardTypedData?, + completion: @escaping (Result) -> Void) + /// Returns the passed list, to test serialization and deserialization. + func flutterEchoNullableList( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aList aListArg: [Any?]?, + completion: @escaping (Result<[Any?]?, ProxyApiTestsError>) -> Void) + /// Returns the passed map, to test serialization and deserialization. + func flutterEchoNullableMap( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aMap aMapArg: [String?: Any?]?, + completion: @escaping (Result<[String?: Any?]?, ProxyApiTestsError>) -> Void) + /// Returns the passed enum to test serialization and deserialization. + func flutterEchoNullableEnum( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, anEnum anEnumArg: ProxyApiTestEnum?, + completion: @escaping (Result) -> Void) + /// Returns the passed ProxyApi to test serialization and deserialization. + func flutterEchoNullableProxyApi( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, + aProxyApi aProxyApiArg: ProxyApiSuperClass?, + completion: @escaping (Result) -> Void) + /// A no-op function taking no arguments and returning no value, to sanity + /// test basic asynchronous calling. + func flutterNoopAsync( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, + completion: @escaping (Result) -> Void) + /// Returns the passed in generic Object asynchronously. + func flutterEchoAsyncString( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aString aStringArg: String, + completion: @escaping (Result) -> Void) +} + +final class PigeonApiProxyApiTestClass: PigeonApiProtocolProxyApiTestClass { + unowned let pigeonRegistrar: ProxyApiTestsPigeonProxyApiRegistrar + let pigeonDelegate: PigeonApiDelegateProxyApiTestClass + ///An implementation of [ProxyApiSuperClass] used to access callback methods + var pigeonApiProxyApiSuperClass: PigeonApiProxyApiSuperClass { + return pigeonRegistrar.apiDelegate.pigeonApiProxyApiSuperClass(pigeonRegistrar) + } + + ///An implementation of [ProxyApiInterface] used to access callback methods + var pigeonApiProxyApiInterface: PigeonApiProxyApiInterface { + return pigeonRegistrar.apiDelegate.pigeonApiProxyApiInterface(pigeonRegistrar) + } + + init( + pigeonRegistrar: ProxyApiTestsPigeonProxyApiRegistrar, + delegate: PigeonApiDelegateProxyApiTestClass + ) { + self.pigeonRegistrar = pigeonRegistrar + self.pigeonDelegate = delegate + } + static func setUpMessageHandlers( + binaryMessenger: FlutterBinaryMessenger, api: PigeonApiProxyApiTestClass? + ) { + let codec: FlutterStandardMessageCodec = + api != nil + ? FlutterStandardMessageCodec( + readerWriter: ProxyApiTestsPigeonInternalProxyApiCodecReaderWriter( + pigeonRegistrar: api!.pigeonRegistrar)) + : FlutterStandardMessageCodec.sharedInstance() + let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.pigeon_defaultConstructor", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + pigeonDefaultConstructorChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonIdentifierArg = args[0] as! Int64 + let aBoolArg = args[1] as! Bool + let anIntArg = args[2] as! Int64 + let aDoubleArg = args[3] as! Double + let aStringArg = args[4] as! String + let aUint8ListArg = args[5] as! FlutterStandardTypedData + let aListArg = args[6] as! [Any?] + let aMapArg = args[7] as! [String?: Any?] + let anEnumArg = args[8] as! ProxyApiTestEnum + let aProxyApiArg = args[9] as! ProxyApiSuperClass + let aNullableBoolArg: Bool? = nilOrValue(args[10]) + let aNullableIntArg: Int64? = nilOrValue(args[11]) + let aNullableDoubleArg: Double? = nilOrValue(args[12]) + let aNullableStringArg: String? = nilOrValue(args[13]) + let aNullableUint8ListArg: FlutterStandardTypedData? = nilOrValue(args[14]) + let aNullableListArg: [Any?]? = nilOrValue(args[15]) + let aNullableMapArg: [String?: Any?]? = nilOrValue(args[16]) + let aNullableEnumArg: ProxyApiTestEnum? = nilOrValue(args[17]) + let aNullableProxyApiArg: ProxyApiSuperClass? = nilOrValue(args[18]) + let boolParamArg = args[19] as! Bool + let intParamArg = args[20] as! Int64 + let doubleParamArg = args[21] as! Double + let stringParamArg = args[22] as! String + let aUint8ListParamArg = args[23] as! FlutterStandardTypedData + let listParamArg = args[24] as! [Any?] + let mapParamArg = args[25] as! [String?: Any?] + let enumParamArg = args[26] as! ProxyApiTestEnum + let proxyApiParamArg = args[27] as! ProxyApiSuperClass + let nullableBoolParamArg: Bool? = nilOrValue(args[28]) + let nullableIntParamArg: Int64? = nilOrValue(args[29]) + let nullableDoubleParamArg: Double? = nilOrValue(args[30]) + let nullableStringParamArg: String? = nilOrValue(args[31]) + let nullableUint8ListParamArg: FlutterStandardTypedData? = nilOrValue(args[32]) + let nullableListParamArg: [Any?]? = nilOrValue(args[33]) + let nullableMapParamArg: [String?: Any?]? = nilOrValue(args[34]) + let nullableEnumParamArg: ProxyApiTestEnum? = nilOrValue(args[35]) + let nullableProxyApiParamArg: ProxyApiSuperClass? = nilOrValue(args[36]) + do { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + try api.pigeonDelegate.pigeonDefaultConstructor( + pigeonApi: api, aBool: aBoolArg, anInt: anIntArg, aDouble: aDoubleArg, + aString: aStringArg, aUint8List: aUint8ListArg, aList: aListArg, aMap: aMapArg, + anEnum: anEnumArg, aProxyApi: aProxyApiArg, aNullableBool: aNullableBoolArg, + aNullableInt: aNullableIntArg, aNullableDouble: aNullableDoubleArg, + aNullableString: aNullableStringArg, aNullableUint8List: aNullableUint8ListArg, + aNullableList: aNullableListArg, aNullableMap: aNullableMapArg, + aNullableEnum: aNullableEnumArg, aNullableProxyApi: aNullableProxyApiArg, + boolParam: boolParamArg, intParam: intParamArg, doubleParam: doubleParamArg, + stringParam: stringParamArg, aUint8ListParam: aUint8ListParamArg, + listParam: listParamArg, mapParam: mapParamArg, enumParam: enumParamArg, + proxyApiParam: proxyApiParamArg, nullableBoolParam: nullableBoolParamArg, + nullableIntParam: nullableIntParamArg, nullableDoubleParam: nullableDoubleParamArg, + nullableStringParam: nullableStringParamArg, + nullableUint8ListParam: nullableUint8ListParamArg, + nullableListParam: nullableListParamArg, nullableMapParam: nullableMapParamArg, + nullableEnumParam: nullableEnumParamArg, + nullableProxyApiParam: nullableProxyApiParamArg), + withIdentifier: pigeonIdentifierArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + pigeonDefaultConstructorChannel.setMessageHandler(nil) + } + let attachedFieldChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.attachedField", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + attachedFieldChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let pigeonIdentifierArg = args[1] as! Int64 + do { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + try api.pigeonDelegate.attachedField(pigeonApi: api, pigeonInstance: pigeonInstanceArg), + withIdentifier: pigeonIdentifierArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + attachedFieldChannel.setMessageHandler(nil) + } + let staticAttachedFieldChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.staticAttachedField", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + staticAttachedFieldChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonIdentifierArg = args[0] as! Int64 + do { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + try api.pigeonDelegate.staticAttachedField(pigeonApi: api), + withIdentifier: pigeonIdentifierArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + staticAttachedFieldChannel.setMessageHandler(nil) + } + let noopChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.noop", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + noopChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + do { + try api.pigeonDelegate.noop(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + noopChannel.setMessageHandler(nil) + } + let throwErrorChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.throwError", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + throwErrorChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + do { + let result = try api.pigeonDelegate.throwError( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + throwErrorChannel.setMessageHandler(nil) + } + let throwErrorFromVoidChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.throwErrorFromVoid", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + throwErrorFromVoidChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + do { + try api.pigeonDelegate.throwErrorFromVoid( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + throwErrorFromVoidChannel.setMessageHandler(nil) + } + let throwFlutterErrorChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.throwFlutterError", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + throwFlutterErrorChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + do { + let result = try api.pigeonDelegate.throwFlutterError( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + throwFlutterErrorChannel.setMessageHandler(nil) + } + let echoIntChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoInt", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoIntChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let anIntArg = args[1] as! Int64 + do { + let result = try api.pigeonDelegate.echoInt( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, anInt: anIntArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoIntChannel.setMessageHandler(nil) + } + let echoDoubleChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoDouble", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoDoubleChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aDoubleArg = args[1] as! Double + do { + let result = try api.pigeonDelegate.echoDouble( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aDouble: aDoubleArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoDoubleChannel.setMessageHandler(nil) + } + let echoBoolChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoBool", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoBoolChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aBoolArg = args[1] as! Bool + do { + let result = try api.pigeonDelegate.echoBool( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aBool: aBoolArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoBoolChannel.setMessageHandler(nil) + } + let echoStringChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoString", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoStringChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aStringArg = args[1] as! String + do { + let result = try api.pigeonDelegate.echoString( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aString: aStringArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoStringChannel.setMessageHandler(nil) + } + let echoUint8ListChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoUint8List", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoUint8ListChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aUint8ListArg = args[1] as! FlutterStandardTypedData + do { + let result = try api.pigeonDelegate.echoUint8List( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aUint8List: aUint8ListArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoUint8ListChannel.setMessageHandler(nil) + } + let echoObjectChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoObject", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoObjectChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let anObjectArg = args[1]! + do { + let result = try api.pigeonDelegate.echoObject( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, anObject: anObjectArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoObjectChannel.setMessageHandler(nil) + } + let echoListChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoList", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoListChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aListArg = args[1] as! [Any?] + do { + let result = try api.pigeonDelegate.echoList( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aList: aListArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoListChannel.setMessageHandler(nil) + } + let echoProxyApiListChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoProxyApiList", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoProxyApiListChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aListArg = args[1] as! [ProxyApiTestClass] + do { + let result = try api.pigeonDelegate.echoProxyApiList( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aList: aListArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoProxyApiListChannel.setMessageHandler(nil) + } + let echoMapChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoMap", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aMapArg = args[1] as! [String?: Any?] + do { + let result = try api.pigeonDelegate.echoMap( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aMap: aMapArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoMapChannel.setMessageHandler(nil) + } + let echoProxyApiMapChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoProxyApiMap", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoProxyApiMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aMapArg = args[1] as! [String: ProxyApiTestClass] + do { + let result = try api.pigeonDelegate.echoProxyApiMap( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aMap: aMapArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoProxyApiMapChannel.setMessageHandler(nil) + } + let echoEnumChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoEnum", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoEnumChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let anEnumArg = args[1] as! ProxyApiTestEnum + do { + let result = try api.pigeonDelegate.echoEnum( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, anEnum: anEnumArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoEnumChannel.setMessageHandler(nil) + } + let echoProxyApiChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoProxyApi", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoProxyApiChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aProxyApiArg = args[1] as! ProxyApiSuperClass + do { + let result = try api.pigeonDelegate.echoProxyApi( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aProxyApi: aProxyApiArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoProxyApiChannel.setMessageHandler(nil) + } + let echoNullableIntChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableInt", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoNullableIntChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aNullableIntArg: Int64? = nilOrValue(args[1]) + do { + let result = try api.pigeonDelegate.echoNullableInt( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aNullableInt: aNullableIntArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoNullableIntChannel.setMessageHandler(nil) + } + let echoNullableDoubleChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableDouble", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoNullableDoubleChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aNullableDoubleArg: Double? = nilOrValue(args[1]) + do { + let result = try api.pigeonDelegate.echoNullableDouble( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aNullableDouble: aNullableDoubleArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoNullableDoubleChannel.setMessageHandler(nil) + } + let echoNullableBoolChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableBool", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoNullableBoolChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aNullableBoolArg: Bool? = nilOrValue(args[1]) + do { + let result = try api.pigeonDelegate.echoNullableBool( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aNullableBool: aNullableBoolArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoNullableBoolChannel.setMessageHandler(nil) + } + let echoNullableStringChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableString", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoNullableStringChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aNullableStringArg: String? = nilOrValue(args[1]) + do { + let result = try api.pigeonDelegate.echoNullableString( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aNullableString: aNullableStringArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoNullableStringChannel.setMessageHandler(nil) + } + let echoNullableUint8ListChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableUint8List", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoNullableUint8ListChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aNullableUint8ListArg: FlutterStandardTypedData? = nilOrValue(args[1]) + do { + let result = try api.pigeonDelegate.echoNullableUint8List( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, + aNullableUint8List: aNullableUint8ListArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoNullableUint8ListChannel.setMessageHandler(nil) + } + let echoNullableObjectChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableObject", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoNullableObjectChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aNullableObjectArg: Any? = args[1] + do { + let result = try api.pigeonDelegate.echoNullableObject( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aNullableObject: aNullableObjectArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoNullableObjectChannel.setMessageHandler(nil) + } + let echoNullableListChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableList", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoNullableListChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aNullableListArg: [Any?]? = nilOrValue(args[1]) + do { + let result = try api.pigeonDelegate.echoNullableList( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aNullableList: aNullableListArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoNullableListChannel.setMessageHandler(nil) + } + let echoNullableMapChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableMap", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoNullableMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aNullableMapArg: [String?: Any?]? = nilOrValue(args[1]) + do { + let result = try api.pigeonDelegate.echoNullableMap( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aNullableMap: aNullableMapArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoNullableMapChannel.setMessageHandler(nil) + } + let echoNullableEnumChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableEnum", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoNullableEnumChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aNullableEnumArg: ProxyApiTestEnum? = nilOrValue(args[1]) + do { + let result = try api.pigeonDelegate.echoNullableEnum( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aNullableEnum: aNullableEnumArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoNullableEnumChannel.setMessageHandler(nil) + } + let echoNullableProxyApiChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableProxyApi", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoNullableProxyApiChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aNullableProxyApiArg: ProxyApiSuperClass? = nilOrValue(args[1]) + do { + let result = try api.pigeonDelegate.echoNullableProxyApi( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, + aNullableProxyApi: aNullableProxyApiArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoNullableProxyApiChannel.setMessageHandler(nil) + } + let noopAsyncChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.noopAsync", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + noopAsyncChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + api.pigeonDelegate.noopAsync(pigeonApi: api, pigeonInstance: pigeonInstanceArg) { result in + switch result { + case .success: + reply(wrapResult(nil)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + noopAsyncChannel.setMessageHandler(nil) + } + let echoAsyncIntChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncInt", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoAsyncIntChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let anIntArg = args[1] as! Int64 + api.pigeonDelegate.echoAsyncInt( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, anInt: anIntArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + echoAsyncIntChannel.setMessageHandler(nil) + } + let echoAsyncDoubleChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncDouble", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoAsyncDoubleChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aDoubleArg = args[1] as! Double + api.pigeonDelegate.echoAsyncDouble( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aDouble: aDoubleArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + echoAsyncDoubleChannel.setMessageHandler(nil) + } + let echoAsyncBoolChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncBool", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoAsyncBoolChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aBoolArg = args[1] as! Bool + api.pigeonDelegate.echoAsyncBool( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aBool: aBoolArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + echoAsyncBoolChannel.setMessageHandler(nil) + } + let echoAsyncStringChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncString", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoAsyncStringChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aStringArg = args[1] as! String + api.pigeonDelegate.echoAsyncString( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aString: aStringArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + echoAsyncStringChannel.setMessageHandler(nil) + } + let echoAsyncUint8ListChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncUint8List", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoAsyncUint8ListChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aUint8ListArg = args[1] as! FlutterStandardTypedData + api.pigeonDelegate.echoAsyncUint8List( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aUint8List: aUint8ListArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + echoAsyncUint8ListChannel.setMessageHandler(nil) + } + let echoAsyncObjectChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncObject", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoAsyncObjectChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let anObjectArg = args[1]! + api.pigeonDelegate.echoAsyncObject( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, anObject: anObjectArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + echoAsyncObjectChannel.setMessageHandler(nil) + } + let echoAsyncListChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncList", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoAsyncListChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aListArg = args[1] as! [Any?] + api.pigeonDelegate.echoAsyncList( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aList: aListArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + echoAsyncListChannel.setMessageHandler(nil) + } + let echoAsyncMapChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncMap", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoAsyncMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aMapArg = args[1] as! [String?: Any?] + api.pigeonDelegate.echoAsyncMap( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aMap: aMapArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + echoAsyncMapChannel.setMessageHandler(nil) + } + let echoAsyncEnumChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncEnum", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoAsyncEnumChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let anEnumArg = args[1] as! ProxyApiTestEnum + api.pigeonDelegate.echoAsyncEnum( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, anEnum: anEnumArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + echoAsyncEnumChannel.setMessageHandler(nil) + } + let throwAsyncErrorChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.throwAsyncError", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + throwAsyncErrorChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + api.pigeonDelegate.throwAsyncError(pigeonApi: api, pigeonInstance: pigeonInstanceArg) { + result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + throwAsyncErrorChannel.setMessageHandler(nil) + } + let throwAsyncErrorFromVoidChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.throwAsyncErrorFromVoid", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + throwAsyncErrorFromVoidChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + api.pigeonDelegate.throwAsyncErrorFromVoid( + pigeonApi: api, pigeonInstance: pigeonInstanceArg + ) { result in + switch result { + case .success: + reply(wrapResult(nil)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + throwAsyncErrorFromVoidChannel.setMessageHandler(nil) + } + let throwAsyncFlutterErrorChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.throwAsyncFlutterError", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + throwAsyncFlutterErrorChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + api.pigeonDelegate.throwAsyncFlutterError(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + throwAsyncFlutterErrorChannel.setMessageHandler(nil) + } + let echoAsyncNullableIntChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableInt", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoAsyncNullableIntChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let anIntArg: Int64? = nilOrValue(args[1]) + api.pigeonDelegate.echoAsyncNullableInt( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, anInt: anIntArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + echoAsyncNullableIntChannel.setMessageHandler(nil) + } + let echoAsyncNullableDoubleChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableDouble", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoAsyncNullableDoubleChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aDoubleArg: Double? = nilOrValue(args[1]) + api.pigeonDelegate.echoAsyncNullableDouble( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aDouble: aDoubleArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + echoAsyncNullableDoubleChannel.setMessageHandler(nil) + } + let echoAsyncNullableBoolChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableBool", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoAsyncNullableBoolChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aBoolArg: Bool? = nilOrValue(args[1]) + api.pigeonDelegate.echoAsyncNullableBool( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aBool: aBoolArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + echoAsyncNullableBoolChannel.setMessageHandler(nil) + } + let echoAsyncNullableStringChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableString", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoAsyncNullableStringChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aStringArg: String? = nilOrValue(args[1]) + api.pigeonDelegate.echoAsyncNullableString( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aString: aStringArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + echoAsyncNullableStringChannel.setMessageHandler(nil) + } + let echoAsyncNullableUint8ListChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableUint8List", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoAsyncNullableUint8ListChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aUint8ListArg: FlutterStandardTypedData? = nilOrValue(args[1]) + api.pigeonDelegate.echoAsyncNullableUint8List( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aUint8List: aUint8ListArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + echoAsyncNullableUint8ListChannel.setMessageHandler(nil) + } + let echoAsyncNullableObjectChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableObject", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoAsyncNullableObjectChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let anObjectArg: Any? = args[1] + api.pigeonDelegate.echoAsyncNullableObject( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, anObject: anObjectArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + echoAsyncNullableObjectChannel.setMessageHandler(nil) + } + let echoAsyncNullableListChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableList", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoAsyncNullableListChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aListArg: [Any?]? = nilOrValue(args[1]) + api.pigeonDelegate.echoAsyncNullableList( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aList: aListArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + echoAsyncNullableListChannel.setMessageHandler(nil) + } + let echoAsyncNullableMapChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableMap", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoAsyncNullableMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aMapArg: [String?: Any?]? = nilOrValue(args[1]) + api.pigeonDelegate.echoAsyncNullableMap( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aMap: aMapArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + echoAsyncNullableMapChannel.setMessageHandler(nil) + } + let echoAsyncNullableEnumChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableEnum", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoAsyncNullableEnumChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let anEnumArg: ProxyApiTestEnum? = nilOrValue(args[1]) + api.pigeonDelegate.echoAsyncNullableEnum( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, anEnum: anEnumArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + echoAsyncNullableEnumChannel.setMessageHandler(nil) + } + let staticNoopChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.staticNoop", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + staticNoopChannel.setMessageHandler { _, reply in + do { + try api.pigeonDelegate.staticNoop(pigeonApi: api) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + staticNoopChannel.setMessageHandler(nil) + } + let echoStaticStringChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoStaticString", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoStaticStringChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let aStringArg = args[0] as! String + do { + let result = try api.pigeonDelegate.echoStaticString(pigeonApi: api, aString: aStringArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoStaticStringChannel.setMessageHandler(nil) + } + let staticAsyncNoopChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.staticAsyncNoop", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + staticAsyncNoopChannel.setMessageHandler { _, reply in + api.pigeonDelegate.staticAsyncNoop(pigeonApi: api) { result in + switch result { + case .success: + reply(wrapResult(nil)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + staticAsyncNoopChannel.setMessageHandler(nil) + } + let callFlutterNoopChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterNoop", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterNoopChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + api.pigeonDelegate.callFlutterNoop(pigeonApi: api, pigeonInstance: pigeonInstanceArg) { + result in + switch result { + case .success: + reply(wrapResult(nil)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterNoopChannel.setMessageHandler(nil) + } + let callFlutterThrowErrorChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterThrowError", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterThrowErrorChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + api.pigeonDelegate.callFlutterThrowError(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterThrowErrorChannel.setMessageHandler(nil) + } + let callFlutterThrowErrorFromVoidChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterThrowErrorFromVoid", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterThrowErrorFromVoidChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + api.pigeonDelegate.callFlutterThrowErrorFromVoid( + pigeonApi: api, pigeonInstance: pigeonInstanceArg + ) { result in + switch result { + case .success: + reply(wrapResult(nil)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterThrowErrorFromVoidChannel.setMessageHandler(nil) + } + let callFlutterEchoBoolChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoBool", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoBoolChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aBoolArg = args[1] as! Bool + api.pigeonDelegate.callFlutterEchoBool( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aBool: aBoolArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoBoolChannel.setMessageHandler(nil) + } + let callFlutterEchoIntChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoInt", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoIntChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let anIntArg = args[1] as! Int64 + api.pigeonDelegate.callFlutterEchoInt( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, anInt: anIntArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoIntChannel.setMessageHandler(nil) + } + let callFlutterEchoDoubleChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoDouble", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoDoubleChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aDoubleArg = args[1] as! Double + api.pigeonDelegate.callFlutterEchoDouble( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aDouble: aDoubleArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoDoubleChannel.setMessageHandler(nil) + } + let callFlutterEchoStringChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoString", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoStringChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aStringArg = args[1] as! String + api.pigeonDelegate.callFlutterEchoString( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aString: aStringArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoStringChannel.setMessageHandler(nil) + } + let callFlutterEchoUint8ListChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoUint8List", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoUint8ListChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aUint8ListArg = args[1] as! FlutterStandardTypedData + api.pigeonDelegate.callFlutterEchoUint8List( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aUint8List: aUint8ListArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoUint8ListChannel.setMessageHandler(nil) + } + let callFlutterEchoListChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoList", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoListChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aListArg = args[1] as! [Any?] + api.pigeonDelegate.callFlutterEchoList( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aList: aListArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoListChannel.setMessageHandler(nil) + } + let callFlutterEchoProxyApiListChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoProxyApiList", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoProxyApiListChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aListArg = args[1] as! [ProxyApiTestClass?] + api.pigeonDelegate.callFlutterEchoProxyApiList( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aList: aListArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoProxyApiListChannel.setMessageHandler(nil) + } + let callFlutterEchoMapChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoMap", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aMapArg = args[1] as! [String?: Any?] + api.pigeonDelegate.callFlutterEchoMap( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aMap: aMapArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoMapChannel.setMessageHandler(nil) + } + let callFlutterEchoProxyApiMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoProxyApiMap", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoProxyApiMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aMapArg = args[1] as! [String?: ProxyApiTestClass?] + api.pigeonDelegate.callFlutterEchoProxyApiMap( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aMap: aMapArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoProxyApiMapChannel.setMessageHandler(nil) + } + let callFlutterEchoEnumChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoEnum", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoEnumChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let anEnumArg = args[1] as! ProxyApiTestEnum + api.pigeonDelegate.callFlutterEchoEnum( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, anEnum: anEnumArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoEnumChannel.setMessageHandler(nil) + } + let callFlutterEchoProxyApiChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoProxyApi", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoProxyApiChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aProxyApiArg = args[1] as! ProxyApiSuperClass + api.pigeonDelegate.callFlutterEchoProxyApi( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aProxyApi: aProxyApiArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoProxyApiChannel.setMessageHandler(nil) + } + let callFlutterEchoNullableBoolChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableBool", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoNullableBoolChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aBoolArg: Bool? = nilOrValue(args[1]) + api.pigeonDelegate.callFlutterEchoNullableBool( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aBool: aBoolArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoNullableBoolChannel.setMessageHandler(nil) + } + let callFlutterEchoNullableIntChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableInt", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoNullableIntChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let anIntArg: Int64? = nilOrValue(args[1]) + api.pigeonDelegate.callFlutterEchoNullableInt( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, anInt: anIntArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoNullableIntChannel.setMessageHandler(nil) + } + let callFlutterEchoNullableDoubleChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableDouble", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoNullableDoubleChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aDoubleArg: Double? = nilOrValue(args[1]) + api.pigeonDelegate.callFlutterEchoNullableDouble( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aDouble: aDoubleArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoNullableDoubleChannel.setMessageHandler(nil) + } + let callFlutterEchoNullableStringChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableString", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoNullableStringChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aStringArg: String? = nilOrValue(args[1]) + api.pigeonDelegate.callFlutterEchoNullableString( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aString: aStringArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoNullableStringChannel.setMessageHandler(nil) + } + let callFlutterEchoNullableUint8ListChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableUint8List", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoNullableUint8ListChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aUint8ListArg: FlutterStandardTypedData? = nilOrValue(args[1]) + api.pigeonDelegate.callFlutterEchoNullableUint8List( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aUint8List: aUint8ListArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoNullableUint8ListChannel.setMessageHandler(nil) + } + let callFlutterEchoNullableListChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableList", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoNullableListChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aListArg: [Any?]? = nilOrValue(args[1]) + api.pigeonDelegate.callFlutterEchoNullableList( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aList: aListArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoNullableListChannel.setMessageHandler(nil) + } + let callFlutterEchoNullableMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableMap", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoNullableMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aMapArg: [String?: Any?]? = nilOrValue(args[1]) + api.pigeonDelegate.callFlutterEchoNullableMap( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aMap: aMapArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoNullableMapChannel.setMessageHandler(nil) + } + let callFlutterEchoNullableEnumChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableEnum", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoNullableEnumChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let anEnumArg: ProxyApiTestEnum? = nilOrValue(args[1]) + api.pigeonDelegate.callFlutterEchoNullableEnum( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, anEnum: anEnumArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoNullableEnumChannel.setMessageHandler(nil) + } + let callFlutterEchoNullableProxyApiChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableProxyApi", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoNullableProxyApiChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aProxyApiArg: ProxyApiSuperClass? = nilOrValue(args[1]) + api.pigeonDelegate.callFlutterEchoNullableProxyApi( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aProxyApi: aProxyApiArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoNullableProxyApiChannel.setMessageHandler(nil) + } + let callFlutterNoopAsyncChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterNoopAsync", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterNoopAsyncChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + api.pigeonDelegate.callFlutterNoopAsync(pigeonApi: api, pigeonInstance: pigeonInstanceArg) { + result in + switch result { + case .success: + reply(wrapResult(nil)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterNoopAsyncChannel.setMessageHandler(nil) + } + let callFlutterEchoAsyncStringChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoAsyncString", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoAsyncStringChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aStringArg = args[1] as! String + api.pigeonDelegate.callFlutterEchoAsyncString( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aString: aStringArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoAsyncStringChannel.setMessageHandler(nil) + } + } + + ///Creates a Dart instance of ProxyApiTestClass and attaches it to [pigeonInstance]. + func pigeonNewInstance( + pigeonInstance: ProxyApiTestClass, + completion: @escaping (Result) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + ProxyApiTestsError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { + completion(.success(Void())) + return + } + let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( + pigeonInstance as AnyObject) + let aBoolArg = try! pigeonDelegate.aBool(pigeonApi: self, pigeonInstance: pigeonInstance) + let anIntArg = try! pigeonDelegate.anInt(pigeonApi: self, pigeonInstance: pigeonInstance) + let aDoubleArg = try! pigeonDelegate.aDouble(pigeonApi: self, pigeonInstance: pigeonInstance) + let aStringArg = try! pigeonDelegate.aString(pigeonApi: self, pigeonInstance: pigeonInstance) + let aUint8ListArg = try! pigeonDelegate.aUint8List( + pigeonApi: self, pigeonInstance: pigeonInstance) + let aListArg = try! pigeonDelegate.aList(pigeonApi: self, pigeonInstance: pigeonInstance) + let aMapArg = try! pigeonDelegate.aMap(pigeonApi: self, pigeonInstance: pigeonInstance) + let anEnumArg = try! pigeonDelegate.anEnum(pigeonApi: self, pigeonInstance: pigeonInstance) + let aProxyApiArg = try! pigeonDelegate.aProxyApi( + pigeonApi: self, pigeonInstance: pigeonInstance) + let aNullableBoolArg = try! pigeonDelegate.aNullableBool( + pigeonApi: self, pigeonInstance: pigeonInstance) + let aNullableIntArg = try! pigeonDelegate.aNullableInt( + pigeonApi: self, pigeonInstance: pigeonInstance) + let aNullableDoubleArg = try! pigeonDelegate.aNullableDouble( + pigeonApi: self, pigeonInstance: pigeonInstance) + let aNullableStringArg = try! pigeonDelegate.aNullableString( + pigeonApi: self, pigeonInstance: pigeonInstance) + let aNullableUint8ListArg = try! pigeonDelegate.aNullableUint8List( + pigeonApi: self, pigeonInstance: pigeonInstance) + let aNullableListArg = try! pigeonDelegate.aNullableList( + pigeonApi: self, pigeonInstance: pigeonInstance) + let aNullableMapArg = try! pigeonDelegate.aNullableMap( + pigeonApi: self, pigeonInstance: pigeonInstance) + let aNullableEnumArg = try! pigeonDelegate.aNullableEnum( + pigeonApi: self, pigeonInstance: pigeonInstance) + let aNullableProxyApiArg = try! pigeonDelegate.aNullableProxyApi( + pigeonApi: self, pigeonInstance: pigeonInstance) + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.pigeon_newInstance" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage( + [ + pigeonIdentifierArg, aBoolArg, anIntArg, aDoubleArg, aStringArg, aUint8ListArg, aListArg, + aMapArg, anEnumArg, aProxyApiArg, aNullableBoolArg, aNullableIntArg, aNullableDoubleArg, + aNullableStringArg, aNullableUint8ListArg, aNullableListArg, aNullableMapArg, + aNullableEnumArg, aNullableProxyApiArg, + ] as [Any?] + ) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(ProxyApiTestsError(code: code, message: message, details: details))) + } else { + completion(.success(Void())) + } + } + } + /// A no-op function taking no arguments and returning no value, to sanity + /// test basic calling. + func flutterNoop( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, + completion: @escaping (Result) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + ProxyApiTestsError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterNoop" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(ProxyApiTestsError(code: code, message: message, details: details))) + } else { + completion(.success(Void())) + } + } + } + + /// Responds with an error from an async function returning a value. + func flutterThrowError( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, + completion: @escaping (Result) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + ProxyApiTestsError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterThrowError" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(ProxyApiTestsError(code: code, message: message, details: details))) + } else { + let result: Any? = listResponse[0] + completion(.success(result)) + } + } + } + + /// Responds with an error from an async void function. + func flutterThrowErrorFromVoid( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, + completion: @escaping (Result) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + ProxyApiTestsError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterThrowErrorFromVoid" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(ProxyApiTestsError(code: code, message: message, details: details))) + } else { + completion(.success(Void())) + } + } + } + + /// Returns the passed boolean, to test serialization and deserialization. + func flutterEchoBool( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aBool aBoolArg: Bool, + completion: @escaping (Result) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + ProxyApiTestsError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoBool" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, aBoolArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(ProxyApiTestsError(code: code, message: message, details: details))) + } else if listResponse[0] == nil { + completion( + .failure( + ProxyApiTestsError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) + } else { + let result = listResponse[0] as! Bool + completion(.success(result)) + } + } + } + + /// Returns the passed int, to test serialization and deserialization. + func flutterEchoInt( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, anInt anIntArg: Int64, + completion: @escaping (Result) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + ProxyApiTestsError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoInt" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, anIntArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(ProxyApiTestsError(code: code, message: message, details: details))) + } else if listResponse[0] == nil { + completion( + .failure( + ProxyApiTestsError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) + } else { + let result = listResponse[0] as! Int64 + completion(.success(result)) + } + } + } + + /// Returns the passed double, to test serialization and deserialization. + func flutterEchoDouble( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aDouble aDoubleArg: Double, + completion: @escaping (Result) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + ProxyApiTestsError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoDouble" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, aDoubleArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(ProxyApiTestsError(code: code, message: message, details: details))) + } else if listResponse[0] == nil { + completion( + .failure( + ProxyApiTestsError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) + } else { + let result = listResponse[0] as! Double + completion(.success(result)) + } + } + } + + /// Returns the passed string, to test serialization and deserialization. + func flutterEchoString( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aString aStringArg: String, + completion: @escaping (Result) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + ProxyApiTestsError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoString" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, aStringArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(ProxyApiTestsError(code: code, message: message, details: details))) + } else if listResponse[0] == nil { + completion( + .failure( + ProxyApiTestsError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) + } else { + let result = listResponse[0] as! String + completion(.success(result)) + } + } + } + + /// Returns the passed byte list, to test serialization and deserialization. + func flutterEchoUint8List( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aList aListArg: FlutterStandardTypedData, + completion: @escaping (Result) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + ProxyApiTestsError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoUint8List" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, aListArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(ProxyApiTestsError(code: code, message: message, details: details))) + } else if listResponse[0] == nil { + completion( + .failure( + ProxyApiTestsError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) + } else { + let result = listResponse[0] as! FlutterStandardTypedData + completion(.success(result)) + } + } + } + + /// Returns the passed list, to test serialization and deserialization. + func flutterEchoList( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aList aListArg: [Any?], + completion: @escaping (Result<[Any?], ProxyApiTestsError>) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + ProxyApiTestsError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoList" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, aListArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(ProxyApiTestsError(code: code, message: message, details: details))) + } else if listResponse[0] == nil { + completion( + .failure( + ProxyApiTestsError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) + } else { + let result = listResponse[0] as! [Any?] + completion(.success(result)) + } + } + } + + /// Returns the passed list with ProxyApis, to test serialization and + /// deserialization. + func flutterEchoProxyApiList( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aList aListArg: [ProxyApiTestClass?], + completion: @escaping (Result<[ProxyApiTestClass?], ProxyApiTestsError>) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + ProxyApiTestsError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoProxyApiList" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, aListArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(ProxyApiTestsError(code: code, message: message, details: details))) + } else if listResponse[0] == nil { + completion( + .failure( + ProxyApiTestsError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) + } else { + let result = listResponse[0] as! [ProxyApiTestClass?] + completion(.success(result)) + } + } + } + + /// Returns the passed map, to test serialization and deserialization. + func flutterEchoMap( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aMap aMapArg: [String?: Any?], + completion: @escaping (Result<[String?: Any?], ProxyApiTestsError>) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + ProxyApiTestsError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoMap" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, aMapArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(ProxyApiTestsError(code: code, message: message, details: details))) + } else if listResponse[0] == nil { + completion( + .failure( + ProxyApiTestsError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) + } else { + let result = listResponse[0] as! [String?: Any?] + completion(.success(result)) + } + } + } + + /// Returns the passed map with ProxyApis, to test serialization and + /// deserialization. + func flutterEchoProxyApiMap( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, + aMap aMapArg: [String?: ProxyApiTestClass?], + completion: @escaping (Result<[String?: ProxyApiTestClass?], ProxyApiTestsError>) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + ProxyApiTestsError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoProxyApiMap" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, aMapArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(ProxyApiTestsError(code: code, message: message, details: details))) + } else if listResponse[0] == nil { + completion( + .failure( + ProxyApiTestsError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) + } else { + let result = listResponse[0] as! [String?: ProxyApiTestClass?] + completion(.success(result)) + } + } + } + + /// Returns the passed enum to test serialization and deserialization. + func flutterEchoEnum( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, anEnum anEnumArg: ProxyApiTestEnum, + completion: @escaping (Result) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + ProxyApiTestsError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoEnum" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, anEnumArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(ProxyApiTestsError(code: code, message: message, details: details))) + } else if listResponse[0] == nil { + completion( + .failure( + ProxyApiTestsError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) + } else { + let result = listResponse[0] as! ProxyApiTestEnum + completion(.success(result)) + } + } + } + + /// Returns the passed ProxyApi to test serialization and deserialization. + func flutterEchoProxyApi( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aProxyApi aProxyApiArg: ProxyApiSuperClass, + completion: @escaping (Result) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + ProxyApiTestsError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoProxyApi" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, aProxyApiArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(ProxyApiTestsError(code: code, message: message, details: details))) + } else if listResponse[0] == nil { + completion( + .failure( + ProxyApiTestsError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) + } else { + let result = listResponse[0] as! ProxyApiSuperClass + completion(.success(result)) + } + } + } + + /// Returns the passed boolean, to test serialization and deserialization. + func flutterEchoNullableBool( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aBool aBoolArg: Bool?, + completion: @escaping (Result) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + ProxyApiTestsError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableBool" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, aBoolArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(ProxyApiTestsError(code: code, message: message, details: details))) + } else { + let result: Bool? = nilOrValue(listResponse[0]) + completion(.success(result)) + } + } + } + + /// Returns the passed int, to test serialization and deserialization. + func flutterEchoNullableInt( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, anInt anIntArg: Int64?, + completion: @escaping (Result) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + ProxyApiTestsError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableInt" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, anIntArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(ProxyApiTestsError(code: code, message: message, details: details))) + } else { + let result: Int64? = nilOrValue(listResponse[0]) + completion(.success(result)) + } + } + } + + /// Returns the passed double, to test serialization and deserialization. + func flutterEchoNullableDouble( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aDouble aDoubleArg: Double?, + completion: @escaping (Result) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + ProxyApiTestsError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableDouble" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, aDoubleArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(ProxyApiTestsError(code: code, message: message, details: details))) + } else { + let result: Double? = nilOrValue(listResponse[0]) + completion(.success(result)) + } + } + } + + /// Returns the passed string, to test serialization and deserialization. + func flutterEchoNullableString( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aString aStringArg: String?, + completion: @escaping (Result) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + ProxyApiTestsError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableString" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, aStringArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(ProxyApiTestsError(code: code, message: message, details: details))) + } else { + let result: String? = nilOrValue(listResponse[0]) + completion(.success(result)) + } + } + } + + /// Returns the passed byte list, to test serialization and deserialization. + func flutterEchoNullableUint8List( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aList aListArg: FlutterStandardTypedData?, + completion: @escaping (Result) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + ProxyApiTestsError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableUint8List" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, aListArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(ProxyApiTestsError(code: code, message: message, details: details))) + } else { + let result: FlutterStandardTypedData? = nilOrValue(listResponse[0]) + completion(.success(result)) + } + } + } + + /// Returns the passed list, to test serialization and deserialization. + func flutterEchoNullableList( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aList aListArg: [Any?]?, + completion: @escaping (Result<[Any?]?, ProxyApiTestsError>) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + ProxyApiTestsError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableList" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, aListArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(ProxyApiTestsError(code: code, message: message, details: details))) + } else { + let result: [Any?]? = nilOrValue(listResponse[0]) + completion(.success(result)) + } + } + } + + /// Returns the passed map, to test serialization and deserialization. + func flutterEchoNullableMap( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aMap aMapArg: [String?: Any?]?, + completion: @escaping (Result<[String?: Any?]?, ProxyApiTestsError>) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + ProxyApiTestsError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableMap" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, aMapArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(ProxyApiTestsError(code: code, message: message, details: details))) + } else { + let result: [String?: Any?]? = nilOrValue(listResponse[0]) + completion(.success(result)) + } + } + } + + /// Returns the passed enum to test serialization and deserialization. + func flutterEchoNullableEnum( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, anEnum anEnumArg: ProxyApiTestEnum?, + completion: @escaping (Result) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + ProxyApiTestsError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableEnum" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, anEnumArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(ProxyApiTestsError(code: code, message: message, details: details))) + } else { + let result: ProxyApiTestEnum? = nilOrValue(listResponse[0]) + completion(.success(result)) + } + } + } + + /// Returns the passed ProxyApi to test serialization and deserialization. + func flutterEchoNullableProxyApi( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, + aProxyApi aProxyApiArg: ProxyApiSuperClass?, + completion: @escaping (Result) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + ProxyApiTestsError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableProxyApi" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, aProxyApiArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(ProxyApiTestsError(code: code, message: message, details: details))) + } else { + let result: ProxyApiSuperClass? = nilOrValue(listResponse[0]) + completion(.success(result)) + } + } + } + + /// A no-op function taking no arguments and returning no value, to sanity + /// test basic asynchronous calling. + func flutterNoopAsync( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, + completion: @escaping (Result) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + ProxyApiTestsError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterNoopAsync" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(ProxyApiTestsError(code: code, message: message, details: details))) + } else { + completion(.success(Void())) + } + } + } + + /// Returns the passed in generic Object asynchronously. + func flutterEchoAsyncString( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aString aStringArg: String, + completion: @escaping (Result) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + ProxyApiTestsError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoAsyncString" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, aStringArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(ProxyApiTestsError(code: code, message: message, details: details))) + } else if listResponse[0] == nil { + completion( + .failure( + ProxyApiTestsError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) + } else { + let result = listResponse[0] as! String + completion(.success(result)) + } + } + } + +} +protocol PigeonApiDelegateProxyApiSuperClass { + func pigeonDefaultConstructor(pigeonApi: PigeonApiProxyApiSuperClass) throws -> ProxyApiSuperClass + func aSuperMethod(pigeonApi: PigeonApiProxyApiSuperClass, pigeonInstance: ProxyApiSuperClass) + throws +} + +protocol PigeonApiProtocolProxyApiSuperClass { +} + +final class PigeonApiProxyApiSuperClass: PigeonApiProtocolProxyApiSuperClass { + unowned let pigeonRegistrar: ProxyApiTestsPigeonProxyApiRegistrar + let pigeonDelegate: PigeonApiDelegateProxyApiSuperClass + init( + pigeonRegistrar: ProxyApiTestsPigeonProxyApiRegistrar, + delegate: PigeonApiDelegateProxyApiSuperClass + ) { + self.pigeonRegistrar = pigeonRegistrar + self.pigeonDelegate = delegate + } + static func setUpMessageHandlers( + binaryMessenger: FlutterBinaryMessenger, api: PigeonApiProxyApiSuperClass? + ) { + let codec: FlutterStandardMessageCodec = + api != nil + ? FlutterStandardMessageCodec( + readerWriter: ProxyApiTestsPigeonInternalProxyApiCodecReaderWriter( + pigeonRegistrar: api!.pigeonRegistrar)) + : FlutterStandardMessageCodec.sharedInstance() + let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiSuperClass.pigeon_defaultConstructor", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + pigeonDefaultConstructorChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonIdentifierArg = args[0] as! Int64 + do { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api), + withIdentifier: pigeonIdentifierArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + pigeonDefaultConstructorChannel.setMessageHandler(nil) + } + let aSuperMethodChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiSuperClass.aSuperMethod", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + aSuperMethodChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiSuperClass + do { + try api.pigeonDelegate.aSuperMethod(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + aSuperMethodChannel.setMessageHandler(nil) + } + } + + ///Creates a Dart instance of ProxyApiSuperClass and attaches it to [pigeonInstance]. + func pigeonNewInstance( + pigeonInstance: ProxyApiSuperClass, + completion: @escaping (Result) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + ProxyApiTestsError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { + completion(.success(Void())) + return + } + let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( + pigeonInstance as AnyObject) + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiSuperClass.pigeon_newInstance" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonIdentifierArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(ProxyApiTestsError(code: code, message: message, details: details))) + } else { + completion(.success(Void())) + } + } + } +} +open class PigeonApiDelegateProxyApiInterface { +} + +protocol PigeonApiProtocolProxyApiInterface { + func anInterfaceMethod( + pigeonInstance pigeonInstanceArg: ProxyApiInterface, + completion: @escaping (Result) -> Void) +} + +final class PigeonApiProxyApiInterface: PigeonApiProtocolProxyApiInterface { + unowned let pigeonRegistrar: ProxyApiTestsPigeonProxyApiRegistrar + let pigeonDelegate: PigeonApiDelegateProxyApiInterface + init( + pigeonRegistrar: ProxyApiTestsPigeonProxyApiRegistrar, + delegate: PigeonApiDelegateProxyApiInterface + ) { + self.pigeonRegistrar = pigeonRegistrar + self.pigeonDelegate = delegate + } + ///Creates a Dart instance of ProxyApiInterface and attaches it to [pigeonInstance]. + func pigeonNewInstance( + pigeonInstance: ProxyApiInterface, + completion: @escaping (Result) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + ProxyApiTestsError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { + completion(.success(Void())) + return + } + let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( + pigeonInstance as AnyObject) + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiInterface.pigeon_newInstance" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonIdentifierArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(ProxyApiTestsError(code: code, message: message, details: details))) + } else { + completion(.success(Void())) + } + } + } + func anInterfaceMethod( + pigeonInstance pigeonInstanceArg: ProxyApiInterface, + completion: @escaping (Result) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + ProxyApiTestsError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiInterface.anInterfaceMethod" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(ProxyApiTestsError(code: code, message: message, details: details))) + } else { + completion(.success(Void())) + } + } + } + +} +protocol PigeonApiDelegateClassWithApiRequirement { + @available(iOS 15.0.0, macOS 10.0.0, *) + func pigeonDefaultConstructor(pigeonApi: PigeonApiClassWithApiRequirement) throws + -> ClassWithApiRequirement + @available(iOS 15.0.0, macOS 10.0.0, *) + func aMethod(pigeonApi: PigeonApiClassWithApiRequirement, pigeonInstance: ClassWithApiRequirement) + throws +} + +protocol PigeonApiProtocolClassWithApiRequirement { +} + +final class PigeonApiClassWithApiRequirement: PigeonApiProtocolClassWithApiRequirement { + unowned let pigeonRegistrar: ProxyApiTestsPigeonProxyApiRegistrar + let pigeonDelegate: PigeonApiDelegateClassWithApiRequirement + init( + pigeonRegistrar: ProxyApiTestsPigeonProxyApiRegistrar, + delegate: PigeonApiDelegateClassWithApiRequirement + ) { + self.pigeonRegistrar = pigeonRegistrar + self.pigeonDelegate = delegate + } + static func setUpMessageHandlers( + binaryMessenger: FlutterBinaryMessenger, api: PigeonApiClassWithApiRequirement? + ) { + let codec: FlutterStandardMessageCodec = + api != nil + ? FlutterStandardMessageCodec( + readerWriter: ProxyApiTestsPigeonInternalProxyApiCodecReaderWriter( + pigeonRegistrar: api!.pigeonRegistrar)) + : FlutterStandardMessageCodec.sharedInstance() + if #available(iOS 15.0.0, macOS 10.0.0, *) { + let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.ClassWithApiRequirement.pigeon_defaultConstructor", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + pigeonDefaultConstructorChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonIdentifierArg = args[0] as! Int64 + do { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api), + withIdentifier: pigeonIdentifierArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + pigeonDefaultConstructorChannel.setMessageHandler(nil) + } + } else { + let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.ClassWithApiRequirement.pigeon_defaultConstructor", + binaryMessenger: binaryMessenger, codec: codec) + if api != nil { + pigeonDefaultConstructorChannel.setMessageHandler { message, reply in + reply( + wrapError( + FlutterError( + code: "PigeonUnsupportedOperationError", + message: + "Call to pigeonDefaultConstructor requires @available(iOS 15.0.0, macOS 10.0.0, *).", + details: nil + ))) + } + } else { + pigeonDefaultConstructorChannel.setMessageHandler(nil) + } + } + if #available(iOS 15.0.0, macOS 10.0.0, *) { + let aMethodChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ClassWithApiRequirement.aMethod", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + aMethodChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ClassWithApiRequirement + do { + try api.pigeonDelegate.aMethod(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + aMethodChannel.setMessageHandler(nil) + } + } else { + let aMethodChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ClassWithApiRequirement.aMethod", + binaryMessenger: binaryMessenger, codec: codec) + if api != nil { + aMethodChannel.setMessageHandler { message, reply in + reply( + wrapError( + FlutterError( + code: "PigeonUnsupportedOperationError", + message: "Call to aMethod requires @available(iOS 15.0.0, macOS 10.0.0, *).", + details: nil + ))) + } + } else { + aMethodChannel.setMessageHandler(nil) + } + } + } + + ///Creates a Dart instance of ClassWithApiRequirement and attaches it to [pigeonInstance]. + @available(iOS 15.0.0, macOS 10.0.0, *) + func pigeonNewInstance( + pigeonInstance: ClassWithApiRequirement, + completion: @escaping (Result) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + ProxyApiTestsError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { + completion(.success(Void())) + return + } + let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( + pigeonInstance as AnyObject) + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.ClassWithApiRequirement.pigeon_newInstance" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonIdentifierArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(ProxyApiTestsError(code: code, message: message, details: details))) + } else { + completion(.success(Void())) + } + } + } +} diff --git a/packages/pigeon/platform_tests/test_plugin/ios/Classes/TestPlugin.swift b/packages/pigeon/platform_tests/test_plugin/ios/Classes/TestPlugin.swift index be07319c7c0c..b4238de3be91 100644 --- a/packages/pigeon/platform_tests/test_plugin/ios/Classes/TestPlugin.swift +++ b/packages/pigeon/platform_tests/test_plugin/ios/Classes/TestPlugin.swift @@ -12,12 +12,14 @@ public class TestPlugin: NSObject, FlutterPlugin, HostIntegrationCoreApi { var flutterAPI: FlutterIntegrationCoreApi var flutterSmallApiOne: FlutterSmallApi var flutterSmallApiTwo: FlutterSmallApi + var proxyApiRegistrar: ProxyApiTestsPigeonProxyApiRegistrar? public static func register(with registrar: FlutterPluginRegistrar) { let plugin = TestPlugin(binaryMessenger: registrar.messenger()) HostIntegrationCoreApiSetup.setUp(binaryMessenger: registrar.messenger(), api: plugin) TestPluginWithSuffix.register(with: registrar, suffix: "suffixOne") TestPluginWithSuffix.register(with: registrar, suffix: "suffixTwo") + registrar.publish(plugin) } init(binaryMessenger: FlutterBinaryMessenger) { @@ -26,6 +28,14 @@ public class TestPlugin: NSObject, FlutterPlugin, HostIntegrationCoreApi { binaryMessenger: binaryMessenger, messageChannelSuffix: "suffixOne") flutterSmallApiTwo = FlutterSmallApi( binaryMessenger: binaryMessenger, messageChannelSuffix: "suffixTwo") + proxyApiRegistrar = ProxyApiTestsPigeonProxyApiRegistrar( + binaryMessenger: binaryMessenger, apiDelegate: ProxyApiDelegate()) + proxyApiRegistrar!.setUp() + } + + public func detachFromEngine(for registrar: FlutterPluginRegistrar) { + proxyApiRegistrar!.tearDown() + proxyApiRegistrar = nil } // MARK: HostIntegrationCoreApi implementation @@ -87,8 +97,56 @@ public class TestPlugin: NSObject, FlutterPlugin, HostIntegrationCoreApi { return list } - func echo(_ aMap: [String?: Any?]) throws -> [String?: Any?] { - return aMap + func echo(enumList: [AnEnum?]) throws -> [AnEnum?] { + return enumList + } + + func echo(classList: [AllNullableTypes?]) throws -> [AllNullableTypes?] { + return classList + } + + func echoNonNull(enumList: [AnEnum]) throws -> [AnEnum] { + return enumList + } + + func echoNonNull(classList: [AllNullableTypes]) throws -> [AllNullableTypes] { + return classList + } + + func echo(_ map: [AnyHashable?: Any?]) throws -> [AnyHashable?: Any?] { + return map + } + + func echo(stringMap: [String?: String?]) throws -> [String?: String?] { + return stringMap + } + + func echo(intMap: [Int64?: Int64?]) throws -> [Int64?: Int64?] { + return intMap + } + + func echo(enumMap: [AnEnum?: AnEnum?]) throws -> [AnEnum?: AnEnum?] { + return enumMap + } + + func echo(classMap: [Int64?: AllNullableTypes?]) throws -> [Int64?: AllNullableTypes?] { + return classMap + } + + func echoNonNull(stringMap: [String: String]) throws -> [String: String] { + return stringMap + } + + func echoNonNull(intMap: [Int64: Int64]) throws -> [Int64: Int64] { + return intMap + } + + func echoNonNull(enumMap: [AnEnum: AnEnum]) throws -> [AnEnum: AnEnum] { + return enumMap + } + + func echoNonNull(classMap: [Int64: AllNullableTypes]) throws -> [Int64: AllNullableTypes] { + return classMap } func echo(_ wrapper: AllClassesWrapper) throws -> AllClassesWrapper { @@ -108,7 +166,9 @@ public class TestPlugin: NSObject, FlutterPlugin, HostIntegrationCoreApi { } func createNestedObject(with nullableString: String?) -> AllClassesWrapper { - return AllClassesWrapper(allNullableTypes: AllNullableTypes(aNullableString: nullableString)) + return AllClassesWrapper( + allNullableTypes: AllNullableTypes(aNullableString: nullableString), classList: [], + classMap: [:]) } func sendMultipleNullableTypes( @@ -167,8 +227,58 @@ public class TestPlugin: NSObject, FlutterPlugin, HostIntegrationCoreApi { return aNullableList } - func echoNullable(_ aNullableMap: [String?: Any?]?) throws -> [String?: Any?]? { - return aNullableMap + func echoNullable(enumList: [AnEnum?]?) throws -> [AnEnum?]? { + return enumList + } + + func echoNullable(classList: [AllNullableTypes?]?) throws -> [AllNullableTypes?]? { + return classList + } + + func echoNullableNonNull(enumList: [AnEnum]?) throws -> [AnEnum]? { + return enumList + } + + func echoNullableNonNull(classList: [AllNullableTypes]?) throws -> [AllNullableTypes]? { + return classList + } + + func echoNullable(_ map: [AnyHashable?: Any?]?) throws -> [AnyHashable?: Any?]? { + return map + } + + func echoNullable(stringMap: [String?: String?]?) throws -> [String?: String?]? { + return stringMap + } + + func echoNullable(intMap: [Int64?: Int64?]?) throws -> [Int64?: Int64?]? { + return intMap + } + + func echoNullable(enumMap: [AnEnum?: AnEnum?]?) throws -> [AnEnum?: AnEnum?]? { + return enumMap + } + + func echoNullable(classMap: [Int64?: AllNullableTypes?]?) throws -> [Int64?: AllNullableTypes?]? { + return classMap + } + + func echoNullableNonNull(stringMap: [String: String]?) throws -> [String: String]? { + return stringMap + } + + func echoNullableNonNull(intMap: [Int64: Int64]?) throws -> [Int64: Int64]? { + return intMap + } + + func echoNullableNonNull(enumMap: [AnEnum: AnEnum]?) throws -> [AnEnum: AnEnum]? { + return enumMap + } + + func echoNullableNonNull(classMap: [Int64: AllNullableTypes]?) throws -> [Int64: + AllNullableTypes]? + { + return classMap } func echoNullable(_ anEnum: AnEnum?) throws -> AnEnum? { @@ -252,10 +362,46 @@ public class TestPlugin: NSObject, FlutterPlugin, HostIntegrationCoreApi { completion(.success(list)) } + func echoAsync(enumList: [AnEnum?], completion: @escaping (Result<[AnEnum?], Error>) -> Void) { + completion(.success(enumList)) + } + + func echoAsync( + classList: [AllNullableTypes?], + completion: @escaping (Result<[AllNullableTypes?], Error>) -> Void + ) { + completion(.success(classList)) + } + + func echoAsync( + _ map: [AnyHashable?: Any?], completion: @escaping (Result<[AnyHashable?: Any?], Error>) -> Void + ) { + completion(.success(map)) + } + + func echoAsync( + stringMap: [String?: String?], completion: @escaping (Result<[String?: String?], Error>) -> Void + ) { + completion(.success(stringMap)) + } + + func echoAsync( + intMap: [Int64?: Int64?], completion: @escaping (Result<[Int64?: Int64?], Error>) -> Void + ) { + completion(.success(intMap)) + } + + func echoAsync( + enumMap: [AnEnum?: AnEnum?], completion: @escaping (Result<[AnEnum?: AnEnum?], Error>) -> Void + ) { + completion(.success(enumMap)) + } + func echoAsync( - _ aMap: [String?: Any?], completion: @escaping (Result<[String?: Any?], Error>) -> Void + classMap: [Int64?: AllNullableTypes?], + completion: @escaping (Result<[Int64?: AllNullableTypes?], Error>) -> Void ) { - completion(.success(aMap)) + completion(.success(classMap)) } func echoAsync(_ anEnum: AnEnum, completion: @escaping (Result) -> Void) { @@ -302,9 +448,49 @@ public class TestPlugin: NSObject, FlutterPlugin, HostIntegrationCoreApi { } func echoAsyncNullable( - _ aMap: [String?: Any?]?, completion: @escaping (Result<[String?: Any?]?, Error>) -> Void + enumList: [AnEnum?]?, completion: @escaping (Result<[AnEnum?]?, Error>) -> Void + ) { + completion(.success(enumList)) + } + + func echoAsyncNullable( + classList: [AllNullableTypes?]?, + completion: @escaping (Result<[AllNullableTypes?]?, Error>) -> Void + ) { + completion(.success(classList)) + } + + func echoAsyncNullable( + _ map: [AnyHashable?: Any?]?, + completion: @escaping (Result<[AnyHashable?: Any?]?, Error>) -> Void + ) { + completion(.success(map)) + } + + func echoAsyncNullable( + stringMap: [String?: String?]?, + completion: @escaping (Result<[String?: String?]?, Error>) -> Void + ) { + completion(.success(stringMap)) + } + + func echoAsyncNullable( + intMap: [Int64?: Int64?]?, completion: @escaping (Result<[Int64?: Int64?]?, Error>) -> Void + ) { + completion(.success(intMap)) + } + + func echoAsyncNullable( + enumMap: [AnEnum?: AnEnum?]?, completion: @escaping (Result<[AnEnum?: AnEnum?]?, Error>) -> Void + ) { + completion(.success(enumMap)) + } + + func echoAsyncNullable( + classMap: [Int64?: AllNullableTypes?]?, + completion: @escaping (Result<[Int64?: AllNullableTypes?]?, Error>) -> Void ) { - completion(.success(aMap)) + completion(.success(classMap)) } func echoAsyncNullable( @@ -501,9 +687,168 @@ public class TestPlugin: NSObject, FlutterPlugin, HostIntegrationCoreApi { } func callFlutterEcho( - _ aMap: [String?: Any?], completion: @escaping (Result<[String?: Any?], Error>) -> Void + enumList: [AnEnum?], completion: @escaping (Result<[AnEnum?], Error>) -> Void + ) { + flutterAPI.echo(enumList: enumList) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEcho( + classList: [AllNullableTypes?], + completion: @escaping (Result<[AllNullableTypes?], Error>) -> Void + ) { + flutterAPI.echo(classList: classList) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoNonNull( + enumList: [AnEnum], completion: @escaping (Result<[AnEnum], Error>) -> Void + ) { + flutterAPI.echoNonNull(enumList: enumList) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoNonNull( + classList: [AllNullableTypes], completion: @escaping (Result<[AllNullableTypes], Error>) -> Void + ) { + flutterAPI.echoNonNull(classList: classList) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEcho( + _ map: [AnyHashable?: Any?], completion: @escaping (Result<[AnyHashable?: Any?], Error>) -> Void + ) { + flutterAPI.echo(map) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEcho( + stringMap: [String?: String?], completion: @escaping (Result<[String?: String?], Error>) -> Void + ) { + flutterAPI.echo(stringMap: stringMap) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEcho( + intMap: [Int64?: Int64?], completion: @escaping (Result<[Int64?: Int64?], Error>) -> Void + ) { + flutterAPI.echo(intMap: intMap) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEcho( + enumMap: [AnEnum?: AnEnum?], completion: @escaping (Result<[AnEnum?: AnEnum?], Error>) -> Void + ) { + flutterAPI.echo(enumMap: enumMap) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEcho( + classMap: [Int64?: AllNullableTypes?], + completion: @escaping (Result<[Int64?: AllNullableTypes?], Error>) -> Void + ) { + flutterAPI.echo(classMap: classMap) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoNonNull( + stringMap: [String: String], completion: @escaping (Result<[String: String], Error>) -> Void + ) { + flutterAPI.echoNonNull(stringMap: stringMap) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoNonNull( + intMap: [Int64: Int64], completion: @escaping (Result<[Int64: Int64], Error>) -> Void + ) { + flutterAPI.echoNonNull(intMap: intMap) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoNonNull( + enumMap: [AnEnum: AnEnum], completion: @escaping (Result<[AnEnum: AnEnum], Error>) -> Void + ) { + flutterAPI.echoNonNull(enumMap: enumMap) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoNonNull( + classMap: [Int64: AllNullableTypes], + completion: @escaping (Result<[Int64: AllNullableTypes], Error>) -> Void ) { - flutterAPI.echo(aMap) { response in + flutterAPI.echoNonNull(classMap: classMap) { response in switch response { case .success(let res): completion(.success(res)) @@ -618,9 +963,9 @@ public class TestPlugin: NSObject, FlutterPlugin, HostIntegrationCoreApi { } func callFlutterEchoNullable( - _ aMap: [String?: Any?]?, completion: @escaping (Result<[String?: Any?]?, Error>) -> Void + enumList: [AnEnum?]?, completion: @escaping (Result<[AnEnum?]?, Error>) -> Void ) { - flutterAPI.echoNullable(aMap) { response in + flutterAPI.echoNullable(enumList: enumList) { response in switch response { case .success(let res): completion(.success(res)) @@ -631,9 +976,37 @@ public class TestPlugin: NSObject, FlutterPlugin, HostIntegrationCoreApi { } func callFlutterEchoNullable( - _ anEnum: AnEnum?, completion: @escaping (Result) -> Void + classList: [AllNullableTypes?]?, + completion: @escaping (Result<[AllNullableTypes?]?, Error>) -> Void ) { - flutterAPI.echoNullable(anEnum) { response in + flutterAPI.echoNullable(classList: classList) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoNullableNonNull( + enumList: [AnEnum]?, completion: @escaping (Result<[AnEnum]?, Error>) -> Void + ) { + flutterAPI.echoNullableNonNull(enumList: enumList) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoNullableNonNull( + classList: [AllNullableTypes]?, + completion: @escaping (Result<[AllNullableTypes]?, Error>) -> Void + ) { + flutterAPI.echoNullableNonNull(classList: classList) { response in switch response { case .success(let res): completion(.success(res)) @@ -644,9 +1017,10 @@ public class TestPlugin: NSObject, FlutterPlugin, HostIntegrationCoreApi { } func callFlutterEchoNullable( - _ anotherEnum: AnotherEnum?, completion: @escaping (Result) -> Void + _ map: [AnyHashable?: Any?]?, + completion: @escaping (Result<[AnyHashable?: Any?]?, Error>) -> Void ) { - flutterAPI.echoNullable(anotherEnum) { response in + flutterAPI.echoNullable(map) { response in switch response { case .success(let res): completion(.success(res)) @@ -656,15 +1030,148 @@ public class TestPlugin: NSObject, FlutterPlugin, HostIntegrationCoreApi { } } - func callFlutterSmallApiEcho( - _ aString: String, completion: @escaping (Result) -> Void + func callFlutterEchoNullable( + stringMap: [String?: String?]?, + completion: @escaping (Result<[String?: String?]?, Error>) -> Void ) { - flutterSmallApiOne.echo(string: aString) { responseOne in - self.flutterSmallApiTwo.echo(string: aString) { responseTwo in - switch responseOne { - case .success(let resOne): - switch responseTwo { - case .success(let resTwo): + flutterAPI.echoNullable(stringMap: stringMap) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoNullable( + intMap: [Int64?: Int64?]?, completion: @escaping (Result<[Int64?: Int64?]?, Error>) -> Void + ) { + flutterAPI.echoNullable(intMap: intMap) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoNullable( + enumMap: [AnEnum?: AnEnum?]?, completion: @escaping (Result<[AnEnum?: AnEnum?]?, Error>) -> Void + ) { + flutterAPI.echoNullable(enumMap: enumMap) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoNullable( + classMap: [Int64?: AllNullableTypes?]?, + completion: @escaping (Result<[Int64?: AllNullableTypes?]?, Error>) -> Void + ) { + flutterAPI.echoNullable(classMap: classMap) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoNullableNonNull( + stringMap: [String: String]?, completion: @escaping (Result<[String: String]?, Error>) -> Void + ) { + flutterAPI.echoNullableNonNull(stringMap: stringMap) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoNullableNonNull( + intMap: [Int64: Int64]?, completion: @escaping (Result<[Int64: Int64]?, Error>) -> Void + ) { + flutterAPI.echoNullableNonNull(intMap: intMap) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoNullableNonNull( + enumMap: [AnEnum: AnEnum]?, completion: @escaping (Result<[AnEnum: AnEnum]?, Error>) -> Void + ) { + flutterAPI.echoNullableNonNull(enumMap: enumMap) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoNullableNonNull( + classMap: [Int64: AllNullableTypes]?, + completion: @escaping (Result<[Int64: AllNullableTypes]?, Error>) -> Void + ) { + flutterAPI.echoNullableNonNull(classMap: classMap) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoNullable( + _ anEnum: AnEnum?, completion: @escaping (Result) -> Void + ) { + flutterAPI.echoNullable(anEnum) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoNullable( + _ anotherEnum: AnotherEnum?, completion: @escaping (Result) -> Void + ) { + flutterAPI.echoNullable(anotherEnum) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterSmallApiEcho( + _ aString: String, completion: @escaping (Result) -> Void + ) { + flutterSmallApiOne.echo(string: aString) { responseOne in + self.flutterSmallApiTwo.echo(string: aString) { responseTwo in + switch responseOne { + case .success(let resOne): + switch responseTwo { + case .success(let resTwo): if resOne == resTwo { completion(.success(resOne)) } else { @@ -684,6 +1191,10 @@ public class TestPlugin: NSObject, FlutterPlugin, HostIntegrationCoreApi { } } } + + func testUnusedClassesGenerate() -> UnusedClass { + return UnusedClass() + } } public class TestPluginWithSuffix: HostSmallApi { @@ -702,3 +1213,902 @@ public class TestPluginWithSuffix: HostSmallApi { } } + +class ProxyApiDelegate: ProxyApiTestsPigeonProxyApiDelegate { + func pigeonApiProxyApiTestClass(_ registrar: ProxyApiTestsPigeonProxyApiRegistrar) + -> PigeonApiProxyApiTestClass + { + class ProxyApiTestClassDelegate: PigeonApiDelegateProxyApiTestClass { + func pigeonDefaultConstructor( + pigeonApi: PigeonApiProxyApiTestClass, aBool: Bool, anInt: Int64, aDouble: Double, + aString: String, aUint8List: FlutterStandardTypedData, aList: [Any?], aMap: [String?: Any?], + anEnum: ProxyApiTestEnum, aProxyApi: ProxyApiSuperClass, aNullableBool: Bool?, + aNullableInt: Int64?, aNullableDouble: Double?, aNullableString: String?, + aNullableUint8List: FlutterStandardTypedData?, aNullableList: [Any?]?, + aNullableMap: [String?: Any?]?, aNullableEnum: ProxyApiTestEnum?, + aNullableProxyApi: ProxyApiSuperClass?, boolParam: Bool, intParam: Int64, + doubleParam: Double, stringParam: String, aUint8ListParam: FlutterStandardTypedData, + listParam: [Any?], mapParam: [String?: Any?], enumParam: ProxyApiTestEnum, + proxyApiParam: ProxyApiSuperClass, nullableBoolParam: Bool?, nullableIntParam: Int64?, + nullableDoubleParam: Double?, nullableStringParam: String?, + nullableUint8ListParam: FlutterStandardTypedData?, nullableListParam: [Any?]?, + nullableMapParam: [String?: Any?]?, nullableEnumParam: ProxyApiTestEnum?, + nullableProxyApiParam: ProxyApiSuperClass? + ) throws -> ProxyApiTestClass { + return ProxyApiTestClass() + } + + func attachedField(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) + throws -> ProxyApiSuperClass + { + return ProxyApiSuperClass() + } + + func staticAttachedField(pigeonApi: PigeonApiProxyApiTestClass) throws -> ProxyApiSuperClass { + return ProxyApiSuperClass() + } + + func aBool(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) throws + -> Bool + { + return true + } + + func anInt(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) throws + -> Int64 + { + return 0 + } + + func aDouble(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) throws + -> Double + { + return 0.0 + } + + func aString(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) throws + -> String + { + return "" + } + + func aUint8List(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) + throws -> FlutterStandardTypedData + { + return FlutterStandardTypedData(bytes: Data()) + } + + func aList(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) throws + -> [Any?] + { + return [] + } + + func aMap(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) throws + -> [String?: Any?] + { + return [:] + } + + func anEnum(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) throws + -> ProxyApiTestEnum + { + return ProxyApiTestEnum.one + } + + func aProxyApi(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) + throws -> ProxyApiSuperClass + { + return ProxyApiSuperClass() + } + + func aNullableBool(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) + throws -> Bool? + { + return nil + } + + func aNullableInt(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) + throws -> Int64? + { + return nil + } + + func aNullableDouble(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) + throws -> Double? + { + return nil + } + + func aNullableString(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) + throws -> String? + { + return nil + } + + func aNullableUint8List( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass + ) throws -> FlutterStandardTypedData? { + return nil + } + + func aNullableList(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) + throws -> [Any?]? + { + return nil + } + + func aNullableMap(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) + throws -> [String?: Any?]? + { + return nil + } + + func aNullableEnum(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) + throws -> ProxyApiTestEnum? + { + return nil + } + + func aNullableProxyApi( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass + ) throws -> ProxyApiSuperClass? { + return nil + } + + func noop(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) throws { + } + + func throwError(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) + throws -> Any? + { + throw ProxyApiTestsError(code: "code", message: "message", details: "details") + } + + func throwErrorFromVoid( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass + ) throws { + throw ProxyApiTestsError(code: "code", message: "message", details: "details") + } + + func throwFlutterError( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass + ) throws -> Any? { + throw ProxyApiTestsError(code: "code", message: "message", details: "details") + } + + func echoInt( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, anInt: Int64 + ) throws -> Int64 { + return anInt + } + + func echoDouble( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aDouble: Double + ) throws -> Double { + return aDouble + } + + func echoBool( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aBool: Bool + ) throws -> Bool { + return aBool + } + + func echoString( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aString: String + ) throws -> String { + return aString + } + + func echoUint8List( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aUint8List: FlutterStandardTypedData + ) throws -> FlutterStandardTypedData { + return aUint8List + } + + func echoObject( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, anObject: Any + ) throws -> Any { + return anObject + } + + func echoList( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aList: [Any?] + ) throws -> [Any?] { + return aList + } + + func echoProxyApiList( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aList: [ProxyApiTestClass] + ) throws -> [ProxyApiTestClass] { + return aList + } + + func echoMap( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aMap: [String?: Any?] + ) throws -> [String?: Any?] { + return aMap + } + + func echoProxyApiMap( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aMap: [String: ProxyApiTestClass] + ) throws -> [String: ProxyApiTestClass] { + return aMap + } + + func echoEnum( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + anEnum: ProxyApiTestEnum + ) throws -> ProxyApiTestEnum { + return anEnum + } + + func echoProxyApi( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aProxyApi: ProxyApiSuperClass + ) throws -> ProxyApiSuperClass { + return aProxyApi + } + + func echoNullableInt( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aNullableInt: Int64? + ) throws -> Int64? { + return aNullableInt + } + + func echoNullableDouble( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aNullableDouble: Double? + ) throws -> Double? { + return aNullableDouble + } + + func echoNullableBool( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aNullableBool: Bool? + ) throws -> Bool? { + return aNullableBool + } + + func echoNullableString( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aNullableString: String? + ) throws -> String? { + return aNullableString + } + + func echoNullableUint8List( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aNullableUint8List: FlutterStandardTypedData? + ) throws -> FlutterStandardTypedData? { + return aNullableUint8List + } + + func echoNullableObject( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aNullableObject: Any? + ) throws -> Any? { + return aNullableObject + } + + func echoNullableList( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aNullableList: [Any?]? + ) throws -> [Any?]? { + return aNullableList + } + + func echoNullableMap( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aNullableMap: [String?: Any?]? + ) throws -> [String?: Any?]? { + return aNullableMap + } + + func echoNullableEnum( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aNullableEnum: ProxyApiTestEnum? + ) throws -> ProxyApiTestEnum? { + return aNullableEnum + } + + func echoNullableProxyApi( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aNullableProxyApi: ProxyApiSuperClass? + ) throws -> ProxyApiSuperClass? { + return aNullableProxyApi + } + + func noopAsync( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + completion: @escaping (Result) -> Void + ) { + completion(.success(Void())) + } + + func echoAsyncInt( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, anInt: Int64, + completion: @escaping (Result) -> Void + ) { + completion(.success(anInt)) + } + + func echoAsyncDouble( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aDouble: Double, + completion: @escaping (Result) -> Void + ) { + completion(.success(aDouble)) + } + + func echoAsyncBool( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aBool: Bool, + completion: @escaping (Result) -> Void + ) { + completion(.success(aBool)) + } + + func echoAsyncString( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aString: String, + completion: @escaping (Result) -> Void + ) { + completion(.success(aString)) + } + + func echoAsyncUint8List( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aUint8List: FlutterStandardTypedData, + completion: @escaping (Result) -> Void + ) { + completion(.success(aUint8List)) + } + + func echoAsyncObject( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, anObject: Any, + completion: @escaping (Result) -> Void + ) { + completion(.success(anObject)) + } + + func echoAsyncList( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aList: [Any?], + completion: @escaping (Result<[Any?], Error>) -> Void + ) { + completion(.success(aList)) + } + + func echoAsyncMap( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aMap: [String?: Any?], completion: @escaping (Result<[String?: Any?], Error>) -> Void + ) { + completion(.success(aMap)) + } + + func echoAsyncEnum( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + anEnum: ProxyApiTestEnum, completion: @escaping (Result) -> Void + ) { + completion(.success(anEnum)) + } + + func throwAsyncError( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + completion: @escaping (Result) -> Void + ) { + completion( + .failure(ProxyApiTestsError(code: "code", message: "message", details: "details"))) + } + + func throwAsyncErrorFromVoid( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + completion: @escaping (Result) -> Void + ) { + completion( + .failure(ProxyApiTestsError(code: "code", message: "message", details: "details"))) + } + + func throwAsyncFlutterError( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + completion: @escaping (Result) -> Void + ) { + completion( + .failure(ProxyApiTestsError(code: "code", message: "message", details: "details"))) + } + + func echoAsyncNullableInt( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, anInt: Int64?, + completion: @escaping (Result) -> Void + ) { + completion(.success(anInt)) + } + + func echoAsyncNullableDouble( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aDouble: Double?, + completion: @escaping (Result) -> Void + ) { + completion(.success(aDouble)) + } + + func echoAsyncNullableBool( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aBool: Bool?, + completion: @escaping (Result) -> Void + ) { + completion(.success(aBool)) + } + + func echoAsyncNullableString( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aString: String?, + completion: @escaping (Result) -> Void + ) { + completion(.success(aString)) + } + + func echoAsyncNullableUint8List( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aUint8List: FlutterStandardTypedData?, + completion: @escaping (Result) -> Void + ) { + completion(.success(aUint8List)) + } + + func echoAsyncNullableObject( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, anObject: Any?, + completion: @escaping (Result) -> Void + ) { + completion(.success(anObject)) + } + + func echoAsyncNullableList( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aList: [Any?]?, + completion: @escaping (Result<[Any?]?, Error>) -> Void + ) { + completion(.success(aList)) + } + + func echoAsyncNullableMap( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aMap: [String?: Any?]?, completion: @escaping (Result<[String?: Any?]?, Error>) -> Void + ) { + completion(.success(aMap)) + } + + func echoAsyncNullableEnum( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + anEnum: ProxyApiTestEnum?, completion: @escaping (Result) -> Void + ) { + completion(.success(anEnum)) + } + + func staticNoop(pigeonApi: PigeonApiProxyApiTestClass) throws { + + } + + func echoStaticString(pigeonApi: PigeonApiProxyApiTestClass, aString: String) throws -> String + { + return aString + } + + func staticAsyncNoop( + pigeonApi: PigeonApiProxyApiTestClass, completion: @escaping (Result) -> Void + ) { + completion(.success(Void())) + } + + func callFlutterNoop( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + completion: @escaping (Result) -> Void + ) { + pigeonApi.flutterNoop(pigeonInstance: pigeonInstance) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterThrowError( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + completion: @escaping (Result) -> Void + ) { + pigeonApi.flutterThrowError(pigeonInstance: pigeonInstance) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterThrowErrorFromVoid( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + completion: @escaping (Result) -> Void + ) { + pigeonApi.flutterThrowErrorFromVoid(pigeonInstance: pigeonInstance) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoBool( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aBool: Bool, + completion: @escaping (Result) -> Void + ) { + pigeonApi.flutterEchoBool(pigeonInstance: pigeonInstance, aBool: aBool) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoInt( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, anInt: Int64, + completion: @escaping (Result) -> Void + ) { + pigeonApi.flutterEchoInt(pigeonInstance: pigeonInstance, anInt: anInt) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoDouble( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aDouble: Double, + completion: @escaping (Result) -> Void + ) { + pigeonApi.flutterEchoDouble(pigeonInstance: pigeonInstance, aDouble: aDouble) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoString( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aString: String, + completion: @escaping (Result) -> Void + ) { + pigeonApi.flutterEchoString(pigeonInstance: pigeonInstance, aString: aString) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoUint8List( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aUint8List: FlutterStandardTypedData, + completion: @escaping (Result) -> Void + ) { + pigeonApi.flutterEchoUint8List(pigeonInstance: pigeonInstance, aList: aUint8List) { + response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoList( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aList: [Any?], + completion: @escaping (Result<[Any?], Error>) -> Void + ) { + pigeonApi.flutterEchoList(pigeonInstance: pigeonInstance, aList: aList) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoProxyApiList( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aList: [ProxyApiTestClass?], + completion: @escaping (Result<[ProxyApiTestClass?], Error>) -> Void + ) { + pigeonApi.flutterEchoProxyApiList(pigeonInstance: pigeonInstance, aList: aList) { + response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoMap( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aMap: [String?: Any?], completion: @escaping (Result<[String?: Any?], Error>) -> Void + ) { + pigeonApi.flutterEchoMap(pigeonInstance: pigeonInstance, aMap: aMap) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoProxyApiMap( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aMap: [String?: ProxyApiTestClass?], + completion: @escaping (Result<[String?: ProxyApiTestClass?], Error>) -> Void + ) { + pigeonApi.flutterEchoProxyApiMap(pigeonInstance: pigeonInstance, aMap: aMap) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoEnum( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + anEnum: ProxyApiTestEnum, completion: @escaping (Result) -> Void + ) { + pigeonApi.flutterEchoEnum(pigeonInstance: pigeonInstance, anEnum: anEnum) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoProxyApi( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aProxyApi: ProxyApiSuperClass, + completion: @escaping (Result) -> Void + ) { + pigeonApi.flutterEchoProxyApi(pigeonInstance: pigeonInstance, aProxyApi: aProxyApi) { + response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoNullableBool( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aBool: Bool?, + completion: @escaping (Result) -> Void + ) { + pigeonApi.flutterEchoNullableBool(pigeonInstance: pigeonInstance, aBool: aBool) { + response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoNullableInt( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, anInt: Int64?, + completion: @escaping (Result) -> Void + ) { + pigeonApi.flutterEchoNullableInt(pigeonInstance: pigeonInstance, anInt: anInt) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoNullableDouble( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aDouble: Double?, + completion: @escaping (Result) -> Void + ) { + pigeonApi.flutterEchoNullableDouble(pigeonInstance: pigeonInstance, aDouble: aDouble) { + response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoNullableString( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aString: String?, + completion: @escaping (Result) -> Void + ) { + pigeonApi.flutterEchoNullableString(pigeonInstance: pigeonInstance, aString: aString) { + response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoNullableUint8List( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aUint8List: FlutterStandardTypedData?, + completion: @escaping (Result) -> Void + ) { + pigeonApi.flutterEchoNullableUint8List(pigeonInstance: pigeonInstance, aList: aUint8List) { + response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoNullableList( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aList: [Any?]?, + completion: @escaping (Result<[Any?]?, Error>) -> Void + ) { + pigeonApi.flutterEchoNullableList(pigeonInstance: pigeonInstance, aList: aList) { + response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoNullableMap( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aMap: [String?: Any?]?, completion: @escaping (Result<[String?: Any?]?, Error>) -> Void + ) { + pigeonApi.flutterEchoNullableMap(pigeonInstance: pigeonInstance, aMap: aMap) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoNullableEnum( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + anEnum: ProxyApiTestEnum?, completion: @escaping (Result) -> Void + ) { + pigeonApi.flutterEchoNullableEnum(pigeonInstance: pigeonInstance, anEnum: anEnum) { + response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoNullableProxyApi( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aProxyApi: ProxyApiSuperClass?, + completion: @escaping (Result) -> Void + ) { + pigeonApi.flutterEchoNullableProxyApi(pigeonInstance: pigeonInstance, aProxyApi: aProxyApi) + { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterNoopAsync( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + completion: @escaping (Result) -> Void + ) { + pigeonApi.flutterNoopAsync(pigeonInstance: pigeonInstance) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoAsyncString( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aString: String, + completion: @escaping (Result) -> Void + ) { + pigeonApi.flutterEchoAsyncString(pigeonInstance: pigeonInstance, aString: aString) { + response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + } + return PigeonApiProxyApiTestClass( + pigeonRegistrar: registrar, delegate: ProxyApiTestClassDelegate()) + } + + func pigeonApiProxyApiSuperClass(_ registrar: ProxyApiTestsPigeonProxyApiRegistrar) + -> PigeonApiProxyApiSuperClass + { + class ProxyApiSuperClassDelegate: PigeonApiDelegateProxyApiSuperClass { + func pigeonDefaultConstructor(pigeonApi: PigeonApiProxyApiSuperClass) throws + -> ProxyApiSuperClass + { + return ProxyApiSuperClass() + } + + func aSuperMethod(pigeonApi: PigeonApiProxyApiSuperClass, pigeonInstance: ProxyApiSuperClass) + throws + {} + } + return PigeonApiProxyApiSuperClass( + pigeonRegistrar: registrar, delegate: ProxyApiSuperClassDelegate()) + } + + func pigeonApiClassWithApiRequirement(_ registrar: ProxyApiTestsPigeonProxyApiRegistrar) + -> PigeonApiClassWithApiRequirement + { + class ClassWithApiRequirementDelegate: PigeonApiDelegateClassWithApiRequirement { + @available(iOS 15, *) + func pigeonDefaultConstructor(pigeonApi: PigeonApiClassWithApiRequirement) throws + -> ClassWithApiRequirement + { + return ClassWithApiRequirement() + } + + @available(iOS 15, *) + func aMethod( + pigeonApi: PigeonApiClassWithApiRequirement, pigeonInstance: ClassWithApiRequirement + ) throws { + + } + } + + return PigeonApiClassWithApiRequirement( + pigeonRegistrar: registrar, delegate: ClassWithApiRequirementDelegate()) + } +} diff --git a/packages/pigeon/platform_tests/test_plugin/linux/pigeon/core_tests.gen.cc b/packages/pigeon/platform_tests/test_plugin/linux/pigeon/core_tests.gen.cc index 4b2a24280c6d..5701f91c2355 100644 --- a/packages/pigeon/platform_tests/test_plugin/linux/pigeon/core_tests.gen.cc +++ b/packages/pigeon/platform_tests/test_plugin/linux/pigeon/core_tests.gen.cc @@ -7,6 +7,68 @@ #include "core_tests.gen.h" +struct _CoreTestsPigeonTestUnusedClass { + GObject parent_instance; + + FlValue* a_field; +}; + +G_DEFINE_TYPE(CoreTestsPigeonTestUnusedClass, + core_tests_pigeon_test_unused_class, G_TYPE_OBJECT) + +static void core_tests_pigeon_test_unused_class_dispose(GObject* object) { + CoreTestsPigeonTestUnusedClass* self = + CORE_TESTS_PIGEON_TEST_UNUSED_CLASS(object); + g_clear_pointer(&self->a_field, fl_value_unref); + G_OBJECT_CLASS(core_tests_pigeon_test_unused_class_parent_class) + ->dispose(object); +} + +static void core_tests_pigeon_test_unused_class_init( + CoreTestsPigeonTestUnusedClass* self) {} + +static void core_tests_pigeon_test_unused_class_class_init( + CoreTestsPigeonTestUnusedClassClass* klass) { + G_OBJECT_CLASS(klass)->dispose = core_tests_pigeon_test_unused_class_dispose; +} + +CoreTestsPigeonTestUnusedClass* core_tests_pigeon_test_unused_class_new( + FlValue* a_field) { + CoreTestsPigeonTestUnusedClass* self = CORE_TESTS_PIGEON_TEST_UNUSED_CLASS( + g_object_new(core_tests_pigeon_test_unused_class_get_type(), nullptr)); + if (a_field != nullptr) { + self->a_field = fl_value_ref(a_field); + } else { + self->a_field = nullptr; + } + return self; +} + +FlValue* core_tests_pigeon_test_unused_class_get_a_field( + CoreTestsPigeonTestUnusedClass* self) { + g_return_val_if_fail(CORE_TESTS_PIGEON_TEST_IS_UNUSED_CLASS(self), nullptr); + return self->a_field; +} + +static FlValue* core_tests_pigeon_test_unused_class_to_list( + CoreTestsPigeonTestUnusedClass* self) { + FlValue* values = fl_value_new_list(); + fl_value_append_take(values, self->a_field != nullptr + ? fl_value_ref(self->a_field) + : fl_value_new_null()); + return values; +} + +static CoreTestsPigeonTestUnusedClass* +core_tests_pigeon_test_unused_class_new_from_list(FlValue* values) { + FlValue* value0 = fl_value_get_list_value(values, 0); + FlValue* a_field = nullptr; + if (fl_value_get_type(value0) != FL_VALUE_TYPE_NULL) { + a_field = value0; + } + return core_tests_pigeon_test_unused_class_new(a_field); +} + struct _CoreTestsPigeonTestAllTypes { GObject parent_instance; @@ -31,7 +93,17 @@ struct _CoreTestsPigeonTestAllTypes { FlValue* int_list; FlValue* double_list; FlValue* bool_list; + FlValue* enum_list; + FlValue* object_list; + FlValue* list_list; + FlValue* map_list; FlValue* map; + FlValue* string_map; + FlValue* int_map; + FlValue* enum_map; + FlValue* object_map; + FlValue* list_map; + FlValue* map_map; }; G_DEFINE_TYPE(CoreTestsPigeonTestAllTypes, core_tests_pigeon_test_all_types, @@ -46,7 +118,17 @@ static void core_tests_pigeon_test_all_types_dispose(GObject* object) { g_clear_pointer(&self->int_list, fl_value_unref); g_clear_pointer(&self->double_list, fl_value_unref); g_clear_pointer(&self->bool_list, fl_value_unref); + g_clear_pointer(&self->enum_list, fl_value_unref); + g_clear_pointer(&self->object_list, fl_value_unref); + g_clear_pointer(&self->list_list, fl_value_unref); + g_clear_pointer(&self->map_list, fl_value_unref); g_clear_pointer(&self->map, fl_value_unref); + g_clear_pointer(&self->string_map, fl_value_unref); + g_clear_pointer(&self->int_map, fl_value_unref); + g_clear_pointer(&self->enum_map, fl_value_unref); + g_clear_pointer(&self->object_map, fl_value_unref); + g_clear_pointer(&self->list_map, fl_value_unref); + g_clear_pointer(&self->map_map, fl_value_unref); G_OBJECT_CLASS(core_tests_pigeon_test_all_types_parent_class) ->dispose(object); } @@ -68,7 +150,10 @@ CoreTestsPigeonTestAllTypes* core_tests_pigeon_test_all_types_new( CoreTestsPigeonTestAnEnum an_enum, CoreTestsPigeonTestAnotherEnum another_enum, const gchar* a_string, FlValue* an_object, FlValue* list, FlValue* string_list, FlValue* int_list, - FlValue* double_list, FlValue* bool_list, FlValue* map) { + FlValue* double_list, FlValue* bool_list, FlValue* enum_list, + FlValue* object_list, FlValue* list_list, FlValue* map_list, FlValue* map, + FlValue* string_map, FlValue* int_map, FlValue* enum_map, + FlValue* object_map, FlValue* list_map, FlValue* map_map) { CoreTestsPigeonTestAllTypes* self = CORE_TESTS_PIGEON_TEST_ALL_TYPES( g_object_new(core_tests_pigeon_test_all_types_get_type(), nullptr)); self->a_bool = a_bool; @@ -99,7 +184,17 @@ CoreTestsPigeonTestAllTypes* core_tests_pigeon_test_all_types_new( self->int_list = fl_value_ref(int_list); self->double_list = fl_value_ref(double_list); self->bool_list = fl_value_ref(bool_list); + self->enum_list = fl_value_ref(enum_list); + self->object_list = fl_value_ref(object_list); + self->list_list = fl_value_ref(list_list); + self->map_list = fl_value_ref(map_list); self->map = fl_value_ref(map); + self->string_map = fl_value_ref(string_map); + self->int_map = fl_value_ref(int_map); + self->enum_map = fl_value_ref(enum_map); + self->object_map = fl_value_ref(object_map); + self->list_map = fl_value_ref(list_map); + self->map_map = fl_value_ref(map_map); return self; } @@ -212,12 +307,72 @@ FlValue* core_tests_pigeon_test_all_types_get_bool_list( return self->bool_list; } +FlValue* core_tests_pigeon_test_all_types_get_enum_list( + CoreTestsPigeonTestAllTypes* self) { + g_return_val_if_fail(CORE_TESTS_PIGEON_TEST_IS_ALL_TYPES(self), nullptr); + return self->enum_list; +} + +FlValue* core_tests_pigeon_test_all_types_get_object_list( + CoreTestsPigeonTestAllTypes* self) { + g_return_val_if_fail(CORE_TESTS_PIGEON_TEST_IS_ALL_TYPES(self), nullptr); + return self->object_list; +} + +FlValue* core_tests_pigeon_test_all_types_get_list_list( + CoreTestsPigeonTestAllTypes* self) { + g_return_val_if_fail(CORE_TESTS_PIGEON_TEST_IS_ALL_TYPES(self), nullptr); + return self->list_list; +} + +FlValue* core_tests_pigeon_test_all_types_get_map_list( + CoreTestsPigeonTestAllTypes* self) { + g_return_val_if_fail(CORE_TESTS_PIGEON_TEST_IS_ALL_TYPES(self), nullptr); + return self->map_list; +} + FlValue* core_tests_pigeon_test_all_types_get_map( CoreTestsPigeonTestAllTypes* self) { g_return_val_if_fail(CORE_TESTS_PIGEON_TEST_IS_ALL_TYPES(self), nullptr); return self->map; } +FlValue* core_tests_pigeon_test_all_types_get_string_map( + CoreTestsPigeonTestAllTypes* self) { + g_return_val_if_fail(CORE_TESTS_PIGEON_TEST_IS_ALL_TYPES(self), nullptr); + return self->string_map; +} + +FlValue* core_tests_pigeon_test_all_types_get_int_map( + CoreTestsPigeonTestAllTypes* self) { + g_return_val_if_fail(CORE_TESTS_PIGEON_TEST_IS_ALL_TYPES(self), nullptr); + return self->int_map; +} + +FlValue* core_tests_pigeon_test_all_types_get_enum_map( + CoreTestsPigeonTestAllTypes* self) { + g_return_val_if_fail(CORE_TESTS_PIGEON_TEST_IS_ALL_TYPES(self), nullptr); + return self->enum_map; +} + +FlValue* core_tests_pigeon_test_all_types_get_object_map( + CoreTestsPigeonTestAllTypes* self) { + g_return_val_if_fail(CORE_TESTS_PIGEON_TEST_IS_ALL_TYPES(self), nullptr); + return self->object_map; +} + +FlValue* core_tests_pigeon_test_all_types_get_list_map( + CoreTestsPigeonTestAllTypes* self) { + g_return_val_if_fail(CORE_TESTS_PIGEON_TEST_IS_ALL_TYPES(self), nullptr); + return self->list_map; +} + +FlValue* core_tests_pigeon_test_all_types_get_map_map( + CoreTestsPigeonTestAllTypes* self) { + g_return_val_if_fail(CORE_TESTS_PIGEON_TEST_IS_ALL_TYPES(self), nullptr); + return self->map_map; +} + static FlValue* core_tests_pigeon_test_all_types_to_list( CoreTestsPigeonTestAllTypes* self) { FlValue* values = fl_value_new_list(); @@ -250,7 +405,17 @@ static FlValue* core_tests_pigeon_test_all_types_to_list( fl_value_append_take(values, fl_value_ref(self->int_list)); fl_value_append_take(values, fl_value_ref(self->double_list)); fl_value_append_take(values, fl_value_ref(self->bool_list)); + fl_value_append_take(values, fl_value_ref(self->enum_list)); + fl_value_append_take(values, fl_value_ref(self->object_list)); + fl_value_append_take(values, fl_value_ref(self->list_list)); + fl_value_append_take(values, fl_value_ref(self->map_list)); fl_value_append_take(values, fl_value_ref(self->map)); + fl_value_append_take(values, fl_value_ref(self->string_map)); + fl_value_append_take(values, fl_value_ref(self->int_map)); + fl_value_append_take(values, fl_value_ref(self->enum_map)); + fl_value_append_take(values, fl_value_ref(self->object_map)); + fl_value_append_take(values, fl_value_ref(self->list_map)); + fl_value_append_take(values, fl_value_ref(self->map_map)); return values; } @@ -300,12 +465,34 @@ core_tests_pigeon_test_all_types_new_from_list(FlValue* values) { FlValue* value16 = fl_value_get_list_value(values, 16); FlValue* bool_list = value16; FlValue* value17 = fl_value_get_list_value(values, 17); - FlValue* map = value17; + FlValue* enum_list = value17; + FlValue* value18 = fl_value_get_list_value(values, 18); + FlValue* object_list = value18; + FlValue* value19 = fl_value_get_list_value(values, 19); + FlValue* list_list = value19; + FlValue* value20 = fl_value_get_list_value(values, 20); + FlValue* map_list = value20; + FlValue* value21 = fl_value_get_list_value(values, 21); + FlValue* map = value21; + FlValue* value22 = fl_value_get_list_value(values, 22); + FlValue* string_map = value22; + FlValue* value23 = fl_value_get_list_value(values, 23); + FlValue* int_map = value23; + FlValue* value24 = fl_value_get_list_value(values, 24); + FlValue* enum_map = value24; + FlValue* value25 = fl_value_get_list_value(values, 25); + FlValue* object_map = value25; + FlValue* value26 = fl_value_get_list_value(values, 26); + FlValue* list_map = value26; + FlValue* value27 = fl_value_get_list_value(values, 27); + FlValue* map_map = value27; return core_tests_pigeon_test_all_types_new( a_bool, an_int, an_int64, a_double, a_byte_array, a_byte_array_length, a4_byte_array, a4_byte_array_length, a8_byte_array, a8_byte_array_length, a_float_array, a_float_array_length, an_enum, another_enum, a_string, - an_object, list, string_list, int_list, double_list, bool_list, map); + an_object, list, string_list, int_list, double_list, bool_list, enum_list, + object_list, list_list, map_list, map, string_map, int_map, enum_map, + object_map, list_map, map_map); } struct _CoreTestsPigeonTestAllNullableTypes { @@ -323,9 +510,6 @@ struct _CoreTestsPigeonTestAllNullableTypes { size_t a_nullable8_byte_array_length; double* a_nullable_float_array; size_t a_nullable_float_array_length; - FlValue* nullable_nested_list; - FlValue* nullable_map_with_annotations; - FlValue* nullable_map_with_object; CoreTestsPigeonTestAnEnum* a_nullable_enum; CoreTestsPigeonTestAnotherEnum* another_nullable_enum; gchar* a_nullable_string; @@ -336,8 +520,19 @@ struct _CoreTestsPigeonTestAllNullableTypes { FlValue* int_list; FlValue* double_list; FlValue* bool_list; - FlValue* nested_class_list; + FlValue* enum_list; + FlValue* object_list; + FlValue* list_list; + FlValue* map_list; + FlValue* recursive_class_list; FlValue* map; + FlValue* string_map; + FlValue* int_map; + FlValue* enum_map; + FlValue* object_map; + FlValue* list_map; + FlValue* map_map; + FlValue* recursive_class_map; }; G_DEFINE_TYPE(CoreTestsPigeonTestAllNullableTypes, @@ -350,9 +545,6 @@ static void core_tests_pigeon_test_all_nullable_types_dispose(GObject* object) { g_clear_pointer(&self->a_nullable_int, g_free); g_clear_pointer(&self->a_nullable_int64, g_free); g_clear_pointer(&self->a_nullable_double, g_free); - g_clear_pointer(&self->nullable_nested_list, fl_value_unref); - g_clear_pointer(&self->nullable_map_with_annotations, fl_value_unref); - g_clear_pointer(&self->nullable_map_with_object, fl_value_unref); g_clear_pointer(&self->a_nullable_enum, g_free); g_clear_pointer(&self->another_nullable_enum, g_free); g_clear_pointer(&self->a_nullable_string, g_free); @@ -363,8 +555,19 @@ static void core_tests_pigeon_test_all_nullable_types_dispose(GObject* object) { g_clear_pointer(&self->int_list, fl_value_unref); g_clear_pointer(&self->double_list, fl_value_unref); g_clear_pointer(&self->bool_list, fl_value_unref); - g_clear_pointer(&self->nested_class_list, fl_value_unref); + g_clear_pointer(&self->enum_list, fl_value_unref); + g_clear_pointer(&self->object_list, fl_value_unref); + g_clear_pointer(&self->list_list, fl_value_unref); + g_clear_pointer(&self->map_list, fl_value_unref); + g_clear_pointer(&self->recursive_class_list, fl_value_unref); g_clear_pointer(&self->map, fl_value_unref); + g_clear_pointer(&self->string_map, fl_value_unref); + g_clear_pointer(&self->int_map, fl_value_unref); + g_clear_pointer(&self->enum_map, fl_value_unref); + g_clear_pointer(&self->object_map, fl_value_unref); + g_clear_pointer(&self->list_map, fl_value_unref); + g_clear_pointer(&self->map_map, fl_value_unref); + g_clear_pointer(&self->recursive_class_map, fl_value_unref); G_OBJECT_CLASS(core_tests_pigeon_test_all_nullable_types_parent_class) ->dispose(object); } @@ -386,14 +589,16 @@ core_tests_pigeon_test_all_nullable_types_new( const int32_t* a_nullable4_byte_array, size_t a_nullable4_byte_array_length, const int64_t* a_nullable8_byte_array, size_t a_nullable8_byte_array_length, const double* a_nullable_float_array, size_t a_nullable_float_array_length, - FlValue* nullable_nested_list, FlValue* nullable_map_with_annotations, - FlValue* nullable_map_with_object, CoreTestsPigeonTestAnEnum* a_nullable_enum, CoreTestsPigeonTestAnotherEnum* another_nullable_enum, const gchar* a_nullable_string, FlValue* a_nullable_object, CoreTestsPigeonTestAllNullableTypes* all_nullable_types, FlValue* list, FlValue* string_list, FlValue* int_list, FlValue* double_list, - FlValue* bool_list, FlValue* nested_class_list, FlValue* map) { + FlValue* bool_list, FlValue* enum_list, FlValue* object_list, + FlValue* list_list, FlValue* map_list, FlValue* recursive_class_list, + FlValue* map, FlValue* string_map, FlValue* int_map, FlValue* enum_map, + FlValue* object_map, FlValue* list_map, FlValue* map_map, + FlValue* recursive_class_map) { CoreTestsPigeonTestAllNullableTypes* self = CORE_TESTS_PIGEON_TEST_ALL_NULLABLE_TYPES(g_object_new( core_tests_pigeon_test_all_nullable_types_get_type(), nullptr)); @@ -460,22 +665,6 @@ core_tests_pigeon_test_all_nullable_types_new( self->a_nullable_float_array = nullptr; self->a_nullable_float_array_length = 0; } - if (nullable_nested_list != nullptr) { - self->nullable_nested_list = fl_value_ref(nullable_nested_list); - } else { - self->nullable_nested_list = nullptr; - } - if (nullable_map_with_annotations != nullptr) { - self->nullable_map_with_annotations = - fl_value_ref(nullable_map_with_annotations); - } else { - self->nullable_map_with_annotations = nullptr; - } - if (nullable_map_with_object != nullptr) { - self->nullable_map_with_object = fl_value_ref(nullable_map_with_object); - } else { - self->nullable_map_with_object = nullptr; - } if (a_nullable_enum != nullptr) { self->a_nullable_enum = static_cast( malloc(sizeof(CoreTestsPigeonTestAnEnum))); @@ -531,16 +720,71 @@ core_tests_pigeon_test_all_nullable_types_new( } else { self->bool_list = nullptr; } - if (nested_class_list != nullptr) { - self->nested_class_list = fl_value_ref(nested_class_list); + if (enum_list != nullptr) { + self->enum_list = fl_value_ref(enum_list); + } else { + self->enum_list = nullptr; + } + if (object_list != nullptr) { + self->object_list = fl_value_ref(object_list); + } else { + self->object_list = nullptr; + } + if (list_list != nullptr) { + self->list_list = fl_value_ref(list_list); + } else { + self->list_list = nullptr; + } + if (map_list != nullptr) { + self->map_list = fl_value_ref(map_list); + } else { + self->map_list = nullptr; + } + if (recursive_class_list != nullptr) { + self->recursive_class_list = fl_value_ref(recursive_class_list); } else { - self->nested_class_list = nullptr; + self->recursive_class_list = nullptr; } if (map != nullptr) { self->map = fl_value_ref(map); } else { self->map = nullptr; } + if (string_map != nullptr) { + self->string_map = fl_value_ref(string_map); + } else { + self->string_map = nullptr; + } + if (int_map != nullptr) { + self->int_map = fl_value_ref(int_map); + } else { + self->int_map = nullptr; + } + if (enum_map != nullptr) { + self->enum_map = fl_value_ref(enum_map); + } else { + self->enum_map = nullptr; + } + if (object_map != nullptr) { + self->object_map = fl_value_ref(object_map); + } else { + self->object_map = nullptr; + } + if (list_map != nullptr) { + self->list_map = fl_value_ref(list_map); + } else { + self->list_map = nullptr; + } + if (map_map != nullptr) { + self->map_map = fl_value_ref(map_map); + } else { + self->map_map = nullptr; + } + if (recursive_class_map != nullptr) { + self->recursive_class_map = fl_value_ref(recursive_class_map); + } else { + self->recursive_class_map = nullptr; + } return self; } @@ -608,28 +852,6 @@ core_tests_pigeon_test_all_nullable_types_get_a_nullable_float_array( return self->a_nullable_float_array; } -FlValue* core_tests_pigeon_test_all_nullable_types_get_nullable_nested_list( - CoreTestsPigeonTestAllNullableTypes* self) { - g_return_val_if_fail(CORE_TESTS_PIGEON_TEST_IS_ALL_NULLABLE_TYPES(self), - nullptr); - return self->nullable_nested_list; -} - -FlValue* -core_tests_pigeon_test_all_nullable_types_get_nullable_map_with_annotations( - CoreTestsPigeonTestAllNullableTypes* self) { - g_return_val_if_fail(CORE_TESTS_PIGEON_TEST_IS_ALL_NULLABLE_TYPES(self), - nullptr); - return self->nullable_map_with_annotations; -} - -FlValue* core_tests_pigeon_test_all_nullable_types_get_nullable_map_with_object( - CoreTestsPigeonTestAllNullableTypes* self) { - g_return_val_if_fail(CORE_TESTS_PIGEON_TEST_IS_ALL_NULLABLE_TYPES(self), - nullptr); - return self->nullable_map_with_object; -} - CoreTestsPigeonTestAnEnum* core_tests_pigeon_test_all_nullable_types_get_a_nullable_enum( CoreTestsPigeonTestAllNullableTypes* self) { @@ -703,11 +925,39 @@ FlValue* core_tests_pigeon_test_all_nullable_types_get_bool_list( return self->bool_list; } -FlValue* core_tests_pigeon_test_all_nullable_types_get_nested_class_list( +FlValue* core_tests_pigeon_test_all_nullable_types_get_enum_list( + CoreTestsPigeonTestAllNullableTypes* self) { + g_return_val_if_fail(CORE_TESTS_PIGEON_TEST_IS_ALL_NULLABLE_TYPES(self), + nullptr); + return self->enum_list; +} + +FlValue* core_tests_pigeon_test_all_nullable_types_get_object_list( + CoreTestsPigeonTestAllNullableTypes* self) { + g_return_val_if_fail(CORE_TESTS_PIGEON_TEST_IS_ALL_NULLABLE_TYPES(self), + nullptr); + return self->object_list; +} + +FlValue* core_tests_pigeon_test_all_nullable_types_get_list_list( + CoreTestsPigeonTestAllNullableTypes* self) { + g_return_val_if_fail(CORE_TESTS_PIGEON_TEST_IS_ALL_NULLABLE_TYPES(self), + nullptr); + return self->list_list; +} + +FlValue* core_tests_pigeon_test_all_nullable_types_get_map_list( + CoreTestsPigeonTestAllNullableTypes* self) { + g_return_val_if_fail(CORE_TESTS_PIGEON_TEST_IS_ALL_NULLABLE_TYPES(self), + nullptr); + return self->map_list; +} + +FlValue* core_tests_pigeon_test_all_nullable_types_get_recursive_class_list( CoreTestsPigeonTestAllNullableTypes* self) { g_return_val_if_fail(CORE_TESTS_PIGEON_TEST_IS_ALL_NULLABLE_TYPES(self), nullptr); - return self->nested_class_list; + return self->recursive_class_list; } FlValue* core_tests_pigeon_test_all_nullable_types_get_map( @@ -717,6 +967,55 @@ FlValue* core_tests_pigeon_test_all_nullable_types_get_map( return self->map; } +FlValue* core_tests_pigeon_test_all_nullable_types_get_string_map( + CoreTestsPigeonTestAllNullableTypes* self) { + g_return_val_if_fail(CORE_TESTS_PIGEON_TEST_IS_ALL_NULLABLE_TYPES(self), + nullptr); + return self->string_map; +} + +FlValue* core_tests_pigeon_test_all_nullable_types_get_int_map( + CoreTestsPigeonTestAllNullableTypes* self) { + g_return_val_if_fail(CORE_TESTS_PIGEON_TEST_IS_ALL_NULLABLE_TYPES(self), + nullptr); + return self->int_map; +} + +FlValue* core_tests_pigeon_test_all_nullable_types_get_enum_map( + CoreTestsPigeonTestAllNullableTypes* self) { + g_return_val_if_fail(CORE_TESTS_PIGEON_TEST_IS_ALL_NULLABLE_TYPES(self), + nullptr); + return self->enum_map; +} + +FlValue* core_tests_pigeon_test_all_nullable_types_get_object_map( + CoreTestsPigeonTestAllNullableTypes* self) { + g_return_val_if_fail(CORE_TESTS_PIGEON_TEST_IS_ALL_NULLABLE_TYPES(self), + nullptr); + return self->object_map; +} + +FlValue* core_tests_pigeon_test_all_nullable_types_get_list_map( + CoreTestsPigeonTestAllNullableTypes* self) { + g_return_val_if_fail(CORE_TESTS_PIGEON_TEST_IS_ALL_NULLABLE_TYPES(self), + nullptr); + return self->list_map; +} + +FlValue* core_tests_pigeon_test_all_nullable_types_get_map_map( + CoreTestsPigeonTestAllNullableTypes* self) { + g_return_val_if_fail(CORE_TESTS_PIGEON_TEST_IS_ALL_NULLABLE_TYPES(self), + nullptr); + return self->map_map; +} + +FlValue* core_tests_pigeon_test_all_nullable_types_get_recursive_class_map( + CoreTestsPigeonTestAllNullableTypes* self) { + g_return_val_if_fail(CORE_TESTS_PIGEON_TEST_IS_ALL_NULLABLE_TYPES(self), + nullptr); + return self->recursive_class_map; +} + static FlValue* core_tests_pigeon_test_all_nullable_types_to_list( CoreTestsPigeonTestAllNullableTypes* self) { FlValue* values = fl_value_new_list(); @@ -753,17 +1052,6 @@ static FlValue* core_tests_pigeon_test_all_nullable_types_to_list( ? fl_value_new_float_list(self->a_nullable_float_array, self->a_nullable_float_array_length) : fl_value_new_null()); - fl_value_append_take(values, self->nullable_nested_list != nullptr - ? fl_value_ref(self->nullable_nested_list) - : fl_value_new_null()); - fl_value_append_take(values, - self->nullable_map_with_annotations != nullptr - ? fl_value_ref(self->nullable_map_with_annotations) - : fl_value_new_null()); - fl_value_append_take(values, - self->nullable_map_with_object != nullptr - ? fl_value_ref(self->nullable_map_with_object) - : fl_value_new_null()); fl_value_append_take( values, self->a_nullable_enum != nullptr @@ -786,7 +1074,7 @@ static FlValue* core_tests_pigeon_test_all_nullable_types_to_list( fl_value_append_take( values, self->all_nullable_types != nullptr - ? fl_value_new_custom_object(132, G_OBJECT(self->all_nullable_types)) + ? fl_value_new_custom_object(133, G_OBJECT(self->all_nullable_types)) : fl_value_new_null()); fl_value_append_take(values, self->list != nullptr ? fl_value_ref(self->list) : fl_value_new_null()); @@ -802,11 +1090,44 @@ static FlValue* core_tests_pigeon_test_all_nullable_types_to_list( fl_value_append_take(values, self->bool_list != nullptr ? fl_value_ref(self->bool_list) : fl_value_new_null()); - fl_value_append_take(values, self->nested_class_list != nullptr - ? fl_value_ref(self->nested_class_list) + fl_value_append_take(values, self->enum_list != nullptr + ? fl_value_ref(self->enum_list) + : fl_value_new_null()); + fl_value_append_take(values, self->object_list != nullptr + ? fl_value_ref(self->object_list) + : fl_value_new_null()); + fl_value_append_take(values, self->list_list != nullptr + ? fl_value_ref(self->list_list) + : fl_value_new_null()); + fl_value_append_take(values, self->map_list != nullptr + ? fl_value_ref(self->map_list) + : fl_value_new_null()); + fl_value_append_take(values, self->recursive_class_list != nullptr + ? fl_value_ref(self->recursive_class_list) : fl_value_new_null()); fl_value_append_take(values, self->map != nullptr ? fl_value_ref(self->map) : fl_value_new_null()); + fl_value_append_take(values, self->string_map != nullptr + ? fl_value_ref(self->string_map) + : fl_value_new_null()); + fl_value_append_take(values, self->int_map != nullptr + ? fl_value_ref(self->int_map) + : fl_value_new_null()); + fl_value_append_take(values, self->enum_map != nullptr + ? fl_value_ref(self->enum_map) + : fl_value_new_null()); + fl_value_append_take(values, self->object_map != nullptr + ? fl_value_ref(self->object_map) + : fl_value_new_null()); + fl_value_append_take(values, self->list_map != nullptr + ? fl_value_ref(self->list_map) + : fl_value_new_null()); + fl_value_append_take(values, self->map_map != nullptr + ? fl_value_ref(self->map_map) + : fl_value_new_null()); + fl_value_append_take(values, self->recursive_class_map != nullptr + ? fl_value_ref(self->recursive_class_map) + : fl_value_new_null()); return values; } @@ -869,99 +1190,140 @@ core_tests_pigeon_test_all_nullable_types_new_from_list(FlValue* values) { a_nullable_float_array_length = fl_value_get_length(value7); } FlValue* value8 = fl_value_get_list_value(values, 8); - FlValue* nullable_nested_list = nullptr; + CoreTestsPigeonTestAnEnum* a_nullable_enum = nullptr; + CoreTestsPigeonTestAnEnum a_nullable_enum_value; if (fl_value_get_type(value8) != FL_VALUE_TYPE_NULL) { - nullable_nested_list = value8; + a_nullable_enum_value = static_cast( + fl_value_get_int(reinterpret_cast( + const_cast(fl_value_get_custom_value(value8))))); + a_nullable_enum = &a_nullable_enum_value; } FlValue* value9 = fl_value_get_list_value(values, 9); - FlValue* nullable_map_with_annotations = nullptr; + CoreTestsPigeonTestAnotherEnum* another_nullable_enum = nullptr; + CoreTestsPigeonTestAnotherEnum another_nullable_enum_value; if (fl_value_get_type(value9) != FL_VALUE_TYPE_NULL) { - nullable_map_with_annotations = value9; + another_nullable_enum_value = static_cast( + fl_value_get_int(reinterpret_cast( + const_cast(fl_value_get_custom_value(value9))))); + another_nullable_enum = &another_nullable_enum_value; } FlValue* value10 = fl_value_get_list_value(values, 10); - FlValue* nullable_map_with_object = nullptr; + const gchar* a_nullable_string = nullptr; if (fl_value_get_type(value10) != FL_VALUE_TYPE_NULL) { - nullable_map_with_object = value10; + a_nullable_string = fl_value_get_string(value10); } FlValue* value11 = fl_value_get_list_value(values, 11); - CoreTestsPigeonTestAnEnum* a_nullable_enum = nullptr; - CoreTestsPigeonTestAnEnum a_nullable_enum_value; + FlValue* a_nullable_object = nullptr; if (fl_value_get_type(value11) != FL_VALUE_TYPE_NULL) { - a_nullable_enum_value = static_cast( - fl_value_get_int(reinterpret_cast( - const_cast(fl_value_get_custom_value(value11))))); - a_nullable_enum = &a_nullable_enum_value; + a_nullable_object = value11; } FlValue* value12 = fl_value_get_list_value(values, 12); - CoreTestsPigeonTestAnotherEnum* another_nullable_enum = nullptr; - CoreTestsPigeonTestAnotherEnum another_nullable_enum_value; + CoreTestsPigeonTestAllNullableTypes* all_nullable_types = nullptr; if (fl_value_get_type(value12) != FL_VALUE_TYPE_NULL) { - another_nullable_enum_value = static_cast( - fl_value_get_int(reinterpret_cast( - const_cast(fl_value_get_custom_value(value12))))); - another_nullable_enum = &another_nullable_enum_value; + all_nullable_types = CORE_TESTS_PIGEON_TEST_ALL_NULLABLE_TYPES( + fl_value_get_custom_value_object(value12)); } FlValue* value13 = fl_value_get_list_value(values, 13); - const gchar* a_nullable_string = nullptr; + FlValue* list = nullptr; if (fl_value_get_type(value13) != FL_VALUE_TYPE_NULL) { - a_nullable_string = fl_value_get_string(value13); + list = value13; } FlValue* value14 = fl_value_get_list_value(values, 14); - FlValue* a_nullable_object = nullptr; + FlValue* string_list = nullptr; if (fl_value_get_type(value14) != FL_VALUE_TYPE_NULL) { - a_nullable_object = value14; + string_list = value14; } FlValue* value15 = fl_value_get_list_value(values, 15); - CoreTestsPigeonTestAllNullableTypes* all_nullable_types = nullptr; + FlValue* int_list = nullptr; if (fl_value_get_type(value15) != FL_VALUE_TYPE_NULL) { - all_nullable_types = CORE_TESTS_PIGEON_TEST_ALL_NULLABLE_TYPES( - fl_value_get_custom_value_object(value15)); + int_list = value15; } FlValue* value16 = fl_value_get_list_value(values, 16); - FlValue* list = nullptr; + FlValue* double_list = nullptr; if (fl_value_get_type(value16) != FL_VALUE_TYPE_NULL) { - list = value16; + double_list = value16; } FlValue* value17 = fl_value_get_list_value(values, 17); - FlValue* string_list = nullptr; + FlValue* bool_list = nullptr; if (fl_value_get_type(value17) != FL_VALUE_TYPE_NULL) { - string_list = value17; + bool_list = value17; } FlValue* value18 = fl_value_get_list_value(values, 18); - FlValue* int_list = nullptr; + FlValue* enum_list = nullptr; if (fl_value_get_type(value18) != FL_VALUE_TYPE_NULL) { - int_list = value18; + enum_list = value18; } FlValue* value19 = fl_value_get_list_value(values, 19); - FlValue* double_list = nullptr; + FlValue* object_list = nullptr; if (fl_value_get_type(value19) != FL_VALUE_TYPE_NULL) { - double_list = value19; + object_list = value19; } FlValue* value20 = fl_value_get_list_value(values, 20); - FlValue* bool_list = nullptr; + FlValue* list_list = nullptr; if (fl_value_get_type(value20) != FL_VALUE_TYPE_NULL) { - bool_list = value20; + list_list = value20; } FlValue* value21 = fl_value_get_list_value(values, 21); - FlValue* nested_class_list = nullptr; + FlValue* map_list = nullptr; if (fl_value_get_type(value21) != FL_VALUE_TYPE_NULL) { - nested_class_list = value21; + map_list = value21; } FlValue* value22 = fl_value_get_list_value(values, 22); - FlValue* map = nullptr; + FlValue* recursive_class_list = nullptr; if (fl_value_get_type(value22) != FL_VALUE_TYPE_NULL) { - map = value22; + recursive_class_list = value22; + } + FlValue* value23 = fl_value_get_list_value(values, 23); + FlValue* map = nullptr; + if (fl_value_get_type(value23) != FL_VALUE_TYPE_NULL) { + map = value23; + } + FlValue* value24 = fl_value_get_list_value(values, 24); + FlValue* string_map = nullptr; + if (fl_value_get_type(value24) != FL_VALUE_TYPE_NULL) { + string_map = value24; + } + FlValue* value25 = fl_value_get_list_value(values, 25); + FlValue* int_map = nullptr; + if (fl_value_get_type(value25) != FL_VALUE_TYPE_NULL) { + int_map = value25; + } + FlValue* value26 = fl_value_get_list_value(values, 26); + FlValue* enum_map = nullptr; + if (fl_value_get_type(value26) != FL_VALUE_TYPE_NULL) { + enum_map = value26; + } + FlValue* value27 = fl_value_get_list_value(values, 27); + FlValue* object_map = nullptr; + if (fl_value_get_type(value27) != FL_VALUE_TYPE_NULL) { + object_map = value27; + } + FlValue* value28 = fl_value_get_list_value(values, 28); + FlValue* list_map = nullptr; + if (fl_value_get_type(value28) != FL_VALUE_TYPE_NULL) { + list_map = value28; + } + FlValue* value29 = fl_value_get_list_value(values, 29); + FlValue* map_map = nullptr; + if (fl_value_get_type(value29) != FL_VALUE_TYPE_NULL) { + map_map = value29; + } + FlValue* value30 = fl_value_get_list_value(values, 30); + FlValue* recursive_class_map = nullptr; + if (fl_value_get_type(value30) != FL_VALUE_TYPE_NULL) { + recursive_class_map = value30; } return core_tests_pigeon_test_all_nullable_types_new( a_nullable_bool, a_nullable_int, a_nullable_int64, a_nullable_double, a_nullable_byte_array, a_nullable_byte_array_length, a_nullable4_byte_array, a_nullable4_byte_array_length, a_nullable8_byte_array, a_nullable8_byte_array_length, - a_nullable_float_array, a_nullable_float_array_length, - nullable_nested_list, nullable_map_with_annotations, - nullable_map_with_object, a_nullable_enum, another_nullable_enum, - a_nullable_string, a_nullable_object, all_nullable_types, list, - string_list, int_list, double_list, bool_list, nested_class_list, map); + a_nullable_float_array, a_nullable_float_array_length, a_nullable_enum, + another_nullable_enum, a_nullable_string, a_nullable_object, + all_nullable_types, list, string_list, int_list, double_list, bool_list, + enum_list, object_list, list_list, map_list, recursive_class_list, map, + string_map, int_map, enum_map, object_map, list_map, map_map, + recursive_class_map); } struct _CoreTestsPigeonTestAllNullableTypesWithoutRecursion { @@ -979,9 +1341,6 @@ struct _CoreTestsPigeonTestAllNullableTypesWithoutRecursion { size_t a_nullable8_byte_array_length; double* a_nullable_float_array; size_t a_nullable_float_array_length; - FlValue* nullable_nested_list; - FlValue* nullable_map_with_annotations; - FlValue* nullable_map_with_object; CoreTestsPigeonTestAnEnum* a_nullable_enum; CoreTestsPigeonTestAnotherEnum* another_nullable_enum; gchar* a_nullable_string; @@ -991,7 +1350,17 @@ struct _CoreTestsPigeonTestAllNullableTypesWithoutRecursion { FlValue* int_list; FlValue* double_list; FlValue* bool_list; + FlValue* enum_list; + FlValue* object_list; + FlValue* list_list; + FlValue* map_list; FlValue* map; + FlValue* string_map; + FlValue* int_map; + FlValue* enum_map; + FlValue* object_map; + FlValue* list_map; + FlValue* map_map; }; G_DEFINE_TYPE(CoreTestsPigeonTestAllNullableTypesWithoutRecursion, @@ -1006,9 +1375,6 @@ static void core_tests_pigeon_test_all_nullable_types_without_recursion_dispose( g_clear_pointer(&self->a_nullable_int, g_free); g_clear_pointer(&self->a_nullable_int64, g_free); g_clear_pointer(&self->a_nullable_double, g_free); - g_clear_pointer(&self->nullable_nested_list, fl_value_unref); - g_clear_pointer(&self->nullable_map_with_annotations, fl_value_unref); - g_clear_pointer(&self->nullable_map_with_object, fl_value_unref); g_clear_pointer(&self->a_nullable_enum, g_free); g_clear_pointer(&self->another_nullable_enum, g_free); g_clear_pointer(&self->a_nullable_string, g_free); @@ -1018,7 +1384,17 @@ static void core_tests_pigeon_test_all_nullable_types_without_recursion_dispose( g_clear_pointer(&self->int_list, fl_value_unref); g_clear_pointer(&self->double_list, fl_value_unref); g_clear_pointer(&self->bool_list, fl_value_unref); + g_clear_pointer(&self->enum_list, fl_value_unref); + g_clear_pointer(&self->object_list, fl_value_unref); + g_clear_pointer(&self->list_list, fl_value_unref); + g_clear_pointer(&self->map_list, fl_value_unref); g_clear_pointer(&self->map, fl_value_unref); + g_clear_pointer(&self->string_map, fl_value_unref); + g_clear_pointer(&self->int_map, fl_value_unref); + g_clear_pointer(&self->enum_map, fl_value_unref); + g_clear_pointer(&self->object_map, fl_value_unref); + g_clear_pointer(&self->list_map, fl_value_unref); + g_clear_pointer(&self->map_map, fl_value_unref); G_OBJECT_CLASS( core_tests_pigeon_test_all_nullable_types_without_recursion_parent_class) ->dispose(object); @@ -1042,13 +1418,14 @@ core_tests_pigeon_test_all_nullable_types_without_recursion_new( const int32_t* a_nullable4_byte_array, size_t a_nullable4_byte_array_length, const int64_t* a_nullable8_byte_array, size_t a_nullable8_byte_array_length, const double* a_nullable_float_array, size_t a_nullable_float_array_length, - FlValue* nullable_nested_list, FlValue* nullable_map_with_annotations, - FlValue* nullable_map_with_object, CoreTestsPigeonTestAnEnum* a_nullable_enum, CoreTestsPigeonTestAnotherEnum* another_nullable_enum, const gchar* a_nullable_string, FlValue* a_nullable_object, FlValue* list, FlValue* string_list, FlValue* int_list, FlValue* double_list, - FlValue* bool_list, FlValue* map) { + FlValue* bool_list, FlValue* enum_list, FlValue* object_list, + FlValue* list_list, FlValue* map_list, FlValue* map, FlValue* string_map, + FlValue* int_map, FlValue* enum_map, FlValue* object_map, FlValue* list_map, + FlValue* map_map) { CoreTestsPigeonTestAllNullableTypesWithoutRecursion* self = CORE_TESTS_PIGEON_TEST_ALL_NULLABLE_TYPES_WITHOUT_RECURSION(g_object_new( core_tests_pigeon_test_all_nullable_types_without_recursion_get_type(), @@ -1116,22 +1493,6 @@ core_tests_pigeon_test_all_nullable_types_without_recursion_new( self->a_nullable_float_array = nullptr; self->a_nullable_float_array_length = 0; } - if (nullable_nested_list != nullptr) { - self->nullable_nested_list = fl_value_ref(nullable_nested_list); - } else { - self->nullable_nested_list = nullptr; - } - if (nullable_map_with_annotations != nullptr) { - self->nullable_map_with_annotations = - fl_value_ref(nullable_map_with_annotations); - } else { - self->nullable_map_with_annotations = nullptr; - } - if (nullable_map_with_object != nullptr) { - self->nullable_map_with_object = fl_value_ref(nullable_map_with_object); - } else { - self->nullable_map_with_object = nullptr; - } if (a_nullable_enum != nullptr) { self->a_nullable_enum = static_cast( malloc(sizeof(CoreTestsPigeonTestAnEnum))); @@ -1181,11 +1542,61 @@ core_tests_pigeon_test_all_nullable_types_without_recursion_new( } else { self->bool_list = nullptr; } + if (enum_list != nullptr) { + self->enum_list = fl_value_ref(enum_list); + } else { + self->enum_list = nullptr; + } + if (object_list != nullptr) { + self->object_list = fl_value_ref(object_list); + } else { + self->object_list = nullptr; + } + if (list_list != nullptr) { + self->list_list = fl_value_ref(list_list); + } else { + self->list_list = nullptr; + } + if (map_list != nullptr) { + self->map_list = fl_value_ref(map_list); + } else { + self->map_list = nullptr; + } if (map != nullptr) { self->map = fl_value_ref(map); } else { self->map = nullptr; } + if (string_map != nullptr) { + self->string_map = fl_value_ref(string_map); + } else { + self->string_map = nullptr; + } + if (int_map != nullptr) { + self->int_map = fl_value_ref(int_map); + } else { + self->int_map = nullptr; + } + if (enum_map != nullptr) { + self->enum_map = fl_value_ref(enum_map); + } else { + self->enum_map = nullptr; + } + if (object_map != nullptr) { + self->object_map = fl_value_ref(object_map); + } else { + self->object_map = nullptr; + } + if (list_map != nullptr) { + self->list_map = fl_value_ref(list_map); + } else { + self->list_map = nullptr; + } + if (map_map != nullptr) { + self->map_map = fl_value_ref(map_map); + } else { + self->map_map = nullptr; + } return self; } @@ -1265,33 +1676,6 @@ core_tests_pigeon_test_all_nullable_types_without_recursion_get_a_nullable_float return self->a_nullable_float_array; } -FlValue* -core_tests_pigeon_test_all_nullable_types_without_recursion_get_nullable_nested_list( - CoreTestsPigeonTestAllNullableTypesWithoutRecursion* self) { - g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_ALL_NULLABLE_TYPES_WITHOUT_RECURSION(self), - nullptr); - return self->nullable_nested_list; -} - -FlValue* -core_tests_pigeon_test_all_nullable_types_without_recursion_get_nullable_map_with_annotations( - CoreTestsPigeonTestAllNullableTypesWithoutRecursion* self) { - g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_ALL_NULLABLE_TYPES_WITHOUT_RECURSION(self), - nullptr); - return self->nullable_map_with_annotations; -} - -FlValue* -core_tests_pigeon_test_all_nullable_types_without_recursion_get_nullable_map_with_object( - CoreTestsPigeonTestAllNullableTypesWithoutRecursion* self) { - g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_ALL_NULLABLE_TYPES_WITHOUT_RECURSION(self), - nullptr); - return self->nullable_map_with_object; -} - CoreTestsPigeonTestAnEnum* core_tests_pigeon_test_all_nullable_types_without_recursion_get_a_nullable_enum( CoreTestsPigeonTestAllNullableTypesWithoutRecursion* self) { @@ -1372,6 +1756,42 @@ core_tests_pigeon_test_all_nullable_types_without_recursion_get_bool_list( return self->bool_list; } +FlValue* +core_tests_pigeon_test_all_nullable_types_without_recursion_get_enum_list( + CoreTestsPigeonTestAllNullableTypesWithoutRecursion* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_ALL_NULLABLE_TYPES_WITHOUT_RECURSION(self), + nullptr); + return self->enum_list; +} + +FlValue* +core_tests_pigeon_test_all_nullable_types_without_recursion_get_object_list( + CoreTestsPigeonTestAllNullableTypesWithoutRecursion* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_ALL_NULLABLE_TYPES_WITHOUT_RECURSION(self), + nullptr); + return self->object_list; +} + +FlValue* +core_tests_pigeon_test_all_nullable_types_without_recursion_get_list_list( + CoreTestsPigeonTestAllNullableTypesWithoutRecursion* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_ALL_NULLABLE_TYPES_WITHOUT_RECURSION(self), + nullptr); + return self->list_list; +} + +FlValue* +core_tests_pigeon_test_all_nullable_types_without_recursion_get_map_list( + CoreTestsPigeonTestAllNullableTypesWithoutRecursion* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_ALL_NULLABLE_TYPES_WITHOUT_RECURSION(self), + nullptr); + return self->map_list; +} + FlValue* core_tests_pigeon_test_all_nullable_types_without_recursion_get_map( CoreTestsPigeonTestAllNullableTypesWithoutRecursion* self) { g_return_val_if_fail( @@ -1380,6 +1800,60 @@ FlValue* core_tests_pigeon_test_all_nullable_types_without_recursion_get_map( return self->map; } +FlValue* +core_tests_pigeon_test_all_nullable_types_without_recursion_get_string_map( + CoreTestsPigeonTestAllNullableTypesWithoutRecursion* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_ALL_NULLABLE_TYPES_WITHOUT_RECURSION(self), + nullptr); + return self->string_map; +} + +FlValue* +core_tests_pigeon_test_all_nullable_types_without_recursion_get_int_map( + CoreTestsPigeonTestAllNullableTypesWithoutRecursion* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_ALL_NULLABLE_TYPES_WITHOUT_RECURSION(self), + nullptr); + return self->int_map; +} + +FlValue* +core_tests_pigeon_test_all_nullable_types_without_recursion_get_enum_map( + CoreTestsPigeonTestAllNullableTypesWithoutRecursion* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_ALL_NULLABLE_TYPES_WITHOUT_RECURSION(self), + nullptr); + return self->enum_map; +} + +FlValue* +core_tests_pigeon_test_all_nullable_types_without_recursion_get_object_map( + CoreTestsPigeonTestAllNullableTypesWithoutRecursion* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_ALL_NULLABLE_TYPES_WITHOUT_RECURSION(self), + nullptr); + return self->object_map; +} + +FlValue* +core_tests_pigeon_test_all_nullable_types_without_recursion_get_list_map( + CoreTestsPigeonTestAllNullableTypesWithoutRecursion* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_ALL_NULLABLE_TYPES_WITHOUT_RECURSION(self), + nullptr); + return self->list_map; +} + +FlValue* +core_tests_pigeon_test_all_nullable_types_without_recursion_get_map_map( + CoreTestsPigeonTestAllNullableTypesWithoutRecursion* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_ALL_NULLABLE_TYPES_WITHOUT_RECURSION(self), + nullptr); + return self->map_map; +} + static FlValue* core_tests_pigeon_test_all_nullable_types_without_recursion_to_list( CoreTestsPigeonTestAllNullableTypesWithoutRecursion* self) { @@ -1417,17 +1891,6 @@ core_tests_pigeon_test_all_nullable_types_without_recursion_to_list( ? fl_value_new_float_list(self->a_nullable_float_array, self->a_nullable_float_array_length) : fl_value_new_null()); - fl_value_append_take(values, self->nullable_nested_list != nullptr - ? fl_value_ref(self->nullable_nested_list) - : fl_value_new_null()); - fl_value_append_take(values, - self->nullable_map_with_annotations != nullptr - ? fl_value_ref(self->nullable_map_with_annotations) - : fl_value_new_null()); - fl_value_append_take(values, - self->nullable_map_with_object != nullptr - ? fl_value_ref(self->nullable_map_with_object) - : fl_value_new_null()); fl_value_append_take( values, self->a_nullable_enum != nullptr @@ -1461,8 +1924,38 @@ core_tests_pigeon_test_all_nullable_types_without_recursion_to_list( fl_value_append_take(values, self->bool_list != nullptr ? fl_value_ref(self->bool_list) : fl_value_new_null()); + fl_value_append_take(values, self->enum_list != nullptr + ? fl_value_ref(self->enum_list) + : fl_value_new_null()); + fl_value_append_take(values, self->object_list != nullptr + ? fl_value_ref(self->object_list) + : fl_value_new_null()); + fl_value_append_take(values, self->list_list != nullptr + ? fl_value_ref(self->list_list) + : fl_value_new_null()); + fl_value_append_take(values, self->map_list != nullptr + ? fl_value_ref(self->map_list) + : fl_value_new_null()); fl_value_append_take(values, self->map != nullptr ? fl_value_ref(self->map) : fl_value_new_null()); + fl_value_append_take(values, self->string_map != nullptr + ? fl_value_ref(self->string_map) + : fl_value_new_null()); + fl_value_append_take(values, self->int_map != nullptr + ? fl_value_ref(self->int_map) + : fl_value_new_null()); + fl_value_append_take(values, self->enum_map != nullptr + ? fl_value_ref(self->enum_map) + : fl_value_new_null()); + fl_value_append_take(values, self->object_map != nullptr + ? fl_value_ref(self->object_map) + : fl_value_new_null()); + fl_value_append_take(values, self->list_map != nullptr + ? fl_value_ref(self->list_map) + : fl_value_new_null()); + fl_value_append_take(values, self->map_map != nullptr + ? fl_value_ref(self->map_map) + : fl_value_new_null()); return values; } @@ -1526,88 +2019,123 @@ core_tests_pigeon_test_all_nullable_types_without_recursion_new_from_list( a_nullable_float_array_length = fl_value_get_length(value7); } FlValue* value8 = fl_value_get_list_value(values, 8); - FlValue* nullable_nested_list = nullptr; + CoreTestsPigeonTestAnEnum* a_nullable_enum = nullptr; + CoreTestsPigeonTestAnEnum a_nullable_enum_value; if (fl_value_get_type(value8) != FL_VALUE_TYPE_NULL) { - nullable_nested_list = value8; + a_nullable_enum_value = static_cast( + fl_value_get_int(reinterpret_cast( + const_cast(fl_value_get_custom_value(value8))))); + a_nullable_enum = &a_nullable_enum_value; } FlValue* value9 = fl_value_get_list_value(values, 9); - FlValue* nullable_map_with_annotations = nullptr; + CoreTestsPigeonTestAnotherEnum* another_nullable_enum = nullptr; + CoreTestsPigeonTestAnotherEnum another_nullable_enum_value; if (fl_value_get_type(value9) != FL_VALUE_TYPE_NULL) { - nullable_map_with_annotations = value9; + another_nullable_enum_value = static_cast( + fl_value_get_int(reinterpret_cast( + const_cast(fl_value_get_custom_value(value9))))); + another_nullable_enum = &another_nullable_enum_value; } FlValue* value10 = fl_value_get_list_value(values, 10); - FlValue* nullable_map_with_object = nullptr; + const gchar* a_nullable_string = nullptr; if (fl_value_get_type(value10) != FL_VALUE_TYPE_NULL) { - nullable_map_with_object = value10; + a_nullable_string = fl_value_get_string(value10); } FlValue* value11 = fl_value_get_list_value(values, 11); - CoreTestsPigeonTestAnEnum* a_nullable_enum = nullptr; - CoreTestsPigeonTestAnEnum a_nullable_enum_value; + FlValue* a_nullable_object = nullptr; if (fl_value_get_type(value11) != FL_VALUE_TYPE_NULL) { - a_nullable_enum_value = static_cast( - fl_value_get_int(reinterpret_cast( - const_cast(fl_value_get_custom_value(value11))))); - a_nullable_enum = &a_nullable_enum_value; + a_nullable_object = value11; } FlValue* value12 = fl_value_get_list_value(values, 12); - CoreTestsPigeonTestAnotherEnum* another_nullable_enum = nullptr; - CoreTestsPigeonTestAnotherEnum another_nullable_enum_value; + FlValue* list = nullptr; if (fl_value_get_type(value12) != FL_VALUE_TYPE_NULL) { - another_nullable_enum_value = static_cast( - fl_value_get_int(reinterpret_cast( - const_cast(fl_value_get_custom_value(value12))))); - another_nullable_enum = &another_nullable_enum_value; + list = value12; } FlValue* value13 = fl_value_get_list_value(values, 13); - const gchar* a_nullable_string = nullptr; + FlValue* string_list = nullptr; if (fl_value_get_type(value13) != FL_VALUE_TYPE_NULL) { - a_nullable_string = fl_value_get_string(value13); + string_list = value13; } FlValue* value14 = fl_value_get_list_value(values, 14); - FlValue* a_nullable_object = nullptr; + FlValue* int_list = nullptr; if (fl_value_get_type(value14) != FL_VALUE_TYPE_NULL) { - a_nullable_object = value14; + int_list = value14; } FlValue* value15 = fl_value_get_list_value(values, 15); - FlValue* list = nullptr; + FlValue* double_list = nullptr; if (fl_value_get_type(value15) != FL_VALUE_TYPE_NULL) { - list = value15; + double_list = value15; } FlValue* value16 = fl_value_get_list_value(values, 16); - FlValue* string_list = nullptr; + FlValue* bool_list = nullptr; if (fl_value_get_type(value16) != FL_VALUE_TYPE_NULL) { - string_list = value16; + bool_list = value16; } FlValue* value17 = fl_value_get_list_value(values, 17); - FlValue* int_list = nullptr; + FlValue* enum_list = nullptr; if (fl_value_get_type(value17) != FL_VALUE_TYPE_NULL) { - int_list = value17; + enum_list = value17; } FlValue* value18 = fl_value_get_list_value(values, 18); - FlValue* double_list = nullptr; + FlValue* object_list = nullptr; if (fl_value_get_type(value18) != FL_VALUE_TYPE_NULL) { - double_list = value18; + object_list = value18; } FlValue* value19 = fl_value_get_list_value(values, 19); - FlValue* bool_list = nullptr; + FlValue* list_list = nullptr; if (fl_value_get_type(value19) != FL_VALUE_TYPE_NULL) { - bool_list = value19; + list_list = value19; } FlValue* value20 = fl_value_get_list_value(values, 20); - FlValue* map = nullptr; + FlValue* map_list = nullptr; if (fl_value_get_type(value20) != FL_VALUE_TYPE_NULL) { - map = value20; + map_list = value20; + } + FlValue* value21 = fl_value_get_list_value(values, 21); + FlValue* map = nullptr; + if (fl_value_get_type(value21) != FL_VALUE_TYPE_NULL) { + map = value21; + } + FlValue* value22 = fl_value_get_list_value(values, 22); + FlValue* string_map = nullptr; + if (fl_value_get_type(value22) != FL_VALUE_TYPE_NULL) { + string_map = value22; + } + FlValue* value23 = fl_value_get_list_value(values, 23); + FlValue* int_map = nullptr; + if (fl_value_get_type(value23) != FL_VALUE_TYPE_NULL) { + int_map = value23; + } + FlValue* value24 = fl_value_get_list_value(values, 24); + FlValue* enum_map = nullptr; + if (fl_value_get_type(value24) != FL_VALUE_TYPE_NULL) { + enum_map = value24; + } + FlValue* value25 = fl_value_get_list_value(values, 25); + FlValue* object_map = nullptr; + if (fl_value_get_type(value25) != FL_VALUE_TYPE_NULL) { + object_map = value25; + } + FlValue* value26 = fl_value_get_list_value(values, 26); + FlValue* list_map = nullptr; + if (fl_value_get_type(value26) != FL_VALUE_TYPE_NULL) { + list_map = value26; + } + FlValue* value27 = fl_value_get_list_value(values, 27); + FlValue* map_map = nullptr; + if (fl_value_get_type(value27) != FL_VALUE_TYPE_NULL) { + map_map = value27; } return core_tests_pigeon_test_all_nullable_types_without_recursion_new( a_nullable_bool, a_nullable_int, a_nullable_int64, a_nullable_double, a_nullable_byte_array, a_nullable_byte_array_length, a_nullable4_byte_array, a_nullable4_byte_array_length, a_nullable8_byte_array, a_nullable8_byte_array_length, - a_nullable_float_array, a_nullable_float_array_length, - nullable_nested_list, nullable_map_with_annotations, - nullable_map_with_object, a_nullable_enum, another_nullable_enum, - a_nullable_string, a_nullable_object, list, string_list, int_list, - double_list, bool_list, map); + a_nullable_float_array, a_nullable_float_array_length, a_nullable_enum, + another_nullable_enum, a_nullable_string, a_nullable_object, list, + string_list, int_list, double_list, bool_list, enum_list, object_list, + list_list, map_list, map, string_map, int_map, enum_map, object_map, + list_map, map_map); } struct _CoreTestsPigeonTestAllClassesWrapper { @@ -1617,6 +2145,10 @@ struct _CoreTestsPigeonTestAllClassesWrapper { CoreTestsPigeonTestAllNullableTypesWithoutRecursion* all_nullable_types_without_recursion; CoreTestsPigeonTestAllTypes* all_types; + FlValue* class_list; + FlValue* nullable_class_list; + FlValue* class_map; + FlValue* nullable_class_map; }; G_DEFINE_TYPE(CoreTestsPigeonTestAllClassesWrapper, @@ -1629,6 +2161,10 @@ static void core_tests_pigeon_test_all_classes_wrapper_dispose( g_clear_object(&self->all_nullable_types); g_clear_object(&self->all_nullable_types_without_recursion); g_clear_object(&self->all_types); + g_clear_pointer(&self->class_list, fl_value_unref); + g_clear_pointer(&self->nullable_class_list, fl_value_unref); + g_clear_pointer(&self->class_map, fl_value_unref); + g_clear_pointer(&self->nullable_class_map, fl_value_unref); G_OBJECT_CLASS(core_tests_pigeon_test_all_classes_wrapper_parent_class) ->dispose(object); } @@ -1647,7 +2183,9 @@ core_tests_pigeon_test_all_classes_wrapper_new( CoreTestsPigeonTestAllNullableTypes* all_nullable_types, CoreTestsPigeonTestAllNullableTypesWithoutRecursion* all_nullable_types_without_recursion, - CoreTestsPigeonTestAllTypes* all_types) { + CoreTestsPigeonTestAllTypes* all_types, FlValue* class_list, + FlValue* nullable_class_list, FlValue* class_map, + FlValue* nullable_class_map) { CoreTestsPigeonTestAllClassesWrapper* self = CORE_TESTS_PIGEON_TEST_ALL_CLASSES_WRAPPER(g_object_new( core_tests_pigeon_test_all_classes_wrapper_get_type(), nullptr)); @@ -1665,6 +2203,18 @@ core_tests_pigeon_test_all_classes_wrapper_new( } else { self->all_types = nullptr; } + self->class_list = fl_value_ref(class_list); + if (nullable_class_list != nullptr) { + self->nullable_class_list = fl_value_ref(nullable_class_list); + } else { + self->nullable_class_list = nullptr; + } + self->class_map = fl_value_ref(class_map); + if (nullable_class_map != nullptr) { + self->nullable_class_map = fl_value_ref(nullable_class_map); + } else { + self->nullable_class_map = nullptr; + } return self; } @@ -1692,21 +2242,57 @@ core_tests_pigeon_test_all_classes_wrapper_get_all_types( return self->all_types; } +FlValue* core_tests_pigeon_test_all_classes_wrapper_get_class_list( + CoreTestsPigeonTestAllClassesWrapper* self) { + g_return_val_if_fail(CORE_TESTS_PIGEON_TEST_IS_ALL_CLASSES_WRAPPER(self), + nullptr); + return self->class_list; +} + +FlValue* core_tests_pigeon_test_all_classes_wrapper_get_nullable_class_list( + CoreTestsPigeonTestAllClassesWrapper* self) { + g_return_val_if_fail(CORE_TESTS_PIGEON_TEST_IS_ALL_CLASSES_WRAPPER(self), + nullptr); + return self->nullable_class_list; +} + +FlValue* core_tests_pigeon_test_all_classes_wrapper_get_class_map( + CoreTestsPigeonTestAllClassesWrapper* self) { + g_return_val_if_fail(CORE_TESTS_PIGEON_TEST_IS_ALL_CLASSES_WRAPPER(self), + nullptr); + return self->class_map; +} + +FlValue* core_tests_pigeon_test_all_classes_wrapper_get_nullable_class_map( + CoreTestsPigeonTestAllClassesWrapper* self) { + g_return_val_if_fail(CORE_TESTS_PIGEON_TEST_IS_ALL_CLASSES_WRAPPER(self), + nullptr); + return self->nullable_class_map; +} + static FlValue* core_tests_pigeon_test_all_classes_wrapper_to_list( CoreTestsPigeonTestAllClassesWrapper* self) { FlValue* values = fl_value_new_list(); fl_value_append_take(values, fl_value_new_custom_object( - 132, G_OBJECT(self->all_nullable_types))); + 133, G_OBJECT(self->all_nullable_types))); fl_value_append_take( values, self->all_nullable_types_without_recursion != nullptr ? fl_value_new_custom_object( - 133, G_OBJECT(self->all_nullable_types_without_recursion)) + 134, G_OBJECT(self->all_nullable_types_without_recursion)) : fl_value_new_null()); fl_value_append_take( values, self->all_types != nullptr - ? fl_value_new_custom_object(131, G_OBJECT(self->all_types)) + ? fl_value_new_custom_object(132, G_OBJECT(self->all_types)) : fl_value_new_null()); + fl_value_append_take(values, fl_value_ref(self->class_list)); + fl_value_append_take(values, self->nullable_class_list != nullptr + ? fl_value_ref(self->nullable_class_list) + : fl_value_new_null()); + fl_value_append_take(values, fl_value_ref(self->class_map)); + fl_value_append_take(values, self->nullable_class_map != nullptr + ? fl_value_ref(self->nullable_class_map) + : fl_value_new_null()); return values; } @@ -1730,8 +2316,23 @@ core_tests_pigeon_test_all_classes_wrapper_new_from_list(FlValue* values) { all_types = CORE_TESTS_PIGEON_TEST_ALL_TYPES( fl_value_get_custom_value_object(value2)); } + FlValue* value3 = fl_value_get_list_value(values, 3); + FlValue* class_list = value3; + FlValue* value4 = fl_value_get_list_value(values, 4); + FlValue* nullable_class_list = nullptr; + if (fl_value_get_type(value4) != FL_VALUE_TYPE_NULL) { + nullable_class_list = value4; + } + FlValue* value5 = fl_value_get_list_value(values, 5); + FlValue* class_map = value5; + FlValue* value6 = fl_value_get_list_value(values, 6); + FlValue* nullable_class_map = nullptr; + if (fl_value_get_type(value6) != FL_VALUE_TYPE_NULL) { + nullable_class_map = value6; + } return core_tests_pigeon_test_all_classes_wrapper_new( - all_nullable_types, all_nullable_types_without_recursion, all_types); + all_nullable_types, all_nullable_types_without_recursion, all_types, + class_list, nullable_class_list, class_map, nullable_class_map); } struct _CoreTestsPigeonTestTestMessage { @@ -1827,11 +2428,22 @@ core_tests_pigeon_test_message_codec_write_core_tests_pigeon_test_another_enum( return fl_standard_message_codec_write_value(codec, buffer, value, error); } +static gboolean +core_tests_pigeon_test_message_codec_write_core_tests_pigeon_test_unused_class( + FlStandardMessageCodec* codec, GByteArray* buffer, + CoreTestsPigeonTestUnusedClass* value, GError** error) { + uint8_t type = 131; + g_byte_array_append(buffer, &type, sizeof(uint8_t)); + g_autoptr(FlValue) values = + core_tests_pigeon_test_unused_class_to_list(value); + return fl_standard_message_codec_write_value(codec, buffer, values, error); +} + static gboolean core_tests_pigeon_test_message_codec_write_core_tests_pigeon_test_all_types( FlStandardMessageCodec* codec, GByteArray* buffer, CoreTestsPigeonTestAllTypes* value, GError** error) { - uint8_t type = 131; + uint8_t type = 132; g_byte_array_append(buffer, &type, sizeof(uint8_t)); g_autoptr(FlValue) values = core_tests_pigeon_test_all_types_to_list(value); return fl_standard_message_codec_write_value(codec, buffer, values, error); @@ -1841,7 +2453,7 @@ static gboolean core_tests_pigeon_test_message_codec_write_core_tests_pigeon_test_all_nullable_types( FlStandardMessageCodec* codec, GByteArray* buffer, CoreTestsPigeonTestAllNullableTypes* value, GError** error) { - uint8_t type = 132; + uint8_t type = 133; g_byte_array_append(buffer, &type, sizeof(uint8_t)); g_autoptr(FlValue) values = core_tests_pigeon_test_all_nullable_types_to_list(value); @@ -1853,7 +2465,7 @@ core_tests_pigeon_test_message_codec_write_core_tests_pigeon_test_all_nullable_t FlStandardMessageCodec* codec, GByteArray* buffer, CoreTestsPigeonTestAllNullableTypesWithoutRecursion* value, GError** error) { - uint8_t type = 133; + uint8_t type = 134; g_byte_array_append(buffer, &type, sizeof(uint8_t)); g_autoptr(FlValue) values = core_tests_pigeon_test_all_nullable_types_without_recursion_to_list( @@ -1865,7 +2477,7 @@ static gboolean core_tests_pigeon_test_message_codec_write_core_tests_pigeon_test_all_classes_wrapper( FlStandardMessageCodec* codec, GByteArray* buffer, CoreTestsPigeonTestAllClassesWrapper* value, GError** error) { - uint8_t type = 134; + uint8_t type = 135; g_byte_array_append(buffer, &type, sizeof(uint8_t)); g_autoptr(FlValue) values = core_tests_pigeon_test_all_classes_wrapper_to_list(value); @@ -1876,7 +2488,7 @@ static gboolean core_tests_pigeon_test_message_codec_write_core_tests_pigeon_test_test_message( FlStandardMessageCodec* codec, GByteArray* buffer, CoreTestsPigeonTestTestMessage* value, GError** error) { - uint8_t type = 135; + uint8_t type = 136; g_byte_array_append(buffer, &type, sizeof(uint8_t)); g_autoptr(FlValue) values = core_tests_pigeon_test_test_message_to_list(value); @@ -1901,30 +2513,36 @@ static gboolean core_tests_pigeon_test_message_codec_write_value( const_cast(fl_value_get_custom_value(value))), error); case 131: + return core_tests_pigeon_test_message_codec_write_core_tests_pigeon_test_unused_class( + codec, buffer, + CORE_TESTS_PIGEON_TEST_UNUSED_CLASS( + fl_value_get_custom_value_object(value)), + error); + case 132: return core_tests_pigeon_test_message_codec_write_core_tests_pigeon_test_all_types( codec, buffer, CORE_TESTS_PIGEON_TEST_ALL_TYPES( fl_value_get_custom_value_object(value)), error); - case 132: + case 133: return core_tests_pigeon_test_message_codec_write_core_tests_pigeon_test_all_nullable_types( codec, buffer, CORE_TESTS_PIGEON_TEST_ALL_NULLABLE_TYPES( fl_value_get_custom_value_object(value)), error); - case 133: + case 134: return core_tests_pigeon_test_message_codec_write_core_tests_pigeon_test_all_nullable_types_without_recursion( codec, buffer, CORE_TESTS_PIGEON_TEST_ALL_NULLABLE_TYPES_WITHOUT_RECURSION( fl_value_get_custom_value_object(value)), error); - case 134: + case 135: return core_tests_pigeon_test_message_codec_write_core_tests_pigeon_test_all_classes_wrapper( codec, buffer, CORE_TESTS_PIGEON_TEST_ALL_CLASSES_WRAPPER( fl_value_get_custom_value_object(value)), error); - case 135: + case 136: return core_tests_pigeon_test_message_codec_write_core_tests_pigeon_test_test_message( codec, buffer, CORE_TESTS_PIGEON_TEST_TEST_MESSAGE( @@ -1956,6 +2574,27 @@ core_tests_pigeon_test_message_codec_read_core_tests_pigeon_test_another_enum( (GDestroyNotify)fl_value_unref); } +static FlValue* +core_tests_pigeon_test_message_codec_read_core_tests_pigeon_test_unused_class( + FlStandardMessageCodec* codec, GBytes* buffer, size_t* offset, + GError** error) { + g_autoptr(FlValue) values = + fl_standard_message_codec_read_value(codec, buffer, offset, error); + if (values == nullptr) { + return nullptr; + } + + g_autoptr(CoreTestsPigeonTestUnusedClass) value = + core_tests_pigeon_test_unused_class_new_from_list(values); + if (value == nullptr) { + g_set_error(error, FL_MESSAGE_CODEC_ERROR, FL_MESSAGE_CODEC_ERROR_FAILED, + "Invalid data received for MessageData"); + return nullptr; + } + + return fl_value_new_custom_object(131, G_OBJECT(value)); +} + static FlValue* core_tests_pigeon_test_message_codec_read_core_tests_pigeon_test_all_types( FlStandardMessageCodec* codec, GBytes* buffer, size_t* offset, @@ -1974,7 +2613,7 @@ core_tests_pigeon_test_message_codec_read_core_tests_pigeon_test_all_types( return nullptr; } - return fl_value_new_custom_object(131, G_OBJECT(value)); + return fl_value_new_custom_object(132, G_OBJECT(value)); } static FlValue* @@ -1995,7 +2634,7 @@ core_tests_pigeon_test_message_codec_read_core_tests_pigeon_test_all_nullable_ty return nullptr; } - return fl_value_new_custom_object(132, G_OBJECT(value)); + return fl_value_new_custom_object(133, G_OBJECT(value)); } static FlValue* @@ -2017,7 +2656,7 @@ core_tests_pigeon_test_message_codec_read_core_tests_pigeon_test_all_nullable_ty return nullptr; } - return fl_value_new_custom_object(133, G_OBJECT(value)); + return fl_value_new_custom_object(134, G_OBJECT(value)); } static FlValue* @@ -2038,7 +2677,7 @@ core_tests_pigeon_test_message_codec_read_core_tests_pigeon_test_all_classes_wra return nullptr; } - return fl_value_new_custom_object(134, G_OBJECT(value)); + return fl_value_new_custom_object(135, G_OBJECT(value)); } static FlValue* @@ -2059,7 +2698,7 @@ core_tests_pigeon_test_message_codec_read_core_tests_pigeon_test_test_message( return nullptr; } - return fl_value_new_custom_object(135, G_OBJECT(value)); + return fl_value_new_custom_object(136, G_OBJECT(value)); } static FlValue* core_tests_pigeon_test_message_codec_read_value_of_type( @@ -2073,18 +2712,21 @@ static FlValue* core_tests_pigeon_test_message_codec_read_value_of_type( return core_tests_pigeon_test_message_codec_read_core_tests_pigeon_test_another_enum( codec, buffer, offset, error); case 131: - return core_tests_pigeon_test_message_codec_read_core_tests_pigeon_test_all_types( + return core_tests_pigeon_test_message_codec_read_core_tests_pigeon_test_unused_class( codec, buffer, offset, error); case 132: - return core_tests_pigeon_test_message_codec_read_core_tests_pigeon_test_all_nullable_types( + return core_tests_pigeon_test_message_codec_read_core_tests_pigeon_test_all_types( codec, buffer, offset, error); case 133: - return core_tests_pigeon_test_message_codec_read_core_tests_pigeon_test_all_nullable_types_without_recursion( + return core_tests_pigeon_test_message_codec_read_core_tests_pigeon_test_all_nullable_types( codec, buffer, offset, error); case 134: - return core_tests_pigeon_test_message_codec_read_core_tests_pigeon_test_all_classes_wrapper( + return core_tests_pigeon_test_message_codec_read_core_tests_pigeon_test_all_nullable_types_without_recursion( codec, buffer, offset, error); case 135: + return core_tests_pigeon_test_message_codec_read_core_tests_pigeon_test_all_classes_wrapper( + codec, buffer, offset, error); + case 136: return core_tests_pigeon_test_message_codec_read_core_tests_pigeon_test_test_message( codec, buffer, offset, error); default: @@ -2262,7 +2904,7 @@ core_tests_pigeon_test_host_integration_core_api_echo_all_types_response_new( nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, - fl_value_new_custom_object(131, G_OBJECT(return_value))); + fl_value_new_custom_object(132, G_OBJECT(return_value))); return self; } @@ -2925,59 +3567,61 @@ core_tests_pigeon_test_host_integration_core_api_echo_list_response_new_error( return self; } -struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoMapResponse { +struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumListResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoMapResponse, - core_tests_pigeon_test_host_integration_core_api_echo_map_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumListResponse, + core_tests_pigeon_test_host_integration_core_api_echo_enum_list_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_echo_map_response_dispose( +core_tests_pigeon_test_host_integration_core_api_echo_enum_list_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoMapResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_MAP_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumListResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ENUM_LIST_RESPONSE( object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_echo_map_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_echo_enum_list_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_echo_map_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoMapResponse* self) {} +core_tests_pigeon_test_host_integration_core_api_echo_enum_list_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumListResponse* self) {} static void -core_tests_pigeon_test_host_integration_core_api_echo_map_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoMapResponseClass* klass) { +core_tests_pigeon_test_host_integration_core_api_echo_enum_list_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumListResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_echo_map_response_dispose; + core_tests_pigeon_test_host_integration_core_api_echo_enum_list_response_dispose; } -CoreTestsPigeonTestHostIntegrationCoreApiEchoMapResponse* -core_tests_pigeon_test_host_integration_core_api_echo_map_response_new( +CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumListResponse* +core_tests_pigeon_test_host_integration_core_api_echo_enum_list_response_new( FlValue* return_value) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoMapResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_MAP_RESPONSE(g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_map_response_get_type(), - nullptr)); + CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumListResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ENUM_LIST_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_echo_enum_list_response_get_type(), + nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_ref(return_value)); return self; } -CoreTestsPigeonTestHostIntegrationCoreApiEchoMapResponse* -core_tests_pigeon_test_host_integration_core_api_echo_map_response_new_error( +CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumListResponse* +core_tests_pigeon_test_host_integration_core_api_echo_enum_list_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoMapResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_MAP_RESPONSE(g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_map_response_get_type(), - nullptr)); + CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumListResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ENUM_LIST_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_echo_enum_list_response_get_type(), + nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); fl_value_append_take(self->value, @@ -2987,62 +3631,61 @@ core_tests_pigeon_test_host_integration_core_api_echo_map_response_new_error( return self; } -struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoClassWrapperResponse { +struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoClassListResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoClassWrapperResponse, - core_tests_pigeon_test_host_integration_core_api_echo_class_wrapper_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoClassListResponse, + core_tests_pigeon_test_host_integration_core_api_echo_class_list_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_echo_class_wrapper_response_dispose( +core_tests_pigeon_test_host_integration_core_api_echo_class_list_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoClassWrapperResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_CLASS_WRAPPER_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoClassListResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_CLASS_LIST_RESPONSE( object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_echo_class_wrapper_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_echo_class_list_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_echo_class_wrapper_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoClassWrapperResponse* self) {} +core_tests_pigeon_test_host_integration_core_api_echo_class_list_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoClassListResponse* self) {} static void -core_tests_pigeon_test_host_integration_core_api_echo_class_wrapper_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoClassWrapperResponseClass* +core_tests_pigeon_test_host_integration_core_api_echo_class_list_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoClassListResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_echo_class_wrapper_response_dispose; + core_tests_pigeon_test_host_integration_core_api_echo_class_list_response_dispose; } -CoreTestsPigeonTestHostIntegrationCoreApiEchoClassWrapperResponse* -core_tests_pigeon_test_host_integration_core_api_echo_class_wrapper_response_new( - CoreTestsPigeonTestAllClassesWrapper* return_value) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoClassWrapperResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_CLASS_WRAPPER_RESPONSE( +CoreTestsPigeonTestHostIntegrationCoreApiEchoClassListResponse* +core_tests_pigeon_test_host_integration_core_api_echo_class_list_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoClassListResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_CLASS_LIST_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_class_wrapper_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_class_list_response_get_type(), nullptr)); self->value = fl_value_new_list(); - fl_value_append_take(self->value, - fl_value_new_custom_object(134, G_OBJECT(return_value))); + fl_value_append_take(self->value, fl_value_ref(return_value)); return self; } -CoreTestsPigeonTestHostIntegrationCoreApiEchoClassWrapperResponse* -core_tests_pigeon_test_host_integration_core_api_echo_class_wrapper_response_new_error( +CoreTestsPigeonTestHostIntegrationCoreApiEchoClassListResponse* +core_tests_pigeon_test_host_integration_core_api_echo_class_list_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoClassWrapperResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_CLASS_WRAPPER_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoClassListResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_CLASS_LIST_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_class_wrapper_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_class_list_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); @@ -3053,61 +3696,63 @@ core_tests_pigeon_test_host_integration_core_api_echo_class_wrapper_response_new return self; } -struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumResponse { +struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullEnumListResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumResponse, - core_tests_pigeon_test_host_integration_core_api_echo_enum_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullEnumListResponse, + core_tests_pigeon_test_host_integration_core_api_echo_non_null_enum_list_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_echo_enum_response_dispose( +core_tests_pigeon_test_host_integration_core_api_echo_non_null_enum_list_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ENUM_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullEnumListResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NON_NULL_ENUM_LIST_RESPONSE( object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_echo_enum_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_echo_non_null_enum_list_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_echo_enum_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumResponse* self) {} +core_tests_pigeon_test_host_integration_core_api_echo_non_null_enum_list_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullEnumListResponse* + self) {} static void -core_tests_pigeon_test_host_integration_core_api_echo_enum_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumResponseClass* klass) { +core_tests_pigeon_test_host_integration_core_api_echo_non_null_enum_list_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullEnumListResponseClass* + klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_echo_enum_response_dispose; + core_tests_pigeon_test_host_integration_core_api_echo_non_null_enum_list_response_dispose; } -CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumResponse* -core_tests_pigeon_test_host_integration_core_api_echo_enum_response_new( - CoreTestsPigeonTestAnEnum return_value) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ENUM_RESPONSE(g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_enum_response_get_type(), - nullptr)); +CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullEnumListResponse* +core_tests_pigeon_test_host_integration_core_api_echo_non_null_enum_list_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullEnumListResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NON_NULL_ENUM_LIST_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_echo_non_null_enum_list_response_get_type(), + nullptr)); self->value = fl_value_new_list(); - fl_value_append_take(self->value, - fl_value_new_custom(129, fl_value_new_int(return_value), - (GDestroyNotify)fl_value_unref)); + fl_value_append_take(self->value, fl_value_ref(return_value)); return self; } -CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumResponse* -core_tests_pigeon_test_host_integration_core_api_echo_enum_response_new_error( +CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullEnumListResponse* +core_tests_pigeon_test_host_integration_core_api_echo_non_null_enum_list_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ENUM_RESPONSE(g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_enum_response_get_type(), - nullptr)); + CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullEnumListResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NON_NULL_ENUM_LIST_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_echo_non_null_enum_list_response_get_type(), + nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); fl_value_append_take(self->value, @@ -3117,63 +3762,62 @@ core_tests_pigeon_test_host_integration_core_api_echo_enum_response_new_error( return self; } -struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherEnumResponse { +struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullClassListResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherEnumResponse, - core_tests_pigeon_test_host_integration_core_api_echo_another_enum_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullClassListResponse, + core_tests_pigeon_test_host_integration_core_api_echo_non_null_class_list_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_echo_another_enum_response_dispose( +core_tests_pigeon_test_host_integration_core_api_echo_non_null_class_list_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherEnumResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ANOTHER_ENUM_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullClassListResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NON_NULL_CLASS_LIST_RESPONSE( object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_echo_another_enum_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_echo_non_null_class_list_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_echo_another_enum_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherEnumResponse* self) {} +core_tests_pigeon_test_host_integration_core_api_echo_non_null_class_list_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullClassListResponse* + self) {} static void -core_tests_pigeon_test_host_integration_core_api_echo_another_enum_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherEnumResponseClass* +core_tests_pigeon_test_host_integration_core_api_echo_non_null_class_list_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullClassListResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_echo_another_enum_response_dispose; + core_tests_pigeon_test_host_integration_core_api_echo_non_null_class_list_response_dispose; } -CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherEnumResponse* -core_tests_pigeon_test_host_integration_core_api_echo_another_enum_response_new( - CoreTestsPigeonTestAnotherEnum return_value) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherEnumResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ANOTHER_ENUM_RESPONSE( +CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullClassListResponse* +core_tests_pigeon_test_host_integration_core_api_echo_non_null_class_list_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullClassListResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NON_NULL_CLASS_LIST_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_another_enum_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_non_null_class_list_response_get_type(), nullptr)); self->value = fl_value_new_list(); - fl_value_append_take(self->value, - fl_value_new_custom(130, fl_value_new_int(return_value), - (GDestroyNotify)fl_value_unref)); + fl_value_append_take(self->value, fl_value_ref(return_value)); return self; } -CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherEnumResponse* -core_tests_pigeon_test_host_integration_core_api_echo_another_enum_response_new_error( +CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullClassListResponse* +core_tests_pigeon_test_host_integration_core_api_echo_non_null_class_list_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherEnumResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ANOTHER_ENUM_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullClassListResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NON_NULL_CLASS_LIST_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_another_enum_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_non_null_class_list_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); @@ -3184,64 +3828,59 @@ core_tests_pigeon_test_host_integration_core_api_echo_another_enum_response_new_ return self; } -struct - _CoreTestsPigeonTestHostIntegrationCoreApiEchoNamedDefaultStringResponse { +struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoMapResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoNamedDefaultStringResponse, - core_tests_pigeon_test_host_integration_core_api_echo_named_default_string_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoMapResponse, + core_tests_pigeon_test_host_integration_core_api_echo_map_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_echo_named_default_string_response_dispose( +core_tests_pigeon_test_host_integration_core_api_echo_map_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoNamedDefaultStringResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NAMED_DEFAULT_STRING_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_MAP_RESPONSE( object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_echo_named_default_string_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_echo_map_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_echo_named_default_string_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoNamedDefaultStringResponse* - self) {} +core_tests_pigeon_test_host_integration_core_api_echo_map_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoMapResponse* self) {} static void -core_tests_pigeon_test_host_integration_core_api_echo_named_default_string_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoNamedDefaultStringResponseClass* - klass) { +core_tests_pigeon_test_host_integration_core_api_echo_map_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoMapResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_echo_named_default_string_response_dispose; + core_tests_pigeon_test_host_integration_core_api_echo_map_response_dispose; } -CoreTestsPigeonTestHostIntegrationCoreApiEchoNamedDefaultStringResponse* -core_tests_pigeon_test_host_integration_core_api_echo_named_default_string_response_new( - const gchar* return_value) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoNamedDefaultStringResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NAMED_DEFAULT_STRING_RESPONSE( - g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_named_default_string_response_get_type(), - nullptr)); +CoreTestsPigeonTestHostIntegrationCoreApiEchoMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_map_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_MAP_RESPONSE(g_object_new( + core_tests_pigeon_test_host_integration_core_api_echo_map_response_get_type(), + nullptr)); self->value = fl_value_new_list(); - fl_value_append_take(self->value, fl_value_new_string(return_value)); + fl_value_append_take(self->value, fl_value_ref(return_value)); return self; } -CoreTestsPigeonTestHostIntegrationCoreApiEchoNamedDefaultStringResponse* -core_tests_pigeon_test_host_integration_core_api_echo_named_default_string_response_new_error( +CoreTestsPigeonTestHostIntegrationCoreApiEchoMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_map_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoNamedDefaultStringResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NAMED_DEFAULT_STRING_RESPONSE( - g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_named_default_string_response_get_type(), - nullptr)); + CoreTestsPigeonTestHostIntegrationCoreApiEchoMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_MAP_RESPONSE(g_object_new( + core_tests_pigeon_test_host_integration_core_api_echo_map_response_get_type(), + nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); fl_value_append_take(self->value, @@ -3251,63 +3890,61 @@ core_tests_pigeon_test_host_integration_core_api_echo_named_default_string_respo return self; } -struct - _CoreTestsPigeonTestHostIntegrationCoreApiEchoOptionalDefaultDoubleResponse { +struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoStringMapResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoOptionalDefaultDoubleResponse, - core_tests_pigeon_test_host_integration_core_api_echo_optional_default_double_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoStringMapResponse, + core_tests_pigeon_test_host_integration_core_api_echo_string_map_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_echo_optional_default_double_response_dispose( +core_tests_pigeon_test_host_integration_core_api_echo_string_map_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoOptionalDefaultDoubleResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_OPTIONAL_DEFAULT_DOUBLE_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoStringMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_STRING_MAP_RESPONSE( object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_echo_optional_default_double_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_echo_string_map_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_echo_optional_default_double_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoOptionalDefaultDoubleResponse* - self) {} +core_tests_pigeon_test_host_integration_core_api_echo_string_map_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoStringMapResponse* self) {} static void -core_tests_pigeon_test_host_integration_core_api_echo_optional_default_double_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoOptionalDefaultDoubleResponseClass* +core_tests_pigeon_test_host_integration_core_api_echo_string_map_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoStringMapResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_echo_optional_default_double_response_dispose; + core_tests_pigeon_test_host_integration_core_api_echo_string_map_response_dispose; } -CoreTestsPigeonTestHostIntegrationCoreApiEchoOptionalDefaultDoubleResponse* -core_tests_pigeon_test_host_integration_core_api_echo_optional_default_double_response_new( - double return_value) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoOptionalDefaultDoubleResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_OPTIONAL_DEFAULT_DOUBLE_RESPONSE( +CoreTestsPigeonTestHostIntegrationCoreApiEchoStringMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_string_map_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoStringMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_STRING_MAP_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_optional_default_double_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_string_map_response_get_type(), nullptr)); self->value = fl_value_new_list(); - fl_value_append_take(self->value, fl_value_new_float(return_value)); + fl_value_append_take(self->value, fl_value_ref(return_value)); return self; } -CoreTestsPigeonTestHostIntegrationCoreApiEchoOptionalDefaultDoubleResponse* -core_tests_pigeon_test_host_integration_core_api_echo_optional_default_double_response_new_error( +CoreTestsPigeonTestHostIntegrationCoreApiEchoStringMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_string_map_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoOptionalDefaultDoubleResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_OPTIONAL_DEFAULT_DOUBLE_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoStringMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_STRING_MAP_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_optional_default_double_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_string_map_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); @@ -3318,61 +3955,60 @@ core_tests_pigeon_test_host_integration_core_api_echo_optional_default_double_re return self; } -struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoRequiredIntResponse { +struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoIntMapResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoRequiredIntResponse, - core_tests_pigeon_test_host_integration_core_api_echo_required_int_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoIntMapResponse, + core_tests_pigeon_test_host_integration_core_api_echo_int_map_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_echo_required_int_response_dispose( +core_tests_pigeon_test_host_integration_core_api_echo_int_map_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoRequiredIntResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_REQUIRED_INT_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoIntMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_INT_MAP_RESPONSE( object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_echo_required_int_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_echo_int_map_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_echo_required_int_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoRequiredIntResponse* self) {} +core_tests_pigeon_test_host_integration_core_api_echo_int_map_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoIntMapResponse* self) {} static void -core_tests_pigeon_test_host_integration_core_api_echo_required_int_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoRequiredIntResponseClass* - klass) { +core_tests_pigeon_test_host_integration_core_api_echo_int_map_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoIntMapResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_echo_required_int_response_dispose; + core_tests_pigeon_test_host_integration_core_api_echo_int_map_response_dispose; } -CoreTestsPigeonTestHostIntegrationCoreApiEchoRequiredIntResponse* -core_tests_pigeon_test_host_integration_core_api_echo_required_int_response_new( - int64_t return_value) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoRequiredIntResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_REQUIRED_INT_RESPONSE( +CoreTestsPigeonTestHostIntegrationCoreApiEchoIntMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_int_map_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoIntMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_INT_MAP_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_required_int_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_int_map_response_get_type(), nullptr)); self->value = fl_value_new_list(); - fl_value_append_take(self->value, fl_value_new_int(return_value)); + fl_value_append_take(self->value, fl_value_ref(return_value)); return self; } -CoreTestsPigeonTestHostIntegrationCoreApiEchoRequiredIntResponse* -core_tests_pigeon_test_host_integration_core_api_echo_required_int_response_new_error( +CoreTestsPigeonTestHostIntegrationCoreApiEchoIntMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_int_map_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoRequiredIntResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_REQUIRED_INT_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoIntMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_INT_MAP_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_required_int_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_int_map_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); @@ -3383,65 +4019,60 @@ core_tests_pigeon_test_host_integration_core_api_echo_required_int_response_new_ return self; } -struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoAllNullableTypesResponse { +struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumMapResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAllNullableTypesResponse, - core_tests_pigeon_test_host_integration_core_api_echo_all_nullable_types_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumMapResponse, + core_tests_pigeon_test_host_integration_core_api_echo_enum_map_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_echo_all_nullable_types_response_dispose( +core_tests_pigeon_test_host_integration_core_api_echo_enum_map_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAllNullableTypesResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ALL_NULLABLE_TYPES_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ENUM_MAP_RESPONSE( object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_echo_all_nullable_types_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_echo_enum_map_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_echo_all_nullable_types_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAllNullableTypesResponse* - self) {} +core_tests_pigeon_test_host_integration_core_api_echo_enum_map_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumMapResponse* self) {} static void -core_tests_pigeon_test_host_integration_core_api_echo_all_nullable_types_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAllNullableTypesResponseClass* - klass) { +core_tests_pigeon_test_host_integration_core_api_echo_enum_map_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumMapResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_echo_all_nullable_types_response_dispose; + core_tests_pigeon_test_host_integration_core_api_echo_enum_map_response_dispose; } -CoreTestsPigeonTestHostIntegrationCoreApiEchoAllNullableTypesResponse* -core_tests_pigeon_test_host_integration_core_api_echo_all_nullable_types_response_new( - CoreTestsPigeonTestAllNullableTypes* return_value) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAllNullableTypesResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ALL_NULLABLE_TYPES_RESPONSE( +CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_enum_map_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ENUM_MAP_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_all_nullable_types_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_enum_map_response_get_type(), nullptr)); self->value = fl_value_new_list(); - fl_value_append_take( - self->value, return_value != nullptr - ? fl_value_new_custom_object(132, G_OBJECT(return_value)) - : fl_value_new_null()); + fl_value_append_take(self->value, fl_value_ref(return_value)); return self; } -CoreTestsPigeonTestHostIntegrationCoreApiEchoAllNullableTypesResponse* -core_tests_pigeon_test_host_integration_core_api_echo_all_nullable_types_response_new_error( +CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_enum_map_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAllNullableTypesResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ALL_NULLABLE_TYPES_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ENUM_MAP_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_all_nullable_types_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_enum_map_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); @@ -3452,67 +4083,60 @@ core_tests_pigeon_test_host_integration_core_api_echo_all_nullable_types_respons return self; } -struct - _CoreTestsPigeonTestHostIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponse { +struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoClassMapResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponse, - core_tests_pigeon_test_host_integration_core_api_echo_all_nullable_types_without_recursion_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoClassMapResponse, + core_tests_pigeon_test_host_integration_core_api_echo_class_map_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_echo_all_nullable_types_without_recursion_response_dispose( +core_tests_pigeon_test_host_integration_core_api_echo_class_map_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponse* - self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ALL_NULLABLE_TYPES_WITHOUT_RECURSION_RESPONSE( - object); + CoreTestsPigeonTestHostIntegrationCoreApiEchoClassMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_CLASS_MAP_RESPONSE( + object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_echo_all_nullable_types_without_recursion_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_echo_class_map_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_echo_all_nullable_types_without_recursion_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponse* - self) {} +core_tests_pigeon_test_host_integration_core_api_echo_class_map_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoClassMapResponse* self) {} static void -core_tests_pigeon_test_host_integration_core_api_echo_all_nullable_types_without_recursion_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponseClass* - klass) { +core_tests_pigeon_test_host_integration_core_api_echo_class_map_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoClassMapResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_echo_all_nullable_types_without_recursion_response_dispose; + core_tests_pigeon_test_host_integration_core_api_echo_class_map_response_dispose; } -CoreTestsPigeonTestHostIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponse* -core_tests_pigeon_test_host_integration_core_api_echo_all_nullable_types_without_recursion_response_new( - CoreTestsPigeonTestAllNullableTypesWithoutRecursion* return_value) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponse* - self = CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ALL_NULLABLE_TYPES_WITHOUT_RECURSION_RESPONSE( +CoreTestsPigeonTestHostIntegrationCoreApiEchoClassMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_class_map_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoClassMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_CLASS_MAP_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_all_nullable_types_without_recursion_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_class_map_response_get_type(), nullptr)); self->value = fl_value_new_list(); - fl_value_append_take( - self->value, return_value != nullptr - ? fl_value_new_custom_object(133, G_OBJECT(return_value)) - : fl_value_new_null()); + fl_value_append_take(self->value, fl_value_ref(return_value)); return self; } -CoreTestsPigeonTestHostIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponse* -core_tests_pigeon_test_host_integration_core_api_echo_all_nullable_types_without_recursion_response_new_error( +CoreTestsPigeonTestHostIntegrationCoreApiEchoClassMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_class_map_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponse* - self = CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ALL_NULLABLE_TYPES_WITHOUT_RECURSION_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoClassMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_CLASS_MAP_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_all_nullable_types_without_recursion_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_class_map_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); @@ -3523,66 +4147,62 @@ core_tests_pigeon_test_host_integration_core_api_echo_all_nullable_types_without return self; } -struct - _CoreTestsPigeonTestHostIntegrationCoreApiExtractNestedNullableStringResponse { +struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullStringMapResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiExtractNestedNullableStringResponse, - core_tests_pigeon_test_host_integration_core_api_extract_nested_nullable_string_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullStringMapResponse, + core_tests_pigeon_test_host_integration_core_api_echo_non_null_string_map_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_extract_nested_nullable_string_response_dispose( +core_tests_pigeon_test_host_integration_core_api_echo_non_null_string_map_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiExtractNestedNullableStringResponse* - self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_EXTRACT_NESTED_NULLABLE_STRING_RESPONSE( - object); + CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullStringMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NON_NULL_STRING_MAP_RESPONSE( + object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_extract_nested_nullable_string_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_echo_non_null_string_map_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_extract_nested_nullable_string_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiExtractNestedNullableStringResponse* +core_tests_pigeon_test_host_integration_core_api_echo_non_null_string_map_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullStringMapResponse* self) {} static void -core_tests_pigeon_test_host_integration_core_api_extract_nested_nullable_string_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiExtractNestedNullableStringResponseClass* +core_tests_pigeon_test_host_integration_core_api_echo_non_null_string_map_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullStringMapResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_extract_nested_nullable_string_response_dispose; + core_tests_pigeon_test_host_integration_core_api_echo_non_null_string_map_response_dispose; } -CoreTestsPigeonTestHostIntegrationCoreApiExtractNestedNullableStringResponse* -core_tests_pigeon_test_host_integration_core_api_extract_nested_nullable_string_response_new( - const gchar* return_value) { - CoreTestsPigeonTestHostIntegrationCoreApiExtractNestedNullableStringResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_EXTRACT_NESTED_NULLABLE_STRING_RESPONSE( +CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullStringMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_non_null_string_map_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullStringMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NON_NULL_STRING_MAP_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_extract_nested_nullable_string_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_non_null_string_map_response_get_type(), nullptr)); self->value = fl_value_new_list(); - fl_value_append_take(self->value, return_value != nullptr - ? fl_value_new_string(return_value) - : fl_value_new_null()); + fl_value_append_take(self->value, fl_value_ref(return_value)); return self; } -CoreTestsPigeonTestHostIntegrationCoreApiExtractNestedNullableStringResponse* -core_tests_pigeon_test_host_integration_core_api_extract_nested_nullable_string_response_new_error( +CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullStringMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_non_null_string_map_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiExtractNestedNullableStringResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_EXTRACT_NESTED_NULLABLE_STRING_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullStringMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NON_NULL_STRING_MAP_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_extract_nested_nullable_string_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_non_null_string_map_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); @@ -3593,64 +4213,61 @@ core_tests_pigeon_test_host_integration_core_api_extract_nested_nullable_string_ return self; } -struct - _CoreTestsPigeonTestHostIntegrationCoreApiCreateNestedNullableStringResponse { +struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullIntMapResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiCreateNestedNullableStringResponse, - core_tests_pigeon_test_host_integration_core_api_create_nested_nullable_string_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullIntMapResponse, + core_tests_pigeon_test_host_integration_core_api_echo_non_null_int_map_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_create_nested_nullable_string_response_dispose( +core_tests_pigeon_test_host_integration_core_api_echo_non_null_int_map_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiCreateNestedNullableStringResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CREATE_NESTED_NULLABLE_STRING_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullIntMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NON_NULL_INT_MAP_RESPONSE( object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_create_nested_nullable_string_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_echo_non_null_int_map_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_create_nested_nullable_string_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiCreateNestedNullableStringResponse* - self) {} +core_tests_pigeon_test_host_integration_core_api_echo_non_null_int_map_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullIntMapResponse* self) {} static void -core_tests_pigeon_test_host_integration_core_api_create_nested_nullable_string_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiCreateNestedNullableStringResponseClass* +core_tests_pigeon_test_host_integration_core_api_echo_non_null_int_map_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullIntMapResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_create_nested_nullable_string_response_dispose; + core_tests_pigeon_test_host_integration_core_api_echo_non_null_int_map_response_dispose; } -CoreTestsPigeonTestHostIntegrationCoreApiCreateNestedNullableStringResponse* -core_tests_pigeon_test_host_integration_core_api_create_nested_nullable_string_response_new( - CoreTestsPigeonTestAllClassesWrapper* return_value) { - CoreTestsPigeonTestHostIntegrationCoreApiCreateNestedNullableStringResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CREATE_NESTED_NULLABLE_STRING_RESPONSE( +CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullIntMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_non_null_int_map_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullIntMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NON_NULL_INT_MAP_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_create_nested_nullable_string_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_non_null_int_map_response_get_type(), nullptr)); self->value = fl_value_new_list(); - fl_value_append_take(self->value, - fl_value_new_custom_object(134, G_OBJECT(return_value))); + fl_value_append_take(self->value, fl_value_ref(return_value)); return self; } -CoreTestsPigeonTestHostIntegrationCoreApiCreateNestedNullableStringResponse* -core_tests_pigeon_test_host_integration_core_api_create_nested_nullable_string_response_new_error( +CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullIntMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_non_null_int_map_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiCreateNestedNullableStringResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CREATE_NESTED_NULLABLE_STRING_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullIntMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NON_NULL_INT_MAP_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_create_nested_nullable_string_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_non_null_int_map_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); @@ -3661,64 +4278,62 @@ core_tests_pigeon_test_host_integration_core_api_create_nested_nullable_string_r return self; } -struct - _CoreTestsPigeonTestHostIntegrationCoreApiSendMultipleNullableTypesResponse { +struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullEnumMapResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiSendMultipleNullableTypesResponse, - core_tests_pigeon_test_host_integration_core_api_send_multiple_nullable_types_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullEnumMapResponse, + core_tests_pigeon_test_host_integration_core_api_echo_non_null_enum_map_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_send_multiple_nullable_types_response_dispose( +core_tests_pigeon_test_host_integration_core_api_echo_non_null_enum_map_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiSendMultipleNullableTypesResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_SEND_MULTIPLE_NULLABLE_TYPES_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullEnumMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NON_NULL_ENUM_MAP_RESPONSE( object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_send_multiple_nullable_types_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_echo_non_null_enum_map_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_send_multiple_nullable_types_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiSendMultipleNullableTypesResponse* - self) {} +core_tests_pigeon_test_host_integration_core_api_echo_non_null_enum_map_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullEnumMapResponse* self) { +} static void -core_tests_pigeon_test_host_integration_core_api_send_multiple_nullable_types_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiSendMultipleNullableTypesResponseClass* +core_tests_pigeon_test_host_integration_core_api_echo_non_null_enum_map_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullEnumMapResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_send_multiple_nullable_types_response_dispose; + core_tests_pigeon_test_host_integration_core_api_echo_non_null_enum_map_response_dispose; } -CoreTestsPigeonTestHostIntegrationCoreApiSendMultipleNullableTypesResponse* -core_tests_pigeon_test_host_integration_core_api_send_multiple_nullable_types_response_new( - CoreTestsPigeonTestAllNullableTypes* return_value) { - CoreTestsPigeonTestHostIntegrationCoreApiSendMultipleNullableTypesResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_SEND_MULTIPLE_NULLABLE_TYPES_RESPONSE( +CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullEnumMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_non_null_enum_map_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullEnumMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NON_NULL_ENUM_MAP_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_send_multiple_nullable_types_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_non_null_enum_map_response_get_type(), nullptr)); self->value = fl_value_new_list(); - fl_value_append_take(self->value, - fl_value_new_custom_object(132, G_OBJECT(return_value))); + fl_value_append_take(self->value, fl_value_ref(return_value)); return self; } -CoreTestsPigeonTestHostIntegrationCoreApiSendMultipleNullableTypesResponse* -core_tests_pigeon_test_host_integration_core_api_send_multiple_nullable_types_response_new_error( +CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullEnumMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_non_null_enum_map_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiSendMultipleNullableTypesResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_SEND_MULTIPLE_NULLABLE_TYPES_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullEnumMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NON_NULL_ENUM_MAP_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_send_multiple_nullable_types_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_non_null_enum_map_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); @@ -3729,65 +4344,62 @@ core_tests_pigeon_test_host_integration_core_api_send_multiple_nullable_types_re return self; } -struct - _CoreTestsPigeonTestHostIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponse { +struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullClassMapResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponse, - core_tests_pigeon_test_host_integration_core_api_send_multiple_nullable_types_without_recursion_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullClassMapResponse, + core_tests_pigeon_test_host_integration_core_api_echo_non_null_class_map_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_send_multiple_nullable_types_without_recursion_response_dispose( +core_tests_pigeon_test_host_integration_core_api_echo_non_null_class_map_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponse* - self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_SEND_MULTIPLE_NULLABLE_TYPES_WITHOUT_RECURSION_RESPONSE( - object); + CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullClassMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NON_NULL_CLASS_MAP_RESPONSE( + object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_send_multiple_nullable_types_without_recursion_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_echo_non_null_class_map_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_send_multiple_nullable_types_without_recursion_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponse* +core_tests_pigeon_test_host_integration_core_api_echo_non_null_class_map_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullClassMapResponse* self) {} static void -core_tests_pigeon_test_host_integration_core_api_send_multiple_nullable_types_without_recursion_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponseClass* +core_tests_pigeon_test_host_integration_core_api_echo_non_null_class_map_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullClassMapResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_send_multiple_nullable_types_without_recursion_response_dispose; + core_tests_pigeon_test_host_integration_core_api_echo_non_null_class_map_response_dispose; } -CoreTestsPigeonTestHostIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponse* -core_tests_pigeon_test_host_integration_core_api_send_multiple_nullable_types_without_recursion_response_new( - CoreTestsPigeonTestAllNullableTypesWithoutRecursion* return_value) { - CoreTestsPigeonTestHostIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponse* - self = CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_SEND_MULTIPLE_NULLABLE_TYPES_WITHOUT_RECURSION_RESPONSE( +CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullClassMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_non_null_class_map_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullClassMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NON_NULL_CLASS_MAP_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_send_multiple_nullable_types_without_recursion_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_non_null_class_map_response_get_type(), nullptr)); self->value = fl_value_new_list(); - fl_value_append_take(self->value, - fl_value_new_custom_object(133, G_OBJECT(return_value))); + fl_value_append_take(self->value, fl_value_ref(return_value)); return self; } -CoreTestsPigeonTestHostIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponse* -core_tests_pigeon_test_host_integration_core_api_send_multiple_nullable_types_without_recursion_response_new_error( +CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullClassMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_non_null_class_map_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponse* - self = CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_SEND_MULTIPLE_NULLABLE_TYPES_WITHOUT_RECURSION_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullClassMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NON_NULL_CLASS_MAP_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_send_multiple_nullable_types_without_recursion_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_non_null_class_map_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); @@ -3798,63 +4410,62 @@ core_tests_pigeon_test_host_integration_core_api_send_multiple_nullable_types_wi return self; } -struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableIntResponse { +struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoClassWrapperResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableIntResponse, - core_tests_pigeon_test_host_integration_core_api_echo_nullable_int_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoClassWrapperResponse, + core_tests_pigeon_test_host_integration_core_api_echo_class_wrapper_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_echo_nullable_int_response_dispose( +core_tests_pigeon_test_host_integration_core_api_echo_class_wrapper_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableIntResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_INT_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoClassWrapperResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_CLASS_WRAPPER_RESPONSE( object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_echo_nullable_int_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_echo_class_wrapper_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_echo_nullable_int_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableIntResponse* self) {} +core_tests_pigeon_test_host_integration_core_api_echo_class_wrapper_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoClassWrapperResponse* self) {} static void -core_tests_pigeon_test_host_integration_core_api_echo_nullable_int_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableIntResponseClass* +core_tests_pigeon_test_host_integration_core_api_echo_class_wrapper_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoClassWrapperResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_echo_nullable_int_response_dispose; + core_tests_pigeon_test_host_integration_core_api_echo_class_wrapper_response_dispose; } -CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableIntResponse* -core_tests_pigeon_test_host_integration_core_api_echo_nullable_int_response_new( - int64_t* return_value) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableIntResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_INT_RESPONSE( +CoreTestsPigeonTestHostIntegrationCoreApiEchoClassWrapperResponse* +core_tests_pigeon_test_host_integration_core_api_echo_class_wrapper_response_new( + CoreTestsPigeonTestAllClassesWrapper* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoClassWrapperResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_CLASS_WRAPPER_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_nullable_int_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_class_wrapper_response_get_type(), nullptr)); self->value = fl_value_new_list(); - fl_value_append_take(self->value, return_value != nullptr - ? fl_value_new_int(*return_value) - : fl_value_new_null()); + fl_value_append_take(self->value, + fl_value_new_custom_object(135, G_OBJECT(return_value))); return self; } -CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableIntResponse* -core_tests_pigeon_test_host_integration_core_api_echo_nullable_int_response_new_error( +CoreTestsPigeonTestHostIntegrationCoreApiEchoClassWrapperResponse* +core_tests_pigeon_test_host_integration_core_api_echo_class_wrapper_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableIntResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_INT_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoClassWrapperResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_CLASS_WRAPPER_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_nullable_int_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_class_wrapper_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); @@ -3865,65 +4476,61 @@ core_tests_pigeon_test_host_integration_core_api_echo_nullable_int_response_new_ return self; } -struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableDoubleResponse { +struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableDoubleResponse, - core_tests_pigeon_test_host_integration_core_api_echo_nullable_double_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumResponse, + core_tests_pigeon_test_host_integration_core_api_echo_enum_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_echo_nullable_double_response_dispose( +core_tests_pigeon_test_host_integration_core_api_echo_enum_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableDoubleResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_DOUBLE_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ENUM_RESPONSE( object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_echo_nullable_double_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_echo_enum_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_echo_nullable_double_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableDoubleResponse* self) { -} +core_tests_pigeon_test_host_integration_core_api_echo_enum_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumResponse* self) {} static void -core_tests_pigeon_test_host_integration_core_api_echo_nullable_double_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableDoubleResponseClass* - klass) { +core_tests_pigeon_test_host_integration_core_api_echo_enum_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_echo_nullable_double_response_dispose; + core_tests_pigeon_test_host_integration_core_api_echo_enum_response_dispose; } -CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableDoubleResponse* -core_tests_pigeon_test_host_integration_core_api_echo_nullable_double_response_new( - double* return_value) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableDoubleResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_DOUBLE_RESPONSE( - g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_nullable_double_response_get_type(), - nullptr)); +CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumResponse* +core_tests_pigeon_test_host_integration_core_api_echo_enum_response_new( + CoreTestsPigeonTestAnEnum return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ENUM_RESPONSE(g_object_new( + core_tests_pigeon_test_host_integration_core_api_echo_enum_response_get_type(), + nullptr)); self->value = fl_value_new_list(); - fl_value_append_take(self->value, return_value != nullptr - ? fl_value_new_float(*return_value) - : fl_value_new_null()); + fl_value_append_take(self->value, + fl_value_new_custom(129, fl_value_new_int(return_value), + (GDestroyNotify)fl_value_unref)); return self; } -CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableDoubleResponse* -core_tests_pigeon_test_host_integration_core_api_echo_nullable_double_response_new_error( +CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumResponse* +core_tests_pigeon_test_host_integration_core_api_echo_enum_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableDoubleResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_DOUBLE_RESPONSE( - g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_nullable_double_response_get_type(), - nullptr)); + CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ENUM_RESPONSE(g_object_new( + core_tests_pigeon_test_host_integration_core_api_echo_enum_response_get_type(), + nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); fl_value_append_take(self->value, @@ -3933,63 +4540,63 @@ core_tests_pigeon_test_host_integration_core_api_echo_nullable_double_response_n return self; } -struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableBoolResponse { +struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherEnumResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableBoolResponse, - core_tests_pigeon_test_host_integration_core_api_echo_nullable_bool_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherEnumResponse, + core_tests_pigeon_test_host_integration_core_api_echo_another_enum_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_echo_nullable_bool_response_dispose( +core_tests_pigeon_test_host_integration_core_api_echo_another_enum_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableBoolResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_BOOL_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherEnumResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ANOTHER_ENUM_RESPONSE( object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_echo_nullable_bool_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_echo_another_enum_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_echo_nullable_bool_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableBoolResponse* self) {} +core_tests_pigeon_test_host_integration_core_api_echo_another_enum_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherEnumResponse* self) {} static void -core_tests_pigeon_test_host_integration_core_api_echo_nullable_bool_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableBoolResponseClass* +core_tests_pigeon_test_host_integration_core_api_echo_another_enum_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherEnumResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_echo_nullable_bool_response_dispose; + core_tests_pigeon_test_host_integration_core_api_echo_another_enum_response_dispose; } -CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableBoolResponse* -core_tests_pigeon_test_host_integration_core_api_echo_nullable_bool_response_new( - gboolean* return_value) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableBoolResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_BOOL_RESPONSE( +CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherEnumResponse* +core_tests_pigeon_test_host_integration_core_api_echo_another_enum_response_new( + CoreTestsPigeonTestAnotherEnum return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherEnumResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ANOTHER_ENUM_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_nullable_bool_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_another_enum_response_get_type(), nullptr)); self->value = fl_value_new_list(); - fl_value_append_take(self->value, return_value != nullptr - ? fl_value_new_bool(*return_value) - : fl_value_new_null()); + fl_value_append_take(self->value, + fl_value_new_custom(130, fl_value_new_int(return_value), + (GDestroyNotify)fl_value_unref)); return self; } -CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableBoolResponse* -core_tests_pigeon_test_host_integration_core_api_echo_nullable_bool_response_new_error( +CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherEnumResponse* +core_tests_pigeon_test_host_integration_core_api_echo_another_enum_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableBoolResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_BOOL_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherEnumResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ANOTHER_ENUM_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_nullable_bool_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_another_enum_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); @@ -4000,64 +4607,63 @@ core_tests_pigeon_test_host_integration_core_api_echo_nullable_bool_response_new return self; } -struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableStringResponse { +struct + _CoreTestsPigeonTestHostIntegrationCoreApiEchoNamedDefaultStringResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableStringResponse, - core_tests_pigeon_test_host_integration_core_api_echo_nullable_string_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoNamedDefaultStringResponse, + core_tests_pigeon_test_host_integration_core_api_echo_named_default_string_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_echo_nullable_string_response_dispose( +core_tests_pigeon_test_host_integration_core_api_echo_named_default_string_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableStringResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_STRING_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNamedDefaultStringResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NAMED_DEFAULT_STRING_RESPONSE( object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_echo_nullable_string_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_echo_named_default_string_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_echo_nullable_string_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableStringResponse* self) { -} +core_tests_pigeon_test_host_integration_core_api_echo_named_default_string_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNamedDefaultStringResponse* + self) {} static void -core_tests_pigeon_test_host_integration_core_api_echo_nullable_string_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableStringResponseClass* +core_tests_pigeon_test_host_integration_core_api_echo_named_default_string_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNamedDefaultStringResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_echo_nullable_string_response_dispose; + core_tests_pigeon_test_host_integration_core_api_echo_named_default_string_response_dispose; } -CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableStringResponse* -core_tests_pigeon_test_host_integration_core_api_echo_nullable_string_response_new( +CoreTestsPigeonTestHostIntegrationCoreApiEchoNamedDefaultStringResponse* +core_tests_pigeon_test_host_integration_core_api_echo_named_default_string_response_new( const gchar* return_value) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableStringResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_STRING_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNamedDefaultStringResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NAMED_DEFAULT_STRING_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_nullable_string_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_named_default_string_response_get_type(), nullptr)); self->value = fl_value_new_list(); - fl_value_append_take(self->value, return_value != nullptr - ? fl_value_new_string(return_value) - : fl_value_new_null()); + fl_value_append_take(self->value, fl_value_new_string(return_value)); return self; } -CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableStringResponse* -core_tests_pigeon_test_host_integration_core_api_echo_nullable_string_response_new_error( +CoreTestsPigeonTestHostIntegrationCoreApiEchoNamedDefaultStringResponse* +core_tests_pigeon_test_host_integration_core_api_echo_named_default_string_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableStringResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_STRING_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNamedDefaultStringResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NAMED_DEFAULT_STRING_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_nullable_string_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_named_default_string_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); @@ -4068,65 +4674,63 @@ core_tests_pigeon_test_host_integration_core_api_echo_nullable_string_response_n return self; } -struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableUint8ListResponse { +struct + _CoreTestsPigeonTestHostIntegrationCoreApiEchoOptionalDefaultDoubleResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableUint8ListResponse, - core_tests_pigeon_test_host_integration_core_api_echo_nullable_uint8_list_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoOptionalDefaultDoubleResponse, + core_tests_pigeon_test_host_integration_core_api_echo_optional_default_double_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_echo_nullable_uint8_list_response_dispose( +core_tests_pigeon_test_host_integration_core_api_echo_optional_default_double_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableUint8ListResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_UINT8_LIST_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoOptionalDefaultDoubleResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_OPTIONAL_DEFAULT_DOUBLE_RESPONSE( object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_echo_nullable_uint8_list_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_echo_optional_default_double_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_echo_nullable_uint8_list_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableUint8ListResponse* +core_tests_pigeon_test_host_integration_core_api_echo_optional_default_double_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoOptionalDefaultDoubleResponse* self) {} static void -core_tests_pigeon_test_host_integration_core_api_echo_nullable_uint8_list_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableUint8ListResponseClass* +core_tests_pigeon_test_host_integration_core_api_echo_optional_default_double_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoOptionalDefaultDoubleResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_echo_nullable_uint8_list_response_dispose; + core_tests_pigeon_test_host_integration_core_api_echo_optional_default_double_response_dispose; } -CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableUint8ListResponse* -core_tests_pigeon_test_host_integration_core_api_echo_nullable_uint8_list_response_new( - const uint8_t* return_value, size_t return_value_length) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableUint8ListResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_UINT8_LIST_RESPONSE( +CoreTestsPigeonTestHostIntegrationCoreApiEchoOptionalDefaultDoubleResponse* +core_tests_pigeon_test_host_integration_core_api_echo_optional_default_double_response_new( + double return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoOptionalDefaultDoubleResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_OPTIONAL_DEFAULT_DOUBLE_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_nullable_uint8_list_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_optional_default_double_response_get_type(), nullptr)); self->value = fl_value_new_list(); - fl_value_append_take(self->value, return_value != nullptr - ? fl_value_new_uint8_list( - return_value, return_value_length) - : fl_value_new_null()); + fl_value_append_take(self->value, fl_value_new_float(return_value)); return self; } -CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableUint8ListResponse* -core_tests_pigeon_test_host_integration_core_api_echo_nullable_uint8_list_response_new_error( +CoreTestsPigeonTestHostIntegrationCoreApiEchoOptionalDefaultDoubleResponse* +core_tests_pigeon_test_host_integration_core_api_echo_optional_default_double_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableUint8ListResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_UINT8_LIST_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoOptionalDefaultDoubleResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_OPTIONAL_DEFAULT_DOUBLE_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_nullable_uint8_list_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_optional_default_double_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); @@ -4137,64 +4741,61 @@ core_tests_pigeon_test_host_integration_core_api_echo_nullable_uint8_list_respon return self; } -struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableObjectResponse { +struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoRequiredIntResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableObjectResponse, - core_tests_pigeon_test_host_integration_core_api_echo_nullable_object_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoRequiredIntResponse, + core_tests_pigeon_test_host_integration_core_api_echo_required_int_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_echo_nullable_object_response_dispose( +core_tests_pigeon_test_host_integration_core_api_echo_required_int_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableObjectResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_OBJECT_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoRequiredIntResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_REQUIRED_INT_RESPONSE( object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_echo_nullable_object_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_echo_required_int_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_echo_nullable_object_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableObjectResponse* self) { -} +core_tests_pigeon_test_host_integration_core_api_echo_required_int_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoRequiredIntResponse* self) {} static void -core_tests_pigeon_test_host_integration_core_api_echo_nullable_object_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableObjectResponseClass* +core_tests_pigeon_test_host_integration_core_api_echo_required_int_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoRequiredIntResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_echo_nullable_object_response_dispose; + core_tests_pigeon_test_host_integration_core_api_echo_required_int_response_dispose; } -CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableObjectResponse* -core_tests_pigeon_test_host_integration_core_api_echo_nullable_object_response_new( - FlValue* return_value) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableObjectResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_OBJECT_RESPONSE( +CoreTestsPigeonTestHostIntegrationCoreApiEchoRequiredIntResponse* +core_tests_pigeon_test_host_integration_core_api_echo_required_int_response_new( + int64_t return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoRequiredIntResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_REQUIRED_INT_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_nullable_object_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_required_int_response_get_type(), nullptr)); self->value = fl_value_new_list(); - fl_value_append_take(self->value, return_value != nullptr - ? fl_value_ref(return_value) - : fl_value_new_null()); + fl_value_append_take(self->value, fl_value_new_int(return_value)); return self; } -CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableObjectResponse* -core_tests_pigeon_test_host_integration_core_api_echo_nullable_object_response_new_error( +CoreTestsPigeonTestHostIntegrationCoreApiEchoRequiredIntResponse* +core_tests_pigeon_test_host_integration_core_api_echo_required_int_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableObjectResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_OBJECT_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoRequiredIntResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_REQUIRED_INT_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_nullable_object_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_required_int_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); @@ -4205,63 +4806,65 @@ core_tests_pigeon_test_host_integration_core_api_echo_nullable_object_response_n return self; } -struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableListResponse { +struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoAllNullableTypesResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableListResponse, - core_tests_pigeon_test_host_integration_core_api_echo_nullable_list_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoAllNullableTypesResponse, + core_tests_pigeon_test_host_integration_core_api_echo_all_nullable_types_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_echo_nullable_list_response_dispose( +core_tests_pigeon_test_host_integration_core_api_echo_all_nullable_types_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableListResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_LIST_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAllNullableTypesResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ALL_NULLABLE_TYPES_RESPONSE( object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_echo_nullable_list_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_echo_all_nullable_types_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_echo_nullable_list_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableListResponse* self) {} +core_tests_pigeon_test_host_integration_core_api_echo_all_nullable_types_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAllNullableTypesResponse* + self) {} static void -core_tests_pigeon_test_host_integration_core_api_echo_nullable_list_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableListResponseClass* +core_tests_pigeon_test_host_integration_core_api_echo_all_nullable_types_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAllNullableTypesResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_echo_nullable_list_response_dispose; + core_tests_pigeon_test_host_integration_core_api_echo_all_nullable_types_response_dispose; } -CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableListResponse* -core_tests_pigeon_test_host_integration_core_api_echo_nullable_list_response_new( - FlValue* return_value) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableListResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_LIST_RESPONSE( +CoreTestsPigeonTestHostIntegrationCoreApiEchoAllNullableTypesResponse* +core_tests_pigeon_test_host_integration_core_api_echo_all_nullable_types_response_new( + CoreTestsPigeonTestAllNullableTypes* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoAllNullableTypesResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ALL_NULLABLE_TYPES_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_nullable_list_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_all_nullable_types_response_get_type(), nullptr)); self->value = fl_value_new_list(); - fl_value_append_take(self->value, return_value != nullptr - ? fl_value_ref(return_value) - : fl_value_new_null()); + fl_value_append_take( + self->value, return_value != nullptr + ? fl_value_new_custom_object(133, G_OBJECT(return_value)) + : fl_value_new_null()); return self; } -CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableListResponse* -core_tests_pigeon_test_host_integration_core_api_echo_nullable_list_response_new_error( +CoreTestsPigeonTestHostIntegrationCoreApiEchoAllNullableTypesResponse* +core_tests_pigeon_test_host_integration_core_api_echo_all_nullable_types_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableListResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_LIST_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAllNullableTypesResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ALL_NULLABLE_TYPES_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_nullable_list_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_all_nullable_types_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); @@ -4272,63 +4875,67 @@ core_tests_pigeon_test_host_integration_core_api_echo_nullable_list_response_new return self; } -struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableMapResponse { +struct + _CoreTestsPigeonTestHostIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableMapResponse, - core_tests_pigeon_test_host_integration_core_api_echo_nullable_map_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponse, + core_tests_pigeon_test_host_integration_core_api_echo_all_nullable_types_without_recursion_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_echo_nullable_map_response_dispose( +core_tests_pigeon_test_host_integration_core_api_echo_all_nullable_types_without_recursion_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableMapResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_MAP_RESPONSE( - object); + CoreTestsPigeonTestHostIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponse* + self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ALL_NULLABLE_TYPES_WITHOUT_RECURSION_RESPONSE( + object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_echo_nullable_map_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_echo_all_nullable_types_without_recursion_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_echo_nullable_map_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableMapResponse* self) {} +core_tests_pigeon_test_host_integration_core_api_echo_all_nullable_types_without_recursion_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponse* + self) {} static void -core_tests_pigeon_test_host_integration_core_api_echo_nullable_map_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableMapResponseClass* +core_tests_pigeon_test_host_integration_core_api_echo_all_nullable_types_without_recursion_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_echo_nullable_map_response_dispose; + core_tests_pigeon_test_host_integration_core_api_echo_all_nullable_types_without_recursion_response_dispose; } -CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableMapResponse* -core_tests_pigeon_test_host_integration_core_api_echo_nullable_map_response_new( - FlValue* return_value) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableMapResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_MAP_RESPONSE( +CoreTestsPigeonTestHostIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponse* +core_tests_pigeon_test_host_integration_core_api_echo_all_nullable_types_without_recursion_response_new( + CoreTestsPigeonTestAllNullableTypesWithoutRecursion* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponse* + self = CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ALL_NULLABLE_TYPES_WITHOUT_RECURSION_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_nullable_map_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_all_nullable_types_without_recursion_response_get_type(), nullptr)); self->value = fl_value_new_list(); - fl_value_append_take(self->value, return_value != nullptr - ? fl_value_ref(return_value) - : fl_value_new_null()); + fl_value_append_take( + self->value, return_value != nullptr + ? fl_value_new_custom_object(134, G_OBJECT(return_value)) + : fl_value_new_null()); return self; } -CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableMapResponse* -core_tests_pigeon_test_host_integration_core_api_echo_nullable_map_response_new_error( +CoreTestsPigeonTestHostIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponse* +core_tests_pigeon_test_host_integration_core_api_echo_all_nullable_types_without_recursion_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableMapResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_MAP_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponse* + self = CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ALL_NULLABLE_TYPES_WITHOUT_RECURSION_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_nullable_map_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_all_nullable_types_without_recursion_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); @@ -4339,66 +4946,66 @@ core_tests_pigeon_test_host_integration_core_api_echo_nullable_map_response_new_ return self; } -struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableEnumResponse { +struct + _CoreTestsPigeonTestHostIntegrationCoreApiExtractNestedNullableStringResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableEnumResponse, - core_tests_pigeon_test_host_integration_core_api_echo_nullable_enum_response, + CoreTestsPigeonTestHostIntegrationCoreApiExtractNestedNullableStringResponse, + core_tests_pigeon_test_host_integration_core_api_extract_nested_nullable_string_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_echo_nullable_enum_response_dispose( +core_tests_pigeon_test_host_integration_core_api_extract_nested_nullable_string_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableEnumResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_ENUM_RESPONSE( - object); + CoreTestsPigeonTestHostIntegrationCoreApiExtractNestedNullableStringResponse* + self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_EXTRACT_NESTED_NULLABLE_STRING_RESPONSE( + object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_echo_nullable_enum_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_extract_nested_nullable_string_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_echo_nullable_enum_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableEnumResponse* self) {} +core_tests_pigeon_test_host_integration_core_api_extract_nested_nullable_string_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiExtractNestedNullableStringResponse* + self) {} static void -core_tests_pigeon_test_host_integration_core_api_echo_nullable_enum_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableEnumResponseClass* +core_tests_pigeon_test_host_integration_core_api_extract_nested_nullable_string_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiExtractNestedNullableStringResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_echo_nullable_enum_response_dispose; + core_tests_pigeon_test_host_integration_core_api_extract_nested_nullable_string_response_dispose; } -CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableEnumResponse* -core_tests_pigeon_test_host_integration_core_api_echo_nullable_enum_response_new( - CoreTestsPigeonTestAnEnum* return_value) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableEnumResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_ENUM_RESPONSE( +CoreTestsPigeonTestHostIntegrationCoreApiExtractNestedNullableStringResponse* +core_tests_pigeon_test_host_integration_core_api_extract_nested_nullable_string_response_new( + const gchar* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiExtractNestedNullableStringResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_EXTRACT_NESTED_NULLABLE_STRING_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_nullable_enum_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_extract_nested_nullable_string_response_get_type(), nullptr)); self->value = fl_value_new_list(); - fl_value_append_take( - self->value, - return_value != nullptr - ? fl_value_new_custom(129, fl_value_new_int(*return_value), - (GDestroyNotify)fl_value_unref) - : fl_value_new_null()); + fl_value_append_take(self->value, return_value != nullptr + ? fl_value_new_string(return_value) + : fl_value_new_null()); return self; } -CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableEnumResponse* -core_tests_pigeon_test_host_integration_core_api_echo_nullable_enum_response_new_error( +CoreTestsPigeonTestHostIntegrationCoreApiExtractNestedNullableStringResponse* +core_tests_pigeon_test_host_integration_core_api_extract_nested_nullable_string_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableEnumResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_ENUM_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiExtractNestedNullableStringResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_EXTRACT_NESTED_NULLABLE_STRING_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_nullable_enum_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_extract_nested_nullable_string_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); @@ -4410,67 +5017,63 @@ core_tests_pigeon_test_host_integration_core_api_echo_nullable_enum_response_new } struct - _CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherNullableEnumResponse { + _CoreTestsPigeonTestHostIntegrationCoreApiCreateNestedNullableStringResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherNullableEnumResponse, - core_tests_pigeon_test_host_integration_core_api_echo_another_nullable_enum_response, + CoreTestsPigeonTestHostIntegrationCoreApiCreateNestedNullableStringResponse, + core_tests_pigeon_test_host_integration_core_api_create_nested_nullable_string_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_echo_another_nullable_enum_response_dispose( +core_tests_pigeon_test_host_integration_core_api_create_nested_nullable_string_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherNullableEnumResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ANOTHER_NULLABLE_ENUM_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiCreateNestedNullableStringResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CREATE_NESTED_NULLABLE_STRING_RESPONSE( object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_echo_another_nullable_enum_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_create_nested_nullable_string_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_echo_another_nullable_enum_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherNullableEnumResponse* +core_tests_pigeon_test_host_integration_core_api_create_nested_nullable_string_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiCreateNestedNullableStringResponse* self) {} static void -core_tests_pigeon_test_host_integration_core_api_echo_another_nullable_enum_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherNullableEnumResponseClass* +core_tests_pigeon_test_host_integration_core_api_create_nested_nullable_string_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiCreateNestedNullableStringResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_echo_another_nullable_enum_response_dispose; + core_tests_pigeon_test_host_integration_core_api_create_nested_nullable_string_response_dispose; } -CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherNullableEnumResponse* -core_tests_pigeon_test_host_integration_core_api_echo_another_nullable_enum_response_new( - CoreTestsPigeonTestAnotherEnum* return_value) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherNullableEnumResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ANOTHER_NULLABLE_ENUM_RESPONSE( +CoreTestsPigeonTestHostIntegrationCoreApiCreateNestedNullableStringResponse* +core_tests_pigeon_test_host_integration_core_api_create_nested_nullable_string_response_new( + CoreTestsPigeonTestAllClassesWrapper* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiCreateNestedNullableStringResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CREATE_NESTED_NULLABLE_STRING_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_another_nullable_enum_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_create_nested_nullable_string_response_get_type(), nullptr)); self->value = fl_value_new_list(); - fl_value_append_take( - self->value, - return_value != nullptr - ? fl_value_new_custom(130, fl_value_new_int(*return_value), - (GDestroyNotify)fl_value_unref) - : fl_value_new_null()); + fl_value_append_take(self->value, + fl_value_new_custom_object(135, G_OBJECT(return_value))); return self; } -CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherNullableEnumResponse* -core_tests_pigeon_test_host_integration_core_api_echo_another_nullable_enum_response_new_error( +CoreTestsPigeonTestHostIntegrationCoreApiCreateNestedNullableStringResponse* +core_tests_pigeon_test_host_integration_core_api_create_nested_nullable_string_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherNullableEnumResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ANOTHER_NULLABLE_ENUM_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiCreateNestedNullableStringResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CREATE_NESTED_NULLABLE_STRING_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_another_nullable_enum_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_create_nested_nullable_string_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); @@ -4482,64 +5085,63 @@ core_tests_pigeon_test_host_integration_core_api_echo_another_nullable_enum_resp } struct - _CoreTestsPigeonTestHostIntegrationCoreApiEchoOptionalNullableIntResponse { + _CoreTestsPigeonTestHostIntegrationCoreApiSendMultipleNullableTypesResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoOptionalNullableIntResponse, - core_tests_pigeon_test_host_integration_core_api_echo_optional_nullable_int_response, + CoreTestsPigeonTestHostIntegrationCoreApiSendMultipleNullableTypesResponse, + core_tests_pigeon_test_host_integration_core_api_send_multiple_nullable_types_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_echo_optional_nullable_int_response_dispose( +core_tests_pigeon_test_host_integration_core_api_send_multiple_nullable_types_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoOptionalNullableIntResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_OPTIONAL_NULLABLE_INT_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiSendMultipleNullableTypesResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_SEND_MULTIPLE_NULLABLE_TYPES_RESPONSE( object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_echo_optional_nullable_int_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_send_multiple_nullable_types_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_echo_optional_nullable_int_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoOptionalNullableIntResponse* +core_tests_pigeon_test_host_integration_core_api_send_multiple_nullable_types_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiSendMultipleNullableTypesResponse* self) {} static void -core_tests_pigeon_test_host_integration_core_api_echo_optional_nullable_int_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoOptionalNullableIntResponseClass* +core_tests_pigeon_test_host_integration_core_api_send_multiple_nullable_types_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiSendMultipleNullableTypesResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_echo_optional_nullable_int_response_dispose; + core_tests_pigeon_test_host_integration_core_api_send_multiple_nullable_types_response_dispose; } -CoreTestsPigeonTestHostIntegrationCoreApiEchoOptionalNullableIntResponse* -core_tests_pigeon_test_host_integration_core_api_echo_optional_nullable_int_response_new( - int64_t* return_value) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoOptionalNullableIntResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_OPTIONAL_NULLABLE_INT_RESPONSE( +CoreTestsPigeonTestHostIntegrationCoreApiSendMultipleNullableTypesResponse* +core_tests_pigeon_test_host_integration_core_api_send_multiple_nullable_types_response_new( + CoreTestsPigeonTestAllNullableTypes* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiSendMultipleNullableTypesResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_SEND_MULTIPLE_NULLABLE_TYPES_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_optional_nullable_int_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_send_multiple_nullable_types_response_get_type(), nullptr)); self->value = fl_value_new_list(); - fl_value_append_take(self->value, return_value != nullptr - ? fl_value_new_int(*return_value) - : fl_value_new_null()); + fl_value_append_take(self->value, + fl_value_new_custom_object(133, G_OBJECT(return_value))); return self; } -CoreTestsPigeonTestHostIntegrationCoreApiEchoOptionalNullableIntResponse* -core_tests_pigeon_test_host_integration_core_api_echo_optional_nullable_int_response_new_error( +CoreTestsPigeonTestHostIntegrationCoreApiSendMultipleNullableTypesResponse* +core_tests_pigeon_test_host_integration_core_api_send_multiple_nullable_types_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoOptionalNullableIntResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_OPTIONAL_NULLABLE_INT_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiSendMultipleNullableTypesResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_SEND_MULTIPLE_NULLABLE_TYPES_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_optional_nullable_int_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_send_multiple_nullable_types_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); @@ -4551,64 +5153,64 @@ core_tests_pigeon_test_host_integration_core_api_echo_optional_nullable_int_resp } struct - _CoreTestsPigeonTestHostIntegrationCoreApiEchoNamedNullableStringResponse { + _CoreTestsPigeonTestHostIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoNamedNullableStringResponse, - core_tests_pigeon_test_host_integration_core_api_echo_named_nullable_string_response, + CoreTestsPigeonTestHostIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponse, + core_tests_pigeon_test_host_integration_core_api_send_multiple_nullable_types_without_recursion_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_echo_named_nullable_string_response_dispose( +core_tests_pigeon_test_host_integration_core_api_send_multiple_nullable_types_without_recursion_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoNamedNullableStringResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NAMED_NULLABLE_STRING_RESPONSE( - object); + CoreTestsPigeonTestHostIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponse* + self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_SEND_MULTIPLE_NULLABLE_TYPES_WITHOUT_RECURSION_RESPONSE( + object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_echo_named_nullable_string_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_send_multiple_nullable_types_without_recursion_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_echo_named_nullable_string_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoNamedNullableStringResponse* +core_tests_pigeon_test_host_integration_core_api_send_multiple_nullable_types_without_recursion_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponse* self) {} static void -core_tests_pigeon_test_host_integration_core_api_echo_named_nullable_string_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoNamedNullableStringResponseClass* +core_tests_pigeon_test_host_integration_core_api_send_multiple_nullable_types_without_recursion_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_echo_named_nullable_string_response_dispose; + core_tests_pigeon_test_host_integration_core_api_send_multiple_nullable_types_without_recursion_response_dispose; } -CoreTestsPigeonTestHostIntegrationCoreApiEchoNamedNullableStringResponse* -core_tests_pigeon_test_host_integration_core_api_echo_named_nullable_string_response_new( - const gchar* return_value) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoNamedNullableStringResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NAMED_NULLABLE_STRING_RESPONSE( +CoreTestsPigeonTestHostIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponse* +core_tests_pigeon_test_host_integration_core_api_send_multiple_nullable_types_without_recursion_response_new( + CoreTestsPigeonTestAllNullableTypesWithoutRecursion* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponse* + self = CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_SEND_MULTIPLE_NULLABLE_TYPES_WITHOUT_RECURSION_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_named_nullable_string_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_send_multiple_nullable_types_without_recursion_response_get_type(), nullptr)); self->value = fl_value_new_list(); - fl_value_append_take(self->value, return_value != nullptr - ? fl_value_new_string(return_value) - : fl_value_new_null()); + fl_value_append_take(self->value, + fl_value_new_custom_object(134, G_OBJECT(return_value))); return self; } -CoreTestsPigeonTestHostIntegrationCoreApiEchoNamedNullableStringResponse* -core_tests_pigeon_test_host_integration_core_api_echo_named_nullable_string_response_new_error( +CoreTestsPigeonTestHostIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponse* +core_tests_pigeon_test_host_integration_core_api_send_multiple_nullable_types_without_recursion_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoNamedNullableStringResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NAMED_NULLABLE_STRING_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponse* + self = CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_SEND_MULTIPLE_NULLABLE_TYPES_WITHOUT_RECURSION_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_named_nullable_string_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_send_multiple_nullable_types_without_recursion_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); @@ -4619,64 +5221,64 @@ core_tests_pigeon_test_host_integration_core_api_echo_named_nullable_string_resp return self; } -G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiNoopAsyncResponse, - core_tests_pigeon_test_host_integration_core_api_noop_async_response, - CORE_TESTS_PIGEON_TEST, HOST_INTEGRATION_CORE_API_NOOP_ASYNC_RESPONSE, - GObject) - -struct _CoreTestsPigeonTestHostIntegrationCoreApiNoopAsyncResponse { +struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableIntResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiNoopAsyncResponse, - core_tests_pigeon_test_host_integration_core_api_noop_async_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableIntResponse, + core_tests_pigeon_test_host_integration_core_api_echo_nullable_int_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_noop_async_response_dispose( +core_tests_pigeon_test_host_integration_core_api_echo_nullable_int_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiNoopAsyncResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_NOOP_ASYNC_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableIntResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_INT_RESPONSE( object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_noop_async_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_echo_nullable_int_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_noop_async_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiNoopAsyncResponse* self) {} +core_tests_pigeon_test_host_integration_core_api_echo_nullable_int_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableIntResponse* self) {} static void -core_tests_pigeon_test_host_integration_core_api_noop_async_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiNoopAsyncResponseClass* klass) { +core_tests_pigeon_test_host_integration_core_api_echo_nullable_int_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableIntResponseClass* + klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_noop_async_response_dispose; + core_tests_pigeon_test_host_integration_core_api_echo_nullable_int_response_dispose; } -static CoreTestsPigeonTestHostIntegrationCoreApiNoopAsyncResponse* -core_tests_pigeon_test_host_integration_core_api_noop_async_response_new() { - CoreTestsPigeonTestHostIntegrationCoreApiNoopAsyncResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_NOOP_ASYNC_RESPONSE(g_object_new( - core_tests_pigeon_test_host_integration_core_api_noop_async_response_get_type(), - nullptr)); +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableIntResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_int_response_new( + int64_t* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableIntResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_INT_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_echo_nullable_int_response_get_type(), + nullptr)); self->value = fl_value_new_list(); - fl_value_append_take(self->value, fl_value_new_null()); + fl_value_append_take(self->value, return_value != nullptr + ? fl_value_new_int(*return_value) + : fl_value_new_null()); return self; } -static CoreTestsPigeonTestHostIntegrationCoreApiNoopAsyncResponse* -core_tests_pigeon_test_host_integration_core_api_noop_async_response_new_error( +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableIntResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_int_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiNoopAsyncResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_NOOP_ASYNC_RESPONSE(g_object_new( - core_tests_pigeon_test_host_integration_core_api_noop_async_response_get_type(), - nullptr)); + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableIntResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_INT_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_echo_nullable_int_response_get_type(), + nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); fl_value_append_take(self->value, @@ -4686,66 +5288,64 @@ core_tests_pigeon_test_host_integration_core_api_noop_async_response_new_error( return self; } -G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncIntResponse, - core_tests_pigeon_test_host_integration_core_api_echo_async_int_response, - CORE_TESTS_PIGEON_TEST, HOST_INTEGRATION_CORE_API_ECHO_ASYNC_INT_RESPONSE, - GObject) - -struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncIntResponse { +struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableDoubleResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncIntResponse, - core_tests_pigeon_test_host_integration_core_api_echo_async_int_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableDoubleResponse, + core_tests_pigeon_test_host_integration_core_api_echo_nullable_double_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_echo_async_int_response_dispose( +core_tests_pigeon_test_host_integration_core_api_echo_nullable_double_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncIntResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_INT_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableDoubleResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_DOUBLE_RESPONSE( object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_echo_async_int_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_echo_nullable_double_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_echo_async_int_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncIntResponse* self) {} +core_tests_pigeon_test_host_integration_core_api_echo_nullable_double_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableDoubleResponse* self) { +} static void -core_tests_pigeon_test_host_integration_core_api_echo_async_int_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncIntResponseClass* klass) { +core_tests_pigeon_test_host_integration_core_api_echo_nullable_double_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableDoubleResponseClass* + klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_echo_async_int_response_dispose; + core_tests_pigeon_test_host_integration_core_api_echo_nullable_double_response_dispose; } -static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncIntResponse* -core_tests_pigeon_test_host_integration_core_api_echo_async_int_response_new( - int64_t return_value) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncIntResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_INT_RESPONSE( +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableDoubleResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_double_response_new( + double* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableDoubleResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_DOUBLE_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_async_int_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_nullable_double_response_get_type(), nullptr)); self->value = fl_value_new_list(); - fl_value_append_take(self->value, fl_value_new_int(return_value)); + fl_value_append_take(self->value, return_value != nullptr + ? fl_value_new_float(*return_value) + : fl_value_new_null()); return self; } -static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncIntResponse* -core_tests_pigeon_test_host_integration_core_api_echo_async_int_response_new_error( +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableDoubleResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_double_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncIntResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_INT_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableDoubleResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_DOUBLE_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_async_int_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_nullable_double_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); @@ -4756,67 +5356,63 @@ core_tests_pigeon_test_host_integration_core_api_echo_async_int_response_new_err return self; } -G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncDoubleResponse, - core_tests_pigeon_test_host_integration_core_api_echo_async_double_response, - CORE_TESTS_PIGEON_TEST, - HOST_INTEGRATION_CORE_API_ECHO_ASYNC_DOUBLE_RESPONSE, GObject) - -struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncDoubleResponse { +struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableBoolResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncDoubleResponse, - core_tests_pigeon_test_host_integration_core_api_echo_async_double_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableBoolResponse, + core_tests_pigeon_test_host_integration_core_api_echo_nullable_bool_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_echo_async_double_response_dispose( +core_tests_pigeon_test_host_integration_core_api_echo_nullable_bool_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncDoubleResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_DOUBLE_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableBoolResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_BOOL_RESPONSE( object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_echo_async_double_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_echo_nullable_bool_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_echo_async_double_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncDoubleResponse* self) {} +core_tests_pigeon_test_host_integration_core_api_echo_nullable_bool_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableBoolResponse* self) {} static void -core_tests_pigeon_test_host_integration_core_api_echo_async_double_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncDoubleResponseClass* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_bool_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableBoolResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_echo_async_double_response_dispose; + core_tests_pigeon_test_host_integration_core_api_echo_nullable_bool_response_dispose; } -static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncDoubleResponse* -core_tests_pigeon_test_host_integration_core_api_echo_async_double_response_new( - double return_value) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncDoubleResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_DOUBLE_RESPONSE( +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableBoolResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_bool_response_new( + gboolean* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableBoolResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_BOOL_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_async_double_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_nullable_bool_response_get_type(), nullptr)); self->value = fl_value_new_list(); - fl_value_append_take(self->value, fl_value_new_float(return_value)); + fl_value_append_take(self->value, return_value != nullptr + ? fl_value_new_bool(*return_value) + : fl_value_new_null()); return self; } -static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncDoubleResponse* -core_tests_pigeon_test_host_integration_core_api_echo_async_double_response_new_error( +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableBoolResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_bool_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncDoubleResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_DOUBLE_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableBoolResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_BOOL_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_async_double_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_nullable_bool_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); @@ -4827,67 +5423,64 @@ core_tests_pigeon_test_host_integration_core_api_echo_async_double_response_new_ return self; } -G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncBoolResponse, - core_tests_pigeon_test_host_integration_core_api_echo_async_bool_response, - CORE_TESTS_PIGEON_TEST, HOST_INTEGRATION_CORE_API_ECHO_ASYNC_BOOL_RESPONSE, - GObject) - -struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncBoolResponse { +struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableStringResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncBoolResponse, - core_tests_pigeon_test_host_integration_core_api_echo_async_bool_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableStringResponse, + core_tests_pigeon_test_host_integration_core_api_echo_nullable_string_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_echo_async_bool_response_dispose( +core_tests_pigeon_test_host_integration_core_api_echo_nullable_string_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncBoolResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_BOOL_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableStringResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_STRING_RESPONSE( object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_echo_async_bool_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_echo_nullable_string_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_echo_async_bool_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncBoolResponse* self) {} +core_tests_pigeon_test_host_integration_core_api_echo_nullable_string_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableStringResponse* self) { +} static void -core_tests_pigeon_test_host_integration_core_api_echo_async_bool_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncBoolResponseClass* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_string_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableStringResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_echo_async_bool_response_dispose; + core_tests_pigeon_test_host_integration_core_api_echo_nullable_string_response_dispose; } -static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncBoolResponse* -core_tests_pigeon_test_host_integration_core_api_echo_async_bool_response_new( - gboolean return_value) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncBoolResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_BOOL_RESPONSE( +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableStringResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_string_response_new( + const gchar* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableStringResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_STRING_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_async_bool_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_nullable_string_response_get_type(), nullptr)); self->value = fl_value_new_list(); - fl_value_append_take(self->value, fl_value_new_bool(return_value)); - return self; + fl_value_append_take(self->value, return_value != nullptr + ? fl_value_new_string(return_value) + : fl_value_new_null()); + return self; } -static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncBoolResponse* -core_tests_pigeon_test_host_integration_core_api_echo_async_bool_response_new_error( +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableStringResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_string_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncBoolResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_BOOL_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableStringResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_STRING_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_async_bool_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_nullable_string_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); @@ -4898,67 +5491,65 @@ core_tests_pigeon_test_host_integration_core_api_echo_async_bool_response_new_er return self; } -G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncStringResponse, - core_tests_pigeon_test_host_integration_core_api_echo_async_string_response, - CORE_TESTS_PIGEON_TEST, - HOST_INTEGRATION_CORE_API_ECHO_ASYNC_STRING_RESPONSE, GObject) - -struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncStringResponse { +struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableUint8ListResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncStringResponse, - core_tests_pigeon_test_host_integration_core_api_echo_async_string_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableUint8ListResponse, + core_tests_pigeon_test_host_integration_core_api_echo_nullable_uint8_list_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_echo_async_string_response_dispose( +core_tests_pigeon_test_host_integration_core_api_echo_nullable_uint8_list_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncStringResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_STRING_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableUint8ListResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_UINT8_LIST_RESPONSE( object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_echo_async_string_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_echo_nullable_uint8_list_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_echo_async_string_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncStringResponse* self) {} +core_tests_pigeon_test_host_integration_core_api_echo_nullable_uint8_list_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableUint8ListResponse* + self) {} static void -core_tests_pigeon_test_host_integration_core_api_echo_async_string_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncStringResponseClass* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_uint8_list_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableUint8ListResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_echo_async_string_response_dispose; + core_tests_pigeon_test_host_integration_core_api_echo_nullable_uint8_list_response_dispose; } -static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncStringResponse* -core_tests_pigeon_test_host_integration_core_api_echo_async_string_response_new( - const gchar* return_value) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncStringResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_STRING_RESPONSE( +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableUint8ListResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_uint8_list_response_new( + const uint8_t* return_value, size_t return_value_length) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableUint8ListResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_UINT8_LIST_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_async_string_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_nullable_uint8_list_response_get_type(), nullptr)); self->value = fl_value_new_list(); - fl_value_append_take(self->value, fl_value_new_string(return_value)); + fl_value_append_take(self->value, return_value != nullptr + ? fl_value_new_uint8_list( + return_value, return_value_length) + : fl_value_new_null()); return self; } -static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncStringResponse* -core_tests_pigeon_test_host_integration_core_api_echo_async_string_response_new_error( +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableUint8ListResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_uint8_list_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncStringResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_STRING_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableUint8ListResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_UINT8_LIST_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_async_string_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_nullable_uint8_list_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); @@ -4969,69 +5560,64 @@ core_tests_pigeon_test_host_integration_core_api_echo_async_string_response_new_ return self; } -G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncUint8ListResponse, - core_tests_pigeon_test_host_integration_core_api_echo_async_uint8_list_response, - CORE_TESTS_PIGEON_TEST, - HOST_INTEGRATION_CORE_API_ECHO_ASYNC_UINT8_LIST_RESPONSE, GObject) - -struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncUint8ListResponse { +struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableObjectResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncUint8ListResponse, - core_tests_pigeon_test_host_integration_core_api_echo_async_uint8_list_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableObjectResponse, + core_tests_pigeon_test_host_integration_core_api_echo_nullable_object_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_echo_async_uint8_list_response_dispose( +core_tests_pigeon_test_host_integration_core_api_echo_nullable_object_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncUint8ListResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_UINT8_LIST_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableObjectResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_OBJECT_RESPONSE( object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_echo_async_uint8_list_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_echo_nullable_object_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_echo_async_uint8_list_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncUint8ListResponse* self) { +core_tests_pigeon_test_host_integration_core_api_echo_nullable_object_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableObjectResponse* self) { } static void -core_tests_pigeon_test_host_integration_core_api_echo_async_uint8_list_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncUint8ListResponseClass* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_object_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableObjectResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_echo_async_uint8_list_response_dispose; + core_tests_pigeon_test_host_integration_core_api_echo_nullable_object_response_dispose; } -static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncUint8ListResponse* -core_tests_pigeon_test_host_integration_core_api_echo_async_uint8_list_response_new( - const uint8_t* return_value, size_t return_value_length) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncUint8ListResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_UINT8_LIST_RESPONSE( +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableObjectResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_object_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableObjectResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_OBJECT_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_async_uint8_list_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_nullable_object_response_get_type(), nullptr)); self->value = fl_value_new_list(); - fl_value_append_take( - self->value, fl_value_new_uint8_list(return_value, return_value_length)); + fl_value_append_take(self->value, return_value != nullptr + ? fl_value_ref(return_value) + : fl_value_new_null()); return self; } -static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncUint8ListResponse* -core_tests_pigeon_test_host_integration_core_api_echo_async_uint8_list_response_new_error( +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableObjectResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_object_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncUint8ListResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_UINT8_LIST_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableObjectResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_OBJECT_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_async_uint8_list_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_nullable_object_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); @@ -5042,67 +5628,63 @@ core_tests_pigeon_test_host_integration_core_api_echo_async_uint8_list_response_ return self; } -G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncObjectResponse, - core_tests_pigeon_test_host_integration_core_api_echo_async_object_response, - CORE_TESTS_PIGEON_TEST, - HOST_INTEGRATION_CORE_API_ECHO_ASYNC_OBJECT_RESPONSE, GObject) - -struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncObjectResponse { +struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableListResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncObjectResponse, - core_tests_pigeon_test_host_integration_core_api_echo_async_object_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableListResponse, + core_tests_pigeon_test_host_integration_core_api_echo_nullable_list_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_echo_async_object_response_dispose( +core_tests_pigeon_test_host_integration_core_api_echo_nullable_list_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncObjectResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_OBJECT_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableListResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_LIST_RESPONSE( object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_echo_async_object_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_echo_nullable_list_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_echo_async_object_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncObjectResponse* self) {} +core_tests_pigeon_test_host_integration_core_api_echo_nullable_list_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableListResponse* self) {} static void -core_tests_pigeon_test_host_integration_core_api_echo_async_object_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncObjectResponseClass* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_list_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableListResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_echo_async_object_response_dispose; + core_tests_pigeon_test_host_integration_core_api_echo_nullable_list_response_dispose; } -static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncObjectResponse* -core_tests_pigeon_test_host_integration_core_api_echo_async_object_response_new( +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableListResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_list_response_new( FlValue* return_value) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncObjectResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_OBJECT_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableListResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_LIST_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_async_object_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_nullable_list_response_get_type(), nullptr)); self->value = fl_value_new_list(); - fl_value_append_take(self->value, fl_value_ref(return_value)); + fl_value_append_take(self->value, return_value != nullptr + ? fl_value_ref(return_value) + : fl_value_new_null()); return self; } -static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncObjectResponse* -core_tests_pigeon_test_host_integration_core_api_echo_async_object_response_new_error( +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableListResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_list_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncObjectResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_OBJECT_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableListResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_LIST_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_async_object_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_nullable_list_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); @@ -5113,67 +5695,64 @@ core_tests_pigeon_test_host_integration_core_api_echo_async_object_response_new_ return self; } -G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncListResponse, - core_tests_pigeon_test_host_integration_core_api_echo_async_list_response, - CORE_TESTS_PIGEON_TEST, HOST_INTEGRATION_CORE_API_ECHO_ASYNC_LIST_RESPONSE, - GObject) - -struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncListResponse { +struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableEnumListResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncListResponse, - core_tests_pigeon_test_host_integration_core_api_echo_async_list_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableEnumListResponse, + core_tests_pigeon_test_host_integration_core_api_echo_nullable_enum_list_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_echo_async_list_response_dispose( +core_tests_pigeon_test_host_integration_core_api_echo_nullable_enum_list_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncListResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_LIST_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableEnumListResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_ENUM_LIST_RESPONSE( object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_echo_async_list_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_echo_nullable_enum_list_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_echo_async_list_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncListResponse* self) {} +core_tests_pigeon_test_host_integration_core_api_echo_nullable_enum_list_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableEnumListResponse* + self) {} static void -core_tests_pigeon_test_host_integration_core_api_echo_async_list_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncListResponseClass* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_enum_list_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableEnumListResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_echo_async_list_response_dispose; + core_tests_pigeon_test_host_integration_core_api_echo_nullable_enum_list_response_dispose; } -static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncListResponse* -core_tests_pigeon_test_host_integration_core_api_echo_async_list_response_new( +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableEnumListResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_enum_list_response_new( FlValue* return_value) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncListResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_LIST_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableEnumListResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_ENUM_LIST_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_async_list_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_nullable_enum_list_response_get_type(), nullptr)); self->value = fl_value_new_list(); - fl_value_append_take(self->value, fl_value_ref(return_value)); + fl_value_append_take(self->value, return_value != nullptr + ? fl_value_ref(return_value) + : fl_value_new_null()); return self; } -static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncListResponse* -core_tests_pigeon_test_host_integration_core_api_echo_async_list_response_new_error( +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableEnumListResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_enum_list_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncListResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_LIST_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableEnumListResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_ENUM_LIST_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_async_list_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_nullable_enum_list_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); @@ -5184,66 +5763,64 @@ core_tests_pigeon_test_host_integration_core_api_echo_async_list_response_new_er return self; } -G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncMapResponse, - core_tests_pigeon_test_host_integration_core_api_echo_async_map_response, - CORE_TESTS_PIGEON_TEST, HOST_INTEGRATION_CORE_API_ECHO_ASYNC_MAP_RESPONSE, - GObject) - -struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncMapResponse { +struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableClassListResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncMapResponse, - core_tests_pigeon_test_host_integration_core_api_echo_async_map_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableClassListResponse, + core_tests_pigeon_test_host_integration_core_api_echo_nullable_class_list_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_echo_async_map_response_dispose( +core_tests_pigeon_test_host_integration_core_api_echo_nullable_class_list_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncMapResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_MAP_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableClassListResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_CLASS_LIST_RESPONSE( object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_echo_async_map_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_echo_nullable_class_list_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_echo_async_map_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncMapResponse* self) {} +core_tests_pigeon_test_host_integration_core_api_echo_nullable_class_list_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableClassListResponse* + self) {} static void -core_tests_pigeon_test_host_integration_core_api_echo_async_map_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncMapResponseClass* klass) { +core_tests_pigeon_test_host_integration_core_api_echo_nullable_class_list_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableClassListResponseClass* + klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_echo_async_map_response_dispose; + core_tests_pigeon_test_host_integration_core_api_echo_nullable_class_list_response_dispose; } -static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncMapResponse* -core_tests_pigeon_test_host_integration_core_api_echo_async_map_response_new( +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableClassListResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_class_list_response_new( FlValue* return_value) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncMapResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_MAP_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableClassListResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_CLASS_LIST_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_async_map_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_nullable_class_list_response_get_type(), nullptr)); self->value = fl_value_new_list(); - fl_value_append_take(self->value, fl_value_ref(return_value)); + fl_value_append_take(self->value, return_value != nullptr + ? fl_value_ref(return_value) + : fl_value_new_null()); return self; } -static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncMapResponse* -core_tests_pigeon_test_host_integration_core_api_echo_async_map_response_new_error( +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableClassListResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_class_list_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncMapResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_MAP_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableClassListResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_CLASS_LIST_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_async_map_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_nullable_class_list_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); @@ -5254,69 +5831,66 @@ core_tests_pigeon_test_host_integration_core_api_echo_async_map_response_new_err return self; } -G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncEnumResponse, - core_tests_pigeon_test_host_integration_core_api_echo_async_enum_response, - CORE_TESTS_PIGEON_TEST, HOST_INTEGRATION_CORE_API_ECHO_ASYNC_ENUM_RESPONSE, - GObject) - -struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncEnumResponse { +struct + _CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullEnumListResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncEnumResponse, - core_tests_pigeon_test_host_integration_core_api_echo_async_enum_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullEnumListResponse, + core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_enum_list_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_echo_async_enum_response_dispose( +core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_enum_list_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncEnumResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_ENUM_RESPONSE( - object); + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullEnumListResponse* + self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_NON_NULL_ENUM_LIST_RESPONSE( + object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_echo_async_enum_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_enum_list_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_echo_async_enum_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncEnumResponse* self) {} +core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_enum_list_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullEnumListResponse* + self) {} static void -core_tests_pigeon_test_host_integration_core_api_echo_async_enum_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncEnumResponseClass* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_enum_list_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullEnumListResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_echo_async_enum_response_dispose; + core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_enum_list_response_dispose; } -static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncEnumResponse* -core_tests_pigeon_test_host_integration_core_api_echo_async_enum_response_new( - CoreTestsPigeonTestAnEnum return_value) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncEnumResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_ENUM_RESPONSE( +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullEnumListResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_enum_list_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullEnumListResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_NON_NULL_ENUM_LIST_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_async_enum_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_enum_list_response_get_type(), nullptr)); self->value = fl_value_new_list(); - fl_value_append_take(self->value, - fl_value_new_custom(129, fl_value_new_int(return_value), - (GDestroyNotify)fl_value_unref)); + fl_value_append_take(self->value, return_value != nullptr + ? fl_value_ref(return_value) + : fl_value_new_null()); return self; } -static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncEnumResponse* -core_tests_pigeon_test_host_integration_core_api_echo_async_enum_response_new_error( +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullEnumListResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_enum_list_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncEnumResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_ENUM_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullEnumListResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_NON_NULL_ENUM_LIST_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_async_enum_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_enum_list_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); @@ -5327,70 +5901,66 @@ core_tests_pigeon_test_host_integration_core_api_echo_async_enum_response_new_er return self; } -G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherAsyncEnumResponse, - core_tests_pigeon_test_host_integration_core_api_echo_another_async_enum_response, - CORE_TESTS_PIGEON_TEST, - HOST_INTEGRATION_CORE_API_ECHO_ANOTHER_ASYNC_ENUM_RESPONSE, GObject) - -struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherAsyncEnumResponse { +struct + _CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullClassListResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherAsyncEnumResponse, - core_tests_pigeon_test_host_integration_core_api_echo_another_async_enum_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullClassListResponse, + core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_class_list_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_echo_another_async_enum_response_dispose( +core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_class_list_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherAsyncEnumResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ANOTHER_ASYNC_ENUM_RESPONSE( - object); + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullClassListResponse* + self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_NON_NULL_CLASS_LIST_RESPONSE( + object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_echo_another_async_enum_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_class_list_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_echo_another_async_enum_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherAsyncEnumResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_class_list_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullClassListResponse* self) {} static void -core_tests_pigeon_test_host_integration_core_api_echo_another_async_enum_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherAsyncEnumResponseClass* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_class_list_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullClassListResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_echo_another_async_enum_response_dispose; + core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_class_list_response_dispose; } -static CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherAsyncEnumResponse* -core_tests_pigeon_test_host_integration_core_api_echo_another_async_enum_response_new( - CoreTestsPigeonTestAnotherEnum return_value) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherAsyncEnumResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ANOTHER_ASYNC_ENUM_RESPONSE( +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullClassListResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_class_list_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullClassListResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_NON_NULL_CLASS_LIST_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_another_async_enum_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_class_list_response_get_type(), nullptr)); self->value = fl_value_new_list(); - fl_value_append_take(self->value, - fl_value_new_custom(130, fl_value_new_int(return_value), - (GDestroyNotify)fl_value_unref)); + fl_value_append_take(self->value, return_value != nullptr + ? fl_value_ref(return_value) + : fl_value_new_null()); return self; } -static CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherAsyncEnumResponse* -core_tests_pigeon_test_host_integration_core_api_echo_another_async_enum_response_new_error( +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullClassListResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_class_list_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherAsyncEnumResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ANOTHER_ASYNC_ENUM_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullClassListResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_NON_NULL_CLASS_LIST_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_another_async_enum_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_class_list_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); @@ -5401,54 +5971,48 @@ core_tests_pigeon_test_host_integration_core_api_echo_another_async_enum_respons return self; } -G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiThrowAsyncErrorResponse, - core_tests_pigeon_test_host_integration_core_api_throw_async_error_response, - CORE_TESTS_PIGEON_TEST, - HOST_INTEGRATION_CORE_API_THROW_ASYNC_ERROR_RESPONSE, GObject) - -struct _CoreTestsPigeonTestHostIntegrationCoreApiThrowAsyncErrorResponse { +struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableMapResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiThrowAsyncErrorResponse, - core_tests_pigeon_test_host_integration_core_api_throw_async_error_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableMapResponse, + core_tests_pigeon_test_host_integration_core_api_echo_nullable_map_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_throw_async_error_response_dispose( +core_tests_pigeon_test_host_integration_core_api_echo_nullable_map_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiThrowAsyncErrorResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_THROW_ASYNC_ERROR_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_MAP_RESPONSE( object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_throw_async_error_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_echo_nullable_map_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_throw_async_error_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiThrowAsyncErrorResponse* self) {} +core_tests_pigeon_test_host_integration_core_api_echo_nullable_map_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableMapResponse* self) {} static void -core_tests_pigeon_test_host_integration_core_api_throw_async_error_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiThrowAsyncErrorResponseClass* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_map_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableMapResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_throw_async_error_response_dispose; + core_tests_pigeon_test_host_integration_core_api_echo_nullable_map_response_dispose; } -static CoreTestsPigeonTestHostIntegrationCoreApiThrowAsyncErrorResponse* -core_tests_pigeon_test_host_integration_core_api_throw_async_error_response_new( +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_map_response_new( FlValue* return_value) { - CoreTestsPigeonTestHostIntegrationCoreApiThrowAsyncErrorResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_THROW_ASYNC_ERROR_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_MAP_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_throw_async_error_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_nullable_map_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, return_value != nullptr @@ -5457,13 +6021,13 @@ core_tests_pigeon_test_host_integration_core_api_throw_async_error_response_new( return self; } -static CoreTestsPigeonTestHostIntegrationCoreApiThrowAsyncErrorResponse* -core_tests_pigeon_test_host_integration_core_api_throw_async_error_response_new_error( +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_map_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiThrowAsyncErrorResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_THROW_ASYNC_ERROR_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_MAP_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_throw_async_error_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_nullable_map_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); @@ -5474,68 +6038,64 @@ core_tests_pigeon_test_host_integration_core_api_throw_async_error_response_new_ return self; } -G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiThrowAsyncErrorFromVoidResponse, - core_tests_pigeon_test_host_integration_core_api_throw_async_error_from_void_response, - CORE_TESTS_PIGEON_TEST, - HOST_INTEGRATION_CORE_API_THROW_ASYNC_ERROR_FROM_VOID_RESPONSE, GObject) - -struct - _CoreTestsPigeonTestHostIntegrationCoreApiThrowAsyncErrorFromVoidResponse { +struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableStringMapResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiThrowAsyncErrorFromVoidResponse, - core_tests_pigeon_test_host_integration_core_api_throw_async_error_from_void_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableStringMapResponse, + core_tests_pigeon_test_host_integration_core_api_echo_nullable_string_map_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_throw_async_error_from_void_response_dispose( +core_tests_pigeon_test_host_integration_core_api_echo_nullable_string_map_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiThrowAsyncErrorFromVoidResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_THROW_ASYNC_ERROR_FROM_VOID_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableStringMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_STRING_MAP_RESPONSE( object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_throw_async_error_from_void_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_echo_nullable_string_map_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_throw_async_error_from_void_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiThrowAsyncErrorFromVoidResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_string_map_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableStringMapResponse* self) {} static void -core_tests_pigeon_test_host_integration_core_api_throw_async_error_from_void_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiThrowAsyncErrorFromVoidResponseClass* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_string_map_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableStringMapResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_throw_async_error_from_void_response_dispose; + core_tests_pigeon_test_host_integration_core_api_echo_nullable_string_map_response_dispose; } -static CoreTestsPigeonTestHostIntegrationCoreApiThrowAsyncErrorFromVoidResponse* -core_tests_pigeon_test_host_integration_core_api_throw_async_error_from_void_response_new() { - CoreTestsPigeonTestHostIntegrationCoreApiThrowAsyncErrorFromVoidResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_THROW_ASYNC_ERROR_FROM_VOID_RESPONSE( +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableStringMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_string_map_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableStringMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_STRING_MAP_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_throw_async_error_from_void_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_nullable_string_map_response_get_type(), nullptr)); self->value = fl_value_new_list(); - fl_value_append_take(self->value, fl_value_new_null()); + fl_value_append_take(self->value, return_value != nullptr + ? fl_value_ref(return_value) + : fl_value_new_null()); return self; } -static CoreTestsPigeonTestHostIntegrationCoreApiThrowAsyncErrorFromVoidResponse* -core_tests_pigeon_test_host_integration_core_api_throw_async_error_from_void_response_new_error( +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableStringMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_string_map_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiThrowAsyncErrorFromVoidResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_THROW_ASYNC_ERROR_FROM_VOID_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableStringMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_STRING_MAP_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_throw_async_error_from_void_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_nullable_string_map_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); @@ -5546,56 +6106,49 @@ core_tests_pigeon_test_host_integration_core_api_throw_async_error_from_void_res return self; } -G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiThrowAsyncFlutterErrorResponse, - core_tests_pigeon_test_host_integration_core_api_throw_async_flutter_error_response, - CORE_TESTS_PIGEON_TEST, - HOST_INTEGRATION_CORE_API_THROW_ASYNC_FLUTTER_ERROR_RESPONSE, GObject) - -struct - _CoreTestsPigeonTestHostIntegrationCoreApiThrowAsyncFlutterErrorResponse { +struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableIntMapResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiThrowAsyncFlutterErrorResponse, - core_tests_pigeon_test_host_integration_core_api_throw_async_flutter_error_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableIntMapResponse, + core_tests_pigeon_test_host_integration_core_api_echo_nullable_int_map_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_throw_async_flutter_error_response_dispose( +core_tests_pigeon_test_host_integration_core_api_echo_nullable_int_map_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiThrowAsyncFlutterErrorResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_THROW_ASYNC_FLUTTER_ERROR_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableIntMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_INT_MAP_RESPONSE( object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_throw_async_flutter_error_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_echo_nullable_int_map_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_throw_async_flutter_error_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiThrowAsyncFlutterErrorResponse* - self) {} +core_tests_pigeon_test_host_integration_core_api_echo_nullable_int_map_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableIntMapResponse* self) { +} static void -core_tests_pigeon_test_host_integration_core_api_throw_async_flutter_error_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiThrowAsyncFlutterErrorResponseClass* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_int_map_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableIntMapResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_throw_async_flutter_error_response_dispose; + core_tests_pigeon_test_host_integration_core_api_echo_nullable_int_map_response_dispose; } -static CoreTestsPigeonTestHostIntegrationCoreApiThrowAsyncFlutterErrorResponse* -core_tests_pigeon_test_host_integration_core_api_throw_async_flutter_error_response_new( +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableIntMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_int_map_response_new( FlValue* return_value) { - CoreTestsPigeonTestHostIntegrationCoreApiThrowAsyncFlutterErrorResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_THROW_ASYNC_FLUTTER_ERROR_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableIntMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_INT_MAP_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_throw_async_flutter_error_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_nullable_int_map_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, return_value != nullptr @@ -5604,13 +6157,13 @@ core_tests_pigeon_test_host_integration_core_api_throw_async_flutter_error_respo return self; } -static CoreTestsPigeonTestHostIntegrationCoreApiThrowAsyncFlutterErrorResponse* -core_tests_pigeon_test_host_integration_core_api_throw_async_flutter_error_response_new_error( +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableIntMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_int_map_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiThrowAsyncFlutterErrorResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_THROW_ASYNC_FLUTTER_ERROR_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableIntMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_INT_MAP_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_throw_async_flutter_error_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_nullable_int_map_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); @@ -5621,68 +6174,64 @@ core_tests_pigeon_test_host_integration_core_api_throw_async_flutter_error_respo return self; } -G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncAllTypesResponse, - core_tests_pigeon_test_host_integration_core_api_echo_async_all_types_response, - CORE_TESTS_PIGEON_TEST, - HOST_INTEGRATION_CORE_API_ECHO_ASYNC_ALL_TYPES_RESPONSE, GObject) - -struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncAllTypesResponse { +struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableEnumMapResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncAllTypesResponse, - core_tests_pigeon_test_host_integration_core_api_echo_async_all_types_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableEnumMapResponse, + core_tests_pigeon_test_host_integration_core_api_echo_nullable_enum_map_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_echo_async_all_types_response_dispose( +core_tests_pigeon_test_host_integration_core_api_echo_nullable_enum_map_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncAllTypesResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_ALL_TYPES_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableEnumMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_ENUM_MAP_RESPONSE( object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_echo_async_all_types_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_echo_nullable_enum_map_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_echo_async_all_types_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncAllTypesResponse* self) {} +core_tests_pigeon_test_host_integration_core_api_echo_nullable_enum_map_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableEnumMapResponse* + self) {} static void -core_tests_pigeon_test_host_integration_core_api_echo_async_all_types_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncAllTypesResponseClass* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_enum_map_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableEnumMapResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_echo_async_all_types_response_dispose; + core_tests_pigeon_test_host_integration_core_api_echo_nullable_enum_map_response_dispose; } -static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncAllTypesResponse* -core_tests_pigeon_test_host_integration_core_api_echo_async_all_types_response_new( - CoreTestsPigeonTestAllTypes* return_value) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncAllTypesResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_ALL_TYPES_RESPONSE( +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableEnumMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_enum_map_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableEnumMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_ENUM_MAP_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_async_all_types_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_nullable_enum_map_response_get_type(), nullptr)); self->value = fl_value_new_list(); - fl_value_append_take(self->value, - fl_value_new_custom_object(131, G_OBJECT(return_value))); + fl_value_append_take(self->value, return_value != nullptr + ? fl_value_ref(return_value) + : fl_value_new_null()); return self; } -static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncAllTypesResponse* -core_tests_pigeon_test_host_integration_core_api_echo_async_all_types_response_new_error( +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableEnumMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_enum_map_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncAllTypesResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_ALL_TYPES_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableEnumMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_ENUM_MAP_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_async_all_types_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_nullable_enum_map_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); @@ -5693,74 +6242,64 @@ core_tests_pigeon_test_host_integration_core_api_echo_async_all_types_response_n return self; } -G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableAllNullableTypesResponse, - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_all_nullable_types_response, - CORE_TESTS_PIGEON_TEST, - HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_ALL_NULLABLE_TYPES_RESPONSE, - GObject) - -struct - _CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableAllNullableTypesResponse { +struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableClassMapResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableAllNullableTypesResponse, - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_all_nullable_types_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableClassMapResponse, + core_tests_pigeon_test_host_integration_core_api_echo_nullable_class_map_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_all_nullable_types_response_dispose( +core_tests_pigeon_test_host_integration_core_api_echo_nullable_class_map_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableAllNullableTypesResponse* - self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_ALL_NULLABLE_TYPES_RESPONSE( - object); + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableClassMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_CLASS_MAP_RESPONSE( + object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_all_nullable_types_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_echo_nullable_class_map_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_all_nullable_types_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableAllNullableTypesResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_class_map_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableClassMapResponse* self) {} static void -core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_all_nullable_types_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableAllNullableTypesResponseClass* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_class_map_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableClassMapResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_all_nullable_types_response_dispose; + core_tests_pigeon_test_host_integration_core_api_echo_nullable_class_map_response_dispose; } -static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableAllNullableTypesResponse* -core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_all_nullable_types_response_new( - CoreTestsPigeonTestAllNullableTypes* return_value) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableAllNullableTypesResponse* - self = CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_ALL_NULLABLE_TYPES_RESPONSE( +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableClassMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_class_map_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableClassMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_CLASS_MAP_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_all_nullable_types_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_nullable_class_map_response_get_type(), nullptr)); self->value = fl_value_new_list(); - fl_value_append_take( - self->value, return_value != nullptr - ? fl_value_new_custom_object(132, G_OBJECT(return_value)) - : fl_value_new_null()); + fl_value_append_take(self->value, return_value != nullptr + ? fl_value_ref(return_value) + : fl_value_new_null()); return self; } -static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableAllNullableTypesResponse* -core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_all_nullable_types_response_new_error( +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableClassMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_class_map_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableAllNullableTypesResponse* - self = CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_ALL_NULLABLE_TYPES_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableClassMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_CLASS_MAP_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_all_nullable_types_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_nullable_class_map_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); @@ -5771,74 +6310,66 @@ core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_all_nullabl return self; } -G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableAllNullableTypesWithoutRecursionResponse, - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_all_nullable_types_without_recursion_response, - CORE_TESTS_PIGEON_TEST, - HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_ALL_NULLABLE_TYPES_WITHOUT_RECURSION_RESPONSE, - GObject) - struct - _CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableAllNullableTypesWithoutRecursionResponse { + _CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullStringMapResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableAllNullableTypesWithoutRecursionResponse, - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_all_nullable_types_without_recursion_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullStringMapResponse, + core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_string_map_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_all_nullable_types_without_recursion_response_dispose( +core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_string_map_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableAllNullableTypesWithoutRecursionResponse* + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullStringMapResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_ALL_NULLABLE_TYPES_WITHOUT_RECURSION_RESPONSE( + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_NON_NULL_STRING_MAP_RESPONSE( object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_all_nullable_types_without_recursion_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_string_map_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_all_nullable_types_without_recursion_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableAllNullableTypesWithoutRecursionResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_string_map_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullStringMapResponse* self) {} static void -core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_all_nullable_types_without_recursion_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableAllNullableTypesWithoutRecursionResponseClass* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_string_map_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullStringMapResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_all_nullable_types_without_recursion_response_dispose; + core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_string_map_response_dispose; } -static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableAllNullableTypesWithoutRecursionResponse* -core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_all_nullable_types_without_recursion_response_new( - CoreTestsPigeonTestAllNullableTypesWithoutRecursion* return_value) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableAllNullableTypesWithoutRecursionResponse* - self = CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_ALL_NULLABLE_TYPES_WITHOUT_RECURSION_RESPONSE( +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullStringMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_string_map_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullStringMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_NON_NULL_STRING_MAP_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_all_nullable_types_without_recursion_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_string_map_response_get_type(), nullptr)); self->value = fl_value_new_list(); - fl_value_append_take( - self->value, return_value != nullptr - ? fl_value_new_custom_object(133, G_OBJECT(return_value)) - : fl_value_new_null()); + fl_value_append_take(self->value, return_value != nullptr + ? fl_value_ref(return_value) + : fl_value_new_null()); return self; } -static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableAllNullableTypesWithoutRecursionResponse* -core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_all_nullable_types_without_recursion_response_new_error( +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullStringMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_string_map_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableAllNullableTypesWithoutRecursionResponse* - self = CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_ALL_NULLABLE_TYPES_WITHOUT_RECURSION_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullStringMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_NON_NULL_STRING_MAP_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_all_nullable_types_without_recursion_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_string_map_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); @@ -5849,70 +6380,65 @@ core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_all_nullabl return self; } -G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableIntResponse, - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_int_response, - CORE_TESTS_PIGEON_TEST, - HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_INT_RESPONSE, GObject) - -struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableIntResponse { +struct + _CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullIntMapResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableIntResponse, - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_int_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullIntMapResponse, + core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_int_map_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_int_response_dispose( +core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_int_map_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableIntResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_INT_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullIntMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_NON_NULL_INT_MAP_RESPONSE( object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_int_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_int_map_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_int_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableIntResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_int_map_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullIntMapResponse* self) {} static void -core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_int_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableIntResponseClass* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_int_map_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullIntMapResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_int_response_dispose; + core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_int_map_response_dispose; } -static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableIntResponse* -core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_int_response_new( - int64_t* return_value) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableIntResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_INT_RESPONSE( +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullIntMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_int_map_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullIntMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_NON_NULL_INT_MAP_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_int_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_int_map_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, return_value != nullptr - ? fl_value_new_int(*return_value) + ? fl_value_ref(return_value) : fl_value_new_null()); return self; } -static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableIntResponse* -core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_int_response_new_error( +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullIntMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_int_map_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableIntResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_INT_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullIntMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_NON_NULL_INT_MAP_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_int_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_int_map_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); @@ -5923,71 +6449,65 @@ core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_int_respons return self; } -G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableDoubleResponse, - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_double_response, - CORE_TESTS_PIGEON_TEST, - HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_DOUBLE_RESPONSE, GObject) - struct - _CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableDoubleResponse { + _CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullEnumMapResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableDoubleResponse, - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_double_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullEnumMapResponse, + core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_enum_map_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_double_response_dispose( +core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_enum_map_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableDoubleResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_DOUBLE_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullEnumMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_NON_NULL_ENUM_MAP_RESPONSE( object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_double_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_enum_map_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_double_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableDoubleResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_enum_map_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullEnumMapResponse* self) {} static void -core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_double_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableDoubleResponseClass* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_enum_map_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullEnumMapResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_double_response_dispose; + core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_enum_map_response_dispose; } -static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableDoubleResponse* -core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_double_response_new( - double* return_value) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableDoubleResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_DOUBLE_RESPONSE( +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullEnumMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_enum_map_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullEnumMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_NON_NULL_ENUM_MAP_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_double_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_enum_map_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, return_value != nullptr - ? fl_value_new_float(*return_value) + ? fl_value_ref(return_value) : fl_value_new_null()); return self; } -static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableDoubleResponse* -core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_double_response_new_error( +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullEnumMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_enum_map_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableDoubleResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_DOUBLE_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullEnumMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_NON_NULL_ENUM_MAP_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_double_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_enum_map_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); @@ -5998,70 +6518,66 @@ core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_double_resp return self; } -G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableBoolResponse, - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_bool_response, - CORE_TESTS_PIGEON_TEST, - HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_BOOL_RESPONSE, GObject) - -struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableBoolResponse { +struct + _CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullClassMapResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableBoolResponse, - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_bool_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullClassMapResponse, + core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_class_map_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_bool_response_dispose( +core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_class_map_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableBoolResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_BOOL_RESPONSE( - object); + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullClassMapResponse* + self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_NON_NULL_CLASS_MAP_RESPONSE( + object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_bool_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_class_map_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_bool_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableBoolResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_class_map_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullClassMapResponse* self) {} static void -core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_bool_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableBoolResponseClass* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_class_map_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullClassMapResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_bool_response_dispose; + core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_class_map_response_dispose; } -static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableBoolResponse* -core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_bool_response_new( - gboolean* return_value) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableBoolResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_BOOL_RESPONSE( +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullClassMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_class_map_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullClassMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_NON_NULL_CLASS_MAP_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_bool_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_class_map_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, return_value != nullptr - ? fl_value_new_bool(*return_value) + ? fl_value_ref(return_value) : fl_value_new_null()); return self; } -static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableBoolResponse* -core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_bool_response_new_error( +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullClassMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_class_map_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableBoolResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_BOOL_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullClassMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_NON_NULL_CLASS_MAP_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_bool_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_class_map_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); @@ -6072,71 +6588,66 @@ core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_bool_respon return self; } -G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableStringResponse, - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_string_response, - CORE_TESTS_PIGEON_TEST, - HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_STRING_RESPONSE, GObject) - -struct - _CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableStringResponse { +struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableEnumResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableStringResponse, - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_string_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableEnumResponse, + core_tests_pigeon_test_host_integration_core_api_echo_nullable_enum_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_string_response_dispose( +core_tests_pigeon_test_host_integration_core_api_echo_nullable_enum_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableStringResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_STRING_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableEnumResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_ENUM_RESPONSE( object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_string_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_echo_nullable_enum_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_string_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableStringResponse* - self) {} +core_tests_pigeon_test_host_integration_core_api_echo_nullable_enum_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableEnumResponse* self) {} static void -core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_string_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableStringResponseClass* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_enum_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableEnumResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_string_response_dispose; + core_tests_pigeon_test_host_integration_core_api_echo_nullable_enum_response_dispose; } -static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableStringResponse* -core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_string_response_new( - const gchar* return_value) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableStringResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_STRING_RESPONSE( +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableEnumResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_enum_response_new( + CoreTestsPigeonTestAnEnum* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableEnumResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_ENUM_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_string_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_nullable_enum_response_get_type(), nullptr)); self->value = fl_value_new_list(); - fl_value_append_take(self->value, return_value != nullptr - ? fl_value_new_string(return_value) - : fl_value_new_null()); + fl_value_append_take( + self->value, + return_value != nullptr + ? fl_value_new_custom(129, fl_value_new_int(*return_value), + (GDestroyNotify)fl_value_unref) + : fl_value_new_null()); return self; } -static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableStringResponse* -core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_string_response_new_error( +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableEnumResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_enum_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableStringResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_STRING_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableEnumResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_ENUM_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_string_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_nullable_enum_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); @@ -6147,72 +6658,68 @@ core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_string_resp return self; } -G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableUint8ListResponse, - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_uint8_list_response, - CORE_TESTS_PIGEON_TEST, - HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_UINT8_LIST_RESPONSE, GObject) - struct - _CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableUint8ListResponse { + _CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherNullableEnumResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableUint8ListResponse, - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_uint8_list_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherNullableEnumResponse, + core_tests_pigeon_test_host_integration_core_api_echo_another_nullable_enum_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_uint8_list_response_dispose( +core_tests_pigeon_test_host_integration_core_api_echo_another_nullable_enum_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableUint8ListResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_UINT8_LIST_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherNullableEnumResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ANOTHER_NULLABLE_ENUM_RESPONSE( object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_uint8_list_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_echo_another_nullable_enum_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_uint8_list_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableUint8ListResponse* +core_tests_pigeon_test_host_integration_core_api_echo_another_nullable_enum_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherNullableEnumResponse* self) {} static void -core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_uint8_list_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableUint8ListResponseClass* +core_tests_pigeon_test_host_integration_core_api_echo_another_nullable_enum_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherNullableEnumResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_uint8_list_response_dispose; + core_tests_pigeon_test_host_integration_core_api_echo_another_nullable_enum_response_dispose; } -static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableUint8ListResponse* -core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_uint8_list_response_new( - const uint8_t* return_value, size_t return_value_length) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableUint8ListResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_UINT8_LIST_RESPONSE( +CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherNullableEnumResponse* +core_tests_pigeon_test_host_integration_core_api_echo_another_nullable_enum_response_new( + CoreTestsPigeonTestAnotherEnum* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherNullableEnumResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ANOTHER_NULLABLE_ENUM_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_uint8_list_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_another_nullable_enum_response_get_type(), nullptr)); self->value = fl_value_new_list(); - fl_value_append_take(self->value, return_value != nullptr - ? fl_value_new_uint8_list( - return_value, return_value_length) - : fl_value_new_null()); + fl_value_append_take( + self->value, + return_value != nullptr + ? fl_value_new_custom(130, fl_value_new_int(*return_value), + (GDestroyNotify)fl_value_unref) + : fl_value_new_null()); return self; } -static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableUint8ListResponse* -core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_uint8_list_response_new_error( +CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherNullableEnumResponse* +core_tests_pigeon_test_host_integration_core_api_echo_another_nullable_enum_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableUint8ListResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_UINT8_LIST_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherNullableEnumResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ANOTHER_NULLABLE_ENUM_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_uint8_list_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_another_nullable_enum_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); @@ -6223,71 +6730,65 @@ core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_uint8_list_ return self; } -G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableObjectResponse, - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_object_response, - CORE_TESTS_PIGEON_TEST, - HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_OBJECT_RESPONSE, GObject) - struct - _CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableObjectResponse { + _CoreTestsPigeonTestHostIntegrationCoreApiEchoOptionalNullableIntResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableObjectResponse, - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_object_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoOptionalNullableIntResponse, + core_tests_pigeon_test_host_integration_core_api_echo_optional_nullable_int_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_object_response_dispose( +core_tests_pigeon_test_host_integration_core_api_echo_optional_nullable_int_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableObjectResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_OBJECT_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoOptionalNullableIntResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_OPTIONAL_NULLABLE_INT_RESPONSE( object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_object_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_echo_optional_nullable_int_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_object_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableObjectResponse* +core_tests_pigeon_test_host_integration_core_api_echo_optional_nullable_int_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoOptionalNullableIntResponse* self) {} static void -core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_object_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableObjectResponseClass* +core_tests_pigeon_test_host_integration_core_api_echo_optional_nullable_int_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoOptionalNullableIntResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_object_response_dispose; + core_tests_pigeon_test_host_integration_core_api_echo_optional_nullable_int_response_dispose; } -static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableObjectResponse* -core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_object_response_new( - FlValue* return_value) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableObjectResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_OBJECT_RESPONSE( +CoreTestsPigeonTestHostIntegrationCoreApiEchoOptionalNullableIntResponse* +core_tests_pigeon_test_host_integration_core_api_echo_optional_nullable_int_response_new( + int64_t* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoOptionalNullableIntResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_OPTIONAL_NULLABLE_INT_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_object_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_optional_nullable_int_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, return_value != nullptr - ? fl_value_ref(return_value) + ? fl_value_new_int(*return_value) : fl_value_new_null()); return self; } -static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableObjectResponse* -core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_object_response_new_error( +CoreTestsPigeonTestHostIntegrationCoreApiEchoOptionalNullableIntResponse* +core_tests_pigeon_test_host_integration_core_api_echo_optional_nullable_int_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableObjectResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_OBJECT_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoOptionalNullableIntResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_OPTIONAL_NULLABLE_INT_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_object_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_optional_nullable_int_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); @@ -6298,70 +6799,65 @@ core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_object_resp return self; } -G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableListResponse, - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_list_response, - CORE_TESTS_PIGEON_TEST, - HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_LIST_RESPONSE, GObject) - -struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableListResponse { +struct + _CoreTestsPigeonTestHostIntegrationCoreApiEchoNamedNullableStringResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableListResponse, - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_list_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoNamedNullableStringResponse, + core_tests_pigeon_test_host_integration_core_api_echo_named_nullable_string_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_list_response_dispose( +core_tests_pigeon_test_host_integration_core_api_echo_named_nullable_string_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableListResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_LIST_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNamedNullableStringResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NAMED_NULLABLE_STRING_RESPONSE( object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_list_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_echo_named_nullable_string_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_list_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableListResponse* +core_tests_pigeon_test_host_integration_core_api_echo_named_nullable_string_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNamedNullableStringResponse* self) {} static void -core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_list_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableListResponseClass* +core_tests_pigeon_test_host_integration_core_api_echo_named_nullable_string_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNamedNullableStringResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_list_response_dispose; + core_tests_pigeon_test_host_integration_core_api_echo_named_nullable_string_response_dispose; } -static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableListResponse* -core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_list_response_new( - FlValue* return_value) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableListResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_LIST_RESPONSE( +CoreTestsPigeonTestHostIntegrationCoreApiEchoNamedNullableStringResponse* +core_tests_pigeon_test_host_integration_core_api_echo_named_nullable_string_response_new( + const gchar* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoNamedNullableStringResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NAMED_NULLABLE_STRING_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_list_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_named_nullable_string_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, return_value != nullptr - ? fl_value_ref(return_value) + ? fl_value_new_string(return_value) : fl_value_new_null()); return self; } -static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableListResponse* -core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_list_response_new_error( +CoreTestsPigeonTestHostIntegrationCoreApiEchoNamedNullableStringResponse* +core_tests_pigeon_test_host_integration_core_api_echo_named_nullable_string_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableListResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_LIST_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNamedNullableStringResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NAMED_NULLABLE_STRING_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_list_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_named_nullable_string_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); @@ -6373,70 +6869,63 @@ core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_list_respon } G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableMapResponse, - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_map_response, - CORE_TESTS_PIGEON_TEST, - HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_MAP_RESPONSE, GObject) + CoreTestsPigeonTestHostIntegrationCoreApiNoopAsyncResponse, + core_tests_pigeon_test_host_integration_core_api_noop_async_response, + CORE_TESTS_PIGEON_TEST, HOST_INTEGRATION_CORE_API_NOOP_ASYNC_RESPONSE, + GObject) -struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableMapResponse { +struct _CoreTestsPigeonTestHostIntegrationCoreApiNoopAsyncResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableMapResponse, - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_map_response, + CoreTestsPigeonTestHostIntegrationCoreApiNoopAsyncResponse, + core_tests_pigeon_test_host_integration_core_api_noop_async_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_map_response_dispose( +core_tests_pigeon_test_host_integration_core_api_noop_async_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableMapResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_MAP_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiNoopAsyncResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_NOOP_ASYNC_RESPONSE( object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_map_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_noop_async_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_map_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableMapResponse* - self) {} +core_tests_pigeon_test_host_integration_core_api_noop_async_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiNoopAsyncResponse* self) {} static void -core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_map_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableMapResponseClass* - klass) { +core_tests_pigeon_test_host_integration_core_api_noop_async_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiNoopAsyncResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_map_response_dispose; + core_tests_pigeon_test_host_integration_core_api_noop_async_response_dispose; } -static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableMapResponse* -core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_map_response_new( - FlValue* return_value) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableMapResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_MAP_RESPONSE( - g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_map_response_get_type(), - nullptr)); +static CoreTestsPigeonTestHostIntegrationCoreApiNoopAsyncResponse* +core_tests_pigeon_test_host_integration_core_api_noop_async_response_new() { + CoreTestsPigeonTestHostIntegrationCoreApiNoopAsyncResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_NOOP_ASYNC_RESPONSE(g_object_new( + core_tests_pigeon_test_host_integration_core_api_noop_async_response_get_type(), + nullptr)); self->value = fl_value_new_list(); - fl_value_append_take(self->value, return_value != nullptr - ? fl_value_ref(return_value) - : fl_value_new_null()); + fl_value_append_take(self->value, fl_value_new_null()); return self; } -static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableMapResponse* -core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_map_response_new_error( +static CoreTestsPigeonTestHostIntegrationCoreApiNoopAsyncResponse* +core_tests_pigeon_test_host_integration_core_api_noop_async_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableMapResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_MAP_RESPONSE( - g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_map_response_get_type(), - nullptr)); + CoreTestsPigeonTestHostIntegrationCoreApiNoopAsyncResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_NOOP_ASYNC_RESPONSE(g_object_new( + core_tests_pigeon_test_host_integration_core_api_noop_async_response_get_type(), + nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); fl_value_append_take(self->value, @@ -6447,72 +6936,65 @@ core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_map_respons } G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableEnumResponse, - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_enum_response, - CORE_TESTS_PIGEON_TEST, - HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_ENUM_RESPONSE, GObject) + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncIntResponse, + core_tests_pigeon_test_host_integration_core_api_echo_async_int_response, + CORE_TESTS_PIGEON_TEST, HOST_INTEGRATION_CORE_API_ECHO_ASYNC_INT_RESPONSE, + GObject) -struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableEnumResponse { +struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncIntResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableEnumResponse, - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_enum_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncIntResponse, + core_tests_pigeon_test_host_integration_core_api_echo_async_int_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_enum_response_dispose( +core_tests_pigeon_test_host_integration_core_api_echo_async_int_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableEnumResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_ENUM_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncIntResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_INT_RESPONSE( object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_enum_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_echo_async_int_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_enum_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableEnumResponse* - self) {} +core_tests_pigeon_test_host_integration_core_api_echo_async_int_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncIntResponse* self) {} static void -core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_enum_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableEnumResponseClass* - klass) { +core_tests_pigeon_test_host_integration_core_api_echo_async_int_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncIntResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_enum_response_dispose; + core_tests_pigeon_test_host_integration_core_api_echo_async_int_response_dispose; } -static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableEnumResponse* -core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_enum_response_new( - CoreTestsPigeonTestAnEnum* return_value) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableEnumResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_ENUM_RESPONSE( +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncIntResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_int_response_new( + int64_t return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncIntResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_INT_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_enum_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_async_int_response_get_type(), nullptr)); self->value = fl_value_new_list(); - fl_value_append_take( - self->value, - return_value != nullptr - ? fl_value_new_custom(129, fl_value_new_int(*return_value), - (GDestroyNotify)fl_value_unref) - : fl_value_new_null()); + fl_value_append_take(self->value, fl_value_new_int(return_value)); return self; } -static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableEnumResponse* -core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_enum_response_new_error( +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncIntResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_int_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableEnumResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_ENUM_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncIntResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_INT_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_enum_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_async_int_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); @@ -6524,75 +7006,66 @@ core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_enum_respon } G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherAsyncNullableEnumResponse, - core_tests_pigeon_test_host_integration_core_api_echo_another_async_nullable_enum_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncDoubleResponse, + core_tests_pigeon_test_host_integration_core_api_echo_async_double_response, CORE_TESTS_PIGEON_TEST, - HOST_INTEGRATION_CORE_API_ECHO_ANOTHER_ASYNC_NULLABLE_ENUM_RESPONSE, - GObject) + HOST_INTEGRATION_CORE_API_ECHO_ASYNC_DOUBLE_RESPONSE, GObject) -struct - _CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherAsyncNullableEnumResponse { +struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncDoubleResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherAsyncNullableEnumResponse, - core_tests_pigeon_test_host_integration_core_api_echo_another_async_nullable_enum_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncDoubleResponse, + core_tests_pigeon_test_host_integration_core_api_echo_async_double_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_echo_another_async_nullable_enum_response_dispose( +core_tests_pigeon_test_host_integration_core_api_echo_async_double_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherAsyncNullableEnumResponse* - self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ANOTHER_ASYNC_NULLABLE_ENUM_RESPONSE( - object); + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncDoubleResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_DOUBLE_RESPONSE( + object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_echo_another_async_nullable_enum_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_echo_async_double_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_echo_another_async_nullable_enum_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherAsyncNullableEnumResponse* - self) {} +core_tests_pigeon_test_host_integration_core_api_echo_async_double_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncDoubleResponse* self) {} static void -core_tests_pigeon_test_host_integration_core_api_echo_another_async_nullable_enum_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherAsyncNullableEnumResponseClass* +core_tests_pigeon_test_host_integration_core_api_echo_async_double_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncDoubleResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_echo_another_async_nullable_enum_response_dispose; + core_tests_pigeon_test_host_integration_core_api_echo_async_double_response_dispose; } -static CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherAsyncNullableEnumResponse* -core_tests_pigeon_test_host_integration_core_api_echo_another_async_nullable_enum_response_new( - CoreTestsPigeonTestAnotherEnum* return_value) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherAsyncNullableEnumResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ANOTHER_ASYNC_NULLABLE_ENUM_RESPONSE( +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncDoubleResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_double_response_new( + double return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncDoubleResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_DOUBLE_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_another_async_nullable_enum_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_async_double_response_get_type(), nullptr)); self->value = fl_value_new_list(); - fl_value_append_take( - self->value, - return_value != nullptr - ? fl_value_new_custom(130, fl_value_new_int(*return_value), - (GDestroyNotify)fl_value_unref) - : fl_value_new_null()); + fl_value_append_take(self->value, fl_value_new_float(return_value)); return self; } -static CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherAsyncNullableEnumResponse* -core_tests_pigeon_test_host_integration_core_api_echo_another_async_nullable_enum_response_new_error( +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncDoubleResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_double_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherAsyncNullableEnumResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ANOTHER_ASYNC_NULLABLE_ENUM_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncDoubleResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_DOUBLE_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_another_async_nullable_enum_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_async_double_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); @@ -6604,65 +7077,66 @@ core_tests_pigeon_test_host_integration_core_api_echo_another_async_nullable_enu } G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterNoopResponse, - core_tests_pigeon_test_host_integration_core_api_call_flutter_noop_response, - CORE_TESTS_PIGEON_TEST, - HOST_INTEGRATION_CORE_API_CALL_FLUTTER_NOOP_RESPONSE, GObject) + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncBoolResponse, + core_tests_pigeon_test_host_integration_core_api_echo_async_bool_response, + CORE_TESTS_PIGEON_TEST, HOST_INTEGRATION_CORE_API_ECHO_ASYNC_BOOL_RESPONSE, + GObject) -struct _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterNoopResponse { +struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncBoolResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterNoopResponse, - core_tests_pigeon_test_host_integration_core_api_call_flutter_noop_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncBoolResponse, + core_tests_pigeon_test_host_integration_core_api_echo_async_bool_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_noop_response_dispose( +core_tests_pigeon_test_host_integration_core_api_echo_async_bool_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterNoopResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_NOOP_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncBoolResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_BOOL_RESPONSE( object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_call_flutter_noop_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_echo_async_bool_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_noop_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterNoopResponse* self) {} +core_tests_pigeon_test_host_integration_core_api_echo_async_bool_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncBoolResponse* self) {} static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_noop_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterNoopResponseClass* +core_tests_pigeon_test_host_integration_core_api_echo_async_bool_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncBoolResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_call_flutter_noop_response_dispose; + core_tests_pigeon_test_host_integration_core_api_echo_async_bool_response_dispose; } -static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterNoopResponse* -core_tests_pigeon_test_host_integration_core_api_call_flutter_noop_response_new() { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterNoopResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_NOOP_RESPONSE( +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncBoolResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_bool_response_new( + gboolean return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncBoolResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_BOOL_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_call_flutter_noop_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_async_bool_response_get_type(), nullptr)); self->value = fl_value_new_list(); - fl_value_append_take(self->value, fl_value_new_null()); + fl_value_append_take(self->value, fl_value_new_bool(return_value)); return self; } -static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterNoopResponse* -core_tests_pigeon_test_host_integration_core_api_call_flutter_noop_response_new_error( +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncBoolResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_bool_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterNoopResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_NOOP_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncBoolResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_BOOL_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_call_flutter_noop_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_async_bool_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); @@ -6674,69 +7148,66 @@ core_tests_pigeon_test_host_integration_core_api_call_flutter_noop_response_new_ } G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterThrowErrorResponse, - core_tests_pigeon_test_host_integration_core_api_call_flutter_throw_error_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncStringResponse, + core_tests_pigeon_test_host_integration_core_api_echo_async_string_response, CORE_TESTS_PIGEON_TEST, - HOST_INTEGRATION_CORE_API_CALL_FLUTTER_THROW_ERROR_RESPONSE, GObject) + HOST_INTEGRATION_CORE_API_ECHO_ASYNC_STRING_RESPONSE, GObject) -struct _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterThrowErrorResponse { +struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncStringResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterThrowErrorResponse, - core_tests_pigeon_test_host_integration_core_api_call_flutter_throw_error_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncStringResponse, + core_tests_pigeon_test_host_integration_core_api_echo_async_string_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_throw_error_response_dispose( +core_tests_pigeon_test_host_integration_core_api_echo_async_string_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterThrowErrorResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_THROW_ERROR_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncStringResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_STRING_RESPONSE( object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_call_flutter_throw_error_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_echo_async_string_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_throw_error_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterThrowErrorResponse* - self) {} +core_tests_pigeon_test_host_integration_core_api_echo_async_string_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncStringResponse* self) {} static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_throw_error_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterThrowErrorResponseClass* +core_tests_pigeon_test_host_integration_core_api_echo_async_string_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncStringResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_call_flutter_throw_error_response_dispose; + core_tests_pigeon_test_host_integration_core_api_echo_async_string_response_dispose; } -static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterThrowErrorResponse* -core_tests_pigeon_test_host_integration_core_api_call_flutter_throw_error_response_new( - FlValue* return_value) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterThrowErrorResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_THROW_ERROR_RESPONSE( +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncStringResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_string_response_new( + const gchar* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncStringResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_STRING_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_call_flutter_throw_error_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_async_string_response_get_type(), nullptr)); self->value = fl_value_new_list(); - fl_value_append_take(self->value, return_value != nullptr - ? fl_value_ref(return_value) - : fl_value_new_null()); + fl_value_append_take(self->value, fl_value_new_string(return_value)); return self; } -static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterThrowErrorResponse* -core_tests_pigeon_test_host_integration_core_api_call_flutter_throw_error_response_new_error( +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncStringResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_string_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterThrowErrorResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_THROW_ERROR_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncStringResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_STRING_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_call_flutter_throw_error_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_async_string_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); @@ -6748,69 +7219,68 @@ core_tests_pigeon_test_host_integration_core_api_call_flutter_throw_error_respon } G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterThrowErrorFromVoidResponse, - core_tests_pigeon_test_host_integration_core_api_call_flutter_throw_error_from_void_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncUint8ListResponse, + core_tests_pigeon_test_host_integration_core_api_echo_async_uint8_list_response, CORE_TESTS_PIGEON_TEST, - HOST_INTEGRATION_CORE_API_CALL_FLUTTER_THROW_ERROR_FROM_VOID_RESPONSE, - GObject) + HOST_INTEGRATION_CORE_API_ECHO_ASYNC_UINT8_LIST_RESPONSE, GObject) -struct - _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterThrowErrorFromVoidResponse { +struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncUint8ListResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterThrowErrorFromVoidResponse, - core_tests_pigeon_test_host_integration_core_api_call_flutter_throw_error_from_void_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncUint8ListResponse, + core_tests_pigeon_test_host_integration_core_api_echo_async_uint8_list_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_throw_error_from_void_response_dispose( +core_tests_pigeon_test_host_integration_core_api_echo_async_uint8_list_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterThrowErrorFromVoidResponse* - self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_THROW_ERROR_FROM_VOID_RESPONSE( - object); + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncUint8ListResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_UINT8_LIST_RESPONSE( + object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_call_flutter_throw_error_from_void_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_echo_async_uint8_list_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_throw_error_from_void_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterThrowErrorFromVoidResponse* - self) {} +core_tests_pigeon_test_host_integration_core_api_echo_async_uint8_list_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncUint8ListResponse* self) { +} static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_throw_error_from_void_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterThrowErrorFromVoidResponseClass* +core_tests_pigeon_test_host_integration_core_api_echo_async_uint8_list_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncUint8ListResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_call_flutter_throw_error_from_void_response_dispose; + core_tests_pigeon_test_host_integration_core_api_echo_async_uint8_list_response_dispose; } -static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterThrowErrorFromVoidResponse* -core_tests_pigeon_test_host_integration_core_api_call_flutter_throw_error_from_void_response_new() { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterThrowErrorFromVoidResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_THROW_ERROR_FROM_VOID_RESPONSE( +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncUint8ListResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_uint8_list_response_new( + const uint8_t* return_value, size_t return_value_length) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncUint8ListResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_UINT8_LIST_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_call_flutter_throw_error_from_void_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_async_uint8_list_response_get_type(), nullptr)); self->value = fl_value_new_list(); - fl_value_append_take(self->value, fl_value_new_null()); + fl_value_append_take( + self->value, fl_value_new_uint8_list(return_value, return_value_length)); return self; } -static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterThrowErrorFromVoidResponse* -core_tests_pigeon_test_host_integration_core_api_call_flutter_throw_error_from_void_response_new_error( +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncUint8ListResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_uint8_list_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterThrowErrorFromVoidResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_THROW_ERROR_FROM_VOID_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncUint8ListResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_UINT8_LIST_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_call_flutter_throw_error_from_void_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_async_uint8_list_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); @@ -6822,69 +7292,66 @@ core_tests_pigeon_test_host_integration_core_api_call_flutter_throw_error_from_v } G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAllTypesResponse, - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_types_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncObjectResponse, + core_tests_pigeon_test_host_integration_core_api_echo_async_object_response, CORE_TESTS_PIGEON_TEST, - HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_ALL_TYPES_RESPONSE, GObject) + HOST_INTEGRATION_CORE_API_ECHO_ASYNC_OBJECT_RESPONSE, GObject) -struct - _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAllTypesResponse { +struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncObjectResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAllTypesResponse, - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_types_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncObjectResponse, + core_tests_pigeon_test_host_integration_core_api_echo_async_object_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_types_response_dispose( +core_tests_pigeon_test_host_integration_core_api_echo_async_object_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAllTypesResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_ALL_TYPES_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncObjectResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_OBJECT_RESPONSE( object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_types_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_echo_async_object_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_types_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAllTypesResponse* - self) {} +core_tests_pigeon_test_host_integration_core_api_echo_async_object_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncObjectResponse* self) {} static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_types_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAllTypesResponseClass* +core_tests_pigeon_test_host_integration_core_api_echo_async_object_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncObjectResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_types_response_dispose; + core_tests_pigeon_test_host_integration_core_api_echo_async_object_response_dispose; } -static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAllTypesResponse* -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_types_response_new( - CoreTestsPigeonTestAllTypes* return_value) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAllTypesResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_ALL_TYPES_RESPONSE( +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncObjectResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_object_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncObjectResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_OBJECT_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_types_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_async_object_response_get_type(), nullptr)); self->value = fl_value_new_list(); - fl_value_append_take(self->value, - fl_value_new_custom_object(131, G_OBJECT(return_value))); + fl_value_append_take(self->value, fl_value_ref(return_value)); return self; } -static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAllTypesResponse* -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_types_response_new_error( +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncObjectResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_object_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAllTypesResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_ALL_TYPES_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncObjectResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_OBJECT_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_types_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_async_object_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); @@ -6896,73 +7363,66 @@ core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_types_res } G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAllNullableTypesResponse, - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_nullable_types_response, - CORE_TESTS_PIGEON_TEST, - HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_ALL_NULLABLE_TYPES_RESPONSE, + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncListResponse, + core_tests_pigeon_test_host_integration_core_api_echo_async_list_response, + CORE_TESTS_PIGEON_TEST, HOST_INTEGRATION_CORE_API_ECHO_ASYNC_LIST_RESPONSE, GObject) -struct - _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAllNullableTypesResponse { +struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncListResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAllNullableTypesResponse, - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_nullable_types_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncListResponse, + core_tests_pigeon_test_host_integration_core_api_echo_async_list_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_nullable_types_response_dispose( +core_tests_pigeon_test_host_integration_core_api_echo_async_list_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAllNullableTypesResponse* - self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_ALL_NULLABLE_TYPES_RESPONSE( - object); + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncListResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_LIST_RESPONSE( + object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_nullable_types_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_echo_async_list_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_nullable_types_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAllNullableTypesResponse* - self) {} +core_tests_pigeon_test_host_integration_core_api_echo_async_list_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncListResponse* self) {} static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_nullable_types_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAllNullableTypesResponseClass* +core_tests_pigeon_test_host_integration_core_api_echo_async_list_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncListResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_nullable_types_response_dispose; + core_tests_pigeon_test_host_integration_core_api_echo_async_list_response_dispose; } -static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAllNullableTypesResponse* -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_nullable_types_response_new( - CoreTestsPigeonTestAllNullableTypes* return_value) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAllNullableTypesResponse* - self = CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_ALL_NULLABLE_TYPES_RESPONSE( +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncListResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_list_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncListResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_LIST_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_nullable_types_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_async_list_response_get_type(), nullptr)); self->value = fl_value_new_list(); - fl_value_append_take( - self->value, return_value != nullptr - ? fl_value_new_custom_object(132, G_OBJECT(return_value)) - : fl_value_new_null()); + fl_value_append_take(self->value, fl_value_ref(return_value)); return self; } -static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAllNullableTypesResponse* -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_nullable_types_response_new_error( +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncListResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_list_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAllNullableTypesResponse* - self = CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_ALL_NULLABLE_TYPES_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncListResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_LIST_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_nullable_types_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_async_list_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); @@ -6974,71 +7434,66 @@ core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_nullable_ } G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterSendMultipleNullableTypesResponse, - core_tests_pigeon_test_host_integration_core_api_call_flutter_send_multiple_nullable_types_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncEnumListResponse, + core_tests_pigeon_test_host_integration_core_api_echo_async_enum_list_response, CORE_TESTS_PIGEON_TEST, - HOST_INTEGRATION_CORE_API_CALL_FLUTTER_SEND_MULTIPLE_NULLABLE_TYPES_RESPONSE, - GObject) + HOST_INTEGRATION_CORE_API_ECHO_ASYNC_ENUM_LIST_RESPONSE, GObject) -struct - _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterSendMultipleNullableTypesResponse { +struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncEnumListResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterSendMultipleNullableTypesResponse, - core_tests_pigeon_test_host_integration_core_api_call_flutter_send_multiple_nullable_types_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncEnumListResponse, + core_tests_pigeon_test_host_integration_core_api_echo_async_enum_list_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_send_multiple_nullable_types_response_dispose( +core_tests_pigeon_test_host_integration_core_api_echo_async_enum_list_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterSendMultipleNullableTypesResponse* - self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_SEND_MULTIPLE_NULLABLE_TYPES_RESPONSE( - object); + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncEnumListResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_ENUM_LIST_RESPONSE( + object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_call_flutter_send_multiple_nullable_types_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_echo_async_enum_list_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_send_multiple_nullable_types_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterSendMultipleNullableTypesResponse* - self) {} +core_tests_pigeon_test_host_integration_core_api_echo_async_enum_list_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncEnumListResponse* self) {} static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_send_multiple_nullable_types_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterSendMultipleNullableTypesResponseClass* +core_tests_pigeon_test_host_integration_core_api_echo_async_enum_list_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncEnumListResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_call_flutter_send_multiple_nullable_types_response_dispose; + core_tests_pigeon_test_host_integration_core_api_echo_async_enum_list_response_dispose; } -static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterSendMultipleNullableTypesResponse* -core_tests_pigeon_test_host_integration_core_api_call_flutter_send_multiple_nullable_types_response_new( - CoreTestsPigeonTestAllNullableTypes* return_value) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterSendMultipleNullableTypesResponse* - self = CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_SEND_MULTIPLE_NULLABLE_TYPES_RESPONSE( +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncEnumListResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_enum_list_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncEnumListResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_ENUM_LIST_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_call_flutter_send_multiple_nullable_types_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_async_enum_list_response_get_type(), nullptr)); self->value = fl_value_new_list(); - fl_value_append_take(self->value, - fl_value_new_custom_object(132, G_OBJECT(return_value))); + fl_value_append_take(self->value, fl_value_ref(return_value)); return self; } -static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterSendMultipleNullableTypesResponse* -core_tests_pigeon_test_host_integration_core_api_call_flutter_send_multiple_nullable_types_response_new_error( +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncEnumListResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_enum_list_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterSendMultipleNullableTypesResponse* - self = CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_SEND_MULTIPLE_NULLABLE_TYPES_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncEnumListResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_ENUM_LIST_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_call_flutter_send_multiple_nullable_types_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_async_enum_list_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); @@ -7050,73 +7505,67 @@ core_tests_pigeon_test_host_integration_core_api_call_flutter_send_multiple_null } G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAllNullableTypesWithoutRecursionResponse, - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_nullable_types_without_recursion_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncClassListResponse, + core_tests_pigeon_test_host_integration_core_api_echo_async_class_list_response, CORE_TESTS_PIGEON_TEST, - HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_ALL_NULLABLE_TYPES_WITHOUT_RECURSION_RESPONSE, - GObject) + HOST_INTEGRATION_CORE_API_ECHO_ASYNC_CLASS_LIST_RESPONSE, GObject) -struct - _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAllNullableTypesWithoutRecursionResponse { +struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncClassListResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAllNullableTypesWithoutRecursionResponse, - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_nullable_types_without_recursion_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncClassListResponse, + core_tests_pigeon_test_host_integration_core_api_echo_async_class_list_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_nullable_types_without_recursion_response_dispose( +core_tests_pigeon_test_host_integration_core_api_echo_async_class_list_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAllNullableTypesWithoutRecursionResponse* - self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_ALL_NULLABLE_TYPES_WITHOUT_RECURSION_RESPONSE( - object); + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncClassListResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_CLASS_LIST_RESPONSE( + object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_nullable_types_without_recursion_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_echo_async_class_list_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_nullable_types_without_recursion_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAllNullableTypesWithoutRecursionResponse* - self) {} +core_tests_pigeon_test_host_integration_core_api_echo_async_class_list_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncClassListResponse* self) { +} static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_nullable_types_without_recursion_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAllNullableTypesWithoutRecursionResponseClass* +core_tests_pigeon_test_host_integration_core_api_echo_async_class_list_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncClassListResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_nullable_types_without_recursion_response_dispose; + core_tests_pigeon_test_host_integration_core_api_echo_async_class_list_response_dispose; } -static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAllNullableTypesWithoutRecursionResponse* -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_nullable_types_without_recursion_response_new( - CoreTestsPigeonTestAllNullableTypesWithoutRecursion* return_value) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAllNullableTypesWithoutRecursionResponse* - self = CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_ALL_NULLABLE_TYPES_WITHOUT_RECURSION_RESPONSE( +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncClassListResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_class_list_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncClassListResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_CLASS_LIST_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_nullable_types_without_recursion_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_async_class_list_response_get_type(), nullptr)); self->value = fl_value_new_list(); - fl_value_append_take( - self->value, return_value != nullptr - ? fl_value_new_custom_object(133, G_OBJECT(return_value)) - : fl_value_new_null()); + fl_value_append_take(self->value, fl_value_ref(return_value)); return self; } -static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAllNullableTypesWithoutRecursionResponse* -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_nullable_types_without_recursion_response_new_error( +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncClassListResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_class_list_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAllNullableTypesWithoutRecursionResponse* - self = CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_ALL_NULLABLE_TYPES_WITHOUT_RECURSION_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncClassListResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_CLASS_LIST_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_nullable_types_without_recursion_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_async_class_list_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); @@ -7128,71 +7577,65 @@ core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_nullable_ } G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterSendMultipleNullableTypesWithoutRecursionResponse, - core_tests_pigeon_test_host_integration_core_api_call_flutter_send_multiple_nullable_types_without_recursion_response, - CORE_TESTS_PIGEON_TEST, - HOST_INTEGRATION_CORE_API_CALL_FLUTTER_SEND_MULTIPLE_NULLABLE_TYPES_WITHOUT_RECURSION_RESPONSE, + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncMapResponse, + core_tests_pigeon_test_host_integration_core_api_echo_async_map_response, + CORE_TESTS_PIGEON_TEST, HOST_INTEGRATION_CORE_API_ECHO_ASYNC_MAP_RESPONSE, GObject) -struct - _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterSendMultipleNullableTypesWithoutRecursionResponse { +struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncMapResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterSendMultipleNullableTypesWithoutRecursionResponse, - core_tests_pigeon_test_host_integration_core_api_call_flutter_send_multiple_nullable_types_without_recursion_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncMapResponse, + core_tests_pigeon_test_host_integration_core_api_echo_async_map_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_send_multiple_nullable_types_without_recursion_response_dispose( +core_tests_pigeon_test_host_integration_core_api_echo_async_map_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterSendMultipleNullableTypesWithoutRecursionResponse* - self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_SEND_MULTIPLE_NULLABLE_TYPES_WITHOUT_RECURSION_RESPONSE( - object); + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_MAP_RESPONSE( + object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_call_flutter_send_multiple_nullable_types_without_recursion_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_echo_async_map_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_send_multiple_nullable_types_without_recursion_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterSendMultipleNullableTypesWithoutRecursionResponse* - self) {} +core_tests_pigeon_test_host_integration_core_api_echo_async_map_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncMapResponse* self) {} static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_send_multiple_nullable_types_without_recursion_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterSendMultipleNullableTypesWithoutRecursionResponseClass* - klass) { +core_tests_pigeon_test_host_integration_core_api_echo_async_map_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncMapResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_call_flutter_send_multiple_nullable_types_without_recursion_response_dispose; + core_tests_pigeon_test_host_integration_core_api_echo_async_map_response_dispose; } -static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterSendMultipleNullableTypesWithoutRecursionResponse* -core_tests_pigeon_test_host_integration_core_api_call_flutter_send_multiple_nullable_types_without_recursion_response_new( - CoreTestsPigeonTestAllNullableTypesWithoutRecursion* return_value) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterSendMultipleNullableTypesWithoutRecursionResponse* - self = CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_SEND_MULTIPLE_NULLABLE_TYPES_WITHOUT_RECURSION_RESPONSE( +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_map_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_MAP_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_call_flutter_send_multiple_nullable_types_without_recursion_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_async_map_response_get_type(), nullptr)); self->value = fl_value_new_list(); - fl_value_append_take(self->value, - fl_value_new_custom_object(133, G_OBJECT(return_value))); + fl_value_append_take(self->value, fl_value_ref(return_value)); return self; } -static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterSendMultipleNullableTypesWithoutRecursionResponse* -core_tests_pigeon_test_host_integration_core_api_call_flutter_send_multiple_nullable_types_without_recursion_response_new_error( +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_map_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterSendMultipleNullableTypesWithoutRecursionResponse* - self = CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_SEND_MULTIPLE_NULLABLE_TYPES_WITHOUT_RECURSION_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_MAP_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_call_flutter_send_multiple_nullable_types_without_recursion_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_async_map_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); @@ -7204,67 +7647,67 @@ core_tests_pigeon_test_host_integration_core_api_call_flutter_send_multiple_null } G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoBoolResponse, - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_bool_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncStringMapResponse, + core_tests_pigeon_test_host_integration_core_api_echo_async_string_map_response, CORE_TESTS_PIGEON_TEST, - HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_BOOL_RESPONSE, GObject) + HOST_INTEGRATION_CORE_API_ECHO_ASYNC_STRING_MAP_RESPONSE, GObject) -struct _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoBoolResponse { +struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncStringMapResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoBoolResponse, - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_bool_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncStringMapResponse, + core_tests_pigeon_test_host_integration_core_api_echo_async_string_map_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_bool_response_dispose( +core_tests_pigeon_test_host_integration_core_api_echo_async_string_map_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoBoolResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_BOOL_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncStringMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_STRING_MAP_RESPONSE( object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_bool_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_echo_async_string_map_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_bool_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoBoolResponse* - self) {} +core_tests_pigeon_test_host_integration_core_api_echo_async_string_map_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncStringMapResponse* self) { +} static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_bool_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoBoolResponseClass* +core_tests_pigeon_test_host_integration_core_api_echo_async_string_map_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncStringMapResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_bool_response_dispose; + core_tests_pigeon_test_host_integration_core_api_echo_async_string_map_response_dispose; } -static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoBoolResponse* -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_bool_response_new( - gboolean return_value) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoBoolResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_BOOL_RESPONSE( +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncStringMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_string_map_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncStringMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_STRING_MAP_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_bool_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_async_string_map_response_get_type(), nullptr)); self->value = fl_value_new_list(); - fl_value_append_take(self->value, fl_value_new_bool(return_value)); + fl_value_append_take(self->value, fl_value_ref(return_value)); return self; } -static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoBoolResponse* -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_bool_response_new_error( +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncStringMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_string_map_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoBoolResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_BOOL_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncStringMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_STRING_MAP_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_bool_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_async_string_map_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); @@ -7276,67 +7719,66 @@ core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_bool_response } G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoIntResponse, - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_int_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncIntMapResponse, + core_tests_pigeon_test_host_integration_core_api_echo_async_int_map_response, CORE_TESTS_PIGEON_TEST, - HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_INT_RESPONSE, GObject) + HOST_INTEGRATION_CORE_API_ECHO_ASYNC_INT_MAP_RESPONSE, GObject) -struct _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoIntResponse { +struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncIntMapResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoIntResponse, - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_int_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncIntMapResponse, + core_tests_pigeon_test_host_integration_core_api_echo_async_int_map_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_int_response_dispose( +core_tests_pigeon_test_host_integration_core_api_echo_async_int_map_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoIntResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_INT_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncIntMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_INT_MAP_RESPONSE( object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_int_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_echo_async_int_map_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_int_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoIntResponse* self) { -} +core_tests_pigeon_test_host_integration_core_api_echo_async_int_map_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncIntMapResponse* self) {} static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_int_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoIntResponseClass* +core_tests_pigeon_test_host_integration_core_api_echo_async_int_map_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncIntMapResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_int_response_dispose; + core_tests_pigeon_test_host_integration_core_api_echo_async_int_map_response_dispose; } -static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoIntResponse* -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_int_response_new( - int64_t return_value) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoIntResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_INT_RESPONSE( +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncIntMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_int_map_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncIntMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_INT_MAP_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_int_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_async_int_map_response_get_type(), nullptr)); self->value = fl_value_new_list(); - fl_value_append_take(self->value, fl_value_new_int(return_value)); + fl_value_append_take(self->value, fl_value_ref(return_value)); return self; } -static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoIntResponse* -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_int_response_new_error( +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncIntMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_int_map_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoIntResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_INT_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncIntMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_INT_MAP_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_int_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_async_int_map_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); @@ -7348,67 +7790,66 @@ core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_int_response_ } G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoDoubleResponse, - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_double_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncEnumMapResponse, + core_tests_pigeon_test_host_integration_core_api_echo_async_enum_map_response, CORE_TESTS_PIGEON_TEST, - HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_DOUBLE_RESPONSE, GObject) + HOST_INTEGRATION_CORE_API_ECHO_ASYNC_ENUM_MAP_RESPONSE, GObject) -struct _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoDoubleResponse { +struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncEnumMapResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoDoubleResponse, - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_double_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncEnumMapResponse, + core_tests_pigeon_test_host_integration_core_api_echo_async_enum_map_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_double_response_dispose( +core_tests_pigeon_test_host_integration_core_api_echo_async_enum_map_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoDoubleResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_DOUBLE_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncEnumMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_ENUM_MAP_RESPONSE( object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_double_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_echo_async_enum_map_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_double_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoDoubleResponse* - self) {} +core_tests_pigeon_test_host_integration_core_api_echo_async_enum_map_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncEnumMapResponse* self) {} static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_double_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoDoubleResponseClass* +core_tests_pigeon_test_host_integration_core_api_echo_async_enum_map_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncEnumMapResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_double_response_dispose; + core_tests_pigeon_test_host_integration_core_api_echo_async_enum_map_response_dispose; } -static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoDoubleResponse* -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_double_response_new( - double return_value) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoDoubleResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_DOUBLE_RESPONSE( +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncEnumMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_enum_map_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncEnumMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_ENUM_MAP_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_double_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_async_enum_map_response_get_type(), nullptr)); self->value = fl_value_new_list(); - fl_value_append_take(self->value, fl_value_new_float(return_value)); + fl_value_append_take(self->value, fl_value_ref(return_value)); return self; } -static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoDoubleResponse* -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_double_response_new_error( +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncEnumMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_enum_map_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoDoubleResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_DOUBLE_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncEnumMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_ENUM_MAP_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_double_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_async_enum_map_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); @@ -7420,67 +7861,66 @@ core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_double_respon } G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoStringResponse, - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_string_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncClassMapResponse, + core_tests_pigeon_test_host_integration_core_api_echo_async_class_map_response, CORE_TESTS_PIGEON_TEST, - HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_STRING_RESPONSE, GObject) + HOST_INTEGRATION_CORE_API_ECHO_ASYNC_CLASS_MAP_RESPONSE, GObject) -struct _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoStringResponse { +struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncClassMapResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoStringResponse, - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_string_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncClassMapResponse, + core_tests_pigeon_test_host_integration_core_api_echo_async_class_map_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_string_response_dispose( +core_tests_pigeon_test_host_integration_core_api_echo_async_class_map_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoStringResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_STRING_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncClassMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_CLASS_MAP_RESPONSE( object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_string_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_echo_async_class_map_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_string_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoStringResponse* - self) {} +core_tests_pigeon_test_host_integration_core_api_echo_async_class_map_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncClassMapResponse* self) {} static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_string_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoStringResponseClass* +core_tests_pigeon_test_host_integration_core_api_echo_async_class_map_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncClassMapResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_string_response_dispose; + core_tests_pigeon_test_host_integration_core_api_echo_async_class_map_response_dispose; } -static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoStringResponse* -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_string_response_new( - const gchar* return_value) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoStringResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_STRING_RESPONSE( +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncClassMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_class_map_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncClassMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_CLASS_MAP_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_string_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_async_class_map_response_get_type(), nullptr)); self->value = fl_value_new_list(); - fl_value_append_take(self->value, fl_value_new_string(return_value)); + fl_value_append_take(self->value, fl_value_ref(return_value)); return self; } -static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoStringResponse* -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_string_response_new_error( +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncClassMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_class_map_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoStringResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_STRING_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncClassMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_CLASS_MAP_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_string_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_async_class_map_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); @@ -7492,69 +7932,68 @@ core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_string_respon } G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoUint8ListResponse, - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_uint8_list_response, - CORE_TESTS_PIGEON_TEST, - HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_UINT8_LIST_RESPONSE, GObject) + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncEnumResponse, + core_tests_pigeon_test_host_integration_core_api_echo_async_enum_response, + CORE_TESTS_PIGEON_TEST, HOST_INTEGRATION_CORE_API_ECHO_ASYNC_ENUM_RESPONSE, + GObject) -struct - _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoUint8ListResponse { +struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncEnumResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoUint8ListResponse, - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_uint8_list_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncEnumResponse, + core_tests_pigeon_test_host_integration_core_api_echo_async_enum_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_uint8_list_response_dispose( +core_tests_pigeon_test_host_integration_core_api_echo_async_enum_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoUint8ListResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_UINT8_LIST_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncEnumResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_ENUM_RESPONSE( object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_uint8_list_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_echo_async_enum_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_uint8_list_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoUint8ListResponse* - self) {} +core_tests_pigeon_test_host_integration_core_api_echo_async_enum_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncEnumResponse* self) {} static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_uint8_list_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoUint8ListResponseClass* +core_tests_pigeon_test_host_integration_core_api_echo_async_enum_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncEnumResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_uint8_list_response_dispose; + core_tests_pigeon_test_host_integration_core_api_echo_async_enum_response_dispose; } -static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoUint8ListResponse* -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_uint8_list_response_new( - const uint8_t* return_value, size_t return_value_length) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoUint8ListResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_UINT8_LIST_RESPONSE( +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncEnumResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_enum_response_new( + CoreTestsPigeonTestAnEnum return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncEnumResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_ENUM_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_uint8_list_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_async_enum_response_get_type(), nullptr)); self->value = fl_value_new_list(); - fl_value_append_take( - self->value, fl_value_new_uint8_list(return_value, return_value_length)); + fl_value_append_take(self->value, + fl_value_new_custom(129, fl_value_new_int(return_value), + (GDestroyNotify)fl_value_unref)); return self; } -static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoUint8ListResponse* -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_uint8_list_response_new_error( +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncEnumResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_enum_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoUint8ListResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_UINT8_LIST_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncEnumResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_ENUM_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_uint8_list_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_async_enum_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); @@ -7566,67 +8005,69 @@ core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_uint8_list_re } G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoListResponse, - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_list_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherAsyncEnumResponse, + core_tests_pigeon_test_host_integration_core_api_echo_another_async_enum_response, CORE_TESTS_PIGEON_TEST, - HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_LIST_RESPONSE, GObject) + HOST_INTEGRATION_CORE_API_ECHO_ANOTHER_ASYNC_ENUM_RESPONSE, GObject) -struct _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoListResponse { +struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherAsyncEnumResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoListResponse, - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_list_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherAsyncEnumResponse, + core_tests_pigeon_test_host_integration_core_api_echo_another_async_enum_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_list_response_dispose( +core_tests_pigeon_test_host_integration_core_api_echo_another_async_enum_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoListResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_LIST_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherAsyncEnumResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ANOTHER_ASYNC_ENUM_RESPONSE( object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_list_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_echo_another_async_enum_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_list_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoListResponse* +core_tests_pigeon_test_host_integration_core_api_echo_another_async_enum_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherAsyncEnumResponse* self) {} static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_list_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoListResponseClass* +core_tests_pigeon_test_host_integration_core_api_echo_another_async_enum_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherAsyncEnumResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_list_response_dispose; + core_tests_pigeon_test_host_integration_core_api_echo_another_async_enum_response_dispose; } -static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoListResponse* -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_list_response_new( - FlValue* return_value) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoListResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_LIST_RESPONSE( +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherAsyncEnumResponse* +core_tests_pigeon_test_host_integration_core_api_echo_another_async_enum_response_new( + CoreTestsPigeonTestAnotherEnum return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherAsyncEnumResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ANOTHER_ASYNC_ENUM_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_list_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_another_async_enum_response_get_type(), nullptr)); self->value = fl_value_new_list(); - fl_value_append_take(self->value, fl_value_ref(return_value)); + fl_value_append_take(self->value, + fl_value_new_custom(130, fl_value_new_int(return_value), + (GDestroyNotify)fl_value_unref)); return self; } -static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoListResponse* -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_list_response_new_error( +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherAsyncEnumResponse* +core_tests_pigeon_test_host_integration_core_api_echo_another_async_enum_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoListResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_LIST_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherAsyncEnumResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ANOTHER_ASYNC_ENUM_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_list_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_another_async_enum_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); @@ -7638,67 +8079,68 @@ core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_list_response } G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoMapResponse, - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_map_response, + CoreTestsPigeonTestHostIntegrationCoreApiThrowAsyncErrorResponse, + core_tests_pigeon_test_host_integration_core_api_throw_async_error_response, CORE_TESTS_PIGEON_TEST, - HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_MAP_RESPONSE, GObject) + HOST_INTEGRATION_CORE_API_THROW_ASYNC_ERROR_RESPONSE, GObject) -struct _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoMapResponse { +struct _CoreTestsPigeonTestHostIntegrationCoreApiThrowAsyncErrorResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoMapResponse, - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_map_response, + CoreTestsPigeonTestHostIntegrationCoreApiThrowAsyncErrorResponse, + core_tests_pigeon_test_host_integration_core_api_throw_async_error_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_map_response_dispose( +core_tests_pigeon_test_host_integration_core_api_throw_async_error_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoMapResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_MAP_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiThrowAsyncErrorResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_THROW_ASYNC_ERROR_RESPONSE( object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_map_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_throw_async_error_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_map_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoMapResponse* self) { -} +core_tests_pigeon_test_host_integration_core_api_throw_async_error_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiThrowAsyncErrorResponse* self) {} static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_map_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoMapResponseClass* +core_tests_pigeon_test_host_integration_core_api_throw_async_error_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiThrowAsyncErrorResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_map_response_dispose; + core_tests_pigeon_test_host_integration_core_api_throw_async_error_response_dispose; } -static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoMapResponse* -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_map_response_new( +static CoreTestsPigeonTestHostIntegrationCoreApiThrowAsyncErrorResponse* +core_tests_pigeon_test_host_integration_core_api_throw_async_error_response_new( FlValue* return_value) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoMapResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_MAP_RESPONSE( - g_object_new( - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_map_response_get_type(), + CoreTestsPigeonTestHostIntegrationCoreApiThrowAsyncErrorResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_THROW_ASYNC_ERROR_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_throw_async_error_response_get_type(), nullptr)); self->value = fl_value_new_list(); - fl_value_append_take(self->value, fl_value_ref(return_value)); + fl_value_append_take(self->value, return_value != nullptr + ? fl_value_ref(return_value) + : fl_value_new_null()); return self; } -static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoMapResponse* -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_map_response_new_error( +static CoreTestsPigeonTestHostIntegrationCoreApiThrowAsyncErrorResponse* +core_tests_pigeon_test_host_integration_core_api_throw_async_error_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoMapResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_MAP_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiThrowAsyncErrorResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_THROW_ASYNC_ERROR_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_map_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_throw_async_error_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); @@ -7710,69 +8152,67 @@ core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_map_response_ } G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoEnumResponse, - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_response, + CoreTestsPigeonTestHostIntegrationCoreApiThrowAsyncErrorFromVoidResponse, + core_tests_pigeon_test_host_integration_core_api_throw_async_error_from_void_response, CORE_TESTS_PIGEON_TEST, - HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_ENUM_RESPONSE, GObject) + HOST_INTEGRATION_CORE_API_THROW_ASYNC_ERROR_FROM_VOID_RESPONSE, GObject) -struct _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoEnumResponse { +struct + _CoreTestsPigeonTestHostIntegrationCoreApiThrowAsyncErrorFromVoidResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoEnumResponse, - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_response, + CoreTestsPigeonTestHostIntegrationCoreApiThrowAsyncErrorFromVoidResponse, + core_tests_pigeon_test_host_integration_core_api_throw_async_error_from_void_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_response_dispose( +core_tests_pigeon_test_host_integration_core_api_throw_async_error_from_void_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoEnumResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_ENUM_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiThrowAsyncErrorFromVoidResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_THROW_ASYNC_ERROR_FROM_VOID_RESPONSE( object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_throw_async_error_from_void_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoEnumResponse* +core_tests_pigeon_test_host_integration_core_api_throw_async_error_from_void_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiThrowAsyncErrorFromVoidResponse* self) {} static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoEnumResponseClass* +core_tests_pigeon_test_host_integration_core_api_throw_async_error_from_void_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiThrowAsyncErrorFromVoidResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_response_dispose; + core_tests_pigeon_test_host_integration_core_api_throw_async_error_from_void_response_dispose; } -static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoEnumResponse* -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_response_new( - CoreTestsPigeonTestAnEnum return_value) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoEnumResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_ENUM_RESPONSE( +static CoreTestsPigeonTestHostIntegrationCoreApiThrowAsyncErrorFromVoidResponse* +core_tests_pigeon_test_host_integration_core_api_throw_async_error_from_void_response_new() { + CoreTestsPigeonTestHostIntegrationCoreApiThrowAsyncErrorFromVoidResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_THROW_ASYNC_ERROR_FROM_VOID_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_throw_async_error_from_void_response_get_type(), nullptr)); self->value = fl_value_new_list(); - fl_value_append_take(self->value, - fl_value_new_custom(129, fl_value_new_int(return_value), - (GDestroyNotify)fl_value_unref)); + fl_value_append_take(self->value, fl_value_new_null()); return self; } -static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoEnumResponse* -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_response_new_error( +static CoreTestsPigeonTestHostIntegrationCoreApiThrowAsyncErrorFromVoidResponse* +core_tests_pigeon_test_host_integration_core_api_throw_async_error_from_void_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoEnumResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_ENUM_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiThrowAsyncErrorFromVoidResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_THROW_ASYNC_ERROR_FROM_VOID_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_throw_async_error_from_void_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); @@ -7784,70 +8224,70 @@ core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_response } G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAnotherEnumResponse, - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_another_enum_response, + CoreTestsPigeonTestHostIntegrationCoreApiThrowAsyncFlutterErrorResponse, + core_tests_pigeon_test_host_integration_core_api_throw_async_flutter_error_response, CORE_TESTS_PIGEON_TEST, - HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_ANOTHER_ENUM_RESPONSE, GObject) + HOST_INTEGRATION_CORE_API_THROW_ASYNC_FLUTTER_ERROR_RESPONSE, GObject) struct - _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAnotherEnumResponse { + _CoreTestsPigeonTestHostIntegrationCoreApiThrowAsyncFlutterErrorResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAnotherEnumResponse, - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_another_enum_response, + CoreTestsPigeonTestHostIntegrationCoreApiThrowAsyncFlutterErrorResponse, + core_tests_pigeon_test_host_integration_core_api_throw_async_flutter_error_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_another_enum_response_dispose( +core_tests_pigeon_test_host_integration_core_api_throw_async_flutter_error_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAnotherEnumResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_ANOTHER_ENUM_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiThrowAsyncFlutterErrorResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_THROW_ASYNC_FLUTTER_ERROR_RESPONSE( object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_another_enum_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_throw_async_flutter_error_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_another_enum_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAnotherEnumResponse* +core_tests_pigeon_test_host_integration_core_api_throw_async_flutter_error_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiThrowAsyncFlutterErrorResponse* self) {} static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_another_enum_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAnotherEnumResponseClass* +core_tests_pigeon_test_host_integration_core_api_throw_async_flutter_error_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiThrowAsyncFlutterErrorResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_another_enum_response_dispose; + core_tests_pigeon_test_host_integration_core_api_throw_async_flutter_error_response_dispose; } -static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAnotherEnumResponse* -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_another_enum_response_new( - CoreTestsPigeonTestAnotherEnum return_value) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAnotherEnumResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_ANOTHER_ENUM_RESPONSE( +static CoreTestsPigeonTestHostIntegrationCoreApiThrowAsyncFlutterErrorResponse* +core_tests_pigeon_test_host_integration_core_api_throw_async_flutter_error_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiThrowAsyncFlutterErrorResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_THROW_ASYNC_FLUTTER_ERROR_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_another_enum_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_throw_async_flutter_error_response_get_type(), nullptr)); self->value = fl_value_new_list(); - fl_value_append_take(self->value, - fl_value_new_custom(130, fl_value_new_int(return_value), - (GDestroyNotify)fl_value_unref)); + fl_value_append_take(self->value, return_value != nullptr + ? fl_value_ref(return_value) + : fl_value_new_null()); return self; } -static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAnotherEnumResponse* -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_another_enum_response_new_error( +static CoreTestsPigeonTestHostIntegrationCoreApiThrowAsyncFlutterErrorResponse* +core_tests_pigeon_test_host_integration_core_api_throw_async_flutter_error_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAnotherEnumResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_ANOTHER_ENUM_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiThrowAsyncFlutterErrorResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_THROW_ASYNC_FLUTTER_ERROR_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_another_enum_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_throw_async_flutter_error_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); @@ -7859,71 +8299,67 @@ core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_another_enum_ } G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableBoolResponse, - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_bool_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncAllTypesResponse, + core_tests_pigeon_test_host_integration_core_api_echo_async_all_types_response, CORE_TESTS_PIGEON_TEST, - HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_BOOL_RESPONSE, GObject) + HOST_INTEGRATION_CORE_API_ECHO_ASYNC_ALL_TYPES_RESPONSE, GObject) -struct - _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableBoolResponse { +struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncAllTypesResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableBoolResponse, - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_bool_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncAllTypesResponse, + core_tests_pigeon_test_host_integration_core_api_echo_async_all_types_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_bool_response_dispose( +core_tests_pigeon_test_host_integration_core_api_echo_async_all_types_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableBoolResponse* - self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_BOOL_RESPONSE( - object); + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncAllTypesResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_ALL_TYPES_RESPONSE( + object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_bool_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_echo_async_all_types_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_bool_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableBoolResponse* - self) {} +core_tests_pigeon_test_host_integration_core_api_echo_async_all_types_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncAllTypesResponse* self) {} static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_bool_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableBoolResponseClass* +core_tests_pigeon_test_host_integration_core_api_echo_async_all_types_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncAllTypesResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_bool_response_dispose; + core_tests_pigeon_test_host_integration_core_api_echo_async_all_types_response_dispose; } -static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableBoolResponse* -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_bool_response_new( - gboolean* return_value) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableBoolResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_BOOL_RESPONSE( +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncAllTypesResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_all_types_response_new( + CoreTestsPigeonTestAllTypes* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncAllTypesResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_ALL_TYPES_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_bool_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_async_all_types_response_get_type(), nullptr)); self->value = fl_value_new_list(); - fl_value_append_take(self->value, return_value != nullptr - ? fl_value_new_bool(*return_value) - : fl_value_new_null()); + fl_value_append_take(self->value, + fl_value_new_custom_object(132, G_OBJECT(return_value))); return self; } -static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableBoolResponse* -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_bool_response_new_error( +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncAllTypesResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_all_types_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableBoolResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_BOOL_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncAllTypesResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_ALL_TYPES_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_bool_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_async_all_types_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); @@ -7935,70 +8371,73 @@ core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_bool } G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableIntResponse, - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_int_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableAllNullableTypesResponse, + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_all_nullable_types_response, CORE_TESTS_PIGEON_TEST, - HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_INT_RESPONSE, GObject) + HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_ALL_NULLABLE_TYPES_RESPONSE, + GObject) struct - _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableIntResponse { + _CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableAllNullableTypesResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableIntResponse, - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_int_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableAllNullableTypesResponse, + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_all_nullable_types_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_int_response_dispose( +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_all_nullable_types_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableIntResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_INT_RESPONSE( - object); + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableAllNullableTypesResponse* + self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_ALL_NULLABLE_TYPES_RESPONSE( + object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_int_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_all_nullable_types_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_int_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableIntResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_all_nullable_types_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableAllNullableTypesResponse* self) {} static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_int_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableIntResponseClass* +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_all_nullable_types_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableAllNullableTypesResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_int_response_dispose; + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_all_nullable_types_response_dispose; } -static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableIntResponse* -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_int_response_new( - int64_t* return_value) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableIntResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_INT_RESPONSE( +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableAllNullableTypesResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_all_nullable_types_response_new( + CoreTestsPigeonTestAllNullableTypes* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableAllNullableTypesResponse* + self = CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_ALL_NULLABLE_TYPES_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_int_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_all_nullable_types_response_get_type(), nullptr)); self->value = fl_value_new_list(); - fl_value_append_take(self->value, return_value != nullptr - ? fl_value_new_int(*return_value) - : fl_value_new_null()); + fl_value_append_take( + self->value, return_value != nullptr + ? fl_value_new_custom_object(133, G_OBJECT(return_value)) + : fl_value_new_null()); return self; } -static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableIntResponse* -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_int_response_new_error( +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableAllNullableTypesResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_all_nullable_types_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableIntResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_INT_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableAllNullableTypesResponse* + self = CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_ALL_NULLABLE_TYPES_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_int_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_all_nullable_types_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); @@ -8010,72 +8449,73 @@ core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_int_ } G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableDoubleResponse, - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_double_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableAllNullableTypesWithoutRecursionResponse, + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_all_nullable_types_without_recursion_response, CORE_TESTS_PIGEON_TEST, - HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_DOUBLE_RESPONSE, + HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_ALL_NULLABLE_TYPES_WITHOUT_RECURSION_RESPONSE, GObject) struct - _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableDoubleResponse { + _CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableAllNullableTypesWithoutRecursionResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableDoubleResponse, - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_double_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableAllNullableTypesWithoutRecursionResponse, + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_all_nullable_types_without_recursion_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_double_response_dispose( +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_all_nullable_types_without_recursion_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableDoubleResponse* + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableAllNullableTypesWithoutRecursionResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_DOUBLE_RESPONSE( + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_ALL_NULLABLE_TYPES_WITHOUT_RECURSION_RESPONSE( object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_double_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_all_nullable_types_without_recursion_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_double_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableDoubleResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_all_nullable_types_without_recursion_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableAllNullableTypesWithoutRecursionResponse* self) {} static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_double_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableDoubleResponseClass* +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_all_nullable_types_without_recursion_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableAllNullableTypesWithoutRecursionResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_double_response_dispose; + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_all_nullable_types_without_recursion_response_dispose; } -static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableDoubleResponse* -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_double_response_new( - double* return_value) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableDoubleResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_DOUBLE_RESPONSE( +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableAllNullableTypesWithoutRecursionResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_all_nullable_types_without_recursion_response_new( + CoreTestsPigeonTestAllNullableTypesWithoutRecursion* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableAllNullableTypesWithoutRecursionResponse* + self = CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_ALL_NULLABLE_TYPES_WITHOUT_RECURSION_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_double_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_all_nullable_types_without_recursion_response_get_type(), nullptr)); self->value = fl_value_new_list(); - fl_value_append_take(self->value, return_value != nullptr - ? fl_value_new_float(*return_value) - : fl_value_new_null()); + fl_value_append_take( + self->value, return_value != nullptr + ? fl_value_new_custom_object(134, G_OBJECT(return_value)) + : fl_value_new_null()); return self; } -static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableDoubleResponse* -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_double_response_new_error( +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableAllNullableTypesWithoutRecursionResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_all_nullable_types_without_recursion_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableDoubleResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_DOUBLE_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableAllNullableTypesWithoutRecursionResponse* + self = CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_ALL_NULLABLE_TYPES_WITHOUT_RECURSION_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_double_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_all_nullable_types_without_recursion_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); @@ -8087,72 +8527,69 @@ core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_doub } G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableStringResponse, - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_string_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableIntResponse, + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_int_response, CORE_TESTS_PIGEON_TEST, - HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_STRING_RESPONSE, - GObject) + HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_INT_RESPONSE, GObject) -struct - _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableStringResponse { +struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableIntResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableStringResponse, - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_string_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableIntResponse, + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_int_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_string_response_dispose( +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_int_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableStringResponse* - self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_STRING_RESPONSE( - object); + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableIntResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_INT_RESPONSE( + object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_string_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_int_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_string_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableStringResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_int_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableIntResponse* self) {} static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_string_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableStringResponseClass* +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_int_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableIntResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_string_response_dispose; + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_int_response_dispose; } -static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableStringResponse* -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_string_response_new( - const gchar* return_value) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableStringResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_STRING_RESPONSE( +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableIntResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_int_response_new( + int64_t* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableIntResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_INT_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_string_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_int_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, return_value != nullptr - ? fl_value_new_string(return_value) + ? fl_value_new_int(*return_value) : fl_value_new_null()); return self; } -static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableStringResponse* -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_string_response_new_error( +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableIntResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_int_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableStringResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_STRING_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableIntResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_INT_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_string_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_int_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); @@ -8164,73 +8601,70 @@ core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_stri } G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableUint8ListResponse, - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_uint8_list_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableDoubleResponse, + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_double_response, CORE_TESTS_PIGEON_TEST, - HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_UINT8_LIST_RESPONSE, - GObject) + HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_DOUBLE_RESPONSE, GObject) struct - _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableUint8ListResponse { + _CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableDoubleResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableUint8ListResponse, - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_uint8_list_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableDoubleResponse, + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_double_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_uint8_list_response_dispose( +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_double_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableUint8ListResponse* - self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_UINT8_LIST_RESPONSE( - object); + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableDoubleResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_DOUBLE_RESPONSE( + object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_uint8_list_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_double_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_uint8_list_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableUint8ListResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_double_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableDoubleResponse* self) {} static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_uint8_list_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableUint8ListResponseClass* +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_double_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableDoubleResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_uint8_list_response_dispose; + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_double_response_dispose; } -static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableUint8ListResponse* -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_uint8_list_response_new( - const uint8_t* return_value, size_t return_value_length) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableUint8ListResponse* - self = CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_UINT8_LIST_RESPONSE( +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableDoubleResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_double_response_new( + double* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableDoubleResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_DOUBLE_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_uint8_list_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_double_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, return_value != nullptr - ? fl_value_new_uint8_list( - return_value, return_value_length) + ? fl_value_new_float(*return_value) : fl_value_new_null()); return self; } -static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableUint8ListResponse* -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_uint8_list_response_new_error( +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableDoubleResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_double_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableUint8ListResponse* - self = CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_UINT8_LIST_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableDoubleResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_DOUBLE_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_uint8_list_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_double_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); @@ -8242,71 +8676,69 @@ core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_uint } G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableListResponse, - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_list_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableBoolResponse, + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_bool_response, CORE_TESTS_PIGEON_TEST, - HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_LIST_RESPONSE, GObject) + HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_BOOL_RESPONSE, GObject) -struct - _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableListResponse { +struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableBoolResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableListResponse, - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_list_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableBoolResponse, + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_bool_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_list_response_dispose( +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_bool_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableListResponse* - self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_LIST_RESPONSE( - object); + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableBoolResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_BOOL_RESPONSE( + object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_list_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_bool_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_list_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableListResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_bool_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableBoolResponse* self) {} static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_list_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableListResponseClass* +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_bool_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableBoolResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_list_response_dispose; + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_bool_response_dispose; } -static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableListResponse* -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_list_response_new( - FlValue* return_value) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableListResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_LIST_RESPONSE( +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableBoolResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_bool_response_new( + gboolean* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableBoolResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_BOOL_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_list_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_bool_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, return_value != nullptr - ? fl_value_ref(return_value) + ? fl_value_new_bool(*return_value) : fl_value_new_null()); return self; } -static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableListResponse* -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_list_response_new_error( +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableBoolResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_bool_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableListResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_LIST_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableBoolResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_BOOL_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_list_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_bool_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); @@ -8318,70 +8750,70 @@ core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_list } G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableMapResponse, - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_map_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableStringResponse, + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_string_response, CORE_TESTS_PIGEON_TEST, - HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_MAP_RESPONSE, GObject) + HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_STRING_RESPONSE, GObject) struct - _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableMapResponse { + _CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableStringResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableMapResponse, - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_map_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableStringResponse, + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_string_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_map_response_dispose( +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_string_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableMapResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_MAP_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableStringResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_STRING_RESPONSE( object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_map_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_string_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_map_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_string_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableStringResponse* self) {} static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_map_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableMapResponseClass* +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_string_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableStringResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_map_response_dispose; + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_string_response_dispose; } -static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableMapResponse* -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_map_response_new( - FlValue* return_value) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableMapResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_MAP_RESPONSE( +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableStringResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_string_response_new( + const gchar* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableStringResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_STRING_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_map_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_string_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, return_value != nullptr - ? fl_value_ref(return_value) + ? fl_value_new_string(return_value) : fl_value_new_null()); return self; } -static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableMapResponse* -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_map_response_new_error( +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableStringResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_string_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableMapResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_MAP_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableStringResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_STRING_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_map_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_string_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); @@ -8393,74 +8825,71 @@ core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_map_ } G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableEnumResponse, - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_enum_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableUint8ListResponse, + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_uint8_list_response, CORE_TESTS_PIGEON_TEST, - HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_ENUM_RESPONSE, GObject) + HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_UINT8_LIST_RESPONSE, GObject) struct - _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableEnumResponse { + _CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableUint8ListResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableEnumResponse, - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_enum_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableUint8ListResponse, + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_uint8_list_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_enum_response_dispose( +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_uint8_list_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableEnumResponse* - self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_ENUM_RESPONSE( - object); + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableUint8ListResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_UINT8_LIST_RESPONSE( + object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_enum_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_uint8_list_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_enum_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableEnumResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_uint8_list_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableUint8ListResponse* self) {} static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_enum_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableEnumResponseClass* +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_uint8_list_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableUint8ListResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_enum_response_dispose; + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_uint8_list_response_dispose; } -static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableEnumResponse* -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_enum_response_new( - CoreTestsPigeonTestAnEnum* return_value) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableEnumResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_ENUM_RESPONSE( +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableUint8ListResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_uint8_list_response_new( + const uint8_t* return_value, size_t return_value_length) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableUint8ListResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_UINT8_LIST_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_enum_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_uint8_list_response_get_type(), nullptr)); self->value = fl_value_new_list(); - fl_value_append_take( - self->value, - return_value != nullptr - ? fl_value_new_custom(129, fl_value_new_int(*return_value), - (GDestroyNotify)fl_value_unref) - : fl_value_new_null()); + fl_value_append_take(self->value, return_value != nullptr + ? fl_value_new_uint8_list( + return_value, return_value_length) + : fl_value_new_null()); return self; } -static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableEnumResponse* -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_enum_response_new_error( +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableUint8ListResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_uint8_list_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableEnumResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_ENUM_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableUint8ListResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_UINT8_LIST_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_enum_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_uint8_list_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); @@ -8472,75 +8901,70 @@ core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_enum } G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAnotherNullableEnumResponse, - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_another_nullable_enum_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableObjectResponse, + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_object_response, CORE_TESTS_PIGEON_TEST, - HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_ANOTHER_NULLABLE_ENUM_RESPONSE, - GObject) + HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_OBJECT_RESPONSE, GObject) struct - _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAnotherNullableEnumResponse { + _CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableObjectResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAnotherNullableEnumResponse, - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_another_nullable_enum_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableObjectResponse, + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_object_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_another_nullable_enum_response_dispose( +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_object_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAnotherNullableEnumResponse* - self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_ANOTHER_NULLABLE_ENUM_RESPONSE( - object); + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableObjectResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_OBJECT_RESPONSE( + object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_another_nullable_enum_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_object_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_another_nullable_enum_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAnotherNullableEnumResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_object_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableObjectResponse* self) {} static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_another_nullable_enum_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAnotherNullableEnumResponseClass* +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_object_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableObjectResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_another_nullable_enum_response_dispose; + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_object_response_dispose; } -static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAnotherNullableEnumResponse* -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_another_nullable_enum_response_new( - CoreTestsPigeonTestAnotherEnum* return_value) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAnotherNullableEnumResponse* - self = CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_ANOTHER_NULLABLE_ENUM_RESPONSE( +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableObjectResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_object_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableObjectResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_OBJECT_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_another_nullable_enum_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_object_response_get_type(), nullptr)); self->value = fl_value_new_list(); - fl_value_append_take( - self->value, - return_value != nullptr - ? fl_value_new_custom(130, fl_value_new_int(*return_value), - (GDestroyNotify)fl_value_unref) - : fl_value_new_null()); + fl_value_append_take(self->value, return_value != nullptr + ? fl_value_ref(return_value) + : fl_value_new_null()); return self; } -static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAnotherNullableEnumResponse* -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_another_nullable_enum_response_new_error( +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableObjectResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_object_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAnotherNullableEnumResponse* - self = CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_ANOTHER_NULLABLE_ENUM_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableObjectResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_OBJECT_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_another_nullable_enum_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_object_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); @@ -8552,70 +8976,69 @@ core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_another_nulla } G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterSmallApiEchoStringResponse, - core_tests_pigeon_test_host_integration_core_api_call_flutter_small_api_echo_string_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableListResponse, + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_list_response, CORE_TESTS_PIGEON_TEST, - HOST_INTEGRATION_CORE_API_CALL_FLUTTER_SMALL_API_ECHO_STRING_RESPONSE, - GObject) + HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_LIST_RESPONSE, GObject) -struct - _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterSmallApiEchoStringResponse { +struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableListResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterSmallApiEchoStringResponse, - core_tests_pigeon_test_host_integration_core_api_call_flutter_small_api_echo_string_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableListResponse, + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_list_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_small_api_echo_string_response_dispose( +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_list_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterSmallApiEchoStringResponse* - self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_SMALL_API_ECHO_STRING_RESPONSE( - object); + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableListResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_LIST_RESPONSE( + object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_call_flutter_small_api_echo_string_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_list_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_small_api_echo_string_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterSmallApiEchoStringResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_list_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableListResponse* self) {} static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_small_api_echo_string_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterSmallApiEchoStringResponseClass* +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_list_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableListResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_call_flutter_small_api_echo_string_response_dispose; + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_list_response_dispose; } -static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterSmallApiEchoStringResponse* -core_tests_pigeon_test_host_integration_core_api_call_flutter_small_api_echo_string_response_new( - const gchar* return_value) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterSmallApiEchoStringResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_SMALL_API_ECHO_STRING_RESPONSE( +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableListResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_list_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableListResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_LIST_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_call_flutter_small_api_echo_string_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_list_response_get_type(), nullptr)); self->value = fl_value_new_list(); - fl_value_append_take(self->value, fl_value_new_string(return_value)); + fl_value_append_take(self->value, return_value != nullptr + ? fl_value_ref(return_value) + : fl_value_new_null()); return self; } -static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterSmallApiEchoStringResponse* -core_tests_pigeon_test_host_integration_core_api_call_flutter_small_api_echo_string_response_new_error( +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableListResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_list_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterSmallApiEchoStringResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_SMALL_API_ECHO_STRING_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableListResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_LIST_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_call_flutter_small_api_echo_string_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_list_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); @@ -8626,6425 +9049,18997 @@ core_tests_pigeon_test_host_integration_core_api_call_flutter_small_api_echo_str return self; } -G_DECLARE_FINAL_TYPE(CoreTestsPigeonTestHostIntegrationCoreApi, - core_tests_pigeon_test_host_integration_core_api, - CORE_TESTS_PIGEON_TEST, HOST_INTEGRATION_CORE_API, GObject) +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableEnumListResponse, + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_enum_list_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_ENUM_LIST_RESPONSE, GObject) -struct _CoreTestsPigeonTestHostIntegrationCoreApi { +struct + _CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableEnumListResponse { GObject parent_instance; - const CoreTestsPigeonTestHostIntegrationCoreApiVTable* vtable; - gpointer user_data; - GDestroyNotify user_data_free_func; + FlValue* value; }; -G_DEFINE_TYPE(CoreTestsPigeonTestHostIntegrationCoreApi, - core_tests_pigeon_test_host_integration_core_api, G_TYPE_OBJECT) +G_DEFINE_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableEnumListResponse, + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_enum_list_response, + G_TYPE_OBJECT) -static void core_tests_pigeon_test_host_integration_core_api_dispose( +static void +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_enum_list_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(object); - if (self->user_data != nullptr) { - self->user_data_free_func(self->user_data); - } - self->user_data = nullptr; - G_OBJECT_CLASS(core_tests_pigeon_test_host_integration_core_api_parent_class) + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableEnumListResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_ENUM_LIST_RESPONSE( + object); + g_clear_pointer(&self->value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_enum_list_response_parent_class) ->dispose(object); } -static void core_tests_pigeon_test_host_integration_core_api_init( - CoreTestsPigeonTestHostIntegrationCoreApi* self) {} +static void +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_enum_list_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableEnumListResponse* + self) {} -static void core_tests_pigeon_test_host_integration_core_api_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiClass* klass) { +static void +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_enum_list_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableEnumListResponseClass* + klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_dispose; + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_enum_list_response_dispose; } -static CoreTestsPigeonTestHostIntegrationCoreApi* -core_tests_pigeon_test_host_integration_core_api_new( - const CoreTestsPigeonTestHostIntegrationCoreApiVTable* vtable, - gpointer user_data, GDestroyNotify user_data_free_func) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(g_object_new( - core_tests_pigeon_test_host_integration_core_api_get_type(), - nullptr)); - self->vtable = vtable; - self->user_data = user_data; - self->user_data_free_func = user_data_free_func; +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableEnumListResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_enum_list_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableEnumListResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_ENUM_LIST_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_enum_list_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, return_value != nullptr + ? fl_value_ref(return_value) + : fl_value_new_null()); return self; } -static void core_tests_pigeon_test_host_integration_core_api_noop_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); - - if (self->vtable == nullptr || self->vtable->noop == nullptr) { - return; - } - - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiNoopResponse) response = - self->vtable->noop(self->user_data); - if (response == nullptr) { - g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", - "noop"); - return; - } - - g_autoptr(GError) error = NULL; - if (!fl_basic_message_channel_respond(channel, response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "noop", error->message); - } +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableEnumListResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_enum_list_response_new_error( + const gchar* code, const gchar* message, FlValue* details) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableEnumListResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_ENUM_LIST_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_enum_list_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_string(code)); + fl_value_append_take(self->value, + fl_value_new_string(message != nullptr ? message : "")); + fl_value_append_take(self->value, details != nullptr ? fl_value_ref(details) + : fl_value_new_null()); + return self; } -static void core_tests_pigeon_test_host_integration_core_api_echo_all_types_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableClassListResponse, + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_class_list_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_CLASS_LIST_RESPONSE, GObject) - if (self->vtable == nullptr || self->vtable->echo_all_types == nullptr) { - return; - } +struct + _CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableClassListResponse { + GObject parent_instance; - FlValue* value0 = fl_value_get_list_value(message_, 0); - CoreTestsPigeonTestAllTypes* everything = CORE_TESTS_PIGEON_TEST_ALL_TYPES( - fl_value_get_custom_value_object(value0)); - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiEchoAllTypesResponse) - response = self->vtable->echo_all_types(everything, self->user_data); - if (response == nullptr) { - g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", - "echoAllTypes"); - return; - } + FlValue* value; +}; - g_autoptr(GError) error = NULL; - if (!fl_basic_message_channel_respond(channel, response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "echoAllTypes", error->message); - } +G_DEFINE_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableClassListResponse, + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_class_list_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_class_list_response_dispose( + GObject* object) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableClassListResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_CLASS_LIST_RESPONSE( + object); + g_clear_pointer(&self->value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_class_list_response_parent_class) + ->dispose(object); } -static void core_tests_pigeon_test_host_integration_core_api_throw_error_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); +static void +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_class_list_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableClassListResponse* + self) {} - if (self->vtable == nullptr || self->vtable->throw_error == nullptr) { - return; - } +static void +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_class_list_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableClassListResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_class_list_response_dispose; +} - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiThrowErrorResponse) - response = self->vtable->throw_error(self->user_data); - if (response == nullptr) { - g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", - "throwError"); - return; - } +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableClassListResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_class_list_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableClassListResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_CLASS_LIST_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_class_list_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, return_value != nullptr + ? fl_value_ref(return_value) + : fl_value_new_null()); + return self; +} - g_autoptr(GError) error = NULL; - if (!fl_basic_message_channel_respond(channel, response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "throwError", error->message); - } +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableClassListResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_class_list_response_new_error( + const gchar* code, const gchar* message, FlValue* details) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableClassListResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_CLASS_LIST_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_class_list_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_string(code)); + fl_value_append_take(self->value, + fl_value_new_string(message != nullptr ? message : "")); + fl_value_append_take(self->value, details != nullptr ? fl_value_ref(details) + : fl_value_new_null()); + return self; } -static void -core_tests_pigeon_test_host_integration_core_api_throw_error_from_void_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableMapResponse, + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_map_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_MAP_RESPONSE, GObject) - if (self->vtable == nullptr || - self->vtable->throw_error_from_void == nullptr) { - return; - } +struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableMapResponse { + GObject parent_instance; - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiThrowErrorFromVoidResponse) - response = self->vtable->throw_error_from_void(self->user_data); - if (response == nullptr) { - g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", - "throwErrorFromVoid"); - return; - } + FlValue* value; +}; - g_autoptr(GError) error = NULL; - if (!fl_basic_message_channel_respond(channel, response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "throwErrorFromVoid", error->message); - } +G_DEFINE_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableMapResponse, + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_map_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_map_response_dispose( + GObject* object) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_MAP_RESPONSE( + object); + g_clear_pointer(&self->value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_map_response_parent_class) + ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_throw_flutter_error_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_map_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableMapResponse* + self) {} - if (self->vtable == nullptr || self->vtable->throw_flutter_error == nullptr) { - return; - } +static void +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_map_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableMapResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_map_response_dispose; +} - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiThrowFlutterErrorResponse) - response = self->vtable->throw_flutter_error(self->user_data); - if (response == nullptr) { - g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", - "throwFlutterError"); - return; - } +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_map_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_MAP_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_map_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, return_value != nullptr + ? fl_value_ref(return_value) + : fl_value_new_null()); + return self; +} - g_autoptr(GError) error = NULL; - if (!fl_basic_message_channel_respond(channel, response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "throwFlutterError", error->message); - } +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_map_response_new_error( + const gchar* code, const gchar* message, FlValue* details) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_MAP_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_map_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_string(code)); + fl_value_append_take(self->value, + fl_value_new_string(message != nullptr ? message : "")); + fl_value_append_take(self->value, details != nullptr ? fl_value_ref(details) + : fl_value_new_null()); + return self; } -static void core_tests_pigeon_test_host_integration_core_api_echo_int_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableStringMapResponse, + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_string_map_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_STRING_MAP_RESPONSE, GObject) - if (self->vtable == nullptr || self->vtable->echo_int == nullptr) { - return; - } +struct + _CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableStringMapResponse { + GObject parent_instance; - FlValue* value0 = fl_value_get_list_value(message_, 0); - int64_t an_int = fl_value_get_int(value0); - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiEchoIntResponse) response = - self->vtable->echo_int(an_int, self->user_data); - if (response == nullptr) { - g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", - "echoInt"); - return; - } + FlValue* value; +}; - g_autoptr(GError) error = NULL; - if (!fl_basic_message_channel_respond(channel, response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "echoInt", error->message); - } +G_DEFINE_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableStringMapResponse, + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_string_map_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_string_map_response_dispose( + GObject* object) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableStringMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_STRING_MAP_RESPONSE( + object); + g_clear_pointer(&self->value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_string_map_response_parent_class) + ->dispose(object); } -static void core_tests_pigeon_test_host_integration_core_api_echo_double_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); +static void +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_string_map_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableStringMapResponse* + self) {} - if (self->vtable == nullptr || self->vtable->echo_double == nullptr) { - return; - } +static void +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_string_map_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableStringMapResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_string_map_response_dispose; +} - FlValue* value0 = fl_value_get_list_value(message_, 0); - double a_double = fl_value_get_float(value0); - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiEchoDoubleResponse) - response = self->vtable->echo_double(a_double, self->user_data); - if (response == nullptr) { - g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", - "echoDouble"); - return; - } +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableStringMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_string_map_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableStringMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_STRING_MAP_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_string_map_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, return_value != nullptr + ? fl_value_ref(return_value) + : fl_value_new_null()); + return self; +} - g_autoptr(GError) error = NULL; - if (!fl_basic_message_channel_respond(channel, response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "echoDouble", error->message); - } +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableStringMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_string_map_response_new_error( + const gchar* code, const gchar* message, FlValue* details) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableStringMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_STRING_MAP_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_string_map_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_string(code)); + fl_value_append_take(self->value, + fl_value_new_string(message != nullptr ? message : "")); + fl_value_append_take(self->value, details != nullptr ? fl_value_ref(details) + : fl_value_new_null()); + return self; } -static void core_tests_pigeon_test_host_integration_core_api_echo_bool_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableIntMapResponse, + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_int_map_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_INT_MAP_RESPONSE, GObject) - if (self->vtable == nullptr || self->vtable->echo_bool == nullptr) { - return; - } +struct + _CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableIntMapResponse { + GObject parent_instance; - FlValue* value0 = fl_value_get_list_value(message_, 0); - gboolean a_bool = fl_value_get_bool(value0); - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiEchoBoolResponse) - response = self->vtable->echo_bool(a_bool, self->user_data); - if (response == nullptr) { - g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", - "echoBool"); - return; - } + FlValue* value; +}; - g_autoptr(GError) error = NULL; - if (!fl_basic_message_channel_respond(channel, response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "echoBool", error->message); - } +G_DEFINE_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableIntMapResponse, + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_int_map_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_int_map_response_dispose( + GObject* object) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableIntMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_INT_MAP_RESPONSE( + object); + g_clear_pointer(&self->value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_int_map_response_parent_class) + ->dispose(object); } -static void core_tests_pigeon_test_host_integration_core_api_echo_string_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); +static void +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_int_map_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableIntMapResponse* + self) {} - if (self->vtable == nullptr || self->vtable->echo_string == nullptr) { - return; - } +static void +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_int_map_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableIntMapResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_int_map_response_dispose; +} - FlValue* value0 = fl_value_get_list_value(message_, 0); - const gchar* a_string = fl_value_get_string(value0); - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiEchoStringResponse) - response = self->vtable->echo_string(a_string, self->user_data); - if (response == nullptr) { - g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", - "echoString"); - return; - } +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableIntMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_int_map_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableIntMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_INT_MAP_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_int_map_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, return_value != nullptr + ? fl_value_ref(return_value) + : fl_value_new_null()); + return self; +} - g_autoptr(GError) error = NULL; - if (!fl_basic_message_channel_respond(channel, response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "echoString", error->message); - } +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableIntMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_int_map_response_new_error( + const gchar* code, const gchar* message, FlValue* details) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableIntMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_INT_MAP_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_int_map_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_string(code)); + fl_value_append_take(self->value, + fl_value_new_string(message != nullptr ? message : "")); + fl_value_append_take(self->value, details != nullptr ? fl_value_ref(details) + : fl_value_new_null()); + return self; } -static void core_tests_pigeon_test_host_integration_core_api_echo_uint8_list_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableEnumMapResponse, + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_enum_map_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_ENUM_MAP_RESPONSE, GObject) - if (self->vtable == nullptr || self->vtable->echo_uint8_list == nullptr) { - return; - } +struct + _CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableEnumMapResponse { + GObject parent_instance; - FlValue* value0 = fl_value_get_list_value(message_, 0); - const uint8_t* a_uint8_list = fl_value_get_uint8_list(value0); - size_t a_uint8_list_length = fl_value_get_length(value0); - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiEchoUint8ListResponse) - response = self->vtable->echo_uint8_list( - a_uint8_list, a_uint8_list_length, self->user_data); - if (response == nullptr) { - g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", - "echoUint8List"); - return; - } + FlValue* value; +}; - g_autoptr(GError) error = NULL; - if (!fl_basic_message_channel_respond(channel, response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "echoUint8List", error->message); - } +G_DEFINE_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableEnumMapResponse, + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_enum_map_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_enum_map_response_dispose( + GObject* object) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableEnumMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_ENUM_MAP_RESPONSE( + object); + g_clear_pointer(&self->value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_enum_map_response_parent_class) + ->dispose(object); } -static void core_tests_pigeon_test_host_integration_core_api_echo_object_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); +static void +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_enum_map_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableEnumMapResponse* + self) {} - if (self->vtable == nullptr || self->vtable->echo_object == nullptr) { - return; - } +static void +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_enum_map_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableEnumMapResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_enum_map_response_dispose; +} - FlValue* value0 = fl_value_get_list_value(message_, 0); - FlValue* an_object = value0; - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiEchoObjectResponse) - response = self->vtable->echo_object(an_object, self->user_data); - if (response == nullptr) { - g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", - "echoObject"); - return; - } +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableEnumMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_enum_map_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableEnumMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_ENUM_MAP_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_enum_map_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, return_value != nullptr + ? fl_value_ref(return_value) + : fl_value_new_null()); + return self; +} - g_autoptr(GError) error = NULL; - if (!fl_basic_message_channel_respond(channel, response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "echoObject", error->message); - } +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableEnumMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_enum_map_response_new_error( + const gchar* code, const gchar* message, FlValue* details) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableEnumMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_ENUM_MAP_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_enum_map_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_string(code)); + fl_value_append_take(self->value, + fl_value_new_string(message != nullptr ? message : "")); + fl_value_append_take(self->value, details != nullptr ? fl_value_ref(details) + : fl_value_new_null()); + return self; } -static void core_tests_pigeon_test_host_integration_core_api_echo_list_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableClassMapResponse, + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_class_map_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_CLASS_MAP_RESPONSE, GObject) - if (self->vtable == nullptr || self->vtable->echo_list == nullptr) { - return; - } +struct + _CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableClassMapResponse { + GObject parent_instance; - FlValue* value0 = fl_value_get_list_value(message_, 0); - FlValue* list = value0; - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiEchoListResponse) - response = self->vtable->echo_list(list, self->user_data); - if (response == nullptr) { - g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", - "echoList"); - return; - } + FlValue* value; +}; - g_autoptr(GError) error = NULL; - if (!fl_basic_message_channel_respond(channel, response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "echoList", error->message); - } +G_DEFINE_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableClassMapResponse, + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_class_map_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_class_map_response_dispose( + GObject* object) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableClassMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_CLASS_MAP_RESPONSE( + object); + g_clear_pointer(&self->value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_class_map_response_parent_class) + ->dispose(object); } -static void core_tests_pigeon_test_host_integration_core_api_echo_map_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); +static void +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_class_map_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableClassMapResponse* + self) {} - if (self->vtable == nullptr || self->vtable->echo_map == nullptr) { - return; - } +static void +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_class_map_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableClassMapResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_class_map_response_dispose; +} - FlValue* value0 = fl_value_get_list_value(message_, 0); - FlValue* a_map = value0; - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiEchoMapResponse) response = - self->vtable->echo_map(a_map, self->user_data); - if (response == nullptr) { - g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", - "echoMap"); - return; - } +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableClassMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_class_map_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableClassMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_CLASS_MAP_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_class_map_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, return_value != nullptr + ? fl_value_ref(return_value) + : fl_value_new_null()); + return self; +} - g_autoptr(GError) error = NULL; - if (!fl_basic_message_channel_respond(channel, response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "echoMap", error->message); - } +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableClassMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_class_map_response_new_error( + const gchar* code, const gchar* message, FlValue* details) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableClassMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_CLASS_MAP_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_class_map_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_string(code)); + fl_value_append_take(self->value, + fl_value_new_string(message != nullptr ? message : "")); + fl_value_append_take(self->value, details != nullptr ? fl_value_ref(details) + : fl_value_new_null()); + return self; } -static void -core_tests_pigeon_test_host_integration_core_api_echo_class_wrapper_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableEnumResponse, + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_enum_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_ENUM_RESPONSE, GObject) - if (self->vtable == nullptr || self->vtable->echo_class_wrapper == nullptr) { - return; - } +struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableEnumResponse { + GObject parent_instance; - FlValue* value0 = fl_value_get_list_value(message_, 0); - CoreTestsPigeonTestAllClassesWrapper* wrapper = - CORE_TESTS_PIGEON_TEST_ALL_CLASSES_WRAPPER( - fl_value_get_custom_value_object(value0)); - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiEchoClassWrapperResponse) - response = self->vtable->echo_class_wrapper(wrapper, self->user_data); - if (response == nullptr) { - g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", - "echoClassWrapper"); - return; - } + FlValue* value; +}; - g_autoptr(GError) error = NULL; - if (!fl_basic_message_channel_respond(channel, response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "echoClassWrapper", error->message); - } +G_DEFINE_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableEnumResponse, + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_enum_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_enum_response_dispose( + GObject* object) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableEnumResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_ENUM_RESPONSE( + object); + g_clear_pointer(&self->value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_enum_response_parent_class) + ->dispose(object); } -static void core_tests_pigeon_test_host_integration_core_api_echo_enum_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); +static void +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_enum_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableEnumResponse* + self) {} - if (self->vtable == nullptr || self->vtable->echo_enum == nullptr) { - return; - } +static void +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_enum_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableEnumResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_enum_response_dispose; +} - FlValue* value0 = fl_value_get_list_value(message_, 0); - CoreTestsPigeonTestAnEnum an_enum = static_cast( - fl_value_get_int(reinterpret_cast( - const_cast(fl_value_get_custom_value(value0))))); - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumResponse) - response = self->vtable->echo_enum(an_enum, self->user_data); - if (response == nullptr) { - g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", - "echoEnum"); - return; - } +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableEnumResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_enum_response_new( + CoreTestsPigeonTestAnEnum* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableEnumResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_ENUM_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_enum_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take( + self->value, + return_value != nullptr + ? fl_value_new_custom(129, fl_value_new_int(*return_value), + (GDestroyNotify)fl_value_unref) + : fl_value_new_null()); + return self; +} - g_autoptr(GError) error = NULL; - if (!fl_basic_message_channel_respond(channel, response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "echoEnum", error->message); - } +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableEnumResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_enum_response_new_error( + const gchar* code, const gchar* message, FlValue* details) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableEnumResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_ENUM_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_enum_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_string(code)); + fl_value_append_take(self->value, + fl_value_new_string(message != nullptr ? message : "")); + fl_value_append_take(self->value, details != nullptr ? fl_value_ref(details) + : fl_value_new_null()); + return self; } -static void -core_tests_pigeon_test_host_integration_core_api_echo_another_enum_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherAsyncNullableEnumResponse, + core_tests_pigeon_test_host_integration_core_api_echo_another_async_nullable_enum_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_ECHO_ANOTHER_ASYNC_NULLABLE_ENUM_RESPONSE, + GObject) - if (self->vtable == nullptr || self->vtable->echo_another_enum == nullptr) { - return; - } +struct + _CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherAsyncNullableEnumResponse { + GObject parent_instance; - FlValue* value0 = fl_value_get_list_value(message_, 0); - CoreTestsPigeonTestAnotherEnum another_enum = - static_cast( - fl_value_get_int(reinterpret_cast( - const_cast(fl_value_get_custom_value(value0))))); - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherEnumResponse) - response = self->vtable->echo_another_enum(another_enum, self->user_data); - if (response == nullptr) { - g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", - "echoAnotherEnum"); - return; - } + FlValue* value; +}; - g_autoptr(GError) error = NULL; - if (!fl_basic_message_channel_respond(channel, response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "echoAnotherEnum", error->message); - } +G_DEFINE_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherAsyncNullableEnumResponse, + core_tests_pigeon_test_host_integration_core_api_echo_another_async_nullable_enum_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_host_integration_core_api_echo_another_async_nullable_enum_response_dispose( + GObject* object) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherAsyncNullableEnumResponse* + self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ANOTHER_ASYNC_NULLABLE_ENUM_RESPONSE( + object); + g_clear_pointer(&self->value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_host_integration_core_api_echo_another_async_nullable_enum_response_parent_class) + ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_echo_named_default_string_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); +core_tests_pigeon_test_host_integration_core_api_echo_another_async_nullable_enum_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherAsyncNullableEnumResponse* + self) {} - if (self->vtable == nullptr || - self->vtable->echo_named_default_string == nullptr) { - return; - } +static void +core_tests_pigeon_test_host_integration_core_api_echo_another_async_nullable_enum_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherAsyncNullableEnumResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_host_integration_core_api_echo_another_async_nullable_enum_response_dispose; +} - FlValue* value0 = fl_value_get_list_value(message_, 0); - const gchar* a_string = fl_value_get_string(value0); - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiEchoNamedDefaultStringResponse) - response = - self->vtable->echo_named_default_string(a_string, self->user_data); - if (response == nullptr) { - g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", - "echoNamedDefaultString"); - return; - } +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherAsyncNullableEnumResponse* +core_tests_pigeon_test_host_integration_core_api_echo_another_async_nullable_enum_response_new( + CoreTestsPigeonTestAnotherEnum* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherAsyncNullableEnumResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ANOTHER_ASYNC_NULLABLE_ENUM_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_echo_another_async_nullable_enum_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take( + self->value, + return_value != nullptr + ? fl_value_new_custom(130, fl_value_new_int(*return_value), + (GDestroyNotify)fl_value_unref) + : fl_value_new_null()); + return self; +} - g_autoptr(GError) error = NULL; - if (!fl_basic_message_channel_respond(channel, response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "echoNamedDefaultString", error->message); - } +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherAsyncNullableEnumResponse* +core_tests_pigeon_test_host_integration_core_api_echo_another_async_nullable_enum_response_new_error( + const gchar* code, const gchar* message, FlValue* details) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherAsyncNullableEnumResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ANOTHER_ASYNC_NULLABLE_ENUM_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_echo_another_async_nullable_enum_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_string(code)); + fl_value_append_take(self->value, + fl_value_new_string(message != nullptr ? message : "")); + fl_value_append_take(self->value, details != nullptr ? fl_value_ref(details) + : fl_value_new_null()); + return self; } -static void -core_tests_pigeon_test_host_integration_core_api_echo_optional_default_double_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterNoopResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_noop_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_CALL_FLUTTER_NOOP_RESPONSE, GObject) - if (self->vtable == nullptr || - self->vtable->echo_optional_default_double == nullptr) { - return; - } +struct _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterNoopResponse { + GObject parent_instance; - FlValue* value0 = fl_value_get_list_value(message_, 0); - double a_double = fl_value_get_float(value0); - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiEchoOptionalDefaultDoubleResponse) - response = - self->vtable->echo_optional_default_double(a_double, self->user_data); - if (response == nullptr) { - g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", - "echoOptionalDefaultDouble"); - return; - } + FlValue* value; +}; - g_autoptr(GError) error = NULL; - if (!fl_basic_message_channel_respond(channel, response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "echoOptionalDefaultDouble", error->message); - } +G_DEFINE_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterNoopResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_noop_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_noop_response_dispose( + GObject* object) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterNoopResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_NOOP_RESPONSE( + object); + g_clear_pointer(&self->value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_host_integration_core_api_call_flutter_noop_response_parent_class) + ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_echo_required_int_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); +core_tests_pigeon_test_host_integration_core_api_call_flutter_noop_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterNoopResponse* self) {} - if (self->vtable == nullptr || self->vtable->echo_required_int == nullptr) { - return; - } +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_noop_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterNoopResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_host_integration_core_api_call_flutter_noop_response_dispose; +} - FlValue* value0 = fl_value_get_list_value(message_, 0); - int64_t an_int = fl_value_get_int(value0); - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiEchoRequiredIntResponse) - response = self->vtable->echo_required_int(an_int, self->user_data); - if (response == nullptr) { - g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", - "echoRequiredInt"); - return; - } +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterNoopResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_noop_response_new() { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterNoopResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_NOOP_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_noop_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_null()); + return self; +} - g_autoptr(GError) error = NULL; - if (!fl_basic_message_channel_respond(channel, response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "echoRequiredInt", error->message); - } +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterNoopResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_noop_response_new_error( + const gchar* code, const gchar* message, FlValue* details) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterNoopResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_NOOP_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_noop_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_string(code)); + fl_value_append_take(self->value, + fl_value_new_string(message != nullptr ? message : "")); + fl_value_append_take(self->value, details != nullptr ? fl_value_ref(details) + : fl_value_new_null()); + return self; } -static void -core_tests_pigeon_test_host_integration_core_api_echo_all_nullable_types_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterThrowErrorResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_throw_error_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_CALL_FLUTTER_THROW_ERROR_RESPONSE, GObject) - if (self->vtable == nullptr || - self->vtable->echo_all_nullable_types == nullptr) { - return; - } +struct _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterThrowErrorResponse { + GObject parent_instance; - FlValue* value0 = fl_value_get_list_value(message_, 0); - CoreTestsPigeonTestAllNullableTypes* everything = - CORE_TESTS_PIGEON_TEST_ALL_NULLABLE_TYPES( - fl_value_get_custom_value_object(value0)); - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAllNullableTypesResponse) - response = - self->vtable->echo_all_nullable_types(everything, self->user_data); - if (response == nullptr) { - g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", - "echoAllNullableTypes"); - return; - } + FlValue* value; +}; - g_autoptr(GError) error = NULL; - if (!fl_basic_message_channel_respond(channel, response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "echoAllNullableTypes", error->message); - } +G_DEFINE_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterThrowErrorResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_throw_error_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_throw_error_response_dispose( + GObject* object) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterThrowErrorResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_THROW_ERROR_RESPONSE( + object); + g_clear_pointer(&self->value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_host_integration_core_api_call_flutter_throw_error_response_parent_class) + ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_echo_all_nullable_types_without_recursion_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); +core_tests_pigeon_test_host_integration_core_api_call_flutter_throw_error_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterThrowErrorResponse* + self) {} - if (self->vtable == nullptr || - self->vtable->echo_all_nullable_types_without_recursion == nullptr) { - return; - } +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_throw_error_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterThrowErrorResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_host_integration_core_api_call_flutter_throw_error_response_dispose; +} - FlValue* value0 = fl_value_get_list_value(message_, 0); - CoreTestsPigeonTestAllNullableTypesWithoutRecursion* everything = - CORE_TESTS_PIGEON_TEST_ALL_NULLABLE_TYPES_WITHOUT_RECURSION( - fl_value_get_custom_value_object(value0)); - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponse) - response = self->vtable->echo_all_nullable_types_without_recursion( - everything, self->user_data); - if (response == nullptr) { - g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", - "echoAllNullableTypesWithoutRecursion"); - return; - } +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterThrowErrorResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_throw_error_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterThrowErrorResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_THROW_ERROR_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_throw_error_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, return_value != nullptr + ? fl_value_ref(return_value) + : fl_value_new_null()); + return self; +} - g_autoptr(GError) error = NULL; - if (!fl_basic_message_channel_respond(channel, response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "echoAllNullableTypesWithoutRecursion", error->message); - } +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterThrowErrorResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_throw_error_response_new_error( + const gchar* code, const gchar* message, FlValue* details) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterThrowErrorResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_THROW_ERROR_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_throw_error_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_string(code)); + fl_value_append_take(self->value, + fl_value_new_string(message != nullptr ? message : "")); + fl_value_append_take(self->value, details != nullptr ? fl_value_ref(details) + : fl_value_new_null()); + return self; } -static void -core_tests_pigeon_test_host_integration_core_api_extract_nested_nullable_string_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterThrowErrorFromVoidResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_throw_error_from_void_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_CALL_FLUTTER_THROW_ERROR_FROM_VOID_RESPONSE, + GObject) - if (self->vtable == nullptr || - self->vtable->extract_nested_nullable_string == nullptr) { - return; - } +struct + _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterThrowErrorFromVoidResponse { + GObject parent_instance; - FlValue* value0 = fl_value_get_list_value(message_, 0); - CoreTestsPigeonTestAllClassesWrapper* wrapper = - CORE_TESTS_PIGEON_TEST_ALL_CLASSES_WRAPPER( - fl_value_get_custom_value_object(value0)); - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiExtractNestedNullableStringResponse) - response = self->vtable->extract_nested_nullable_string(wrapper, - self->user_data); - if (response == nullptr) { - g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", - "extractNestedNullableString"); - return; - } + FlValue* value; +}; - g_autoptr(GError) error = NULL; - if (!fl_basic_message_channel_respond(channel, response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "extractNestedNullableString", error->message); - } +G_DEFINE_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterThrowErrorFromVoidResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_throw_error_from_void_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_throw_error_from_void_response_dispose( + GObject* object) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterThrowErrorFromVoidResponse* + self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_THROW_ERROR_FROM_VOID_RESPONSE( + object); + g_clear_pointer(&self->value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_host_integration_core_api_call_flutter_throw_error_from_void_response_parent_class) + ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_create_nested_nullable_string_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); +core_tests_pigeon_test_host_integration_core_api_call_flutter_throw_error_from_void_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterThrowErrorFromVoidResponse* + self) {} - if (self->vtable == nullptr || - self->vtable->create_nested_nullable_string == nullptr) { - return; - } +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_throw_error_from_void_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterThrowErrorFromVoidResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_host_integration_core_api_call_flutter_throw_error_from_void_response_dispose; +} - FlValue* value0 = fl_value_get_list_value(message_, 0); - const gchar* nullable_string = fl_value_get_string(value0); - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiCreateNestedNullableStringResponse) - response = self->vtable->create_nested_nullable_string(nullable_string, - self->user_data); - if (response == nullptr) { - g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", - "createNestedNullableString"); - return; - } +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterThrowErrorFromVoidResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_throw_error_from_void_response_new() { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterThrowErrorFromVoidResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_THROW_ERROR_FROM_VOID_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_throw_error_from_void_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_null()); + return self; +} - g_autoptr(GError) error = NULL; - if (!fl_basic_message_channel_respond(channel, response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "createNestedNullableString", error->message); - } +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterThrowErrorFromVoidResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_throw_error_from_void_response_new_error( + const gchar* code, const gchar* message, FlValue* details) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterThrowErrorFromVoidResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_THROW_ERROR_FROM_VOID_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_throw_error_from_void_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_string(code)); + fl_value_append_take(self->value, + fl_value_new_string(message != nullptr ? message : "")); + fl_value_append_take(self->value, details != nullptr ? fl_value_ref(details) + : fl_value_new_null()); + return self; } -static void -core_tests_pigeon_test_host_integration_core_api_send_multiple_nullable_types_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAllTypesResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_types_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_ALL_TYPES_RESPONSE, GObject) - if (self->vtable == nullptr || - self->vtable->send_multiple_nullable_types == nullptr) { - return; - } +struct + _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAllTypesResponse { + GObject parent_instance; - FlValue* value0 = fl_value_get_list_value(message_, 0); - gboolean* a_nullable_bool = nullptr; - gboolean a_nullable_bool_value; - if (fl_value_get_type(value0) != FL_VALUE_TYPE_NULL) { - a_nullable_bool_value = fl_value_get_bool(value0); - a_nullable_bool = &a_nullable_bool_value; - } - FlValue* value1 = fl_value_get_list_value(message_, 1); - int64_t* a_nullable_int = nullptr; - int64_t a_nullable_int_value; - if (fl_value_get_type(value1) != FL_VALUE_TYPE_NULL) { - a_nullable_int_value = fl_value_get_int(value1); - a_nullable_int = &a_nullable_int_value; - } - FlValue* value2 = fl_value_get_list_value(message_, 2); - const gchar* a_nullable_string = fl_value_get_string(value2); - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiSendMultipleNullableTypesResponse) - response = self->vtable->send_multiple_nullable_types( - a_nullable_bool, a_nullable_int, a_nullable_string, self->user_data); - if (response == nullptr) { - g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", - "sendMultipleNullableTypes"); - return; - } + FlValue* value; +}; - g_autoptr(GError) error = NULL; - if (!fl_basic_message_channel_respond(channel, response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "sendMultipleNullableTypes", error->message); - } +G_DEFINE_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAllTypesResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_types_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_types_response_dispose( + GObject* object) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAllTypesResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_ALL_TYPES_RESPONSE( + object); + g_clear_pointer(&self->value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_types_response_parent_class) + ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_send_multiple_nullable_types_without_recursion_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_types_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAllTypesResponse* + self) {} - if (self->vtable == nullptr || - self->vtable->send_multiple_nullable_types_without_recursion == nullptr) { - return; - } +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_types_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAllTypesResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_types_response_dispose; +} - FlValue* value0 = fl_value_get_list_value(message_, 0); - gboolean* a_nullable_bool = nullptr; - gboolean a_nullable_bool_value; - if (fl_value_get_type(value0) != FL_VALUE_TYPE_NULL) { - a_nullable_bool_value = fl_value_get_bool(value0); - a_nullable_bool = &a_nullable_bool_value; - } - FlValue* value1 = fl_value_get_list_value(message_, 1); - int64_t* a_nullable_int = nullptr; - int64_t a_nullable_int_value; - if (fl_value_get_type(value1) != FL_VALUE_TYPE_NULL) { - a_nullable_int_value = fl_value_get_int(value1); - a_nullable_int = &a_nullable_int_value; - } - FlValue* value2 = fl_value_get_list_value(message_, 2); - const gchar* a_nullable_string = fl_value_get_string(value2); - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponse) - response = self->vtable->send_multiple_nullable_types_without_recursion( - a_nullable_bool, a_nullable_int, a_nullable_string, self->user_data); - if (response == nullptr) { - g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", - "sendMultipleNullableTypesWithoutRecursion"); - return; - } +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAllTypesResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_types_response_new( + CoreTestsPigeonTestAllTypes* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAllTypesResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_ALL_TYPES_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_types_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, + fl_value_new_custom_object(132, G_OBJECT(return_value))); + return self; +} - g_autoptr(GError) error = NULL; - if (!fl_basic_message_channel_respond(channel, response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "sendMultipleNullableTypesWithoutRecursion", error->message); - } +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAllTypesResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_types_response_new_error( + const gchar* code, const gchar* message, FlValue* details) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAllTypesResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_ALL_TYPES_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_types_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_string(code)); + fl_value_append_take(self->value, + fl_value_new_string(message != nullptr ? message : "")); + fl_value_append_take(self->value, details != nullptr ? fl_value_ref(details) + : fl_value_new_null()); + return self; } -static void -core_tests_pigeon_test_host_integration_core_api_echo_nullable_int_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAllNullableTypesResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_nullable_types_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_ALL_NULLABLE_TYPES_RESPONSE, + GObject) - if (self->vtable == nullptr || self->vtable->echo_nullable_int == nullptr) { - return; - } +struct + _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAllNullableTypesResponse { + GObject parent_instance; - FlValue* value0 = fl_value_get_list_value(message_, 0); - int64_t* a_nullable_int = nullptr; - int64_t a_nullable_int_value; - if (fl_value_get_type(value0) != FL_VALUE_TYPE_NULL) { - a_nullable_int_value = fl_value_get_int(value0); - a_nullable_int = &a_nullable_int_value; - } - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableIntResponse) - response = - self->vtable->echo_nullable_int(a_nullable_int, self->user_data); - if (response == nullptr) { - g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", - "echoNullableInt"); - return; - } + FlValue* value; +}; - g_autoptr(GError) error = NULL; - if (!fl_basic_message_channel_respond(channel, response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "echoNullableInt", error->message); - } -} +G_DEFINE_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAllNullableTypesResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_nullable_types_response, + G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_echo_nullable_double_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); - - if (self->vtable == nullptr || - self->vtable->echo_nullable_double == nullptr) { - return; - } - - FlValue* value0 = fl_value_get_list_value(message_, 0); - double* a_nullable_double = nullptr; - double a_nullable_double_value; - if (fl_value_get_type(value0) != FL_VALUE_TYPE_NULL) { - a_nullable_double_value = fl_value_get_float(value0); - a_nullable_double = &a_nullable_double_value; - } - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableDoubleResponse) - response = self->vtable->echo_nullable_double(a_nullable_double, - self->user_data); - if (response == nullptr) { - g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", - "echoNullableDouble"); - return; - } - - g_autoptr(GError) error = NULL; - if (!fl_basic_message_channel_respond(channel, response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "echoNullableDouble", error->message); - } +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_nullable_types_response_dispose( + GObject* object) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAllNullableTypesResponse* + self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_ALL_NULLABLE_TYPES_RESPONSE( + object); + g_clear_pointer(&self->value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_nullable_types_response_parent_class) + ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_echo_nullable_bool_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_nullable_types_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAllNullableTypesResponse* + self) {} - if (self->vtable == nullptr || self->vtable->echo_nullable_bool == nullptr) { - return; - } +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_nullable_types_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAllNullableTypesResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_nullable_types_response_dispose; +} - FlValue* value0 = fl_value_get_list_value(message_, 0); - gboolean* a_nullable_bool = nullptr; - gboolean a_nullable_bool_value; - if (fl_value_get_type(value0) != FL_VALUE_TYPE_NULL) { - a_nullable_bool_value = fl_value_get_bool(value0); - a_nullable_bool = &a_nullable_bool_value; - } - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableBoolResponse) - response = - self->vtable->echo_nullable_bool(a_nullable_bool, self->user_data); - if (response == nullptr) { - g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", - "echoNullableBool"); - return; - } +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAllNullableTypesResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_nullable_types_response_new( + CoreTestsPigeonTestAllNullableTypes* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAllNullableTypesResponse* + self = CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_ALL_NULLABLE_TYPES_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_nullable_types_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take( + self->value, return_value != nullptr + ? fl_value_new_custom_object(133, G_OBJECT(return_value)) + : fl_value_new_null()); + return self; +} - g_autoptr(GError) error = NULL; - if (!fl_basic_message_channel_respond(channel, response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "echoNullableBool", error->message); - } +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAllNullableTypesResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_nullable_types_response_new_error( + const gchar* code, const gchar* message, FlValue* details) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAllNullableTypesResponse* + self = CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_ALL_NULLABLE_TYPES_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_nullable_types_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_string(code)); + fl_value_append_take(self->value, + fl_value_new_string(message != nullptr ? message : "")); + fl_value_append_take(self->value, details != nullptr ? fl_value_ref(details) + : fl_value_new_null()); + return self; } -static void -core_tests_pigeon_test_host_integration_core_api_echo_nullable_string_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterSendMultipleNullableTypesResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_send_multiple_nullable_types_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_CALL_FLUTTER_SEND_MULTIPLE_NULLABLE_TYPES_RESPONSE, + GObject) - if (self->vtable == nullptr || - self->vtable->echo_nullable_string == nullptr) { - return; - } +struct + _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterSendMultipleNullableTypesResponse { + GObject parent_instance; - FlValue* value0 = fl_value_get_list_value(message_, 0); - const gchar* a_nullable_string = fl_value_get_string(value0); - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableStringResponse) - response = self->vtable->echo_nullable_string(a_nullable_string, - self->user_data); - if (response == nullptr) { - g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", - "echoNullableString"); - return; - } + FlValue* value; +}; - g_autoptr(GError) error = NULL; - if (!fl_basic_message_channel_respond(channel, response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "echoNullableString", error->message); - } +G_DEFINE_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterSendMultipleNullableTypesResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_send_multiple_nullable_types_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_send_multiple_nullable_types_response_dispose( + GObject* object) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterSendMultipleNullableTypesResponse* + self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_SEND_MULTIPLE_NULLABLE_TYPES_RESPONSE( + object); + g_clear_pointer(&self->value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_host_integration_core_api_call_flutter_send_multiple_nullable_types_response_parent_class) + ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_echo_nullable_uint8_list_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); +core_tests_pigeon_test_host_integration_core_api_call_flutter_send_multiple_nullable_types_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterSendMultipleNullableTypesResponse* + self) {} - if (self->vtable == nullptr || - self->vtable->echo_nullable_uint8_list == nullptr) { - return; - } +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_send_multiple_nullable_types_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterSendMultipleNullableTypesResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_host_integration_core_api_call_flutter_send_multiple_nullable_types_response_dispose; +} - FlValue* value0 = fl_value_get_list_value(message_, 0); - const uint8_t* a_nullable_uint8_list = fl_value_get_uint8_list(value0); - size_t a_nullable_uint8_list_length = fl_value_get_length(value0); - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableUint8ListResponse) - response = self->vtable->echo_nullable_uint8_list( - a_nullable_uint8_list, a_nullable_uint8_list_length, self->user_data); - if (response == nullptr) { - g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", - "echoNullableUint8List"); - return; - } +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterSendMultipleNullableTypesResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_send_multiple_nullable_types_response_new( + CoreTestsPigeonTestAllNullableTypes* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterSendMultipleNullableTypesResponse* + self = CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_SEND_MULTIPLE_NULLABLE_TYPES_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_send_multiple_nullable_types_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, + fl_value_new_custom_object(133, G_OBJECT(return_value))); + return self; +} - g_autoptr(GError) error = NULL; - if (!fl_basic_message_channel_respond(channel, response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "echoNullableUint8List", error->message); - } +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterSendMultipleNullableTypesResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_send_multiple_nullable_types_response_new_error( + const gchar* code, const gchar* message, FlValue* details) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterSendMultipleNullableTypesResponse* + self = CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_SEND_MULTIPLE_NULLABLE_TYPES_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_send_multiple_nullable_types_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_string(code)); + fl_value_append_take(self->value, + fl_value_new_string(message != nullptr ? message : "")); + fl_value_append_take(self->value, details != nullptr ? fl_value_ref(details) + : fl_value_new_null()); + return self; } -static void -core_tests_pigeon_test_host_integration_core_api_echo_nullable_object_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAllNullableTypesWithoutRecursionResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_nullable_types_without_recursion_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_ALL_NULLABLE_TYPES_WITHOUT_RECURSION_RESPONSE, + GObject) - if (self->vtable == nullptr || - self->vtable->echo_nullable_object == nullptr) { - return; - } +struct + _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAllNullableTypesWithoutRecursionResponse { + GObject parent_instance; - FlValue* value0 = fl_value_get_list_value(message_, 0); - FlValue* a_nullable_object = value0; - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableObjectResponse) - response = self->vtable->echo_nullable_object(a_nullable_object, - self->user_data); - if (response == nullptr) { - g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", - "echoNullableObject"); - return; - } + FlValue* value; +}; - g_autoptr(GError) error = NULL; - if (!fl_basic_message_channel_respond(channel, response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "echoNullableObject", error->message); - } +G_DEFINE_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAllNullableTypesWithoutRecursionResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_nullable_types_without_recursion_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_nullable_types_without_recursion_response_dispose( + GObject* object) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAllNullableTypesWithoutRecursionResponse* + self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_ALL_NULLABLE_TYPES_WITHOUT_RECURSION_RESPONSE( + object); + g_clear_pointer(&self->value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_nullable_types_without_recursion_response_parent_class) + ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_echo_nullable_list_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_nullable_types_without_recursion_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAllNullableTypesWithoutRecursionResponse* + self) {} - if (self->vtable == nullptr || self->vtable->echo_nullable_list == nullptr) { - return; - } +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_nullable_types_without_recursion_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAllNullableTypesWithoutRecursionResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_nullable_types_without_recursion_response_dispose; +} - FlValue* value0 = fl_value_get_list_value(message_, 0); - FlValue* a_nullable_list = value0; - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableListResponse) - response = - self->vtable->echo_nullable_list(a_nullable_list, self->user_data); - if (response == nullptr) { - g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", - "echoNullableList"); - return; - } +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAllNullableTypesWithoutRecursionResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_nullable_types_without_recursion_response_new( + CoreTestsPigeonTestAllNullableTypesWithoutRecursion* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAllNullableTypesWithoutRecursionResponse* + self = CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_ALL_NULLABLE_TYPES_WITHOUT_RECURSION_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_nullable_types_without_recursion_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take( + self->value, return_value != nullptr + ? fl_value_new_custom_object(134, G_OBJECT(return_value)) + : fl_value_new_null()); + return self; +} - g_autoptr(GError) error = NULL; - if (!fl_basic_message_channel_respond(channel, response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "echoNullableList", error->message); - } +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAllNullableTypesWithoutRecursionResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_nullable_types_without_recursion_response_new_error( + const gchar* code, const gchar* message, FlValue* details) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAllNullableTypesWithoutRecursionResponse* + self = CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_ALL_NULLABLE_TYPES_WITHOUT_RECURSION_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_nullable_types_without_recursion_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_string(code)); + fl_value_append_take(self->value, + fl_value_new_string(message != nullptr ? message : "")); + fl_value_append_take(self->value, details != nullptr ? fl_value_ref(details) + : fl_value_new_null()); + return self; } -static void -core_tests_pigeon_test_host_integration_core_api_echo_nullable_map_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterSendMultipleNullableTypesWithoutRecursionResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_send_multiple_nullable_types_without_recursion_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_CALL_FLUTTER_SEND_MULTIPLE_NULLABLE_TYPES_WITHOUT_RECURSION_RESPONSE, + GObject) - if (self->vtable == nullptr || self->vtable->echo_nullable_map == nullptr) { - return; - } +struct + _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterSendMultipleNullableTypesWithoutRecursionResponse { + GObject parent_instance; - FlValue* value0 = fl_value_get_list_value(message_, 0); - FlValue* a_nullable_map = value0; - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableMapResponse) - response = - self->vtable->echo_nullable_map(a_nullable_map, self->user_data); - if (response == nullptr) { - g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", - "echoNullableMap"); - return; - } + FlValue* value; +}; - g_autoptr(GError) error = NULL; - if (!fl_basic_message_channel_respond(channel, response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "echoNullableMap", error->message); - } +G_DEFINE_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterSendMultipleNullableTypesWithoutRecursionResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_send_multiple_nullable_types_without_recursion_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_send_multiple_nullable_types_without_recursion_response_dispose( + GObject* object) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterSendMultipleNullableTypesWithoutRecursionResponse* + self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_SEND_MULTIPLE_NULLABLE_TYPES_WITHOUT_RECURSION_RESPONSE( + object); + g_clear_pointer(&self->value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_host_integration_core_api_call_flutter_send_multiple_nullable_types_without_recursion_response_parent_class) + ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_echo_nullable_enum_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); +core_tests_pigeon_test_host_integration_core_api_call_flutter_send_multiple_nullable_types_without_recursion_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterSendMultipleNullableTypesWithoutRecursionResponse* + self) {} - if (self->vtable == nullptr || self->vtable->echo_nullable_enum == nullptr) { - return; - } +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_send_multiple_nullable_types_without_recursion_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterSendMultipleNullableTypesWithoutRecursionResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_host_integration_core_api_call_flutter_send_multiple_nullable_types_without_recursion_response_dispose; +} - FlValue* value0 = fl_value_get_list_value(message_, 0); - CoreTestsPigeonTestAnEnum* an_enum = nullptr; - CoreTestsPigeonTestAnEnum an_enum_value; - if (fl_value_get_type(value0) != FL_VALUE_TYPE_NULL) { - an_enum_value = static_cast( - fl_value_get_int(reinterpret_cast( - const_cast(fl_value_get_custom_value(value0))))); - an_enum = &an_enum_value; - } - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableEnumResponse) - response = self->vtable->echo_nullable_enum(an_enum, self->user_data); - if (response == nullptr) { - g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", - "echoNullableEnum"); - return; - } +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterSendMultipleNullableTypesWithoutRecursionResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_send_multiple_nullable_types_without_recursion_response_new( + CoreTestsPigeonTestAllNullableTypesWithoutRecursion* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterSendMultipleNullableTypesWithoutRecursionResponse* + self = CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_SEND_MULTIPLE_NULLABLE_TYPES_WITHOUT_RECURSION_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_send_multiple_nullable_types_without_recursion_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, + fl_value_new_custom_object(134, G_OBJECT(return_value))); + return self; +} - g_autoptr(GError) error = NULL; - if (!fl_basic_message_channel_respond(channel, response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "echoNullableEnum", error->message); - } +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterSendMultipleNullableTypesWithoutRecursionResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_send_multiple_nullable_types_without_recursion_response_new_error( + const gchar* code, const gchar* message, FlValue* details) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterSendMultipleNullableTypesWithoutRecursionResponse* + self = CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_SEND_MULTIPLE_NULLABLE_TYPES_WITHOUT_RECURSION_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_send_multiple_nullable_types_without_recursion_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_string(code)); + fl_value_append_take(self->value, + fl_value_new_string(message != nullptr ? message : "")); + fl_value_append_take(self->value, details != nullptr ? fl_value_ref(details) + : fl_value_new_null()); + return self; } -static void -core_tests_pigeon_test_host_integration_core_api_echo_another_nullable_enum_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoBoolResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_bool_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_BOOL_RESPONSE, GObject) - if (self->vtable == nullptr || - self->vtable->echo_another_nullable_enum == nullptr) { - return; - } +struct _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoBoolResponse { + GObject parent_instance; - FlValue* value0 = fl_value_get_list_value(message_, 0); - CoreTestsPigeonTestAnotherEnum* another_enum = nullptr; - CoreTestsPigeonTestAnotherEnum another_enum_value; - if (fl_value_get_type(value0) != FL_VALUE_TYPE_NULL) { - another_enum_value = static_cast( - fl_value_get_int(reinterpret_cast( - const_cast(fl_value_get_custom_value(value0))))); - another_enum = &another_enum_value; - } - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherNullableEnumResponse) - response = self->vtable->echo_another_nullable_enum(another_enum, - self->user_data); - if (response == nullptr) { - g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", - "echoAnotherNullableEnum"); - return; - } + FlValue* value; +}; - g_autoptr(GError) error = NULL; - if (!fl_basic_message_channel_respond(channel, response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "echoAnotherNullableEnum", error->message); - } -} +G_DEFINE_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoBoolResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_bool_response, + G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_echo_optional_nullable_int_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); - - if (self->vtable == nullptr || - self->vtable->echo_optional_nullable_int == nullptr) { - return; - } - - FlValue* value0 = fl_value_get_list_value(message_, 0); - int64_t* a_nullable_int = nullptr; - int64_t a_nullable_int_value; - if (fl_value_get_type(value0) != FL_VALUE_TYPE_NULL) { - a_nullable_int_value = fl_value_get_int(value0); - a_nullable_int = &a_nullable_int_value; - } - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiEchoOptionalNullableIntResponse) - response = self->vtable->echo_optional_nullable_int(a_nullable_int, - self->user_data); - if (response == nullptr) { - g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", - "echoOptionalNullableInt"); - return; - } - - g_autoptr(GError) error = NULL; - if (!fl_basic_message_channel_respond(channel, response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "echoOptionalNullableInt", error->message); - } +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_bool_response_dispose( + GObject* object) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoBoolResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_BOOL_RESPONSE( + object); + g_clear_pointer(&self->value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_bool_response_parent_class) + ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_echo_named_nullable_string_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); - - if (self->vtable == nullptr || - self->vtable->echo_named_nullable_string == nullptr) { - return; - } +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_bool_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoBoolResponse* + self) {} - FlValue* value0 = fl_value_get_list_value(message_, 0); - const gchar* a_nullable_string = fl_value_get_string(value0); - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiEchoNamedNullableStringResponse) - response = self->vtable->echo_named_nullable_string(a_nullable_string, - self->user_data); - if (response == nullptr) { - g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", - "echoNamedNullableString"); - return; - } +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_bool_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoBoolResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_bool_response_dispose; +} - g_autoptr(GError) error = NULL; - if (!fl_basic_message_channel_respond(channel, response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "echoNamedNullableString", error->message); - } +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoBoolResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_bool_response_new( + gboolean return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoBoolResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_BOOL_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_bool_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_bool(return_value)); + return self; } -static void core_tests_pigeon_test_host_integration_core_api_noop_async_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoBoolResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_bool_response_new_error( + const gchar* code, const gchar* message, FlValue* details) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoBoolResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_BOOL_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_bool_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_string(code)); + fl_value_append_take(self->value, + fl_value_new_string(message != nullptr ? message : "")); + fl_value_append_take(self->value, details != nullptr ? fl_value_ref(details) + : fl_value_new_null()); + return self; +} - if (self->vtable == nullptr || self->vtable->noop_async == nullptr) { - return; - } +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoIntResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_int_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_INT_RESPONSE, GObject) - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = - core_tests_pigeon_test_host_integration_core_api_response_handle_new( - channel, response_handle); - self->vtable->noop_async(handle, self->user_data); -} +struct _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoIntResponse { + GObject parent_instance; -static void core_tests_pigeon_test_host_integration_core_api_echo_async_int_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + FlValue* value; +}; - if (self->vtable == nullptr || self->vtable->echo_async_int == nullptr) { - return; - } +G_DEFINE_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoIntResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_int_response, + G_TYPE_OBJECT) - FlValue* value0 = fl_value_get_list_value(message_, 0); - int64_t an_int = fl_value_get_int(value0); - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = - core_tests_pigeon_test_host_integration_core_api_response_handle_new( - channel, response_handle); - self->vtable->echo_async_int(an_int, handle, self->user_data); +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_int_response_dispose( + GObject* object) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoIntResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_INT_RESPONSE( + object); + g_clear_pointer(&self->value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_int_response_parent_class) + ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_echo_async_double_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_int_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoIntResponse* self) { +} - if (self->vtable == nullptr || self->vtable->echo_async_double == nullptr) { - return; - } - - FlValue* value0 = fl_value_get_list_value(message_, 0); - double a_double = fl_value_get_float(value0); - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = - core_tests_pigeon_test_host_integration_core_api_response_handle_new( - channel, response_handle); - self->vtable->echo_async_double(a_double, handle, self->user_data); +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_int_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoIntResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_int_response_dispose; } -static void core_tests_pigeon_test_host_integration_core_api_echo_async_bool_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); - - if (self->vtable == nullptr || self->vtable->echo_async_bool == nullptr) { - return; - } - - FlValue* value0 = fl_value_get_list_value(message_, 0); - gboolean a_bool = fl_value_get_bool(value0); - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = - core_tests_pigeon_test_host_integration_core_api_response_handle_new( - channel, response_handle); - self->vtable->echo_async_bool(a_bool, handle, self->user_data); +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoIntResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_int_response_new( + int64_t return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoIntResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_INT_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_int_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_int(return_value)); + return self; } -static void -core_tests_pigeon_test_host_integration_core_api_echo_async_string_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoIntResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_int_response_new_error( + const gchar* code, const gchar* message, FlValue* details) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoIntResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_INT_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_int_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_string(code)); + fl_value_append_take(self->value, + fl_value_new_string(message != nullptr ? message : "")); + fl_value_append_take(self->value, details != nullptr ? fl_value_ref(details) + : fl_value_new_null()); + return self; +} - if (self->vtable == nullptr || self->vtable->echo_async_string == nullptr) { - return; - } +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoDoubleResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_double_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_DOUBLE_RESPONSE, GObject) - FlValue* value0 = fl_value_get_list_value(message_, 0); - const gchar* a_string = fl_value_get_string(value0); - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = - core_tests_pigeon_test_host_integration_core_api_response_handle_new( - channel, response_handle); - self->vtable->echo_async_string(a_string, handle, self->user_data); -} +struct _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoDoubleResponse { + GObject parent_instance; -static void -core_tests_pigeon_test_host_integration_core_api_echo_async_uint8_list_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + FlValue* value; +}; - if (self->vtable == nullptr || - self->vtable->echo_async_uint8_list == nullptr) { - return; - } +G_DEFINE_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoDoubleResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_double_response, + G_TYPE_OBJECT) - FlValue* value0 = fl_value_get_list_value(message_, 0); - const uint8_t* a_uint8_list = fl_value_get_uint8_list(value0); - size_t a_uint8_list_length = fl_value_get_length(value0); - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = - core_tests_pigeon_test_host_integration_core_api_response_handle_new( - channel, response_handle); - self->vtable->echo_async_uint8_list(a_uint8_list, a_uint8_list_length, handle, - self->user_data); +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_double_response_dispose( + GObject* object) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoDoubleResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_DOUBLE_RESPONSE( + object); + g_clear_pointer(&self->value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_double_response_parent_class) + ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_echo_async_object_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); - - if (self->vtable == nullptr || self->vtable->echo_async_object == nullptr) { - return; - } +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_double_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoDoubleResponse* + self) {} - FlValue* value0 = fl_value_get_list_value(message_, 0); - FlValue* an_object = value0; - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = - core_tests_pigeon_test_host_integration_core_api_response_handle_new( - channel, response_handle); - self->vtable->echo_async_object(an_object, handle, self->user_data); +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_double_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoDoubleResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_double_response_dispose; } -static void core_tests_pigeon_test_host_integration_core_api_echo_async_list_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); - - if (self->vtable == nullptr || self->vtable->echo_async_list == nullptr) { - return; - } - - FlValue* value0 = fl_value_get_list_value(message_, 0); - FlValue* list = value0; - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = - core_tests_pigeon_test_host_integration_core_api_response_handle_new( - channel, response_handle); - self->vtable->echo_async_list(list, handle, self->user_data); +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoDoubleResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_double_response_new( + double return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoDoubleResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_DOUBLE_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_double_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_float(return_value)); + return self; } -static void core_tests_pigeon_test_host_integration_core_api_echo_async_map_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoDoubleResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_double_response_new_error( + const gchar* code, const gchar* message, FlValue* details) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoDoubleResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_DOUBLE_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_double_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_string(code)); + fl_value_append_take(self->value, + fl_value_new_string(message != nullptr ? message : "")); + fl_value_append_take(self->value, details != nullptr ? fl_value_ref(details) + : fl_value_new_null()); + return self; +} - if (self->vtable == nullptr || self->vtable->echo_async_map == nullptr) { - return; - } +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoStringResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_string_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_STRING_RESPONSE, GObject) - FlValue* value0 = fl_value_get_list_value(message_, 0); - FlValue* a_map = value0; - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = - core_tests_pigeon_test_host_integration_core_api_response_handle_new( - channel, response_handle); - self->vtable->echo_async_map(a_map, handle, self->user_data); -} +struct _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoStringResponse { + GObject parent_instance; -static void core_tests_pigeon_test_host_integration_core_api_echo_async_enum_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + FlValue* value; +}; - if (self->vtable == nullptr || self->vtable->echo_async_enum == nullptr) { - return; - } +G_DEFINE_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoStringResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_string_response, + G_TYPE_OBJECT) - FlValue* value0 = fl_value_get_list_value(message_, 0); - CoreTestsPigeonTestAnEnum an_enum = static_cast( - fl_value_get_int(reinterpret_cast( - const_cast(fl_value_get_custom_value(value0))))); - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = - core_tests_pigeon_test_host_integration_core_api_response_handle_new( - channel, response_handle); - self->vtable->echo_async_enum(an_enum, handle, self->user_data); +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_string_response_dispose( + GObject* object) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoStringResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_STRING_RESPONSE( + object); + g_clear_pointer(&self->value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_string_response_parent_class) + ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_echo_another_async_enum_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_string_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoStringResponse* + self) {} - if (self->vtable == nullptr || - self->vtable->echo_another_async_enum == nullptr) { - return; - } +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_string_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoStringResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_string_response_dispose; +} - FlValue* value0 = fl_value_get_list_value(message_, 0); - CoreTestsPigeonTestAnotherEnum another_enum = - static_cast( - fl_value_get_int(reinterpret_cast( - const_cast(fl_value_get_custom_value(value0))))); - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = - core_tests_pigeon_test_host_integration_core_api_response_handle_new( - channel, response_handle); - self->vtable->echo_another_async_enum(another_enum, handle, self->user_data); +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoStringResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_string_response_new( + const gchar* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoStringResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_STRING_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_string_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_string(return_value)); + return self; } -static void -core_tests_pigeon_test_host_integration_core_api_throw_async_error_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); - - if (self->vtable == nullptr || self->vtable->throw_async_error == nullptr) { - return; - } - - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = - core_tests_pigeon_test_host_integration_core_api_response_handle_new( - channel, response_handle); - self->vtable->throw_async_error(handle, self->user_data); +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoStringResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_string_response_new_error( + const gchar* code, const gchar* message, FlValue* details) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoStringResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_STRING_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_string_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_string(code)); + fl_value_append_take(self->value, + fl_value_new_string(message != nullptr ? message : "")); + fl_value_append_take(self->value, details != nullptr ? fl_value_ref(details) + : fl_value_new_null()); + return self; } -static void -core_tests_pigeon_test_host_integration_core_api_throw_async_error_from_void_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); - - if (self->vtable == nullptr || - self->vtable->throw_async_error_from_void == nullptr) { - return; - } +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoUint8ListResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_uint8_list_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_UINT8_LIST_RESPONSE, GObject) - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = - core_tests_pigeon_test_host_integration_core_api_response_handle_new( - channel, response_handle); - self->vtable->throw_async_error_from_void(handle, self->user_data); -} +struct + _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoUint8ListResponse { + GObject parent_instance; -static void -core_tests_pigeon_test_host_integration_core_api_throw_async_flutter_error_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + FlValue* value; +}; - if (self->vtable == nullptr || - self->vtable->throw_async_flutter_error == nullptr) { - return; - } +G_DEFINE_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoUint8ListResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_uint8_list_response, + G_TYPE_OBJECT) - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = - core_tests_pigeon_test_host_integration_core_api_response_handle_new( - channel, response_handle); - self->vtable->throw_async_flutter_error(handle, self->user_data); +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_uint8_list_response_dispose( + GObject* object) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoUint8ListResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_UINT8_LIST_RESPONSE( + object); + g_clear_pointer(&self->value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_uint8_list_response_parent_class) + ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_echo_async_all_types_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_uint8_list_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoUint8ListResponse* + self) {} - if (self->vtable == nullptr || - self->vtable->echo_async_all_types == nullptr) { - return; - } +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_uint8_list_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoUint8ListResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_uint8_list_response_dispose; +} - FlValue* value0 = fl_value_get_list_value(message_, 0); - CoreTestsPigeonTestAllTypes* everything = CORE_TESTS_PIGEON_TEST_ALL_TYPES( - fl_value_get_custom_value_object(value0)); - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = - core_tests_pigeon_test_host_integration_core_api_response_handle_new( - channel, response_handle); - self->vtable->echo_async_all_types(everything, handle, self->user_data); +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoUint8ListResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_uint8_list_response_new( + const uint8_t* return_value, size_t return_value_length) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoUint8ListResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_UINT8_LIST_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_uint8_list_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take( + self->value, fl_value_new_uint8_list(return_value, return_value_length)); + return self; } -static void -core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_all_nullable_types_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoUint8ListResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_uint8_list_response_new_error( + const gchar* code, const gchar* message, FlValue* details) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoUint8ListResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_UINT8_LIST_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_uint8_list_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_string(code)); + fl_value_append_take(self->value, + fl_value_new_string(message != nullptr ? message : "")); + fl_value_append_take(self->value, details != nullptr ? fl_value_ref(details) + : fl_value_new_null()); + return self; +} - if (self->vtable == nullptr || - self->vtable->echo_async_nullable_all_nullable_types == nullptr) { - return; - } +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoListResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_list_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_LIST_RESPONSE, GObject) - FlValue* value0 = fl_value_get_list_value(message_, 0); - CoreTestsPigeonTestAllNullableTypes* everything = - CORE_TESTS_PIGEON_TEST_ALL_NULLABLE_TYPES( - fl_value_get_custom_value_object(value0)); - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = - core_tests_pigeon_test_host_integration_core_api_response_handle_new( - channel, response_handle); - self->vtable->echo_async_nullable_all_nullable_types(everything, handle, - self->user_data); -} +struct _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoListResponse { + GObject parent_instance; -static void -core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_all_nullable_types_without_recursion_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + FlValue* value; +}; - if (self->vtable == nullptr || - self->vtable->echo_async_nullable_all_nullable_types_without_recursion == - nullptr) { - return; - } +G_DEFINE_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoListResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_list_response, + G_TYPE_OBJECT) - FlValue* value0 = fl_value_get_list_value(message_, 0); - CoreTestsPigeonTestAllNullableTypesWithoutRecursion* everything = - CORE_TESTS_PIGEON_TEST_ALL_NULLABLE_TYPES_WITHOUT_RECURSION( - fl_value_get_custom_value_object(value0)); - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = - core_tests_pigeon_test_host_integration_core_api_response_handle_new( - channel, response_handle); - self->vtable->echo_async_nullable_all_nullable_types_without_recursion( - everything, handle, self->user_data); +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_list_response_dispose( + GObject* object) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoListResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_LIST_RESPONSE( + object); + g_clear_pointer(&self->value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_list_response_parent_class) + ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_int_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); - - if (self->vtable == nullptr || - self->vtable->echo_async_nullable_int == nullptr) { - return; - } - - FlValue* value0 = fl_value_get_list_value(message_, 0); - int64_t* an_int = nullptr; - int64_t an_int_value; - if (fl_value_get_type(value0) != FL_VALUE_TYPE_NULL) { - an_int_value = fl_value_get_int(value0); - an_int = &an_int_value; - } - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = - core_tests_pigeon_test_host_integration_core_api_response_handle_new( - channel, response_handle); - self->vtable->echo_async_nullable_int(an_int, handle, self->user_data); -} +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_list_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoListResponse* + self) {} static void -core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_double_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_list_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoListResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_list_response_dispose; +} - if (self->vtable == nullptr || - self->vtable->echo_async_nullable_double == nullptr) { - return; - } +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoListResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_list_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoListResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_LIST_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_list_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_ref(return_value)); + return self; +} - FlValue* value0 = fl_value_get_list_value(message_, 0); - double* a_double = nullptr; - double a_double_value; - if (fl_value_get_type(value0) != FL_VALUE_TYPE_NULL) { - a_double_value = fl_value_get_float(value0); - a_double = &a_double_value; - } - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = - core_tests_pigeon_test_host_integration_core_api_response_handle_new( - channel, response_handle); - self->vtable->echo_async_nullable_double(a_double, handle, self->user_data); +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoListResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_list_response_new_error( + const gchar* code, const gchar* message, FlValue* details) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoListResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_LIST_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_list_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_string(code)); + fl_value_append_take(self->value, + fl_value_new_string(message != nullptr ? message : "")); + fl_value_append_take(self->value, details != nullptr ? fl_value_ref(details) + : fl_value_new_null()); + return self; } -static void -core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_bool_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoEnumListResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_list_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_ENUM_LIST_RESPONSE, GObject) - if (self->vtable == nullptr || - self->vtable->echo_async_nullable_bool == nullptr) { - return; - } +struct + _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoEnumListResponse { + GObject parent_instance; - FlValue* value0 = fl_value_get_list_value(message_, 0); - gboolean* a_bool = nullptr; - gboolean a_bool_value; - if (fl_value_get_type(value0) != FL_VALUE_TYPE_NULL) { - a_bool_value = fl_value_get_bool(value0); - a_bool = &a_bool_value; - } - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = - core_tests_pigeon_test_host_integration_core_api_response_handle_new( - channel, response_handle); - self->vtable->echo_async_nullable_bool(a_bool, handle, self->user_data); + FlValue* value; +}; + +G_DEFINE_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoEnumListResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_list_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_list_response_dispose( + GObject* object) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoEnumListResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_ENUM_LIST_RESPONSE( + object); + g_clear_pointer(&self->value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_list_response_parent_class) + ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_string_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_list_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoEnumListResponse* + self) {} - if (self->vtable == nullptr || - self->vtable->echo_async_nullable_string == nullptr) { - return; - } +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_list_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoEnumListResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_list_response_dispose; +} - FlValue* value0 = fl_value_get_list_value(message_, 0); - const gchar* a_string = fl_value_get_string(value0); - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = - core_tests_pigeon_test_host_integration_core_api_response_handle_new( - channel, response_handle); - self->vtable->echo_async_nullable_string(a_string, handle, self->user_data); +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoEnumListResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_list_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoEnumListResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_ENUM_LIST_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_list_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_ref(return_value)); + return self; } -static void -core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_uint8_list_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoEnumListResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_list_response_new_error( + const gchar* code, const gchar* message, FlValue* details) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoEnumListResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_ENUM_LIST_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_list_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_string(code)); + fl_value_append_take(self->value, + fl_value_new_string(message != nullptr ? message : "")); + fl_value_append_take(self->value, details != nullptr ? fl_value_ref(details) + : fl_value_new_null()); + return self; +} - if (self->vtable == nullptr || - self->vtable->echo_async_nullable_uint8_list == nullptr) { - return; - } +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoClassListResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_class_list_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_CLASS_LIST_RESPONSE, GObject) - FlValue* value0 = fl_value_get_list_value(message_, 0); - const uint8_t* a_uint8_list = fl_value_get_uint8_list(value0); - size_t a_uint8_list_length = fl_value_get_length(value0); - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = - core_tests_pigeon_test_host_integration_core_api_response_handle_new( - channel, response_handle); - self->vtable->echo_async_nullable_uint8_list( - a_uint8_list, a_uint8_list_length, handle, self->user_data); -} +struct + _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoClassListResponse { + GObject parent_instance; -static void -core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_object_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + FlValue* value; +}; - if (self->vtable == nullptr || - self->vtable->echo_async_nullable_object == nullptr) { - return; - } +G_DEFINE_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoClassListResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_class_list_response, + G_TYPE_OBJECT) - FlValue* value0 = fl_value_get_list_value(message_, 0); - FlValue* an_object = value0; - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = - core_tests_pigeon_test_host_integration_core_api_response_handle_new( - channel, response_handle); - self->vtable->echo_async_nullable_object(an_object, handle, self->user_data); +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_class_list_response_dispose( + GObject* object) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoClassListResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_CLASS_LIST_RESPONSE( + object); + g_clear_pointer(&self->value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_class_list_response_parent_class) + ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_list_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_class_list_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoClassListResponse* + self) {} - if (self->vtable == nullptr || - self->vtable->echo_async_nullable_list == nullptr) { - return; - } +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_class_list_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoClassListResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_class_list_response_dispose; +} - FlValue* value0 = fl_value_get_list_value(message_, 0); - FlValue* list = value0; - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = - core_tests_pigeon_test_host_integration_core_api_response_handle_new( - channel, response_handle); - self->vtable->echo_async_nullable_list(list, handle, self->user_data); +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoClassListResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_class_list_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoClassListResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_CLASS_LIST_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_class_list_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_ref(return_value)); + return self; } -static void -core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_map_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoClassListResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_class_list_response_new_error( + const gchar* code, const gchar* message, FlValue* details) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoClassListResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_CLASS_LIST_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_class_list_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_string(code)); + fl_value_append_take(self->value, + fl_value_new_string(message != nullptr ? message : "")); + fl_value_append_take(self->value, details != nullptr ? fl_value_ref(details) + : fl_value_new_null()); + return self; +} - if (self->vtable == nullptr || - self->vtable->echo_async_nullable_map == nullptr) { - return; - } +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNonNullEnumListResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_enum_list_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NON_NULL_ENUM_LIST_RESPONSE, + GObject) - FlValue* value0 = fl_value_get_list_value(message_, 0); - FlValue* a_map = value0; - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = - core_tests_pigeon_test_host_integration_core_api_response_handle_new( - channel, response_handle); - self->vtable->echo_async_nullable_map(a_map, handle, self->user_data); -} +struct + _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNonNullEnumListResponse { + GObject parent_instance; -static void -core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_enum_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + FlValue* value; +}; - if (self->vtable == nullptr || - self->vtable->echo_async_nullable_enum == nullptr) { - return; - } +G_DEFINE_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNonNullEnumListResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_enum_list_response, + G_TYPE_OBJECT) - FlValue* value0 = fl_value_get_list_value(message_, 0); - CoreTestsPigeonTestAnEnum* an_enum = nullptr; - CoreTestsPigeonTestAnEnum an_enum_value; - if (fl_value_get_type(value0) != FL_VALUE_TYPE_NULL) { - an_enum_value = static_cast( - fl_value_get_int(reinterpret_cast( - const_cast(fl_value_get_custom_value(value0))))); - an_enum = &an_enum_value; - } - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = - core_tests_pigeon_test_host_integration_core_api_response_handle_new( - channel, response_handle); - self->vtable->echo_async_nullable_enum(an_enum, handle, self->user_data); +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_enum_list_response_dispose( + GObject* object) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNonNullEnumListResponse* + self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NON_NULL_ENUM_LIST_RESPONSE( + object); + g_clear_pointer(&self->value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_enum_list_response_parent_class) + ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_echo_another_async_nullable_enum_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_enum_list_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNonNullEnumListResponse* + self) {} - if (self->vtable == nullptr || - self->vtable->echo_another_async_nullable_enum == nullptr) { - return; - } +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_enum_list_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNonNullEnumListResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_enum_list_response_dispose; +} - FlValue* value0 = fl_value_get_list_value(message_, 0); - CoreTestsPigeonTestAnotherEnum* another_enum = nullptr; - CoreTestsPigeonTestAnotherEnum another_enum_value; - if (fl_value_get_type(value0) != FL_VALUE_TYPE_NULL) { - another_enum_value = static_cast( - fl_value_get_int(reinterpret_cast( - const_cast(fl_value_get_custom_value(value0))))); - another_enum = &another_enum_value; - } - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = - core_tests_pigeon_test_host_integration_core_api_response_handle_new( - channel, response_handle); - self->vtable->echo_another_async_nullable_enum(another_enum, handle, - self->user_data); +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNonNullEnumListResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_enum_list_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNonNullEnumListResponse* + self = CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NON_NULL_ENUM_LIST_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_enum_list_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_ref(return_value)); + return self; } -static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_noop_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNonNullEnumListResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_enum_list_response_new_error( + const gchar* code, const gchar* message, FlValue* details) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNonNullEnumListResponse* + self = CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NON_NULL_ENUM_LIST_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_enum_list_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_string(code)); + fl_value_append_take(self->value, + fl_value_new_string(message != nullptr ? message : "")); + fl_value_append_take(self->value, details != nullptr ? fl_value_ref(details) + : fl_value_new_null()); + return self; +} - if (self->vtable == nullptr || self->vtable->call_flutter_noop == nullptr) { - return; - } +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNonNullClassListResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_class_list_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NON_NULL_CLASS_LIST_RESPONSE, + GObject) - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = - core_tests_pigeon_test_host_integration_core_api_response_handle_new( - channel, response_handle); - self->vtable->call_flutter_noop(handle, self->user_data); -} +struct + _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNonNullClassListResponse { + GObject parent_instance; -static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_throw_error_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + FlValue* value; +}; - if (self->vtable == nullptr || - self->vtable->call_flutter_throw_error == nullptr) { - return; - } +G_DEFINE_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNonNullClassListResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_class_list_response, + G_TYPE_OBJECT) - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = - core_tests_pigeon_test_host_integration_core_api_response_handle_new( - channel, response_handle); - self->vtable->call_flutter_throw_error(handle, self->user_data); +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_class_list_response_dispose( + GObject* object) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNonNullClassListResponse* + self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NON_NULL_CLASS_LIST_RESPONSE( + object); + g_clear_pointer(&self->value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_class_list_response_parent_class) + ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_throw_error_from_void_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_class_list_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNonNullClassListResponse* + self) {} - if (self->vtable == nullptr || - self->vtable->call_flutter_throw_error_from_void == nullptr) { - return; - } +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_class_list_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNonNullClassListResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_class_list_response_dispose; +} - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = - core_tests_pigeon_test_host_integration_core_api_response_handle_new( - channel, response_handle); - self->vtable->call_flutter_throw_error_from_void(handle, self->user_data); +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNonNullClassListResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_class_list_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNonNullClassListResponse* + self = CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NON_NULL_CLASS_LIST_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_class_list_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_ref(return_value)); + return self; } -static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_types_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNonNullClassListResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_class_list_response_new_error( + const gchar* code, const gchar* message, FlValue* details) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNonNullClassListResponse* + self = CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NON_NULL_CLASS_LIST_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_class_list_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_string(code)); + fl_value_append_take(self->value, + fl_value_new_string(message != nullptr ? message : "")); + fl_value_append_take(self->value, details != nullptr ? fl_value_ref(details) + : fl_value_new_null()); + return self; +} - if (self->vtable == nullptr || - self->vtable->call_flutter_echo_all_types == nullptr) { - return; - } +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoMapResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_map_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_MAP_RESPONSE, GObject) - FlValue* value0 = fl_value_get_list_value(message_, 0); - CoreTestsPigeonTestAllTypes* everything = CORE_TESTS_PIGEON_TEST_ALL_TYPES( - fl_value_get_custom_value_object(value0)); - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = - core_tests_pigeon_test_host_integration_core_api_response_handle_new( - channel, response_handle); - self->vtable->call_flutter_echo_all_types(everything, handle, - self->user_data); -} +struct _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoMapResponse { + GObject parent_instance; -static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_nullable_types_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + FlValue* value; +}; - if (self->vtable == nullptr || - self->vtable->call_flutter_echo_all_nullable_types == nullptr) { - return; - } +G_DEFINE_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoMapResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_map_response, + G_TYPE_OBJECT) - FlValue* value0 = fl_value_get_list_value(message_, 0); - CoreTestsPigeonTestAllNullableTypes* everything = - CORE_TESTS_PIGEON_TEST_ALL_NULLABLE_TYPES( - fl_value_get_custom_value_object(value0)); - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = - core_tests_pigeon_test_host_integration_core_api_response_handle_new( - channel, response_handle); - self->vtable->call_flutter_echo_all_nullable_types(everything, handle, - self->user_data); +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_map_response_dispose( + GObject* object) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_MAP_RESPONSE( + object); + g_clear_pointer(&self->value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_map_response_parent_class) + ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_send_multiple_nullable_types_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); - - if (self->vtable == nullptr || - self->vtable->call_flutter_send_multiple_nullable_types == nullptr) { - return; - } - - FlValue* value0 = fl_value_get_list_value(message_, 0); - gboolean* a_nullable_bool = nullptr; - gboolean a_nullable_bool_value; - if (fl_value_get_type(value0) != FL_VALUE_TYPE_NULL) { - a_nullable_bool_value = fl_value_get_bool(value0); - a_nullable_bool = &a_nullable_bool_value; - } - FlValue* value1 = fl_value_get_list_value(message_, 1); - int64_t* a_nullable_int = nullptr; - int64_t a_nullable_int_value; - if (fl_value_get_type(value1) != FL_VALUE_TYPE_NULL) { - a_nullable_int_value = fl_value_get_int(value1); - a_nullable_int = &a_nullable_int_value; - } - FlValue* value2 = fl_value_get_list_value(message_, 2); - const gchar* a_nullable_string = fl_value_get_string(value2); - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = - core_tests_pigeon_test_host_integration_core_api_response_handle_new( - channel, response_handle); - self->vtable->call_flutter_send_multiple_nullable_types( - a_nullable_bool, a_nullable_int, a_nullable_string, handle, - self->user_data); +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_map_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoMapResponse* self) { } static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_nullable_types_without_recursion_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); - - if (self->vtable == nullptr || - self->vtable->call_flutter_echo_all_nullable_types_without_recursion == - nullptr) { - return; - } +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_map_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoMapResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_map_response_dispose; +} - FlValue* value0 = fl_value_get_list_value(message_, 0); - CoreTestsPigeonTestAllNullableTypesWithoutRecursion* everything = - CORE_TESTS_PIGEON_TEST_ALL_NULLABLE_TYPES_WITHOUT_RECURSION( - fl_value_get_custom_value_object(value0)); - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = - core_tests_pigeon_test_host_integration_core_api_response_handle_new( - channel, response_handle); - self->vtable->call_flutter_echo_all_nullable_types_without_recursion( - everything, handle, self->user_data); +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoMapResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_map_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_MAP_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_map_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_ref(return_value)); + return self; } -static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_send_multiple_nullable_types_without_recursion_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoMapResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_map_response_new_error( + const gchar* code, const gchar* message, FlValue* details) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_MAP_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_map_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_string(code)); + fl_value_append_take(self->value, + fl_value_new_string(message != nullptr ? message : "")); + fl_value_append_take(self->value, details != nullptr ? fl_value_ref(details) + : fl_value_new_null()); + return self; +} - if (self->vtable == nullptr || - self->vtable - ->call_flutter_send_multiple_nullable_types_without_recursion == - nullptr) { - return; - } +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoStringMapResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_string_map_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_STRING_MAP_RESPONSE, GObject) - FlValue* value0 = fl_value_get_list_value(message_, 0); - gboolean* a_nullable_bool = nullptr; - gboolean a_nullable_bool_value; - if (fl_value_get_type(value0) != FL_VALUE_TYPE_NULL) { - a_nullable_bool_value = fl_value_get_bool(value0); - a_nullable_bool = &a_nullable_bool_value; - } - FlValue* value1 = fl_value_get_list_value(message_, 1); - int64_t* a_nullable_int = nullptr; - int64_t a_nullable_int_value; - if (fl_value_get_type(value1) != FL_VALUE_TYPE_NULL) { - a_nullable_int_value = fl_value_get_int(value1); - a_nullable_int = &a_nullable_int_value; - } - FlValue* value2 = fl_value_get_list_value(message_, 2); - const gchar* a_nullable_string = fl_value_get_string(value2); - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = - core_tests_pigeon_test_host_integration_core_api_response_handle_new( - channel, response_handle); - self->vtable->call_flutter_send_multiple_nullable_types_without_recursion( - a_nullable_bool, a_nullable_int, a_nullable_string, handle, - self->user_data); -} +struct + _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoStringMapResponse { + GObject parent_instance; -static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_bool_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + FlValue* value; +}; - if (self->vtable == nullptr || - self->vtable->call_flutter_echo_bool == nullptr) { - return; - } +G_DEFINE_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoStringMapResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_string_map_response, + G_TYPE_OBJECT) - FlValue* value0 = fl_value_get_list_value(message_, 0); - gboolean a_bool = fl_value_get_bool(value0); - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = - core_tests_pigeon_test_host_integration_core_api_response_handle_new( - channel, response_handle); - self->vtable->call_flutter_echo_bool(a_bool, handle, self->user_data); +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_string_map_response_dispose( + GObject* object) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoStringMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_STRING_MAP_RESPONSE( + object); + g_clear_pointer(&self->value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_string_map_response_parent_class) + ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_int_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_string_map_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoStringMapResponse* + self) {} - if (self->vtable == nullptr || - self->vtable->call_flutter_echo_int == nullptr) { - return; - } +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_string_map_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoStringMapResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_string_map_response_dispose; +} - FlValue* value0 = fl_value_get_list_value(message_, 0); - int64_t an_int = fl_value_get_int(value0); - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = - core_tests_pigeon_test_host_integration_core_api_response_handle_new( - channel, response_handle); - self->vtable->call_flutter_echo_int(an_int, handle, self->user_data); +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoStringMapResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_string_map_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoStringMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_STRING_MAP_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_string_map_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_ref(return_value)); + return self; } -static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_double_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoStringMapResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_string_map_response_new_error( + const gchar* code, const gchar* message, FlValue* details) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoStringMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_STRING_MAP_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_string_map_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_string(code)); + fl_value_append_take(self->value, + fl_value_new_string(message != nullptr ? message : "")); + fl_value_append_take(self->value, details != nullptr ? fl_value_ref(details) + : fl_value_new_null()); + return self; +} - if (self->vtable == nullptr || - self->vtable->call_flutter_echo_double == nullptr) { - return; - } +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoIntMapResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_int_map_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_INT_MAP_RESPONSE, GObject) - FlValue* value0 = fl_value_get_list_value(message_, 0); - double a_double = fl_value_get_float(value0); - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = - core_tests_pigeon_test_host_integration_core_api_response_handle_new( - channel, response_handle); - self->vtable->call_flutter_echo_double(a_double, handle, self->user_data); -} +struct _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoIntMapResponse { + GObject parent_instance; -static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_string_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + FlValue* value; +}; - if (self->vtable == nullptr || - self->vtable->call_flutter_echo_string == nullptr) { - return; - } +G_DEFINE_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoIntMapResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_int_map_response, + G_TYPE_OBJECT) - FlValue* value0 = fl_value_get_list_value(message_, 0); - const gchar* a_string = fl_value_get_string(value0); - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = - core_tests_pigeon_test_host_integration_core_api_response_handle_new( - channel, response_handle); - self->vtable->call_flutter_echo_string(a_string, handle, self->user_data); +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_int_map_response_dispose( + GObject* object) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoIntMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_INT_MAP_RESPONSE( + object); + g_clear_pointer(&self->value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_int_map_response_parent_class) + ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_uint8_list_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_int_map_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoIntMapResponse* + self) {} - if (self->vtable == nullptr || - self->vtable->call_flutter_echo_uint8_list == nullptr) { - return; - } +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_int_map_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoIntMapResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_int_map_response_dispose; +} - FlValue* value0 = fl_value_get_list_value(message_, 0); - const uint8_t* list = fl_value_get_uint8_list(value0); - size_t list_length = fl_value_get_length(value0); - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = - core_tests_pigeon_test_host_integration_core_api_response_handle_new( - channel, response_handle); - self->vtable->call_flutter_echo_uint8_list(list, list_length, handle, - self->user_data); +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoIntMapResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_int_map_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoIntMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_INT_MAP_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_int_map_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_ref(return_value)); + return self; } -static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_list_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoIntMapResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_int_map_response_new_error( + const gchar* code, const gchar* message, FlValue* details) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoIntMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_INT_MAP_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_int_map_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_string(code)); + fl_value_append_take(self->value, + fl_value_new_string(message != nullptr ? message : "")); + fl_value_append_take(self->value, details != nullptr ? fl_value_ref(details) + : fl_value_new_null()); + return self; +} - if (self->vtable == nullptr || - self->vtable->call_flutter_echo_list == nullptr) { - return; - } +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoEnumMapResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_map_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_ENUM_MAP_RESPONSE, GObject) - FlValue* value0 = fl_value_get_list_value(message_, 0); - FlValue* list = value0; - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = - core_tests_pigeon_test_host_integration_core_api_response_handle_new( - channel, response_handle); - self->vtable->call_flutter_echo_list(list, handle, self->user_data); -} +struct + _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoEnumMapResponse { + GObject parent_instance; -static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_map_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + FlValue* value; +}; - if (self->vtable == nullptr || - self->vtable->call_flutter_echo_map == nullptr) { - return; - } +G_DEFINE_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoEnumMapResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_map_response, + G_TYPE_OBJECT) - FlValue* value0 = fl_value_get_list_value(message_, 0); - FlValue* a_map = value0; - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = - core_tests_pigeon_test_host_integration_core_api_response_handle_new( - channel, response_handle); - self->vtable->call_flutter_echo_map(a_map, handle, self->user_data); +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_map_response_dispose( + GObject* object) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoEnumMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_ENUM_MAP_RESPONSE( + object); + g_clear_pointer(&self->value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_map_response_parent_class) + ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_map_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoEnumMapResponse* + self) {} - if (self->vtable == nullptr || - self->vtable->call_flutter_echo_enum == nullptr) { - return; - } +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_map_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoEnumMapResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_map_response_dispose; +} - FlValue* value0 = fl_value_get_list_value(message_, 0); - CoreTestsPigeonTestAnEnum an_enum = static_cast( - fl_value_get_int(reinterpret_cast( - const_cast(fl_value_get_custom_value(value0))))); - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = - core_tests_pigeon_test_host_integration_core_api_response_handle_new( - channel, response_handle); - self->vtable->call_flutter_echo_enum(an_enum, handle, self->user_data); +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoEnumMapResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_map_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoEnumMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_ENUM_MAP_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_map_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_ref(return_value)); + return self; } -static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_another_enum_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoEnumMapResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_map_response_new_error( + const gchar* code, const gchar* message, FlValue* details) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoEnumMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_ENUM_MAP_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_map_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_string(code)); + fl_value_append_take(self->value, + fl_value_new_string(message != nullptr ? message : "")); + fl_value_append_take(self->value, details != nullptr ? fl_value_ref(details) + : fl_value_new_null()); + return self; +} - if (self->vtable == nullptr || - self->vtable->call_flutter_echo_another_enum == nullptr) { - return; - } +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoClassMapResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_class_map_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_CLASS_MAP_RESPONSE, GObject) - FlValue* value0 = fl_value_get_list_value(message_, 0); - CoreTestsPigeonTestAnotherEnum another_enum = - static_cast( - fl_value_get_int(reinterpret_cast( - const_cast(fl_value_get_custom_value(value0))))); - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = - core_tests_pigeon_test_host_integration_core_api_response_handle_new( - channel, response_handle); - self->vtable->call_flutter_echo_another_enum(another_enum, handle, - self->user_data); -} +struct + _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoClassMapResponse { + GObject parent_instance; -static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_bool_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + FlValue* value; +}; - if (self->vtable == nullptr || - self->vtable->call_flutter_echo_nullable_bool == nullptr) { - return; - } +G_DEFINE_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoClassMapResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_class_map_response, + G_TYPE_OBJECT) - FlValue* value0 = fl_value_get_list_value(message_, 0); - gboolean* a_bool = nullptr; - gboolean a_bool_value; - if (fl_value_get_type(value0) != FL_VALUE_TYPE_NULL) { - a_bool_value = fl_value_get_bool(value0); - a_bool = &a_bool_value; - } - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = - core_tests_pigeon_test_host_integration_core_api_response_handle_new( - channel, response_handle); - self->vtable->call_flutter_echo_nullable_bool(a_bool, handle, - self->user_data); +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_class_map_response_dispose( + GObject* object) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoClassMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_CLASS_MAP_RESPONSE( + object); + g_clear_pointer(&self->value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_class_map_response_parent_class) + ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_int_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_class_map_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoClassMapResponse* + self) {} - if (self->vtable == nullptr || - self->vtable->call_flutter_echo_nullable_int == nullptr) { - return; - } +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_class_map_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoClassMapResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_class_map_response_dispose; +} - FlValue* value0 = fl_value_get_list_value(message_, 0); - int64_t* an_int = nullptr; - int64_t an_int_value; - if (fl_value_get_type(value0) != FL_VALUE_TYPE_NULL) { - an_int_value = fl_value_get_int(value0); - an_int = &an_int_value; - } - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = - core_tests_pigeon_test_host_integration_core_api_response_handle_new( - channel, response_handle); - self->vtable->call_flutter_echo_nullable_int(an_int, handle, self->user_data); +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoClassMapResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_class_map_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoClassMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_CLASS_MAP_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_class_map_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_ref(return_value)); + return self; } -static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_double_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoClassMapResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_class_map_response_new_error( + const gchar* code, const gchar* message, FlValue* details) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoClassMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_CLASS_MAP_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_class_map_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_string(code)); + fl_value_append_take(self->value, + fl_value_new_string(message != nullptr ? message : "")); + fl_value_append_take(self->value, details != nullptr ? fl_value_ref(details) + : fl_value_new_null()); + return self; +} - if (self->vtable == nullptr || - self->vtable->call_flutter_echo_nullable_double == nullptr) { - return; - } +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNonNullStringMapResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_string_map_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NON_NULL_STRING_MAP_RESPONSE, + GObject) - FlValue* value0 = fl_value_get_list_value(message_, 0); - double* a_double = nullptr; - double a_double_value; - if (fl_value_get_type(value0) != FL_VALUE_TYPE_NULL) { - a_double_value = fl_value_get_float(value0); - a_double = &a_double_value; - } - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = - core_tests_pigeon_test_host_integration_core_api_response_handle_new( - channel, response_handle); - self->vtable->call_flutter_echo_nullable_double(a_double, handle, - self->user_data); -} +struct + _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNonNullStringMapResponse { + GObject parent_instance; -static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_string_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + FlValue* value; +}; - if (self->vtable == nullptr || - self->vtable->call_flutter_echo_nullable_string == nullptr) { - return; - } +G_DEFINE_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNonNullStringMapResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_string_map_response, + G_TYPE_OBJECT) - FlValue* value0 = fl_value_get_list_value(message_, 0); - const gchar* a_string = fl_value_get_string(value0); - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = - core_tests_pigeon_test_host_integration_core_api_response_handle_new( - channel, response_handle); - self->vtable->call_flutter_echo_nullable_string(a_string, handle, - self->user_data); +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_string_map_response_dispose( + GObject* object) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNonNullStringMapResponse* + self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NON_NULL_STRING_MAP_RESPONSE( + object); + g_clear_pointer(&self->value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_string_map_response_parent_class) + ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_uint8_list_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_string_map_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNonNullStringMapResponse* + self) {} - if (self->vtable == nullptr || - self->vtable->call_flutter_echo_nullable_uint8_list == nullptr) { - return; - } +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_string_map_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNonNullStringMapResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_string_map_response_dispose; +} - FlValue* value0 = fl_value_get_list_value(message_, 0); - const uint8_t* list = fl_value_get_uint8_list(value0); - size_t list_length = fl_value_get_length(value0); - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = - core_tests_pigeon_test_host_integration_core_api_response_handle_new( - channel, response_handle); - self->vtable->call_flutter_echo_nullable_uint8_list(list, list_length, handle, - self->user_data); +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNonNullStringMapResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_string_map_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNonNullStringMapResponse* + self = CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NON_NULL_STRING_MAP_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_string_map_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_ref(return_value)); + return self; } -static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_list_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNonNullStringMapResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_string_map_response_new_error( + const gchar* code, const gchar* message, FlValue* details) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNonNullStringMapResponse* + self = CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NON_NULL_STRING_MAP_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_string_map_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_string(code)); + fl_value_append_take(self->value, + fl_value_new_string(message != nullptr ? message : "")); + fl_value_append_take(self->value, details != nullptr ? fl_value_ref(details) + : fl_value_new_null()); + return self; +} - if (self->vtable == nullptr || - self->vtable->call_flutter_echo_nullable_list == nullptr) { - return; - } +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNonNullIntMapResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_int_map_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NON_NULL_INT_MAP_RESPONSE, + GObject) - FlValue* value0 = fl_value_get_list_value(message_, 0); - FlValue* list = value0; - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = - core_tests_pigeon_test_host_integration_core_api_response_handle_new( - channel, response_handle); - self->vtable->call_flutter_echo_nullable_list(list, handle, self->user_data); -} +struct + _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNonNullIntMapResponse { + GObject parent_instance; -static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_map_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + FlValue* value; +}; - if (self->vtable == nullptr || - self->vtable->call_flutter_echo_nullable_map == nullptr) { - return; - } +G_DEFINE_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNonNullIntMapResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_int_map_response, + G_TYPE_OBJECT) - FlValue* value0 = fl_value_get_list_value(message_, 0); - FlValue* a_map = value0; - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = - core_tests_pigeon_test_host_integration_core_api_response_handle_new( - channel, response_handle); - self->vtable->call_flutter_echo_nullable_map(a_map, handle, self->user_data); +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_int_map_response_dispose( + GObject* object) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNonNullIntMapResponse* + self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NON_NULL_INT_MAP_RESPONSE( + object); + g_clear_pointer(&self->value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_int_map_response_parent_class) + ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_enum_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_int_map_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNonNullIntMapResponse* + self) {} - if (self->vtable == nullptr || - self->vtable->call_flutter_echo_nullable_enum == nullptr) { - return; - } +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_int_map_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNonNullIntMapResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_int_map_response_dispose; +} - FlValue* value0 = fl_value_get_list_value(message_, 0); - CoreTestsPigeonTestAnEnum* an_enum = nullptr; - CoreTestsPigeonTestAnEnum an_enum_value; - if (fl_value_get_type(value0) != FL_VALUE_TYPE_NULL) { - an_enum_value = static_cast( - fl_value_get_int(reinterpret_cast( - const_cast(fl_value_get_custom_value(value0))))); - an_enum = &an_enum_value; - } - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = - core_tests_pigeon_test_host_integration_core_api_response_handle_new( - channel, response_handle); - self->vtable->call_flutter_echo_nullable_enum(an_enum, handle, - self->user_data); +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNonNullIntMapResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_int_map_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNonNullIntMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NON_NULL_INT_MAP_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_int_map_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_ref(return_value)); + return self; +} + +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNonNullIntMapResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_int_map_response_new_error( + const gchar* code, const gchar* message, FlValue* details) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNonNullIntMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NON_NULL_INT_MAP_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_int_map_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_string(code)); + fl_value_append_take(self->value, + fl_value_new_string(message != nullptr ? message : "")); + fl_value_append_take(self->value, details != nullptr ? fl_value_ref(details) + : fl_value_new_null()); + return self; +} + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNonNullEnumMapResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_enum_map_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NON_NULL_ENUM_MAP_RESPONSE, + GObject) + +struct + _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNonNullEnumMapResponse { + GObject parent_instance; + + FlValue* value; +}; + +G_DEFINE_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNonNullEnumMapResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_enum_map_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_enum_map_response_dispose( + GObject* object) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNonNullEnumMapResponse* + self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NON_NULL_ENUM_MAP_RESPONSE( + object); + g_clear_pointer(&self->value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_enum_map_response_parent_class) + ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_another_nullable_enum_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_enum_map_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNonNullEnumMapResponse* + self) {} - if (self->vtable == nullptr || - self->vtable->call_flutter_echo_another_nullable_enum == nullptr) { - return; - } +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_enum_map_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNonNullEnumMapResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_enum_map_response_dispose; +} - FlValue* value0 = fl_value_get_list_value(message_, 0); - CoreTestsPigeonTestAnotherEnum* another_enum = nullptr; - CoreTestsPigeonTestAnotherEnum another_enum_value; - if (fl_value_get_type(value0) != FL_VALUE_TYPE_NULL) { - another_enum_value = static_cast( - fl_value_get_int(reinterpret_cast( - const_cast(fl_value_get_custom_value(value0))))); - another_enum = &another_enum_value; - } - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = - core_tests_pigeon_test_host_integration_core_api_response_handle_new( - channel, response_handle); - self->vtable->call_flutter_echo_another_nullable_enum(another_enum, handle, - self->user_data); +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNonNullEnumMapResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_enum_map_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNonNullEnumMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NON_NULL_ENUM_MAP_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_enum_map_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_ref(return_value)); + return self; +} + +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNonNullEnumMapResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_enum_map_response_new_error( + const gchar* code, const gchar* message, FlValue* details) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNonNullEnumMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NON_NULL_ENUM_MAP_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_enum_map_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_string(code)); + fl_value_append_take(self->value, + fl_value_new_string(message != nullptr ? message : "")); + fl_value_append_take(self->value, details != nullptr ? fl_value_ref(details) + : fl_value_new_null()); + return self; } +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNonNullClassMapResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_class_map_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NON_NULL_CLASS_MAP_RESPONSE, + GObject) + +struct + _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNonNullClassMapResponse { + GObject parent_instance; + + FlValue* value; +}; + +G_DEFINE_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNonNullClassMapResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_class_map_response, + G_TYPE_OBJECT) + static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_small_api_echo_string_cb( - FlBasicMessageChannel* channel, FlValue* message_, - FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { - CoreTestsPigeonTestHostIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_class_map_response_dispose( + GObject* object) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNonNullClassMapResponse* + self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NON_NULL_CLASS_MAP_RESPONSE( + object); + g_clear_pointer(&self->value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_class_map_response_parent_class) + ->dispose(object); +} - if (self->vtable == nullptr || - self->vtable->call_flutter_small_api_echo_string == nullptr) { - return; - } +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_class_map_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNonNullClassMapResponse* + self) {} - FlValue* value0 = fl_value_get_list_value(message_, 0); - const gchar* a_string = fl_value_get_string(value0); - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = - core_tests_pigeon_test_host_integration_core_api_response_handle_new( - channel, response_handle); - self->vtable->call_flutter_small_api_echo_string(a_string, handle, - self->user_data); +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_class_map_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNonNullClassMapResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_class_map_response_dispose; } -void core_tests_pigeon_test_host_integration_core_api_set_method_handlers( - FlBinaryMessenger* messenger, const gchar* suffix, - const CoreTestsPigeonTestHostIntegrationCoreApiVTable* vtable, - gpointer user_data, GDestroyNotify user_data_free_func) { - g_autofree gchar* dot_suffix = - suffix != nullptr ? g_strdup_printf(".%s", suffix) : g_strdup(""); - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApi) api_data = - core_tests_pigeon_test_host_integration_core_api_new(vtable, user_data, - user_data_free_func); +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNonNullClassMapResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_class_map_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNonNullClassMapResponse* + self = CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NON_NULL_CLASS_MAP_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_class_map_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_ref(return_value)); + return self; +} - g_autoptr(CoreTestsPigeonTestMessageCodec) codec = - core_tests_pigeon_test_message_codec_new(); - g_autofree gchar* noop_channel_name = g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.noop%" - "s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) noop_channel = fl_basic_message_channel_new( - messenger, noop_channel_name, FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - noop_channel, core_tests_pigeon_test_host_integration_core_api_noop_cb, - g_object_ref(api_data), g_object_unref); - g_autofree gchar* echo_all_types_channel_name = g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAllTypes%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_all_types_channel = - fl_basic_message_channel_new(messenger, echo_all_types_channel_name, - FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - echo_all_types_channel, - core_tests_pigeon_test_host_integration_core_api_echo_all_types_cb, - g_object_ref(api_data), g_object_unref); - g_autofree gchar* throw_error_channel_name = g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "throwError%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) throw_error_channel = - fl_basic_message_channel_new(messenger, throw_error_channel_name, - FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - throw_error_channel, - core_tests_pigeon_test_host_integration_core_api_throw_error_cb, - g_object_ref(api_data), g_object_unref); - g_autofree gchar* throw_error_from_void_channel_name = g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "throwErrorFromVoid%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) throw_error_from_void_channel = - fl_basic_message_channel_new(messenger, - throw_error_from_void_channel_name, - FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - throw_error_from_void_channel, - core_tests_pigeon_test_host_integration_core_api_throw_error_from_void_cb, - g_object_ref(api_data), g_object_unref); - g_autofree gchar* throw_flutter_error_channel_name = g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "throwFlutterError%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) throw_flutter_error_channel = - fl_basic_message_channel_new(messenger, throw_flutter_error_channel_name, - FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - throw_flutter_error_channel, - core_tests_pigeon_test_host_integration_core_api_throw_flutter_error_cb, - g_object_ref(api_data), g_object_unref); - g_autofree gchar* echo_int_channel_name = g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoInt%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_int_channel = - fl_basic_message_channel_new(messenger, echo_int_channel_name, - FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - echo_int_channel, - core_tests_pigeon_test_host_integration_core_api_echo_int_cb, - g_object_ref(api_data), g_object_unref); - g_autofree gchar* echo_double_channel_name = g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNonNullClassMapResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_class_map_response_new_error( + const gchar* code, const gchar* message, FlValue* details) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNonNullClassMapResponse* + self = CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NON_NULL_CLASS_MAP_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_class_map_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_string(code)); + fl_value_append_take(self->value, + fl_value_new_string(message != nullptr ? message : "")); + fl_value_append_take(self->value, details != nullptr ? fl_value_ref(details) + : fl_value_new_null()); + return self; +} + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoEnumResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_ENUM_RESPONSE, GObject) + +struct _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoEnumResponse { + GObject parent_instance; + + FlValue* value; +}; + +G_DEFINE_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoEnumResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_response_dispose( + GObject* object) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoEnumResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_ENUM_RESPONSE( + object); + g_clear_pointer(&self->value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_response_parent_class) + ->dispose(object); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoEnumResponse* + self) {} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoEnumResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_response_dispose; +} + +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoEnumResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_response_new( + CoreTestsPigeonTestAnEnum return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoEnumResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_ENUM_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, + fl_value_new_custom(129, fl_value_new_int(return_value), + (GDestroyNotify)fl_value_unref)); + return self; +} + +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoEnumResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_response_new_error( + const gchar* code, const gchar* message, FlValue* details) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoEnumResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_ENUM_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_string(code)); + fl_value_append_take(self->value, + fl_value_new_string(message != nullptr ? message : "")); + fl_value_append_take(self->value, details != nullptr ? fl_value_ref(details) + : fl_value_new_null()); + return self; +} + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAnotherEnumResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_another_enum_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_ANOTHER_ENUM_RESPONSE, GObject) + +struct + _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAnotherEnumResponse { + GObject parent_instance; + + FlValue* value; +}; + +G_DEFINE_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAnotherEnumResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_another_enum_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_another_enum_response_dispose( + GObject* object) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAnotherEnumResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_ANOTHER_ENUM_RESPONSE( + object); + g_clear_pointer(&self->value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_another_enum_response_parent_class) + ->dispose(object); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_another_enum_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAnotherEnumResponse* + self) {} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_another_enum_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAnotherEnumResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_another_enum_response_dispose; +} + +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAnotherEnumResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_another_enum_response_new( + CoreTestsPigeonTestAnotherEnum return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAnotherEnumResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_ANOTHER_ENUM_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_another_enum_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, + fl_value_new_custom(130, fl_value_new_int(return_value), + (GDestroyNotify)fl_value_unref)); + return self; +} + +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAnotherEnumResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_another_enum_response_new_error( + const gchar* code, const gchar* message, FlValue* details) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAnotherEnumResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_ANOTHER_ENUM_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_another_enum_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_string(code)); + fl_value_append_take(self->value, + fl_value_new_string(message != nullptr ? message : "")); + fl_value_append_take(self->value, details != nullptr ? fl_value_ref(details) + : fl_value_new_null()); + return self; +} + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableBoolResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_bool_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_BOOL_RESPONSE, GObject) + +struct + _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableBoolResponse { + GObject parent_instance; + + FlValue* value; +}; + +G_DEFINE_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableBoolResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_bool_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_bool_response_dispose( + GObject* object) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableBoolResponse* + self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_BOOL_RESPONSE( + object); + g_clear_pointer(&self->value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_bool_response_parent_class) + ->dispose(object); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_bool_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableBoolResponse* + self) {} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_bool_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableBoolResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_bool_response_dispose; +} + +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableBoolResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_bool_response_new( + gboolean* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableBoolResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_BOOL_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_bool_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, return_value != nullptr + ? fl_value_new_bool(*return_value) + : fl_value_new_null()); + return self; +} + +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableBoolResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_bool_response_new_error( + const gchar* code, const gchar* message, FlValue* details) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableBoolResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_BOOL_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_bool_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_string(code)); + fl_value_append_take(self->value, + fl_value_new_string(message != nullptr ? message : "")); + fl_value_append_take(self->value, details != nullptr ? fl_value_ref(details) + : fl_value_new_null()); + return self; +} + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableIntResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_int_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_INT_RESPONSE, GObject) + +struct + _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableIntResponse { + GObject parent_instance; + + FlValue* value; +}; + +G_DEFINE_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableIntResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_int_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_int_response_dispose( + GObject* object) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableIntResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_INT_RESPONSE( + object); + g_clear_pointer(&self->value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_int_response_parent_class) + ->dispose(object); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_int_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableIntResponse* + self) {} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_int_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableIntResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_int_response_dispose; +} + +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableIntResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_int_response_new( + int64_t* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableIntResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_INT_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_int_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, return_value != nullptr + ? fl_value_new_int(*return_value) + : fl_value_new_null()); + return self; +} + +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableIntResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_int_response_new_error( + const gchar* code, const gchar* message, FlValue* details) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableIntResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_INT_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_int_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_string(code)); + fl_value_append_take(self->value, + fl_value_new_string(message != nullptr ? message : "")); + fl_value_append_take(self->value, details != nullptr ? fl_value_ref(details) + : fl_value_new_null()); + return self; +} + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableDoubleResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_double_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_DOUBLE_RESPONSE, + GObject) + +struct + _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableDoubleResponse { + GObject parent_instance; + + FlValue* value; +}; + +G_DEFINE_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableDoubleResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_double_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_double_response_dispose( + GObject* object) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableDoubleResponse* + self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_DOUBLE_RESPONSE( + object); + g_clear_pointer(&self->value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_double_response_parent_class) + ->dispose(object); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_double_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableDoubleResponse* + self) {} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_double_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableDoubleResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_double_response_dispose; +} + +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableDoubleResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_double_response_new( + double* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableDoubleResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_DOUBLE_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_double_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, return_value != nullptr + ? fl_value_new_float(*return_value) + : fl_value_new_null()); + return self; +} + +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableDoubleResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_double_response_new_error( + const gchar* code, const gchar* message, FlValue* details) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableDoubleResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_DOUBLE_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_double_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_string(code)); + fl_value_append_take(self->value, + fl_value_new_string(message != nullptr ? message : "")); + fl_value_append_take(self->value, details != nullptr ? fl_value_ref(details) + : fl_value_new_null()); + return self; +} + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableStringResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_string_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_STRING_RESPONSE, + GObject) + +struct + _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableStringResponse { + GObject parent_instance; + + FlValue* value; +}; + +G_DEFINE_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableStringResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_string_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_string_response_dispose( + GObject* object) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableStringResponse* + self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_STRING_RESPONSE( + object); + g_clear_pointer(&self->value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_string_response_parent_class) + ->dispose(object); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_string_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableStringResponse* + self) {} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_string_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableStringResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_string_response_dispose; +} + +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableStringResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_string_response_new( + const gchar* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableStringResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_STRING_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_string_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, return_value != nullptr + ? fl_value_new_string(return_value) + : fl_value_new_null()); + return self; +} + +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableStringResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_string_response_new_error( + const gchar* code, const gchar* message, FlValue* details) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableStringResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_STRING_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_string_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_string(code)); + fl_value_append_take(self->value, + fl_value_new_string(message != nullptr ? message : "")); + fl_value_append_take(self->value, details != nullptr ? fl_value_ref(details) + : fl_value_new_null()); + return self; +} + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableUint8ListResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_uint8_list_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_UINT8_LIST_RESPONSE, + GObject) + +struct + _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableUint8ListResponse { + GObject parent_instance; + + FlValue* value; +}; + +G_DEFINE_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableUint8ListResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_uint8_list_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_uint8_list_response_dispose( + GObject* object) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableUint8ListResponse* + self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_UINT8_LIST_RESPONSE( + object); + g_clear_pointer(&self->value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_uint8_list_response_parent_class) + ->dispose(object); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_uint8_list_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableUint8ListResponse* + self) {} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_uint8_list_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableUint8ListResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_uint8_list_response_dispose; +} + +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableUint8ListResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_uint8_list_response_new( + const uint8_t* return_value, size_t return_value_length) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableUint8ListResponse* + self = CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_UINT8_LIST_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_uint8_list_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, return_value != nullptr + ? fl_value_new_uint8_list( + return_value, return_value_length) + : fl_value_new_null()); + return self; +} + +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableUint8ListResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_uint8_list_response_new_error( + const gchar* code, const gchar* message, FlValue* details) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableUint8ListResponse* + self = CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_UINT8_LIST_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_uint8_list_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_string(code)); + fl_value_append_take(self->value, + fl_value_new_string(message != nullptr ? message : "")); + fl_value_append_take(self->value, details != nullptr ? fl_value_ref(details) + : fl_value_new_null()); + return self; +} + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableListResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_list_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_LIST_RESPONSE, GObject) + +struct + _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableListResponse { + GObject parent_instance; + + FlValue* value; +}; + +G_DEFINE_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableListResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_list_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_list_response_dispose( + GObject* object) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableListResponse* + self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_LIST_RESPONSE( + object); + g_clear_pointer(&self->value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_list_response_parent_class) + ->dispose(object); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_list_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableListResponse* + self) {} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_list_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableListResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_list_response_dispose; +} + +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableListResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_list_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableListResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_LIST_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_list_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, return_value != nullptr + ? fl_value_ref(return_value) + : fl_value_new_null()); + return self; +} + +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableListResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_list_response_new_error( + const gchar* code, const gchar* message, FlValue* details) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableListResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_LIST_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_list_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_string(code)); + fl_value_append_take(self->value, + fl_value_new_string(message != nullptr ? message : "")); + fl_value_append_take(self->value, details != nullptr ? fl_value_ref(details) + : fl_value_new_null()); + return self; +} + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableEnumListResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_enum_list_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_ENUM_LIST_RESPONSE, + GObject) + +struct + _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableEnumListResponse { + GObject parent_instance; + + FlValue* value; +}; + +G_DEFINE_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableEnumListResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_enum_list_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_enum_list_response_dispose( + GObject* object) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableEnumListResponse* + self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_ENUM_LIST_RESPONSE( + object); + g_clear_pointer(&self->value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_enum_list_response_parent_class) + ->dispose(object); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_enum_list_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableEnumListResponse* + self) {} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_enum_list_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableEnumListResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_enum_list_response_dispose; +} + +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableEnumListResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_enum_list_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableEnumListResponse* + self = CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_ENUM_LIST_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_enum_list_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, return_value != nullptr + ? fl_value_ref(return_value) + : fl_value_new_null()); + return self; +} + +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableEnumListResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_enum_list_response_new_error( + const gchar* code, const gchar* message, FlValue* details) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableEnumListResponse* + self = CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_ENUM_LIST_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_enum_list_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_string(code)); + fl_value_append_take(self->value, + fl_value_new_string(message != nullptr ? message : "")); + fl_value_append_take(self->value, details != nullptr ? fl_value_ref(details) + : fl_value_new_null()); + return self; +} + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableClassListResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_class_list_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_CLASS_LIST_RESPONSE, + GObject) + +struct + _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableClassListResponse { + GObject parent_instance; + + FlValue* value; +}; + +G_DEFINE_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableClassListResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_class_list_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_class_list_response_dispose( + GObject* object) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableClassListResponse* + self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_CLASS_LIST_RESPONSE( + object); + g_clear_pointer(&self->value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_class_list_response_parent_class) + ->dispose(object); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_class_list_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableClassListResponse* + self) {} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_class_list_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableClassListResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_class_list_response_dispose; +} + +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableClassListResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_class_list_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableClassListResponse* + self = CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_CLASS_LIST_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_class_list_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, return_value != nullptr + ? fl_value_ref(return_value) + : fl_value_new_null()); + return self; +} + +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableClassListResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_class_list_response_new_error( + const gchar* code, const gchar* message, FlValue* details) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableClassListResponse* + self = CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_CLASS_LIST_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_class_list_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_string(code)); + fl_value_append_take(self->value, + fl_value_new_string(message != nullptr ? message : "")); + fl_value_append_take(self->value, details != nullptr ? fl_value_ref(details) + : fl_value_new_null()); + return self; +} + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableNonNullEnumListResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_enum_list_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_NON_NULL_ENUM_LIST_RESPONSE, + GObject) + +struct + _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableNonNullEnumListResponse { + GObject parent_instance; + + FlValue* value; +}; + +G_DEFINE_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableNonNullEnumListResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_enum_list_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_enum_list_response_dispose( + GObject* object) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableNonNullEnumListResponse* + self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_NON_NULL_ENUM_LIST_RESPONSE( + object); + g_clear_pointer(&self->value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_enum_list_response_parent_class) + ->dispose(object); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_enum_list_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableNonNullEnumListResponse* + self) {} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_enum_list_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableNonNullEnumListResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_enum_list_response_dispose; +} + +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableNonNullEnumListResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_enum_list_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableNonNullEnumListResponse* + self = CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_NON_NULL_ENUM_LIST_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_enum_list_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, return_value != nullptr + ? fl_value_ref(return_value) + : fl_value_new_null()); + return self; +} + +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableNonNullEnumListResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_enum_list_response_new_error( + const gchar* code, const gchar* message, FlValue* details) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableNonNullEnumListResponse* + self = CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_NON_NULL_ENUM_LIST_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_enum_list_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_string(code)); + fl_value_append_take(self->value, + fl_value_new_string(message != nullptr ? message : "")); + fl_value_append_take(self->value, details != nullptr ? fl_value_ref(details) + : fl_value_new_null()); + return self; +} + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableNonNullClassListResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_class_list_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_NON_NULL_CLASS_LIST_RESPONSE, + GObject) + +struct + _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableNonNullClassListResponse { + GObject parent_instance; + + FlValue* value; +}; + +G_DEFINE_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableNonNullClassListResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_class_list_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_class_list_response_dispose( + GObject* object) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableNonNullClassListResponse* + self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_NON_NULL_CLASS_LIST_RESPONSE( + object); + g_clear_pointer(&self->value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_class_list_response_parent_class) + ->dispose(object); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_class_list_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableNonNullClassListResponse* + self) {} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_class_list_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableNonNullClassListResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_class_list_response_dispose; +} + +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableNonNullClassListResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_class_list_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableNonNullClassListResponse* + self = CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_NON_NULL_CLASS_LIST_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_class_list_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, return_value != nullptr + ? fl_value_ref(return_value) + : fl_value_new_null()); + return self; +} + +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableNonNullClassListResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_class_list_response_new_error( + const gchar* code, const gchar* message, FlValue* details) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableNonNullClassListResponse* + self = CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_NON_NULL_CLASS_LIST_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_class_list_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_string(code)); + fl_value_append_take(self->value, + fl_value_new_string(message != nullptr ? message : "")); + fl_value_append_take(self->value, details != nullptr ? fl_value_ref(details) + : fl_value_new_null()); + return self; +} + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableMapResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_map_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_MAP_RESPONSE, GObject) + +struct + _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableMapResponse { + GObject parent_instance; + + FlValue* value; +}; + +G_DEFINE_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableMapResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_map_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_map_response_dispose( + GObject* object) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_MAP_RESPONSE( + object); + g_clear_pointer(&self->value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_map_response_parent_class) + ->dispose(object); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_map_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableMapResponse* + self) {} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_map_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableMapResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_map_response_dispose; +} + +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableMapResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_map_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_MAP_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_map_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, return_value != nullptr + ? fl_value_ref(return_value) + : fl_value_new_null()); + return self; +} + +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableMapResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_map_response_new_error( + const gchar* code, const gchar* message, FlValue* details) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_MAP_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_map_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_string(code)); + fl_value_append_take(self->value, + fl_value_new_string(message != nullptr ? message : "")); + fl_value_append_take(self->value, details != nullptr ? fl_value_ref(details) + : fl_value_new_null()); + return self; +} + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableStringMapResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_string_map_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_STRING_MAP_RESPONSE, + GObject) + +struct + _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableStringMapResponse { + GObject parent_instance; + + FlValue* value; +}; + +G_DEFINE_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableStringMapResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_string_map_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_string_map_response_dispose( + GObject* object) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableStringMapResponse* + self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_STRING_MAP_RESPONSE( + object); + g_clear_pointer(&self->value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_string_map_response_parent_class) + ->dispose(object); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_string_map_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableStringMapResponse* + self) {} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_string_map_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableStringMapResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_string_map_response_dispose; +} + +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableStringMapResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_string_map_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableStringMapResponse* + self = CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_STRING_MAP_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_string_map_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, return_value != nullptr + ? fl_value_ref(return_value) + : fl_value_new_null()); + return self; +} + +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableStringMapResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_string_map_response_new_error( + const gchar* code, const gchar* message, FlValue* details) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableStringMapResponse* + self = CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_STRING_MAP_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_string_map_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_string(code)); + fl_value_append_take(self->value, + fl_value_new_string(message != nullptr ? message : "")); + fl_value_append_take(self->value, details != nullptr ? fl_value_ref(details) + : fl_value_new_null()); + return self; +} + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableIntMapResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_int_map_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_INT_MAP_RESPONSE, + GObject) + +struct + _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableIntMapResponse { + GObject parent_instance; + + FlValue* value; +}; + +G_DEFINE_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableIntMapResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_int_map_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_int_map_response_dispose( + GObject* object) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableIntMapResponse* + self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_INT_MAP_RESPONSE( + object); + g_clear_pointer(&self->value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_int_map_response_parent_class) + ->dispose(object); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_int_map_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableIntMapResponse* + self) {} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_int_map_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableIntMapResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_int_map_response_dispose; +} + +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableIntMapResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_int_map_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableIntMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_INT_MAP_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_int_map_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, return_value != nullptr + ? fl_value_ref(return_value) + : fl_value_new_null()); + return self; +} + +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableIntMapResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_int_map_response_new_error( + const gchar* code, const gchar* message, FlValue* details) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableIntMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_INT_MAP_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_int_map_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_string(code)); + fl_value_append_take(self->value, + fl_value_new_string(message != nullptr ? message : "")); + fl_value_append_take(self->value, details != nullptr ? fl_value_ref(details) + : fl_value_new_null()); + return self; +} + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableEnumMapResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_enum_map_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_ENUM_MAP_RESPONSE, + GObject) + +struct + _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableEnumMapResponse { + GObject parent_instance; + + FlValue* value; +}; + +G_DEFINE_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableEnumMapResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_enum_map_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_enum_map_response_dispose( + GObject* object) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableEnumMapResponse* + self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_ENUM_MAP_RESPONSE( + object); + g_clear_pointer(&self->value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_enum_map_response_parent_class) + ->dispose(object); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_enum_map_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableEnumMapResponse* + self) {} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_enum_map_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableEnumMapResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_enum_map_response_dispose; +} + +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableEnumMapResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_enum_map_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableEnumMapResponse* + self = CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_ENUM_MAP_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_enum_map_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, return_value != nullptr + ? fl_value_ref(return_value) + : fl_value_new_null()); + return self; +} + +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableEnumMapResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_enum_map_response_new_error( + const gchar* code, const gchar* message, FlValue* details) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableEnumMapResponse* + self = CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_ENUM_MAP_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_enum_map_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_string(code)); + fl_value_append_take(self->value, + fl_value_new_string(message != nullptr ? message : "")); + fl_value_append_take(self->value, details != nullptr ? fl_value_ref(details) + : fl_value_new_null()); + return self; +} + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableClassMapResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_class_map_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_CLASS_MAP_RESPONSE, + GObject) + +struct + _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableClassMapResponse { + GObject parent_instance; + + FlValue* value; +}; + +G_DEFINE_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableClassMapResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_class_map_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_class_map_response_dispose( + GObject* object) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableClassMapResponse* + self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_CLASS_MAP_RESPONSE( + object); + g_clear_pointer(&self->value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_class_map_response_parent_class) + ->dispose(object); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_class_map_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableClassMapResponse* + self) {} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_class_map_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableClassMapResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_class_map_response_dispose; +} + +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableClassMapResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_class_map_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableClassMapResponse* + self = CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_CLASS_MAP_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_class_map_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, return_value != nullptr + ? fl_value_ref(return_value) + : fl_value_new_null()); + return self; +} + +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableClassMapResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_class_map_response_new_error( + const gchar* code, const gchar* message, FlValue* details) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableClassMapResponse* + self = CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_CLASS_MAP_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_class_map_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_string(code)); + fl_value_append_take(self->value, + fl_value_new_string(message != nullptr ? message : "")); + fl_value_append_take(self->value, details != nullptr ? fl_value_ref(details) + : fl_value_new_null()); + return self; +} + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableNonNullStringMapResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_string_map_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_NON_NULL_STRING_MAP_RESPONSE, + GObject) + +struct + _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableNonNullStringMapResponse { + GObject parent_instance; + + FlValue* value; +}; + +G_DEFINE_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableNonNullStringMapResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_string_map_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_string_map_response_dispose( + GObject* object) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableNonNullStringMapResponse* + self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_NON_NULL_STRING_MAP_RESPONSE( + object); + g_clear_pointer(&self->value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_string_map_response_parent_class) + ->dispose(object); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_string_map_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableNonNullStringMapResponse* + self) {} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_string_map_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableNonNullStringMapResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_string_map_response_dispose; +} + +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableNonNullStringMapResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_string_map_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableNonNullStringMapResponse* + self = CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_NON_NULL_STRING_MAP_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_string_map_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, return_value != nullptr + ? fl_value_ref(return_value) + : fl_value_new_null()); + return self; +} + +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableNonNullStringMapResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_string_map_response_new_error( + const gchar* code, const gchar* message, FlValue* details) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableNonNullStringMapResponse* + self = CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_NON_NULL_STRING_MAP_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_string_map_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_string(code)); + fl_value_append_take(self->value, + fl_value_new_string(message != nullptr ? message : "")); + fl_value_append_take(self->value, details != nullptr ? fl_value_ref(details) + : fl_value_new_null()); + return self; +} + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableNonNullIntMapResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_int_map_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_NON_NULL_INT_MAP_RESPONSE, + GObject) + +struct + _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableNonNullIntMapResponse { + GObject parent_instance; + + FlValue* value; +}; + +G_DEFINE_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableNonNullIntMapResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_int_map_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_int_map_response_dispose( + GObject* object) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableNonNullIntMapResponse* + self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_NON_NULL_INT_MAP_RESPONSE( + object); + g_clear_pointer(&self->value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_int_map_response_parent_class) + ->dispose(object); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_int_map_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableNonNullIntMapResponse* + self) {} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_int_map_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableNonNullIntMapResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_int_map_response_dispose; +} + +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableNonNullIntMapResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_int_map_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableNonNullIntMapResponse* + self = CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_NON_NULL_INT_MAP_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_int_map_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, return_value != nullptr + ? fl_value_ref(return_value) + : fl_value_new_null()); + return self; +} + +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableNonNullIntMapResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_int_map_response_new_error( + const gchar* code, const gchar* message, FlValue* details) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableNonNullIntMapResponse* + self = CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_NON_NULL_INT_MAP_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_int_map_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_string(code)); + fl_value_append_take(self->value, + fl_value_new_string(message != nullptr ? message : "")); + fl_value_append_take(self->value, details != nullptr ? fl_value_ref(details) + : fl_value_new_null()); + return self; +} + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableNonNullEnumMapResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_enum_map_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_NON_NULL_ENUM_MAP_RESPONSE, + GObject) + +struct + _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableNonNullEnumMapResponse { + GObject parent_instance; + + FlValue* value; +}; + +G_DEFINE_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableNonNullEnumMapResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_enum_map_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_enum_map_response_dispose( + GObject* object) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableNonNullEnumMapResponse* + self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_NON_NULL_ENUM_MAP_RESPONSE( + object); + g_clear_pointer(&self->value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_enum_map_response_parent_class) + ->dispose(object); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_enum_map_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableNonNullEnumMapResponse* + self) {} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_enum_map_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableNonNullEnumMapResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_enum_map_response_dispose; +} + +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableNonNullEnumMapResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_enum_map_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableNonNullEnumMapResponse* + self = CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_NON_NULL_ENUM_MAP_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_enum_map_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, return_value != nullptr + ? fl_value_ref(return_value) + : fl_value_new_null()); + return self; +} + +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableNonNullEnumMapResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_enum_map_response_new_error( + const gchar* code, const gchar* message, FlValue* details) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableNonNullEnumMapResponse* + self = CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_NON_NULL_ENUM_MAP_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_enum_map_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_string(code)); + fl_value_append_take(self->value, + fl_value_new_string(message != nullptr ? message : "")); + fl_value_append_take(self->value, details != nullptr ? fl_value_ref(details) + : fl_value_new_null()); + return self; +} + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableNonNullClassMapResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_class_map_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_NON_NULL_CLASS_MAP_RESPONSE, + GObject) + +struct + _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableNonNullClassMapResponse { + GObject parent_instance; + + FlValue* value; +}; + +G_DEFINE_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableNonNullClassMapResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_class_map_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_class_map_response_dispose( + GObject* object) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableNonNullClassMapResponse* + self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_NON_NULL_CLASS_MAP_RESPONSE( + object); + g_clear_pointer(&self->value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_class_map_response_parent_class) + ->dispose(object); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_class_map_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableNonNullClassMapResponse* + self) {} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_class_map_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableNonNullClassMapResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_class_map_response_dispose; +} + +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableNonNullClassMapResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_class_map_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableNonNullClassMapResponse* + self = CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_NON_NULL_CLASS_MAP_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_class_map_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, return_value != nullptr + ? fl_value_ref(return_value) + : fl_value_new_null()); + return self; +} + +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableNonNullClassMapResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_class_map_response_new_error( + const gchar* code, const gchar* message, FlValue* details) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableNonNullClassMapResponse* + self = CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_NON_NULL_CLASS_MAP_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_class_map_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_string(code)); + fl_value_append_take(self->value, + fl_value_new_string(message != nullptr ? message : "")); + fl_value_append_take(self->value, details != nullptr ? fl_value_ref(details) + : fl_value_new_null()); + return self; +} + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableEnumResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_enum_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_ENUM_RESPONSE, GObject) + +struct + _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableEnumResponse { + GObject parent_instance; + + FlValue* value; +}; + +G_DEFINE_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableEnumResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_enum_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_enum_response_dispose( + GObject* object) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableEnumResponse* + self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_ENUM_RESPONSE( + object); + g_clear_pointer(&self->value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_enum_response_parent_class) + ->dispose(object); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_enum_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableEnumResponse* + self) {} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_enum_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableEnumResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_enum_response_dispose; +} + +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableEnumResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_enum_response_new( + CoreTestsPigeonTestAnEnum* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableEnumResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_ENUM_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_enum_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take( + self->value, + return_value != nullptr + ? fl_value_new_custom(129, fl_value_new_int(*return_value), + (GDestroyNotify)fl_value_unref) + : fl_value_new_null()); + return self; +} + +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableEnumResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_enum_response_new_error( + const gchar* code, const gchar* message, FlValue* details) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableEnumResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_ENUM_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_enum_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_string(code)); + fl_value_append_take(self->value, + fl_value_new_string(message != nullptr ? message : "")); + fl_value_append_take(self->value, details != nullptr ? fl_value_ref(details) + : fl_value_new_null()); + return self; +} + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAnotherNullableEnumResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_another_nullable_enum_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_ANOTHER_NULLABLE_ENUM_RESPONSE, + GObject) + +struct + _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAnotherNullableEnumResponse { + GObject parent_instance; + + FlValue* value; +}; + +G_DEFINE_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAnotherNullableEnumResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_another_nullable_enum_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_another_nullable_enum_response_dispose( + GObject* object) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAnotherNullableEnumResponse* + self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_ANOTHER_NULLABLE_ENUM_RESPONSE( + object); + g_clear_pointer(&self->value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_another_nullable_enum_response_parent_class) + ->dispose(object); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_another_nullable_enum_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAnotherNullableEnumResponse* + self) {} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_another_nullable_enum_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAnotherNullableEnumResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_another_nullable_enum_response_dispose; +} + +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAnotherNullableEnumResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_another_nullable_enum_response_new( + CoreTestsPigeonTestAnotherEnum* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAnotherNullableEnumResponse* + self = CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_ANOTHER_NULLABLE_ENUM_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_another_nullable_enum_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take( + self->value, + return_value != nullptr + ? fl_value_new_custom(130, fl_value_new_int(*return_value), + (GDestroyNotify)fl_value_unref) + : fl_value_new_null()); + return self; +} + +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAnotherNullableEnumResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_another_nullable_enum_response_new_error( + const gchar* code, const gchar* message, FlValue* details) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAnotherNullableEnumResponse* + self = CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_ANOTHER_NULLABLE_ENUM_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_another_nullable_enum_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_string(code)); + fl_value_append_take(self->value, + fl_value_new_string(message != nullptr ? message : "")); + fl_value_append_take(self->value, details != nullptr ? fl_value_ref(details) + : fl_value_new_null()); + return self; +} + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterSmallApiEchoStringResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_small_api_echo_string_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_CALL_FLUTTER_SMALL_API_ECHO_STRING_RESPONSE, + GObject) + +struct + _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterSmallApiEchoStringResponse { + GObject parent_instance; + + FlValue* value; +}; + +G_DEFINE_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterSmallApiEchoStringResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_small_api_echo_string_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_small_api_echo_string_response_dispose( + GObject* object) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterSmallApiEchoStringResponse* + self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_SMALL_API_ECHO_STRING_RESPONSE( + object); + g_clear_pointer(&self->value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_host_integration_core_api_call_flutter_small_api_echo_string_response_parent_class) + ->dispose(object); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_small_api_echo_string_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterSmallApiEchoStringResponse* + self) {} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_small_api_echo_string_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterSmallApiEchoStringResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_host_integration_core_api_call_flutter_small_api_echo_string_response_dispose; +} + +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterSmallApiEchoStringResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_small_api_echo_string_response_new( + const gchar* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterSmallApiEchoStringResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_SMALL_API_ECHO_STRING_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_small_api_echo_string_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_string(return_value)); + return self; +} + +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterSmallApiEchoStringResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_small_api_echo_string_response_new_error( + const gchar* code, const gchar* message, FlValue* details) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterSmallApiEchoStringResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_SMALL_API_ECHO_STRING_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_small_api_echo_string_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_string(code)); + fl_value_append_take(self->value, + fl_value_new_string(message != nullptr ? message : "")); + fl_value_append_take(self->value, details != nullptr ? fl_value_ref(details) + : fl_value_new_null()); + return self; +} + +G_DECLARE_FINAL_TYPE(CoreTestsPigeonTestHostIntegrationCoreApi, + core_tests_pigeon_test_host_integration_core_api, + CORE_TESTS_PIGEON_TEST, HOST_INTEGRATION_CORE_API, GObject) + +struct _CoreTestsPigeonTestHostIntegrationCoreApi { + GObject parent_instance; + + const CoreTestsPigeonTestHostIntegrationCoreApiVTable* vtable; + gpointer user_data; + GDestroyNotify user_data_free_func; +}; + +G_DEFINE_TYPE(CoreTestsPigeonTestHostIntegrationCoreApi, + core_tests_pigeon_test_host_integration_core_api, G_TYPE_OBJECT) + +static void core_tests_pigeon_test_host_integration_core_api_dispose( + GObject* object) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(object); + if (self->user_data != nullptr) { + self->user_data_free_func(self->user_data); + } + self->user_data = nullptr; + G_OBJECT_CLASS(core_tests_pigeon_test_host_integration_core_api_parent_class) + ->dispose(object); +} + +static void core_tests_pigeon_test_host_integration_core_api_init( + CoreTestsPigeonTestHostIntegrationCoreApi* self) {} + +static void core_tests_pigeon_test_host_integration_core_api_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiClass* klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_host_integration_core_api_dispose; +} + +static CoreTestsPigeonTestHostIntegrationCoreApi* +core_tests_pigeon_test_host_integration_core_api_new( + const CoreTestsPigeonTestHostIntegrationCoreApiVTable* vtable, + gpointer user_data, GDestroyNotify user_data_free_func) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(g_object_new( + core_tests_pigeon_test_host_integration_core_api_get_type(), + nullptr)); + self->vtable = vtable; + self->user_data = user_data; + self->user_data_free_func = user_data_free_func; + return self; +} + +static void core_tests_pigeon_test_host_integration_core_api_noop_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || self->vtable->noop == nullptr) { + return; + } + + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiNoopResponse) response = + self->vtable->noop(self->user_data); + if (response == nullptr) { + g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", + "noop"); + return; + } + + g_autoptr(GError) error = NULL; + if (!fl_basic_message_channel_respond(channel, response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "noop", error->message); + } +} + +static void core_tests_pigeon_test_host_integration_core_api_echo_all_types_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || self->vtable->echo_all_types == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + CoreTestsPigeonTestAllTypes* everything = CORE_TESTS_PIGEON_TEST_ALL_TYPES( + fl_value_get_custom_value_object(value0)); + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiEchoAllTypesResponse) + response = self->vtable->echo_all_types(everything, self->user_data); + if (response == nullptr) { + g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", + "echoAllTypes"); + return; + } + + g_autoptr(GError) error = NULL; + if (!fl_basic_message_channel_respond(channel, response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAllTypes", error->message); + } +} + +static void core_tests_pigeon_test_host_integration_core_api_throw_error_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || self->vtable->throw_error == nullptr) { + return; + } + + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiThrowErrorResponse) + response = self->vtable->throw_error(self->user_data); + if (response == nullptr) { + g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", + "throwError"); + return; + } + + g_autoptr(GError) error = NULL; + if (!fl_basic_message_channel_respond(channel, response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "throwError", error->message); + } +} + +static void +core_tests_pigeon_test_host_integration_core_api_throw_error_from_void_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->throw_error_from_void == nullptr) { + return; + } + + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiThrowErrorFromVoidResponse) + response = self->vtable->throw_error_from_void(self->user_data); + if (response == nullptr) { + g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", + "throwErrorFromVoid"); + return; + } + + g_autoptr(GError) error = NULL; + if (!fl_basic_message_channel_respond(channel, response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "throwErrorFromVoid", error->message); + } +} + +static void +core_tests_pigeon_test_host_integration_core_api_throw_flutter_error_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || self->vtable->throw_flutter_error == nullptr) { + return; + } + + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiThrowFlutterErrorResponse) + response = self->vtable->throw_flutter_error(self->user_data); + if (response == nullptr) { + g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", + "throwFlutterError"); + return; + } + + g_autoptr(GError) error = NULL; + if (!fl_basic_message_channel_respond(channel, response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "throwFlutterError", error->message); + } +} + +static void core_tests_pigeon_test_host_integration_core_api_echo_int_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || self->vtable->echo_int == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + int64_t an_int = fl_value_get_int(value0); + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiEchoIntResponse) response = + self->vtable->echo_int(an_int, self->user_data); + if (response == nullptr) { + g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", + "echoInt"); + return; + } + + g_autoptr(GError) error = NULL; + if (!fl_basic_message_channel_respond(channel, response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoInt", error->message); + } +} + +static void core_tests_pigeon_test_host_integration_core_api_echo_double_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || self->vtable->echo_double == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + double a_double = fl_value_get_float(value0); + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiEchoDoubleResponse) + response = self->vtable->echo_double(a_double, self->user_data); + if (response == nullptr) { + g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", + "echoDouble"); + return; + } + + g_autoptr(GError) error = NULL; + if (!fl_basic_message_channel_respond(channel, response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoDouble", error->message); + } +} + +static void core_tests_pigeon_test_host_integration_core_api_echo_bool_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || self->vtable->echo_bool == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + gboolean a_bool = fl_value_get_bool(value0); + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiEchoBoolResponse) + response = self->vtable->echo_bool(a_bool, self->user_data); + if (response == nullptr) { + g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", + "echoBool"); + return; + } + + g_autoptr(GError) error = NULL; + if (!fl_basic_message_channel_respond(channel, response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoBool", error->message); + } +} + +static void core_tests_pigeon_test_host_integration_core_api_echo_string_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || self->vtable->echo_string == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + const gchar* a_string = fl_value_get_string(value0); + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiEchoStringResponse) + response = self->vtable->echo_string(a_string, self->user_data); + if (response == nullptr) { + g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", + "echoString"); + return; + } + + g_autoptr(GError) error = NULL; + if (!fl_basic_message_channel_respond(channel, response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoString", error->message); + } +} + +static void core_tests_pigeon_test_host_integration_core_api_echo_uint8_list_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || self->vtable->echo_uint8_list == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + const uint8_t* a_uint8_list = fl_value_get_uint8_list(value0); + size_t a_uint8_list_length = fl_value_get_length(value0); + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiEchoUint8ListResponse) + response = self->vtable->echo_uint8_list( + a_uint8_list, a_uint8_list_length, self->user_data); + if (response == nullptr) { + g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", + "echoUint8List"); + return; + } + + g_autoptr(GError) error = NULL; + if (!fl_basic_message_channel_respond(channel, response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoUint8List", error->message); + } +} + +static void core_tests_pigeon_test_host_integration_core_api_echo_object_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || self->vtable->echo_object == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* an_object = value0; + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiEchoObjectResponse) + response = self->vtable->echo_object(an_object, self->user_data); + if (response == nullptr) { + g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", + "echoObject"); + return; + } + + g_autoptr(GError) error = NULL; + if (!fl_basic_message_channel_respond(channel, response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoObject", error->message); + } +} + +static void core_tests_pigeon_test_host_integration_core_api_echo_list_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || self->vtable->echo_list == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* list = value0; + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiEchoListResponse) + response = self->vtable->echo_list(list, self->user_data); + if (response == nullptr) { + g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", + "echoList"); + return; + } + + g_autoptr(GError) error = NULL; + if (!fl_basic_message_channel_respond(channel, response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoList", error->message); + } +} + +static void core_tests_pigeon_test_host_integration_core_api_echo_enum_list_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || self->vtable->echo_enum_list == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* enum_list = value0; + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumListResponse) + response = self->vtable->echo_enum_list(enum_list, self->user_data); + if (response == nullptr) { + g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", + "echoEnumList"); + return; + } + + g_autoptr(GError) error = NULL; + if (!fl_basic_message_channel_respond(channel, response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoEnumList", error->message); + } +} + +static void core_tests_pigeon_test_host_integration_core_api_echo_class_list_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || self->vtable->echo_class_list == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* class_list = value0; + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiEchoClassListResponse) + response = self->vtable->echo_class_list(class_list, self->user_data); + if (response == nullptr) { + g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", + "echoClassList"); + return; + } + + g_autoptr(GError) error = NULL; + if (!fl_basic_message_channel_respond(channel, response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoClassList", error->message); + } +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_non_null_enum_list_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->echo_non_null_enum_list == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* enum_list = value0; + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullEnumListResponse) + response = + self->vtable->echo_non_null_enum_list(enum_list, self->user_data); + if (response == nullptr) { + g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", + "echoNonNullEnumList"); + return; + } + + g_autoptr(GError) error = NULL; + if (!fl_basic_message_channel_respond(channel, response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoNonNullEnumList", error->message); + } +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_non_null_class_list_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->echo_non_null_class_list == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* class_list = value0; + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullClassListResponse) + response = + self->vtable->echo_non_null_class_list(class_list, self->user_data); + if (response == nullptr) { + g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", + "echoNonNullClassList"); + return; + } + + g_autoptr(GError) error = NULL; + if (!fl_basic_message_channel_respond(channel, response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoNonNullClassList", error->message); + } +} + +static void core_tests_pigeon_test_host_integration_core_api_echo_map_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || self->vtable->echo_map == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* map = value0; + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiEchoMapResponse) response = + self->vtable->echo_map(map, self->user_data); + if (response == nullptr) { + g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", + "echoMap"); + return; + } + + g_autoptr(GError) error = NULL; + if (!fl_basic_message_channel_respond(channel, response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoMap", error->message); + } +} + +static void core_tests_pigeon_test_host_integration_core_api_echo_string_map_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || self->vtable->echo_string_map == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* string_map = value0; + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiEchoStringMapResponse) + response = self->vtable->echo_string_map(string_map, self->user_data); + if (response == nullptr) { + g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", + "echoStringMap"); + return; + } + + g_autoptr(GError) error = NULL; + if (!fl_basic_message_channel_respond(channel, response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoStringMap", error->message); + } +} + +static void core_tests_pigeon_test_host_integration_core_api_echo_int_map_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || self->vtable->echo_int_map == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* int_map = value0; + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiEchoIntMapResponse) + response = self->vtable->echo_int_map(int_map, self->user_data); + if (response == nullptr) { + g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", + "echoIntMap"); + return; + } + + g_autoptr(GError) error = NULL; + if (!fl_basic_message_channel_respond(channel, response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoIntMap", error->message); + } +} + +static void core_tests_pigeon_test_host_integration_core_api_echo_enum_map_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || self->vtable->echo_enum_map == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* enum_map = value0; + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumMapResponse) + response = self->vtable->echo_enum_map(enum_map, self->user_data); + if (response == nullptr) { + g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", + "echoEnumMap"); + return; + } + + g_autoptr(GError) error = NULL; + if (!fl_basic_message_channel_respond(channel, response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoEnumMap", error->message); + } +} + +static void core_tests_pigeon_test_host_integration_core_api_echo_class_map_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || self->vtable->echo_class_map == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* class_map = value0; + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiEchoClassMapResponse) + response = self->vtable->echo_class_map(class_map, self->user_data); + if (response == nullptr) { + g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", + "echoClassMap"); + return; + } + + g_autoptr(GError) error = NULL; + if (!fl_basic_message_channel_respond(channel, response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoClassMap", error->message); + } +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_non_null_string_map_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->echo_non_null_string_map == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* string_map = value0; + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullStringMapResponse) + response = + self->vtable->echo_non_null_string_map(string_map, self->user_data); + if (response == nullptr) { + g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", + "echoNonNullStringMap"); + return; + } + + g_autoptr(GError) error = NULL; + if (!fl_basic_message_channel_respond(channel, response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoNonNullStringMap", error->message); + } +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_non_null_int_map_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->echo_non_null_int_map == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* int_map = value0; + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullIntMapResponse) + response = self->vtable->echo_non_null_int_map(int_map, self->user_data); + if (response == nullptr) { + g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", + "echoNonNullIntMap"); + return; + } + + g_autoptr(GError) error = NULL; + if (!fl_basic_message_channel_respond(channel, response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoNonNullIntMap", error->message); + } +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_non_null_enum_map_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->echo_non_null_enum_map == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* enum_map = value0; + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullEnumMapResponse) + response = + self->vtable->echo_non_null_enum_map(enum_map, self->user_data); + if (response == nullptr) { + g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", + "echoNonNullEnumMap"); + return; + } + + g_autoptr(GError) error = NULL; + if (!fl_basic_message_channel_respond(channel, response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoNonNullEnumMap", error->message); + } +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_non_null_class_map_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->echo_non_null_class_map == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* class_map = value0; + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullClassMapResponse) + response = + self->vtable->echo_non_null_class_map(class_map, self->user_data); + if (response == nullptr) { + g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", + "echoNonNullClassMap"); + return; + } + + g_autoptr(GError) error = NULL; + if (!fl_basic_message_channel_respond(channel, response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoNonNullClassMap", error->message); + } +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_class_wrapper_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || self->vtable->echo_class_wrapper == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + CoreTestsPigeonTestAllClassesWrapper* wrapper = + CORE_TESTS_PIGEON_TEST_ALL_CLASSES_WRAPPER( + fl_value_get_custom_value_object(value0)); + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiEchoClassWrapperResponse) + response = self->vtable->echo_class_wrapper(wrapper, self->user_data); + if (response == nullptr) { + g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", + "echoClassWrapper"); + return; + } + + g_autoptr(GError) error = NULL; + if (!fl_basic_message_channel_respond(channel, response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoClassWrapper", error->message); + } +} + +static void core_tests_pigeon_test_host_integration_core_api_echo_enum_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || self->vtable->echo_enum == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + CoreTestsPigeonTestAnEnum an_enum = static_cast( + fl_value_get_int(reinterpret_cast( + const_cast(fl_value_get_custom_value(value0))))); + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumResponse) + response = self->vtable->echo_enum(an_enum, self->user_data); + if (response == nullptr) { + g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", + "echoEnum"); + return; + } + + g_autoptr(GError) error = NULL; + if (!fl_basic_message_channel_respond(channel, response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoEnum", error->message); + } +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_another_enum_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || self->vtable->echo_another_enum == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + CoreTestsPigeonTestAnotherEnum another_enum = + static_cast( + fl_value_get_int(reinterpret_cast( + const_cast(fl_value_get_custom_value(value0))))); + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherEnumResponse) + response = self->vtable->echo_another_enum(another_enum, self->user_data); + if (response == nullptr) { + g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", + "echoAnotherEnum"); + return; + } + + g_autoptr(GError) error = NULL; + if (!fl_basic_message_channel_respond(channel, response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAnotherEnum", error->message); + } +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_named_default_string_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->echo_named_default_string == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + const gchar* a_string = fl_value_get_string(value0); + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNamedDefaultStringResponse) + response = + self->vtable->echo_named_default_string(a_string, self->user_data); + if (response == nullptr) { + g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", + "echoNamedDefaultString"); + return; + } + + g_autoptr(GError) error = NULL; + if (!fl_basic_message_channel_respond(channel, response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoNamedDefaultString", error->message); + } +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_optional_default_double_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->echo_optional_default_double == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + double a_double = fl_value_get_float(value0); + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoOptionalDefaultDoubleResponse) + response = + self->vtable->echo_optional_default_double(a_double, self->user_data); + if (response == nullptr) { + g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", + "echoOptionalDefaultDouble"); + return; + } + + g_autoptr(GError) error = NULL; + if (!fl_basic_message_channel_respond(channel, response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoOptionalDefaultDouble", error->message); + } +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_required_int_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || self->vtable->echo_required_int == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + int64_t an_int = fl_value_get_int(value0); + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiEchoRequiredIntResponse) + response = self->vtable->echo_required_int(an_int, self->user_data); + if (response == nullptr) { + g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", + "echoRequiredInt"); + return; + } + + g_autoptr(GError) error = NULL; + if (!fl_basic_message_channel_respond(channel, response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoRequiredInt", error->message); + } +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_all_nullable_types_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->echo_all_nullable_types == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + CoreTestsPigeonTestAllNullableTypes* everything = + CORE_TESTS_PIGEON_TEST_ALL_NULLABLE_TYPES( + fl_value_get_custom_value_object(value0)); + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAllNullableTypesResponse) + response = + self->vtable->echo_all_nullable_types(everything, self->user_data); + if (response == nullptr) { + g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", + "echoAllNullableTypes"); + return; + } + + g_autoptr(GError) error = NULL; + if (!fl_basic_message_channel_respond(channel, response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAllNullableTypes", error->message); + } +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_all_nullable_types_without_recursion_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->echo_all_nullable_types_without_recursion == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + CoreTestsPigeonTestAllNullableTypesWithoutRecursion* everything = + CORE_TESTS_PIGEON_TEST_ALL_NULLABLE_TYPES_WITHOUT_RECURSION( + fl_value_get_custom_value_object(value0)); + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponse) + response = self->vtable->echo_all_nullable_types_without_recursion( + everything, self->user_data); + if (response == nullptr) { + g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", + "echoAllNullableTypesWithoutRecursion"); + return; + } + + g_autoptr(GError) error = NULL; + if (!fl_basic_message_channel_respond(channel, response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAllNullableTypesWithoutRecursion", error->message); + } +} + +static void +core_tests_pigeon_test_host_integration_core_api_extract_nested_nullable_string_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->extract_nested_nullable_string == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + CoreTestsPigeonTestAllClassesWrapper* wrapper = + CORE_TESTS_PIGEON_TEST_ALL_CLASSES_WRAPPER( + fl_value_get_custom_value_object(value0)); + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiExtractNestedNullableStringResponse) + response = self->vtable->extract_nested_nullable_string(wrapper, + self->user_data); + if (response == nullptr) { + g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", + "extractNestedNullableString"); + return; + } + + g_autoptr(GError) error = NULL; + if (!fl_basic_message_channel_respond(channel, response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "extractNestedNullableString", error->message); + } +} + +static void +core_tests_pigeon_test_host_integration_core_api_create_nested_nullable_string_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->create_nested_nullable_string == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + const gchar* nullable_string = fl_value_get_string(value0); + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCreateNestedNullableStringResponse) + response = self->vtable->create_nested_nullable_string(nullable_string, + self->user_data); + if (response == nullptr) { + g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", + "createNestedNullableString"); + return; + } + + g_autoptr(GError) error = NULL; + if (!fl_basic_message_channel_respond(channel, response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "createNestedNullableString", error->message); + } +} + +static void +core_tests_pigeon_test_host_integration_core_api_send_multiple_nullable_types_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->send_multiple_nullable_types == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + gboolean* a_nullable_bool = nullptr; + gboolean a_nullable_bool_value; + if (fl_value_get_type(value0) != FL_VALUE_TYPE_NULL) { + a_nullable_bool_value = fl_value_get_bool(value0); + a_nullable_bool = &a_nullable_bool_value; + } + FlValue* value1 = fl_value_get_list_value(message_, 1); + int64_t* a_nullable_int = nullptr; + int64_t a_nullable_int_value; + if (fl_value_get_type(value1) != FL_VALUE_TYPE_NULL) { + a_nullable_int_value = fl_value_get_int(value1); + a_nullable_int = &a_nullable_int_value; + } + FlValue* value2 = fl_value_get_list_value(message_, 2); + const gchar* a_nullable_string = fl_value_get_string(value2); + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiSendMultipleNullableTypesResponse) + response = self->vtable->send_multiple_nullable_types( + a_nullable_bool, a_nullable_int, a_nullable_string, self->user_data); + if (response == nullptr) { + g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", + "sendMultipleNullableTypes"); + return; + } + + g_autoptr(GError) error = NULL; + if (!fl_basic_message_channel_respond(channel, response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "sendMultipleNullableTypes", error->message); + } +} + +static void +core_tests_pigeon_test_host_integration_core_api_send_multiple_nullable_types_without_recursion_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->send_multiple_nullable_types_without_recursion == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + gboolean* a_nullable_bool = nullptr; + gboolean a_nullable_bool_value; + if (fl_value_get_type(value0) != FL_VALUE_TYPE_NULL) { + a_nullable_bool_value = fl_value_get_bool(value0); + a_nullable_bool = &a_nullable_bool_value; + } + FlValue* value1 = fl_value_get_list_value(message_, 1); + int64_t* a_nullable_int = nullptr; + int64_t a_nullable_int_value; + if (fl_value_get_type(value1) != FL_VALUE_TYPE_NULL) { + a_nullable_int_value = fl_value_get_int(value1); + a_nullable_int = &a_nullable_int_value; + } + FlValue* value2 = fl_value_get_list_value(message_, 2); + const gchar* a_nullable_string = fl_value_get_string(value2); + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponse) + response = self->vtable->send_multiple_nullable_types_without_recursion( + a_nullable_bool, a_nullable_int, a_nullable_string, self->user_data); + if (response == nullptr) { + g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", + "sendMultipleNullableTypesWithoutRecursion"); + return; + } + + g_autoptr(GError) error = NULL; + if (!fl_basic_message_channel_respond(channel, response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "sendMultipleNullableTypesWithoutRecursion", error->message); + } +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_nullable_int_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || self->vtable->echo_nullable_int == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + int64_t* a_nullable_int = nullptr; + int64_t a_nullable_int_value; + if (fl_value_get_type(value0) != FL_VALUE_TYPE_NULL) { + a_nullable_int_value = fl_value_get_int(value0); + a_nullable_int = &a_nullable_int_value; + } + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableIntResponse) + response = + self->vtable->echo_nullable_int(a_nullable_int, self->user_data); + if (response == nullptr) { + g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", + "echoNullableInt"); + return; + } + + g_autoptr(GError) error = NULL; + if (!fl_basic_message_channel_respond(channel, response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoNullableInt", error->message); + } +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_nullable_double_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->echo_nullable_double == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + double* a_nullable_double = nullptr; + double a_nullable_double_value; + if (fl_value_get_type(value0) != FL_VALUE_TYPE_NULL) { + a_nullable_double_value = fl_value_get_float(value0); + a_nullable_double = &a_nullable_double_value; + } + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableDoubleResponse) + response = self->vtable->echo_nullable_double(a_nullable_double, + self->user_data); + if (response == nullptr) { + g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", + "echoNullableDouble"); + return; + } + + g_autoptr(GError) error = NULL; + if (!fl_basic_message_channel_respond(channel, response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoNullableDouble", error->message); + } +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_nullable_bool_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || self->vtable->echo_nullable_bool == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + gboolean* a_nullable_bool = nullptr; + gboolean a_nullable_bool_value; + if (fl_value_get_type(value0) != FL_VALUE_TYPE_NULL) { + a_nullable_bool_value = fl_value_get_bool(value0); + a_nullable_bool = &a_nullable_bool_value; + } + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableBoolResponse) + response = + self->vtable->echo_nullable_bool(a_nullable_bool, self->user_data); + if (response == nullptr) { + g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", + "echoNullableBool"); + return; + } + + g_autoptr(GError) error = NULL; + if (!fl_basic_message_channel_respond(channel, response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoNullableBool", error->message); + } +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_nullable_string_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->echo_nullable_string == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + const gchar* a_nullable_string = fl_value_get_string(value0); + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableStringResponse) + response = self->vtable->echo_nullable_string(a_nullable_string, + self->user_data); + if (response == nullptr) { + g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", + "echoNullableString"); + return; + } + + g_autoptr(GError) error = NULL; + if (!fl_basic_message_channel_respond(channel, response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoNullableString", error->message); + } +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_nullable_uint8_list_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->echo_nullable_uint8_list == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + const uint8_t* a_nullable_uint8_list = fl_value_get_uint8_list(value0); + size_t a_nullable_uint8_list_length = fl_value_get_length(value0); + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableUint8ListResponse) + response = self->vtable->echo_nullable_uint8_list( + a_nullable_uint8_list, a_nullable_uint8_list_length, self->user_data); + if (response == nullptr) { + g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", + "echoNullableUint8List"); + return; + } + + g_autoptr(GError) error = NULL; + if (!fl_basic_message_channel_respond(channel, response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoNullableUint8List", error->message); + } +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_nullable_object_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->echo_nullable_object == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* a_nullable_object = value0; + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableObjectResponse) + response = self->vtable->echo_nullable_object(a_nullable_object, + self->user_data); + if (response == nullptr) { + g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", + "echoNullableObject"); + return; + } + + g_autoptr(GError) error = NULL; + if (!fl_basic_message_channel_respond(channel, response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoNullableObject", error->message); + } +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_nullable_list_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || self->vtable->echo_nullable_list == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* a_nullable_list = value0; + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableListResponse) + response = + self->vtable->echo_nullable_list(a_nullable_list, self->user_data); + if (response == nullptr) { + g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", + "echoNullableList"); + return; + } + + g_autoptr(GError) error = NULL; + if (!fl_basic_message_channel_respond(channel, response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoNullableList", error->message); + } +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_nullable_enum_list_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->echo_nullable_enum_list == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* enum_list = value0; + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableEnumListResponse) + response = + self->vtable->echo_nullable_enum_list(enum_list, self->user_data); + if (response == nullptr) { + g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", + "echoNullableEnumList"); + return; + } + + g_autoptr(GError) error = NULL; + if (!fl_basic_message_channel_respond(channel, response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoNullableEnumList", error->message); + } +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_nullable_class_list_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->echo_nullable_class_list == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* class_list = value0; + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableClassListResponse) + response = + self->vtable->echo_nullable_class_list(class_list, self->user_data); + if (response == nullptr) { + g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", + "echoNullableClassList"); + return; + } + + g_autoptr(GError) error = NULL; + if (!fl_basic_message_channel_respond(channel, response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoNullableClassList", error->message); + } +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_enum_list_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->echo_nullable_non_null_enum_list == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* enum_list = value0; + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullEnumListResponse) + response = self->vtable->echo_nullable_non_null_enum_list( + enum_list, self->user_data); + if (response == nullptr) { + g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", + "echoNullableNonNullEnumList"); + return; + } + + g_autoptr(GError) error = NULL; + if (!fl_basic_message_channel_respond(channel, response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoNullableNonNullEnumList", error->message); + } +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_class_list_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->echo_nullable_non_null_class_list == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* class_list = value0; + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullClassListResponse) + response = self->vtable->echo_nullable_non_null_class_list( + class_list, self->user_data); + if (response == nullptr) { + g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", + "echoNullableNonNullClassList"); + return; + } + + g_autoptr(GError) error = NULL; + if (!fl_basic_message_channel_respond(channel, response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoNullableNonNullClassList", error->message); + } +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_nullable_map_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || self->vtable->echo_nullable_map == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* map = value0; + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableMapResponse) + response = self->vtable->echo_nullable_map(map, self->user_data); + if (response == nullptr) { + g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", + "echoNullableMap"); + return; + } + + g_autoptr(GError) error = NULL; + if (!fl_basic_message_channel_respond(channel, response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoNullableMap", error->message); + } +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_nullable_string_map_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->echo_nullable_string_map == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* string_map = value0; + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableStringMapResponse) + response = + self->vtable->echo_nullable_string_map(string_map, self->user_data); + if (response == nullptr) { + g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", + "echoNullableStringMap"); + return; + } + + g_autoptr(GError) error = NULL; + if (!fl_basic_message_channel_respond(channel, response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoNullableStringMap", error->message); + } +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_nullable_int_map_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->echo_nullable_int_map == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* int_map = value0; + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableIntMapResponse) + response = self->vtable->echo_nullable_int_map(int_map, self->user_data); + if (response == nullptr) { + g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", + "echoNullableIntMap"); + return; + } + + g_autoptr(GError) error = NULL; + if (!fl_basic_message_channel_respond(channel, response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoNullableIntMap", error->message); + } +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_nullable_enum_map_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->echo_nullable_enum_map == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* enum_map = value0; + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableEnumMapResponse) + response = + self->vtable->echo_nullable_enum_map(enum_map, self->user_data); + if (response == nullptr) { + g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", + "echoNullableEnumMap"); + return; + } + + g_autoptr(GError) error = NULL; + if (!fl_basic_message_channel_respond(channel, response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoNullableEnumMap", error->message); + } +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_nullable_class_map_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->echo_nullable_class_map == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* class_map = value0; + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableClassMapResponse) + response = + self->vtable->echo_nullable_class_map(class_map, self->user_data); + if (response == nullptr) { + g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", + "echoNullableClassMap"); + return; + } + + g_autoptr(GError) error = NULL; + if (!fl_basic_message_channel_respond(channel, response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoNullableClassMap", error->message); + } +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_string_map_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->echo_nullable_non_null_string_map == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* string_map = value0; + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullStringMapResponse) + response = self->vtable->echo_nullable_non_null_string_map( + string_map, self->user_data); + if (response == nullptr) { + g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", + "echoNullableNonNullStringMap"); + return; + } + + g_autoptr(GError) error = NULL; + if (!fl_basic_message_channel_respond(channel, response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoNullableNonNullStringMap", error->message); + } +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_int_map_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->echo_nullable_non_null_int_map == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* int_map = value0; + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullIntMapResponse) + response = self->vtable->echo_nullable_non_null_int_map(int_map, + self->user_data); + if (response == nullptr) { + g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", + "echoNullableNonNullIntMap"); + return; + } + + g_autoptr(GError) error = NULL; + if (!fl_basic_message_channel_respond(channel, response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoNullableNonNullIntMap", error->message); + } +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_enum_map_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->echo_nullable_non_null_enum_map == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* enum_map = value0; + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullEnumMapResponse) + response = self->vtable->echo_nullable_non_null_enum_map(enum_map, + self->user_data); + if (response == nullptr) { + g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", + "echoNullableNonNullEnumMap"); + return; + } + + g_autoptr(GError) error = NULL; + if (!fl_basic_message_channel_respond(channel, response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoNullableNonNullEnumMap", error->message); + } +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_class_map_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->echo_nullable_non_null_class_map == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* class_map = value0; + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullClassMapResponse) + response = self->vtable->echo_nullable_non_null_class_map( + class_map, self->user_data); + if (response == nullptr) { + g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", + "echoNullableNonNullClassMap"); + return; + } + + g_autoptr(GError) error = NULL; + if (!fl_basic_message_channel_respond(channel, response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoNullableNonNullClassMap", error->message); + } +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_nullable_enum_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || self->vtable->echo_nullable_enum == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + CoreTestsPigeonTestAnEnum* an_enum = nullptr; + CoreTestsPigeonTestAnEnum an_enum_value; + if (fl_value_get_type(value0) != FL_VALUE_TYPE_NULL) { + an_enum_value = static_cast( + fl_value_get_int(reinterpret_cast( + const_cast(fl_value_get_custom_value(value0))))); + an_enum = &an_enum_value; + } + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableEnumResponse) + response = self->vtable->echo_nullable_enum(an_enum, self->user_data); + if (response == nullptr) { + g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", + "echoNullableEnum"); + return; + } + + g_autoptr(GError) error = NULL; + if (!fl_basic_message_channel_respond(channel, response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoNullableEnum", error->message); + } +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_another_nullable_enum_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->echo_another_nullable_enum == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + CoreTestsPigeonTestAnotherEnum* another_enum = nullptr; + CoreTestsPigeonTestAnotherEnum another_enum_value; + if (fl_value_get_type(value0) != FL_VALUE_TYPE_NULL) { + another_enum_value = static_cast( + fl_value_get_int(reinterpret_cast( + const_cast(fl_value_get_custom_value(value0))))); + another_enum = &another_enum_value; + } + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherNullableEnumResponse) + response = self->vtable->echo_another_nullable_enum(another_enum, + self->user_data); + if (response == nullptr) { + g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", + "echoAnotherNullableEnum"); + return; + } + + g_autoptr(GError) error = NULL; + if (!fl_basic_message_channel_respond(channel, response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAnotherNullableEnum", error->message); + } +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_optional_nullable_int_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->echo_optional_nullable_int == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + int64_t* a_nullable_int = nullptr; + int64_t a_nullable_int_value; + if (fl_value_get_type(value0) != FL_VALUE_TYPE_NULL) { + a_nullable_int_value = fl_value_get_int(value0); + a_nullable_int = &a_nullable_int_value; + } + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoOptionalNullableIntResponse) + response = self->vtable->echo_optional_nullable_int(a_nullable_int, + self->user_data); + if (response == nullptr) { + g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", + "echoOptionalNullableInt"); + return; + } + + g_autoptr(GError) error = NULL; + if (!fl_basic_message_channel_respond(channel, response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoOptionalNullableInt", error->message); + } +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_named_nullable_string_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->echo_named_nullable_string == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + const gchar* a_nullable_string = fl_value_get_string(value0); + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNamedNullableStringResponse) + response = self->vtable->echo_named_nullable_string(a_nullable_string, + self->user_data); + if (response == nullptr) { + g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", + "echoNamedNullableString"); + return; + } + + g_autoptr(GError) error = NULL; + if (!fl_basic_message_channel_respond(channel, response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoNamedNullableString", error->message); + } +} + +static void core_tests_pigeon_test_host_integration_core_api_noop_async_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || self->vtable->noop_async == nullptr) { + return; + } + + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->noop_async(handle, self->user_data); +} + +static void core_tests_pigeon_test_host_integration_core_api_echo_async_int_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || self->vtable->echo_async_int == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + int64_t an_int = fl_value_get_int(value0); + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->echo_async_int(an_int, handle, self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_async_double_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || self->vtable->echo_async_double == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + double a_double = fl_value_get_float(value0); + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->echo_async_double(a_double, handle, self->user_data); +} + +static void core_tests_pigeon_test_host_integration_core_api_echo_async_bool_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || self->vtable->echo_async_bool == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + gboolean a_bool = fl_value_get_bool(value0); + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->echo_async_bool(a_bool, handle, self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_async_string_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || self->vtable->echo_async_string == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + const gchar* a_string = fl_value_get_string(value0); + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->echo_async_string(a_string, handle, self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_async_uint8_list_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->echo_async_uint8_list == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + const uint8_t* a_uint8_list = fl_value_get_uint8_list(value0); + size_t a_uint8_list_length = fl_value_get_length(value0); + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->echo_async_uint8_list(a_uint8_list, a_uint8_list_length, handle, + self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_async_object_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || self->vtable->echo_async_object == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* an_object = value0; + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->echo_async_object(an_object, handle, self->user_data); +} + +static void core_tests_pigeon_test_host_integration_core_api_echo_async_list_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || self->vtable->echo_async_list == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* list = value0; + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->echo_async_list(list, handle, self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_async_enum_list_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->echo_async_enum_list == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* enum_list = value0; + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->echo_async_enum_list(enum_list, handle, self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_async_class_list_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->echo_async_class_list == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* class_list = value0; + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->echo_async_class_list(class_list, handle, self->user_data); +} + +static void core_tests_pigeon_test_host_integration_core_api_echo_async_map_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || self->vtable->echo_async_map == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* map = value0; + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->echo_async_map(map, handle, self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_async_string_map_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->echo_async_string_map == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* string_map = value0; + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->echo_async_string_map(string_map, handle, self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_async_int_map_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || self->vtable->echo_async_int_map == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* int_map = value0; + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->echo_async_int_map(int_map, handle, self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_async_enum_map_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || self->vtable->echo_async_enum_map == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* enum_map = value0; + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->echo_async_enum_map(enum_map, handle, self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_async_class_map_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->echo_async_class_map == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* class_map = value0; + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->echo_async_class_map(class_map, handle, self->user_data); +} + +static void core_tests_pigeon_test_host_integration_core_api_echo_async_enum_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || self->vtable->echo_async_enum == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + CoreTestsPigeonTestAnEnum an_enum = static_cast( + fl_value_get_int(reinterpret_cast( + const_cast(fl_value_get_custom_value(value0))))); + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->echo_async_enum(an_enum, handle, self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_another_async_enum_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->echo_another_async_enum == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + CoreTestsPigeonTestAnotherEnum another_enum = + static_cast( + fl_value_get_int(reinterpret_cast( + const_cast(fl_value_get_custom_value(value0))))); + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->echo_another_async_enum(another_enum, handle, self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_throw_async_error_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || self->vtable->throw_async_error == nullptr) { + return; + } + + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->throw_async_error(handle, self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_throw_async_error_from_void_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->throw_async_error_from_void == nullptr) { + return; + } + + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->throw_async_error_from_void(handle, self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_throw_async_flutter_error_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->throw_async_flutter_error == nullptr) { + return; + } + + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->throw_async_flutter_error(handle, self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_async_all_types_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->echo_async_all_types == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + CoreTestsPigeonTestAllTypes* everything = CORE_TESTS_PIGEON_TEST_ALL_TYPES( + fl_value_get_custom_value_object(value0)); + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->echo_async_all_types(everything, handle, self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_all_nullable_types_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->echo_async_nullable_all_nullable_types == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + CoreTestsPigeonTestAllNullableTypes* everything = + CORE_TESTS_PIGEON_TEST_ALL_NULLABLE_TYPES( + fl_value_get_custom_value_object(value0)); + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->echo_async_nullable_all_nullable_types(everything, handle, + self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_all_nullable_types_without_recursion_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->echo_async_nullable_all_nullable_types_without_recursion == + nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + CoreTestsPigeonTestAllNullableTypesWithoutRecursion* everything = + CORE_TESTS_PIGEON_TEST_ALL_NULLABLE_TYPES_WITHOUT_RECURSION( + fl_value_get_custom_value_object(value0)); + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->echo_async_nullable_all_nullable_types_without_recursion( + everything, handle, self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_int_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->echo_async_nullable_int == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + int64_t* an_int = nullptr; + int64_t an_int_value; + if (fl_value_get_type(value0) != FL_VALUE_TYPE_NULL) { + an_int_value = fl_value_get_int(value0); + an_int = &an_int_value; + } + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->echo_async_nullable_int(an_int, handle, self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_double_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->echo_async_nullable_double == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + double* a_double = nullptr; + double a_double_value; + if (fl_value_get_type(value0) != FL_VALUE_TYPE_NULL) { + a_double_value = fl_value_get_float(value0); + a_double = &a_double_value; + } + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->echo_async_nullable_double(a_double, handle, self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_bool_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->echo_async_nullable_bool == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + gboolean* a_bool = nullptr; + gboolean a_bool_value; + if (fl_value_get_type(value0) != FL_VALUE_TYPE_NULL) { + a_bool_value = fl_value_get_bool(value0); + a_bool = &a_bool_value; + } + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->echo_async_nullable_bool(a_bool, handle, self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_string_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->echo_async_nullable_string == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + const gchar* a_string = fl_value_get_string(value0); + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->echo_async_nullable_string(a_string, handle, self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_uint8_list_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->echo_async_nullable_uint8_list == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + const uint8_t* a_uint8_list = fl_value_get_uint8_list(value0); + size_t a_uint8_list_length = fl_value_get_length(value0); + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->echo_async_nullable_uint8_list( + a_uint8_list, a_uint8_list_length, handle, self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_object_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->echo_async_nullable_object == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* an_object = value0; + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->echo_async_nullable_object(an_object, handle, self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_list_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->echo_async_nullable_list == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* list = value0; + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->echo_async_nullable_list(list, handle, self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_enum_list_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->echo_async_nullable_enum_list == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* enum_list = value0; + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->echo_async_nullable_enum_list(enum_list, handle, + self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_class_list_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->echo_async_nullable_class_list == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* class_list = value0; + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->echo_async_nullable_class_list(class_list, handle, + self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_map_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->echo_async_nullable_map == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* map = value0; + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->echo_async_nullable_map(map, handle, self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_string_map_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->echo_async_nullable_string_map == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* string_map = value0; + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->echo_async_nullable_string_map(string_map, handle, + self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_int_map_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->echo_async_nullable_int_map == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* int_map = value0; + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->echo_async_nullable_int_map(int_map, handle, self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_enum_map_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->echo_async_nullable_enum_map == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* enum_map = value0; + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->echo_async_nullable_enum_map(enum_map, handle, self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_class_map_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->echo_async_nullable_class_map == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* class_map = value0; + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->echo_async_nullable_class_map(class_map, handle, + self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_enum_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->echo_async_nullable_enum == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + CoreTestsPigeonTestAnEnum* an_enum = nullptr; + CoreTestsPigeonTestAnEnum an_enum_value; + if (fl_value_get_type(value0) != FL_VALUE_TYPE_NULL) { + an_enum_value = static_cast( + fl_value_get_int(reinterpret_cast( + const_cast(fl_value_get_custom_value(value0))))); + an_enum = &an_enum_value; + } + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->echo_async_nullable_enum(an_enum, handle, self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_another_async_nullable_enum_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->echo_another_async_nullable_enum == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + CoreTestsPigeonTestAnotherEnum* another_enum = nullptr; + CoreTestsPigeonTestAnotherEnum another_enum_value; + if (fl_value_get_type(value0) != FL_VALUE_TYPE_NULL) { + another_enum_value = static_cast( + fl_value_get_int(reinterpret_cast( + const_cast(fl_value_get_custom_value(value0))))); + another_enum = &another_enum_value; + } + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->echo_another_async_nullable_enum(another_enum, handle, + self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_noop_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || self->vtable->call_flutter_noop == nullptr) { + return; + } + + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->call_flutter_noop(handle, self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_throw_error_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->call_flutter_throw_error == nullptr) { + return; + } + + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->call_flutter_throw_error(handle, self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_throw_error_from_void_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->call_flutter_throw_error_from_void == nullptr) { + return; + } + + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->call_flutter_throw_error_from_void(handle, self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_types_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->call_flutter_echo_all_types == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + CoreTestsPigeonTestAllTypes* everything = CORE_TESTS_PIGEON_TEST_ALL_TYPES( + fl_value_get_custom_value_object(value0)); + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->call_flutter_echo_all_types(everything, handle, + self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_nullable_types_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->call_flutter_echo_all_nullable_types == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + CoreTestsPigeonTestAllNullableTypes* everything = + CORE_TESTS_PIGEON_TEST_ALL_NULLABLE_TYPES( + fl_value_get_custom_value_object(value0)); + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->call_flutter_echo_all_nullable_types(everything, handle, + self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_send_multiple_nullable_types_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->call_flutter_send_multiple_nullable_types == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + gboolean* a_nullable_bool = nullptr; + gboolean a_nullable_bool_value; + if (fl_value_get_type(value0) != FL_VALUE_TYPE_NULL) { + a_nullable_bool_value = fl_value_get_bool(value0); + a_nullable_bool = &a_nullable_bool_value; + } + FlValue* value1 = fl_value_get_list_value(message_, 1); + int64_t* a_nullable_int = nullptr; + int64_t a_nullable_int_value; + if (fl_value_get_type(value1) != FL_VALUE_TYPE_NULL) { + a_nullable_int_value = fl_value_get_int(value1); + a_nullable_int = &a_nullable_int_value; + } + FlValue* value2 = fl_value_get_list_value(message_, 2); + const gchar* a_nullable_string = fl_value_get_string(value2); + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->call_flutter_send_multiple_nullable_types( + a_nullable_bool, a_nullable_int, a_nullable_string, handle, + self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_nullable_types_without_recursion_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->call_flutter_echo_all_nullable_types_without_recursion == + nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + CoreTestsPigeonTestAllNullableTypesWithoutRecursion* everything = + CORE_TESTS_PIGEON_TEST_ALL_NULLABLE_TYPES_WITHOUT_RECURSION( + fl_value_get_custom_value_object(value0)); + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->call_flutter_echo_all_nullable_types_without_recursion( + everything, handle, self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_send_multiple_nullable_types_without_recursion_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable + ->call_flutter_send_multiple_nullable_types_without_recursion == + nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + gboolean* a_nullable_bool = nullptr; + gboolean a_nullable_bool_value; + if (fl_value_get_type(value0) != FL_VALUE_TYPE_NULL) { + a_nullable_bool_value = fl_value_get_bool(value0); + a_nullable_bool = &a_nullable_bool_value; + } + FlValue* value1 = fl_value_get_list_value(message_, 1); + int64_t* a_nullable_int = nullptr; + int64_t a_nullable_int_value; + if (fl_value_get_type(value1) != FL_VALUE_TYPE_NULL) { + a_nullable_int_value = fl_value_get_int(value1); + a_nullable_int = &a_nullable_int_value; + } + FlValue* value2 = fl_value_get_list_value(message_, 2); + const gchar* a_nullable_string = fl_value_get_string(value2); + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->call_flutter_send_multiple_nullable_types_without_recursion( + a_nullable_bool, a_nullable_int, a_nullable_string, handle, + self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_bool_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->call_flutter_echo_bool == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + gboolean a_bool = fl_value_get_bool(value0); + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->call_flutter_echo_bool(a_bool, handle, self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_int_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->call_flutter_echo_int == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + int64_t an_int = fl_value_get_int(value0); + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->call_flutter_echo_int(an_int, handle, self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_double_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->call_flutter_echo_double == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + double a_double = fl_value_get_float(value0); + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->call_flutter_echo_double(a_double, handle, self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_string_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->call_flutter_echo_string == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + const gchar* a_string = fl_value_get_string(value0); + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->call_flutter_echo_string(a_string, handle, self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_uint8_list_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->call_flutter_echo_uint8_list == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + const uint8_t* list = fl_value_get_uint8_list(value0); + size_t list_length = fl_value_get_length(value0); + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->call_flutter_echo_uint8_list(list, list_length, handle, + self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_list_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->call_flutter_echo_list == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* list = value0; + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->call_flutter_echo_list(list, handle, self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_list_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->call_flutter_echo_enum_list == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* enum_list = value0; + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->call_flutter_echo_enum_list(enum_list, handle, self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_class_list_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->call_flutter_echo_class_list == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* class_list = value0; + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->call_flutter_echo_class_list(class_list, handle, + self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_enum_list_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->call_flutter_echo_non_null_enum_list == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* enum_list = value0; + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->call_flutter_echo_non_null_enum_list(enum_list, handle, + self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_class_list_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->call_flutter_echo_non_null_class_list == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* class_list = value0; + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->call_flutter_echo_non_null_class_list(class_list, handle, + self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_map_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->call_flutter_echo_map == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* map = value0; + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->call_flutter_echo_map(map, handle, self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_string_map_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->call_flutter_echo_string_map == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* string_map = value0; + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->call_flutter_echo_string_map(string_map, handle, + self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_int_map_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->call_flutter_echo_int_map == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* int_map = value0; + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->call_flutter_echo_int_map(int_map, handle, self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_map_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->call_flutter_echo_enum_map == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* enum_map = value0; + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->call_flutter_echo_enum_map(enum_map, handle, self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_class_map_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->call_flutter_echo_class_map == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* class_map = value0; + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->call_flutter_echo_class_map(class_map, handle, self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_string_map_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->call_flutter_echo_non_null_string_map == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* string_map = value0; + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->call_flutter_echo_non_null_string_map(string_map, handle, + self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_int_map_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->call_flutter_echo_non_null_int_map == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* int_map = value0; + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->call_flutter_echo_non_null_int_map(int_map, handle, + self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_enum_map_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->call_flutter_echo_non_null_enum_map == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* enum_map = value0; + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->call_flutter_echo_non_null_enum_map(enum_map, handle, + self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_class_map_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->call_flutter_echo_non_null_class_map == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* class_map = value0; + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->call_flutter_echo_non_null_class_map(class_map, handle, + self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->call_flutter_echo_enum == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + CoreTestsPigeonTestAnEnum an_enum = static_cast( + fl_value_get_int(reinterpret_cast( + const_cast(fl_value_get_custom_value(value0))))); + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->call_flutter_echo_enum(an_enum, handle, self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_another_enum_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->call_flutter_echo_another_enum == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + CoreTestsPigeonTestAnotherEnum another_enum = + static_cast( + fl_value_get_int(reinterpret_cast( + const_cast(fl_value_get_custom_value(value0))))); + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->call_flutter_echo_another_enum(another_enum, handle, + self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_bool_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->call_flutter_echo_nullable_bool == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + gboolean* a_bool = nullptr; + gboolean a_bool_value; + if (fl_value_get_type(value0) != FL_VALUE_TYPE_NULL) { + a_bool_value = fl_value_get_bool(value0); + a_bool = &a_bool_value; + } + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->call_flutter_echo_nullable_bool(a_bool, handle, + self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_int_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->call_flutter_echo_nullable_int == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + int64_t* an_int = nullptr; + int64_t an_int_value; + if (fl_value_get_type(value0) != FL_VALUE_TYPE_NULL) { + an_int_value = fl_value_get_int(value0); + an_int = &an_int_value; + } + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->call_flutter_echo_nullable_int(an_int, handle, self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_double_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->call_flutter_echo_nullable_double == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + double* a_double = nullptr; + double a_double_value; + if (fl_value_get_type(value0) != FL_VALUE_TYPE_NULL) { + a_double_value = fl_value_get_float(value0); + a_double = &a_double_value; + } + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->call_flutter_echo_nullable_double(a_double, handle, + self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_string_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->call_flutter_echo_nullable_string == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + const gchar* a_string = fl_value_get_string(value0); + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->call_flutter_echo_nullable_string(a_string, handle, + self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_uint8_list_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->call_flutter_echo_nullable_uint8_list == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + const uint8_t* list = fl_value_get_uint8_list(value0); + size_t list_length = fl_value_get_length(value0); + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->call_flutter_echo_nullable_uint8_list(list, list_length, handle, + self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_list_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->call_flutter_echo_nullable_list == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* list = value0; + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->call_flutter_echo_nullable_list(list, handle, self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_enum_list_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->call_flutter_echo_nullable_enum_list == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* enum_list = value0; + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->call_flutter_echo_nullable_enum_list(enum_list, handle, + self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_class_list_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->call_flutter_echo_nullable_class_list == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* class_list = value0; + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->call_flutter_echo_nullable_class_list(class_list, handle, + self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_enum_list_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->call_flutter_echo_nullable_non_null_enum_list == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* enum_list = value0; + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->call_flutter_echo_nullable_non_null_enum_list(enum_list, handle, + self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_class_list_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->call_flutter_echo_nullable_non_null_class_list == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* class_list = value0; + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->call_flutter_echo_nullable_non_null_class_list( + class_list, handle, self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_map_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->call_flutter_echo_nullable_map == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* map = value0; + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->call_flutter_echo_nullable_map(map, handle, self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_string_map_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->call_flutter_echo_nullable_string_map == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* string_map = value0; + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->call_flutter_echo_nullable_string_map(string_map, handle, + self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_int_map_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->call_flutter_echo_nullable_int_map == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* int_map = value0; + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->call_flutter_echo_nullable_int_map(int_map, handle, + self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_enum_map_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->call_flutter_echo_nullable_enum_map == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* enum_map = value0; + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->call_flutter_echo_nullable_enum_map(enum_map, handle, + self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_class_map_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->call_flutter_echo_nullable_class_map == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* class_map = value0; + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->call_flutter_echo_nullable_class_map(class_map, handle, + self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_string_map_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->call_flutter_echo_nullable_non_null_string_map == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* string_map = value0; + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->call_flutter_echo_nullable_non_null_string_map( + string_map, handle, self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_int_map_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->call_flutter_echo_nullable_non_null_int_map == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* int_map = value0; + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->call_flutter_echo_nullable_non_null_int_map(int_map, handle, + self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_enum_map_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->call_flutter_echo_nullable_non_null_enum_map == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* enum_map = value0; + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->call_flutter_echo_nullable_non_null_enum_map(enum_map, handle, + self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_class_map_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->call_flutter_echo_nullable_non_null_class_map == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* class_map = value0; + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->call_flutter_echo_nullable_non_null_class_map(class_map, handle, + self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_enum_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->call_flutter_echo_nullable_enum == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + CoreTestsPigeonTestAnEnum* an_enum = nullptr; + CoreTestsPigeonTestAnEnum an_enum_value; + if (fl_value_get_type(value0) != FL_VALUE_TYPE_NULL) { + an_enum_value = static_cast( + fl_value_get_int(reinterpret_cast( + const_cast(fl_value_get_custom_value(value0))))); + an_enum = &an_enum_value; + } + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->call_flutter_echo_nullable_enum(an_enum, handle, + self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_another_nullable_enum_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->call_flutter_echo_another_nullable_enum == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + CoreTestsPigeonTestAnotherEnum* another_enum = nullptr; + CoreTestsPigeonTestAnotherEnum another_enum_value; + if (fl_value_get_type(value0) != FL_VALUE_TYPE_NULL) { + another_enum_value = static_cast( + fl_value_get_int(reinterpret_cast( + const_cast(fl_value_get_custom_value(value0))))); + another_enum = &another_enum_value; + } + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->call_flutter_echo_another_nullable_enum(another_enum, handle, + self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_small_api_echo_string_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->call_flutter_small_api_echo_string == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + const gchar* a_string = fl_value_get_string(value0); + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->call_flutter_small_api_echo_string(a_string, handle, + self->user_data); +} + +void core_tests_pigeon_test_host_integration_core_api_set_method_handlers( + FlBinaryMessenger* messenger, const gchar* suffix, + const CoreTestsPigeonTestHostIntegrationCoreApiVTable* vtable, + gpointer user_data, GDestroyNotify user_data_free_func) { + g_autofree gchar* dot_suffix = + suffix != nullptr ? g_strdup_printf(".%s", suffix) : g_strdup(""); + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApi) api_data = + core_tests_pigeon_test_host_integration_core_api_new(vtable, user_data, + user_data_free_func); + + g_autoptr(CoreTestsPigeonTestMessageCodec) codec = + core_tests_pigeon_test_message_codec_new(); + g_autofree gchar* noop_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.noop%" + "s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) noop_channel = fl_basic_message_channel_new( + messenger, noop_channel_name, FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + noop_channel, core_tests_pigeon_test_host_integration_core_api_noop_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_all_types_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAllTypes%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_all_types_channel = + fl_basic_message_channel_new(messenger, echo_all_types_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_all_types_channel, + core_tests_pigeon_test_host_integration_core_api_echo_all_types_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* throw_error_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "throwError%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) throw_error_channel = + fl_basic_message_channel_new(messenger, throw_error_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + throw_error_channel, + core_tests_pigeon_test_host_integration_core_api_throw_error_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* throw_error_from_void_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "throwErrorFromVoid%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) throw_error_from_void_channel = + fl_basic_message_channel_new(messenger, + throw_error_from_void_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + throw_error_from_void_channel, + core_tests_pigeon_test_host_integration_core_api_throw_error_from_void_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* throw_flutter_error_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "throwFlutterError%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) throw_flutter_error_channel = + fl_basic_message_channel_new(messenger, throw_flutter_error_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + throw_flutter_error_channel, + core_tests_pigeon_test_host_integration_core_api_throw_flutter_error_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_int_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoInt%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_int_channel = + fl_basic_message_channel_new(messenger, echo_int_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_int_channel, + core_tests_pigeon_test_host_integration_core_api_echo_int_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_double_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." "echoDouble%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_double_channel = - fl_basic_message_channel_new(messenger, echo_double_channel_name, + g_autoptr(FlBasicMessageChannel) echo_double_channel = + fl_basic_message_channel_new(messenger, echo_double_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_double_channel, + core_tests_pigeon_test_host_integration_core_api_echo_double_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_bool_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoBool%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_bool_channel = + fl_basic_message_channel_new(messenger, echo_bool_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_bool_channel, + core_tests_pigeon_test_host_integration_core_api_echo_bool_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_string_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoString%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_string_channel = + fl_basic_message_channel_new(messenger, echo_string_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_string_channel, + core_tests_pigeon_test_host_integration_core_api_echo_string_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_uint8_list_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoUint8List%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_uint8_list_channel = + fl_basic_message_channel_new(messenger, echo_uint8_list_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_uint8_list_channel, + core_tests_pigeon_test_host_integration_core_api_echo_uint8_list_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_object_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoObject%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_object_channel = + fl_basic_message_channel_new(messenger, echo_object_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_object_channel, + core_tests_pigeon_test_host_integration_core_api_echo_object_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_list_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoList%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_list_channel = + fl_basic_message_channel_new(messenger, echo_list_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_list_channel, + core_tests_pigeon_test_host_integration_core_api_echo_list_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_enum_list_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoEnumList%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_enum_list_channel = + fl_basic_message_channel_new(messenger, echo_enum_list_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_enum_list_channel, + core_tests_pigeon_test_host_integration_core_api_echo_enum_list_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_class_list_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoClassList%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_class_list_channel = + fl_basic_message_channel_new(messenger, echo_class_list_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_class_list_channel, + core_tests_pigeon_test_host_integration_core_api_echo_class_list_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_non_null_enum_list_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoNonNullEnumList%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_non_null_enum_list_channel = + fl_basic_message_channel_new(messenger, + echo_non_null_enum_list_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_non_null_enum_list_channel, + core_tests_pigeon_test_host_integration_core_api_echo_non_null_enum_list_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_non_null_class_list_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoNonNullClassList%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_non_null_class_list_channel = + fl_basic_message_channel_new(messenger, + echo_non_null_class_list_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_non_null_class_list_channel, + core_tests_pigeon_test_host_integration_core_api_echo_non_null_class_list_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_map_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_map_channel = + fl_basic_message_channel_new(messenger, echo_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_map_channel, + core_tests_pigeon_test_host_integration_core_api_echo_map_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_string_map_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoStringMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_string_map_channel = + fl_basic_message_channel_new(messenger, echo_string_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_string_map_channel, + core_tests_pigeon_test_host_integration_core_api_echo_string_map_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_int_map_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoIntMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_int_map_channel = + fl_basic_message_channel_new(messenger, echo_int_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_int_map_channel, + core_tests_pigeon_test_host_integration_core_api_echo_int_map_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_enum_map_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoEnumMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_enum_map_channel = + fl_basic_message_channel_new(messenger, echo_enum_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_enum_map_channel, + core_tests_pigeon_test_host_integration_core_api_echo_enum_map_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_class_map_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoClassMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_class_map_channel = + fl_basic_message_channel_new(messenger, echo_class_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_class_map_channel, + core_tests_pigeon_test_host_integration_core_api_echo_class_map_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_non_null_string_map_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoNonNullStringMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_non_null_string_map_channel = + fl_basic_message_channel_new(messenger, + echo_non_null_string_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_non_null_string_map_channel, + core_tests_pigeon_test_host_integration_core_api_echo_non_null_string_map_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_non_null_int_map_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoNonNullIntMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_non_null_int_map_channel = + fl_basic_message_channel_new(messenger, + echo_non_null_int_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_non_null_int_map_channel, + core_tests_pigeon_test_host_integration_core_api_echo_non_null_int_map_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_non_null_enum_map_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoNonNullEnumMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_non_null_enum_map_channel = + fl_basic_message_channel_new(messenger, + echo_non_null_enum_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_non_null_enum_map_channel, + core_tests_pigeon_test_host_integration_core_api_echo_non_null_enum_map_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_non_null_class_map_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoNonNullClassMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_non_null_class_map_channel = + fl_basic_message_channel_new(messenger, + echo_non_null_class_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_non_null_class_map_channel, + core_tests_pigeon_test_host_integration_core_api_echo_non_null_class_map_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_class_wrapper_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoClassWrapper%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_class_wrapper_channel = + fl_basic_message_channel_new(messenger, echo_class_wrapper_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_class_wrapper_channel, + core_tests_pigeon_test_host_integration_core_api_echo_class_wrapper_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_enum_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoEnum%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_enum_channel = + fl_basic_message_channel_new(messenger, echo_enum_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_enum_channel, + core_tests_pigeon_test_host_integration_core_api_echo_enum_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_another_enum_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAnotherEnum%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_another_enum_channel = + fl_basic_message_channel_new(messenger, echo_another_enum_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_another_enum_channel, + core_tests_pigeon_test_host_integration_core_api_echo_another_enum_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_named_default_string_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoNamedDefaultString%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_named_default_string_channel = + fl_basic_message_channel_new(messenger, + echo_named_default_string_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_named_default_string_channel, + core_tests_pigeon_test_host_integration_core_api_echo_named_default_string_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_optional_default_double_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoOptionalDefaultDouble%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_optional_default_double_channel = + fl_basic_message_channel_new(messenger, + echo_optional_default_double_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_optional_default_double_channel, + core_tests_pigeon_test_host_integration_core_api_echo_optional_default_double_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_required_int_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoRequiredInt%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_required_int_channel = + fl_basic_message_channel_new(messenger, echo_required_int_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_required_int_channel, + core_tests_pigeon_test_host_integration_core_api_echo_required_int_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_all_nullable_types_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAllNullableTypes%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_all_nullable_types_channel = + fl_basic_message_channel_new(messenger, + echo_all_nullable_types_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_all_nullable_types_channel, + core_tests_pigeon_test_host_integration_core_api_echo_all_nullable_types_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_all_nullable_types_without_recursion_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAllNullableTypesWithoutRecursion%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) + echo_all_nullable_types_without_recursion_channel = + fl_basic_message_channel_new( + messenger, echo_all_nullable_types_without_recursion_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_all_nullable_types_without_recursion_channel, + core_tests_pigeon_test_host_integration_core_api_echo_all_nullable_types_without_recursion_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* extract_nested_nullable_string_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "extractNestedNullableString%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) extract_nested_nullable_string_channel = + fl_basic_message_channel_new(messenger, + extract_nested_nullable_string_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + extract_nested_nullable_string_channel, + core_tests_pigeon_test_host_integration_core_api_extract_nested_nullable_string_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* create_nested_nullable_string_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "createNestedNullableString%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) create_nested_nullable_string_channel = + fl_basic_message_channel_new(messenger, + create_nested_nullable_string_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + create_nested_nullable_string_channel, + core_tests_pigeon_test_host_integration_core_api_create_nested_nullable_string_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* send_multiple_nullable_types_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "sendMultipleNullableTypes%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) send_multiple_nullable_types_channel = + fl_basic_message_channel_new(messenger, + send_multiple_nullable_types_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + send_multiple_nullable_types_channel, + core_tests_pigeon_test_host_integration_core_api_send_multiple_nullable_types_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* + send_multiple_nullable_types_without_recursion_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi." + "sendMultipleNullableTypesWithoutRecursion%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) + send_multiple_nullable_types_without_recursion_channel = + fl_basic_message_channel_new( + messenger, + send_multiple_nullable_types_without_recursion_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + send_multiple_nullable_types_without_recursion_channel, + core_tests_pigeon_test_host_integration_core_api_send_multiple_nullable_types_without_recursion_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_nullable_int_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoNullableInt%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_nullable_int_channel = + fl_basic_message_channel_new(messenger, echo_nullable_int_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_nullable_int_channel, + core_tests_pigeon_test_host_integration_core_api_echo_nullable_int_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_nullable_double_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoNullableDouble%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_nullable_double_channel = + fl_basic_message_channel_new(messenger, echo_nullable_double_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_nullable_double_channel, + core_tests_pigeon_test_host_integration_core_api_echo_nullable_double_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_nullable_bool_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoNullableBool%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_nullable_bool_channel = + fl_basic_message_channel_new(messenger, echo_nullable_bool_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_nullable_bool_channel, + core_tests_pigeon_test_host_integration_core_api_echo_nullable_bool_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_nullable_string_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoNullableString%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_nullable_string_channel = + fl_basic_message_channel_new(messenger, echo_nullable_string_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_nullable_string_channel, + core_tests_pigeon_test_host_integration_core_api_echo_nullable_string_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_nullable_uint8_list_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoNullableUint8List%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_nullable_uint8_list_channel = + fl_basic_message_channel_new(messenger, + echo_nullable_uint8_list_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_nullable_uint8_list_channel, + core_tests_pigeon_test_host_integration_core_api_echo_nullable_uint8_list_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_nullable_object_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoNullableObject%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_nullable_object_channel = + fl_basic_message_channel_new(messenger, echo_nullable_object_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_nullable_object_channel, + core_tests_pigeon_test_host_integration_core_api_echo_nullable_object_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_nullable_list_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoNullableList%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_nullable_list_channel = + fl_basic_message_channel_new(messenger, echo_nullable_list_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_nullable_list_channel, + core_tests_pigeon_test_host_integration_core_api_echo_nullable_list_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_nullable_enum_list_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoNullableEnumList%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_nullable_enum_list_channel = + fl_basic_message_channel_new(messenger, + echo_nullable_enum_list_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_nullable_enum_list_channel, + core_tests_pigeon_test_host_integration_core_api_echo_nullable_enum_list_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_nullable_class_list_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoNullableClassList%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_nullable_class_list_channel = + fl_basic_message_channel_new(messenger, + echo_nullable_class_list_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_nullable_class_list_channel, + core_tests_pigeon_test_host_integration_core_api_echo_nullable_class_list_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_nullable_non_null_enum_list_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoNullableNonNullEnumList%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_nullable_non_null_enum_list_channel = + fl_basic_message_channel_new( + messenger, echo_nullable_non_null_enum_list_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_nullable_non_null_enum_list_channel, + core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_enum_list_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_nullable_non_null_class_list_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoNullableNonNullClassList%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_nullable_non_null_class_list_channel = + fl_basic_message_channel_new( + messenger, echo_nullable_non_null_class_list_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_nullable_non_null_class_list_channel, + core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_class_list_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_nullable_map_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoNullableMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_nullable_map_channel = + fl_basic_message_channel_new(messenger, echo_nullable_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_nullable_map_channel, + core_tests_pigeon_test_host_integration_core_api_echo_nullable_map_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_nullable_string_map_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoNullableStringMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_nullable_string_map_channel = + fl_basic_message_channel_new(messenger, + echo_nullable_string_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_nullable_string_map_channel, + core_tests_pigeon_test_host_integration_core_api_echo_nullable_string_map_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_nullable_int_map_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoNullableIntMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_nullable_int_map_channel = + fl_basic_message_channel_new(messenger, + echo_nullable_int_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_nullable_int_map_channel, + core_tests_pigeon_test_host_integration_core_api_echo_nullable_int_map_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_nullable_enum_map_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoNullableEnumMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_nullable_enum_map_channel = + fl_basic_message_channel_new(messenger, + echo_nullable_enum_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_nullable_enum_map_channel, + core_tests_pigeon_test_host_integration_core_api_echo_nullable_enum_map_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_nullable_class_map_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoNullableClassMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_nullable_class_map_channel = + fl_basic_message_channel_new(messenger, + echo_nullable_class_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_nullable_class_map_channel, + core_tests_pigeon_test_host_integration_core_api_echo_nullable_class_map_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_nullable_non_null_string_map_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoNullableNonNullStringMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_nullable_non_null_string_map_channel = + fl_basic_message_channel_new( + messenger, echo_nullable_non_null_string_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_nullable_non_null_string_map_channel, + core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_string_map_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_nullable_non_null_int_map_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoNullableNonNullIntMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_nullable_non_null_int_map_channel = + fl_basic_message_channel_new(messenger, + echo_nullable_non_null_int_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_nullable_non_null_int_map_channel, + core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_int_map_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_nullable_non_null_enum_map_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoNullableNonNullEnumMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_nullable_non_null_enum_map_channel = + fl_basic_message_channel_new(messenger, + echo_nullable_non_null_enum_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_nullable_non_null_enum_map_channel, + core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_enum_map_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_nullable_non_null_class_map_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoNullableNonNullClassMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_nullable_non_null_class_map_channel = + fl_basic_message_channel_new( + messenger, echo_nullable_non_null_class_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_nullable_non_null_class_map_channel, + core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_class_map_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_nullable_enum_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoNullableEnum%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_nullable_enum_channel = + fl_basic_message_channel_new(messenger, echo_nullable_enum_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_nullable_enum_channel, + core_tests_pigeon_test_host_integration_core_api_echo_nullable_enum_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_another_nullable_enum_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAnotherNullableEnum%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_another_nullable_enum_channel = + fl_basic_message_channel_new(messenger, + echo_another_nullable_enum_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_another_nullable_enum_channel, + core_tests_pigeon_test_host_integration_core_api_echo_another_nullable_enum_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_optional_nullable_int_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoOptionalNullableInt%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_optional_nullable_int_channel = + fl_basic_message_channel_new(messenger, + echo_optional_nullable_int_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_optional_nullable_int_channel, + core_tests_pigeon_test_host_integration_core_api_echo_optional_nullable_int_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_named_nullable_string_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoNamedNullableString%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_named_nullable_string_channel = + fl_basic_message_channel_new(messenger, + echo_named_nullable_string_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_named_nullable_string_channel, + core_tests_pigeon_test_host_integration_core_api_echo_named_nullable_string_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* noop_async_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "noopAsync%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) noop_async_channel = + fl_basic_message_channel_new(messenger, noop_async_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + noop_async_channel, + core_tests_pigeon_test_host_integration_core_api_noop_async_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_async_int_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncInt%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_async_int_channel = + fl_basic_message_channel_new(messenger, echo_async_int_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_async_int_channel, + core_tests_pigeon_test_host_integration_core_api_echo_async_int_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_async_double_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncDouble%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_async_double_channel = + fl_basic_message_channel_new(messenger, echo_async_double_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_async_double_channel, + core_tests_pigeon_test_host_integration_core_api_echo_async_double_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_async_bool_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncBool%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_async_bool_channel = + fl_basic_message_channel_new(messenger, echo_async_bool_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_async_bool_channel, + core_tests_pigeon_test_host_integration_core_api_echo_async_bool_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_async_string_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncString%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_async_string_channel = + fl_basic_message_channel_new(messenger, echo_async_string_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_async_string_channel, + core_tests_pigeon_test_host_integration_core_api_echo_async_string_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_async_uint8_list_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncUint8List%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_async_uint8_list_channel = + fl_basic_message_channel_new(messenger, + echo_async_uint8_list_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_async_uint8_list_channel, + core_tests_pigeon_test_host_integration_core_api_echo_async_uint8_list_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_async_object_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncObject%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_async_object_channel = + fl_basic_message_channel_new(messenger, echo_async_object_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_async_object_channel, + core_tests_pigeon_test_host_integration_core_api_echo_async_object_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_async_list_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncList%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_async_list_channel = + fl_basic_message_channel_new(messenger, echo_async_list_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_async_list_channel, + core_tests_pigeon_test_host_integration_core_api_echo_async_list_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_async_enum_list_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncEnumList%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_async_enum_list_channel = + fl_basic_message_channel_new(messenger, echo_async_enum_list_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_async_enum_list_channel, + core_tests_pigeon_test_host_integration_core_api_echo_async_enum_list_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_async_class_list_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncClassList%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_async_class_list_channel = + fl_basic_message_channel_new(messenger, + echo_async_class_list_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_async_class_list_channel, + core_tests_pigeon_test_host_integration_core_api_echo_async_class_list_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_async_map_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_async_map_channel = + fl_basic_message_channel_new(messenger, echo_async_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_async_map_channel, + core_tests_pigeon_test_host_integration_core_api_echo_async_map_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_async_string_map_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncStringMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_async_string_map_channel = + fl_basic_message_channel_new(messenger, + echo_async_string_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_async_string_map_channel, + core_tests_pigeon_test_host_integration_core_api_echo_async_string_map_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_async_int_map_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncIntMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_async_int_map_channel = + fl_basic_message_channel_new(messenger, echo_async_int_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_async_int_map_channel, + core_tests_pigeon_test_host_integration_core_api_echo_async_int_map_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_async_enum_map_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncEnumMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_async_enum_map_channel = + fl_basic_message_channel_new(messenger, echo_async_enum_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_async_enum_map_channel, + core_tests_pigeon_test_host_integration_core_api_echo_async_enum_map_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_async_class_map_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncClassMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_async_class_map_channel = + fl_basic_message_channel_new(messenger, echo_async_class_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_async_class_map_channel, + core_tests_pigeon_test_host_integration_core_api_echo_async_class_map_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_async_enum_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncEnum%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_async_enum_channel = + fl_basic_message_channel_new(messenger, echo_async_enum_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_async_enum_channel, + core_tests_pigeon_test_host_integration_core_api_echo_async_enum_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_another_async_enum_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAnotherAsyncEnum%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_another_async_enum_channel = + fl_basic_message_channel_new(messenger, + echo_another_async_enum_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_another_async_enum_channel, + core_tests_pigeon_test_host_integration_core_api_echo_another_async_enum_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* throw_async_error_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "throwAsyncError%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) throw_async_error_channel = + fl_basic_message_channel_new(messenger, throw_async_error_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + throw_async_error_channel, + core_tests_pigeon_test_host_integration_core_api_throw_async_error_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* throw_async_error_from_void_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "throwAsyncErrorFromVoid%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) throw_async_error_from_void_channel = + fl_basic_message_channel_new(messenger, + throw_async_error_from_void_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + throw_async_error_from_void_channel, + core_tests_pigeon_test_host_integration_core_api_throw_async_error_from_void_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* throw_async_flutter_error_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "throwAsyncFlutterError%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) throw_async_flutter_error_channel = + fl_basic_message_channel_new(messenger, + throw_async_flutter_error_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + throw_async_flutter_error_channel, + core_tests_pigeon_test_host_integration_core_api_throw_async_flutter_error_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_async_all_types_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncAllTypes%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_async_all_types_channel = + fl_basic_message_channel_new(messenger, echo_async_all_types_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_async_all_types_channel, + core_tests_pigeon_test_host_integration_core_api_echo_async_all_types_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_async_nullable_all_nullable_types_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncNullableAllNullableTypes%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) + echo_async_nullable_all_nullable_types_channel = + fl_basic_message_channel_new( + messenger, echo_async_nullable_all_nullable_types_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_async_nullable_all_nullable_types_channel, + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_all_nullable_types_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* + echo_async_nullable_all_nullable_types_without_recursion_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi." + "echoAsyncNullableAllNullableTypesWithoutRecursion%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) + echo_async_nullable_all_nullable_types_without_recursion_channel = + fl_basic_message_channel_new( + messenger, + echo_async_nullable_all_nullable_types_without_recursion_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_async_nullable_all_nullable_types_without_recursion_channel, + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_all_nullable_types_without_recursion_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_async_nullable_int_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncNullableInt%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_async_nullable_int_channel = + fl_basic_message_channel_new(messenger, + echo_async_nullable_int_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_async_nullable_int_channel, + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_int_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_async_nullable_double_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncNullableDouble%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_async_nullable_double_channel = + fl_basic_message_channel_new(messenger, + echo_async_nullable_double_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_async_nullable_double_channel, + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_double_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_async_nullable_bool_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncNullableBool%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_async_nullable_bool_channel = + fl_basic_message_channel_new(messenger, + echo_async_nullable_bool_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_async_nullable_bool_channel, + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_bool_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_async_nullable_string_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncNullableString%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_async_nullable_string_channel = + fl_basic_message_channel_new(messenger, + echo_async_nullable_string_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_async_nullable_string_channel, + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_string_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_async_nullable_uint8_list_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncNullableUint8List%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_async_nullable_uint8_list_channel = + fl_basic_message_channel_new(messenger, + echo_async_nullable_uint8_list_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_async_nullable_uint8_list_channel, + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_uint8_list_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_async_nullable_object_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncNullableObject%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_async_nullable_object_channel = + fl_basic_message_channel_new(messenger, + echo_async_nullable_object_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_async_nullable_object_channel, + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_object_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_async_nullable_list_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncNullableList%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_async_nullable_list_channel = + fl_basic_message_channel_new(messenger, + echo_async_nullable_list_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_async_nullable_list_channel, + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_list_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_async_nullable_enum_list_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncNullableEnumList%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_async_nullable_enum_list_channel = + fl_basic_message_channel_new(messenger, + echo_async_nullable_enum_list_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_async_nullable_enum_list_channel, + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_enum_list_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_async_nullable_class_list_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncNullableClassList%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_async_nullable_class_list_channel = + fl_basic_message_channel_new(messenger, + echo_async_nullable_class_list_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_async_nullable_class_list_channel, + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_class_list_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_async_nullable_map_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncNullableMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_async_nullable_map_channel = + fl_basic_message_channel_new(messenger, + echo_async_nullable_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_async_nullable_map_channel, + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_map_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_async_nullable_string_map_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncNullableStringMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_async_nullable_string_map_channel = + fl_basic_message_channel_new(messenger, + echo_async_nullable_string_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_async_nullable_string_map_channel, + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_string_map_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_async_nullable_int_map_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncNullableIntMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_async_nullable_int_map_channel = + fl_basic_message_channel_new(messenger, + echo_async_nullable_int_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_async_nullable_int_map_channel, + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_int_map_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_async_nullable_enum_map_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncNullableEnumMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_async_nullable_enum_map_channel = + fl_basic_message_channel_new(messenger, + echo_async_nullable_enum_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_async_nullable_enum_map_channel, + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_enum_map_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_async_nullable_class_map_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncNullableClassMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_async_nullable_class_map_channel = + fl_basic_message_channel_new(messenger, + echo_async_nullable_class_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_async_nullable_class_map_channel, + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_class_map_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_async_nullable_enum_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncNullableEnum%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_async_nullable_enum_channel = + fl_basic_message_channel_new(messenger, + echo_async_nullable_enum_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_async_nullable_enum_channel, + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_enum_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_another_async_nullable_enum_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAnotherAsyncNullableEnum%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_another_async_nullable_enum_channel = + fl_basic_message_channel_new( + messenger, echo_another_async_nullable_enum_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_another_async_nullable_enum_channel, + core_tests_pigeon_test_host_integration_core_api_echo_another_async_nullable_enum_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* call_flutter_noop_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterNoop%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) call_flutter_noop_channel = + fl_basic_message_channel_new(messenger, call_flutter_noop_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + call_flutter_noop_channel, + core_tests_pigeon_test_host_integration_core_api_call_flutter_noop_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* call_flutter_throw_error_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterThrowError%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) call_flutter_throw_error_channel = + fl_basic_message_channel_new(messenger, + call_flutter_throw_error_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + call_flutter_throw_error_channel, + core_tests_pigeon_test_host_integration_core_api_call_flutter_throw_error_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* call_flutter_throw_error_from_void_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterThrowErrorFromVoid%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) call_flutter_throw_error_from_void_channel = + fl_basic_message_channel_new( + messenger, call_flutter_throw_error_from_void_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + call_flutter_throw_error_from_void_channel, + core_tests_pigeon_test_host_integration_core_api_call_flutter_throw_error_from_void_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* call_flutter_echo_all_types_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoAllTypes%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) call_flutter_echo_all_types_channel = + fl_basic_message_channel_new(messenger, + call_flutter_echo_all_types_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + call_flutter_echo_all_types_channel, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_types_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* call_flutter_echo_all_nullable_types_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoAllNullableTypes%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) + call_flutter_echo_all_nullable_types_channel = + fl_basic_message_channel_new( + messenger, call_flutter_echo_all_nullable_types_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + call_flutter_echo_all_nullable_types_channel, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_nullable_types_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* call_flutter_send_multiple_nullable_types_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterSendMultipleNullableTypes%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) + call_flutter_send_multiple_nullable_types_channel = + fl_basic_message_channel_new( + messenger, call_flutter_send_multiple_nullable_types_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + call_flutter_send_multiple_nullable_types_channel, + core_tests_pigeon_test_host_integration_core_api_call_flutter_send_multiple_nullable_types_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* + call_flutter_echo_all_nullable_types_without_recursion_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi." + "callFlutterEchoAllNullableTypesWithoutRecursion%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) + call_flutter_echo_all_nullable_types_without_recursion_channel = + fl_basic_message_channel_new( + messenger, + call_flutter_echo_all_nullable_types_without_recursion_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + call_flutter_echo_all_nullable_types_without_recursion_channel, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_nullable_types_without_recursion_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* + call_flutter_send_multiple_nullable_types_without_recursion_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi." + "callFlutterSendMultipleNullableTypesWithoutRecursion%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) + call_flutter_send_multiple_nullable_types_without_recursion_channel = + fl_basic_message_channel_new( + messenger, + call_flutter_send_multiple_nullable_types_without_recursion_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + call_flutter_send_multiple_nullable_types_without_recursion_channel, + core_tests_pigeon_test_host_integration_core_api_call_flutter_send_multiple_nullable_types_without_recursion_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* call_flutter_echo_bool_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoBool%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) call_flutter_echo_bool_channel = + fl_basic_message_channel_new(messenger, + call_flutter_echo_bool_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + call_flutter_echo_bool_channel, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_bool_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* call_flutter_echo_int_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoInt%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) call_flutter_echo_int_channel = + fl_basic_message_channel_new(messenger, + call_flutter_echo_int_channel_name, FL_MESSAGE_CODEC(codec)); fl_basic_message_channel_set_message_handler( - echo_double_channel, - core_tests_pigeon_test_host_integration_core_api_echo_double_cb, + call_flutter_echo_int_channel, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_int_cb, g_object_ref(api_data), g_object_unref); - g_autofree gchar* echo_bool_channel_name = g_strdup_printf( + g_autofree gchar* call_flutter_echo_double_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoBool%s", + "callFlutterEchoDouble%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_bool_channel = - fl_basic_message_channel_new(messenger, echo_bool_channel_name, + g_autoptr(FlBasicMessageChannel) call_flutter_echo_double_channel = + fl_basic_message_channel_new(messenger, + call_flutter_echo_double_channel_name, FL_MESSAGE_CODEC(codec)); fl_basic_message_channel_set_message_handler( - echo_bool_channel, - core_tests_pigeon_test_host_integration_core_api_echo_bool_cb, + call_flutter_echo_double_channel, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_double_cb, g_object_ref(api_data), g_object_unref); - g_autofree gchar* echo_string_channel_name = g_strdup_printf( + g_autofree gchar* call_flutter_echo_string_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoString%s", + "callFlutterEchoString%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_string_channel = - fl_basic_message_channel_new(messenger, echo_string_channel_name, + g_autoptr(FlBasicMessageChannel) call_flutter_echo_string_channel = + fl_basic_message_channel_new(messenger, + call_flutter_echo_string_channel_name, FL_MESSAGE_CODEC(codec)); fl_basic_message_channel_set_message_handler( - echo_string_channel, - core_tests_pigeon_test_host_integration_core_api_echo_string_cb, + call_flutter_echo_string_channel, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_string_cb, g_object_ref(api_data), g_object_unref); - g_autofree gchar* echo_uint8_list_channel_name = g_strdup_printf( + g_autofree gchar* call_flutter_echo_uint8_list_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoUint8List%s", + "callFlutterEchoUint8List%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_uint8_list_channel = - fl_basic_message_channel_new(messenger, echo_uint8_list_channel_name, + g_autoptr(FlBasicMessageChannel) call_flutter_echo_uint8_list_channel = + fl_basic_message_channel_new(messenger, + call_flutter_echo_uint8_list_channel_name, FL_MESSAGE_CODEC(codec)); fl_basic_message_channel_set_message_handler( - echo_uint8_list_channel, - core_tests_pigeon_test_host_integration_core_api_echo_uint8_list_cb, + call_flutter_echo_uint8_list_channel, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_uint8_list_cb, g_object_ref(api_data), g_object_unref); - g_autofree gchar* echo_object_channel_name = g_strdup_printf( + g_autofree gchar* call_flutter_echo_list_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoObject%s", + "callFlutterEchoList%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_object_channel = - fl_basic_message_channel_new(messenger, echo_object_channel_name, + g_autoptr(FlBasicMessageChannel) call_flutter_echo_list_channel = + fl_basic_message_channel_new(messenger, + call_flutter_echo_list_channel_name, FL_MESSAGE_CODEC(codec)); fl_basic_message_channel_set_message_handler( - echo_object_channel, - core_tests_pigeon_test_host_integration_core_api_echo_object_cb, + call_flutter_echo_list_channel, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_list_cb, g_object_ref(api_data), g_object_unref); - g_autofree gchar* echo_list_channel_name = g_strdup_printf( + g_autofree gchar* call_flutter_echo_enum_list_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoList%s", + "callFlutterEchoEnumList%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_list_channel = - fl_basic_message_channel_new(messenger, echo_list_channel_name, + g_autoptr(FlBasicMessageChannel) call_flutter_echo_enum_list_channel = + fl_basic_message_channel_new(messenger, + call_flutter_echo_enum_list_channel_name, FL_MESSAGE_CODEC(codec)); fl_basic_message_channel_set_message_handler( - echo_list_channel, - core_tests_pigeon_test_host_integration_core_api_echo_list_cb, + call_flutter_echo_enum_list_channel, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_list_cb, g_object_ref(api_data), g_object_unref); - g_autofree gchar* echo_map_channel_name = g_strdup_printf( + g_autofree gchar* call_flutter_echo_class_list_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoMap%s", + "callFlutterEchoClassList%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_map_channel = - fl_basic_message_channel_new(messenger, echo_map_channel_name, + g_autoptr(FlBasicMessageChannel) call_flutter_echo_class_list_channel = + fl_basic_message_channel_new(messenger, + call_flutter_echo_class_list_channel_name, FL_MESSAGE_CODEC(codec)); fl_basic_message_channel_set_message_handler( - echo_map_channel, - core_tests_pigeon_test_host_integration_core_api_echo_map_cb, + call_flutter_echo_class_list_channel, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_class_list_cb, g_object_ref(api_data), g_object_unref); - g_autofree gchar* echo_class_wrapper_channel_name = g_strdup_printf( + g_autofree gchar* call_flutter_echo_non_null_enum_list_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNonNullEnumList%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) + call_flutter_echo_non_null_enum_list_channel = + fl_basic_message_channel_new( + messenger, call_flutter_echo_non_null_enum_list_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + call_flutter_echo_non_null_enum_list_channel, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_enum_list_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* call_flutter_echo_non_null_class_list_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNonNullClassList%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) + call_flutter_echo_non_null_class_list_channel = + fl_basic_message_channel_new( + messenger, call_flutter_echo_non_null_class_list_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + call_flutter_echo_non_null_class_list_channel, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_class_list_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* call_flutter_echo_map_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoClassWrapper%s", + "callFlutterEchoMap%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_class_wrapper_channel = - fl_basic_message_channel_new(messenger, echo_class_wrapper_channel_name, + g_autoptr(FlBasicMessageChannel) call_flutter_echo_map_channel = + fl_basic_message_channel_new(messenger, + call_flutter_echo_map_channel_name, FL_MESSAGE_CODEC(codec)); fl_basic_message_channel_set_message_handler( - echo_class_wrapper_channel, - core_tests_pigeon_test_host_integration_core_api_echo_class_wrapper_cb, + call_flutter_echo_map_channel, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_map_cb, g_object_ref(api_data), g_object_unref); - g_autofree gchar* echo_enum_channel_name = g_strdup_printf( + g_autofree gchar* call_flutter_echo_string_map_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoEnum%s", + "callFlutterEchoStringMap%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_enum_channel = - fl_basic_message_channel_new(messenger, echo_enum_channel_name, + g_autoptr(FlBasicMessageChannel) call_flutter_echo_string_map_channel = + fl_basic_message_channel_new(messenger, + call_flutter_echo_string_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + call_flutter_echo_string_map_channel, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_string_map_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* call_flutter_echo_int_map_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoIntMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) call_flutter_echo_int_map_channel = + fl_basic_message_channel_new(messenger, + call_flutter_echo_int_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + call_flutter_echo_int_map_channel, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_int_map_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* call_flutter_echo_enum_map_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoEnumMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) call_flutter_echo_enum_map_channel = + fl_basic_message_channel_new(messenger, + call_flutter_echo_enum_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + call_flutter_echo_enum_map_channel, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_map_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* call_flutter_echo_class_map_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoClassMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) call_flutter_echo_class_map_channel = + fl_basic_message_channel_new(messenger, + call_flutter_echo_class_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + call_flutter_echo_class_map_channel, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_class_map_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* call_flutter_echo_non_null_string_map_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNonNullStringMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) + call_flutter_echo_non_null_string_map_channel = + fl_basic_message_channel_new( + messenger, call_flutter_echo_non_null_string_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + call_flutter_echo_non_null_string_map_channel, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_string_map_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* call_flutter_echo_non_null_int_map_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNonNullIntMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) call_flutter_echo_non_null_int_map_channel = + fl_basic_message_channel_new( + messenger, call_flutter_echo_non_null_int_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + call_flutter_echo_non_null_int_map_channel, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_int_map_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* call_flutter_echo_non_null_enum_map_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNonNullEnumMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) call_flutter_echo_non_null_enum_map_channel = + fl_basic_message_channel_new( + messenger, call_flutter_echo_non_null_enum_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + call_flutter_echo_non_null_enum_map_channel, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_enum_map_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* call_flutter_echo_non_null_class_map_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNonNullClassMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) + call_flutter_echo_non_null_class_map_channel = + fl_basic_message_channel_new( + messenger, call_flutter_echo_non_null_class_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + call_flutter_echo_non_null_class_map_channel, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_class_map_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* call_flutter_echo_enum_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoEnum%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) call_flutter_echo_enum_channel = + fl_basic_message_channel_new(messenger, + call_flutter_echo_enum_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + call_flutter_echo_enum_channel, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* call_flutter_echo_another_enum_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoAnotherEnum%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) call_flutter_echo_another_enum_channel = + fl_basic_message_channel_new(messenger, + call_flutter_echo_another_enum_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + call_flutter_echo_another_enum_channel, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_another_enum_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* call_flutter_echo_nullable_bool_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableBool%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) call_flutter_echo_nullable_bool_channel = + fl_basic_message_channel_new(messenger, + call_flutter_echo_nullable_bool_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + call_flutter_echo_nullable_bool_channel, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_bool_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* call_flutter_echo_nullable_int_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableInt%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) call_flutter_echo_nullable_int_channel = + fl_basic_message_channel_new(messenger, + call_flutter_echo_nullable_int_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + call_flutter_echo_nullable_int_channel, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_int_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* call_flutter_echo_nullable_double_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableDouble%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) call_flutter_echo_nullable_double_channel = + fl_basic_message_channel_new( + messenger, call_flutter_echo_nullable_double_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + call_flutter_echo_nullable_double_channel, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_double_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* call_flutter_echo_nullable_string_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableString%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) call_flutter_echo_nullable_string_channel = + fl_basic_message_channel_new( + messenger, call_flutter_echo_nullable_string_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + call_flutter_echo_nullable_string_channel, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_string_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* call_flutter_echo_nullable_uint8_list_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableUint8List%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) + call_flutter_echo_nullable_uint8_list_channel = + fl_basic_message_channel_new( + messenger, call_flutter_echo_nullable_uint8_list_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + call_flutter_echo_nullable_uint8_list_channel, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_uint8_list_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* call_flutter_echo_nullable_list_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableList%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) call_flutter_echo_nullable_list_channel = + fl_basic_message_channel_new(messenger, + call_flutter_echo_nullable_list_channel_name, FL_MESSAGE_CODEC(codec)); fl_basic_message_channel_set_message_handler( - echo_enum_channel, - core_tests_pigeon_test_host_integration_core_api_echo_enum_cb, + call_flutter_echo_nullable_list_channel, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_list_cb, g_object_ref(api_data), g_object_unref); - g_autofree gchar* echo_another_enum_channel_name = g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAnotherEnum%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_another_enum_channel = - fl_basic_message_channel_new(messenger, echo_another_enum_channel_name, - FL_MESSAGE_CODEC(codec)); + g_autofree gchar* call_flutter_echo_nullable_enum_list_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableEnumList%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) + call_flutter_echo_nullable_enum_list_channel = + fl_basic_message_channel_new( + messenger, call_flutter_echo_nullable_enum_list_channel_name, + FL_MESSAGE_CODEC(codec)); fl_basic_message_channel_set_message_handler( - echo_another_enum_channel, - core_tests_pigeon_test_host_integration_core_api_echo_another_enum_cb, + call_flutter_echo_nullable_enum_list_channel, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_enum_list_cb, g_object_ref(api_data), g_object_unref); - g_autofree gchar* echo_named_default_string_channel_name = g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoNamedDefaultString%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_named_default_string_channel = - fl_basic_message_channel_new(messenger, - echo_named_default_string_channel_name, - FL_MESSAGE_CODEC(codec)); + g_autofree gchar* call_flutter_echo_nullable_class_list_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableClassList%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) + call_flutter_echo_nullable_class_list_channel = + fl_basic_message_channel_new( + messenger, call_flutter_echo_nullable_class_list_channel_name, + FL_MESSAGE_CODEC(codec)); fl_basic_message_channel_set_message_handler( - echo_named_default_string_channel, - core_tests_pigeon_test_host_integration_core_api_echo_named_default_string_cb, + call_flutter_echo_nullable_class_list_channel, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_class_list_cb, g_object_ref(api_data), g_object_unref); - g_autofree gchar* echo_optional_default_double_channel_name = g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoOptionalDefaultDouble%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_optional_default_double_channel = - fl_basic_message_channel_new(messenger, - echo_optional_default_double_channel_name, - FL_MESSAGE_CODEC(codec)); + g_autofree gchar* call_flutter_echo_nullable_non_null_enum_list_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableNonNullEnumList%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) + call_flutter_echo_nullable_non_null_enum_list_channel = + fl_basic_message_channel_new( + messenger, + call_flutter_echo_nullable_non_null_enum_list_channel_name, + FL_MESSAGE_CODEC(codec)); fl_basic_message_channel_set_message_handler( - echo_optional_default_double_channel, - core_tests_pigeon_test_host_integration_core_api_echo_optional_default_double_cb, + call_flutter_echo_nullable_non_null_enum_list_channel, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_enum_list_cb, g_object_ref(api_data), g_object_unref); - g_autofree gchar* echo_required_int_channel_name = g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoRequiredInt%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_required_int_channel = - fl_basic_message_channel_new(messenger, echo_required_int_channel_name, - FL_MESSAGE_CODEC(codec)); + g_autofree gchar* + call_flutter_echo_nullable_non_null_class_list_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.callFlutterEchoNullableNonNullClassList%" + "s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) + call_flutter_echo_nullable_non_null_class_list_channel = + fl_basic_message_channel_new( + messenger, + call_flutter_echo_nullable_non_null_class_list_channel_name, + FL_MESSAGE_CODEC(codec)); fl_basic_message_channel_set_message_handler( - echo_required_int_channel, - core_tests_pigeon_test_host_integration_core_api_echo_required_int_cb, + call_flutter_echo_nullable_non_null_class_list_channel, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_class_list_cb, g_object_ref(api_data), g_object_unref); - g_autofree gchar* echo_all_nullable_types_channel_name = g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAllNullableTypes%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_all_nullable_types_channel = + g_autofree gchar* call_flutter_echo_nullable_map_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) call_flutter_echo_nullable_map_channel = fl_basic_message_channel_new(messenger, - echo_all_nullable_types_channel_name, + call_flutter_echo_nullable_map_channel_name, FL_MESSAGE_CODEC(codec)); fl_basic_message_channel_set_message_handler( - echo_all_nullable_types_channel, - core_tests_pigeon_test_host_integration_core_api_echo_all_nullable_types_cb, + call_flutter_echo_nullable_map_channel, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_map_cb, g_object_ref(api_data), g_object_unref); - g_autofree gchar* echo_all_nullable_types_without_recursion_channel_name = + g_autofree gchar* call_flutter_echo_nullable_string_map_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAllNullableTypesWithoutRecursion%s", + "callFlutterEchoNullableStringMap%s", dot_suffix); g_autoptr(FlBasicMessageChannel) - echo_all_nullable_types_without_recursion_channel = + call_flutter_echo_nullable_string_map_channel = fl_basic_message_channel_new( - messenger, echo_all_nullable_types_without_recursion_channel_name, + messenger, call_flutter_echo_nullable_string_map_channel_name, FL_MESSAGE_CODEC(codec)); fl_basic_message_channel_set_message_handler( - echo_all_nullable_types_without_recursion_channel, - core_tests_pigeon_test_host_integration_core_api_echo_all_nullable_types_without_recursion_cb, + call_flutter_echo_nullable_string_map_channel, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_string_map_cb, g_object_ref(api_data), g_object_unref); - g_autofree gchar* extract_nested_nullable_string_channel_name = + g_autofree gchar* call_flutter_echo_nullable_int_map_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "extractNestedNullableString%s", + "callFlutterEchoNullableIntMap%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) extract_nested_nullable_string_channel = - fl_basic_message_channel_new(messenger, - extract_nested_nullable_string_channel_name, - FL_MESSAGE_CODEC(codec)); + g_autoptr(FlBasicMessageChannel) call_flutter_echo_nullable_int_map_channel = + fl_basic_message_channel_new( + messenger, call_flutter_echo_nullable_int_map_channel_name, + FL_MESSAGE_CODEC(codec)); fl_basic_message_channel_set_message_handler( - extract_nested_nullable_string_channel, - core_tests_pigeon_test_host_integration_core_api_extract_nested_nullable_string_cb, + call_flutter_echo_nullable_int_map_channel, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_int_map_cb, g_object_ref(api_data), g_object_unref); - g_autofree gchar* create_nested_nullable_string_channel_name = + g_autofree gchar* call_flutter_echo_nullable_enum_map_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "createNestedNullableString%s", + "callFlutterEchoNullableEnumMap%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) create_nested_nullable_string_channel = - fl_basic_message_channel_new(messenger, - create_nested_nullable_string_channel_name, - FL_MESSAGE_CODEC(codec)); + g_autoptr(FlBasicMessageChannel) call_flutter_echo_nullable_enum_map_channel = + fl_basic_message_channel_new( + messenger, call_flutter_echo_nullable_enum_map_channel_name, + FL_MESSAGE_CODEC(codec)); fl_basic_message_channel_set_message_handler( - create_nested_nullable_string_channel, - core_tests_pigeon_test_host_integration_core_api_create_nested_nullable_string_cb, + call_flutter_echo_nullable_enum_map_channel, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_enum_map_cb, g_object_ref(api_data), g_object_unref); - g_autofree gchar* send_multiple_nullable_types_channel_name = g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "sendMultipleNullableTypes%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) send_multiple_nullable_types_channel = - fl_basic_message_channel_new(messenger, - send_multiple_nullable_types_channel_name, - FL_MESSAGE_CODEC(codec)); + g_autofree gchar* call_flutter_echo_nullable_class_map_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableClassMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) + call_flutter_echo_nullable_class_map_channel = + fl_basic_message_channel_new( + messenger, call_flutter_echo_nullable_class_map_channel_name, + FL_MESSAGE_CODEC(codec)); fl_basic_message_channel_set_message_handler( - send_multiple_nullable_types_channel, - core_tests_pigeon_test_host_integration_core_api_send_multiple_nullable_types_cb, + call_flutter_echo_nullable_class_map_channel, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_class_map_cb, g_object_ref(api_data), g_object_unref); g_autofree gchar* - send_multiple_nullable_types_without_recursion_channel_name = + call_flutter_echo_nullable_non_null_string_map_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi." - "sendMultipleNullableTypesWithoutRecursion%s", + "HostIntegrationCoreApi.callFlutterEchoNullableNonNullStringMap%" + "s", dot_suffix); g_autoptr(FlBasicMessageChannel) - send_multiple_nullable_types_without_recursion_channel = + call_flutter_echo_nullable_non_null_string_map_channel = fl_basic_message_channel_new( messenger, - send_multiple_nullable_types_without_recursion_channel_name, + call_flutter_echo_nullable_non_null_string_map_channel_name, FL_MESSAGE_CODEC(codec)); fl_basic_message_channel_set_message_handler( - send_multiple_nullable_types_without_recursion_channel, - core_tests_pigeon_test_host_integration_core_api_send_multiple_nullable_types_without_recursion_cb, - g_object_ref(api_data), g_object_unref); - g_autofree gchar* echo_nullable_int_channel_name = g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoNullableInt%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_nullable_int_channel = - fl_basic_message_channel_new(messenger, echo_nullable_int_channel_name, - FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - echo_nullable_int_channel, - core_tests_pigeon_test_host_integration_core_api_echo_nullable_int_cb, + call_flutter_echo_nullable_non_null_string_map_channel, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_string_map_cb, g_object_ref(api_data), g_object_unref); - g_autofree gchar* echo_nullable_double_channel_name = g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoNullableDouble%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_nullable_double_channel = - fl_basic_message_channel_new(messenger, echo_nullable_double_channel_name, - FL_MESSAGE_CODEC(codec)); + g_autofree gchar* call_flutter_echo_nullable_non_null_int_map_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableNonNullIntMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) + call_flutter_echo_nullable_non_null_int_map_channel = + fl_basic_message_channel_new( + messenger, + call_flutter_echo_nullable_non_null_int_map_channel_name, + FL_MESSAGE_CODEC(codec)); fl_basic_message_channel_set_message_handler( - echo_nullable_double_channel, - core_tests_pigeon_test_host_integration_core_api_echo_nullable_double_cb, + call_flutter_echo_nullable_non_null_int_map_channel, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_int_map_cb, g_object_ref(api_data), g_object_unref); - g_autofree gchar* echo_nullable_bool_channel_name = g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoNullableBool%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_nullable_bool_channel = - fl_basic_message_channel_new(messenger, echo_nullable_bool_channel_name, - FL_MESSAGE_CODEC(codec)); + g_autofree gchar* call_flutter_echo_nullable_non_null_enum_map_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableNonNullEnumMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) + call_flutter_echo_nullable_non_null_enum_map_channel = + fl_basic_message_channel_new( + messenger, + call_flutter_echo_nullable_non_null_enum_map_channel_name, + FL_MESSAGE_CODEC(codec)); fl_basic_message_channel_set_message_handler( - echo_nullable_bool_channel, - core_tests_pigeon_test_host_integration_core_api_echo_nullable_bool_cb, + call_flutter_echo_nullable_non_null_enum_map_channel, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_enum_map_cb, g_object_ref(api_data), g_object_unref); - g_autofree gchar* echo_nullable_string_channel_name = g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoNullableString%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_nullable_string_channel = - fl_basic_message_channel_new(messenger, echo_nullable_string_channel_name, - FL_MESSAGE_CODEC(codec)); + g_autofree gchar* call_flutter_echo_nullable_non_null_class_map_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableNonNullClassMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) + call_flutter_echo_nullable_non_null_class_map_channel = + fl_basic_message_channel_new( + messenger, + call_flutter_echo_nullable_non_null_class_map_channel_name, + FL_MESSAGE_CODEC(codec)); fl_basic_message_channel_set_message_handler( - echo_nullable_string_channel, - core_tests_pigeon_test_host_integration_core_api_echo_nullable_string_cb, + call_flutter_echo_nullable_non_null_class_map_channel, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_class_map_cb, g_object_ref(api_data), g_object_unref); - g_autofree gchar* echo_nullable_uint8_list_channel_name = g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoNullableUint8List%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_nullable_uint8_list_channel = + g_autofree gchar* call_flutter_echo_nullable_enum_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableEnum%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) call_flutter_echo_nullable_enum_channel = fl_basic_message_channel_new(messenger, - echo_nullable_uint8_list_channel_name, - FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - echo_nullable_uint8_list_channel, - core_tests_pigeon_test_host_integration_core_api_echo_nullable_uint8_list_cb, - g_object_ref(api_data), g_object_unref); - g_autofree gchar* echo_nullable_object_channel_name = g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoNullableObject%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_nullable_object_channel = - fl_basic_message_channel_new(messenger, echo_nullable_object_channel_name, + call_flutter_echo_nullable_enum_channel_name, FL_MESSAGE_CODEC(codec)); fl_basic_message_channel_set_message_handler( - echo_nullable_object_channel, - core_tests_pigeon_test_host_integration_core_api_echo_nullable_object_cb, + call_flutter_echo_nullable_enum_channel, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_enum_cb, g_object_ref(api_data), g_object_unref); - g_autofree gchar* echo_nullable_list_channel_name = g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoNullableList%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_nullable_list_channel = - fl_basic_message_channel_new(messenger, echo_nullable_list_channel_name, - FL_MESSAGE_CODEC(codec)); + g_autofree gchar* call_flutter_echo_another_nullable_enum_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoAnotherNullableEnum%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) + call_flutter_echo_another_nullable_enum_channel = + fl_basic_message_channel_new( + messenger, call_flutter_echo_another_nullable_enum_channel_name, + FL_MESSAGE_CODEC(codec)); fl_basic_message_channel_set_message_handler( - echo_nullable_list_channel, - core_tests_pigeon_test_host_integration_core_api_echo_nullable_list_cb, + call_flutter_echo_another_nullable_enum_channel, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_another_nullable_enum_cb, g_object_ref(api_data), g_object_unref); - g_autofree gchar* echo_nullable_map_channel_name = g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoNullableMap%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_nullable_map_channel = - fl_basic_message_channel_new(messenger, echo_nullable_map_channel_name, - FL_MESSAGE_CODEC(codec)); + g_autofree gchar* call_flutter_small_api_echo_string_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterSmallApiEchoString%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) call_flutter_small_api_echo_string_channel = + fl_basic_message_channel_new( + messenger, call_flutter_small_api_echo_string_channel_name, + FL_MESSAGE_CODEC(codec)); fl_basic_message_channel_set_message_handler( - echo_nullable_map_channel, - core_tests_pigeon_test_host_integration_core_api_echo_nullable_map_cb, + call_flutter_small_api_echo_string_channel, + core_tests_pigeon_test_host_integration_core_api_call_flutter_small_api_echo_string_cb, g_object_ref(api_data), g_object_unref); - g_autofree gchar* echo_nullable_enum_channel_name = g_strdup_printf( +} + +void core_tests_pigeon_test_host_integration_core_api_clear_method_handlers( + FlBinaryMessenger* messenger, const gchar* suffix) { + g_autofree gchar* dot_suffix = + suffix != nullptr ? g_strdup_printf(".%s", suffix) : g_strdup(""); + + g_autoptr(CoreTestsPigeonTestMessageCodec) codec = + core_tests_pigeon_test_message_codec_new(); + g_autofree gchar* noop_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.noop%" + "s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) noop_channel = fl_basic_message_channel_new( + messenger, noop_channel_name, FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler(noop_channel, nullptr, nullptr, + nullptr); + g_autofree gchar* echo_all_types_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoNullableEnum%s", + "echoAllTypes%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_nullable_enum_channel = - fl_basic_message_channel_new(messenger, echo_nullable_enum_channel_name, + g_autoptr(FlBasicMessageChannel) echo_all_types_channel = + fl_basic_message_channel_new(messenger, echo_all_types_channel_name, FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - echo_nullable_enum_channel, - core_tests_pigeon_test_host_integration_core_api_echo_nullable_enum_cb, - g_object_ref(api_data), g_object_unref); - g_autofree gchar* echo_another_nullable_enum_channel_name = g_strdup_printf( + fl_basic_message_channel_set_message_handler(echo_all_types_channel, nullptr, + nullptr, nullptr); + g_autofree gchar* throw_error_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAnotherNullableEnum%s", + "throwError%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_another_nullable_enum_channel = - fl_basic_message_channel_new(messenger, - echo_another_nullable_enum_channel_name, + g_autoptr(FlBasicMessageChannel) throw_error_channel = + fl_basic_message_channel_new(messenger, throw_error_channel_name, FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - echo_another_nullable_enum_channel, - core_tests_pigeon_test_host_integration_core_api_echo_another_nullable_enum_cb, - g_object_ref(api_data), g_object_unref); - g_autofree gchar* echo_optional_nullable_int_channel_name = g_strdup_printf( + fl_basic_message_channel_set_message_handler(throw_error_channel, nullptr, + nullptr, nullptr); + g_autofree gchar* throw_error_from_void_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoOptionalNullableInt%s", + "throwErrorFromVoid%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_optional_nullable_int_channel = + g_autoptr(FlBasicMessageChannel) throw_error_from_void_channel = fl_basic_message_channel_new(messenger, - echo_optional_nullable_int_channel_name, + throw_error_from_void_channel_name, FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - echo_optional_nullable_int_channel, - core_tests_pigeon_test_host_integration_core_api_echo_optional_nullable_int_cb, - g_object_ref(api_data), g_object_unref); - g_autofree gchar* echo_named_nullable_string_channel_name = g_strdup_printf( + fl_basic_message_channel_set_message_handler(throw_error_from_void_channel, + nullptr, nullptr, nullptr); + g_autofree gchar* throw_flutter_error_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoNamedNullableString%s", + "throwFlutterError%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_named_nullable_string_channel = - fl_basic_message_channel_new(messenger, - echo_named_nullable_string_channel_name, + g_autoptr(FlBasicMessageChannel) throw_flutter_error_channel = + fl_basic_message_channel_new(messenger, throw_flutter_error_channel_name, FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - echo_named_nullable_string_channel, - core_tests_pigeon_test_host_integration_core_api_echo_named_nullable_string_cb, - g_object_ref(api_data), g_object_unref); - g_autofree gchar* noop_async_channel_name = g_strdup_printf( + fl_basic_message_channel_set_message_handler(throw_flutter_error_channel, + nullptr, nullptr, nullptr); + g_autofree gchar* echo_int_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "noopAsync%s", + "echoInt%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) noop_async_channel = - fl_basic_message_channel_new(messenger, noop_async_channel_name, + g_autoptr(FlBasicMessageChannel) echo_int_channel = + fl_basic_message_channel_new(messenger, echo_int_channel_name, FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - noop_async_channel, - core_tests_pigeon_test_host_integration_core_api_noop_async_cb, - g_object_ref(api_data), g_object_unref); - g_autofree gchar* echo_async_int_channel_name = g_strdup_printf( + fl_basic_message_channel_set_message_handler(echo_int_channel, nullptr, + nullptr, nullptr); + g_autofree gchar* echo_double_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncInt%s", + "echoDouble%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_async_int_channel = - fl_basic_message_channel_new(messenger, echo_async_int_channel_name, + g_autoptr(FlBasicMessageChannel) echo_double_channel = + fl_basic_message_channel_new(messenger, echo_double_channel_name, FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - echo_async_int_channel, - core_tests_pigeon_test_host_integration_core_api_echo_async_int_cb, - g_object_ref(api_data), g_object_unref); - g_autofree gchar* echo_async_double_channel_name = g_strdup_printf( + fl_basic_message_channel_set_message_handler(echo_double_channel, nullptr, + nullptr, nullptr); + g_autofree gchar* echo_bool_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncDouble%s", + "echoBool%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_async_double_channel = - fl_basic_message_channel_new(messenger, echo_async_double_channel_name, + g_autoptr(FlBasicMessageChannel) echo_bool_channel = + fl_basic_message_channel_new(messenger, echo_bool_channel_name, FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - echo_async_double_channel, - core_tests_pigeon_test_host_integration_core_api_echo_async_double_cb, - g_object_ref(api_data), g_object_unref); - g_autofree gchar* echo_async_bool_channel_name = g_strdup_printf( + fl_basic_message_channel_set_message_handler(echo_bool_channel, nullptr, + nullptr, nullptr); + g_autofree gchar* echo_string_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncBool%s", + "echoString%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_async_bool_channel = - fl_basic_message_channel_new(messenger, echo_async_bool_channel_name, + g_autoptr(FlBasicMessageChannel) echo_string_channel = + fl_basic_message_channel_new(messenger, echo_string_channel_name, FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - echo_async_bool_channel, - core_tests_pigeon_test_host_integration_core_api_echo_async_bool_cb, - g_object_ref(api_data), g_object_unref); - g_autofree gchar* echo_async_string_channel_name = g_strdup_printf( + fl_basic_message_channel_set_message_handler(echo_string_channel, nullptr, + nullptr, nullptr); + g_autofree gchar* echo_uint8_list_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncString%s", + "echoUint8List%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_async_string_channel = - fl_basic_message_channel_new(messenger, echo_async_string_channel_name, + g_autoptr(FlBasicMessageChannel) echo_uint8_list_channel = + fl_basic_message_channel_new(messenger, echo_uint8_list_channel_name, FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - echo_async_string_channel, - core_tests_pigeon_test_host_integration_core_api_echo_async_string_cb, - g_object_ref(api_data), g_object_unref); - g_autofree gchar* echo_async_uint8_list_channel_name = g_strdup_printf( + fl_basic_message_channel_set_message_handler(echo_uint8_list_channel, nullptr, + nullptr, nullptr); + g_autofree gchar* echo_object_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncUint8List%s", + "echoObject%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_async_uint8_list_channel = - fl_basic_message_channel_new(messenger, - echo_async_uint8_list_channel_name, + g_autoptr(FlBasicMessageChannel) echo_object_channel = + fl_basic_message_channel_new(messenger, echo_object_channel_name, FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - echo_async_uint8_list_channel, - core_tests_pigeon_test_host_integration_core_api_echo_async_uint8_list_cb, - g_object_ref(api_data), g_object_unref); - g_autofree gchar* echo_async_object_channel_name = g_strdup_printf( + fl_basic_message_channel_set_message_handler(echo_object_channel, nullptr, + nullptr, nullptr); + g_autofree gchar* echo_list_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncObject%s", + "echoList%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_async_object_channel = - fl_basic_message_channel_new(messenger, echo_async_object_channel_name, + g_autoptr(FlBasicMessageChannel) echo_list_channel = + fl_basic_message_channel_new(messenger, echo_list_channel_name, FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - echo_async_object_channel, - core_tests_pigeon_test_host_integration_core_api_echo_async_object_cb, - g_object_ref(api_data), g_object_unref); - g_autofree gchar* echo_async_list_channel_name = g_strdup_printf( + fl_basic_message_channel_set_message_handler(echo_list_channel, nullptr, + nullptr, nullptr); + g_autofree gchar* echo_enum_list_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncList%s", + "echoEnumList%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_async_list_channel = - fl_basic_message_channel_new(messenger, echo_async_list_channel_name, + g_autoptr(FlBasicMessageChannel) echo_enum_list_channel = + fl_basic_message_channel_new(messenger, echo_enum_list_channel_name, FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - echo_async_list_channel, - core_tests_pigeon_test_host_integration_core_api_echo_async_list_cb, - g_object_ref(api_data), g_object_unref); - g_autofree gchar* echo_async_map_channel_name = g_strdup_printf( + fl_basic_message_channel_set_message_handler(echo_enum_list_channel, nullptr, + nullptr, nullptr); + g_autofree gchar* echo_class_list_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncMap%s", + "echoClassList%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_async_map_channel = - fl_basic_message_channel_new(messenger, echo_async_map_channel_name, + g_autoptr(FlBasicMessageChannel) echo_class_list_channel = + fl_basic_message_channel_new(messenger, echo_class_list_channel_name, FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - echo_async_map_channel, - core_tests_pigeon_test_host_integration_core_api_echo_async_map_cb, - g_object_ref(api_data), g_object_unref); - g_autofree gchar* echo_async_enum_channel_name = g_strdup_printf( + fl_basic_message_channel_set_message_handler(echo_class_list_channel, nullptr, + nullptr, nullptr); + g_autofree gchar* echo_non_null_enum_list_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncEnum%s", + "echoNonNullEnumList%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_async_enum_channel = - fl_basic_message_channel_new(messenger, echo_async_enum_channel_name, + g_autoptr(FlBasicMessageChannel) echo_non_null_enum_list_channel = + fl_basic_message_channel_new(messenger, + echo_non_null_enum_list_channel_name, FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - echo_async_enum_channel, - core_tests_pigeon_test_host_integration_core_api_echo_async_enum_cb, - g_object_ref(api_data), g_object_unref); - g_autofree gchar* echo_another_async_enum_channel_name = g_strdup_printf( + fl_basic_message_channel_set_message_handler(echo_non_null_enum_list_channel, + nullptr, nullptr, nullptr); + g_autofree gchar* echo_non_null_class_list_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAnotherAsyncEnum%s", + "echoNonNullClassList%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_another_async_enum_channel = + g_autoptr(FlBasicMessageChannel) echo_non_null_class_list_channel = fl_basic_message_channel_new(messenger, - echo_another_async_enum_channel_name, + echo_non_null_class_list_channel_name, FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - echo_another_async_enum_channel, - core_tests_pigeon_test_host_integration_core_api_echo_another_async_enum_cb, - g_object_ref(api_data), g_object_unref); - g_autofree gchar* throw_async_error_channel_name = g_strdup_printf( + fl_basic_message_channel_set_message_handler(echo_non_null_class_list_channel, + nullptr, nullptr, nullptr); + g_autofree gchar* echo_map_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "throwAsyncError%s", + "echoMap%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) throw_async_error_channel = - fl_basic_message_channel_new(messenger, throw_async_error_channel_name, + g_autoptr(FlBasicMessageChannel) echo_map_channel = + fl_basic_message_channel_new(messenger, echo_map_channel_name, FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - throw_async_error_channel, - core_tests_pigeon_test_host_integration_core_api_throw_async_error_cb, - g_object_ref(api_data), g_object_unref); - g_autofree gchar* throw_async_error_from_void_channel_name = g_strdup_printf( + fl_basic_message_channel_set_message_handler(echo_map_channel, nullptr, + nullptr, nullptr); + g_autofree gchar* echo_string_map_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "throwAsyncErrorFromVoid%s", + "echoStringMap%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) throw_async_error_from_void_channel = - fl_basic_message_channel_new(messenger, - throw_async_error_from_void_channel_name, + g_autoptr(FlBasicMessageChannel) echo_string_map_channel = + fl_basic_message_channel_new(messenger, echo_string_map_channel_name, FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - throw_async_error_from_void_channel, - core_tests_pigeon_test_host_integration_core_api_throw_async_error_from_void_cb, - g_object_ref(api_data), g_object_unref); - g_autofree gchar* throw_async_flutter_error_channel_name = g_strdup_printf( + fl_basic_message_channel_set_message_handler(echo_string_map_channel, nullptr, + nullptr, nullptr); + g_autofree gchar* echo_int_map_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "throwAsyncFlutterError%s", + "echoIntMap%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) throw_async_flutter_error_channel = - fl_basic_message_channel_new(messenger, - throw_async_flutter_error_channel_name, - FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - throw_async_flutter_error_channel, - core_tests_pigeon_test_host_integration_core_api_throw_async_flutter_error_cb, - g_object_ref(api_data), g_object_unref); - g_autofree gchar* echo_async_all_types_channel_name = g_strdup_printf( + g_autoptr(FlBasicMessageChannel) echo_int_map_channel = + fl_basic_message_channel_new(messenger, echo_int_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler(echo_int_map_channel, nullptr, + nullptr, nullptr); + g_autofree gchar* echo_enum_map_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncAllTypes%s", + "echoEnumMap%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_async_all_types_channel = - fl_basic_message_channel_new(messenger, echo_async_all_types_channel_name, + g_autoptr(FlBasicMessageChannel) echo_enum_map_channel = + fl_basic_message_channel_new(messenger, echo_enum_map_channel_name, FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - echo_async_all_types_channel, - core_tests_pigeon_test_host_integration_core_api_echo_async_all_types_cb, - g_object_ref(api_data), g_object_unref); - g_autofree gchar* echo_async_nullable_all_nullable_types_channel_name = - g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncNullableAllNullableTypes%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) - echo_async_nullable_all_nullable_types_channel = - fl_basic_message_channel_new( - messenger, echo_async_nullable_all_nullable_types_channel_name, - FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - echo_async_nullable_all_nullable_types_channel, - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_all_nullable_types_cb, - g_object_ref(api_data), g_object_unref); - g_autofree gchar* - echo_async_nullable_all_nullable_types_without_recursion_channel_name = - g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi." - "echoAsyncNullableAllNullableTypesWithoutRecursion%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) - echo_async_nullable_all_nullable_types_without_recursion_channel = - fl_basic_message_channel_new( - messenger, - echo_async_nullable_all_nullable_types_without_recursion_channel_name, - FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - echo_async_nullable_all_nullable_types_without_recursion_channel, - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_all_nullable_types_without_recursion_cb, - g_object_ref(api_data), g_object_unref); - g_autofree gchar* echo_async_nullable_int_channel_name = g_strdup_printf( + fl_basic_message_channel_set_message_handler(echo_enum_map_channel, nullptr, + nullptr, nullptr); + g_autofree gchar* echo_class_map_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncNullableInt%s", + "echoClassMap%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_async_nullable_int_channel = - fl_basic_message_channel_new(messenger, - echo_async_nullable_int_channel_name, + g_autoptr(FlBasicMessageChannel) echo_class_map_channel = + fl_basic_message_channel_new(messenger, echo_class_map_channel_name, FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - echo_async_nullable_int_channel, - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_int_cb, - g_object_ref(api_data), g_object_unref); - g_autofree gchar* echo_async_nullable_double_channel_name = g_strdup_printf( + fl_basic_message_channel_set_message_handler(echo_class_map_channel, nullptr, + nullptr, nullptr); + g_autofree gchar* echo_non_null_string_map_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncNullableDouble%s", + "echoNonNullStringMap%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_async_nullable_double_channel = + g_autoptr(FlBasicMessageChannel) echo_non_null_string_map_channel = fl_basic_message_channel_new(messenger, - echo_async_nullable_double_channel_name, + echo_non_null_string_map_channel_name, FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - echo_async_nullable_double_channel, - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_double_cb, - g_object_ref(api_data), g_object_unref); - g_autofree gchar* echo_async_nullable_bool_channel_name = g_strdup_printf( + fl_basic_message_channel_set_message_handler(echo_non_null_string_map_channel, + nullptr, nullptr, nullptr); + g_autofree gchar* echo_non_null_int_map_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncNullableBool%s", + "echoNonNullIntMap%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_async_nullable_bool_channel = + g_autoptr(FlBasicMessageChannel) echo_non_null_int_map_channel = fl_basic_message_channel_new(messenger, - echo_async_nullable_bool_channel_name, + echo_non_null_int_map_channel_name, FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - echo_async_nullable_bool_channel, - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_bool_cb, - g_object_ref(api_data), g_object_unref); - g_autofree gchar* echo_async_nullable_string_channel_name = g_strdup_printf( + fl_basic_message_channel_set_message_handler(echo_non_null_int_map_channel, + nullptr, nullptr, nullptr); + g_autofree gchar* echo_non_null_enum_map_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncNullableString%s", + "echoNonNullEnumMap%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_async_nullable_string_channel = + g_autoptr(FlBasicMessageChannel) echo_non_null_enum_map_channel = fl_basic_message_channel_new(messenger, - echo_async_nullable_string_channel_name, + echo_non_null_enum_map_channel_name, FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - echo_async_nullable_string_channel, - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_string_cb, - g_object_ref(api_data), g_object_unref); - g_autofree gchar* echo_async_nullable_uint8_list_channel_name = - g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncNullableUint8List%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_async_nullable_uint8_list_channel = + fl_basic_message_channel_set_message_handler(echo_non_null_enum_map_channel, + nullptr, nullptr, nullptr); + g_autofree gchar* echo_non_null_class_map_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoNonNullClassMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_non_null_class_map_channel = fl_basic_message_channel_new(messenger, - echo_async_nullable_uint8_list_channel_name, + echo_non_null_class_map_channel_name, FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - echo_async_nullable_uint8_list_channel, - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_uint8_list_cb, - g_object_ref(api_data), g_object_unref); - g_autofree gchar* echo_async_nullable_object_channel_name = g_strdup_printf( + fl_basic_message_channel_set_message_handler(echo_non_null_class_map_channel, + nullptr, nullptr, nullptr); + g_autofree gchar* echo_class_wrapper_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncNullableObject%s", + "echoClassWrapper%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_async_nullable_object_channel = - fl_basic_message_channel_new(messenger, - echo_async_nullable_object_channel_name, + g_autoptr(FlBasicMessageChannel) echo_class_wrapper_channel = + fl_basic_message_channel_new(messenger, echo_class_wrapper_channel_name, FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - echo_async_nullable_object_channel, - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_object_cb, - g_object_ref(api_data), g_object_unref); - g_autofree gchar* echo_async_nullable_list_channel_name = g_strdup_printf( + fl_basic_message_channel_set_message_handler(echo_class_wrapper_channel, + nullptr, nullptr, nullptr); + g_autofree gchar* echo_enum_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncNullableList%s", + "echoEnum%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_async_nullable_list_channel = - fl_basic_message_channel_new(messenger, - echo_async_nullable_list_channel_name, + g_autoptr(FlBasicMessageChannel) echo_enum_channel = + fl_basic_message_channel_new(messenger, echo_enum_channel_name, FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - echo_async_nullable_list_channel, - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_list_cb, - g_object_ref(api_data), g_object_unref); - g_autofree gchar* echo_async_nullable_map_channel_name = g_strdup_printf( + fl_basic_message_channel_set_message_handler(echo_enum_channel, nullptr, + nullptr, nullptr); + g_autofree gchar* echo_another_enum_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncNullableMap%s", + "echoAnotherEnum%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_async_nullable_map_channel = - fl_basic_message_channel_new(messenger, - echo_async_nullable_map_channel_name, + g_autoptr(FlBasicMessageChannel) echo_another_enum_channel = + fl_basic_message_channel_new(messenger, echo_another_enum_channel_name, FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - echo_async_nullable_map_channel, - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_map_cb, - g_object_ref(api_data), g_object_unref); - g_autofree gchar* echo_async_nullable_enum_channel_name = g_strdup_printf( + fl_basic_message_channel_set_message_handler(echo_another_enum_channel, + nullptr, nullptr, nullptr); + g_autofree gchar* echo_named_default_string_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncNullableEnum%s", + "echoNamedDefaultString%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_async_nullable_enum_channel = + g_autoptr(FlBasicMessageChannel) echo_named_default_string_channel = fl_basic_message_channel_new(messenger, - echo_async_nullable_enum_channel_name, + echo_named_default_string_channel_name, FL_MESSAGE_CODEC(codec)); fl_basic_message_channel_set_message_handler( - echo_async_nullable_enum_channel, - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_enum_cb, - g_object_ref(api_data), g_object_unref); - g_autofree gchar* echo_another_async_nullable_enum_channel_name = - g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAnotherAsyncNullableEnum%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_another_async_nullable_enum_channel = - fl_basic_message_channel_new( - messenger, echo_another_async_nullable_enum_channel_name, - FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - echo_another_async_nullable_enum_channel, - core_tests_pigeon_test_host_integration_core_api_echo_another_async_nullable_enum_cb, - g_object_ref(api_data), g_object_unref); - g_autofree gchar* call_flutter_noop_channel_name = g_strdup_printf( + echo_named_default_string_channel, nullptr, nullptr, nullptr); + g_autofree gchar* echo_optional_default_double_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterNoop%s", + "echoOptionalDefaultDouble%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) call_flutter_noop_channel = - fl_basic_message_channel_new(messenger, call_flutter_noop_channel_name, + g_autoptr(FlBasicMessageChannel) echo_optional_default_double_channel = + fl_basic_message_channel_new(messenger, + echo_optional_default_double_channel_name, FL_MESSAGE_CODEC(codec)); fl_basic_message_channel_set_message_handler( - call_flutter_noop_channel, - core_tests_pigeon_test_host_integration_core_api_call_flutter_noop_cb, - g_object_ref(api_data), g_object_unref); - g_autofree gchar* call_flutter_throw_error_channel_name = g_strdup_printf( + echo_optional_default_double_channel, nullptr, nullptr, nullptr); + g_autofree gchar* echo_required_int_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterThrowError%s", + "echoRequiredInt%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) call_flutter_throw_error_channel = - fl_basic_message_channel_new(messenger, - call_flutter_throw_error_channel_name, + g_autoptr(FlBasicMessageChannel) echo_required_int_channel = + fl_basic_message_channel_new(messenger, echo_required_int_channel_name, FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - call_flutter_throw_error_channel, - core_tests_pigeon_test_host_integration_core_api_call_flutter_throw_error_cb, - g_object_ref(api_data), g_object_unref); - g_autofree gchar* call_flutter_throw_error_from_void_channel_name = - g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterThrowErrorFromVoid%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) call_flutter_throw_error_from_void_channel = - fl_basic_message_channel_new( - messenger, call_flutter_throw_error_from_void_channel_name, - FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - call_flutter_throw_error_from_void_channel, - core_tests_pigeon_test_host_integration_core_api_call_flutter_throw_error_from_void_cb, - g_object_ref(api_data), g_object_unref); - g_autofree gchar* call_flutter_echo_all_types_channel_name = g_strdup_printf( + fl_basic_message_channel_set_message_handler(echo_required_int_channel, + nullptr, nullptr, nullptr); + g_autofree gchar* echo_all_nullable_types_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoAllTypes%s", + "echoAllNullableTypes%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) call_flutter_echo_all_types_channel = + g_autoptr(FlBasicMessageChannel) echo_all_nullable_types_channel = fl_basic_message_channel_new(messenger, - call_flutter_echo_all_types_channel_name, + echo_all_nullable_types_channel_name, FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - call_flutter_echo_all_types_channel, - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_types_cb, - g_object_ref(api_data), g_object_unref); - g_autofree gchar* call_flutter_echo_all_nullable_types_channel_name = - g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoAllNullableTypes%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) - call_flutter_echo_all_nullable_types_channel = - fl_basic_message_channel_new( - messenger, call_flutter_echo_all_nullable_types_channel_name, - FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - call_flutter_echo_all_nullable_types_channel, - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_nullable_types_cb, - g_object_ref(api_data), g_object_unref); - g_autofree gchar* call_flutter_send_multiple_nullable_types_channel_name = + fl_basic_message_channel_set_message_handler(echo_all_nullable_types_channel, + nullptr, nullptr, nullptr); + g_autofree gchar* echo_all_nullable_types_without_recursion_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterSendMultipleNullableTypes%s", + "echoAllNullableTypesWithoutRecursion%s", dot_suffix); g_autoptr(FlBasicMessageChannel) - call_flutter_send_multiple_nullable_types_channel = - fl_basic_message_channel_new( - messenger, call_flutter_send_multiple_nullable_types_channel_name, - FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - call_flutter_send_multiple_nullable_types_channel, - core_tests_pigeon_test_host_integration_core_api_call_flutter_send_multiple_nullable_types_cb, - g_object_ref(api_data), g_object_unref); - g_autofree gchar* - call_flutter_echo_all_nullable_types_without_recursion_channel_name = - g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi." - "callFlutterEchoAllNullableTypesWithoutRecursion%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) - call_flutter_echo_all_nullable_types_without_recursion_channel = + echo_all_nullable_types_without_recursion_channel = fl_basic_message_channel_new( - messenger, - call_flutter_echo_all_nullable_types_without_recursion_channel_name, + messenger, echo_all_nullable_types_without_recursion_channel_name, FL_MESSAGE_CODEC(codec)); fl_basic_message_channel_set_message_handler( - call_flutter_echo_all_nullable_types_without_recursion_channel, - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_nullable_types_without_recursion_cb, - g_object_ref(api_data), g_object_unref); + echo_all_nullable_types_without_recursion_channel, nullptr, nullptr, + nullptr); + g_autofree gchar* extract_nested_nullable_string_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "extractNestedNullableString%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) extract_nested_nullable_string_channel = + fl_basic_message_channel_new(messenger, + extract_nested_nullable_string_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + extract_nested_nullable_string_channel, nullptr, nullptr, nullptr); + g_autofree gchar* create_nested_nullable_string_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "createNestedNullableString%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) create_nested_nullable_string_channel = + fl_basic_message_channel_new(messenger, + create_nested_nullable_string_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + create_nested_nullable_string_channel, nullptr, nullptr, nullptr); + g_autofree gchar* send_multiple_nullable_types_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "sendMultipleNullableTypes%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) send_multiple_nullable_types_channel = + fl_basic_message_channel_new(messenger, + send_multiple_nullable_types_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + send_multiple_nullable_types_channel, nullptr, nullptr, nullptr); g_autofree gchar* - call_flutter_send_multiple_nullable_types_without_recursion_channel_name = + send_multiple_nullable_types_without_recursion_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests." "HostIntegrationCoreApi." - "callFlutterSendMultipleNullableTypesWithoutRecursion%s", + "sendMultipleNullableTypesWithoutRecursion%s", dot_suffix); g_autoptr(FlBasicMessageChannel) - call_flutter_send_multiple_nullable_types_without_recursion_channel = + send_multiple_nullable_types_without_recursion_channel = fl_basic_message_channel_new( messenger, - call_flutter_send_multiple_nullable_types_without_recursion_channel_name, + send_multiple_nullable_types_without_recursion_channel_name, FL_MESSAGE_CODEC(codec)); fl_basic_message_channel_set_message_handler( - call_flutter_send_multiple_nullable_types_without_recursion_channel, - core_tests_pigeon_test_host_integration_core_api_call_flutter_send_multiple_nullable_types_without_recursion_cb, - g_object_ref(api_data), g_object_unref); - g_autofree gchar* call_flutter_echo_bool_channel_name = g_strdup_printf( + send_multiple_nullable_types_without_recursion_channel, nullptr, nullptr, + nullptr); + g_autofree gchar* echo_nullable_int_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoBool%s", + "echoNullableInt%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) call_flutter_echo_bool_channel = - fl_basic_message_channel_new(messenger, - call_flutter_echo_bool_channel_name, + g_autoptr(FlBasicMessageChannel) echo_nullable_int_channel = + fl_basic_message_channel_new(messenger, echo_nullable_int_channel_name, FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - call_flutter_echo_bool_channel, - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_bool_cb, - g_object_ref(api_data), g_object_unref); - g_autofree gchar* call_flutter_echo_int_channel_name = g_strdup_printf( + fl_basic_message_channel_set_message_handler(echo_nullable_int_channel, + nullptr, nullptr, nullptr); + g_autofree gchar* echo_nullable_double_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoInt%s", + "echoNullableDouble%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) call_flutter_echo_int_channel = - fl_basic_message_channel_new(messenger, - call_flutter_echo_int_channel_name, + g_autoptr(FlBasicMessageChannel) echo_nullable_double_channel = + fl_basic_message_channel_new(messenger, echo_nullable_double_channel_name, FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - call_flutter_echo_int_channel, - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_int_cb, - g_object_ref(api_data), g_object_unref); - g_autofree gchar* call_flutter_echo_double_channel_name = g_strdup_printf( + fl_basic_message_channel_set_message_handler(echo_nullable_double_channel, + nullptr, nullptr, nullptr); + g_autofree gchar* echo_nullable_bool_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoDouble%s", + "echoNullableBool%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) call_flutter_echo_double_channel = - fl_basic_message_channel_new(messenger, - call_flutter_echo_double_channel_name, + g_autoptr(FlBasicMessageChannel) echo_nullable_bool_channel = + fl_basic_message_channel_new(messenger, echo_nullable_bool_channel_name, FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - call_flutter_echo_double_channel, - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_double_cb, - g_object_ref(api_data), g_object_unref); - g_autofree gchar* call_flutter_echo_string_channel_name = g_strdup_printf( + fl_basic_message_channel_set_message_handler(echo_nullable_bool_channel, + nullptr, nullptr, nullptr); + g_autofree gchar* echo_nullable_string_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoString%s", + "echoNullableString%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) call_flutter_echo_string_channel = - fl_basic_message_channel_new(messenger, - call_flutter_echo_string_channel_name, + g_autoptr(FlBasicMessageChannel) echo_nullable_string_channel = + fl_basic_message_channel_new(messenger, echo_nullable_string_channel_name, FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - call_flutter_echo_string_channel, - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_string_cb, - g_object_ref(api_data), g_object_unref); - g_autofree gchar* call_flutter_echo_uint8_list_channel_name = g_strdup_printf( + fl_basic_message_channel_set_message_handler(echo_nullable_string_channel, + nullptr, nullptr, nullptr); + g_autofree gchar* echo_nullable_uint8_list_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoUint8List%s", + "echoNullableUint8List%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) call_flutter_echo_uint8_list_channel = + g_autoptr(FlBasicMessageChannel) echo_nullable_uint8_list_channel = fl_basic_message_channel_new(messenger, - call_flutter_echo_uint8_list_channel_name, + echo_nullable_uint8_list_channel_name, FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - call_flutter_echo_uint8_list_channel, - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_uint8_list_cb, - g_object_ref(api_data), g_object_unref); - g_autofree gchar* call_flutter_echo_list_channel_name = g_strdup_printf( + fl_basic_message_channel_set_message_handler(echo_nullable_uint8_list_channel, + nullptr, nullptr, nullptr); + g_autofree gchar* echo_nullable_object_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoList%s", + "echoNullableObject%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) call_flutter_echo_list_channel = - fl_basic_message_channel_new(messenger, - call_flutter_echo_list_channel_name, + g_autoptr(FlBasicMessageChannel) echo_nullable_object_channel = + fl_basic_message_channel_new(messenger, echo_nullable_object_channel_name, FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - call_flutter_echo_list_channel, - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_list_cb, - g_object_ref(api_data), g_object_unref); - g_autofree gchar* call_flutter_echo_map_channel_name = g_strdup_printf( + fl_basic_message_channel_set_message_handler(echo_nullable_object_channel, + nullptr, nullptr, nullptr); + g_autofree gchar* echo_nullable_list_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoMap%s", + "echoNullableList%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) call_flutter_echo_map_channel = - fl_basic_message_channel_new(messenger, - call_flutter_echo_map_channel_name, + g_autoptr(FlBasicMessageChannel) echo_nullable_list_channel = + fl_basic_message_channel_new(messenger, echo_nullable_list_channel_name, FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - call_flutter_echo_map_channel, - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_map_cb, - g_object_ref(api_data), g_object_unref); - g_autofree gchar* call_flutter_echo_enum_channel_name = g_strdup_printf( + fl_basic_message_channel_set_message_handler(echo_nullable_list_channel, + nullptr, nullptr, nullptr); + g_autofree gchar* echo_nullable_enum_list_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoEnum%s", + "echoNullableEnumList%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) call_flutter_echo_enum_channel = - fl_basic_message_channel_new(messenger, - call_flutter_echo_enum_channel_name, - FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - call_flutter_echo_enum_channel, - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_cb, - g_object_ref(api_data), g_object_unref); - g_autofree gchar* call_flutter_echo_another_enum_channel_name = - g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoAnotherEnum%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) call_flutter_echo_another_enum_channel = - fl_basic_message_channel_new(messenger, - call_flutter_echo_another_enum_channel_name, - FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - call_flutter_echo_another_enum_channel, - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_another_enum_cb, - g_object_ref(api_data), g_object_unref); - g_autofree gchar* call_flutter_echo_nullable_bool_channel_name = - g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoNullableBool%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) call_flutter_echo_nullable_bool_channel = + g_autoptr(FlBasicMessageChannel) echo_nullable_enum_list_channel = fl_basic_message_channel_new(messenger, - call_flutter_echo_nullable_bool_channel_name, + echo_nullable_enum_list_channel_name, FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - call_flutter_echo_nullable_bool_channel, - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_bool_cb, - g_object_ref(api_data), g_object_unref); - g_autofree gchar* call_flutter_echo_nullable_int_channel_name = - g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoNullableInt%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) call_flutter_echo_nullable_int_channel = + fl_basic_message_channel_set_message_handler(echo_nullable_enum_list_channel, + nullptr, nullptr, nullptr); + g_autofree gchar* echo_nullable_class_list_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoNullableClassList%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_nullable_class_list_channel = fl_basic_message_channel_new(messenger, - call_flutter_echo_nullable_int_channel_name, + echo_nullable_class_list_channel_name, FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - call_flutter_echo_nullable_int_channel, - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_int_cb, - g_object_ref(api_data), g_object_unref); - g_autofree gchar* call_flutter_echo_nullable_double_channel_name = + fl_basic_message_channel_set_message_handler(echo_nullable_class_list_channel, + nullptr, nullptr, nullptr); + g_autofree gchar* echo_nullable_non_null_enum_list_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoNullableDouble%s", + "echoNullableNonNullEnumList%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) call_flutter_echo_nullable_double_channel = + g_autoptr(FlBasicMessageChannel) echo_nullable_non_null_enum_list_channel = fl_basic_message_channel_new( - messenger, call_flutter_echo_nullable_double_channel_name, + messenger, echo_nullable_non_null_enum_list_channel_name, FL_MESSAGE_CODEC(codec)); fl_basic_message_channel_set_message_handler( - call_flutter_echo_nullable_double_channel, - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_double_cb, - g_object_ref(api_data), g_object_unref); - g_autofree gchar* call_flutter_echo_nullable_string_channel_name = + echo_nullable_non_null_enum_list_channel, nullptr, nullptr, nullptr); + g_autofree gchar* echo_nullable_non_null_class_list_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoNullableString%s", + "echoNullableNonNullClassList%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) call_flutter_echo_nullable_string_channel = + g_autoptr(FlBasicMessageChannel) echo_nullable_non_null_class_list_channel = fl_basic_message_channel_new( - messenger, call_flutter_echo_nullable_string_channel_name, + messenger, echo_nullable_non_null_class_list_channel_name, FL_MESSAGE_CODEC(codec)); fl_basic_message_channel_set_message_handler( - call_flutter_echo_nullable_string_channel, - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_string_cb, - g_object_ref(api_data), g_object_unref); - g_autofree gchar* call_flutter_echo_nullable_uint8_list_channel_name = - g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoNullableUint8List%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) - call_flutter_echo_nullable_uint8_list_channel = - fl_basic_message_channel_new( - messenger, call_flutter_echo_nullable_uint8_list_channel_name, - FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - call_flutter_echo_nullable_uint8_list_channel, - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_uint8_list_cb, - g_object_ref(api_data), g_object_unref); - g_autofree gchar* call_flutter_echo_nullable_list_channel_name = - g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoNullableList%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) call_flutter_echo_nullable_list_channel = + echo_nullable_non_null_class_list_channel, nullptr, nullptr, nullptr); + g_autofree gchar* echo_nullable_map_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoNullableMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_nullable_map_channel = + fl_basic_message_channel_new(messenger, echo_nullable_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler(echo_nullable_map_channel, + nullptr, nullptr, nullptr); + g_autofree gchar* echo_nullable_string_map_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoNullableStringMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_nullable_string_map_channel = + fl_basic_message_channel_new(messenger, + echo_nullable_string_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler(echo_nullable_string_map_channel, + nullptr, nullptr, nullptr); + g_autofree gchar* echo_nullable_int_map_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoNullableIntMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_nullable_int_map_channel = + fl_basic_message_channel_new(messenger, + echo_nullable_int_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler(echo_nullable_int_map_channel, + nullptr, nullptr, nullptr); + g_autofree gchar* echo_nullable_enum_map_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoNullableEnumMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_nullable_enum_map_channel = fl_basic_message_channel_new(messenger, - call_flutter_echo_nullable_list_channel_name, + echo_nullable_enum_map_channel_name, FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - call_flutter_echo_nullable_list_channel, - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_list_cb, - g_object_ref(api_data), g_object_unref); - g_autofree gchar* call_flutter_echo_nullable_map_channel_name = + fl_basic_message_channel_set_message_handler(echo_nullable_enum_map_channel, + nullptr, nullptr, nullptr); + g_autofree gchar* echo_nullable_class_map_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoNullableClassMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_nullable_class_map_channel = + fl_basic_message_channel_new(messenger, + echo_nullable_class_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler(echo_nullable_class_map_channel, + nullptr, nullptr, nullptr); + g_autofree gchar* echo_nullable_non_null_string_map_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoNullableMap%s", + "echoNullableNonNullStringMap%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) call_flutter_echo_nullable_map_channel = - fl_basic_message_channel_new(messenger, - call_flutter_echo_nullable_map_channel_name, - FL_MESSAGE_CODEC(codec)); + g_autoptr(FlBasicMessageChannel) echo_nullable_non_null_string_map_channel = + fl_basic_message_channel_new( + messenger, echo_nullable_non_null_string_map_channel_name, + FL_MESSAGE_CODEC(codec)); fl_basic_message_channel_set_message_handler( - call_flutter_echo_nullable_map_channel, - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_map_cb, - g_object_ref(api_data), g_object_unref); - g_autofree gchar* call_flutter_echo_nullable_enum_channel_name = + echo_nullable_non_null_string_map_channel, nullptr, nullptr, nullptr); + g_autofree gchar* echo_nullable_non_null_int_map_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoNullableEnum%s", + "echoNullableNonNullIntMap%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) call_flutter_echo_nullable_enum_channel = + g_autoptr(FlBasicMessageChannel) echo_nullable_non_null_int_map_channel = fl_basic_message_channel_new(messenger, - call_flutter_echo_nullable_enum_channel_name, + echo_nullable_non_null_int_map_channel_name, FL_MESSAGE_CODEC(codec)); fl_basic_message_channel_set_message_handler( - call_flutter_echo_nullable_enum_channel, - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_enum_cb, - g_object_ref(api_data), g_object_unref); - g_autofree gchar* call_flutter_echo_another_nullable_enum_channel_name = + echo_nullable_non_null_int_map_channel, nullptr, nullptr, nullptr); + g_autofree gchar* echo_nullable_non_null_enum_map_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoAnotherNullableEnum%s", + "echoNullableNonNullEnumMap%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) - call_flutter_echo_another_nullable_enum_channel = - fl_basic_message_channel_new( - messenger, call_flutter_echo_another_nullable_enum_channel_name, - FL_MESSAGE_CODEC(codec)); + g_autoptr(FlBasicMessageChannel) echo_nullable_non_null_enum_map_channel = + fl_basic_message_channel_new(messenger, + echo_nullable_non_null_enum_map_channel_name, + FL_MESSAGE_CODEC(codec)); fl_basic_message_channel_set_message_handler( - call_flutter_echo_another_nullable_enum_channel, - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_another_nullable_enum_cb, - g_object_ref(api_data), g_object_unref); - g_autofree gchar* call_flutter_small_api_echo_string_channel_name = + echo_nullable_non_null_enum_map_channel, nullptr, nullptr, nullptr); + g_autofree gchar* echo_nullable_non_null_class_map_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterSmallApiEchoString%s", + "echoNullableNonNullClassMap%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) call_flutter_small_api_echo_string_channel = + g_autoptr(FlBasicMessageChannel) echo_nullable_non_null_class_map_channel = fl_basic_message_channel_new( - messenger, call_flutter_small_api_echo_string_channel_name, + messenger, echo_nullable_non_null_class_map_channel_name, FL_MESSAGE_CODEC(codec)); fl_basic_message_channel_set_message_handler( - call_flutter_small_api_echo_string_channel, - core_tests_pigeon_test_host_integration_core_api_call_flutter_small_api_echo_string_cb, - g_object_ref(api_data), g_object_unref); -} - -void core_tests_pigeon_test_host_integration_core_api_clear_method_handlers( - FlBinaryMessenger* messenger, const gchar* suffix) { - g_autofree gchar* dot_suffix = - suffix != nullptr ? g_strdup_printf(".%s", suffix) : g_strdup(""); - - g_autoptr(CoreTestsPigeonTestMessageCodec) codec = - core_tests_pigeon_test_message_codec_new(); - g_autofree gchar* noop_channel_name = g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.noop%" - "s", + echo_nullable_non_null_class_map_channel, nullptr, nullptr, nullptr); + g_autofree gchar* echo_nullable_enum_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoNullableEnum%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) noop_channel = fl_basic_message_channel_new( - messenger, noop_channel_name, FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler(noop_channel, nullptr, nullptr, - nullptr); - g_autofree gchar* echo_all_types_channel_name = g_strdup_printf( + g_autoptr(FlBasicMessageChannel) echo_nullable_enum_channel = + fl_basic_message_channel_new(messenger, echo_nullable_enum_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler(echo_nullable_enum_channel, + nullptr, nullptr, nullptr); + g_autofree gchar* echo_another_nullable_enum_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAllTypes%s", + "echoAnotherNullableEnum%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_all_types_channel = - fl_basic_message_channel_new(messenger, echo_all_types_channel_name, + g_autoptr(FlBasicMessageChannel) echo_another_nullable_enum_channel = + fl_basic_message_channel_new(messenger, + echo_another_nullable_enum_channel_name, FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler(echo_all_types_channel, nullptr, + fl_basic_message_channel_set_message_handler( + echo_another_nullable_enum_channel, nullptr, nullptr, nullptr); + g_autofree gchar* echo_optional_nullable_int_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoOptionalNullableInt%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_optional_nullable_int_channel = + fl_basic_message_channel_new(messenger, + echo_optional_nullable_int_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_optional_nullable_int_channel, nullptr, nullptr, nullptr); + g_autofree gchar* echo_named_nullable_string_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoNamedNullableString%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_named_nullable_string_channel = + fl_basic_message_channel_new(messenger, + echo_named_nullable_string_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_named_nullable_string_channel, nullptr, nullptr, nullptr); + g_autofree gchar* noop_async_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "noopAsync%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) noop_async_channel = + fl_basic_message_channel_new(messenger, noop_async_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler(noop_async_channel, nullptr, nullptr, nullptr); - g_autofree gchar* throw_error_channel_name = g_strdup_printf( + g_autofree gchar* echo_async_int_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "throwError%s", + "echoAsyncInt%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) throw_error_channel = - fl_basic_message_channel_new(messenger, throw_error_channel_name, + g_autoptr(FlBasicMessageChannel) echo_async_int_channel = + fl_basic_message_channel_new(messenger, echo_async_int_channel_name, FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler(throw_error_channel, nullptr, + fl_basic_message_channel_set_message_handler(echo_async_int_channel, nullptr, nullptr, nullptr); - g_autofree gchar* throw_error_from_void_channel_name = g_strdup_printf( + g_autofree gchar* echo_async_double_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "throwErrorFromVoid%s", + "echoAsyncDouble%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) throw_error_from_void_channel = + g_autoptr(FlBasicMessageChannel) echo_async_double_channel = + fl_basic_message_channel_new(messenger, echo_async_double_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler(echo_async_double_channel, + nullptr, nullptr, nullptr); + g_autofree gchar* echo_async_bool_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncBool%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_async_bool_channel = + fl_basic_message_channel_new(messenger, echo_async_bool_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler(echo_async_bool_channel, nullptr, + nullptr, nullptr); + g_autofree gchar* echo_async_string_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncString%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_async_string_channel = + fl_basic_message_channel_new(messenger, echo_async_string_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler(echo_async_string_channel, + nullptr, nullptr, nullptr); + g_autofree gchar* echo_async_uint8_list_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncUint8List%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_async_uint8_list_channel = fl_basic_message_channel_new(messenger, - throw_error_from_void_channel_name, + echo_async_uint8_list_channel_name, FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler(throw_error_from_void_channel, + fl_basic_message_channel_set_message_handler(echo_async_uint8_list_channel, nullptr, nullptr, nullptr); - g_autofree gchar* throw_flutter_error_channel_name = g_strdup_printf( + g_autofree gchar* echo_async_object_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "throwFlutterError%s", + "echoAsyncObject%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) throw_flutter_error_channel = - fl_basic_message_channel_new(messenger, throw_flutter_error_channel_name, + g_autoptr(FlBasicMessageChannel) echo_async_object_channel = + fl_basic_message_channel_new(messenger, echo_async_object_channel_name, FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler(throw_flutter_error_channel, + fl_basic_message_channel_set_message_handler(echo_async_object_channel, nullptr, nullptr, nullptr); - g_autofree gchar* echo_int_channel_name = g_strdup_printf( + g_autofree gchar* echo_async_list_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoInt%s", + "echoAsyncList%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_int_channel = - fl_basic_message_channel_new(messenger, echo_int_channel_name, + g_autoptr(FlBasicMessageChannel) echo_async_list_channel = + fl_basic_message_channel_new(messenger, echo_async_list_channel_name, FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler(echo_int_channel, nullptr, + fl_basic_message_channel_set_message_handler(echo_async_list_channel, nullptr, nullptr, nullptr); - g_autofree gchar* echo_double_channel_name = g_strdup_printf( + g_autofree gchar* echo_async_enum_list_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncEnumList%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_async_enum_list_channel = + fl_basic_message_channel_new(messenger, echo_async_enum_list_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler(echo_async_enum_list_channel, + nullptr, nullptr, nullptr); + g_autofree gchar* echo_async_class_list_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncClassList%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_async_class_list_channel = + fl_basic_message_channel_new(messenger, + echo_async_class_list_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler(echo_async_class_list_channel, + nullptr, nullptr, nullptr); + g_autofree gchar* echo_async_map_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_async_map_channel = + fl_basic_message_channel_new(messenger, echo_async_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler(echo_async_map_channel, nullptr, + nullptr, nullptr); + g_autofree gchar* echo_async_string_map_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncStringMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_async_string_map_channel = + fl_basic_message_channel_new(messenger, + echo_async_string_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler(echo_async_string_map_channel, + nullptr, nullptr, nullptr); + g_autofree gchar* echo_async_int_map_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncIntMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_async_int_map_channel = + fl_basic_message_channel_new(messenger, echo_async_int_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler(echo_async_int_map_channel, + nullptr, nullptr, nullptr); + g_autofree gchar* echo_async_enum_map_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncEnumMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_async_enum_map_channel = + fl_basic_message_channel_new(messenger, echo_async_enum_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler(echo_async_enum_map_channel, + nullptr, nullptr, nullptr); + g_autofree gchar* echo_async_class_map_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncClassMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_async_class_map_channel = + fl_basic_message_channel_new(messenger, echo_async_class_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler(echo_async_class_map_channel, + nullptr, nullptr, nullptr); + g_autofree gchar* echo_async_enum_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncEnum%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_async_enum_channel = + fl_basic_message_channel_new(messenger, echo_async_enum_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler(echo_async_enum_channel, nullptr, + nullptr, nullptr); + g_autofree gchar* echo_another_async_enum_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAnotherAsyncEnum%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_another_async_enum_channel = + fl_basic_message_channel_new(messenger, + echo_another_async_enum_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler(echo_another_async_enum_channel, + nullptr, nullptr, nullptr); + g_autofree gchar* throw_async_error_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "throwAsyncError%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) throw_async_error_channel = + fl_basic_message_channel_new(messenger, throw_async_error_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler(throw_async_error_channel, + nullptr, nullptr, nullptr); + g_autofree gchar* throw_async_error_from_void_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "throwAsyncErrorFromVoid%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) throw_async_error_from_void_channel = + fl_basic_message_channel_new(messenger, + throw_async_error_from_void_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + throw_async_error_from_void_channel, nullptr, nullptr, nullptr); + g_autofree gchar* throw_async_flutter_error_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoDouble%s", + "throwAsyncFlutterError%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_double_channel = - fl_basic_message_channel_new(messenger, echo_double_channel_name, + g_autoptr(FlBasicMessageChannel) throw_async_flutter_error_channel = + fl_basic_message_channel_new(messenger, + throw_async_flutter_error_channel_name, FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler(echo_double_channel, nullptr, - nullptr, nullptr); - g_autofree gchar* echo_bool_channel_name = g_strdup_printf( + fl_basic_message_channel_set_message_handler( + throw_async_flutter_error_channel, nullptr, nullptr, nullptr); + g_autofree gchar* echo_async_all_types_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoBool%s", + "echoAsyncAllTypes%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_bool_channel = - fl_basic_message_channel_new(messenger, echo_bool_channel_name, + g_autoptr(FlBasicMessageChannel) echo_async_all_types_channel = + fl_basic_message_channel_new(messenger, echo_async_all_types_channel_name, FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler(echo_bool_channel, nullptr, - nullptr, nullptr); - g_autofree gchar* echo_string_channel_name = g_strdup_printf( + fl_basic_message_channel_set_message_handler(echo_async_all_types_channel, + nullptr, nullptr, nullptr); + g_autofree gchar* echo_async_nullable_all_nullable_types_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncNullableAllNullableTypes%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) + echo_async_nullable_all_nullable_types_channel = + fl_basic_message_channel_new( + messenger, echo_async_nullable_all_nullable_types_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_async_nullable_all_nullable_types_channel, nullptr, nullptr, + nullptr); + g_autofree gchar* + echo_async_nullable_all_nullable_types_without_recursion_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi." + "echoAsyncNullableAllNullableTypesWithoutRecursion%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) + echo_async_nullable_all_nullable_types_without_recursion_channel = + fl_basic_message_channel_new( + messenger, + echo_async_nullable_all_nullable_types_without_recursion_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_async_nullable_all_nullable_types_without_recursion_channel, nullptr, + nullptr, nullptr); + g_autofree gchar* echo_async_nullable_int_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoString%s", + "echoAsyncNullableInt%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_string_channel = - fl_basic_message_channel_new(messenger, echo_string_channel_name, + g_autoptr(FlBasicMessageChannel) echo_async_nullable_int_channel = + fl_basic_message_channel_new(messenger, + echo_async_nullable_int_channel_name, FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler(echo_string_channel, nullptr, - nullptr, nullptr); - g_autofree gchar* echo_uint8_list_channel_name = g_strdup_printf( + fl_basic_message_channel_set_message_handler(echo_async_nullable_int_channel, + nullptr, nullptr, nullptr); + g_autofree gchar* echo_async_nullable_double_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoUint8List%s", + "echoAsyncNullableDouble%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_uint8_list_channel = - fl_basic_message_channel_new(messenger, echo_uint8_list_channel_name, + g_autoptr(FlBasicMessageChannel) echo_async_nullable_double_channel = + fl_basic_message_channel_new(messenger, + echo_async_nullable_double_channel_name, FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler(echo_uint8_list_channel, nullptr, - nullptr, nullptr); - g_autofree gchar* echo_object_channel_name = g_strdup_printf( + fl_basic_message_channel_set_message_handler( + echo_async_nullable_double_channel, nullptr, nullptr, nullptr); + g_autofree gchar* echo_async_nullable_bool_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoObject%s", + "echoAsyncNullableBool%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_object_channel = - fl_basic_message_channel_new(messenger, echo_object_channel_name, + g_autoptr(FlBasicMessageChannel) echo_async_nullable_bool_channel = + fl_basic_message_channel_new(messenger, + echo_async_nullable_bool_channel_name, FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler(echo_object_channel, nullptr, - nullptr, nullptr); - g_autofree gchar* echo_list_channel_name = g_strdup_printf( + fl_basic_message_channel_set_message_handler(echo_async_nullable_bool_channel, + nullptr, nullptr, nullptr); + g_autofree gchar* echo_async_nullable_string_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoList%s", + "echoAsyncNullableString%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_list_channel = - fl_basic_message_channel_new(messenger, echo_list_channel_name, + g_autoptr(FlBasicMessageChannel) echo_async_nullable_string_channel = + fl_basic_message_channel_new(messenger, + echo_async_nullable_string_channel_name, FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler(echo_list_channel, nullptr, - nullptr, nullptr); - g_autofree gchar* echo_map_channel_name = g_strdup_printf( + fl_basic_message_channel_set_message_handler( + echo_async_nullable_string_channel, nullptr, nullptr, nullptr); + g_autofree gchar* echo_async_nullable_uint8_list_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncNullableUint8List%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_async_nullable_uint8_list_channel = + fl_basic_message_channel_new(messenger, + echo_async_nullable_uint8_list_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_async_nullable_uint8_list_channel, nullptr, nullptr, nullptr); + g_autofree gchar* echo_async_nullable_object_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoMap%s", + "echoAsyncNullableObject%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_map_channel = - fl_basic_message_channel_new(messenger, echo_map_channel_name, + g_autoptr(FlBasicMessageChannel) echo_async_nullable_object_channel = + fl_basic_message_channel_new(messenger, + echo_async_nullable_object_channel_name, FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler(echo_map_channel, nullptr, - nullptr, nullptr); - g_autofree gchar* echo_class_wrapper_channel_name = g_strdup_printf( + fl_basic_message_channel_set_message_handler( + echo_async_nullable_object_channel, nullptr, nullptr, nullptr); + g_autofree gchar* echo_async_nullable_list_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoClassWrapper%s", + "echoAsyncNullableList%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_class_wrapper_channel = - fl_basic_message_channel_new(messenger, echo_class_wrapper_channel_name, + g_autoptr(FlBasicMessageChannel) echo_async_nullable_list_channel = + fl_basic_message_channel_new(messenger, + echo_async_nullable_list_channel_name, FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler(echo_class_wrapper_channel, + fl_basic_message_channel_set_message_handler(echo_async_nullable_list_channel, nullptr, nullptr, nullptr); - g_autofree gchar* echo_enum_channel_name = g_strdup_printf( + g_autofree gchar* echo_async_nullable_enum_list_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncNullableEnumList%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_async_nullable_enum_list_channel = + fl_basic_message_channel_new(messenger, + echo_async_nullable_enum_list_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_async_nullable_enum_list_channel, nullptr, nullptr, nullptr); + g_autofree gchar* echo_async_nullable_class_list_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncNullableClassList%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_async_nullable_class_list_channel = + fl_basic_message_channel_new(messenger, + echo_async_nullable_class_list_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_async_nullable_class_list_channel, nullptr, nullptr, nullptr); + g_autofree gchar* echo_async_nullable_map_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoEnum%s", + "echoAsyncNullableMap%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_enum_channel = - fl_basic_message_channel_new(messenger, echo_enum_channel_name, + g_autoptr(FlBasicMessageChannel) echo_async_nullable_map_channel = + fl_basic_message_channel_new(messenger, + echo_async_nullable_map_channel_name, FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler(echo_enum_channel, nullptr, - nullptr, nullptr); - g_autofree gchar* echo_another_enum_channel_name = g_strdup_printf( + fl_basic_message_channel_set_message_handler(echo_async_nullable_map_channel, + nullptr, nullptr, nullptr); + g_autofree gchar* echo_async_nullable_string_map_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncNullableStringMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_async_nullable_string_map_channel = + fl_basic_message_channel_new(messenger, + echo_async_nullable_string_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_async_nullable_string_map_channel, nullptr, nullptr, nullptr); + g_autofree gchar* echo_async_nullable_int_map_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAnotherEnum%s", + "echoAsyncNullableIntMap%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_another_enum_channel = - fl_basic_message_channel_new(messenger, echo_another_enum_channel_name, + g_autoptr(FlBasicMessageChannel) echo_async_nullable_int_map_channel = + fl_basic_message_channel_new(messenger, + echo_async_nullable_int_map_channel_name, FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler(echo_another_enum_channel, - nullptr, nullptr, nullptr); - g_autofree gchar* echo_named_default_string_channel_name = g_strdup_printf( + fl_basic_message_channel_set_message_handler( + echo_async_nullable_int_map_channel, nullptr, nullptr, nullptr); + g_autofree gchar* echo_async_nullable_enum_map_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoNamedDefaultString%s", + "echoAsyncNullableEnumMap%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_named_default_string_channel = + g_autoptr(FlBasicMessageChannel) echo_async_nullable_enum_map_channel = fl_basic_message_channel_new(messenger, - echo_named_default_string_channel_name, + echo_async_nullable_enum_map_channel_name, FL_MESSAGE_CODEC(codec)); fl_basic_message_channel_set_message_handler( - echo_named_default_string_channel, nullptr, nullptr, nullptr); - g_autofree gchar* echo_optional_default_double_channel_name = g_strdup_printf( + echo_async_nullable_enum_map_channel, nullptr, nullptr, nullptr); + g_autofree gchar* echo_async_nullable_class_map_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncNullableClassMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_async_nullable_class_map_channel = + fl_basic_message_channel_new(messenger, + echo_async_nullable_class_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_async_nullable_class_map_channel, nullptr, nullptr, nullptr); + g_autofree gchar* echo_async_nullable_enum_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoOptionalDefaultDouble%s", + "echoAsyncNullableEnum%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_optional_default_double_channel = + g_autoptr(FlBasicMessageChannel) echo_async_nullable_enum_channel = fl_basic_message_channel_new(messenger, - echo_optional_default_double_channel_name, + echo_async_nullable_enum_channel_name, FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler(echo_async_nullable_enum_channel, + nullptr, nullptr, nullptr); + g_autofree gchar* echo_another_async_nullable_enum_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAnotherAsyncNullableEnum%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_another_async_nullable_enum_channel = + fl_basic_message_channel_new( + messenger, echo_another_async_nullable_enum_channel_name, + FL_MESSAGE_CODEC(codec)); fl_basic_message_channel_set_message_handler( - echo_optional_default_double_channel, nullptr, nullptr, nullptr); - g_autofree gchar* echo_required_int_channel_name = g_strdup_printf( + echo_another_async_nullable_enum_channel, nullptr, nullptr, nullptr); + g_autofree gchar* call_flutter_noop_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoRequiredInt%s", + "callFlutterNoop%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_required_int_channel = - fl_basic_message_channel_new(messenger, echo_required_int_channel_name, + g_autoptr(FlBasicMessageChannel) call_flutter_noop_channel = + fl_basic_message_channel_new(messenger, call_flutter_noop_channel_name, FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler(echo_required_int_channel, + fl_basic_message_channel_set_message_handler(call_flutter_noop_channel, nullptr, nullptr, nullptr); - g_autofree gchar* echo_all_nullable_types_channel_name = g_strdup_printf( + g_autofree gchar* call_flutter_throw_error_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAllNullableTypes%s", + "callFlutterThrowError%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_all_nullable_types_channel = + g_autoptr(FlBasicMessageChannel) call_flutter_throw_error_channel = fl_basic_message_channel_new(messenger, - echo_all_nullable_types_channel_name, + call_flutter_throw_error_channel_name, FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler(echo_all_nullable_types_channel, + fl_basic_message_channel_set_message_handler(call_flutter_throw_error_channel, nullptr, nullptr, nullptr); - g_autofree gchar* echo_all_nullable_types_without_recursion_channel_name = + g_autofree gchar* call_flutter_throw_error_from_void_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAllNullableTypesWithoutRecursion%s", + "callFlutterThrowErrorFromVoid%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) - echo_all_nullable_types_without_recursion_channel = - fl_basic_message_channel_new( - messenger, echo_all_nullable_types_without_recursion_channel_name, - FL_MESSAGE_CODEC(codec)); + g_autoptr(FlBasicMessageChannel) call_flutter_throw_error_from_void_channel = + fl_basic_message_channel_new( + messenger, call_flutter_throw_error_from_void_channel_name, + FL_MESSAGE_CODEC(codec)); fl_basic_message_channel_set_message_handler( - echo_all_nullable_types_without_recursion_channel, nullptr, nullptr, - nullptr); - g_autofree gchar* extract_nested_nullable_string_channel_name = + call_flutter_throw_error_from_void_channel, nullptr, nullptr, nullptr); + g_autofree gchar* call_flutter_echo_all_types_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoAllTypes%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) call_flutter_echo_all_types_channel = + fl_basic_message_channel_new(messenger, + call_flutter_echo_all_types_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + call_flutter_echo_all_types_channel, nullptr, nullptr, nullptr); + g_autofree gchar* call_flutter_echo_all_nullable_types_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "extractNestedNullableString%s", + "callFlutterEchoAllNullableTypes%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) extract_nested_nullable_string_channel = - fl_basic_message_channel_new(messenger, - extract_nested_nullable_string_channel_name, - FL_MESSAGE_CODEC(codec)); + g_autoptr(FlBasicMessageChannel) + call_flutter_echo_all_nullable_types_channel = + fl_basic_message_channel_new( + messenger, call_flutter_echo_all_nullable_types_channel_name, + FL_MESSAGE_CODEC(codec)); fl_basic_message_channel_set_message_handler( - extract_nested_nullable_string_channel, nullptr, nullptr, nullptr); - g_autofree gchar* create_nested_nullable_string_channel_name = + call_flutter_echo_all_nullable_types_channel, nullptr, nullptr, nullptr); + g_autofree gchar* call_flutter_send_multiple_nullable_types_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "createNestedNullableString%s", + "callFlutterSendMultipleNullableTypes%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) create_nested_nullable_string_channel = - fl_basic_message_channel_new(messenger, - create_nested_nullable_string_channel_name, - FL_MESSAGE_CODEC(codec)); + g_autoptr(FlBasicMessageChannel) + call_flutter_send_multiple_nullable_types_channel = + fl_basic_message_channel_new( + messenger, call_flutter_send_multiple_nullable_types_channel_name, + FL_MESSAGE_CODEC(codec)); fl_basic_message_channel_set_message_handler( - create_nested_nullable_string_channel, nullptr, nullptr, nullptr); - g_autofree gchar* send_multiple_nullable_types_channel_name = g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "sendMultipleNullableTypes%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) send_multiple_nullable_types_channel = - fl_basic_message_channel_new(messenger, - send_multiple_nullable_types_channel_name, - FL_MESSAGE_CODEC(codec)); + call_flutter_send_multiple_nullable_types_channel, nullptr, nullptr, + nullptr); + g_autofree gchar* + call_flutter_echo_all_nullable_types_without_recursion_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi." + "callFlutterEchoAllNullableTypesWithoutRecursion%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) + call_flutter_echo_all_nullable_types_without_recursion_channel = + fl_basic_message_channel_new( + messenger, + call_flutter_echo_all_nullable_types_without_recursion_channel_name, + FL_MESSAGE_CODEC(codec)); fl_basic_message_channel_set_message_handler( - send_multiple_nullable_types_channel, nullptr, nullptr, nullptr); + call_flutter_echo_all_nullable_types_without_recursion_channel, nullptr, + nullptr, nullptr); g_autofree gchar* - send_multiple_nullable_types_without_recursion_channel_name = + call_flutter_send_multiple_nullable_types_without_recursion_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests." "HostIntegrationCoreApi." - "sendMultipleNullableTypesWithoutRecursion%s", + "callFlutterSendMultipleNullableTypesWithoutRecursion%s", dot_suffix); g_autoptr(FlBasicMessageChannel) - send_multiple_nullable_types_without_recursion_channel = + call_flutter_send_multiple_nullable_types_without_recursion_channel = fl_basic_message_channel_new( messenger, - send_multiple_nullable_types_without_recursion_channel_name, + call_flutter_send_multiple_nullable_types_without_recursion_channel_name, FL_MESSAGE_CODEC(codec)); fl_basic_message_channel_set_message_handler( - send_multiple_nullable_types_without_recursion_channel, nullptr, nullptr, - nullptr); - g_autofree gchar* echo_nullable_int_channel_name = g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoNullableInt%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_nullable_int_channel = - fl_basic_message_channel_new(messenger, echo_nullable_int_channel_name, - FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler(echo_nullable_int_channel, - nullptr, nullptr, nullptr); - g_autofree gchar* echo_nullable_double_channel_name = g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoNullableDouble%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_nullable_double_channel = - fl_basic_message_channel_new(messenger, echo_nullable_double_channel_name, - FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler(echo_nullable_double_channel, - nullptr, nullptr, nullptr); - g_autofree gchar* echo_nullable_bool_channel_name = g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoNullableBool%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_nullable_bool_channel = - fl_basic_message_channel_new(messenger, echo_nullable_bool_channel_name, - FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler(echo_nullable_bool_channel, - nullptr, nullptr, nullptr); - g_autofree gchar* echo_nullable_string_channel_name = g_strdup_printf( + call_flutter_send_multiple_nullable_types_without_recursion_channel, + nullptr, nullptr, nullptr); + g_autofree gchar* call_flutter_echo_bool_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoNullableString%s", + "callFlutterEchoBool%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_nullable_string_channel = - fl_basic_message_channel_new(messenger, echo_nullable_string_channel_name, + g_autoptr(FlBasicMessageChannel) call_flutter_echo_bool_channel = + fl_basic_message_channel_new(messenger, + call_flutter_echo_bool_channel_name, FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler(echo_nullable_string_channel, + fl_basic_message_channel_set_message_handler(call_flutter_echo_bool_channel, nullptr, nullptr, nullptr); - g_autofree gchar* echo_nullable_uint8_list_channel_name = g_strdup_printf( + g_autofree gchar* call_flutter_echo_int_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoNullableUint8List%s", + "callFlutterEchoInt%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_nullable_uint8_list_channel = + g_autoptr(FlBasicMessageChannel) call_flutter_echo_int_channel = fl_basic_message_channel_new(messenger, - echo_nullable_uint8_list_channel_name, + call_flutter_echo_int_channel_name, FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler(echo_nullable_uint8_list_channel, + fl_basic_message_channel_set_message_handler(call_flutter_echo_int_channel, nullptr, nullptr, nullptr); - g_autofree gchar* echo_nullable_object_channel_name = g_strdup_printf( + g_autofree gchar* call_flutter_echo_double_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoNullableObject%s", + "callFlutterEchoDouble%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_nullable_object_channel = - fl_basic_message_channel_new(messenger, echo_nullable_object_channel_name, + g_autoptr(FlBasicMessageChannel) call_flutter_echo_double_channel = + fl_basic_message_channel_new(messenger, + call_flutter_echo_double_channel_name, FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler(echo_nullable_object_channel, + fl_basic_message_channel_set_message_handler(call_flutter_echo_double_channel, nullptr, nullptr, nullptr); - g_autofree gchar* echo_nullable_list_channel_name = g_strdup_printf( + g_autofree gchar* call_flutter_echo_string_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoNullableList%s", + "callFlutterEchoString%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_nullable_list_channel = - fl_basic_message_channel_new(messenger, echo_nullable_list_channel_name, + g_autoptr(FlBasicMessageChannel) call_flutter_echo_string_channel = + fl_basic_message_channel_new(messenger, + call_flutter_echo_string_channel_name, FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler(echo_nullable_list_channel, + fl_basic_message_channel_set_message_handler(call_flutter_echo_string_channel, nullptr, nullptr, nullptr); - g_autofree gchar* echo_nullable_map_channel_name = g_strdup_printf( + g_autofree gchar* call_flutter_echo_uint8_list_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoNullableMap%s", + "callFlutterEchoUint8List%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_nullable_map_channel = - fl_basic_message_channel_new(messenger, echo_nullable_map_channel_name, + g_autoptr(FlBasicMessageChannel) call_flutter_echo_uint8_list_channel = + fl_basic_message_channel_new(messenger, + call_flutter_echo_uint8_list_channel_name, FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler(echo_nullable_map_channel, - nullptr, nullptr, nullptr); - g_autofree gchar* echo_nullable_enum_channel_name = g_strdup_printf( + fl_basic_message_channel_set_message_handler( + call_flutter_echo_uint8_list_channel, nullptr, nullptr, nullptr); + g_autofree gchar* call_flutter_echo_list_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoNullableEnum%s", + "callFlutterEchoList%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_nullable_enum_channel = - fl_basic_message_channel_new(messenger, echo_nullable_enum_channel_name, + g_autoptr(FlBasicMessageChannel) call_flutter_echo_list_channel = + fl_basic_message_channel_new(messenger, + call_flutter_echo_list_channel_name, FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler(echo_nullable_enum_channel, + fl_basic_message_channel_set_message_handler(call_flutter_echo_list_channel, nullptr, nullptr, nullptr); - g_autofree gchar* echo_another_nullable_enum_channel_name = g_strdup_printf( + g_autofree gchar* call_flutter_echo_enum_list_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAnotherNullableEnum%s", + "callFlutterEchoEnumList%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_another_nullable_enum_channel = + g_autoptr(FlBasicMessageChannel) call_flutter_echo_enum_list_channel = fl_basic_message_channel_new(messenger, - echo_another_nullable_enum_channel_name, + call_flutter_echo_enum_list_channel_name, FL_MESSAGE_CODEC(codec)); fl_basic_message_channel_set_message_handler( - echo_another_nullable_enum_channel, nullptr, nullptr, nullptr); - g_autofree gchar* echo_optional_nullable_int_channel_name = g_strdup_printf( + call_flutter_echo_enum_list_channel, nullptr, nullptr, nullptr); + g_autofree gchar* call_flutter_echo_class_list_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoOptionalNullableInt%s", + "callFlutterEchoClassList%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_optional_nullable_int_channel = + g_autoptr(FlBasicMessageChannel) call_flutter_echo_class_list_channel = fl_basic_message_channel_new(messenger, - echo_optional_nullable_int_channel_name, + call_flutter_echo_class_list_channel_name, FL_MESSAGE_CODEC(codec)); fl_basic_message_channel_set_message_handler( - echo_optional_nullable_int_channel, nullptr, nullptr, nullptr); - g_autofree gchar* echo_named_nullable_string_channel_name = g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoNamedNullableString%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_named_nullable_string_channel = - fl_basic_message_channel_new(messenger, - echo_named_nullable_string_channel_name, - FL_MESSAGE_CODEC(codec)); + call_flutter_echo_class_list_channel, nullptr, nullptr, nullptr); + g_autofree gchar* call_flutter_echo_non_null_enum_list_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNonNullEnumList%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) + call_flutter_echo_non_null_enum_list_channel = + fl_basic_message_channel_new( + messenger, call_flutter_echo_non_null_enum_list_channel_name, + FL_MESSAGE_CODEC(codec)); fl_basic_message_channel_set_message_handler( - echo_named_nullable_string_channel, nullptr, nullptr, nullptr); - g_autofree gchar* noop_async_channel_name = g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "noopAsync%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) noop_async_channel = - fl_basic_message_channel_new(messenger, noop_async_channel_name, - FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler(noop_async_channel, nullptr, - nullptr, nullptr); - g_autofree gchar* echo_async_int_channel_name = g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncInt%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_async_int_channel = - fl_basic_message_channel_new(messenger, echo_async_int_channel_name, - FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler(echo_async_int_channel, nullptr, - nullptr, nullptr); - g_autofree gchar* echo_async_double_channel_name = g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncDouble%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_async_double_channel = - fl_basic_message_channel_new(messenger, echo_async_double_channel_name, - FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler(echo_async_double_channel, - nullptr, nullptr, nullptr); - g_autofree gchar* echo_async_bool_channel_name = g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncBool%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_async_bool_channel = - fl_basic_message_channel_new(messenger, echo_async_bool_channel_name, - FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler(echo_async_bool_channel, nullptr, - nullptr, nullptr); - g_autofree gchar* echo_async_string_channel_name = g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncString%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_async_string_channel = - fl_basic_message_channel_new(messenger, echo_async_string_channel_name, - FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler(echo_async_string_channel, - nullptr, nullptr, nullptr); - g_autofree gchar* echo_async_uint8_list_channel_name = g_strdup_printf( + call_flutter_echo_non_null_enum_list_channel, nullptr, nullptr, nullptr); + g_autofree gchar* call_flutter_echo_non_null_class_list_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNonNullClassList%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) + call_flutter_echo_non_null_class_list_channel = + fl_basic_message_channel_new( + messenger, call_flutter_echo_non_null_class_list_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + call_flutter_echo_non_null_class_list_channel, nullptr, nullptr, nullptr); + g_autofree gchar* call_flutter_echo_map_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncUint8List%s", + "callFlutterEchoMap%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_async_uint8_list_channel = + g_autoptr(FlBasicMessageChannel) call_flutter_echo_map_channel = fl_basic_message_channel_new(messenger, - echo_async_uint8_list_channel_name, - FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler(echo_async_uint8_list_channel, - nullptr, nullptr, nullptr); - g_autofree gchar* echo_async_object_channel_name = g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncObject%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_async_object_channel = - fl_basic_message_channel_new(messenger, echo_async_object_channel_name, + call_flutter_echo_map_channel_name, FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler(echo_async_object_channel, + fl_basic_message_channel_set_message_handler(call_flutter_echo_map_channel, nullptr, nullptr, nullptr); - g_autofree gchar* echo_async_list_channel_name = g_strdup_printf( + g_autofree gchar* call_flutter_echo_string_map_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncList%s", + "callFlutterEchoStringMap%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_async_list_channel = - fl_basic_message_channel_new(messenger, echo_async_list_channel_name, + g_autoptr(FlBasicMessageChannel) call_flutter_echo_string_map_channel = + fl_basic_message_channel_new(messenger, + call_flutter_echo_string_map_channel_name, FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler(echo_async_list_channel, nullptr, - nullptr, nullptr); - g_autofree gchar* echo_async_map_channel_name = g_strdup_printf( + fl_basic_message_channel_set_message_handler( + call_flutter_echo_string_map_channel, nullptr, nullptr, nullptr); + g_autofree gchar* call_flutter_echo_int_map_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncMap%s", + "callFlutterEchoIntMap%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_async_map_channel = - fl_basic_message_channel_new(messenger, echo_async_map_channel_name, + g_autoptr(FlBasicMessageChannel) call_flutter_echo_int_map_channel = + fl_basic_message_channel_new(messenger, + call_flutter_echo_int_map_channel_name, FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler(echo_async_map_channel, nullptr, - nullptr, nullptr); - g_autofree gchar* echo_async_enum_channel_name = g_strdup_printf( + fl_basic_message_channel_set_message_handler( + call_flutter_echo_int_map_channel, nullptr, nullptr, nullptr); + g_autofree gchar* call_flutter_echo_enum_map_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncEnum%s", + "callFlutterEchoEnumMap%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_async_enum_channel = - fl_basic_message_channel_new(messenger, echo_async_enum_channel_name, + g_autoptr(FlBasicMessageChannel) call_flutter_echo_enum_map_channel = + fl_basic_message_channel_new(messenger, + call_flutter_echo_enum_map_channel_name, FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler(echo_async_enum_channel, nullptr, - nullptr, nullptr); - g_autofree gchar* echo_another_async_enum_channel_name = g_strdup_printf( + fl_basic_message_channel_set_message_handler( + call_flutter_echo_enum_map_channel, nullptr, nullptr, nullptr); + g_autofree gchar* call_flutter_echo_class_map_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAnotherAsyncEnum%s", + "callFlutterEchoClassMap%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_another_async_enum_channel = + g_autoptr(FlBasicMessageChannel) call_flutter_echo_class_map_channel = fl_basic_message_channel_new(messenger, - echo_another_async_enum_channel_name, + call_flutter_echo_class_map_channel_name, FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler(echo_another_async_enum_channel, - nullptr, nullptr, nullptr); - g_autofree gchar* throw_async_error_channel_name = g_strdup_printf( + fl_basic_message_channel_set_message_handler( + call_flutter_echo_class_map_channel, nullptr, nullptr, nullptr); + g_autofree gchar* call_flutter_echo_non_null_string_map_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNonNullStringMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) + call_flutter_echo_non_null_string_map_channel = + fl_basic_message_channel_new( + messenger, call_flutter_echo_non_null_string_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + call_flutter_echo_non_null_string_map_channel, nullptr, nullptr, nullptr); + g_autofree gchar* call_flutter_echo_non_null_int_map_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNonNullIntMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) call_flutter_echo_non_null_int_map_channel = + fl_basic_message_channel_new( + messenger, call_flutter_echo_non_null_int_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + call_flutter_echo_non_null_int_map_channel, nullptr, nullptr, nullptr); + g_autofree gchar* call_flutter_echo_non_null_enum_map_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNonNullEnumMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) call_flutter_echo_non_null_enum_map_channel = + fl_basic_message_channel_new( + messenger, call_flutter_echo_non_null_enum_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + call_flutter_echo_non_null_enum_map_channel, nullptr, nullptr, nullptr); + g_autofree gchar* call_flutter_echo_non_null_class_map_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNonNullClassMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) + call_flutter_echo_non_null_class_map_channel = + fl_basic_message_channel_new( + messenger, call_flutter_echo_non_null_class_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + call_flutter_echo_non_null_class_map_channel, nullptr, nullptr, nullptr); + g_autofree gchar* call_flutter_echo_enum_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "throwAsyncError%s", + "callFlutterEchoEnum%s", dot_suffix); - g_autoptr(FlBasicMessageChannel) throw_async_error_channel = - fl_basic_message_channel_new(messenger, throw_async_error_channel_name, + g_autoptr(FlBasicMessageChannel) call_flutter_echo_enum_channel = + fl_basic_message_channel_new(messenger, + call_flutter_echo_enum_channel_name, FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler(throw_async_error_channel, + fl_basic_message_channel_set_message_handler(call_flutter_echo_enum_channel, nullptr, nullptr, nullptr); - g_autofree gchar* throw_async_error_from_void_channel_name = g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "throwAsyncErrorFromVoid%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) throw_async_error_from_void_channel = + g_autofree gchar* call_flutter_echo_another_enum_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoAnotherEnum%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) call_flutter_echo_another_enum_channel = fl_basic_message_channel_new(messenger, - throw_async_error_from_void_channel_name, + call_flutter_echo_another_enum_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + call_flutter_echo_another_enum_channel, nullptr, nullptr, nullptr); + g_autofree gchar* call_flutter_echo_nullable_bool_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableBool%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) call_flutter_echo_nullable_bool_channel = + fl_basic_message_channel_new(messenger, + call_flutter_echo_nullable_bool_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + call_flutter_echo_nullable_bool_channel, nullptr, nullptr, nullptr); + g_autofree gchar* call_flutter_echo_nullable_int_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableInt%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) call_flutter_echo_nullable_int_channel = + fl_basic_message_channel_new(messenger, + call_flutter_echo_nullable_int_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + call_flutter_echo_nullable_int_channel, nullptr, nullptr, nullptr); + g_autofree gchar* call_flutter_echo_nullable_double_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableDouble%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) call_flutter_echo_nullable_double_channel = + fl_basic_message_channel_new( + messenger, call_flutter_echo_nullable_double_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + call_flutter_echo_nullable_double_channel, nullptr, nullptr, nullptr); + g_autofree gchar* call_flutter_echo_nullable_string_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableString%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) call_flutter_echo_nullable_string_channel = + fl_basic_message_channel_new( + messenger, call_flutter_echo_nullable_string_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + call_flutter_echo_nullable_string_channel, nullptr, nullptr, nullptr); + g_autofree gchar* call_flutter_echo_nullable_uint8_list_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableUint8List%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) + call_flutter_echo_nullable_uint8_list_channel = + fl_basic_message_channel_new( + messenger, call_flutter_echo_nullable_uint8_list_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + call_flutter_echo_nullable_uint8_list_channel, nullptr, nullptr, nullptr); + g_autofree gchar* call_flutter_echo_nullable_list_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableList%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) call_flutter_echo_nullable_list_channel = + fl_basic_message_channel_new(messenger, + call_flutter_echo_nullable_list_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + call_flutter_echo_nullable_list_channel, nullptr, nullptr, nullptr); + g_autofree gchar* call_flutter_echo_nullable_enum_list_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableEnumList%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) + call_flutter_echo_nullable_enum_list_channel = + fl_basic_message_channel_new( + messenger, call_flutter_echo_nullable_enum_list_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + call_flutter_echo_nullable_enum_list_channel, nullptr, nullptr, nullptr); + g_autofree gchar* call_flutter_echo_nullable_class_list_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableClassList%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) + call_flutter_echo_nullable_class_list_channel = + fl_basic_message_channel_new( + messenger, call_flutter_echo_nullable_class_list_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + call_flutter_echo_nullable_class_list_channel, nullptr, nullptr, nullptr); + g_autofree gchar* call_flutter_echo_nullable_non_null_enum_list_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableNonNullEnumList%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) + call_flutter_echo_nullable_non_null_enum_list_channel = + fl_basic_message_channel_new( + messenger, + call_flutter_echo_nullable_non_null_enum_list_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + call_flutter_echo_nullable_non_null_enum_list_channel, nullptr, nullptr, + nullptr); + g_autofree gchar* + call_flutter_echo_nullable_non_null_class_list_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.callFlutterEchoNullableNonNullClassList%" + "s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) + call_flutter_echo_nullable_non_null_class_list_channel = + fl_basic_message_channel_new( + messenger, + call_flutter_echo_nullable_non_null_class_list_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + call_flutter_echo_nullable_non_null_class_list_channel, nullptr, nullptr, + nullptr); + g_autofree gchar* call_flutter_echo_nullable_map_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) call_flutter_echo_nullable_map_channel = + fl_basic_message_channel_new(messenger, + call_flutter_echo_nullable_map_channel_name, FL_MESSAGE_CODEC(codec)); fl_basic_message_channel_set_message_handler( - throw_async_error_from_void_channel, nullptr, nullptr, nullptr); - g_autofree gchar* throw_async_flutter_error_channel_name = g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "throwAsyncFlutterError%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) throw_async_flutter_error_channel = + call_flutter_echo_nullable_map_channel, nullptr, nullptr, nullptr); + g_autofree gchar* call_flutter_echo_nullable_string_map_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableStringMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) + call_flutter_echo_nullable_string_map_channel = + fl_basic_message_channel_new( + messenger, call_flutter_echo_nullable_string_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + call_flutter_echo_nullable_string_map_channel, nullptr, nullptr, nullptr); + g_autofree gchar* call_flutter_echo_nullable_int_map_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableIntMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) call_flutter_echo_nullable_int_map_channel = + fl_basic_message_channel_new( + messenger, call_flutter_echo_nullable_int_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + call_flutter_echo_nullable_int_map_channel, nullptr, nullptr, nullptr); + g_autofree gchar* call_flutter_echo_nullable_enum_map_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableEnumMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) call_flutter_echo_nullable_enum_map_channel = + fl_basic_message_channel_new( + messenger, call_flutter_echo_nullable_enum_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + call_flutter_echo_nullable_enum_map_channel, nullptr, nullptr, nullptr); + g_autofree gchar* call_flutter_echo_nullable_class_map_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableClassMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) + call_flutter_echo_nullable_class_map_channel = + fl_basic_message_channel_new( + messenger, call_flutter_echo_nullable_class_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + call_flutter_echo_nullable_class_map_channel, nullptr, nullptr, nullptr); + g_autofree gchar* + call_flutter_echo_nullable_non_null_string_map_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.callFlutterEchoNullableNonNullStringMap%" + "s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) + call_flutter_echo_nullable_non_null_string_map_channel = + fl_basic_message_channel_new( + messenger, + call_flutter_echo_nullable_non_null_string_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + call_flutter_echo_nullable_non_null_string_map_channel, nullptr, nullptr, + nullptr); + g_autofree gchar* call_flutter_echo_nullable_non_null_int_map_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableNonNullIntMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) + call_flutter_echo_nullable_non_null_int_map_channel = + fl_basic_message_channel_new( + messenger, + call_flutter_echo_nullable_non_null_int_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + call_flutter_echo_nullable_non_null_int_map_channel, nullptr, nullptr, + nullptr); + g_autofree gchar* call_flutter_echo_nullable_non_null_enum_map_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableNonNullEnumMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) + call_flutter_echo_nullable_non_null_enum_map_channel = + fl_basic_message_channel_new( + messenger, + call_flutter_echo_nullable_non_null_enum_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + call_flutter_echo_nullable_non_null_enum_map_channel, nullptr, nullptr, + nullptr); + g_autofree gchar* call_flutter_echo_nullable_non_null_class_map_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableNonNullClassMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) + call_flutter_echo_nullable_non_null_class_map_channel = + fl_basic_message_channel_new( + messenger, + call_flutter_echo_nullable_non_null_class_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + call_flutter_echo_nullable_non_null_class_map_channel, nullptr, nullptr, + nullptr); + g_autofree gchar* call_flutter_echo_nullable_enum_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableEnum%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) call_flutter_echo_nullable_enum_channel = fl_basic_message_channel_new(messenger, - throw_async_flutter_error_channel_name, + call_flutter_echo_nullable_enum_channel_name, FL_MESSAGE_CODEC(codec)); fl_basic_message_channel_set_message_handler( - throw_async_flutter_error_channel, nullptr, nullptr, nullptr); - g_autofree gchar* echo_async_all_types_channel_name = g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncAllTypes%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_async_all_types_channel = - fl_basic_message_channel_new(messenger, echo_async_all_types_channel_name, - FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler(echo_async_all_types_channel, - nullptr, nullptr, nullptr); - g_autofree gchar* echo_async_nullable_all_nullable_types_channel_name = + call_flutter_echo_nullable_enum_channel, nullptr, nullptr, nullptr); + g_autofree gchar* call_flutter_echo_another_nullable_enum_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncNullableAllNullableTypes%s", + "callFlutterEchoAnotherNullableEnum%s", dot_suffix); g_autoptr(FlBasicMessageChannel) - echo_async_nullable_all_nullable_types_channel = + call_flutter_echo_another_nullable_enum_channel = fl_basic_message_channel_new( - messenger, echo_async_nullable_all_nullable_types_channel_name, + messenger, call_flutter_echo_another_nullable_enum_channel_name, FL_MESSAGE_CODEC(codec)); fl_basic_message_channel_set_message_handler( - echo_async_nullable_all_nullable_types_channel, nullptr, nullptr, + call_flutter_echo_another_nullable_enum_channel, nullptr, nullptr, + nullptr); + g_autofree gchar* call_flutter_small_api_echo_string_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterSmallApiEchoString%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) call_flutter_small_api_echo_string_channel = + fl_basic_message_channel_new( + messenger, call_flutter_small_api_echo_string_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + call_flutter_small_api_echo_string_channel, nullptr, nullptr, nullptr); +} + +void core_tests_pigeon_test_host_integration_core_api_respond_noop_async( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiNoopAsyncResponse) response = + core_tests_pigeon_test_host_integration_core_api_noop_async_response_new(); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "noopAsync", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_noop_async( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiNoopAsyncResponse) response = + core_tests_pigeon_test_host_integration_core_api_noop_async_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "noopAsync", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_int( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + int64_t return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncIntResponse) response = + core_tests_pigeon_test_host_integration_core_api_echo_async_int_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAsyncInt", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_int( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncIntResponse) response = + core_tests_pigeon_test_host_integration_core_api_echo_async_int_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAsyncInt", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_double( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + double return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncDoubleResponse) response = + core_tests_pigeon_test_host_integration_core_api_echo_async_double_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAsyncDouble", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_double( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncDoubleResponse) response = + core_tests_pigeon_test_host_integration_core_api_echo_async_double_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAsyncDouble", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_bool( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gboolean return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncBoolResponse) response = + core_tests_pigeon_test_host_integration_core_api_echo_async_bool_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAsyncBool", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_bool( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncBoolResponse) response = + core_tests_pigeon_test_host_integration_core_api_echo_async_bool_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAsyncBool", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_string( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncStringResponse) response = + core_tests_pigeon_test_host_integration_core_api_echo_async_string_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAsyncString", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_string( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncStringResponse) response = + core_tests_pigeon_test_host_integration_core_api_echo_async_string_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAsyncString", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_uint8_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const uint8_t* return_value, size_t return_value_length) { + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncUint8ListResponse) + response = + core_tests_pigeon_test_host_integration_core_api_echo_async_uint8_list_response_new( + return_value, return_value_length); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAsyncUint8List", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_uint8_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncUint8ListResponse) + response = + core_tests_pigeon_test_host_integration_core_api_echo_async_uint8_list_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAsyncUint8List", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_object( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncObjectResponse) response = + core_tests_pigeon_test_host_integration_core_api_echo_async_object_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAsyncObject", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_object( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncObjectResponse) response = + core_tests_pigeon_test_host_integration_core_api_echo_async_object_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAsyncObject", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncListResponse) response = + core_tests_pigeon_test_host_integration_core_api_echo_async_list_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAsyncList", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncListResponse) response = + core_tests_pigeon_test_host_integration_core_api_echo_async_list_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAsyncList", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_enum_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncEnumListResponse) response = + core_tests_pigeon_test_host_integration_core_api_echo_async_enum_list_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAsyncEnumList", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_enum_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncEnumListResponse) response = + core_tests_pigeon_test_host_integration_core_api_echo_async_enum_list_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAsyncEnumList", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_class_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value) { + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncClassListResponse) + response = + core_tests_pigeon_test_host_integration_core_api_echo_async_class_list_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAsyncClassList", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_class_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncClassListResponse) + response = + core_tests_pigeon_test_host_integration_core_api_echo_async_class_list_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAsyncClassList", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncMapResponse) response = + core_tests_pigeon_test_host_integration_core_api_echo_async_map_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAsyncMap", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncMapResponse) response = + core_tests_pigeon_test_host_integration_core_api_echo_async_map_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAsyncMap", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_string_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value) { + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncStringMapResponse) + response = + core_tests_pigeon_test_host_integration_core_api_echo_async_string_map_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAsyncStringMap", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_string_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncStringMapResponse) + response = + core_tests_pigeon_test_host_integration_core_api_echo_async_string_map_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAsyncStringMap", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_int_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncIntMapResponse) response = + core_tests_pigeon_test_host_integration_core_api_echo_async_int_map_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAsyncIntMap", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_int_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncIntMapResponse) response = + core_tests_pigeon_test_host_integration_core_api_echo_async_int_map_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAsyncIntMap", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_enum_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncEnumMapResponse) response = + core_tests_pigeon_test_host_integration_core_api_echo_async_enum_map_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAsyncEnumMap", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_enum_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncEnumMapResponse) response = + core_tests_pigeon_test_host_integration_core_api_echo_async_enum_map_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAsyncEnumMap", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_class_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncClassMapResponse) response = + core_tests_pigeon_test_host_integration_core_api_echo_async_class_map_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAsyncClassMap", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_class_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncClassMapResponse) response = + core_tests_pigeon_test_host_integration_core_api_echo_async_class_map_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAsyncClassMap", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_enum( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + CoreTestsPigeonTestAnEnum return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncEnumResponse) response = + core_tests_pigeon_test_host_integration_core_api_echo_async_enum_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAsyncEnum", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_enum( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncEnumResponse) response = + core_tests_pigeon_test_host_integration_core_api_echo_async_enum_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAsyncEnum", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_echo_another_async_enum( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + CoreTestsPigeonTestAnotherEnum return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherAsyncEnumResponse) + response = + core_tests_pigeon_test_host_integration_core_api_echo_another_async_enum_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAnotherAsyncEnum", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_another_async_enum( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherAsyncEnumResponse) + response = + core_tests_pigeon_test_host_integration_core_api_echo_another_async_enum_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAnotherAsyncEnum", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_throw_async_error( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiThrowAsyncErrorResponse) response = + core_tests_pigeon_test_host_integration_core_api_throw_async_error_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "throwAsyncError", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_throw_async_error( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiThrowAsyncErrorResponse) response = + core_tests_pigeon_test_host_integration_core_api_throw_async_error_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "throwAsyncError", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_throw_async_error_from_void( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiThrowAsyncErrorFromVoidResponse) + response = + core_tests_pigeon_test_host_integration_core_api_throw_async_error_from_void_response_new(); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "throwAsyncErrorFromVoid", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_throw_async_error_from_void( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiThrowAsyncErrorFromVoidResponse) + response = + core_tests_pigeon_test_host_integration_core_api_throw_async_error_from_void_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "throwAsyncErrorFromVoid", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_throw_async_flutter_error( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiThrowAsyncFlutterErrorResponse) + response = + core_tests_pigeon_test_host_integration_core_api_throw_async_flutter_error_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "throwAsyncFlutterError", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_throw_async_flutter_error( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiThrowAsyncFlutterErrorResponse) + response = + core_tests_pigeon_test_host_integration_core_api_throw_async_flutter_error_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "throwAsyncFlutterError", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_all_types( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + CoreTestsPigeonTestAllTypes* return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncAllTypesResponse) response = + core_tests_pigeon_test_host_integration_core_api_echo_async_all_types_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAsyncAllTypes", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_all_types( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncAllTypesResponse) response = + core_tests_pigeon_test_host_integration_core_api_echo_async_all_types_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAsyncAllTypes", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_all_nullable_types( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + CoreTestsPigeonTestAllNullableTypes* return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableAllNullableTypesResponse) + response = + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_all_nullable_types_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAsyncNullableAllNullableTypes", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_all_nullable_types( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableAllNullableTypesResponse) + response = + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_all_nullable_types_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAsyncNullableAllNullableTypes", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_all_nullable_types_without_recursion( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + CoreTestsPigeonTestAllNullableTypesWithoutRecursion* return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableAllNullableTypesWithoutRecursionResponse) + response = + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_all_nullable_types_without_recursion_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAsyncNullableAllNullableTypesWithoutRecursion", + error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_all_nullable_types_without_recursion( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableAllNullableTypesWithoutRecursionResponse) + response = + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_all_nullable_types_without_recursion_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAsyncNullableAllNullableTypesWithoutRecursion", + error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_int( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + int64_t* return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableIntResponse) + response = + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_int_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAsyncNullableInt", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_int( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableIntResponse) + response = + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_int_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAsyncNullableInt", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_double( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + double* return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableDoubleResponse) + response = + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_double_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAsyncNullableDouble", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_double( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableDoubleResponse) + response = + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_double_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAsyncNullableDouble", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_bool( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gboolean* return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableBoolResponse) + response = + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_bool_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAsyncNullableBool", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_bool( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableBoolResponse) + response = + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_bool_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAsyncNullableBool", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_string( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableStringResponse) + response = + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_string_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAsyncNullableString", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_string( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableStringResponse) + response = + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_string_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAsyncNullableString", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_uint8_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const uint8_t* return_value, size_t return_value_length) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableUint8ListResponse) + response = + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_uint8_list_response_new( + return_value, return_value_length); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAsyncNullableUint8List", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_uint8_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableUint8ListResponse) + response = + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_uint8_list_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAsyncNullableUint8List", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_object( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableObjectResponse) + response = + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_object_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAsyncNullableObject", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_object( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableObjectResponse) + response = + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_object_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAsyncNullableObject", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableListResponse) + response = + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_list_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAsyncNullableList", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableListResponse) + response = + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_list_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAsyncNullableList", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_enum_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableEnumListResponse) + response = + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_enum_list_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAsyncNullableEnumList", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_enum_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableEnumListResponse) + response = + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_enum_list_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAsyncNullableEnumList", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_class_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableClassListResponse) + response = + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_class_list_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAsyncNullableClassList", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_class_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableClassListResponse) + response = + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_class_list_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAsyncNullableClassList", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableMapResponse) + response = + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_map_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAsyncNullableMap", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableMapResponse) + response = + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_map_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAsyncNullableMap", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_string_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableStringMapResponse) + response = + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_string_map_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAsyncNullableStringMap", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_string_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableStringMapResponse) + response = + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_string_map_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAsyncNullableStringMap", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_int_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableIntMapResponse) + response = + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_int_map_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAsyncNullableIntMap", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_int_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableIntMapResponse) + response = + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_int_map_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAsyncNullableIntMap", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_enum_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableEnumMapResponse) + response = + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_enum_map_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAsyncNullableEnumMap", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_enum_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableEnumMapResponse) + response = + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_enum_map_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAsyncNullableEnumMap", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_class_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableClassMapResponse) + response = + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_class_map_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAsyncNullableClassMap", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_class_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableClassMapResponse) + response = + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_class_map_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAsyncNullableClassMap", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_enum( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + CoreTestsPigeonTestAnEnum* return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableEnumResponse) + response = + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_enum_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAsyncNullableEnum", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_enum( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableEnumResponse) + response = + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_enum_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAsyncNullableEnum", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_echo_another_async_nullable_enum( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + CoreTestsPigeonTestAnotherEnum* return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherAsyncNullableEnumResponse) + response = + core_tests_pigeon_test_host_integration_core_api_echo_another_async_nullable_enum_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAnotherAsyncNullableEnum", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_another_async_nullable_enum( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherAsyncNullableEnumResponse) + response = + core_tests_pigeon_test_host_integration_core_api_echo_another_async_nullable_enum_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAnotherAsyncNullableEnum", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_noop( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterNoopResponse) response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_noop_response_new(); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterNoop", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_noop( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterNoopResponse) response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_noop_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterNoop", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_throw_error( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterThrowErrorResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_throw_error_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterThrowError", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_throw_error( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterThrowErrorResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_throw_error_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterThrowError", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_throw_error_from_void( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterThrowErrorFromVoidResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_throw_error_from_void_response_new(); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterThrowErrorFromVoid", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_throw_error_from_void( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterThrowErrorFromVoidResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_throw_error_from_void_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterThrowErrorFromVoid", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_all_types( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + CoreTestsPigeonTestAllTypes* return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAllTypesResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_types_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoAllTypes", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_all_types( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAllTypesResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_types_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoAllTypes", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_all_nullable_types( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + CoreTestsPigeonTestAllNullableTypes* return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAllNullableTypesResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_nullable_types_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoAllNullableTypes", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_all_nullable_types( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAllNullableTypesResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_nullable_types_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoAllNullableTypes", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_send_multiple_nullable_types( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + CoreTestsPigeonTestAllNullableTypes* return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterSendMultipleNullableTypesResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_send_multiple_nullable_types_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterSendMultipleNullableTypes", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_send_multiple_nullable_types( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterSendMultipleNullableTypesResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_send_multiple_nullable_types_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterSendMultipleNullableTypes", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_all_nullable_types_without_recursion( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + CoreTestsPigeonTestAllNullableTypesWithoutRecursion* return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAllNullableTypesWithoutRecursionResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_nullable_types_without_recursion_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoAllNullableTypesWithoutRecursion", + error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_all_nullable_types_without_recursion( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAllNullableTypesWithoutRecursionResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_nullable_types_without_recursion_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoAllNullableTypesWithoutRecursion", + error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_send_multiple_nullable_types_without_recursion( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + CoreTestsPigeonTestAllNullableTypesWithoutRecursion* return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterSendMultipleNullableTypesWithoutRecursionResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_send_multiple_nullable_types_without_recursion_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterSendMultipleNullableTypesWithoutRecursion", + error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_send_multiple_nullable_types_without_recursion( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterSendMultipleNullableTypesWithoutRecursionResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_send_multiple_nullable_types_without_recursion_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterSendMultipleNullableTypesWithoutRecursion", + error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_bool( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gboolean return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoBoolResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_bool_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoBool", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_bool( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoBoolResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_bool_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoBool", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_int( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + int64_t return_value) { + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoIntResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_int_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoInt", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_int( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoIntResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_int_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoInt", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_double( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + double return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoDoubleResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_double_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoDouble", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_double( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoDoubleResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_double_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoDouble", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_string( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoStringResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_string_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoString", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_string( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoStringResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_string_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoString", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_uint8_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const uint8_t* return_value, size_t return_value_length) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoUint8ListResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_uint8_list_response_new( + return_value, return_value_length); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoUint8List", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_uint8_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoUint8ListResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_uint8_list_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoUint8List", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoListResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_list_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoList", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoListResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_list_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoList", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_enum_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoEnumListResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_list_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoEnumList", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_enum_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoEnumListResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_list_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoEnumList", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_class_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoClassListResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_class_list_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoClassList", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_class_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoClassListResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_class_list_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoClassList", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_non_null_enum_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNonNullEnumListResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_enum_list_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoNonNullEnumList", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_non_null_enum_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNonNullEnumListResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_enum_list_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoNonNullEnumList", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_non_null_class_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNonNullClassListResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_class_list_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoNonNullClassList", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_non_null_class_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNonNullClassListResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_class_list_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoNonNullClassList", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value) { + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoMapResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_map_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoMap", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoMapResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_map_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoMap", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_string_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoStringMapResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_string_map_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoStringMap", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_string_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoStringMapResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_string_map_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoStringMap", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_int_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoIntMapResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_int_map_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoIntMap", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_int_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoIntMapResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_int_map_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoIntMap", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_enum_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoEnumMapResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_map_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoEnumMap", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_enum_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoEnumMapResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_map_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoEnumMap", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_class_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoClassMapResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_class_map_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoClassMap", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_class_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoClassMapResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_class_map_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoClassMap", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_non_null_string_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNonNullStringMapResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_string_map_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoNonNullStringMap", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_non_null_string_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNonNullStringMapResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_string_map_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoNonNullStringMap", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_non_null_int_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNonNullIntMapResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_int_map_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoNonNullIntMap", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_non_null_int_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNonNullIntMapResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_int_map_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoNonNullIntMap", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_non_null_enum_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNonNullEnumMapResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_enum_map_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoNonNullEnumMap", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_non_null_enum_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNonNullEnumMapResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_enum_map_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoNonNullEnumMap", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_non_null_class_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNonNullClassMapResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_class_map_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoNonNullClassMap", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_non_null_class_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNonNullClassMapResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_non_null_class_map_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoNonNullClassMap", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_enum( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + CoreTestsPigeonTestAnEnum return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoEnumResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoEnum", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_enum( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoEnumResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoEnum", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_another_enum( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + CoreTestsPigeonTestAnotherEnum return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAnotherEnumResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_another_enum_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoAnotherEnum", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_another_enum( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAnotherEnumResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_another_enum_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoAnotherEnum", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_bool( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gboolean* return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableBoolResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_bool_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoNullableBool", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_bool( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableBoolResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_bool_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoNullableBool", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_int( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + int64_t* return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableIntResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_int_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoNullableInt", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_int( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableIntResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_int_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoNullableInt", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_double( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + double* return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableDoubleResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_double_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoNullableDouble", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_double( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableDoubleResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_double_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoNullableDouble", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_string( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableStringResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_string_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoNullableString", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_string( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableStringResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_string_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoNullableString", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_uint8_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const uint8_t* return_value, size_t return_value_length) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableUint8ListResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_uint8_list_response_new( + return_value, return_value_length); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoNullableUint8List", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_uint8_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableUint8ListResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_uint8_list_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoNullableUint8List", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableListResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_list_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoNullableList", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableListResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_list_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoNullableList", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_enum_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableEnumListResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_enum_list_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoNullableEnumList", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_enum_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableEnumListResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_enum_list_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoNullableEnumList", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_class_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableClassListResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_class_list_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoNullableClassList", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_class_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableClassListResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_class_list_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoNullableClassList", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_non_null_enum_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableNonNullEnumListResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_enum_list_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoNullableNonNullEnumList", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_non_null_enum_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableNonNullEnumListResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_enum_list_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoNullableNonNullEnumList", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_non_null_class_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableNonNullClassListResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_class_list_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoNullableNonNullClassList", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_non_null_class_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableNonNullClassListResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_class_list_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoNullableNonNullClassList", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableMapResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_map_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoNullableMap", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableMapResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_map_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoNullableMap", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_string_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableStringMapResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_string_map_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoNullableStringMap", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_string_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableStringMapResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_string_map_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoNullableStringMap", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_int_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableIntMapResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_int_map_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoNullableIntMap", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_int_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableIntMapResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_int_map_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoNullableIntMap", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_enum_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableEnumMapResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_enum_map_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoNullableEnumMap", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_enum_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableEnumMapResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_enum_map_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoNullableEnumMap", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_class_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableClassMapResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_class_map_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoNullableClassMap", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_class_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableClassMapResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_class_map_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoNullableClassMap", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_non_null_string_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableNonNullStringMapResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_string_map_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoNullableNonNullStringMap", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_non_null_string_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableNonNullStringMapResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_string_map_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoNullableNonNullStringMap", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_non_null_int_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableNonNullIntMapResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_int_map_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoNullableNonNullIntMap", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_non_null_int_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableNonNullIntMapResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_int_map_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoNullableNonNullIntMap", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_non_null_enum_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableNonNullEnumMapResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_enum_map_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoNullableNonNullEnumMap", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_non_null_enum_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableNonNullEnumMapResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_enum_map_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoNullableNonNullEnumMap", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_non_null_class_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableNonNullClassMapResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_class_map_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoNullableNonNullClassMap", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_non_null_class_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableNonNullClassMapResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_non_null_class_map_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoNullableNonNullClassMap", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_enum( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + CoreTestsPigeonTestAnEnum* return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableEnumResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_enum_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoNullableEnum", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_enum( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableEnumResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_enum_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoNullableEnum", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_another_nullable_enum( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + CoreTestsPigeonTestAnotherEnum* return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAnotherNullableEnumResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_another_nullable_enum_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoAnotherNullableEnum", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_another_nullable_enum( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAnotherNullableEnumResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_another_nullable_enum_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoAnotherNullableEnum", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_small_api_echo_string( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterSmallApiEchoStringResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_small_api_echo_string_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterSmallApiEchoString", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_small_api_echo_string( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterSmallApiEchoStringResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_small_api_echo_string_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterSmallApiEchoString", error->message); + } +} + +struct _CoreTestsPigeonTestFlutterIntegrationCoreApi { + GObject parent_instance; + + FlBinaryMessenger* messenger; + gchar* suffix; +}; + +G_DEFINE_TYPE(CoreTestsPigeonTestFlutterIntegrationCoreApi, + core_tests_pigeon_test_flutter_integration_core_api, + G_TYPE_OBJECT) + +static void core_tests_pigeon_test_flutter_integration_core_api_dispose( + GObject* object) { + CoreTestsPigeonTestFlutterIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API(object); + g_clear_object(&self->messenger); + g_clear_pointer(&self->suffix, g_free); + G_OBJECT_CLASS( + core_tests_pigeon_test_flutter_integration_core_api_parent_class) + ->dispose(object); +} + +static void core_tests_pigeon_test_flutter_integration_core_api_init( + CoreTestsPigeonTestFlutterIntegrationCoreApi* self) {} + +static void core_tests_pigeon_test_flutter_integration_core_api_class_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiClass* klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_flutter_integration_core_api_dispose; +} + +CoreTestsPigeonTestFlutterIntegrationCoreApi* +core_tests_pigeon_test_flutter_integration_core_api_new( + FlBinaryMessenger* messenger, const gchar* suffix) { + CoreTestsPigeonTestFlutterIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API(g_object_new( + core_tests_pigeon_test_flutter_integration_core_api_get_type(), + nullptr)); + self->messenger = FL_BINARY_MESSENGER(g_object_ref(messenger)); + self->suffix = + suffix != nullptr ? g_strdup_printf(".%s", suffix) : g_strdup(""); + return self; +} + +struct _CoreTestsPigeonTestFlutterIntegrationCoreApiNoopResponse { + GObject parent_instance; + + FlValue* error; +}; + +G_DEFINE_TYPE(CoreTestsPigeonTestFlutterIntegrationCoreApiNoopResponse, + core_tests_pigeon_test_flutter_integration_core_api_noop_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_flutter_integration_core_api_noop_response_dispose( + GObject* object) { + CoreTestsPigeonTestFlutterIntegrationCoreApiNoopResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_NOOP_RESPONSE(object); + g_clear_pointer(&self->error, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_flutter_integration_core_api_noop_response_parent_class) + ->dispose(object); +} + +static void +core_tests_pigeon_test_flutter_integration_core_api_noop_response_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiNoopResponse* self) {} + +static void +core_tests_pigeon_test_flutter_integration_core_api_noop_response_class_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiNoopResponseClass* klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_flutter_integration_core_api_noop_response_dispose; +} + +static CoreTestsPigeonTestFlutterIntegrationCoreApiNoopResponse* +core_tests_pigeon_test_flutter_integration_core_api_noop_response_new( + FlValue* response) { + CoreTestsPigeonTestFlutterIntegrationCoreApiNoopResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_NOOP_RESPONSE(g_object_new( + core_tests_pigeon_test_flutter_integration_core_api_noop_response_get_type(), + nullptr)); + if (fl_value_get_length(response) > 1) { + self->error = fl_value_ref(response); + } + return self; +} + +gboolean +core_tests_pigeon_test_flutter_integration_core_api_noop_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiNoopResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_NOOP_RESPONSE( + self), + FALSE); + return self->error != nullptr; +} + +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_noop_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiNoopResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_NOOP_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_noop_response_is_error( + self)); + return fl_value_get_string(fl_value_get_list_value(self->error, 0)); +} + +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_noop_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiNoopResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_NOOP_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_noop_response_is_error( + self)); + return fl_value_get_string(fl_value_get_list_value(self->error, 1)); +} + +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_noop_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiNoopResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_NOOP_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_noop_response_is_error( + self)); + return fl_value_get_list_value(self->error, 2); +} + +static void core_tests_pigeon_test_flutter_integration_core_api_noop_cb( + GObject* object, GAsyncResult* result, gpointer user_data) { + GTask* task = G_TASK(user_data); + g_task_return_pointer(task, result, g_object_unref); +} + +void core_tests_pigeon_test_flutter_integration_core_api_noop( + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, + GCancellable* cancellable, GAsyncReadyCallback callback, + gpointer user_data) { + g_autoptr(FlValue) args = fl_value_new_list(); + g_autofree gchar* channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "noop%s", + self->suffix); + g_autoptr(CoreTestsPigeonTestMessageCodec) codec = + core_tests_pigeon_test_message_codec_new(); + FlBasicMessageChannel* channel = fl_basic_message_channel_new( + self->messenger, channel_name, FL_MESSAGE_CODEC(codec)); + GTask* task = g_task_new(self, cancellable, callback, user_data); + g_task_set_task_data(task, channel, g_object_unref); + fl_basic_message_channel_send( + channel, args, cancellable, + core_tests_pigeon_test_flutter_integration_core_api_noop_cb, task); +} + +CoreTestsPigeonTestFlutterIntegrationCoreApiNoopResponse* +core_tests_pigeon_test_flutter_integration_core_api_noop_finish( + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, GAsyncResult* result, + GError** error) { + g_autoptr(GTask) task = G_TASK(result); + GAsyncResult* r = G_ASYNC_RESULT(g_task_propagate_pointer(task, nullptr)); + FlBasicMessageChannel* channel = + FL_BASIC_MESSAGE_CHANNEL(g_task_get_task_data(task)); + g_autoptr(FlValue) response = + fl_basic_message_channel_send_finish(channel, r, error); + if (response == nullptr) { + return nullptr; + } + return core_tests_pigeon_test_flutter_integration_core_api_noop_response_new( + response); +} + +struct _CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorResponse { + GObject parent_instance; + + FlValue* error; + FlValue* return_value; +}; + +G_DEFINE_TYPE( + CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorResponse, + core_tests_pigeon_test_flutter_integration_core_api_throw_error_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_flutter_integration_core_api_throw_error_response_dispose( + GObject* object) { + CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_THROW_ERROR_RESPONSE( + object); + g_clear_pointer(&self->error, fl_value_unref); + g_clear_pointer(&self->return_value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_flutter_integration_core_api_throw_error_response_parent_class) + ->dispose(object); +} + +static void +core_tests_pigeon_test_flutter_integration_core_api_throw_error_response_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorResponse* self) {} + +static void +core_tests_pigeon_test_flutter_integration_core_api_throw_error_response_class_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_flutter_integration_core_api_throw_error_response_dispose; +} + +static CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorResponse* +core_tests_pigeon_test_flutter_integration_core_api_throw_error_response_new( + FlValue* response) { + CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_THROW_ERROR_RESPONSE( + g_object_new( + core_tests_pigeon_test_flutter_integration_core_api_throw_error_response_get_type(), + nullptr)); + if (fl_value_get_length(response) > 1) { + self->error = fl_value_ref(response); + } else { + FlValue* value = fl_value_get_list_value(response, 0); + self->return_value = fl_value_ref(value); + } + return self; +} + +gboolean +core_tests_pigeon_test_flutter_integration_core_api_throw_error_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_THROW_ERROR_RESPONSE( + self), + FALSE); + return self->error != nullptr; +} + +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_throw_error_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_THROW_ERROR_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_throw_error_response_is_error( + self)); + return fl_value_get_string(fl_value_get_list_value(self->error, 0)); +} + +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_throw_error_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_THROW_ERROR_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_throw_error_response_is_error( + self)); + return fl_value_get_string(fl_value_get_list_value(self->error, 1)); +} + +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_throw_error_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_THROW_ERROR_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_throw_error_response_is_error( + self)); + return fl_value_get_list_value(self->error, 2); +} + +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_throw_error_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_THROW_ERROR_RESPONSE( + self), + nullptr); + g_assert( + !core_tests_pigeon_test_flutter_integration_core_api_throw_error_response_is_error( + self)); + if (fl_value_get_type(self->return_value) == FL_VALUE_TYPE_NULL) { + return nullptr; + } + return self->return_value; +} + +static void core_tests_pigeon_test_flutter_integration_core_api_throw_error_cb( + GObject* object, GAsyncResult* result, gpointer user_data) { + GTask* task = G_TASK(user_data); + g_task_return_pointer(task, result, g_object_unref); +} + +void core_tests_pigeon_test_flutter_integration_core_api_throw_error( + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, + GCancellable* cancellable, GAsyncReadyCallback callback, + gpointer user_data) { + g_autoptr(FlValue) args = fl_value_new_list(); + g_autofree gchar* channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "throwError%s", + self->suffix); + g_autoptr(CoreTestsPigeonTestMessageCodec) codec = + core_tests_pigeon_test_message_codec_new(); + FlBasicMessageChannel* channel = fl_basic_message_channel_new( + self->messenger, channel_name, FL_MESSAGE_CODEC(codec)); + GTask* task = g_task_new(self, cancellable, callback, user_data); + g_task_set_task_data(task, channel, g_object_unref); + fl_basic_message_channel_send( + channel, args, cancellable, + core_tests_pigeon_test_flutter_integration_core_api_throw_error_cb, task); +} + +CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorResponse* +core_tests_pigeon_test_flutter_integration_core_api_throw_error_finish( + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, GAsyncResult* result, + GError** error) { + g_autoptr(GTask) task = G_TASK(result); + GAsyncResult* r = G_ASYNC_RESULT(g_task_propagate_pointer(task, nullptr)); + FlBasicMessageChannel* channel = + FL_BASIC_MESSAGE_CHANNEL(g_task_get_task_data(task)); + g_autoptr(FlValue) response = + fl_basic_message_channel_send_finish(channel, r, error); + if (response == nullptr) { + return nullptr; + } + return core_tests_pigeon_test_flutter_integration_core_api_throw_error_response_new( + response); +} + +struct _CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorFromVoidResponse { + GObject parent_instance; + + FlValue* error; +}; + +G_DEFINE_TYPE( + CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorFromVoidResponse, + core_tests_pigeon_test_flutter_integration_core_api_throw_error_from_void_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_flutter_integration_core_api_throw_error_from_void_response_dispose( + GObject* object) { + CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorFromVoidResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_THROW_ERROR_FROM_VOID_RESPONSE( + object); + g_clear_pointer(&self->error, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_flutter_integration_core_api_throw_error_from_void_response_parent_class) + ->dispose(object); +} + +static void +core_tests_pigeon_test_flutter_integration_core_api_throw_error_from_void_response_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorFromVoidResponse* + self) {} + +static void +core_tests_pigeon_test_flutter_integration_core_api_throw_error_from_void_response_class_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorFromVoidResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_flutter_integration_core_api_throw_error_from_void_response_dispose; +} + +static CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorFromVoidResponse* +core_tests_pigeon_test_flutter_integration_core_api_throw_error_from_void_response_new( + FlValue* response) { + CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorFromVoidResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_THROW_ERROR_FROM_VOID_RESPONSE( + g_object_new( + core_tests_pigeon_test_flutter_integration_core_api_throw_error_from_void_response_get_type(), + nullptr)); + if (fl_value_get_length(response) > 1) { + self->error = fl_value_ref(response); + } + return self; +} + +gboolean +core_tests_pigeon_test_flutter_integration_core_api_throw_error_from_void_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorFromVoidResponse* + self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_THROW_ERROR_FROM_VOID_RESPONSE( + self), + FALSE); + return self->error != nullptr; +} + +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_throw_error_from_void_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorFromVoidResponse* + self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_THROW_ERROR_FROM_VOID_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_throw_error_from_void_response_is_error( + self)); + return fl_value_get_string(fl_value_get_list_value(self->error, 0)); +} + +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_throw_error_from_void_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorFromVoidResponse* + self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_THROW_ERROR_FROM_VOID_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_throw_error_from_void_response_is_error( + self)); + return fl_value_get_string(fl_value_get_list_value(self->error, 1)); +} + +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_throw_error_from_void_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorFromVoidResponse* + self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_THROW_ERROR_FROM_VOID_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_throw_error_from_void_response_is_error( + self)); + return fl_value_get_list_value(self->error, 2); +} + +static void +core_tests_pigeon_test_flutter_integration_core_api_throw_error_from_void_cb( + GObject* object, GAsyncResult* result, gpointer user_data) { + GTask* task = G_TASK(user_data); + g_task_return_pointer(task, result, g_object_unref); +} + +void core_tests_pigeon_test_flutter_integration_core_api_throw_error_from_void( + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, + GCancellable* cancellable, GAsyncReadyCallback callback, + gpointer user_data) { + g_autoptr(FlValue) args = fl_value_new_list(); + g_autofree gchar* channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "throwErrorFromVoid%s", + self->suffix); + g_autoptr(CoreTestsPigeonTestMessageCodec) codec = + core_tests_pigeon_test_message_codec_new(); + FlBasicMessageChannel* channel = fl_basic_message_channel_new( + self->messenger, channel_name, FL_MESSAGE_CODEC(codec)); + GTask* task = g_task_new(self, cancellable, callback, user_data); + g_task_set_task_data(task, channel, g_object_unref); + fl_basic_message_channel_send( + channel, args, cancellable, + core_tests_pigeon_test_flutter_integration_core_api_throw_error_from_void_cb, + task); +} + +CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorFromVoidResponse* +core_tests_pigeon_test_flutter_integration_core_api_throw_error_from_void_finish( + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, GAsyncResult* result, + GError** error) { + g_autoptr(GTask) task = G_TASK(result); + GAsyncResult* r = G_ASYNC_RESULT(g_task_propagate_pointer(task, nullptr)); + FlBasicMessageChannel* channel = + FL_BASIC_MESSAGE_CHANNEL(g_task_get_task_data(task)); + g_autoptr(FlValue) response = + fl_basic_message_channel_send_finish(channel, r, error); + if (response == nullptr) { + return nullptr; + } + return core_tests_pigeon_test_flutter_integration_core_api_throw_error_from_void_response_new( + response); +} + +struct _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllTypesResponse { + GObject parent_instance; + + FlValue* error; + FlValue* return_value; +}; + +G_DEFINE_TYPE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllTypesResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_all_types_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_all_types_response_dispose( + GObject* object) { + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllTypesResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_ALL_TYPES_RESPONSE( + object); + g_clear_pointer(&self->error, fl_value_unref); + g_clear_pointer(&self->return_value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_flutter_integration_core_api_echo_all_types_response_parent_class) + ->dispose(object); +} + +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_all_types_response_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllTypesResponse* self) {} + +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_all_types_response_class_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllTypesResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_flutter_integration_core_api_echo_all_types_response_dispose; +} + +static CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllTypesResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_all_types_response_new( + FlValue* response) { + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllTypesResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_ALL_TYPES_RESPONSE( + g_object_new( + core_tests_pigeon_test_flutter_integration_core_api_echo_all_types_response_get_type(), + nullptr)); + if (fl_value_get_length(response) > 1) { + self->error = fl_value_ref(response); + } else { + FlValue* value = fl_value_get_list_value(response, 0); + self->return_value = fl_value_ref(value); + } + return self; +} + +gboolean +core_tests_pigeon_test_flutter_integration_core_api_echo_all_types_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllTypesResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_ALL_TYPES_RESPONSE( + self), + FALSE); + return self->error != nullptr; +} + +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_all_types_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllTypesResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_ALL_TYPES_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_echo_all_types_response_is_error( + self)); + return fl_value_get_string(fl_value_get_list_value(self->error, 0)); +} + +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_all_types_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllTypesResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_ALL_TYPES_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_echo_all_types_response_is_error( + self)); + return fl_value_get_string(fl_value_get_list_value(self->error, 1)); +} + +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_all_types_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllTypesResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_ALL_TYPES_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_echo_all_types_response_is_error( + self)); + return fl_value_get_list_value(self->error, 2); +} + +CoreTestsPigeonTestAllTypes* +core_tests_pigeon_test_flutter_integration_core_api_echo_all_types_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllTypesResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_ALL_TYPES_RESPONSE( + self), + nullptr); + g_assert( + !core_tests_pigeon_test_flutter_integration_core_api_echo_all_types_response_is_error( + self)); + return CORE_TESTS_PIGEON_TEST_ALL_TYPES( + fl_value_get_custom_value_object(self->return_value)); +} + +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_all_types_cb( + GObject* object, GAsyncResult* result, gpointer user_data) { + GTask* task = G_TASK(user_data); + g_task_return_pointer(task, result, g_object_unref); +} + +void core_tests_pigeon_test_flutter_integration_core_api_echo_all_types( + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, + CoreTestsPigeonTestAllTypes* everything, GCancellable* cancellable, + GAsyncReadyCallback callback, gpointer user_data) { + g_autoptr(FlValue) args = fl_value_new_list(); + fl_value_append_take(args, + fl_value_new_custom_object(132, G_OBJECT(everything))); + g_autofree gchar* channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoAllTypes%s", + self->suffix); + g_autoptr(CoreTestsPigeonTestMessageCodec) codec = + core_tests_pigeon_test_message_codec_new(); + FlBasicMessageChannel* channel = fl_basic_message_channel_new( + self->messenger, channel_name, FL_MESSAGE_CODEC(codec)); + GTask* task = g_task_new(self, cancellable, callback, user_data); + g_task_set_task_data(task, channel, g_object_unref); + fl_basic_message_channel_send( + channel, args, cancellable, + core_tests_pigeon_test_flutter_integration_core_api_echo_all_types_cb, + task); +} + +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllTypesResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_all_types_finish( + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, GAsyncResult* result, + GError** error) { + g_autoptr(GTask) task = G_TASK(result); + GAsyncResult* r = G_ASYNC_RESULT(g_task_propagate_pointer(task, nullptr)); + FlBasicMessageChannel* channel = + FL_BASIC_MESSAGE_CHANNEL(g_task_get_task_data(task)); + g_autoptr(FlValue) response = + fl_basic_message_channel_send_finish(channel, r, error); + if (response == nullptr) { + return nullptr; + } + return core_tests_pigeon_test_flutter_integration_core_api_echo_all_types_response_new( + response); +} + +struct + _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesResponse { + GObject parent_instance; + + FlValue* error; + FlValue* return_value; +}; + +G_DEFINE_TYPE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_response_dispose( + GObject* object) { + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_ALL_NULLABLE_TYPES_RESPONSE( + object); + g_clear_pointer(&self->error, fl_value_unref); + g_clear_pointer(&self->return_value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_response_parent_class) + ->dispose(object); +} + +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_response_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesResponse* + self) {} + +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_response_class_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_response_dispose; +} + +static CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_response_new( + FlValue* response) { + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_ALL_NULLABLE_TYPES_RESPONSE( + g_object_new( + core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_response_get_type(), + nullptr)); + if (fl_value_get_length(response) > 1) { + self->error = fl_value_ref(response); + } else { + FlValue* value = fl_value_get_list_value(response, 0); + self->return_value = fl_value_ref(value); + } + return self; +} + +gboolean +core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesResponse* + self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_ALL_NULLABLE_TYPES_RESPONSE( + self), + FALSE); + return self->error != nullptr; +} + +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesResponse* + self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_ALL_NULLABLE_TYPES_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_response_is_error( + self)); + return fl_value_get_string(fl_value_get_list_value(self->error, 0)); +} + +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesResponse* + self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_ALL_NULLABLE_TYPES_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_response_is_error( + self)); + return fl_value_get_string(fl_value_get_list_value(self->error, 1)); +} + +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesResponse* + self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_ALL_NULLABLE_TYPES_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_response_is_error( + self)); + return fl_value_get_list_value(self->error, 2); +} + +CoreTestsPigeonTestAllNullableTypes* +core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesResponse* + self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_ALL_NULLABLE_TYPES_RESPONSE( + self), + nullptr); + g_assert( + !core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_response_is_error( + self)); + if (fl_value_get_type(self->return_value) == FL_VALUE_TYPE_NULL) { + return nullptr; + } + return CORE_TESTS_PIGEON_TEST_ALL_NULLABLE_TYPES( + fl_value_get_custom_value_object(self->return_value)); +} + +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_cb( + GObject* object, GAsyncResult* result, gpointer user_data) { + GTask* task = G_TASK(user_data); + g_task_return_pointer(task, result, g_object_unref); +} + +void core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types( + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, + CoreTestsPigeonTestAllNullableTypes* everything, GCancellable* cancellable, + GAsyncReadyCallback callback, gpointer user_data) { + g_autoptr(FlValue) args = fl_value_new_list(); + fl_value_append_take( + args, everything != nullptr + ? fl_value_new_custom_object(133, G_OBJECT(everything)) + : fl_value_new_null()); + g_autofree gchar* channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoAllNullableTypes%s", + self->suffix); + g_autoptr(CoreTestsPigeonTestMessageCodec) codec = + core_tests_pigeon_test_message_codec_new(); + FlBasicMessageChannel* channel = fl_basic_message_channel_new( + self->messenger, channel_name, FL_MESSAGE_CODEC(codec)); + GTask* task = g_task_new(self, cancellable, callback, user_data); + g_task_set_task_data(task, channel, g_object_unref); + fl_basic_message_channel_send( + channel, args, cancellable, + core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_cb, + task); +} + +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_finish( + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, GAsyncResult* result, + GError** error) { + g_autoptr(GTask) task = G_TASK(result); + GAsyncResult* r = G_ASYNC_RESULT(g_task_propagate_pointer(task, nullptr)); + FlBasicMessageChannel* channel = + FL_BASIC_MESSAGE_CHANNEL(g_task_get_task_data(task)); + g_autoptr(FlValue) response = + fl_basic_message_channel_send_finish(channel, r, error); + if (response == nullptr) { + return nullptr; + } + return core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_response_new( + response); +} + +struct + _CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesResponse { + GObject parent_instance; + + FlValue* error; + FlValue* return_value; +}; + +G_DEFINE_TYPE( + CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesResponse, + core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_response_dispose( + GObject* object) { + CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesResponse* + self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_SEND_MULTIPLE_NULLABLE_TYPES_RESPONSE( + object); + g_clear_pointer(&self->error, fl_value_unref); + g_clear_pointer(&self->return_value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_response_parent_class) + ->dispose(object); +} + +static void +core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_response_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesResponse* + self) {} + +static void +core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_response_class_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_response_dispose; +} + +static CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesResponse* +core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_response_new( + FlValue* response) { + CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_SEND_MULTIPLE_NULLABLE_TYPES_RESPONSE( + g_object_new( + core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_response_get_type(), + nullptr)); + if (fl_value_get_length(response) > 1) { + self->error = fl_value_ref(response); + } else { + FlValue* value = fl_value_get_list_value(response, 0); + self->return_value = fl_value_ref(value); + } + return self; +} + +gboolean +core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesResponse* + self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_SEND_MULTIPLE_NULLABLE_TYPES_RESPONSE( + self), + FALSE); + return self->error != nullptr; +} + +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesResponse* + self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_SEND_MULTIPLE_NULLABLE_TYPES_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_response_is_error( + self)); + return fl_value_get_string(fl_value_get_list_value(self->error, 0)); +} + +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesResponse* + self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_SEND_MULTIPLE_NULLABLE_TYPES_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_response_is_error( + self)); + return fl_value_get_string(fl_value_get_list_value(self->error, 1)); +} + +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesResponse* + self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_SEND_MULTIPLE_NULLABLE_TYPES_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_response_is_error( + self)); + return fl_value_get_list_value(self->error, 2); +} + +CoreTestsPigeonTestAllNullableTypes* +core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesResponse* + self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_SEND_MULTIPLE_NULLABLE_TYPES_RESPONSE( + self), + nullptr); + g_assert( + !core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_response_is_error( + self)); + return CORE_TESTS_PIGEON_TEST_ALL_NULLABLE_TYPES( + fl_value_get_custom_value_object(self->return_value)); +} + +static void +core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_cb( + GObject* object, GAsyncResult* result, gpointer user_data) { + GTask* task = G_TASK(user_data); + g_task_return_pointer(task, result, g_object_unref); +} + +void core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types( + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, + gboolean* a_nullable_bool, int64_t* a_nullable_int, + const gchar* a_nullable_string, GCancellable* cancellable, + GAsyncReadyCallback callback, gpointer user_data) { + g_autoptr(FlValue) args = fl_value_new_list(); + fl_value_append_take(args, a_nullable_bool != nullptr + ? fl_value_new_bool(*a_nullable_bool) + : fl_value_new_null()); + fl_value_append_take(args, a_nullable_int != nullptr + ? fl_value_new_int(*a_nullable_int) + : fl_value_new_null()); + fl_value_append_take(args, a_nullable_string != nullptr + ? fl_value_new_string(a_nullable_string) + : fl_value_new_null()); + g_autofree gchar* channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "sendMultipleNullableTypes%s", + self->suffix); + g_autoptr(CoreTestsPigeonTestMessageCodec) codec = + core_tests_pigeon_test_message_codec_new(); + FlBasicMessageChannel* channel = fl_basic_message_channel_new( + self->messenger, channel_name, FL_MESSAGE_CODEC(codec)); + GTask* task = g_task_new(self, cancellable, callback, user_data); + g_task_set_task_data(task, channel, g_object_unref); + fl_basic_message_channel_send( + channel, args, cancellable, + core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_cb, + task); +} + +CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesResponse* +core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_finish( + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, GAsyncResult* result, + GError** error) { + g_autoptr(GTask) task = G_TASK(result); + GAsyncResult* r = G_ASYNC_RESULT(g_task_propagate_pointer(task, nullptr)); + FlBasicMessageChannel* channel = + FL_BASIC_MESSAGE_CHANNEL(g_task_get_task_data(task)); + g_autoptr(FlValue) response = + fl_basic_message_channel_send_finish(channel, r, error); + if (response == nullptr) { + return nullptr; + } + return core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_response_new( + response); +} + +struct + _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponse { + GObject parent_instance; + + FlValue* error; + FlValue* return_value; +}; + +G_DEFINE_TYPE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_without_recursion_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_without_recursion_response_dispose( + GObject* object) { + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponse* + self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_ALL_NULLABLE_TYPES_WITHOUT_RECURSION_RESPONSE( + object); + g_clear_pointer(&self->error, fl_value_unref); + g_clear_pointer(&self->return_value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_without_recursion_response_parent_class) + ->dispose(object); +} + +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_without_recursion_response_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponse* + self) {} + +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_without_recursion_response_class_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_without_recursion_response_dispose; +} + +static CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_without_recursion_response_new( + FlValue* response) { + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponse* + self = CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_ALL_NULLABLE_TYPES_WITHOUT_RECURSION_RESPONSE( + g_object_new( + core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_without_recursion_response_get_type(), + nullptr)); + if (fl_value_get_length(response) > 1) { + self->error = fl_value_ref(response); + } else { + FlValue* value = fl_value_get_list_value(response, 0); + self->return_value = fl_value_ref(value); + } + return self; +} + +gboolean +core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_without_recursion_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponse* + self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_ALL_NULLABLE_TYPES_WITHOUT_RECURSION_RESPONSE( + self), + FALSE); + return self->error != nullptr; +} + +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_without_recursion_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponse* + self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_ALL_NULLABLE_TYPES_WITHOUT_RECURSION_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_without_recursion_response_is_error( + self)); + return fl_value_get_string(fl_value_get_list_value(self->error, 0)); +} + +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_without_recursion_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponse* + self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_ALL_NULLABLE_TYPES_WITHOUT_RECURSION_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_without_recursion_response_is_error( + self)); + return fl_value_get_string(fl_value_get_list_value(self->error, 1)); +} + +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_without_recursion_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponse* + self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_ALL_NULLABLE_TYPES_WITHOUT_RECURSION_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_without_recursion_response_is_error( + self)); + return fl_value_get_list_value(self->error, 2); +} + +CoreTestsPigeonTestAllNullableTypesWithoutRecursion* +core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_without_recursion_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponse* + self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_ALL_NULLABLE_TYPES_WITHOUT_RECURSION_RESPONSE( + self), + nullptr); + g_assert( + !core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_without_recursion_response_is_error( + self)); + if (fl_value_get_type(self->return_value) == FL_VALUE_TYPE_NULL) { + return nullptr; + } + return CORE_TESTS_PIGEON_TEST_ALL_NULLABLE_TYPES_WITHOUT_RECURSION( + fl_value_get_custom_value_object(self->return_value)); +} + +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_without_recursion_cb( + GObject* object, GAsyncResult* result, gpointer user_data) { + GTask* task = G_TASK(user_data); + g_task_return_pointer(task, result, g_object_unref); +} + +void core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_without_recursion( + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, + CoreTestsPigeonTestAllNullableTypesWithoutRecursion* everything, + GCancellable* cancellable, GAsyncReadyCallback callback, + gpointer user_data) { + g_autoptr(FlValue) args = fl_value_new_list(); + fl_value_append_take( + args, everything != nullptr + ? fl_value_new_custom_object(134, G_OBJECT(everything)) + : fl_value_new_null()); + g_autofree gchar* channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoAllNullableTypesWithoutRecursion%s", + self->suffix); + g_autoptr(CoreTestsPigeonTestMessageCodec) codec = + core_tests_pigeon_test_message_codec_new(); + FlBasicMessageChannel* channel = fl_basic_message_channel_new( + self->messenger, channel_name, FL_MESSAGE_CODEC(codec)); + GTask* task = g_task_new(self, cancellable, callback, user_data); + g_task_set_task_data(task, channel, g_object_unref); + fl_basic_message_channel_send( + channel, args, cancellable, + core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_without_recursion_cb, + task); +} + +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_without_recursion_finish( + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, GAsyncResult* result, + GError** error) { + g_autoptr(GTask) task = G_TASK(result); + GAsyncResult* r = G_ASYNC_RESULT(g_task_propagate_pointer(task, nullptr)); + FlBasicMessageChannel* channel = + FL_BASIC_MESSAGE_CHANNEL(g_task_get_task_data(task)); + g_autoptr(FlValue) response = + fl_basic_message_channel_send_finish(channel, r, error); + if (response == nullptr) { + return nullptr; + } + return core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_without_recursion_response_new( + response); +} + +struct + _CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponse { + GObject parent_instance; + + FlValue* error; + FlValue* return_value; +}; + +G_DEFINE_TYPE( + CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponse, + core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_without_recursion_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_without_recursion_response_dispose( + GObject* object) { + CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponse* + self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_SEND_MULTIPLE_NULLABLE_TYPES_WITHOUT_RECURSION_RESPONSE( + object); + g_clear_pointer(&self->error, fl_value_unref); + g_clear_pointer(&self->return_value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_without_recursion_response_parent_class) + ->dispose(object); +} + +static void +core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_without_recursion_response_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponse* + self) {} + +static void +core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_without_recursion_response_class_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_without_recursion_response_dispose; +} + +static CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponse* +core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_without_recursion_response_new( + FlValue* response) { + CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponse* + self = CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_SEND_MULTIPLE_NULLABLE_TYPES_WITHOUT_RECURSION_RESPONSE( + g_object_new( + core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_without_recursion_response_get_type(), + nullptr)); + if (fl_value_get_length(response) > 1) { + self->error = fl_value_ref(response); + } else { + FlValue* value = fl_value_get_list_value(response, 0); + self->return_value = fl_value_ref(value); + } + return self; +} + +gboolean +core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_without_recursion_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponse* + self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_SEND_MULTIPLE_NULLABLE_TYPES_WITHOUT_RECURSION_RESPONSE( + self), + FALSE); + return self->error != nullptr; +} + +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_without_recursion_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponse* + self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_SEND_MULTIPLE_NULLABLE_TYPES_WITHOUT_RECURSION_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_without_recursion_response_is_error( + self)); + return fl_value_get_string(fl_value_get_list_value(self->error, 0)); +} + +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_without_recursion_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponse* + self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_SEND_MULTIPLE_NULLABLE_TYPES_WITHOUT_RECURSION_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_without_recursion_response_is_error( + self)); + return fl_value_get_string(fl_value_get_list_value(self->error, 1)); +} + +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_without_recursion_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponse* + self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_SEND_MULTIPLE_NULLABLE_TYPES_WITHOUT_RECURSION_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_without_recursion_response_is_error( + self)); + return fl_value_get_list_value(self->error, 2); +} + +CoreTestsPigeonTestAllNullableTypesWithoutRecursion* +core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_without_recursion_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponse* + self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_SEND_MULTIPLE_NULLABLE_TYPES_WITHOUT_RECURSION_RESPONSE( + self), + nullptr); + g_assert( + !core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_without_recursion_response_is_error( + self)); + return CORE_TESTS_PIGEON_TEST_ALL_NULLABLE_TYPES_WITHOUT_RECURSION( + fl_value_get_custom_value_object(self->return_value)); +} + +static void +core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_without_recursion_cb( + GObject* object, GAsyncResult* result, gpointer user_data) { + GTask* task = G_TASK(user_data); + g_task_return_pointer(task, result, g_object_unref); +} + +void core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_without_recursion( + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, + gboolean* a_nullable_bool, int64_t* a_nullable_int, + const gchar* a_nullable_string, GCancellable* cancellable, + GAsyncReadyCallback callback, gpointer user_data) { + g_autoptr(FlValue) args = fl_value_new_list(); + fl_value_append_take(args, a_nullable_bool != nullptr + ? fl_value_new_bool(*a_nullable_bool) + : fl_value_new_null()); + fl_value_append_take(args, a_nullable_int != nullptr + ? fl_value_new_int(*a_nullable_int) + : fl_value_new_null()); + fl_value_append_take(args, a_nullable_string != nullptr + ? fl_value_new_string(a_nullable_string) + : fl_value_new_null()); + g_autofree gchar* channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "sendMultipleNullableTypesWithoutRecursion%s", + self->suffix); + g_autoptr(CoreTestsPigeonTestMessageCodec) codec = + core_tests_pigeon_test_message_codec_new(); + FlBasicMessageChannel* channel = fl_basic_message_channel_new( + self->messenger, channel_name, FL_MESSAGE_CODEC(codec)); + GTask* task = g_task_new(self, cancellable, callback, user_data); + g_task_set_task_data(task, channel, g_object_unref); + fl_basic_message_channel_send( + channel, args, cancellable, + core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_without_recursion_cb, + task); +} + +CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponse* +core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_without_recursion_finish( + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, GAsyncResult* result, + GError** error) { + g_autoptr(GTask) task = G_TASK(result); + GAsyncResult* r = G_ASYNC_RESULT(g_task_propagate_pointer(task, nullptr)); + FlBasicMessageChannel* channel = + FL_BASIC_MESSAGE_CHANNEL(g_task_get_task_data(task)); + g_autoptr(FlValue) response = + fl_basic_message_channel_send_finish(channel, r, error); + if (response == nullptr) { + return nullptr; + } + return core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_without_recursion_response_new( + response); +} + +struct _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoBoolResponse { + GObject parent_instance; + + FlValue* error; + FlValue* return_value; +}; + +G_DEFINE_TYPE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoBoolResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_bool_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_bool_response_dispose( + GObject* object) { + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoBoolResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_BOOL_RESPONSE( + object); + g_clear_pointer(&self->error, fl_value_unref); + g_clear_pointer(&self->return_value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_flutter_integration_core_api_echo_bool_response_parent_class) + ->dispose(object); +} + +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_bool_response_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoBoolResponse* self) {} + +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_bool_response_class_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoBoolResponseClass* klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_flutter_integration_core_api_echo_bool_response_dispose; +} + +static CoreTestsPigeonTestFlutterIntegrationCoreApiEchoBoolResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_bool_response_new( + FlValue* response) { + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoBoolResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_BOOL_RESPONSE( + g_object_new( + core_tests_pigeon_test_flutter_integration_core_api_echo_bool_response_get_type(), + nullptr)); + if (fl_value_get_length(response) > 1) { + self->error = fl_value_ref(response); + } else { + FlValue* value = fl_value_get_list_value(response, 0); + self->return_value = fl_value_ref(value); + } + return self; +} + +gboolean +core_tests_pigeon_test_flutter_integration_core_api_echo_bool_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoBoolResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_BOOL_RESPONSE( + self), + FALSE); + return self->error != nullptr; +} + +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_bool_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoBoolResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_BOOL_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_echo_bool_response_is_error( + self)); + return fl_value_get_string(fl_value_get_list_value(self->error, 0)); +} + +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_bool_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoBoolResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_BOOL_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_echo_bool_response_is_error( + self)); + return fl_value_get_string(fl_value_get_list_value(self->error, 1)); +} + +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_bool_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoBoolResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_BOOL_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_echo_bool_response_is_error( + self)); + return fl_value_get_list_value(self->error, 2); +} + +gboolean +core_tests_pigeon_test_flutter_integration_core_api_echo_bool_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoBoolResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_BOOL_RESPONSE( + self), + FALSE); + g_assert( + !core_tests_pigeon_test_flutter_integration_core_api_echo_bool_response_is_error( + self)); + return fl_value_get_bool(self->return_value); +} + +static void core_tests_pigeon_test_flutter_integration_core_api_echo_bool_cb( + GObject* object, GAsyncResult* result, gpointer user_data) { + GTask* task = G_TASK(user_data); + g_task_return_pointer(task, result, g_object_unref); +} + +void core_tests_pigeon_test_flutter_integration_core_api_echo_bool( + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, gboolean a_bool, + GCancellable* cancellable, GAsyncReadyCallback callback, + gpointer user_data) { + g_autoptr(FlValue) args = fl_value_new_list(); + fl_value_append_take(args, fl_value_new_bool(a_bool)); + g_autofree gchar* channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoBool%s", + self->suffix); + g_autoptr(CoreTestsPigeonTestMessageCodec) codec = + core_tests_pigeon_test_message_codec_new(); + FlBasicMessageChannel* channel = fl_basic_message_channel_new( + self->messenger, channel_name, FL_MESSAGE_CODEC(codec)); + GTask* task = g_task_new(self, cancellable, callback, user_data); + g_task_set_task_data(task, channel, g_object_unref); + fl_basic_message_channel_send( + channel, args, cancellable, + core_tests_pigeon_test_flutter_integration_core_api_echo_bool_cb, task); +} + +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoBoolResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_bool_finish( + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, GAsyncResult* result, + GError** error) { + g_autoptr(GTask) task = G_TASK(result); + GAsyncResult* r = G_ASYNC_RESULT(g_task_propagate_pointer(task, nullptr)); + FlBasicMessageChannel* channel = + FL_BASIC_MESSAGE_CHANNEL(g_task_get_task_data(task)); + g_autoptr(FlValue) response = + fl_basic_message_channel_send_finish(channel, r, error); + if (response == nullptr) { + return nullptr; + } + return core_tests_pigeon_test_flutter_integration_core_api_echo_bool_response_new( + response); +} + +struct _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntResponse { + GObject parent_instance; + + FlValue* error; + FlValue* return_value; +}; + +G_DEFINE_TYPE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_int_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_int_response_dispose( + GObject* object) { + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_INT_RESPONSE( + object); + g_clear_pointer(&self->error, fl_value_unref); + g_clear_pointer(&self->return_value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_flutter_integration_core_api_echo_int_response_parent_class) + ->dispose(object); +} + +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_int_response_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntResponse* self) {} + +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_int_response_class_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntResponseClass* klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_flutter_integration_core_api_echo_int_response_dispose; +} + +static CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_int_response_new( + FlValue* response) { + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_INT_RESPONSE( + g_object_new( + core_tests_pigeon_test_flutter_integration_core_api_echo_int_response_get_type(), + nullptr)); + if (fl_value_get_length(response) > 1) { + self->error = fl_value_ref(response); + } else { + FlValue* value = fl_value_get_list_value(response, 0); + self->return_value = fl_value_ref(value); + } + return self; +} + +gboolean +core_tests_pigeon_test_flutter_integration_core_api_echo_int_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_INT_RESPONSE( + self), + FALSE); + return self->error != nullptr; +} + +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_int_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_INT_RESPONSE( + self), nullptr); - g_autofree gchar* - echo_async_nullable_all_nullable_types_without_recursion_channel_name = - g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi." - "echoAsyncNullableAllNullableTypesWithoutRecursion%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) - echo_async_nullable_all_nullable_types_without_recursion_channel = - fl_basic_message_channel_new( - messenger, - echo_async_nullable_all_nullable_types_without_recursion_channel_name, - FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - echo_async_nullable_all_nullable_types_without_recursion_channel, nullptr, - nullptr, nullptr); - g_autofree gchar* echo_async_nullable_int_channel_name = g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncNullableInt%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_async_nullable_int_channel = - fl_basic_message_channel_new(messenger, - echo_async_nullable_int_channel_name, - FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler(echo_async_nullable_int_channel, - nullptr, nullptr, nullptr); - g_autofree gchar* echo_async_nullable_double_channel_name = g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncNullableDouble%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_async_nullable_double_channel = - fl_basic_message_channel_new(messenger, - echo_async_nullable_double_channel_name, - FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - echo_async_nullable_double_channel, nullptr, nullptr, nullptr); - g_autofree gchar* echo_async_nullable_bool_channel_name = g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncNullableBool%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_async_nullable_bool_channel = - fl_basic_message_channel_new(messenger, - echo_async_nullable_bool_channel_name, - FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler(echo_async_nullable_bool_channel, - nullptr, nullptr, nullptr); - g_autofree gchar* echo_async_nullable_string_channel_name = g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncNullableString%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_async_nullable_string_channel = - fl_basic_message_channel_new(messenger, - echo_async_nullable_string_channel_name, - FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - echo_async_nullable_string_channel, nullptr, nullptr, nullptr); - g_autofree gchar* echo_async_nullable_uint8_list_channel_name = - g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncNullableUint8List%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_async_nullable_uint8_list_channel = - fl_basic_message_channel_new(messenger, - echo_async_nullable_uint8_list_channel_name, - FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - echo_async_nullable_uint8_list_channel, nullptr, nullptr, nullptr); - g_autofree gchar* echo_async_nullable_object_channel_name = g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncNullableObject%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_async_nullable_object_channel = - fl_basic_message_channel_new(messenger, - echo_async_nullable_object_channel_name, - FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - echo_async_nullable_object_channel, nullptr, nullptr, nullptr); - g_autofree gchar* echo_async_nullable_list_channel_name = g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncNullableList%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_async_nullable_list_channel = - fl_basic_message_channel_new(messenger, - echo_async_nullable_list_channel_name, - FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler(echo_async_nullable_list_channel, - nullptr, nullptr, nullptr); - g_autofree gchar* echo_async_nullable_map_channel_name = g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncNullableMap%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_async_nullable_map_channel = - fl_basic_message_channel_new(messenger, - echo_async_nullable_map_channel_name, - FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler(echo_async_nullable_map_channel, - nullptr, nullptr, nullptr); - g_autofree gchar* echo_async_nullable_enum_channel_name = g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncNullableEnum%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_async_nullable_enum_channel = - fl_basic_message_channel_new(messenger, - echo_async_nullable_enum_channel_name, - FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler(echo_async_nullable_enum_channel, - nullptr, nullptr, nullptr); - g_autofree gchar* echo_another_async_nullable_enum_channel_name = - g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAnotherAsyncNullableEnum%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) echo_another_async_nullable_enum_channel = - fl_basic_message_channel_new( - messenger, echo_another_async_nullable_enum_channel_name, - FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - echo_another_async_nullable_enum_channel, nullptr, nullptr, nullptr); - g_autofree gchar* call_flutter_noop_channel_name = g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterNoop%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) call_flutter_noop_channel = - fl_basic_message_channel_new(messenger, call_flutter_noop_channel_name, - FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler(call_flutter_noop_channel, - nullptr, nullptr, nullptr); - g_autofree gchar* call_flutter_throw_error_channel_name = g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterThrowError%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) call_flutter_throw_error_channel = - fl_basic_message_channel_new(messenger, - call_flutter_throw_error_channel_name, - FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler(call_flutter_throw_error_channel, - nullptr, nullptr, nullptr); - g_autofree gchar* call_flutter_throw_error_from_void_channel_name = - g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterThrowErrorFromVoid%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) call_flutter_throw_error_from_void_channel = - fl_basic_message_channel_new( - messenger, call_flutter_throw_error_from_void_channel_name, - FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - call_flutter_throw_error_from_void_channel, nullptr, nullptr, nullptr); - g_autofree gchar* call_flutter_echo_all_types_channel_name = g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoAllTypes%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) call_flutter_echo_all_types_channel = - fl_basic_message_channel_new(messenger, - call_flutter_echo_all_types_channel_name, - FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - call_flutter_echo_all_types_channel, nullptr, nullptr, nullptr); - g_autofree gchar* call_flutter_echo_all_nullable_types_channel_name = - g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoAllNullableTypes%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) - call_flutter_echo_all_nullable_types_channel = - fl_basic_message_channel_new( - messenger, call_flutter_echo_all_nullable_types_channel_name, - FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - call_flutter_echo_all_nullable_types_channel, nullptr, nullptr, nullptr); - g_autofree gchar* call_flutter_send_multiple_nullable_types_channel_name = - g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterSendMultipleNullableTypes%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) - call_flutter_send_multiple_nullable_types_channel = - fl_basic_message_channel_new( - messenger, call_flutter_send_multiple_nullable_types_channel_name, - FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - call_flutter_send_multiple_nullable_types_channel, nullptr, nullptr, + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_echo_int_response_is_error( + self)); + return fl_value_get_string(fl_value_get_list_value(self->error, 0)); +} + +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_int_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_INT_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_echo_int_response_is_error( + self)); + return fl_value_get_string(fl_value_get_list_value(self->error, 1)); +} + +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_int_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_INT_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_echo_int_response_is_error( + self)); + return fl_value_get_list_value(self->error, 2); +} + +int64_t +core_tests_pigeon_test_flutter_integration_core_api_echo_int_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_INT_RESPONSE( + self), + 0); + g_assert( + !core_tests_pigeon_test_flutter_integration_core_api_echo_int_response_is_error( + self)); + return fl_value_get_int(self->return_value); +} + +static void core_tests_pigeon_test_flutter_integration_core_api_echo_int_cb( + GObject* object, GAsyncResult* result, gpointer user_data) { + GTask* task = G_TASK(user_data); + g_task_return_pointer(task, result, g_object_unref); +} + +void core_tests_pigeon_test_flutter_integration_core_api_echo_int( + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, int64_t an_int, + GCancellable* cancellable, GAsyncReadyCallback callback, + gpointer user_data) { + g_autoptr(FlValue) args = fl_value_new_list(); + fl_value_append_take(args, fl_value_new_int(an_int)); + g_autofree gchar* channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoInt%s", + self->suffix); + g_autoptr(CoreTestsPigeonTestMessageCodec) codec = + core_tests_pigeon_test_message_codec_new(); + FlBasicMessageChannel* channel = fl_basic_message_channel_new( + self->messenger, channel_name, FL_MESSAGE_CODEC(codec)); + GTask* task = g_task_new(self, cancellable, callback, user_data); + g_task_set_task_data(task, channel, g_object_unref); + fl_basic_message_channel_send( + channel, args, cancellable, + core_tests_pigeon_test_flutter_integration_core_api_echo_int_cb, task); +} + +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_int_finish( + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, GAsyncResult* result, + GError** error) { + g_autoptr(GTask) task = G_TASK(result); + GAsyncResult* r = G_ASYNC_RESULT(g_task_propagate_pointer(task, nullptr)); + FlBasicMessageChannel* channel = + FL_BASIC_MESSAGE_CHANNEL(g_task_get_task_data(task)); + g_autoptr(FlValue) response = + fl_basic_message_channel_send_finish(channel, r, error); + if (response == nullptr) { + return nullptr; + } + return core_tests_pigeon_test_flutter_integration_core_api_echo_int_response_new( + response); +} + +struct _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoDoubleResponse { + GObject parent_instance; + + FlValue* error; + FlValue* return_value; +}; + +G_DEFINE_TYPE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoDoubleResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_double_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_double_response_dispose( + GObject* object) { + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoDoubleResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_DOUBLE_RESPONSE( + object); + g_clear_pointer(&self->error, fl_value_unref); + g_clear_pointer(&self->return_value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_flutter_integration_core_api_echo_double_response_parent_class) + ->dispose(object); +} + +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_double_response_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoDoubleResponse* self) {} + +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_double_response_class_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoDoubleResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_flutter_integration_core_api_echo_double_response_dispose; +} + +static CoreTestsPigeonTestFlutterIntegrationCoreApiEchoDoubleResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_double_response_new( + FlValue* response) { + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoDoubleResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_DOUBLE_RESPONSE( + g_object_new( + core_tests_pigeon_test_flutter_integration_core_api_echo_double_response_get_type(), + nullptr)); + if (fl_value_get_length(response) > 1) { + self->error = fl_value_ref(response); + } else { + FlValue* value = fl_value_get_list_value(response, 0); + self->return_value = fl_value_ref(value); + } + return self; +} + +gboolean +core_tests_pigeon_test_flutter_integration_core_api_echo_double_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoDoubleResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_DOUBLE_RESPONSE( + self), + FALSE); + return self->error != nullptr; +} + +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_double_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoDoubleResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_DOUBLE_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_echo_double_response_is_error( + self)); + return fl_value_get_string(fl_value_get_list_value(self->error, 0)); +} + +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_double_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoDoubleResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_DOUBLE_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_echo_double_response_is_error( + self)); + return fl_value_get_string(fl_value_get_list_value(self->error, 1)); +} + +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_double_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoDoubleResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_DOUBLE_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_echo_double_response_is_error( + self)); + return fl_value_get_list_value(self->error, 2); +} + +double +core_tests_pigeon_test_flutter_integration_core_api_echo_double_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoDoubleResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_DOUBLE_RESPONSE( + self), + 0.0); + g_assert( + !core_tests_pigeon_test_flutter_integration_core_api_echo_double_response_is_error( + self)); + return fl_value_get_float(self->return_value); +} + +static void core_tests_pigeon_test_flutter_integration_core_api_echo_double_cb( + GObject* object, GAsyncResult* result, gpointer user_data) { + GTask* task = G_TASK(user_data); + g_task_return_pointer(task, result, g_object_unref); +} + +void core_tests_pigeon_test_flutter_integration_core_api_echo_double( + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, double a_double, + GCancellable* cancellable, GAsyncReadyCallback callback, + gpointer user_data) { + g_autoptr(FlValue) args = fl_value_new_list(); + fl_value_append_take(args, fl_value_new_float(a_double)); + g_autofree gchar* channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoDouble%s", + self->suffix); + g_autoptr(CoreTestsPigeonTestMessageCodec) codec = + core_tests_pigeon_test_message_codec_new(); + FlBasicMessageChannel* channel = fl_basic_message_channel_new( + self->messenger, channel_name, FL_MESSAGE_CODEC(codec)); + GTask* task = g_task_new(self, cancellable, callback, user_data); + g_task_set_task_data(task, channel, g_object_unref); + fl_basic_message_channel_send( + channel, args, cancellable, + core_tests_pigeon_test_flutter_integration_core_api_echo_double_cb, task); +} + +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoDoubleResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_double_finish( + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, GAsyncResult* result, + GError** error) { + g_autoptr(GTask) task = G_TASK(result); + GAsyncResult* r = G_ASYNC_RESULT(g_task_propagate_pointer(task, nullptr)); + FlBasicMessageChannel* channel = + FL_BASIC_MESSAGE_CHANNEL(g_task_get_task_data(task)); + g_autoptr(FlValue) response = + fl_basic_message_channel_send_finish(channel, r, error); + if (response == nullptr) { + return nullptr; + } + return core_tests_pigeon_test_flutter_integration_core_api_echo_double_response_new( + response); +} + +struct _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringResponse { + GObject parent_instance; + + FlValue* error; + FlValue* return_value; +}; + +G_DEFINE_TYPE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_string_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_string_response_dispose( + GObject* object) { + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_STRING_RESPONSE( + object); + g_clear_pointer(&self->error, fl_value_unref); + g_clear_pointer(&self->return_value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_flutter_integration_core_api_echo_string_response_parent_class) + ->dispose(object); +} + +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_string_response_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringResponse* self) {} + +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_string_response_class_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_flutter_integration_core_api_echo_string_response_dispose; +} + +static CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_string_response_new( + FlValue* response) { + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_STRING_RESPONSE( + g_object_new( + core_tests_pigeon_test_flutter_integration_core_api_echo_string_response_get_type(), + nullptr)); + if (fl_value_get_length(response) > 1) { + self->error = fl_value_ref(response); + } else { + FlValue* value = fl_value_get_list_value(response, 0); + self->return_value = fl_value_ref(value); + } + return self; +} + +gboolean +core_tests_pigeon_test_flutter_integration_core_api_echo_string_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_STRING_RESPONSE( + self), + FALSE); + return self->error != nullptr; +} + +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_string_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_STRING_RESPONSE( + self), nullptr); - g_autofree gchar* - call_flutter_echo_all_nullable_types_without_recursion_channel_name = - g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi." - "callFlutterEchoAllNullableTypesWithoutRecursion%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) - call_flutter_echo_all_nullable_types_without_recursion_channel = - fl_basic_message_channel_new( - messenger, - call_flutter_echo_all_nullable_types_without_recursion_channel_name, - FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - call_flutter_echo_all_nullable_types_without_recursion_channel, nullptr, - nullptr, nullptr); - g_autofree gchar* - call_flutter_send_multiple_nullable_types_without_recursion_channel_name = - g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi." - "callFlutterSendMultipleNullableTypesWithoutRecursion%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) - call_flutter_send_multiple_nullable_types_without_recursion_channel = - fl_basic_message_channel_new( - messenger, - call_flutter_send_multiple_nullable_types_without_recursion_channel_name, - FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - call_flutter_send_multiple_nullable_types_without_recursion_channel, - nullptr, nullptr, nullptr); - g_autofree gchar* call_flutter_echo_bool_channel_name = g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoBool%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) call_flutter_echo_bool_channel = - fl_basic_message_channel_new(messenger, - call_flutter_echo_bool_channel_name, - FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler(call_flutter_echo_bool_channel, - nullptr, nullptr, nullptr); - g_autofree gchar* call_flutter_echo_int_channel_name = g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoInt%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) call_flutter_echo_int_channel = - fl_basic_message_channel_new(messenger, - call_flutter_echo_int_channel_name, - FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler(call_flutter_echo_int_channel, - nullptr, nullptr, nullptr); - g_autofree gchar* call_flutter_echo_double_channel_name = g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoDouble%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) call_flutter_echo_double_channel = - fl_basic_message_channel_new(messenger, - call_flutter_echo_double_channel_name, - FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler(call_flutter_echo_double_channel, - nullptr, nullptr, nullptr); - g_autofree gchar* call_flutter_echo_string_channel_name = g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoString%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) call_flutter_echo_string_channel = - fl_basic_message_channel_new(messenger, - call_flutter_echo_string_channel_name, - FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler(call_flutter_echo_string_channel, - nullptr, nullptr, nullptr); - g_autofree gchar* call_flutter_echo_uint8_list_channel_name = g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoUint8List%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) call_flutter_echo_uint8_list_channel = - fl_basic_message_channel_new(messenger, - call_flutter_echo_uint8_list_channel_name, - FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - call_flutter_echo_uint8_list_channel, nullptr, nullptr, nullptr); - g_autofree gchar* call_flutter_echo_list_channel_name = g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoList%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) call_flutter_echo_list_channel = - fl_basic_message_channel_new(messenger, - call_flutter_echo_list_channel_name, - FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler(call_flutter_echo_list_channel, - nullptr, nullptr, nullptr); - g_autofree gchar* call_flutter_echo_map_channel_name = g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoMap%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) call_flutter_echo_map_channel = - fl_basic_message_channel_new(messenger, - call_flutter_echo_map_channel_name, - FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler(call_flutter_echo_map_channel, - nullptr, nullptr, nullptr); - g_autofree gchar* call_flutter_echo_enum_channel_name = g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoEnum%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) call_flutter_echo_enum_channel = - fl_basic_message_channel_new(messenger, - call_flutter_echo_enum_channel_name, - FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler(call_flutter_echo_enum_channel, - nullptr, nullptr, nullptr); - g_autofree gchar* call_flutter_echo_another_enum_channel_name = - g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoAnotherEnum%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) call_flutter_echo_another_enum_channel = - fl_basic_message_channel_new(messenger, - call_flutter_echo_another_enum_channel_name, - FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - call_flutter_echo_another_enum_channel, nullptr, nullptr, nullptr); - g_autofree gchar* call_flutter_echo_nullable_bool_channel_name = - g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoNullableBool%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) call_flutter_echo_nullable_bool_channel = - fl_basic_message_channel_new(messenger, - call_flutter_echo_nullable_bool_channel_name, - FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - call_flutter_echo_nullable_bool_channel, nullptr, nullptr, nullptr); - g_autofree gchar* call_flutter_echo_nullable_int_channel_name = - g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoNullableInt%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) call_flutter_echo_nullable_int_channel = - fl_basic_message_channel_new(messenger, - call_flutter_echo_nullable_int_channel_name, - FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - call_flutter_echo_nullable_int_channel, nullptr, nullptr, nullptr); - g_autofree gchar* call_flutter_echo_nullable_double_channel_name = - g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoNullableDouble%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) call_flutter_echo_nullable_double_channel = - fl_basic_message_channel_new( - messenger, call_flutter_echo_nullable_double_channel_name, - FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - call_flutter_echo_nullable_double_channel, nullptr, nullptr, nullptr); - g_autofree gchar* call_flutter_echo_nullable_string_channel_name = - g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoNullableString%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) call_flutter_echo_nullable_string_channel = - fl_basic_message_channel_new( - messenger, call_flutter_echo_nullable_string_channel_name, - FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - call_flutter_echo_nullable_string_channel, nullptr, nullptr, nullptr); - g_autofree gchar* call_flutter_echo_nullable_uint8_list_channel_name = - g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoNullableUint8List%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) - call_flutter_echo_nullable_uint8_list_channel = - fl_basic_message_channel_new( - messenger, call_flutter_echo_nullable_uint8_list_channel_name, - FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - call_flutter_echo_nullable_uint8_list_channel, nullptr, nullptr, nullptr); - g_autofree gchar* call_flutter_echo_nullable_list_channel_name = - g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoNullableList%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) call_flutter_echo_nullable_list_channel = - fl_basic_message_channel_new(messenger, - call_flutter_echo_nullable_list_channel_name, - FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - call_flutter_echo_nullable_list_channel, nullptr, nullptr, nullptr); - g_autofree gchar* call_flutter_echo_nullable_map_channel_name = - g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoNullableMap%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) call_flutter_echo_nullable_map_channel = - fl_basic_message_channel_new(messenger, - call_flutter_echo_nullable_map_channel_name, - FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - call_flutter_echo_nullable_map_channel, nullptr, nullptr, nullptr); - g_autofree gchar* call_flutter_echo_nullable_enum_channel_name = - g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoNullableEnum%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) call_flutter_echo_nullable_enum_channel = - fl_basic_message_channel_new(messenger, - call_flutter_echo_nullable_enum_channel_name, - FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - call_flutter_echo_nullable_enum_channel, nullptr, nullptr, nullptr); - g_autofree gchar* call_flutter_echo_another_nullable_enum_channel_name = - g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoAnotherNullableEnum%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) - call_flutter_echo_another_nullable_enum_channel = - fl_basic_message_channel_new( - messenger, call_flutter_echo_another_nullable_enum_channel_name, - FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - call_flutter_echo_another_nullable_enum_channel, nullptr, nullptr, + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_echo_string_response_is_error( + self)); + return fl_value_get_string(fl_value_get_list_value(self->error, 0)); +} + +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_string_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_STRING_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_echo_string_response_is_error( + self)); + return fl_value_get_string(fl_value_get_list_value(self->error, 1)); +} + +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_string_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_STRING_RESPONSE( + self), nullptr); - g_autofree gchar* call_flutter_small_api_echo_string_channel_name = - g_strdup_printf( - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterSmallApiEchoString%s", - dot_suffix); - g_autoptr(FlBasicMessageChannel) call_flutter_small_api_echo_string_channel = - fl_basic_message_channel_new( - messenger, call_flutter_small_api_echo_string_channel_name, - FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler( - call_flutter_small_api_echo_string_channel, nullptr, nullptr, nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_echo_string_response_is_error( + self)); + return fl_value_get_list_value(self->error, 2); } -void core_tests_pigeon_test_host_integration_core_api_respond_noop_async( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiNoopAsyncResponse) response = - core_tests_pigeon_test_host_integration_core_api_noop_async_response_new(); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "noopAsync", error->message); +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_string_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_STRING_RESPONSE( + self), + nullptr); + g_assert( + !core_tests_pigeon_test_flutter_integration_core_api_echo_string_response_is_error( + self)); + return fl_value_get_string(self->return_value); +} + +static void core_tests_pigeon_test_flutter_integration_core_api_echo_string_cb( + GObject* object, GAsyncResult* result, gpointer user_data) { + GTask* task = G_TASK(user_data); + g_task_return_pointer(task, result, g_object_unref); +} + +void core_tests_pigeon_test_flutter_integration_core_api_echo_string( + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, const gchar* a_string, + GCancellable* cancellable, GAsyncReadyCallback callback, + gpointer user_data) { + g_autoptr(FlValue) args = fl_value_new_list(); + fl_value_append_take(args, fl_value_new_string(a_string)); + g_autofree gchar* channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoString%s", + self->suffix); + g_autoptr(CoreTestsPigeonTestMessageCodec) codec = + core_tests_pigeon_test_message_codec_new(); + FlBasicMessageChannel* channel = fl_basic_message_channel_new( + self->messenger, channel_name, FL_MESSAGE_CODEC(codec)); + GTask* task = g_task_new(self, cancellable, callback, user_data); + g_task_set_task_data(task, channel, g_object_unref); + fl_basic_message_channel_send( + channel, args, cancellable, + core_tests_pigeon_test_flutter_integration_core_api_echo_string_cb, task); +} + +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_string_finish( + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, GAsyncResult* result, + GError** error) { + g_autoptr(GTask) task = G_TASK(result); + GAsyncResult* r = G_ASYNC_RESULT(g_task_propagate_pointer(task, nullptr)); + FlBasicMessageChannel* channel = + FL_BASIC_MESSAGE_CHANNEL(g_task_get_task_data(task)); + g_autoptr(FlValue) response = + fl_basic_message_channel_send_finish(channel, r, error); + if (response == nullptr) { + return nullptr; } + return core_tests_pigeon_test_flutter_integration_core_api_echo_string_response_new( + response); } -void core_tests_pigeon_test_host_integration_core_api_respond_error_noop_async( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiNoopAsyncResponse) response = - core_tests_pigeon_test_host_integration_core_api_noop_async_response_new_error( - code, message, details); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "noopAsync", error->message); +struct _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoUint8ListResponse { + GObject parent_instance; + + FlValue* error; + FlValue* return_value; +}; + +G_DEFINE_TYPE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoUint8ListResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list_response_dispose( + GObject* object) { + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoUint8ListResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_UINT8_LIST_RESPONSE( + object); + g_clear_pointer(&self->error, fl_value_unref); + g_clear_pointer(&self->return_value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list_response_parent_class) + ->dispose(object); +} + +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list_response_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoUint8ListResponse* self) {} + +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list_response_class_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoUint8ListResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list_response_dispose; +} + +static CoreTestsPigeonTestFlutterIntegrationCoreApiEchoUint8ListResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list_response_new( + FlValue* response) { + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoUint8ListResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_UINT8_LIST_RESPONSE( + g_object_new( + core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list_response_get_type(), + nullptr)); + if (fl_value_get_length(response) > 1) { + self->error = fl_value_ref(response); + } else { + FlValue* value = fl_value_get_list_value(response, 0); + self->return_value = fl_value_ref(value); + } + return self; +} + +gboolean +core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoUint8ListResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_UINT8_LIST_RESPONSE( + self), + FALSE); + return self->error != nullptr; +} + +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoUint8ListResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_UINT8_LIST_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list_response_is_error( + self)); + return fl_value_get_string(fl_value_get_list_value(self->error, 0)); +} + +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoUint8ListResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_UINT8_LIST_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list_response_is_error( + self)); + return fl_value_get_string(fl_value_get_list_value(self->error, 1)); +} + +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoUint8ListResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_UINT8_LIST_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list_response_is_error( + self)); + return fl_value_get_list_value(self->error, 2); +} + +const uint8_t* +core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoUint8ListResponse* self, + size_t* return_value_length) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_UINT8_LIST_RESPONSE( + self), + nullptr); + g_assert( + !core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list_response_is_error( + self)); + if (return_value_length != nullptr) { + *return_value_length = fl_value_get_length(self->return_value); + } + return fl_value_get_uint8_list(self->return_value); +} + +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list_cb( + GObject* object, GAsyncResult* result, gpointer user_data) { + GTask* task = G_TASK(user_data); + g_task_return_pointer(task, result, g_object_unref); +} + +void core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list( + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, const uint8_t* list, + size_t list_length, GCancellable* cancellable, GAsyncReadyCallback callback, + gpointer user_data) { + g_autoptr(FlValue) args = fl_value_new_list(); + fl_value_append_take(args, fl_value_new_uint8_list(list, list_length)); + g_autofree gchar* channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoUint8List%s", + self->suffix); + g_autoptr(CoreTestsPigeonTestMessageCodec) codec = + core_tests_pigeon_test_message_codec_new(); + FlBasicMessageChannel* channel = fl_basic_message_channel_new( + self->messenger, channel_name, FL_MESSAGE_CODEC(codec)); + GTask* task = g_task_new(self, cancellable, callback, user_data); + g_task_set_task_data(task, channel, g_object_unref); + fl_basic_message_channel_send( + channel, args, cancellable, + core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list_cb, + task); +} + +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoUint8ListResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list_finish( + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, GAsyncResult* result, + GError** error) { + g_autoptr(GTask) task = G_TASK(result); + GAsyncResult* r = G_ASYNC_RESULT(g_task_propagate_pointer(task, nullptr)); + FlBasicMessageChannel* channel = + FL_BASIC_MESSAGE_CHANNEL(g_task_get_task_data(task)); + g_autoptr(FlValue) response = + fl_basic_message_channel_send_finish(channel, r, error); + if (response == nullptr) { + return nullptr; } + return core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list_response_new( + response); } -void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_int( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - int64_t return_value) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncIntResponse) response = - core_tests_pigeon_test_host_integration_core_api_echo_async_int_response_new( - return_value); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "echoAsyncInt", error->message); - } +struct _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoListResponse { + GObject parent_instance; + + FlValue* error; + FlValue* return_value; +}; + +G_DEFINE_TYPE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoListResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_list_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_list_response_dispose( + GObject* object) { + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoListResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_LIST_RESPONSE( + object); + g_clear_pointer(&self->error, fl_value_unref); + g_clear_pointer(&self->return_value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_flutter_integration_core_api_echo_list_response_parent_class) + ->dispose(object); } -void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_int( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncIntResponse) response = - core_tests_pigeon_test_host_integration_core_api_echo_async_int_response_new_error( - code, message, details); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "echoAsyncInt", error->message); - } +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_list_response_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoListResponse* self) {} + +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_list_response_class_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoListResponseClass* klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_flutter_integration_core_api_echo_list_response_dispose; } -void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_double( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - double return_value) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncDoubleResponse) response = - core_tests_pigeon_test_host_integration_core_api_echo_async_double_response_new( - return_value); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "echoAsyncDouble", error->message); +static CoreTestsPigeonTestFlutterIntegrationCoreApiEchoListResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_list_response_new( + FlValue* response) { + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoListResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_LIST_RESPONSE( + g_object_new( + core_tests_pigeon_test_flutter_integration_core_api_echo_list_response_get_type(), + nullptr)); + if (fl_value_get_length(response) > 1) { + self->error = fl_value_ref(response); + } else { + FlValue* value = fl_value_get_list_value(response, 0); + self->return_value = fl_value_ref(value); } + return self; } -void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_double( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncDoubleResponse) response = - core_tests_pigeon_test_host_integration_core_api_echo_async_double_response_new_error( - code, message, details); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "echoAsyncDouble", error->message); - } +gboolean +core_tests_pigeon_test_flutter_integration_core_api_echo_list_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoListResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_LIST_RESPONSE( + self), + FALSE); + return self->error != nullptr; } -void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_bool( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - gboolean return_value) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncBoolResponse) response = - core_tests_pigeon_test_host_integration_core_api_echo_async_bool_response_new( - return_value); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "echoAsyncBool", error->message); - } +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_list_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoListResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_LIST_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_echo_list_response_is_error( + self)); + return fl_value_get_string(fl_value_get_list_value(self->error, 0)); } -void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_bool( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncBoolResponse) response = - core_tests_pigeon_test_host_integration_core_api_echo_async_bool_response_new_error( - code, message, details); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "echoAsyncBool", error->message); - } +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_list_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoListResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_LIST_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_echo_list_response_is_error( + self)); + return fl_value_get_string(fl_value_get_list_value(self->error, 1)); } -void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_string( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* return_value) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncStringResponse) response = - core_tests_pigeon_test_host_integration_core_api_echo_async_string_response_new( - return_value); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "echoAsyncString", error->message); - } +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_list_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoListResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_LIST_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_echo_list_response_is_error( + self)); + return fl_value_get_list_value(self->error, 2); } -void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_string( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncStringResponse) response = - core_tests_pigeon_test_host_integration_core_api_echo_async_string_response_new_error( - code, message, details); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "echoAsyncString", error->message); - } +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_list_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoListResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_LIST_RESPONSE( + self), + nullptr); + g_assert( + !core_tests_pigeon_test_flutter_integration_core_api_echo_list_response_is_error( + self)); + return self->return_value; } -void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_uint8_list( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const uint8_t* return_value, size_t return_value_length) { - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncUint8ListResponse) - response = - core_tests_pigeon_test_host_integration_core_api_echo_async_uint8_list_response_new( - return_value, return_value_length); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "echoAsyncUint8List", error->message); - } +static void core_tests_pigeon_test_flutter_integration_core_api_echo_list_cb( + GObject* object, GAsyncResult* result, gpointer user_data) { + GTask* task = G_TASK(user_data); + g_task_return_pointer(task, result, g_object_unref); } -void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_uint8_list( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details) { - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncUint8ListResponse) - response = - core_tests_pigeon_test_host_integration_core_api_echo_async_uint8_list_response_new_error( - code, message, details); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "echoAsyncUint8List", error->message); - } +void core_tests_pigeon_test_flutter_integration_core_api_echo_list( + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, FlValue* list, + GCancellable* cancellable, GAsyncReadyCallback callback, + gpointer user_data) { + g_autoptr(FlValue) args = fl_value_new_list(); + fl_value_append_take(args, fl_value_ref(list)); + g_autofree gchar* channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoList%s", + self->suffix); + g_autoptr(CoreTestsPigeonTestMessageCodec) codec = + core_tests_pigeon_test_message_codec_new(); + FlBasicMessageChannel* channel = fl_basic_message_channel_new( + self->messenger, channel_name, FL_MESSAGE_CODEC(codec)); + GTask* task = g_task_new(self, cancellable, callback, user_data); + g_task_set_task_data(task, channel, g_object_unref); + fl_basic_message_channel_send( + channel, args, cancellable, + core_tests_pigeon_test_flutter_integration_core_api_echo_list_cb, task); } -void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_object( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - FlValue* return_value) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncObjectResponse) response = - core_tests_pigeon_test_host_integration_core_api_echo_async_object_response_new( - return_value); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "echoAsyncObject", error->message); +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoListResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_list_finish( + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, GAsyncResult* result, + GError** error) { + g_autoptr(GTask) task = G_TASK(result); + GAsyncResult* r = G_ASYNC_RESULT(g_task_propagate_pointer(task, nullptr)); + FlBasicMessageChannel* channel = + FL_BASIC_MESSAGE_CHANNEL(g_task_get_task_data(task)); + g_autoptr(FlValue) response = + fl_basic_message_channel_send_finish(channel, r, error); + if (response == nullptr) { + return nullptr; } + return core_tests_pigeon_test_flutter_integration_core_api_echo_list_response_new( + response); } -void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_object( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncObjectResponse) response = - core_tests_pigeon_test_host_integration_core_api_echo_async_object_response_new_error( - code, message, details); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "echoAsyncObject", error->message); - } +struct _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumListResponse { + GObject parent_instance; + + FlValue* error; + FlValue* return_value; +}; + +G_DEFINE_TYPE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumListResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_enum_list_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_enum_list_response_dispose( + GObject* object) { + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumListResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_ENUM_LIST_RESPONSE( + object); + g_clear_pointer(&self->error, fl_value_unref); + g_clear_pointer(&self->return_value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_flutter_integration_core_api_echo_enum_list_response_parent_class) + ->dispose(object); } -void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_list( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - FlValue* return_value) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncListResponse) response = - core_tests_pigeon_test_host_integration_core_api_echo_async_list_response_new( - return_value); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "echoAsyncList", error->message); - } +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_enum_list_response_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumListResponse* self) {} + +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_enum_list_response_class_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumListResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_flutter_integration_core_api_echo_enum_list_response_dispose; } -void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_list( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncListResponse) response = - core_tests_pigeon_test_host_integration_core_api_echo_async_list_response_new_error( - code, message, details); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "echoAsyncList", error->message); +static CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumListResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_enum_list_response_new( + FlValue* response) { + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumListResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_ENUM_LIST_RESPONSE( + g_object_new( + core_tests_pigeon_test_flutter_integration_core_api_echo_enum_list_response_get_type(), + nullptr)); + if (fl_value_get_length(response) > 1) { + self->error = fl_value_ref(response); + } else { + FlValue* value = fl_value_get_list_value(response, 0); + self->return_value = fl_value_ref(value); } + return self; } -void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_map( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - FlValue* return_value) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncMapResponse) response = - core_tests_pigeon_test_host_integration_core_api_echo_async_map_response_new( - return_value); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "echoAsyncMap", error->message); - } +gboolean +core_tests_pigeon_test_flutter_integration_core_api_echo_enum_list_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumListResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_ENUM_LIST_RESPONSE( + self), + FALSE); + return self->error != nullptr; } -void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_map( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncMapResponse) response = - core_tests_pigeon_test_host_integration_core_api_echo_async_map_response_new_error( - code, message, details); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "echoAsyncMap", error->message); - } +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_enum_list_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumListResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_ENUM_LIST_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_echo_enum_list_response_is_error( + self)); + return fl_value_get_string(fl_value_get_list_value(self->error, 0)); } -void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_enum( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - CoreTestsPigeonTestAnEnum return_value) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncEnumResponse) response = - core_tests_pigeon_test_host_integration_core_api_echo_async_enum_response_new( - return_value); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "echoAsyncEnum", error->message); - } +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_enum_list_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumListResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_ENUM_LIST_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_echo_enum_list_response_is_error( + self)); + return fl_value_get_string(fl_value_get_list_value(self->error, 1)); } -void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_enum( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncEnumResponse) response = - core_tests_pigeon_test_host_integration_core_api_echo_async_enum_response_new_error( - code, message, details); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "echoAsyncEnum", error->message); - } +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_enum_list_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumListResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_ENUM_LIST_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_echo_enum_list_response_is_error( + self)); + return fl_value_get_list_value(self->error, 2); } -void core_tests_pigeon_test_host_integration_core_api_respond_echo_another_async_enum( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - CoreTestsPigeonTestAnotherEnum return_value) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherAsyncEnumResponse) - response = - core_tests_pigeon_test_host_integration_core_api_echo_another_async_enum_response_new( - return_value); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "echoAnotherAsyncEnum", error->message); - } +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_enum_list_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumListResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_ENUM_LIST_RESPONSE( + self), + nullptr); + g_assert( + !core_tests_pigeon_test_flutter_integration_core_api_echo_enum_list_response_is_error( + self)); + return self->return_value; } -void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_another_async_enum( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherAsyncEnumResponse) - response = - core_tests_pigeon_test_host_integration_core_api_echo_another_async_enum_response_new_error( - code, message, details); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "echoAnotherAsyncEnum", error->message); - } +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_enum_list_cb( + GObject* object, GAsyncResult* result, gpointer user_data) { + GTask* task = G_TASK(user_data); + g_task_return_pointer(task, result, g_object_unref); } -void core_tests_pigeon_test_host_integration_core_api_respond_throw_async_error( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - FlValue* return_value) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiThrowAsyncErrorResponse) response = - core_tests_pigeon_test_host_integration_core_api_throw_async_error_response_new( - return_value); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "throwAsyncError", error->message); - } +void core_tests_pigeon_test_flutter_integration_core_api_echo_enum_list( + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, FlValue* enum_list, + GCancellable* cancellable, GAsyncReadyCallback callback, + gpointer user_data) { + g_autoptr(FlValue) args = fl_value_new_list(); + fl_value_append_take(args, fl_value_ref(enum_list)); + g_autofree gchar* channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoEnumList%s", + self->suffix); + g_autoptr(CoreTestsPigeonTestMessageCodec) codec = + core_tests_pigeon_test_message_codec_new(); + FlBasicMessageChannel* channel = fl_basic_message_channel_new( + self->messenger, channel_name, FL_MESSAGE_CODEC(codec)); + GTask* task = g_task_new(self, cancellable, callback, user_data); + g_task_set_task_data(task, channel, g_object_unref); + fl_basic_message_channel_send( + channel, args, cancellable, + core_tests_pigeon_test_flutter_integration_core_api_echo_enum_list_cb, + task); } -void core_tests_pigeon_test_host_integration_core_api_respond_error_throw_async_error( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiThrowAsyncErrorResponse) response = - core_tests_pigeon_test_host_integration_core_api_throw_async_error_response_new_error( - code, message, details); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "throwAsyncError", error->message); +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumListResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_enum_list_finish( + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, GAsyncResult* result, + GError** error) { + g_autoptr(GTask) task = G_TASK(result); + GAsyncResult* r = G_ASYNC_RESULT(g_task_propagate_pointer(task, nullptr)); + FlBasicMessageChannel* channel = + FL_BASIC_MESSAGE_CHANNEL(g_task_get_task_data(task)); + g_autoptr(FlValue) response = + fl_basic_message_channel_send_finish(channel, r, error); + if (response == nullptr) { + return nullptr; } + return core_tests_pigeon_test_flutter_integration_core_api_echo_enum_list_response_new( + response); } -void core_tests_pigeon_test_host_integration_core_api_respond_throw_async_error_from_void( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiThrowAsyncErrorFromVoidResponse) - response = - core_tests_pigeon_test_host_integration_core_api_throw_async_error_from_void_response_new(); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "throwAsyncErrorFromVoid", error->message); - } +struct _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoClassListResponse { + GObject parent_instance; + + FlValue* error; + FlValue* return_value; +}; + +G_DEFINE_TYPE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoClassListResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_class_list_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_class_list_response_dispose( + GObject* object) { + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoClassListResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_CLASS_LIST_RESPONSE( + object); + g_clear_pointer(&self->error, fl_value_unref); + g_clear_pointer(&self->return_value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_flutter_integration_core_api_echo_class_list_response_parent_class) + ->dispose(object); } -void core_tests_pigeon_test_host_integration_core_api_respond_error_throw_async_error_from_void( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiThrowAsyncErrorFromVoidResponse) - response = - core_tests_pigeon_test_host_integration_core_api_throw_async_error_from_void_response_new_error( - code, message, details); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "throwAsyncErrorFromVoid", error->message); - } +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_class_list_response_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoClassListResponse* self) {} + +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_class_list_response_class_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoClassListResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_flutter_integration_core_api_echo_class_list_response_dispose; } -void core_tests_pigeon_test_host_integration_core_api_respond_throw_async_flutter_error( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - FlValue* return_value) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiThrowAsyncFlutterErrorResponse) - response = - core_tests_pigeon_test_host_integration_core_api_throw_async_flutter_error_response_new( - return_value); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "throwAsyncFlutterError", error->message); +static CoreTestsPigeonTestFlutterIntegrationCoreApiEchoClassListResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_class_list_response_new( + FlValue* response) { + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoClassListResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_CLASS_LIST_RESPONSE( + g_object_new( + core_tests_pigeon_test_flutter_integration_core_api_echo_class_list_response_get_type(), + nullptr)); + if (fl_value_get_length(response) > 1) { + self->error = fl_value_ref(response); + } else { + FlValue* value = fl_value_get_list_value(response, 0); + self->return_value = fl_value_ref(value); } + return self; } -void core_tests_pigeon_test_host_integration_core_api_respond_error_throw_async_flutter_error( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiThrowAsyncFlutterErrorResponse) - response = - core_tests_pigeon_test_host_integration_core_api_throw_async_flutter_error_response_new_error( - code, message, details); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "throwAsyncFlutterError", error->message); - } +gboolean +core_tests_pigeon_test_flutter_integration_core_api_echo_class_list_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoClassListResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_CLASS_LIST_RESPONSE( + self), + FALSE); + return self->error != nullptr; } -void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_all_types( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - CoreTestsPigeonTestAllTypes* return_value) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncAllTypesResponse) response = - core_tests_pigeon_test_host_integration_core_api_echo_async_all_types_response_new( - return_value); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "echoAsyncAllTypes", error->message); - } +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_class_list_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoClassListResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_CLASS_LIST_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_echo_class_list_response_is_error( + self)); + return fl_value_get_string(fl_value_get_list_value(self->error, 0)); } -void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_all_types( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncAllTypesResponse) response = - core_tests_pigeon_test_host_integration_core_api_echo_async_all_types_response_new_error( - code, message, details); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "echoAsyncAllTypes", error->message); - } +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_class_list_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoClassListResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_CLASS_LIST_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_echo_class_list_response_is_error( + self)); + return fl_value_get_string(fl_value_get_list_value(self->error, 1)); } -void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_all_nullable_types( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - CoreTestsPigeonTestAllNullableTypes* return_value) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableAllNullableTypesResponse) - response = - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_all_nullable_types_response_new( - return_value); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "echoAsyncNullableAllNullableTypes", error->message); - } +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_class_list_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoClassListResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_CLASS_LIST_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_echo_class_list_response_is_error( + self)); + return fl_value_get_list_value(self->error, 2); } -void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_all_nullable_types( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableAllNullableTypesResponse) - response = - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_all_nullable_types_response_new_error( - code, message, details); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "echoAsyncNullableAllNullableTypes", error->message); - } +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_class_list_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoClassListResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_CLASS_LIST_RESPONSE( + self), + nullptr); + g_assert( + !core_tests_pigeon_test_flutter_integration_core_api_echo_class_list_response_is_error( + self)); + return self->return_value; } -void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_all_nullable_types_without_recursion( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - CoreTestsPigeonTestAllNullableTypesWithoutRecursion* return_value) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableAllNullableTypesWithoutRecursionResponse) - response = - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_all_nullable_types_without_recursion_response_new( - return_value); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "echoAsyncNullableAllNullableTypesWithoutRecursion", - error->message); - } +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_class_list_cb( + GObject* object, GAsyncResult* result, gpointer user_data) { + GTask* task = G_TASK(user_data); + g_task_return_pointer(task, result, g_object_unref); } -void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_all_nullable_types_without_recursion( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableAllNullableTypesWithoutRecursionResponse) - response = - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_all_nullable_types_without_recursion_response_new_error( - code, message, details); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "echoAsyncNullableAllNullableTypesWithoutRecursion", - error->message); +void core_tests_pigeon_test_flutter_integration_core_api_echo_class_list( + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, FlValue* class_list, + GCancellable* cancellable, GAsyncReadyCallback callback, + gpointer user_data) { + g_autoptr(FlValue) args = fl_value_new_list(); + fl_value_append_take(args, fl_value_ref(class_list)); + g_autofree gchar* channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoClassList%s", + self->suffix); + g_autoptr(CoreTestsPigeonTestMessageCodec) codec = + core_tests_pigeon_test_message_codec_new(); + FlBasicMessageChannel* channel = fl_basic_message_channel_new( + self->messenger, channel_name, FL_MESSAGE_CODEC(codec)); + GTask* task = g_task_new(self, cancellable, callback, user_data); + g_task_set_task_data(task, channel, g_object_unref); + fl_basic_message_channel_send( + channel, args, cancellable, + core_tests_pigeon_test_flutter_integration_core_api_echo_class_list_cb, + task); +} + +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoClassListResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_class_list_finish( + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, GAsyncResult* result, + GError** error) { + g_autoptr(GTask) task = G_TASK(result); + GAsyncResult* r = G_ASYNC_RESULT(g_task_propagate_pointer(task, nullptr)); + FlBasicMessageChannel* channel = + FL_BASIC_MESSAGE_CHANNEL(g_task_get_task_data(task)); + g_autoptr(FlValue) response = + fl_basic_message_channel_send_finish(channel, r, error); + if (response == nullptr) { + return nullptr; } + return core_tests_pigeon_test_flutter_integration_core_api_echo_class_list_response_new( + response); } -void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_int( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - int64_t* return_value) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableIntResponse) - response = - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_int_response_new( - return_value); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "echoAsyncNullableInt", error->message); - } +struct + _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullEnumListResponse { + GObject parent_instance; + + FlValue* error; + FlValue* return_value; +}; + +G_DEFINE_TYPE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullEnumListResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_list_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_list_response_dispose( + GObject* object) { + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullEnumListResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_NON_NULL_ENUM_LIST_RESPONSE( + object); + g_clear_pointer(&self->error, fl_value_unref); + g_clear_pointer(&self->return_value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_list_response_parent_class) + ->dispose(object); } -void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_int( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableIntResponse) - response = - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_int_response_new_error( - code, message, details); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "echoAsyncNullableInt", error->message); - } +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_list_response_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullEnumListResponse* + self) {} + +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_list_response_class_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullEnumListResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_list_response_dispose; } -void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_double( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - double* return_value) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableDoubleResponse) - response = - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_double_response_new( - return_value); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "echoAsyncNullableDouble", error->message); +static CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullEnumListResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_list_response_new( + FlValue* response) { + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullEnumListResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_NON_NULL_ENUM_LIST_RESPONSE( + g_object_new( + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_list_response_get_type(), + nullptr)); + if (fl_value_get_length(response) > 1) { + self->error = fl_value_ref(response); + } else { + FlValue* value = fl_value_get_list_value(response, 0); + self->return_value = fl_value_ref(value); } + return self; } -void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_double( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableDoubleResponse) - response = - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_double_response_new_error( - code, message, details); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "echoAsyncNullableDouble", error->message); - } +gboolean +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_list_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullEnumListResponse* + self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NON_NULL_ENUM_LIST_RESPONSE( + self), + FALSE); + return self->error != nullptr; } -void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_bool( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - gboolean* return_value) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableBoolResponse) - response = - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_bool_response_new( - return_value); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "echoAsyncNullableBool", error->message); - } +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_list_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullEnumListResponse* + self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NON_NULL_ENUM_LIST_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_list_response_is_error( + self)); + return fl_value_get_string(fl_value_get_list_value(self->error, 0)); } -void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_bool( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableBoolResponse) - response = - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_bool_response_new_error( - code, message, details); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "echoAsyncNullableBool", error->message); - } +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_list_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullEnumListResponse* + self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NON_NULL_ENUM_LIST_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_list_response_is_error( + self)); + return fl_value_get_string(fl_value_get_list_value(self->error, 1)); } -void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_string( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* return_value) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableStringResponse) - response = - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_string_response_new( - return_value); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "echoAsyncNullableString", error->message); - } +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_list_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullEnumListResponse* + self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NON_NULL_ENUM_LIST_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_list_response_is_error( + self)); + return fl_value_get_list_value(self->error, 2); } -void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_string( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableStringResponse) - response = - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_string_response_new_error( - code, message, details); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "echoAsyncNullableString", error->message); - } +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_list_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullEnumListResponse* + self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NON_NULL_ENUM_LIST_RESPONSE( + self), + nullptr); + g_assert( + !core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_list_response_is_error( + self)); + return self->return_value; } -void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_uint8_list( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const uint8_t* return_value, size_t return_value_length) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableUint8ListResponse) - response = - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_uint8_list_response_new( - return_value, return_value_length); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "echoAsyncNullableUint8List", error->message); - } +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_list_cb( + GObject* object, GAsyncResult* result, gpointer user_data) { + GTask* task = G_TASK(user_data); + g_task_return_pointer(task, result, g_object_unref); } -void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_uint8_list( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableUint8ListResponse) - response = - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_uint8_list_response_new_error( - code, message, details); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "echoAsyncNullableUint8List", error->message); +void core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_list( + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, FlValue* enum_list, + GCancellable* cancellable, GAsyncReadyCallback callback, + gpointer user_data) { + g_autoptr(FlValue) args = fl_value_new_list(); + fl_value_append_take(args, fl_value_ref(enum_list)); + g_autofree gchar* channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoNonNullEnumList%s", + self->suffix); + g_autoptr(CoreTestsPigeonTestMessageCodec) codec = + core_tests_pigeon_test_message_codec_new(); + FlBasicMessageChannel* channel = fl_basic_message_channel_new( + self->messenger, channel_name, FL_MESSAGE_CODEC(codec)); + GTask* task = g_task_new(self, cancellable, callback, user_data); + g_task_set_task_data(task, channel, g_object_unref); + fl_basic_message_channel_send( + channel, args, cancellable, + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_list_cb, + task); +} + +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullEnumListResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_list_finish( + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, GAsyncResult* result, + GError** error) { + g_autoptr(GTask) task = G_TASK(result); + GAsyncResult* r = G_ASYNC_RESULT(g_task_propagate_pointer(task, nullptr)); + FlBasicMessageChannel* channel = + FL_BASIC_MESSAGE_CHANNEL(g_task_get_task_data(task)); + g_autoptr(FlValue) response = + fl_basic_message_channel_send_finish(channel, r, error); + if (response == nullptr) { + return nullptr; } + return core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_list_response_new( + response); } -void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_object( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - FlValue* return_value) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableObjectResponse) - response = - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_object_response_new( - return_value); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "echoAsyncNullableObject", error->message); - } +struct + _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullClassListResponse { + GObject parent_instance; + + FlValue* error; + FlValue* return_value; +}; + +G_DEFINE_TYPE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullClassListResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_list_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_list_response_dispose( + GObject* object) { + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullClassListResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_NON_NULL_CLASS_LIST_RESPONSE( + object); + g_clear_pointer(&self->error, fl_value_unref); + g_clear_pointer(&self->return_value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_list_response_parent_class) + ->dispose(object); } -void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_object( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableObjectResponse) - response = - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_object_response_new_error( - code, message, details); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "echoAsyncNullableObject", error->message); - } +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_list_response_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullClassListResponse* + self) {} + +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_list_response_class_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullClassListResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_list_response_dispose; } -void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_list( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - FlValue* return_value) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableListResponse) - response = - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_list_response_new( - return_value); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "echoAsyncNullableList", error->message); +static CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullClassListResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_list_response_new( + FlValue* response) { + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullClassListResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_NON_NULL_CLASS_LIST_RESPONSE( + g_object_new( + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_list_response_get_type(), + nullptr)); + if (fl_value_get_length(response) > 1) { + self->error = fl_value_ref(response); + } else { + FlValue* value = fl_value_get_list_value(response, 0); + self->return_value = fl_value_ref(value); } + return self; } -void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_list( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableListResponse) - response = - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_list_response_new_error( - code, message, details); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "echoAsyncNullableList", error->message); - } +gboolean +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_list_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullClassListResponse* + self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NON_NULL_CLASS_LIST_RESPONSE( + self), + FALSE); + return self->error != nullptr; } -void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_map( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - FlValue* return_value) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableMapResponse) - response = - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_map_response_new( - return_value); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "echoAsyncNullableMap", error->message); - } +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_list_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullClassListResponse* + self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NON_NULL_CLASS_LIST_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_list_response_is_error( + self)); + return fl_value_get_string(fl_value_get_list_value(self->error, 0)); } -void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_map( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableMapResponse) - response = - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_map_response_new_error( - code, message, details); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "echoAsyncNullableMap", error->message); - } +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_list_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullClassListResponse* + self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NON_NULL_CLASS_LIST_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_list_response_is_error( + self)); + return fl_value_get_string(fl_value_get_list_value(self->error, 1)); } -void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_enum( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - CoreTestsPigeonTestAnEnum* return_value) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableEnumResponse) - response = - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_enum_response_new( - return_value); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "echoAsyncNullableEnum", error->message); - } +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_list_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullClassListResponse* + self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NON_NULL_CLASS_LIST_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_list_response_is_error( + self)); + return fl_value_get_list_value(self->error, 2); } -void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_enum( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableEnumResponse) - response = - core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_enum_response_new_error( - code, message, details); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "echoAsyncNullableEnum", error->message); - } +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_list_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullClassListResponse* + self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NON_NULL_CLASS_LIST_RESPONSE( + self), + nullptr); + g_assert( + !core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_list_response_is_error( + self)); + return self->return_value; } -void core_tests_pigeon_test_host_integration_core_api_respond_echo_another_async_nullable_enum( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - CoreTestsPigeonTestAnotherEnum* return_value) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherAsyncNullableEnumResponse) - response = - core_tests_pigeon_test_host_integration_core_api_echo_another_async_nullable_enum_response_new( - return_value); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "echoAnotherAsyncNullableEnum", error->message); - } +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_list_cb( + GObject* object, GAsyncResult* result, gpointer user_data) { + GTask* task = G_TASK(user_data); + g_task_return_pointer(task, result, g_object_unref); } -void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_another_async_nullable_enum( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherAsyncNullableEnumResponse) - response = - core_tests_pigeon_test_host_integration_core_api_echo_another_async_nullable_enum_response_new_error( - code, message, details); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "echoAnotherAsyncNullableEnum", error->message); - } +void core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_list( + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, FlValue* class_list, + GCancellable* cancellable, GAsyncReadyCallback callback, + gpointer user_data) { + g_autoptr(FlValue) args = fl_value_new_list(); + fl_value_append_take(args, fl_value_ref(class_list)); + g_autofree gchar* channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoNonNullClassList%s", + self->suffix); + g_autoptr(CoreTestsPigeonTestMessageCodec) codec = + core_tests_pigeon_test_message_codec_new(); + FlBasicMessageChannel* channel = fl_basic_message_channel_new( + self->messenger, channel_name, FL_MESSAGE_CODEC(codec)); + GTask* task = g_task_new(self, cancellable, callback, user_data); + g_task_set_task_data(task, channel, g_object_unref); + fl_basic_message_channel_send( + channel, args, cancellable, + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_list_cb, + task); } -void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_noop( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterNoopResponse) response = - core_tests_pigeon_test_host_integration_core_api_call_flutter_noop_response_new(); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "callFlutterNoop", error->message); +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullClassListResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_list_finish( + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, GAsyncResult* result, + GError** error) { + g_autoptr(GTask) task = G_TASK(result); + GAsyncResult* r = G_ASYNC_RESULT(g_task_propagate_pointer(task, nullptr)); + FlBasicMessageChannel* channel = + FL_BASIC_MESSAGE_CHANNEL(g_task_get_task_data(task)); + g_autoptr(FlValue) response = + fl_basic_message_channel_send_finish(channel, r, error); + if (response == nullptr) { + return nullptr; } + return core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_list_response_new( + response); } -void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_noop( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterNoopResponse) response = - core_tests_pigeon_test_host_integration_core_api_call_flutter_noop_response_new_error( - code, message, details); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "callFlutterNoop", error->message); - } +struct _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoMapResponse { + GObject parent_instance; + + FlValue* error; + FlValue* return_value; +}; + +G_DEFINE_TYPE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoMapResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_map_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_map_response_dispose( + GObject* object) { + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoMapResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_MAP_RESPONSE( + object); + g_clear_pointer(&self->error, fl_value_unref); + g_clear_pointer(&self->return_value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_flutter_integration_core_api_echo_map_response_parent_class) + ->dispose(object); } -void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_throw_error( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - FlValue* return_value) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterThrowErrorResponse) - response = - core_tests_pigeon_test_host_integration_core_api_call_flutter_throw_error_response_new( - return_value); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "callFlutterThrowError", error->message); - } +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_map_response_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoMapResponse* self) {} + +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_map_response_class_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoMapResponseClass* klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_flutter_integration_core_api_echo_map_response_dispose; } -void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_throw_error( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterThrowErrorResponse) - response = - core_tests_pigeon_test_host_integration_core_api_call_flutter_throw_error_response_new_error( - code, message, details); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "callFlutterThrowError", error->message); +static CoreTestsPigeonTestFlutterIntegrationCoreApiEchoMapResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_map_response_new( + FlValue* response) { + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoMapResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_MAP_RESPONSE( + g_object_new( + core_tests_pigeon_test_flutter_integration_core_api_echo_map_response_get_type(), + nullptr)); + if (fl_value_get_length(response) > 1) { + self->error = fl_value_ref(response); + } else { + FlValue* value = fl_value_get_list_value(response, 0); + self->return_value = fl_value_ref(value); } + return self; } -void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_throw_error_from_void( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterThrowErrorFromVoidResponse) - response = - core_tests_pigeon_test_host_integration_core_api_call_flutter_throw_error_from_void_response_new(); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "callFlutterThrowErrorFromVoid", error->message); - } +gboolean +core_tests_pigeon_test_flutter_integration_core_api_echo_map_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoMapResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_MAP_RESPONSE( + self), + FALSE); + return self->error != nullptr; } -void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_throw_error_from_void( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterThrowErrorFromVoidResponse) - response = - core_tests_pigeon_test_host_integration_core_api_call_flutter_throw_error_from_void_response_new_error( - code, message, details); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "callFlutterThrowErrorFromVoid", error->message); - } +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_map_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoMapResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_MAP_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_echo_map_response_is_error( + self)); + return fl_value_get_string(fl_value_get_list_value(self->error, 0)); } -void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_all_types( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - CoreTestsPigeonTestAllTypes* return_value) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAllTypesResponse) - response = - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_types_response_new( - return_value); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "callFlutterEchoAllTypes", error->message); - } +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_map_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoMapResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_MAP_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_echo_map_response_is_error( + self)); + return fl_value_get_string(fl_value_get_list_value(self->error, 1)); } -void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_all_types( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAllTypesResponse) - response = - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_types_response_new_error( - code, message, details); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "callFlutterEchoAllTypes", error->message); - } +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_map_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoMapResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_MAP_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_echo_map_response_is_error( + self)); + return fl_value_get_list_value(self->error, 2); } -void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_all_nullable_types( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - CoreTestsPigeonTestAllNullableTypes* return_value) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAllNullableTypesResponse) - response = - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_nullable_types_response_new( - return_value); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "callFlutterEchoAllNullableTypes", error->message); - } +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_map_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoMapResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_MAP_RESPONSE( + self), + nullptr); + g_assert( + !core_tests_pigeon_test_flutter_integration_core_api_echo_map_response_is_error( + self)); + return self->return_value; } -void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_all_nullable_types( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAllNullableTypesResponse) - response = - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_nullable_types_response_new_error( - code, message, details); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "callFlutterEchoAllNullableTypes", error->message); - } +static void core_tests_pigeon_test_flutter_integration_core_api_echo_map_cb( + GObject* object, GAsyncResult* result, gpointer user_data) { + GTask* task = G_TASK(user_data); + g_task_return_pointer(task, result, g_object_unref); +} + +void core_tests_pigeon_test_flutter_integration_core_api_echo_map( + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, FlValue* map, + GCancellable* cancellable, GAsyncReadyCallback callback, + gpointer user_data) { + g_autoptr(FlValue) args = fl_value_new_list(); + fl_value_append_take(args, fl_value_ref(map)); + g_autofree gchar* channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoMap%s", + self->suffix); + g_autoptr(CoreTestsPigeonTestMessageCodec) codec = + core_tests_pigeon_test_message_codec_new(); + FlBasicMessageChannel* channel = fl_basic_message_channel_new( + self->messenger, channel_name, FL_MESSAGE_CODEC(codec)); + GTask* task = g_task_new(self, cancellable, callback, user_data); + g_task_set_task_data(task, channel, g_object_unref); + fl_basic_message_channel_send( + channel, args, cancellable, + core_tests_pigeon_test_flutter_integration_core_api_echo_map_cb, task); } -void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_send_multiple_nullable_types( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - CoreTestsPigeonTestAllNullableTypes* return_value) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterSendMultipleNullableTypesResponse) - response = - core_tests_pigeon_test_host_integration_core_api_call_flutter_send_multiple_nullable_types_response_new( - return_value); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "callFlutterSendMultipleNullableTypes", error->message); +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoMapResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_map_finish( + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, GAsyncResult* result, + GError** error) { + g_autoptr(GTask) task = G_TASK(result); + GAsyncResult* r = G_ASYNC_RESULT(g_task_propagate_pointer(task, nullptr)); + FlBasicMessageChannel* channel = + FL_BASIC_MESSAGE_CHANNEL(g_task_get_task_data(task)); + g_autoptr(FlValue) response = + fl_basic_message_channel_send_finish(channel, r, error); + if (response == nullptr) { + return nullptr; } + return core_tests_pigeon_test_flutter_integration_core_api_echo_map_response_new( + response); } -void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_send_multiple_nullable_types( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterSendMultipleNullableTypesResponse) - response = - core_tests_pigeon_test_host_integration_core_api_call_flutter_send_multiple_nullable_types_response_new_error( - code, message, details); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "callFlutterSendMultipleNullableTypes", error->message); - } +struct _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringMapResponse { + GObject parent_instance; + + FlValue* error; + FlValue* return_value; +}; + +G_DEFINE_TYPE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringMapResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_response_dispose( + GObject* object) { + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringMapResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_STRING_MAP_RESPONSE( + object); + g_clear_pointer(&self->error, fl_value_unref); + g_clear_pointer(&self->return_value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_response_parent_class) + ->dispose(object); } -void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_all_nullable_types_without_recursion( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - CoreTestsPigeonTestAllNullableTypesWithoutRecursion* return_value) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAllNullableTypesWithoutRecursionResponse) - response = - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_nullable_types_without_recursion_response_new( - return_value); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "callFlutterEchoAllNullableTypesWithoutRecursion", - error->message); - } +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_response_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringMapResponse* self) {} + +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_response_class_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringMapResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_response_dispose; } -void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_all_nullable_types_without_recursion( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAllNullableTypesWithoutRecursionResponse) - response = - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_all_nullable_types_without_recursion_response_new_error( - code, message, details); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "callFlutterEchoAllNullableTypesWithoutRecursion", - error->message); +static CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringMapResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_response_new( + FlValue* response) { + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringMapResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_STRING_MAP_RESPONSE( + g_object_new( + core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_response_get_type(), + nullptr)); + if (fl_value_get_length(response) > 1) { + self->error = fl_value_ref(response); + } else { + FlValue* value = fl_value_get_list_value(response, 0); + self->return_value = fl_value_ref(value); } + return self; } -void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_send_multiple_nullable_types_without_recursion( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - CoreTestsPigeonTestAllNullableTypesWithoutRecursion* return_value) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterSendMultipleNullableTypesWithoutRecursionResponse) - response = - core_tests_pigeon_test_host_integration_core_api_call_flutter_send_multiple_nullable_types_without_recursion_response_new( - return_value); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "callFlutterSendMultipleNullableTypesWithoutRecursion", - error->message); - } +gboolean +core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringMapResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_STRING_MAP_RESPONSE( + self), + FALSE); + return self->error != nullptr; } -void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_send_multiple_nullable_types_without_recursion( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterSendMultipleNullableTypesWithoutRecursionResponse) - response = - core_tests_pigeon_test_host_integration_core_api_call_flutter_send_multiple_nullable_types_without_recursion_response_new_error( - code, message, details); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "callFlutterSendMultipleNullableTypesWithoutRecursion", - error->message); - } +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringMapResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_STRING_MAP_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_response_is_error( + self)); + return fl_value_get_string(fl_value_get_list_value(self->error, 0)); } -void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_bool( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - gboolean return_value) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoBoolResponse) - response = - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_bool_response_new( - return_value); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "callFlutterEchoBool", error->message); - } +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringMapResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_STRING_MAP_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_response_is_error( + self)); + return fl_value_get_string(fl_value_get_list_value(self->error, 1)); } -void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_bool( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoBoolResponse) - response = - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_bool_response_new_error( - code, message, details); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "callFlutterEchoBool", error->message); - } +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringMapResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_STRING_MAP_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_response_is_error( + self)); + return fl_value_get_list_value(self->error, 2); } -void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_int( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - int64_t return_value) { - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoIntResponse) - response = - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_int_response_new( - return_value); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "callFlutterEchoInt", error->message); - } +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringMapResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_STRING_MAP_RESPONSE( + self), + nullptr); + g_assert( + !core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_response_is_error( + self)); + return self->return_value; } -void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_int( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details) { - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoIntResponse) - response = - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_int_response_new_error( - code, message, details); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "callFlutterEchoInt", error->message); - } +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_cb( + GObject* object, GAsyncResult* result, gpointer user_data) { + GTask* task = G_TASK(user_data); + g_task_return_pointer(task, result, g_object_unref); } -void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_double( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - double return_value) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoDoubleResponse) - response = - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_double_response_new( - return_value); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "callFlutterEchoDouble", error->message); - } +void core_tests_pigeon_test_flutter_integration_core_api_echo_string_map( + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, FlValue* string_map, + GCancellable* cancellable, GAsyncReadyCallback callback, + gpointer user_data) { + g_autoptr(FlValue) args = fl_value_new_list(); + fl_value_append_take(args, fl_value_ref(string_map)); + g_autofree gchar* channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoStringMap%s", + self->suffix); + g_autoptr(CoreTestsPigeonTestMessageCodec) codec = + core_tests_pigeon_test_message_codec_new(); + FlBasicMessageChannel* channel = fl_basic_message_channel_new( + self->messenger, channel_name, FL_MESSAGE_CODEC(codec)); + GTask* task = g_task_new(self, cancellable, callback, user_data); + g_task_set_task_data(task, channel, g_object_unref); + fl_basic_message_channel_send( + channel, args, cancellable, + core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_cb, + task); } -void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_double( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoDoubleResponse) - response = - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_double_response_new_error( - code, message, details); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "callFlutterEchoDouble", error->message); +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringMapResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_finish( + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, GAsyncResult* result, + GError** error) { + g_autoptr(GTask) task = G_TASK(result); + GAsyncResult* r = G_ASYNC_RESULT(g_task_propagate_pointer(task, nullptr)); + FlBasicMessageChannel* channel = + FL_BASIC_MESSAGE_CHANNEL(g_task_get_task_data(task)); + g_autoptr(FlValue) response = + fl_basic_message_channel_send_finish(channel, r, error); + if (response == nullptr) { + return nullptr; } + return core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_response_new( + response); } -void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_string( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* return_value) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoStringResponse) - response = - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_string_response_new( - return_value); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "callFlutterEchoString", error->message); - } +struct _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntMapResponse { + GObject parent_instance; + + FlValue* error; + FlValue* return_value; +}; + +G_DEFINE_TYPE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntMapResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_response_dispose( + GObject* object) { + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntMapResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_INT_MAP_RESPONSE( + object); + g_clear_pointer(&self->error, fl_value_unref); + g_clear_pointer(&self->return_value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_response_parent_class) + ->dispose(object); } -void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_string( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoStringResponse) - response = - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_string_response_new_error( - code, message, details); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "callFlutterEchoString", error->message); - } +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_response_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntMapResponse* self) {} + +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_response_class_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntMapResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_response_dispose; } -void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_uint8_list( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const uint8_t* return_value, size_t return_value_length) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoUint8ListResponse) - response = - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_uint8_list_response_new( - return_value, return_value_length); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "callFlutterEchoUint8List", error->message); +static CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntMapResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_response_new( + FlValue* response) { + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntMapResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_INT_MAP_RESPONSE( + g_object_new( + core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_response_get_type(), + nullptr)); + if (fl_value_get_length(response) > 1) { + self->error = fl_value_ref(response); + } else { + FlValue* value = fl_value_get_list_value(response, 0); + self->return_value = fl_value_ref(value); } + return self; } -void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_uint8_list( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoUint8ListResponse) - response = - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_uint8_list_response_new_error( - code, message, details); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "callFlutterEchoUint8List", error->message); - } +gboolean +core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntMapResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_INT_MAP_RESPONSE( + self), + FALSE); + return self->error != nullptr; } -void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_list( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - FlValue* return_value) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoListResponse) - response = - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_list_response_new( - return_value); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "callFlutterEchoList", error->message); - } +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntMapResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_INT_MAP_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_response_is_error( + self)); + return fl_value_get_string(fl_value_get_list_value(self->error, 0)); } -void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_list( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoListResponse) - response = - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_list_response_new_error( - code, message, details); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "callFlutterEchoList", error->message); - } +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntMapResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_INT_MAP_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_response_is_error( + self)); + return fl_value_get_string(fl_value_get_list_value(self->error, 1)); } -void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_map( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - FlValue* return_value) { - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoMapResponse) - response = - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_map_response_new( - return_value); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "callFlutterEchoMap", error->message); - } +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntMapResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_INT_MAP_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_response_is_error( + self)); + return fl_value_get_list_value(self->error, 2); } -void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_map( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details) { - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoMapResponse) - response = - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_map_response_new_error( - code, message, details); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "callFlutterEchoMap", error->message); - } +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntMapResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_INT_MAP_RESPONSE( + self), + nullptr); + g_assert( + !core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_response_is_error( + self)); + return self->return_value; } -void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_enum( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - CoreTestsPigeonTestAnEnum return_value) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoEnumResponse) - response = - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_response_new( - return_value); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "callFlutterEchoEnum", error->message); - } +static void core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_cb( + GObject* object, GAsyncResult* result, gpointer user_data) { + GTask* task = G_TASK(user_data); + g_task_return_pointer(task, result, g_object_unref); } -void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_enum( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoEnumResponse) - response = - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_response_new_error( - code, message, details); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "callFlutterEchoEnum", error->message); - } +void core_tests_pigeon_test_flutter_integration_core_api_echo_int_map( + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, FlValue* int_map, + GCancellable* cancellable, GAsyncReadyCallback callback, + gpointer user_data) { + g_autoptr(FlValue) args = fl_value_new_list(); + fl_value_append_take(args, fl_value_ref(int_map)); + g_autofree gchar* channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoIntMap%s", + self->suffix); + g_autoptr(CoreTestsPigeonTestMessageCodec) codec = + core_tests_pigeon_test_message_codec_new(); + FlBasicMessageChannel* channel = fl_basic_message_channel_new( + self->messenger, channel_name, FL_MESSAGE_CODEC(codec)); + GTask* task = g_task_new(self, cancellable, callback, user_data); + g_task_set_task_data(task, channel, g_object_unref); + fl_basic_message_channel_send( + channel, args, cancellable, + core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_cb, + task); } -void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_another_enum( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - CoreTestsPigeonTestAnotherEnum return_value) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAnotherEnumResponse) - response = - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_another_enum_response_new( - return_value); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "callFlutterEchoAnotherEnum", error->message); +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntMapResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_finish( + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, GAsyncResult* result, + GError** error) { + g_autoptr(GTask) task = G_TASK(result); + GAsyncResult* r = G_ASYNC_RESULT(g_task_propagate_pointer(task, nullptr)); + FlBasicMessageChannel* channel = + FL_BASIC_MESSAGE_CHANNEL(g_task_get_task_data(task)); + g_autoptr(FlValue) response = + fl_basic_message_channel_send_finish(channel, r, error); + if (response == nullptr) { + return nullptr; } + return core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_response_new( + response); } -void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_another_enum( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAnotherEnumResponse) - response = - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_another_enum_response_new_error( - code, message, details); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "callFlutterEchoAnotherEnum", error->message); - } +struct _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumMapResponse { + GObject parent_instance; + + FlValue* error; + FlValue* return_value; +}; + +G_DEFINE_TYPE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumMapResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_enum_map_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_enum_map_response_dispose( + GObject* object) { + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumMapResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_ENUM_MAP_RESPONSE( + object); + g_clear_pointer(&self->error, fl_value_unref); + g_clear_pointer(&self->return_value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_flutter_integration_core_api_echo_enum_map_response_parent_class) + ->dispose(object); } -void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_bool( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - gboolean* return_value) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableBoolResponse) - response = - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_bool_response_new( - return_value); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "callFlutterEchoNullableBool", error->message); - } +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_enum_map_response_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumMapResponse* self) {} + +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_enum_map_response_class_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumMapResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_flutter_integration_core_api_echo_enum_map_response_dispose; } -void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_bool( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableBoolResponse) - response = - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_bool_response_new_error( - code, message, details); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "callFlutterEchoNullableBool", error->message); +static CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumMapResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_enum_map_response_new( + FlValue* response) { + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumMapResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_ENUM_MAP_RESPONSE( + g_object_new( + core_tests_pigeon_test_flutter_integration_core_api_echo_enum_map_response_get_type(), + nullptr)); + if (fl_value_get_length(response) > 1) { + self->error = fl_value_ref(response); + } else { + FlValue* value = fl_value_get_list_value(response, 0); + self->return_value = fl_value_ref(value); } + return self; } -void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_int( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - int64_t* return_value) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableIntResponse) - response = - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_int_response_new( - return_value); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "callFlutterEchoNullableInt", error->message); - } +gboolean +core_tests_pigeon_test_flutter_integration_core_api_echo_enum_map_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumMapResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_ENUM_MAP_RESPONSE( + self), + FALSE); + return self->error != nullptr; } -void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_int( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableIntResponse) - response = - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_int_response_new_error( - code, message, details); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "callFlutterEchoNullableInt", error->message); - } +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_enum_map_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumMapResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_ENUM_MAP_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_echo_enum_map_response_is_error( + self)); + return fl_value_get_string(fl_value_get_list_value(self->error, 0)); } -void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_double( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - double* return_value) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableDoubleResponse) - response = - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_double_response_new( - return_value); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "callFlutterEchoNullableDouble", error->message); - } +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_enum_map_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumMapResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_ENUM_MAP_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_echo_enum_map_response_is_error( + self)); + return fl_value_get_string(fl_value_get_list_value(self->error, 1)); } -void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_double( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableDoubleResponse) - response = - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_double_response_new_error( - code, message, details); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "callFlutterEchoNullableDouble", error->message); - } +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_enum_map_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumMapResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_ENUM_MAP_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_echo_enum_map_response_is_error( + self)); + return fl_value_get_list_value(self->error, 2); } -void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_string( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* return_value) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableStringResponse) - response = - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_string_response_new( - return_value); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "callFlutterEchoNullableString", error->message); - } +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_enum_map_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumMapResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_ENUM_MAP_RESPONSE( + self), + nullptr); + g_assert( + !core_tests_pigeon_test_flutter_integration_core_api_echo_enum_map_response_is_error( + self)); + return self->return_value; } -void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_string( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableStringResponse) - response = - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_string_response_new_error( - code, message, details); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "callFlutterEchoNullableString", error->message); - } +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_enum_map_cb( + GObject* object, GAsyncResult* result, gpointer user_data) { + GTask* task = G_TASK(user_data); + g_task_return_pointer(task, result, g_object_unref); } -void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_uint8_list( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const uint8_t* return_value, size_t return_value_length) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableUint8ListResponse) - response = - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_uint8_list_response_new( - return_value, return_value_length); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "callFlutterEchoNullableUint8List", error->message); - } +void core_tests_pigeon_test_flutter_integration_core_api_echo_enum_map( + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, FlValue* enum_map, + GCancellable* cancellable, GAsyncReadyCallback callback, + gpointer user_data) { + g_autoptr(FlValue) args = fl_value_new_list(); + fl_value_append_take(args, fl_value_ref(enum_map)); + g_autofree gchar* channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoEnumMap%s", + self->suffix); + g_autoptr(CoreTestsPigeonTestMessageCodec) codec = + core_tests_pigeon_test_message_codec_new(); + FlBasicMessageChannel* channel = fl_basic_message_channel_new( + self->messenger, channel_name, FL_MESSAGE_CODEC(codec)); + GTask* task = g_task_new(self, cancellable, callback, user_data); + g_task_set_task_data(task, channel, g_object_unref); + fl_basic_message_channel_send( + channel, args, cancellable, + core_tests_pigeon_test_flutter_integration_core_api_echo_enum_map_cb, + task); } -void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_uint8_list( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableUint8ListResponse) - response = - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_uint8_list_response_new_error( - code, message, details); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "callFlutterEchoNullableUint8List", error->message); +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumMapResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_enum_map_finish( + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, GAsyncResult* result, + GError** error) { + g_autoptr(GTask) task = G_TASK(result); + GAsyncResult* r = G_ASYNC_RESULT(g_task_propagate_pointer(task, nullptr)); + FlBasicMessageChannel* channel = + FL_BASIC_MESSAGE_CHANNEL(g_task_get_task_data(task)); + g_autoptr(FlValue) response = + fl_basic_message_channel_send_finish(channel, r, error); + if (response == nullptr) { + return nullptr; } + return core_tests_pigeon_test_flutter_integration_core_api_echo_enum_map_response_new( + response); } -void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_list( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - FlValue* return_value) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableListResponse) - response = - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_list_response_new( - return_value); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "callFlutterEchoNullableList", error->message); - } +struct _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoClassMapResponse { + GObject parent_instance; + + FlValue* error; + FlValue* return_value; +}; + +G_DEFINE_TYPE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoClassMapResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_class_map_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_class_map_response_dispose( + GObject* object) { + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoClassMapResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_CLASS_MAP_RESPONSE( + object); + g_clear_pointer(&self->error, fl_value_unref); + g_clear_pointer(&self->return_value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_flutter_integration_core_api_echo_class_map_response_parent_class) + ->dispose(object); } -void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_list( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableListResponse) - response = - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_list_response_new_error( - code, message, details); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "callFlutterEchoNullableList", error->message); - } +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_class_map_response_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoClassMapResponse* self) {} + +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_class_map_response_class_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoClassMapResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_flutter_integration_core_api_echo_class_map_response_dispose; } -void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_map( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - FlValue* return_value) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableMapResponse) - response = - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_map_response_new( - return_value); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "callFlutterEchoNullableMap", error->message); +static CoreTestsPigeonTestFlutterIntegrationCoreApiEchoClassMapResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_class_map_response_new( + FlValue* response) { + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoClassMapResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_CLASS_MAP_RESPONSE( + g_object_new( + core_tests_pigeon_test_flutter_integration_core_api_echo_class_map_response_get_type(), + nullptr)); + if (fl_value_get_length(response) > 1) { + self->error = fl_value_ref(response); + } else { + FlValue* value = fl_value_get_list_value(response, 0); + self->return_value = fl_value_ref(value); } + return self; } -void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_map( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableMapResponse) - response = - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_map_response_new_error( - code, message, details); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "callFlutterEchoNullableMap", error->message); - } +gboolean +core_tests_pigeon_test_flutter_integration_core_api_echo_class_map_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoClassMapResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_CLASS_MAP_RESPONSE( + self), + FALSE); + return self->error != nullptr; } -void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_enum( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - CoreTestsPigeonTestAnEnum* return_value) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableEnumResponse) - response = - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_enum_response_new( - return_value); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "callFlutterEchoNullableEnum", error->message); - } +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_class_map_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoClassMapResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_CLASS_MAP_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_echo_class_map_response_is_error( + self)); + return fl_value_get_string(fl_value_get_list_value(self->error, 0)); } -void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_enum( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableEnumResponse) - response = - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_enum_response_new_error( - code, message, details); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "callFlutterEchoNullableEnum", error->message); - } +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_class_map_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoClassMapResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_CLASS_MAP_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_echo_class_map_response_is_error( + self)); + return fl_value_get_string(fl_value_get_list_value(self->error, 1)); } -void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_another_nullable_enum( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - CoreTestsPigeonTestAnotherEnum* return_value) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAnotherNullableEnumResponse) - response = - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_another_nullable_enum_response_new( - return_value); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "callFlutterEchoAnotherNullableEnum", error->message); - } +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_class_map_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoClassMapResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_CLASS_MAP_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_echo_class_map_response_is_error( + self)); + return fl_value_get_list_value(self->error, 2); } -void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_another_nullable_enum( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAnotherNullableEnumResponse) - response = - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_another_nullable_enum_response_new_error( - code, message, details); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "callFlutterEchoAnotherNullableEnum", error->message); - } +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_class_map_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoClassMapResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_CLASS_MAP_RESPONSE( + self), + nullptr); + g_assert( + !core_tests_pigeon_test_flutter_integration_core_api_echo_class_map_response_is_error( + self)); + return self->return_value; } -void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_small_api_echo_string( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* return_value) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterSmallApiEchoStringResponse) - response = - core_tests_pigeon_test_host_integration_core_api_call_flutter_small_api_echo_string_response_new( - return_value); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "callFlutterSmallApiEchoString", error->message); - } +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_class_map_cb( + GObject* object, GAsyncResult* result, gpointer user_data) { + GTask* task = G_TASK(user_data); + g_task_return_pointer(task, result, g_object_unref); } -void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_small_api_echo_string( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details) { - g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterSmallApiEchoStringResponse) - response = - core_tests_pigeon_test_host_integration_core_api_call_flutter_small_api_echo_string_response_new_error( - code, message, details); - g_autoptr(GError) error = nullptr; - if (!fl_basic_message_channel_respond(response_handle->channel, - response_handle->response_handle, - response->value, &error)) { - g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "callFlutterSmallApiEchoString", error->message); +void core_tests_pigeon_test_flutter_integration_core_api_echo_class_map( + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, FlValue* class_map, + GCancellable* cancellable, GAsyncReadyCallback callback, + gpointer user_data) { + g_autoptr(FlValue) args = fl_value_new_list(); + fl_value_append_take(args, fl_value_ref(class_map)); + g_autofree gchar* channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoClassMap%s", + self->suffix); + g_autoptr(CoreTestsPigeonTestMessageCodec) codec = + core_tests_pigeon_test_message_codec_new(); + FlBasicMessageChannel* channel = fl_basic_message_channel_new( + self->messenger, channel_name, FL_MESSAGE_CODEC(codec)); + GTask* task = g_task_new(self, cancellable, callback, user_data); + g_task_set_task_data(task, channel, g_object_unref); + fl_basic_message_channel_send( + channel, args, cancellable, + core_tests_pigeon_test_flutter_integration_core_api_echo_class_map_cb, + task); +} + +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoClassMapResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_class_map_finish( + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, GAsyncResult* result, + GError** error) { + g_autoptr(GTask) task = G_TASK(result); + GAsyncResult* r = G_ASYNC_RESULT(g_task_propagate_pointer(task, nullptr)); + FlBasicMessageChannel* channel = + FL_BASIC_MESSAGE_CHANNEL(g_task_get_task_data(task)); + g_autoptr(FlValue) response = + fl_basic_message_channel_send_finish(channel, r, error); + if (response == nullptr) { + return nullptr; } + return core_tests_pigeon_test_flutter_integration_core_api_echo_class_map_response_new( + response); } -struct _CoreTestsPigeonTestFlutterIntegrationCoreApi { +struct + _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullStringMapResponse { GObject parent_instance; - FlBinaryMessenger* messenger; - gchar* suffix; + FlValue* error; + FlValue* return_value; }; -G_DEFINE_TYPE(CoreTestsPigeonTestFlutterIntegrationCoreApi, - core_tests_pigeon_test_flutter_integration_core_api, - G_TYPE_OBJECT) +G_DEFINE_TYPE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullStringMapResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_string_map_response, + G_TYPE_OBJECT) -static void core_tests_pigeon_test_flutter_integration_core_api_dispose( +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_string_map_response_dispose( GObject* object) { - CoreTestsPigeonTestFlutterIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API(object); - g_clear_object(&self->messenger); - g_clear_pointer(&self->suffix, g_free); + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullStringMapResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_NON_NULL_STRING_MAP_RESPONSE( + object); + g_clear_pointer(&self->error, fl_value_unref); + g_clear_pointer(&self->return_value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_flutter_integration_core_api_parent_class) + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_string_map_response_parent_class) ->dispose(object); } -static void core_tests_pigeon_test_flutter_integration_core_api_init( - CoreTestsPigeonTestFlutterIntegrationCoreApi* self) {} +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_string_map_response_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullStringMapResponse* + self) {} -static void core_tests_pigeon_test_flutter_integration_core_api_class_init( - CoreTestsPigeonTestFlutterIntegrationCoreApiClass* klass) { +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_string_map_response_class_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullStringMapResponseClass* + klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_flutter_integration_core_api_dispose; + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_string_map_response_dispose; } -CoreTestsPigeonTestFlutterIntegrationCoreApi* -core_tests_pigeon_test_flutter_integration_core_api_new( - FlBinaryMessenger* messenger, const gchar* suffix) { - CoreTestsPigeonTestFlutterIntegrationCoreApi* self = - CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API(g_object_new( - core_tests_pigeon_test_flutter_integration_core_api_get_type(), - nullptr)); - self->messenger = FL_BINARY_MESSENGER(g_object_ref(messenger)); - self->suffix = - suffix != nullptr ? g_strdup_printf(".%s", suffix) : g_strdup(""); +static CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullStringMapResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_string_map_response_new( + FlValue* response) { + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullStringMapResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_NON_NULL_STRING_MAP_RESPONSE( + g_object_new( + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_string_map_response_get_type(), + nullptr)); + if (fl_value_get_length(response) > 1) { + self->error = fl_value_ref(response); + } else { + FlValue* value = fl_value_get_list_value(response, 0); + self->return_value = fl_value_ref(value); + } return self; } -struct _CoreTestsPigeonTestFlutterIntegrationCoreApiNoopResponse { +gboolean +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_string_map_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullStringMapResponse* + self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NON_NULL_STRING_MAP_RESPONSE( + self), + FALSE); + return self->error != nullptr; +} + +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_string_map_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullStringMapResponse* + self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NON_NULL_STRING_MAP_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_string_map_response_is_error( + self)); + return fl_value_get_string(fl_value_get_list_value(self->error, 0)); +} + +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_string_map_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullStringMapResponse* + self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NON_NULL_STRING_MAP_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_string_map_response_is_error( + self)); + return fl_value_get_string(fl_value_get_list_value(self->error, 1)); +} + +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_string_map_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullStringMapResponse* + self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NON_NULL_STRING_MAP_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_string_map_response_is_error( + self)); + return fl_value_get_list_value(self->error, 2); +} + +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_string_map_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullStringMapResponse* + self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NON_NULL_STRING_MAP_RESPONSE( + self), + nullptr); + g_assert( + !core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_string_map_response_is_error( + self)); + return self->return_value; +} + +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_string_map_cb( + GObject* object, GAsyncResult* result, gpointer user_data) { + GTask* task = G_TASK(user_data); + g_task_return_pointer(task, result, g_object_unref); +} + +void core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_string_map( + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, FlValue* string_map, + GCancellable* cancellable, GAsyncReadyCallback callback, + gpointer user_data) { + g_autoptr(FlValue) args = fl_value_new_list(); + fl_value_append_take(args, fl_value_ref(string_map)); + g_autofree gchar* channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoNonNullStringMap%s", + self->suffix); + g_autoptr(CoreTestsPigeonTestMessageCodec) codec = + core_tests_pigeon_test_message_codec_new(); + FlBasicMessageChannel* channel = fl_basic_message_channel_new( + self->messenger, channel_name, FL_MESSAGE_CODEC(codec)); + GTask* task = g_task_new(self, cancellable, callback, user_data); + g_task_set_task_data(task, channel, g_object_unref); + fl_basic_message_channel_send( + channel, args, cancellable, + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_string_map_cb, + task); +} + +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullStringMapResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_string_map_finish( + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, GAsyncResult* result, + GError** error) { + g_autoptr(GTask) task = G_TASK(result); + GAsyncResult* r = G_ASYNC_RESULT(g_task_propagate_pointer(task, nullptr)); + FlBasicMessageChannel* channel = + FL_BASIC_MESSAGE_CHANNEL(g_task_get_task_data(task)); + g_autoptr(FlValue) response = + fl_basic_message_channel_send_finish(channel, r, error); + if (response == nullptr) { + return nullptr; + } + return core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_string_map_response_new( + response); +} + +struct _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullIntMapResponse { GObject parent_instance; FlValue* error; + FlValue* return_value; }; -G_DEFINE_TYPE(CoreTestsPigeonTestFlutterIntegrationCoreApiNoopResponse, - core_tests_pigeon_test_flutter_integration_core_api_noop_response, - G_TYPE_OBJECT) +G_DEFINE_TYPE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullIntMapResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_int_map_response, + G_TYPE_OBJECT) static void -core_tests_pigeon_test_flutter_integration_core_api_noop_response_dispose( +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_int_map_response_dispose( GObject* object) { - CoreTestsPigeonTestFlutterIntegrationCoreApiNoopResponse* self = - CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_NOOP_RESPONSE(object); + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullIntMapResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_NON_NULL_INT_MAP_RESPONSE( + object); g_clear_pointer(&self->error, fl_value_unref); + g_clear_pointer(&self->return_value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_flutter_integration_core_api_noop_response_parent_class) + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_int_map_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_flutter_integration_core_api_noop_response_init( - CoreTestsPigeonTestFlutterIntegrationCoreApiNoopResponse* self) {} +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_int_map_response_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullIntMapResponse* + self) {} static void -core_tests_pigeon_test_flutter_integration_core_api_noop_response_class_init( - CoreTestsPigeonTestFlutterIntegrationCoreApiNoopResponseClass* klass) { +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_int_map_response_class_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullIntMapResponseClass* + klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_flutter_integration_core_api_noop_response_dispose; + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_int_map_response_dispose; } -static CoreTestsPigeonTestFlutterIntegrationCoreApiNoopResponse* -core_tests_pigeon_test_flutter_integration_core_api_noop_response_new( +static CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullIntMapResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_int_map_response_new( FlValue* response) { - CoreTestsPigeonTestFlutterIntegrationCoreApiNoopResponse* self = - CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_NOOP_RESPONSE(g_object_new( - core_tests_pigeon_test_flutter_integration_core_api_noop_response_get_type(), - nullptr)); + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullIntMapResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_NON_NULL_INT_MAP_RESPONSE( + g_object_new( + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_int_map_response_get_type(), + nullptr)); if (fl_value_get_length(response) > 1) { self->error = fl_value_ref(response); + } else { + FlValue* value = fl_value_get_list_value(response, 0); + self->return_value = fl_value_ref(value); } return self; } gboolean -core_tests_pigeon_test_flutter_integration_core_api_noop_response_is_error( - CoreTestsPigeonTestFlutterIntegrationCoreApiNoopResponse* self) { +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_int_map_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullIntMapResponse* + self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_NOOP_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NON_NULL_INT_MAP_RESPONSE( self), FALSE); return self->error != nullptr; } const gchar* -core_tests_pigeon_test_flutter_integration_core_api_noop_response_get_error_code( - CoreTestsPigeonTestFlutterIntegrationCoreApiNoopResponse* self) { +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_int_map_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullIntMapResponse* + self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_NOOP_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NON_NULL_INT_MAP_RESPONSE( self), nullptr); g_assert( - core_tests_pigeon_test_flutter_integration_core_api_noop_response_is_error( + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_int_map_response_is_error( self)); return fl_value_get_string(fl_value_get_list_value(self->error, 0)); } const gchar* -core_tests_pigeon_test_flutter_integration_core_api_noop_response_get_error_message( - CoreTestsPigeonTestFlutterIntegrationCoreApiNoopResponse* self) { +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_int_map_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullIntMapResponse* + self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_NOOP_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NON_NULL_INT_MAP_RESPONSE( self), nullptr); g_assert( - core_tests_pigeon_test_flutter_integration_core_api_noop_response_is_error( + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_int_map_response_is_error( self)); return fl_value_get_string(fl_value_get_list_value(self->error, 1)); } FlValue* -core_tests_pigeon_test_flutter_integration_core_api_noop_response_get_error_details( - CoreTestsPigeonTestFlutterIntegrationCoreApiNoopResponse* self) { +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_int_map_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullIntMapResponse* + self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_NOOP_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NON_NULL_INT_MAP_RESPONSE( self), nullptr); g_assert( - core_tests_pigeon_test_flutter_integration_core_api_noop_response_is_error( + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_int_map_response_is_error( self)); return fl_value_get_list_value(self->error, 2); } -static void core_tests_pigeon_test_flutter_integration_core_api_noop_cb( +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_int_map_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullIntMapResponse* + self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NON_NULL_INT_MAP_RESPONSE( + self), + nullptr); + g_assert( + !core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_int_map_response_is_error( + self)); + return self->return_value; +} + +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_int_map_cb( GObject* object, GAsyncResult* result, gpointer user_data) { GTask* task = G_TASK(user_data); g_task_return_pointer(task, result, g_object_unref); } -void core_tests_pigeon_test_flutter_integration_core_api_noop( - CoreTestsPigeonTestFlutterIntegrationCoreApi* self, +void core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_int_map( + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, FlValue* int_map, GCancellable* cancellable, GAsyncReadyCallback callback, gpointer user_data) { g_autoptr(FlValue) args = fl_value_new_list(); + fl_value_append_take(args, fl_value_ref(int_map)); g_autofree gchar* channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "noop%s", + "echoNonNullIntMap%s", self->suffix); g_autoptr(CoreTestsPigeonTestMessageCodec) codec = core_tests_pigeon_test_message_codec_new(); @@ -15054,11 +28049,12 @@ void core_tests_pigeon_test_flutter_integration_core_api_noop( g_task_set_task_data(task, channel, g_object_unref); fl_basic_message_channel_send( channel, args, cancellable, - core_tests_pigeon_test_flutter_integration_core_api_noop_cb, task); + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_int_map_cb, + task); } -CoreTestsPigeonTestFlutterIntegrationCoreApiNoopResponse* -core_tests_pigeon_test_flutter_integration_core_api_noop_finish( +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullIntMapResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_int_map_finish( CoreTestsPigeonTestFlutterIntegrationCoreApi* self, GAsyncResult* result, GError** error) { g_autoptr(GTask) task = G_TASK(result); @@ -15070,11 +28066,11 @@ core_tests_pigeon_test_flutter_integration_core_api_noop_finish( if (response == nullptr) { return nullptr; } - return core_tests_pigeon_test_flutter_integration_core_api_noop_response_new( + return core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_int_map_response_new( response); } -struct _CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorResponse { +struct _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullEnumMapResponse { GObject parent_instance; FlValue* error; @@ -15082,42 +28078,43 @@ struct _CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorResponse { }; G_DEFINE_TYPE( - CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorResponse, - core_tests_pigeon_test_flutter_integration_core_api_throw_error_response, + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullEnumMapResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_map_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_flutter_integration_core_api_throw_error_response_dispose( +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_map_response_dispose( GObject* object) { - CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorResponse* self = - CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_THROW_ERROR_RESPONSE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullEnumMapResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_NON_NULL_ENUM_MAP_RESPONSE( object); g_clear_pointer(&self->error, fl_value_unref); g_clear_pointer(&self->return_value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_flutter_integration_core_api_throw_error_response_parent_class) + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_map_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_flutter_integration_core_api_throw_error_response_init( - CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorResponse* self) {} +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_map_response_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullEnumMapResponse* + self) {} static void -core_tests_pigeon_test_flutter_integration_core_api_throw_error_response_class_init( - CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorResponseClass* +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_map_response_class_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullEnumMapResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_flutter_integration_core_api_throw_error_response_dispose; + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_map_response_dispose; } -static CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorResponse* -core_tests_pigeon_test_flutter_integration_core_api_throw_error_response_new( +static CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullEnumMapResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_map_response_new( FlValue* response) { - CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorResponse* self = - CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_THROW_ERROR_RESPONSE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullEnumMapResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_NON_NULL_ENUM_MAP_RESPONSE( g_object_new( - core_tests_pigeon_test_flutter_integration_core_api_throw_error_response_get_type(), + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_map_response_get_type(), nullptr)); if (fl_value_get_length(response) > 1) { self->error = fl_value_ref(response); @@ -15129,84 +28126,88 @@ core_tests_pigeon_test_flutter_integration_core_api_throw_error_response_new( } gboolean -core_tests_pigeon_test_flutter_integration_core_api_throw_error_response_is_error( - CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorResponse* self) { +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_map_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullEnumMapResponse* + self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_THROW_ERROR_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NON_NULL_ENUM_MAP_RESPONSE( self), FALSE); return self->error != nullptr; } const gchar* -core_tests_pigeon_test_flutter_integration_core_api_throw_error_response_get_error_code( - CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorResponse* self) { +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_map_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullEnumMapResponse* + self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_THROW_ERROR_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NON_NULL_ENUM_MAP_RESPONSE( self), nullptr); g_assert( - core_tests_pigeon_test_flutter_integration_core_api_throw_error_response_is_error( + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_map_response_is_error( self)); return fl_value_get_string(fl_value_get_list_value(self->error, 0)); } const gchar* -core_tests_pigeon_test_flutter_integration_core_api_throw_error_response_get_error_message( - CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorResponse* self) { +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_map_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullEnumMapResponse* + self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_THROW_ERROR_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NON_NULL_ENUM_MAP_RESPONSE( self), nullptr); g_assert( - core_tests_pigeon_test_flutter_integration_core_api_throw_error_response_is_error( + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_map_response_is_error( self)); return fl_value_get_string(fl_value_get_list_value(self->error, 1)); } FlValue* -core_tests_pigeon_test_flutter_integration_core_api_throw_error_response_get_error_details( - CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorResponse* self) { +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_map_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullEnumMapResponse* + self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_THROW_ERROR_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NON_NULL_ENUM_MAP_RESPONSE( self), nullptr); g_assert( - core_tests_pigeon_test_flutter_integration_core_api_throw_error_response_is_error( + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_map_response_is_error( self)); return fl_value_get_list_value(self->error, 2); } FlValue* -core_tests_pigeon_test_flutter_integration_core_api_throw_error_response_get_return_value( - CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorResponse* self) { +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_map_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullEnumMapResponse* + self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_THROW_ERROR_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NON_NULL_ENUM_MAP_RESPONSE( self), nullptr); g_assert( - !core_tests_pigeon_test_flutter_integration_core_api_throw_error_response_is_error( + !core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_map_response_is_error( self)); - if (fl_value_get_type(self->return_value) == FL_VALUE_TYPE_NULL) { - return nullptr; - } return self->return_value; } -static void core_tests_pigeon_test_flutter_integration_core_api_throw_error_cb( +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_map_cb( GObject* object, GAsyncResult* result, gpointer user_data) { GTask* task = G_TASK(user_data); g_task_return_pointer(task, result, g_object_unref); } -void core_tests_pigeon_test_flutter_integration_core_api_throw_error( - CoreTestsPigeonTestFlutterIntegrationCoreApi* self, +void core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_map( + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, FlValue* enum_map, GCancellable* cancellable, GAsyncReadyCallback callback, gpointer user_data) { g_autoptr(FlValue) args = fl_value_new_list(); + fl_value_append_take(args, fl_value_ref(enum_map)); g_autofree gchar* channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "throwError%s", + "echoNonNullEnumMap%s", self->suffix); g_autoptr(CoreTestsPigeonTestMessageCodec) codec = core_tests_pigeon_test_message_codec_new(); @@ -15216,11 +28217,12 @@ void core_tests_pigeon_test_flutter_integration_core_api_throw_error( g_task_set_task_data(task, channel, g_object_unref); fl_basic_message_channel_send( channel, args, cancellable, - core_tests_pigeon_test_flutter_integration_core_api_throw_error_cb, task); + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_map_cb, + task); } -CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorResponse* -core_tests_pigeon_test_flutter_integration_core_api_throw_error_finish( +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullEnumMapResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_map_finish( CoreTestsPigeonTestFlutterIntegrationCoreApi* self, GAsyncResult* result, GError** error) { g_autoptr(GTask) task = G_TASK(result); @@ -15232,128 +28234,149 @@ core_tests_pigeon_test_flutter_integration_core_api_throw_error_finish( if (response == nullptr) { return nullptr; } - return core_tests_pigeon_test_flutter_integration_core_api_throw_error_response_new( + return core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_map_response_new( response); } -struct _CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorFromVoidResponse { +struct + _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullClassMapResponse { GObject parent_instance; FlValue* error; + FlValue* return_value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorFromVoidResponse, - core_tests_pigeon_test_flutter_integration_core_api_throw_error_from_void_response, + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullClassMapResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_map_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_flutter_integration_core_api_throw_error_from_void_response_dispose( +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_map_response_dispose( GObject* object) { - CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorFromVoidResponse* self = - CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_THROW_ERROR_FROM_VOID_RESPONSE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullClassMapResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_NON_NULL_CLASS_MAP_RESPONSE( object); g_clear_pointer(&self->error, fl_value_unref); + g_clear_pointer(&self->return_value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_flutter_integration_core_api_throw_error_from_void_response_parent_class) + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_map_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_flutter_integration_core_api_throw_error_from_void_response_init( - CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorFromVoidResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_map_response_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullClassMapResponse* self) {} static void -core_tests_pigeon_test_flutter_integration_core_api_throw_error_from_void_response_class_init( - CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorFromVoidResponseClass* +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_map_response_class_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullClassMapResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_flutter_integration_core_api_throw_error_from_void_response_dispose; + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_map_response_dispose; } -static CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorFromVoidResponse* -core_tests_pigeon_test_flutter_integration_core_api_throw_error_from_void_response_new( +static CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullClassMapResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_map_response_new( FlValue* response) { - CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorFromVoidResponse* self = - CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_THROW_ERROR_FROM_VOID_RESPONSE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullClassMapResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_NON_NULL_CLASS_MAP_RESPONSE( g_object_new( - core_tests_pigeon_test_flutter_integration_core_api_throw_error_from_void_response_get_type(), + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_map_response_get_type(), nullptr)); if (fl_value_get_length(response) > 1) { self->error = fl_value_ref(response); + } else { + FlValue* value = fl_value_get_list_value(response, 0); + self->return_value = fl_value_ref(value); } return self; } gboolean -core_tests_pigeon_test_flutter_integration_core_api_throw_error_from_void_response_is_error( - CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorFromVoidResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_map_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullClassMapResponse* self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_THROW_ERROR_FROM_VOID_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NON_NULL_CLASS_MAP_RESPONSE( self), FALSE); return self->error != nullptr; } const gchar* -core_tests_pigeon_test_flutter_integration_core_api_throw_error_from_void_response_get_error_code( - CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorFromVoidResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_map_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullClassMapResponse* self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_THROW_ERROR_FROM_VOID_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NON_NULL_CLASS_MAP_RESPONSE( self), nullptr); g_assert( - core_tests_pigeon_test_flutter_integration_core_api_throw_error_from_void_response_is_error( + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_map_response_is_error( self)); return fl_value_get_string(fl_value_get_list_value(self->error, 0)); } const gchar* -core_tests_pigeon_test_flutter_integration_core_api_throw_error_from_void_response_get_error_message( - CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorFromVoidResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_map_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullClassMapResponse* self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_THROW_ERROR_FROM_VOID_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NON_NULL_CLASS_MAP_RESPONSE( self), nullptr); g_assert( - core_tests_pigeon_test_flutter_integration_core_api_throw_error_from_void_response_is_error( + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_map_response_is_error( self)); return fl_value_get_string(fl_value_get_list_value(self->error, 1)); } FlValue* -core_tests_pigeon_test_flutter_integration_core_api_throw_error_from_void_response_get_error_details( - CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorFromVoidResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_map_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullClassMapResponse* self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_THROW_ERROR_FROM_VOID_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NON_NULL_CLASS_MAP_RESPONSE( self), nullptr); g_assert( - core_tests_pigeon_test_flutter_integration_core_api_throw_error_from_void_response_is_error( + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_map_response_is_error( self)); return fl_value_get_list_value(self->error, 2); } +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_map_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullClassMapResponse* + self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NON_NULL_CLASS_MAP_RESPONSE( + self), + nullptr); + g_assert( + !core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_map_response_is_error( + self)); + return self->return_value; +} + static void -core_tests_pigeon_test_flutter_integration_core_api_throw_error_from_void_cb( +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_map_cb( GObject* object, GAsyncResult* result, gpointer user_data) { GTask* task = G_TASK(user_data); g_task_return_pointer(task, result, g_object_unref); } -void core_tests_pigeon_test_flutter_integration_core_api_throw_error_from_void( - CoreTestsPigeonTestFlutterIntegrationCoreApi* self, +void core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_map( + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, FlValue* class_map, GCancellable* cancellable, GAsyncReadyCallback callback, gpointer user_data) { g_autoptr(FlValue) args = fl_value_new_list(); + fl_value_append_take(args, fl_value_ref(class_map)); g_autofree gchar* channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "throwErrorFromVoid%s", + "echoNonNullClassMap%s", self->suffix); g_autoptr(CoreTestsPigeonTestMessageCodec) codec = core_tests_pigeon_test_message_codec_new(); @@ -15363,12 +28386,12 @@ void core_tests_pigeon_test_flutter_integration_core_api_throw_error_from_void( g_task_set_task_data(task, channel, g_object_unref); fl_basic_message_channel_send( channel, args, cancellable, - core_tests_pigeon_test_flutter_integration_core_api_throw_error_from_void_cb, + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_map_cb, task); } -CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorFromVoidResponse* -core_tests_pigeon_test_flutter_integration_core_api_throw_error_from_void_finish( +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullClassMapResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_map_finish( CoreTestsPigeonTestFlutterIntegrationCoreApi* self, GAsyncResult* result, GError** error) { g_autoptr(GTask) task = G_TASK(result); @@ -15380,11 +28403,11 @@ core_tests_pigeon_test_flutter_integration_core_api_throw_error_from_void_finish if (response == nullptr) { return nullptr; } - return core_tests_pigeon_test_flutter_integration_core_api_throw_error_from_void_response_new( + return core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_map_response_new( response); } -struct _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllTypesResponse { +struct _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumResponse { GObject parent_instance; FlValue* error; @@ -15392,42 +28415,41 @@ struct _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllTypesResponse { }; G_DEFINE_TYPE( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllTypesResponse, - core_tests_pigeon_test_flutter_integration_core_api_echo_all_types_response, + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_enum_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_flutter_integration_core_api_echo_all_types_response_dispose( +core_tests_pigeon_test_flutter_integration_core_api_echo_enum_response_dispose( GObject* object) { - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllTypesResponse* self = - CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_ALL_TYPES_RESPONSE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_ENUM_RESPONSE( object); g_clear_pointer(&self->error, fl_value_unref); g_clear_pointer(&self->return_value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_flutter_integration_core_api_echo_all_types_response_parent_class) + core_tests_pigeon_test_flutter_integration_core_api_echo_enum_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_flutter_integration_core_api_echo_all_types_response_init( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllTypesResponse* self) {} +core_tests_pigeon_test_flutter_integration_core_api_echo_enum_response_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumResponse* self) {} static void -core_tests_pigeon_test_flutter_integration_core_api_echo_all_types_response_class_init( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllTypesResponseClass* - klass) { +core_tests_pigeon_test_flutter_integration_core_api_echo_enum_response_class_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_flutter_integration_core_api_echo_all_types_response_dispose; + core_tests_pigeon_test_flutter_integration_core_api_echo_enum_response_dispose; } -static CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllTypesResponse* -core_tests_pigeon_test_flutter_integration_core_api_echo_all_types_response_new( +static CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_enum_response_new( FlValue* response) { - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllTypesResponse* self = - CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_ALL_TYPES_RESPONSE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_ENUM_RESPONSE( g_object_new( - core_tests_pigeon_test_flutter_integration_core_api_echo_all_types_response_get_type(), + core_tests_pigeon_test_flutter_integration_core_api_echo_enum_response_get_type(), nullptr)); if (fl_value_get_length(response) > 1) { self->error = fl_value_ref(response); @@ -15439,85 +28461,86 @@ core_tests_pigeon_test_flutter_integration_core_api_echo_all_types_response_new( } gboolean -core_tests_pigeon_test_flutter_integration_core_api_echo_all_types_response_is_error( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllTypesResponse* self) { +core_tests_pigeon_test_flutter_integration_core_api_echo_enum_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumResponse* self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_ALL_TYPES_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_ENUM_RESPONSE( self), FALSE); return self->error != nullptr; } const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_all_types_response_get_error_code( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllTypesResponse* self) { +core_tests_pigeon_test_flutter_integration_core_api_echo_enum_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumResponse* self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_ALL_TYPES_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_ENUM_RESPONSE( self), nullptr); g_assert( - core_tests_pigeon_test_flutter_integration_core_api_echo_all_types_response_is_error( + core_tests_pigeon_test_flutter_integration_core_api_echo_enum_response_is_error( self)); return fl_value_get_string(fl_value_get_list_value(self->error, 0)); } const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_all_types_response_get_error_message( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllTypesResponse* self) { +core_tests_pigeon_test_flutter_integration_core_api_echo_enum_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumResponse* self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_ALL_TYPES_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_ENUM_RESPONSE( self), nullptr); g_assert( - core_tests_pigeon_test_flutter_integration_core_api_echo_all_types_response_is_error( + core_tests_pigeon_test_flutter_integration_core_api_echo_enum_response_is_error( self)); return fl_value_get_string(fl_value_get_list_value(self->error, 1)); } FlValue* -core_tests_pigeon_test_flutter_integration_core_api_echo_all_types_response_get_error_details( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllTypesResponse* self) { +core_tests_pigeon_test_flutter_integration_core_api_echo_enum_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumResponse* self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_ALL_TYPES_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_ENUM_RESPONSE( self), nullptr); g_assert( - core_tests_pigeon_test_flutter_integration_core_api_echo_all_types_response_is_error( + core_tests_pigeon_test_flutter_integration_core_api_echo_enum_response_is_error( self)); return fl_value_get_list_value(self->error, 2); } -CoreTestsPigeonTestAllTypes* -core_tests_pigeon_test_flutter_integration_core_api_echo_all_types_response_get_return_value( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllTypesResponse* self) { +CoreTestsPigeonTestAnEnum +core_tests_pigeon_test_flutter_integration_core_api_echo_enum_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumResponse* self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_ALL_TYPES_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_ENUM_RESPONSE( self), - nullptr); + static_cast(0)); g_assert( - !core_tests_pigeon_test_flutter_integration_core_api_echo_all_types_response_is_error( + !core_tests_pigeon_test_flutter_integration_core_api_echo_enum_response_is_error( self)); - return CORE_TESTS_PIGEON_TEST_ALL_TYPES( - fl_value_get_custom_value_object(self->return_value)); + return static_cast( + fl_value_get_int(reinterpret_cast(const_cast( + fl_value_get_custom_value(self->return_value))))); } -static void -core_tests_pigeon_test_flutter_integration_core_api_echo_all_types_cb( +static void core_tests_pigeon_test_flutter_integration_core_api_echo_enum_cb( GObject* object, GAsyncResult* result, gpointer user_data) { GTask* task = G_TASK(user_data); g_task_return_pointer(task, result, g_object_unref); } -void core_tests_pigeon_test_flutter_integration_core_api_echo_all_types( +void core_tests_pigeon_test_flutter_integration_core_api_echo_enum( CoreTestsPigeonTestFlutterIntegrationCoreApi* self, - CoreTestsPigeonTestAllTypes* everything, GCancellable* cancellable, + CoreTestsPigeonTestAnEnum an_enum, GCancellable* cancellable, GAsyncReadyCallback callback, gpointer user_data) { g_autoptr(FlValue) args = fl_value_new_list(); fl_value_append_take(args, - fl_value_new_custom_object(131, G_OBJECT(everything))); + fl_value_new_custom(129, fl_value_new_int(an_enum), + (GDestroyNotify)fl_value_unref)); g_autofree gchar* channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoAllTypes%s", + "echoEnum%s", self->suffix); g_autoptr(CoreTestsPigeonTestMessageCodec) codec = core_tests_pigeon_test_message_codec_new(); @@ -15527,12 +28550,11 @@ void core_tests_pigeon_test_flutter_integration_core_api_echo_all_types( g_task_set_task_data(task, channel, g_object_unref); fl_basic_message_channel_send( channel, args, cancellable, - core_tests_pigeon_test_flutter_integration_core_api_echo_all_types_cb, - task); + core_tests_pigeon_test_flutter_integration_core_api_echo_enum_cb, task); } -CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllTypesResponse* -core_tests_pigeon_test_flutter_integration_core_api_echo_all_types_finish( +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_enum_finish( CoreTestsPigeonTestFlutterIntegrationCoreApi* self, GAsyncResult* result, GError** error) { g_autoptr(GTask) task = G_TASK(result); @@ -15544,12 +28566,11 @@ core_tests_pigeon_test_flutter_integration_core_api_echo_all_types_finish( if (response == nullptr) { return nullptr; } - return core_tests_pigeon_test_flutter_integration_core_api_echo_all_types_response_new( + return core_tests_pigeon_test_flutter_integration_core_api_echo_enum_response_new( response); } -struct - _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesResponse { +struct _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAnotherEnumResponse { GObject parent_instance; FlValue* error; @@ -15557,43 +28578,43 @@ struct }; G_DEFINE_TYPE( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesResponse, - core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_response, + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAnotherEnumResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_response_dispose( +core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_response_dispose( GObject* object) { - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesResponse* self = - CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_ALL_NULLABLE_TYPES_RESPONSE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAnotherEnumResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_ANOTHER_ENUM_RESPONSE( object); g_clear_pointer(&self->error, fl_value_unref); g_clear_pointer(&self->return_value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_response_parent_class) + core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_response_init( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesResponse* - self) {} +core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_response_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAnotherEnumResponse* self) { +} static void -core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_response_class_init( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesResponseClass* +core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_response_class_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAnotherEnumResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_response_dispose; + core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_response_dispose; } -static CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesResponse* -core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_response_new( +static CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAnotherEnumResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_response_new( FlValue* response) { - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesResponse* self = - CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_ALL_NULLABLE_TYPES_RESPONSE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAnotherEnumResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_ANOTHER_ENUM_RESPONSE( g_object_new( - core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_response_get_type(), + core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_response_get_type(), nullptr)); if (fl_value_get_length(response) > 1) { self->error = fl_value_ref(response); @@ -15605,95 +28626,87 @@ core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_resp } gboolean -core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_response_is_error( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesResponse* - self) { +core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAnotherEnumResponse* self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_ALL_NULLABLE_TYPES_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_ANOTHER_ENUM_RESPONSE( self), FALSE); return self->error != nullptr; } const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_response_get_error_code( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesResponse* - self) { +core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAnotherEnumResponse* self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_ALL_NULLABLE_TYPES_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_ANOTHER_ENUM_RESPONSE( self), nullptr); g_assert( - core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_response_is_error( + core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_response_is_error( self)); return fl_value_get_string(fl_value_get_list_value(self->error, 0)); } const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_response_get_error_message( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesResponse* - self) { +core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAnotherEnumResponse* self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_ALL_NULLABLE_TYPES_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_ANOTHER_ENUM_RESPONSE( self), nullptr); g_assert( - core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_response_is_error( + core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_response_is_error( self)); return fl_value_get_string(fl_value_get_list_value(self->error, 1)); } FlValue* -core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_response_get_error_details( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesResponse* - self) { +core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAnotherEnumResponse* self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_ALL_NULLABLE_TYPES_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_ANOTHER_ENUM_RESPONSE( self), nullptr); g_assert( - core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_response_is_error( + core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_response_is_error( self)); return fl_value_get_list_value(self->error, 2); -} - -CoreTestsPigeonTestAllNullableTypes* -core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_response_get_return_value( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesResponse* - self) { +} + +CoreTestsPigeonTestAnotherEnum +core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAnotherEnumResponse* self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_ALL_NULLABLE_TYPES_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_ANOTHER_ENUM_RESPONSE( self), - nullptr); + static_cast(0)); g_assert( - !core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_response_is_error( + !core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_response_is_error( self)); - if (fl_value_get_type(self->return_value) == FL_VALUE_TYPE_NULL) { - return nullptr; - } - return CORE_TESTS_PIGEON_TEST_ALL_NULLABLE_TYPES( - fl_value_get_custom_value_object(self->return_value)); + return static_cast( + fl_value_get_int(reinterpret_cast(const_cast( + fl_value_get_custom_value(self->return_value))))); } static void -core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_cb( +core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_cb( GObject* object, GAsyncResult* result, gpointer user_data) { GTask* task = G_TASK(user_data); g_task_return_pointer(task, result, g_object_unref); } -void core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types( +void core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum( CoreTestsPigeonTestFlutterIntegrationCoreApi* self, - CoreTestsPigeonTestAllNullableTypes* everything, GCancellable* cancellable, + CoreTestsPigeonTestAnotherEnum another_enum, GCancellable* cancellable, GAsyncReadyCallback callback, gpointer user_data) { g_autoptr(FlValue) args = fl_value_new_list(); - fl_value_append_take( - args, everything != nullptr - ? fl_value_new_custom_object(132, G_OBJECT(everything)) - : fl_value_new_null()); + fl_value_append_take(args, + fl_value_new_custom(130, fl_value_new_int(another_enum), + (GDestroyNotify)fl_value_unref)); g_autofree gchar* channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoAllNullableTypes%s", + "echoAnotherEnum%s", self->suffix); g_autoptr(CoreTestsPigeonTestMessageCodec) codec = core_tests_pigeon_test_message_codec_new(); @@ -15703,12 +28716,12 @@ void core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types g_task_set_task_data(task, channel, g_object_unref); fl_basic_message_channel_send( channel, args, cancellable, - core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_cb, + core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_cb, task); } -CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesResponse* -core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_finish( +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAnotherEnumResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_finish( CoreTestsPigeonTestFlutterIntegrationCoreApi* self, GAsyncResult* result, GError** error) { g_autoptr(GTask) task = G_TASK(result); @@ -15720,57 +28733,56 @@ core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_fini if (response == nullptr) { return nullptr; } - return core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_response_new( + return core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_response_new( response); } -struct - _CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesResponse { +struct _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableBoolResponse { GObject parent_instance; FlValue* error; FlValue* return_value; + gboolean return_value_; }; G_DEFINE_TYPE( - CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesResponse, - core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_response, + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableBoolResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_response_dispose( +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_response_dispose( GObject* object) { - CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesResponse* - self = - CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_SEND_MULTIPLE_NULLABLE_TYPES_RESPONSE( - object); + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableBoolResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_BOOL_RESPONSE( + object); g_clear_pointer(&self->error, fl_value_unref); g_clear_pointer(&self->return_value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_response_parent_class) + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_response_init( - CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_response_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableBoolResponse* self) {} static void -core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_response_class_init( - CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesResponseClass* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_response_class_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableBoolResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_response_dispose; + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_response_dispose; } -static CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesResponse* -core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_response_new( +static CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableBoolResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_response_new( FlValue* response) { - CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesResponse* self = - CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_SEND_MULTIPLE_NULLABLE_TYPES_RESPONSE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableBoolResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_BOOL_RESPONSE( g_object_new( - core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_response_get_type(), + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_response_get_type(), nullptr)); if (fl_value_get_length(response) > 1) { self->error = fl_value_ref(response); @@ -15782,98 +28794,93 @@ core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types } gboolean -core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_response_is_error( - CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableBoolResponse* self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_SEND_MULTIPLE_NULLABLE_TYPES_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_BOOL_RESPONSE( self), FALSE); return self->error != nullptr; } const gchar* -core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_response_get_error_code( - CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableBoolResponse* self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_SEND_MULTIPLE_NULLABLE_TYPES_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_BOOL_RESPONSE( self), nullptr); g_assert( - core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_response_is_error( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_response_is_error( self)); return fl_value_get_string(fl_value_get_list_value(self->error, 0)); } const gchar* -core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_response_get_error_message( - CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableBoolResponse* self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_SEND_MULTIPLE_NULLABLE_TYPES_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_BOOL_RESPONSE( self), nullptr); g_assert( - core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_response_is_error( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_response_is_error( self)); return fl_value_get_string(fl_value_get_list_value(self->error, 1)); } FlValue* -core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_response_get_error_details( - CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableBoolResponse* self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_SEND_MULTIPLE_NULLABLE_TYPES_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_BOOL_RESPONSE( self), nullptr); g_assert( - core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_response_is_error( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_response_is_error( self)); return fl_value_get_list_value(self->error, 2); } -CoreTestsPigeonTestAllNullableTypes* -core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_response_get_return_value( - CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesResponse* +gboolean* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableBoolResponse* self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_SEND_MULTIPLE_NULLABLE_TYPES_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_BOOL_RESPONSE( self), nullptr); g_assert( - !core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_response_is_error( + !core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_response_is_error( self)); - return CORE_TESTS_PIGEON_TEST_ALL_NULLABLE_TYPES( - fl_value_get_custom_value_object(self->return_value)); + if (fl_value_get_type(self->return_value) == FL_VALUE_TYPE_NULL) { + return nullptr; + } + self->return_value_ = fl_value_get_bool(self->return_value); + return &self->return_value_; } static void -core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_cb( +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_cb( GObject* object, GAsyncResult* result, gpointer user_data) { GTask* task = G_TASK(user_data); g_task_return_pointer(task, result, g_object_unref); } -void core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types( - CoreTestsPigeonTestFlutterIntegrationCoreApi* self, - gboolean* a_nullable_bool, int64_t* a_nullable_int, - const gchar* a_nullable_string, GCancellable* cancellable, - GAsyncReadyCallback callback, gpointer user_data) { +void core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool( + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, gboolean* a_bool, + GCancellable* cancellable, GAsyncReadyCallback callback, + gpointer user_data) { g_autoptr(FlValue) args = fl_value_new_list(); - fl_value_append_take(args, a_nullable_bool != nullptr - ? fl_value_new_bool(*a_nullable_bool) - : fl_value_new_null()); - fl_value_append_take(args, a_nullable_int != nullptr - ? fl_value_new_int(*a_nullable_int) - : fl_value_new_null()); - fl_value_append_take(args, a_nullable_string != nullptr - ? fl_value_new_string(a_nullable_string) - : fl_value_new_null()); + fl_value_append_take(args, a_bool != nullptr ? fl_value_new_bool(*a_bool) + : fl_value_new_null()); g_autofree gchar* channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "sendMultipleNullableTypes%s", + "echoNullableBool%s", self->suffix); g_autoptr(CoreTestsPigeonTestMessageCodec) codec = core_tests_pigeon_test_message_codec_new(); @@ -15883,12 +28890,12 @@ void core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_ g_task_set_task_data(task, channel, g_object_unref); fl_basic_message_channel_send( channel, args, cancellable, - core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_cb, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_cb, task); } -CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesResponse* -core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_finish( +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableBoolResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_finish( CoreTestsPigeonTestFlutterIntegrationCoreApi* self, GAsyncResult* result, GError** error) { g_autoptr(GTask) task = G_TASK(result); @@ -15900,57 +28907,56 @@ core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types if (response == nullptr) { return nullptr; } - return core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_response_new( + return core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_response_new( response); } -struct - _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponse { +struct _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntResponse { GObject parent_instance; FlValue* error; FlValue* return_value; + int64_t return_value_; }; G_DEFINE_TYPE( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponse, - core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_without_recursion_response, + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_without_recursion_response_dispose( +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_response_dispose( GObject* object) { - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponse* - self = - CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_ALL_NULLABLE_TYPES_WITHOUT_RECURSION_RESPONSE( - object); + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_INT_RESPONSE( + object); g_clear_pointer(&self->error, fl_value_unref); g_clear_pointer(&self->return_value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_without_recursion_response_parent_class) + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_without_recursion_response_init( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponse* - self) {} +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_response_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntResponse* self) { +} static void -core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_without_recursion_response_class_init( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponseClass* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_response_class_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_without_recursion_response_dispose; + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_response_dispose; } -static CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponse* -core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_without_recursion_response_new( +static CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_response_new( FlValue* response) { - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponse* - self = CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_ALL_NULLABLE_TYPES_WITHOUT_RECURSION_RESPONSE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_INT_RESPONSE( g_object_new( - core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_without_recursion_response_get_type(), + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_response_get_type(), nullptr)); if (fl_value_get_length(response) > 1) { self->error = fl_value_ref(response); @@ -15962,96 +28968,88 @@ core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_with } gboolean -core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_without_recursion_response_is_error( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponse* - self) { +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntResponse* self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_ALL_NULLABLE_TYPES_WITHOUT_RECURSION_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_INT_RESPONSE( self), FALSE); return self->error != nullptr; } const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_without_recursion_response_get_error_code( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponse* - self) { +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntResponse* self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_ALL_NULLABLE_TYPES_WITHOUT_RECURSION_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_INT_RESPONSE( self), nullptr); g_assert( - core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_without_recursion_response_is_error( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_response_is_error( self)); return fl_value_get_string(fl_value_get_list_value(self->error, 0)); } const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_without_recursion_response_get_error_message( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponse* - self) { +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntResponse* self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_ALL_NULLABLE_TYPES_WITHOUT_RECURSION_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_INT_RESPONSE( self), nullptr); g_assert( - core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_without_recursion_response_is_error( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_response_is_error( self)); return fl_value_get_string(fl_value_get_list_value(self->error, 1)); } FlValue* -core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_without_recursion_response_get_error_details( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponse* - self) { +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntResponse* self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_ALL_NULLABLE_TYPES_WITHOUT_RECURSION_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_INT_RESPONSE( self), nullptr); g_assert( - core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_without_recursion_response_is_error( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_response_is_error( self)); return fl_value_get_list_value(self->error, 2); } -CoreTestsPigeonTestAllNullableTypesWithoutRecursion* -core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_without_recursion_response_get_return_value( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponse* - self) { +int64_t* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntResponse* self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_ALL_NULLABLE_TYPES_WITHOUT_RECURSION_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_INT_RESPONSE( self), nullptr); g_assert( - !core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_without_recursion_response_is_error( + !core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_response_is_error( self)); if (fl_value_get_type(self->return_value) == FL_VALUE_TYPE_NULL) { return nullptr; } - return CORE_TESTS_PIGEON_TEST_ALL_NULLABLE_TYPES_WITHOUT_RECURSION( - fl_value_get_custom_value_object(self->return_value)); + self->return_value_ = fl_value_get_int(self->return_value); + return &self->return_value_; } static void -core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_without_recursion_cb( +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_cb( GObject* object, GAsyncResult* result, gpointer user_data) { GTask* task = G_TASK(user_data); g_task_return_pointer(task, result, g_object_unref); } -void core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_without_recursion( - CoreTestsPigeonTestFlutterIntegrationCoreApi* self, - CoreTestsPigeonTestAllNullableTypesWithoutRecursion* everything, +void core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int( + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, int64_t* an_int, GCancellable* cancellable, GAsyncReadyCallback callback, gpointer user_data) { g_autoptr(FlValue) args = fl_value_new_list(); - fl_value_append_take( - args, everything != nullptr - ? fl_value_new_custom_object(133, G_OBJECT(everything)) - : fl_value_new_null()); + fl_value_append_take(args, an_int != nullptr ? fl_value_new_int(*an_int) + : fl_value_new_null()); g_autofree gchar* channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoAllNullableTypesWithoutRecursion%s", + "echoNullableInt%s", self->suffix); g_autoptr(CoreTestsPigeonTestMessageCodec) codec = core_tests_pigeon_test_message_codec_new(); @@ -16061,12 +29059,12 @@ void core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types g_task_set_task_data(task, channel, g_object_unref); fl_basic_message_channel_send( channel, args, cancellable, - core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_without_recursion_cb, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_cb, task); } -CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponse* -core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_without_recursion_finish( +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_finish( CoreTestsPigeonTestFlutterIntegrationCoreApi* self, GAsyncResult* result, GError** error) { g_autoptr(GTask) task = G_TASK(result); @@ -16078,57 +29076,56 @@ core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_with if (response == nullptr) { return nullptr; } - return core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_without_recursion_response_new( + return core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_response_new( response); } -struct - _CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponse { +struct _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableDoubleResponse { GObject parent_instance; FlValue* error; FlValue* return_value; + double return_value_; }; G_DEFINE_TYPE( - CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponse, - core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_without_recursion_response, + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableDoubleResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_without_recursion_response_dispose( +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_response_dispose( GObject* object) { - CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponse* - self = - CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_SEND_MULTIPLE_NULLABLE_TYPES_WITHOUT_RECURSION_RESPONSE( - object); + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableDoubleResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_DOUBLE_RESPONSE( + object); g_clear_pointer(&self->error, fl_value_unref); g_clear_pointer(&self->return_value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_without_recursion_response_parent_class) + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_without_recursion_response_init( - CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_response_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableDoubleResponse* self) {} static void -core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_without_recursion_response_class_init( - CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponseClass* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_response_class_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableDoubleResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_without_recursion_response_dispose; + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_response_dispose; } -static CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponse* -core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_without_recursion_response_new( +static CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableDoubleResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_response_new( FlValue* response) { - CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponse* - self = CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_SEND_MULTIPLE_NULLABLE_TYPES_WITHOUT_RECURSION_RESPONSE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableDoubleResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_DOUBLE_RESPONSE( g_object_new( - core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_without_recursion_response_get_type(), + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_response_get_type(), nullptr)); if (fl_value_get_length(response) > 1) { self->error = fl_value_ref(response); @@ -16140,98 +29137,93 @@ core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types } gboolean -core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_without_recursion_response_is_error( - CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableDoubleResponse* self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_SEND_MULTIPLE_NULLABLE_TYPES_WITHOUT_RECURSION_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_DOUBLE_RESPONSE( self), FALSE); return self->error != nullptr; } const gchar* -core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_without_recursion_response_get_error_code( - CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableDoubleResponse* self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_SEND_MULTIPLE_NULLABLE_TYPES_WITHOUT_RECURSION_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_DOUBLE_RESPONSE( self), nullptr); g_assert( - core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_without_recursion_response_is_error( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_response_is_error( self)); return fl_value_get_string(fl_value_get_list_value(self->error, 0)); } const gchar* -core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_without_recursion_response_get_error_message( - CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableDoubleResponse* self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_SEND_MULTIPLE_NULLABLE_TYPES_WITHOUT_RECURSION_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_DOUBLE_RESPONSE( self), nullptr); g_assert( - core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_without_recursion_response_is_error( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_response_is_error( self)); return fl_value_get_string(fl_value_get_list_value(self->error, 1)); } FlValue* -core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_without_recursion_response_get_error_details( - CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableDoubleResponse* self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_SEND_MULTIPLE_NULLABLE_TYPES_WITHOUT_RECURSION_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_DOUBLE_RESPONSE( self), nullptr); g_assert( - core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_without_recursion_response_is_error( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_response_is_error( self)); return fl_value_get_list_value(self->error, 2); } -CoreTestsPigeonTestAllNullableTypesWithoutRecursion* -core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_without_recursion_response_get_return_value( - CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponse* +double* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableDoubleResponse* self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_SEND_MULTIPLE_NULLABLE_TYPES_WITHOUT_RECURSION_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_DOUBLE_RESPONSE( self), nullptr); g_assert( - !core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_without_recursion_response_is_error( + !core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_response_is_error( self)); - return CORE_TESTS_PIGEON_TEST_ALL_NULLABLE_TYPES_WITHOUT_RECURSION( - fl_value_get_custom_value_object(self->return_value)); + if (fl_value_get_type(self->return_value) == FL_VALUE_TYPE_NULL) { + return nullptr; + } + self->return_value_ = fl_value_get_float(self->return_value); + return &self->return_value_; } static void -core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_without_recursion_cb( +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_cb( GObject* object, GAsyncResult* result, gpointer user_data) { GTask* task = G_TASK(user_data); g_task_return_pointer(task, result, g_object_unref); } -void core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_without_recursion( - CoreTestsPigeonTestFlutterIntegrationCoreApi* self, - gboolean* a_nullable_bool, int64_t* a_nullable_int, - const gchar* a_nullable_string, GCancellable* cancellable, - GAsyncReadyCallback callback, gpointer user_data) { +void core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double( + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, double* a_double, + GCancellable* cancellable, GAsyncReadyCallback callback, + gpointer user_data) { g_autoptr(FlValue) args = fl_value_new_list(); - fl_value_append_take(args, a_nullable_bool != nullptr - ? fl_value_new_bool(*a_nullable_bool) - : fl_value_new_null()); - fl_value_append_take(args, a_nullable_int != nullptr - ? fl_value_new_int(*a_nullable_int) - : fl_value_new_null()); - fl_value_append_take(args, a_nullable_string != nullptr - ? fl_value_new_string(a_nullable_string) - : fl_value_new_null()); + fl_value_append_take(args, a_double != nullptr ? fl_value_new_float(*a_double) + : fl_value_new_null()); g_autofree gchar* channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "sendMultipleNullableTypesWithoutRecursion%s", + "echoNullableDouble%s", self->suffix); g_autoptr(CoreTestsPigeonTestMessageCodec) codec = core_tests_pigeon_test_message_codec_new(); @@ -16241,12 +29233,12 @@ void core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_ g_task_set_task_data(task, channel, g_object_unref); fl_basic_message_channel_send( channel, args, cancellable, - core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_without_recursion_cb, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_cb, task); } -CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponse* -core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_without_recursion_finish( +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableDoubleResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_finish( CoreTestsPigeonTestFlutterIntegrationCoreApi* self, GAsyncResult* result, GError** error) { g_autoptr(GTask) task = G_TASK(result); @@ -16258,11 +29250,11 @@ core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types if (response == nullptr) { return nullptr; } - return core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_without_recursion_response_new( + return core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_response_new( response); } -struct _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoBoolResponse { +struct _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringResponse { GObject parent_instance; FlValue* error; @@ -16270,41 +29262,43 @@ struct _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoBoolResponse { }; G_DEFINE_TYPE( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoBoolResponse, - core_tests_pigeon_test_flutter_integration_core_api_echo_bool_response, + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_flutter_integration_core_api_echo_bool_response_dispose( +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_response_dispose( GObject* object) { - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoBoolResponse* self = - CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_BOOL_RESPONSE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_STRING_RESPONSE( object); g_clear_pointer(&self->error, fl_value_unref); g_clear_pointer(&self->return_value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_flutter_integration_core_api_echo_bool_response_parent_class) + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_flutter_integration_core_api_echo_bool_response_init( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoBoolResponse* self) {} +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_response_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringResponse* + self) {} static void -core_tests_pigeon_test_flutter_integration_core_api_echo_bool_response_class_init( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoBoolResponseClass* klass) { +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_response_class_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringResponseClass* + klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_flutter_integration_core_api_echo_bool_response_dispose; + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_response_dispose; } -static CoreTestsPigeonTestFlutterIntegrationCoreApiEchoBoolResponse* -core_tests_pigeon_test_flutter_integration_core_api_echo_bool_response_new( +static CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_response_new( FlValue* response) { - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoBoolResponse* self = - CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_BOOL_RESPONSE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_STRING_RESPONSE( g_object_new( - core_tests_pigeon_test_flutter_integration_core_api_echo_bool_response_get_type(), + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_response_get_type(), nullptr)); if (fl_value_get_length(response) > 1) { self->error = fl_value_ref(response); @@ -16316,82 +29310,92 @@ core_tests_pigeon_test_flutter_integration_core_api_echo_bool_response_new( } gboolean -core_tests_pigeon_test_flutter_integration_core_api_echo_bool_response_is_error( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoBoolResponse* self) { +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringResponse* + self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_BOOL_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_STRING_RESPONSE( self), FALSE); return self->error != nullptr; } const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_bool_response_get_error_code( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoBoolResponse* self) { +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringResponse* + self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_BOOL_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_STRING_RESPONSE( self), nullptr); g_assert( - core_tests_pigeon_test_flutter_integration_core_api_echo_bool_response_is_error( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_response_is_error( self)); return fl_value_get_string(fl_value_get_list_value(self->error, 0)); } const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_bool_response_get_error_message( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoBoolResponse* self) { +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringResponse* + self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_BOOL_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_STRING_RESPONSE( self), nullptr); g_assert( - core_tests_pigeon_test_flutter_integration_core_api_echo_bool_response_is_error( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_response_is_error( self)); return fl_value_get_string(fl_value_get_list_value(self->error, 1)); } FlValue* -core_tests_pigeon_test_flutter_integration_core_api_echo_bool_response_get_error_details( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoBoolResponse* self) { +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringResponse* + self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_BOOL_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_STRING_RESPONSE( self), nullptr); g_assert( - core_tests_pigeon_test_flutter_integration_core_api_echo_bool_response_is_error( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_response_is_error( self)); return fl_value_get_list_value(self->error, 2); } -gboolean -core_tests_pigeon_test_flutter_integration_core_api_echo_bool_response_get_return_value( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoBoolResponse* self) { +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringResponse* + self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_BOOL_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_STRING_RESPONSE( self), - FALSE); + nullptr); g_assert( - !core_tests_pigeon_test_flutter_integration_core_api_echo_bool_response_is_error( + !core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_response_is_error( self)); - return fl_value_get_bool(self->return_value); + if (fl_value_get_type(self->return_value) == FL_VALUE_TYPE_NULL) { + return nullptr; + } + return fl_value_get_string(self->return_value); } -static void core_tests_pigeon_test_flutter_integration_core_api_echo_bool_cb( +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_cb( GObject* object, GAsyncResult* result, gpointer user_data) { GTask* task = G_TASK(user_data); g_task_return_pointer(task, result, g_object_unref); } -void core_tests_pigeon_test_flutter_integration_core_api_echo_bool( - CoreTestsPigeonTestFlutterIntegrationCoreApi* self, gboolean a_bool, +void core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string( + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, const gchar* a_string, GCancellable* cancellable, GAsyncReadyCallback callback, gpointer user_data) { g_autoptr(FlValue) args = fl_value_new_list(); - fl_value_append_take(args, fl_value_new_bool(a_bool)); + fl_value_append_take(args, a_string != nullptr ? fl_value_new_string(a_string) + : fl_value_new_null()); g_autofree gchar* channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoBool%s", + "echoNullableString%s", self->suffix); g_autoptr(CoreTestsPigeonTestMessageCodec) codec = core_tests_pigeon_test_message_codec_new(); @@ -16401,11 +29405,12 @@ void core_tests_pigeon_test_flutter_integration_core_api_echo_bool( g_task_set_task_data(task, channel, g_object_unref); fl_basic_message_channel_send( channel, args, cancellable, - core_tests_pigeon_test_flutter_integration_core_api_echo_bool_cb, task); + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_cb, + task); } -CoreTestsPigeonTestFlutterIntegrationCoreApiEchoBoolResponse* -core_tests_pigeon_test_flutter_integration_core_api_echo_bool_finish( +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_finish( CoreTestsPigeonTestFlutterIntegrationCoreApi* self, GAsyncResult* result, GError** error) { g_autoptr(GTask) task = G_TASK(result); @@ -16417,11 +29422,12 @@ core_tests_pigeon_test_flutter_integration_core_api_echo_bool_finish( if (response == nullptr) { return nullptr; } - return core_tests_pigeon_test_flutter_integration_core_api_echo_bool_response_new( + return core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_response_new( response); } -struct _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntResponse { +struct + _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableUint8ListResponse { GObject parent_instance; FlValue* error; @@ -16429,41 +29435,43 @@ struct _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntResponse { }; G_DEFINE_TYPE( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntResponse, - core_tests_pigeon_test_flutter_integration_core_api_echo_int_response, + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableUint8ListResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_flutter_integration_core_api_echo_int_response_dispose( +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_response_dispose( GObject* object) { - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntResponse* self = - CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_INT_RESPONSE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableUint8ListResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_UINT8_LIST_RESPONSE( object); g_clear_pointer(&self->error, fl_value_unref); g_clear_pointer(&self->return_value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_flutter_integration_core_api_echo_int_response_parent_class) + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_flutter_integration_core_api_echo_int_response_init( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntResponse* self) {} +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_response_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableUint8ListResponse* + self) {} static void -core_tests_pigeon_test_flutter_integration_core_api_echo_int_response_class_init( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntResponseClass* klass) { +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_response_class_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableUint8ListResponseClass* + klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_flutter_integration_core_api_echo_int_response_dispose; + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_response_dispose; } -static CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntResponse* -core_tests_pigeon_test_flutter_integration_core_api_echo_int_response_new( +static CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableUint8ListResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_response_new( FlValue* response) { - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntResponse* self = - CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_INT_RESPONSE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableUint8ListResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_UINT8_LIST_RESPONSE( g_object_new( - core_tests_pigeon_test_flutter_integration_core_api_echo_int_response_get_type(), + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_response_get_type(), nullptr)); if (fl_value_get_length(response) > 1) { self->error = fl_value_ref(response); @@ -16475,82 +29483,97 @@ core_tests_pigeon_test_flutter_integration_core_api_echo_int_response_new( } gboolean -core_tests_pigeon_test_flutter_integration_core_api_echo_int_response_is_error( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntResponse* self) { +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableUint8ListResponse* + self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_INT_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_UINT8_LIST_RESPONSE( self), FALSE); return self->error != nullptr; } const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_int_response_get_error_code( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntResponse* self) { +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableUint8ListResponse* + self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_INT_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_UINT8_LIST_RESPONSE( self), nullptr); g_assert( - core_tests_pigeon_test_flutter_integration_core_api_echo_int_response_is_error( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_response_is_error( self)); return fl_value_get_string(fl_value_get_list_value(self->error, 0)); } const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_int_response_get_error_message( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntResponse* self) { +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableUint8ListResponse* + self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_INT_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_UINT8_LIST_RESPONSE( self), nullptr); g_assert( - core_tests_pigeon_test_flutter_integration_core_api_echo_int_response_is_error( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_response_is_error( self)); return fl_value_get_string(fl_value_get_list_value(self->error, 1)); } FlValue* -core_tests_pigeon_test_flutter_integration_core_api_echo_int_response_get_error_details( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntResponse* self) { +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableUint8ListResponse* + self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_INT_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_UINT8_LIST_RESPONSE( self), nullptr); g_assert( - core_tests_pigeon_test_flutter_integration_core_api_echo_int_response_is_error( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_response_is_error( self)); return fl_value_get_list_value(self->error, 2); } -int64_t -core_tests_pigeon_test_flutter_integration_core_api_echo_int_response_get_return_value( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntResponse* self) { +const uint8_t* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableUint8ListResponse* + self, + size_t* return_value_length) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_INT_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_UINT8_LIST_RESPONSE( self), - 0); + nullptr); g_assert( - !core_tests_pigeon_test_flutter_integration_core_api_echo_int_response_is_error( + !core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_response_is_error( self)); - return fl_value_get_int(self->return_value); + if (fl_value_get_type(self->return_value) == FL_VALUE_TYPE_NULL) { + return nullptr; + } + if (return_value_length != nullptr) { + *return_value_length = fl_value_get_length(self->return_value); + } + return fl_value_get_uint8_list(self->return_value); } -static void core_tests_pigeon_test_flutter_integration_core_api_echo_int_cb( +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_cb( GObject* object, GAsyncResult* result, gpointer user_data) { GTask* task = G_TASK(user_data); g_task_return_pointer(task, result, g_object_unref); } -void core_tests_pigeon_test_flutter_integration_core_api_echo_int( - CoreTestsPigeonTestFlutterIntegrationCoreApi* self, int64_t an_int, - GCancellable* cancellable, GAsyncReadyCallback callback, +void core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list( + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, const uint8_t* list, + size_t list_length, GCancellable* cancellable, GAsyncReadyCallback callback, gpointer user_data) { g_autoptr(FlValue) args = fl_value_new_list(); - fl_value_append_take(args, fl_value_new_int(an_int)); + fl_value_append_take(args, list != nullptr + ? fl_value_new_uint8_list(list, list_length) + : fl_value_new_null()); g_autofree gchar* channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoInt%s", + "echoNullableUint8List%s", self->suffix); g_autoptr(CoreTestsPigeonTestMessageCodec) codec = core_tests_pigeon_test_message_codec_new(); @@ -16560,11 +29583,12 @@ void core_tests_pigeon_test_flutter_integration_core_api_echo_int( g_task_set_task_data(task, channel, g_object_unref); fl_basic_message_channel_send( channel, args, cancellable, - core_tests_pigeon_test_flutter_integration_core_api_echo_int_cb, task); + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_cb, + task); } -CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntResponse* -core_tests_pigeon_test_flutter_integration_core_api_echo_int_finish( +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableUint8ListResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_finish( CoreTestsPigeonTestFlutterIntegrationCoreApi* self, GAsyncResult* result, GError** error) { g_autoptr(GTask) task = G_TASK(result); @@ -16576,11 +29600,11 @@ core_tests_pigeon_test_flutter_integration_core_api_echo_int_finish( if (response == nullptr) { return nullptr; } - return core_tests_pigeon_test_flutter_integration_core_api_echo_int_response_new( + return core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_response_new( response); } -struct _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoDoubleResponse { +struct _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableListResponse { GObject parent_instance; FlValue* error; @@ -16588,42 +29612,43 @@ struct _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoDoubleResponse { }; G_DEFINE_TYPE( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoDoubleResponse, - core_tests_pigeon_test_flutter_integration_core_api_echo_double_response, + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableListResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_flutter_integration_core_api_echo_double_response_dispose( +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_response_dispose( GObject* object) { - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoDoubleResponse* self = - CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_DOUBLE_RESPONSE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableListResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_LIST_RESPONSE( object); g_clear_pointer(&self->error, fl_value_unref); g_clear_pointer(&self->return_value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_flutter_integration_core_api_echo_double_response_parent_class) + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_flutter_integration_core_api_echo_double_response_init( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoDoubleResponse* self) {} +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_response_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableListResponse* + self) {} static void -core_tests_pigeon_test_flutter_integration_core_api_echo_double_response_class_init( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoDoubleResponseClass* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_response_class_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableListResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_flutter_integration_core_api_echo_double_response_dispose; + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_response_dispose; } -static CoreTestsPigeonTestFlutterIntegrationCoreApiEchoDoubleResponse* -core_tests_pigeon_test_flutter_integration_core_api_echo_double_response_new( +static CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableListResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_response_new( FlValue* response) { - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoDoubleResponse* self = - CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_DOUBLE_RESPONSE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableListResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_LIST_RESPONSE( g_object_new( - core_tests_pigeon_test_flutter_integration_core_api_echo_double_response_get_type(), + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_response_get_type(), nullptr)); if (fl_value_get_length(response) > 1) { self->error = fl_value_ref(response); @@ -16635,82 +29660,92 @@ core_tests_pigeon_test_flutter_integration_core_api_echo_double_response_new( } gboolean -core_tests_pigeon_test_flutter_integration_core_api_echo_double_response_is_error( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoDoubleResponse* self) { +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableListResponse* + self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_DOUBLE_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_LIST_RESPONSE( self), FALSE); return self->error != nullptr; } const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_double_response_get_error_code( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoDoubleResponse* self) { +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableListResponse* + self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_DOUBLE_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_LIST_RESPONSE( self), nullptr); g_assert( - core_tests_pigeon_test_flutter_integration_core_api_echo_double_response_is_error( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_response_is_error( self)); return fl_value_get_string(fl_value_get_list_value(self->error, 0)); } const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_double_response_get_error_message( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoDoubleResponse* self) { +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableListResponse* + self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_DOUBLE_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_LIST_RESPONSE( self), nullptr); g_assert( - core_tests_pigeon_test_flutter_integration_core_api_echo_double_response_is_error( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_response_is_error( self)); return fl_value_get_string(fl_value_get_list_value(self->error, 1)); } FlValue* -core_tests_pigeon_test_flutter_integration_core_api_echo_double_response_get_error_details( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoDoubleResponse* self) { +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableListResponse* + self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_DOUBLE_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_LIST_RESPONSE( self), nullptr); g_assert( - core_tests_pigeon_test_flutter_integration_core_api_echo_double_response_is_error( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_response_is_error( self)); return fl_value_get_list_value(self->error, 2); } -double -core_tests_pigeon_test_flutter_integration_core_api_echo_double_response_get_return_value( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoDoubleResponse* self) { +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableListResponse* + self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_DOUBLE_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_LIST_RESPONSE( self), - 0.0); + nullptr); g_assert( - !core_tests_pigeon_test_flutter_integration_core_api_echo_double_response_is_error( + !core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_response_is_error( self)); - return fl_value_get_float(self->return_value); + if (fl_value_get_type(self->return_value) == FL_VALUE_TYPE_NULL) { + return nullptr; + } + return self->return_value; } -static void core_tests_pigeon_test_flutter_integration_core_api_echo_double_cb( +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_cb( GObject* object, GAsyncResult* result, gpointer user_data) { GTask* task = G_TASK(user_data); g_task_return_pointer(task, result, g_object_unref); } -void core_tests_pigeon_test_flutter_integration_core_api_echo_double( - CoreTestsPigeonTestFlutterIntegrationCoreApi* self, double a_double, +void core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list( + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, FlValue* list, GCancellable* cancellable, GAsyncReadyCallback callback, gpointer user_data) { g_autoptr(FlValue) args = fl_value_new_list(); - fl_value_append_take(args, fl_value_new_float(a_double)); + fl_value_append_take( + args, list != nullptr ? fl_value_ref(list) : fl_value_new_null()); g_autofree gchar* channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoDouble%s", + "echoNullableList%s", self->suffix); g_autoptr(CoreTestsPigeonTestMessageCodec) codec = core_tests_pigeon_test_message_codec_new(); @@ -16720,11 +29755,12 @@ void core_tests_pigeon_test_flutter_integration_core_api_echo_double( g_task_set_task_data(task, channel, g_object_unref); fl_basic_message_channel_send( channel, args, cancellable, - core_tests_pigeon_test_flutter_integration_core_api_echo_double_cb, task); + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_cb, + task); } -CoreTestsPigeonTestFlutterIntegrationCoreApiEchoDoubleResponse* -core_tests_pigeon_test_flutter_integration_core_api_echo_double_finish( +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableListResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_finish( CoreTestsPigeonTestFlutterIntegrationCoreApi* self, GAsyncResult* result, GError** error) { g_autoptr(GTask) task = G_TASK(result); @@ -16736,11 +29772,12 @@ core_tests_pigeon_test_flutter_integration_core_api_echo_double_finish( if (response == nullptr) { return nullptr; } - return core_tests_pigeon_test_flutter_integration_core_api_echo_double_response_new( + return core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_response_new( response); } -struct _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringResponse { +struct + _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableEnumListResponse { GObject parent_instance; FlValue* error; @@ -16748,42 +29785,43 @@ struct _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringResponse { }; G_DEFINE_TYPE( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringResponse, - core_tests_pigeon_test_flutter_integration_core_api_echo_string_response, + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableEnumListResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_list_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_flutter_integration_core_api_echo_string_response_dispose( +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_list_response_dispose( GObject* object) { - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringResponse* self = - CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_STRING_RESPONSE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableEnumListResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_ENUM_LIST_RESPONSE( object); g_clear_pointer(&self->error, fl_value_unref); g_clear_pointer(&self->return_value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_flutter_integration_core_api_echo_string_response_parent_class) + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_list_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_flutter_integration_core_api_echo_string_response_init( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringResponse* self) {} +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_list_response_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableEnumListResponse* + self) {} static void -core_tests_pigeon_test_flutter_integration_core_api_echo_string_response_class_init( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringResponseClass* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_list_response_class_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableEnumListResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_flutter_integration_core_api_echo_string_response_dispose; + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_list_response_dispose; } -static CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringResponse* -core_tests_pigeon_test_flutter_integration_core_api_echo_string_response_new( +static CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableEnumListResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_list_response_new( FlValue* response) { - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringResponse* self = - CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_STRING_RESPONSE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableEnumListResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_ENUM_LIST_RESPONSE( g_object_new( - core_tests_pigeon_test_flutter_integration_core_api_echo_string_response_get_type(), + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_list_response_get_type(), nullptr)); if (fl_value_get_length(response) > 1) { self->error = fl_value_ref(response); @@ -16795,82 +29833,92 @@ core_tests_pigeon_test_flutter_integration_core_api_echo_string_response_new( } gboolean -core_tests_pigeon_test_flutter_integration_core_api_echo_string_response_is_error( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringResponse* self) { +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_list_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableEnumListResponse* + self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_STRING_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_ENUM_LIST_RESPONSE( self), FALSE); return self->error != nullptr; } const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_string_response_get_error_code( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringResponse* self) { +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_list_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableEnumListResponse* + self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_STRING_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_ENUM_LIST_RESPONSE( self), nullptr); g_assert( - core_tests_pigeon_test_flutter_integration_core_api_echo_string_response_is_error( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_list_response_is_error( self)); return fl_value_get_string(fl_value_get_list_value(self->error, 0)); } const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_string_response_get_error_message( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringResponse* self) { +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_list_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableEnumListResponse* + self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_STRING_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_ENUM_LIST_RESPONSE( self), nullptr); g_assert( - core_tests_pigeon_test_flutter_integration_core_api_echo_string_response_is_error( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_list_response_is_error( self)); return fl_value_get_string(fl_value_get_list_value(self->error, 1)); } FlValue* -core_tests_pigeon_test_flutter_integration_core_api_echo_string_response_get_error_details( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringResponse* self) { +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_list_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableEnumListResponse* + self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_STRING_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_ENUM_LIST_RESPONSE( self), nullptr); g_assert( - core_tests_pigeon_test_flutter_integration_core_api_echo_string_response_is_error( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_list_response_is_error( self)); return fl_value_get_list_value(self->error, 2); } -const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_string_response_get_return_value( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringResponse* self) { +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_list_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableEnumListResponse* + self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_STRING_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_ENUM_LIST_RESPONSE( self), nullptr); g_assert( - !core_tests_pigeon_test_flutter_integration_core_api_echo_string_response_is_error( + !core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_list_response_is_error( self)); - return fl_value_get_string(self->return_value); + if (fl_value_get_type(self->return_value) == FL_VALUE_TYPE_NULL) { + return nullptr; + } + return self->return_value; } -static void core_tests_pigeon_test_flutter_integration_core_api_echo_string_cb( +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_list_cb( GObject* object, GAsyncResult* result, gpointer user_data) { GTask* task = G_TASK(user_data); g_task_return_pointer(task, result, g_object_unref); } -void core_tests_pigeon_test_flutter_integration_core_api_echo_string( - CoreTestsPigeonTestFlutterIntegrationCoreApi* self, const gchar* a_string, +void core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_list( + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, FlValue* enum_list, GCancellable* cancellable, GAsyncReadyCallback callback, gpointer user_data) { g_autoptr(FlValue) args = fl_value_new_list(); - fl_value_append_take(args, fl_value_new_string(a_string)); + fl_value_append_take(args, enum_list != nullptr ? fl_value_ref(enum_list) + : fl_value_new_null()); g_autofree gchar* channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoString%s", + "echoNullableEnumList%s", self->suffix); g_autoptr(CoreTestsPigeonTestMessageCodec) codec = core_tests_pigeon_test_message_codec_new(); @@ -16880,11 +29928,12 @@ void core_tests_pigeon_test_flutter_integration_core_api_echo_string( g_task_set_task_data(task, channel, g_object_unref); fl_basic_message_channel_send( channel, args, cancellable, - core_tests_pigeon_test_flutter_integration_core_api_echo_string_cb, task); + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_list_cb, + task); } -CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringResponse* -core_tests_pigeon_test_flutter_integration_core_api_echo_string_finish( +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableEnumListResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_list_finish( CoreTestsPigeonTestFlutterIntegrationCoreApi* self, GAsyncResult* result, GError** error) { g_autoptr(GTask) task = G_TASK(result); @@ -16896,11 +29945,12 @@ core_tests_pigeon_test_flutter_integration_core_api_echo_string_finish( if (response == nullptr) { return nullptr; } - return core_tests_pigeon_test_flutter_integration_core_api_echo_string_response_new( + return core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_list_response_new( response); } -struct _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoUint8ListResponse { +struct + _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableClassListResponse { GObject parent_instance; FlValue* error; @@ -16908,42 +29958,43 @@ struct _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoUint8ListResponse { }; G_DEFINE_TYPE( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoUint8ListResponse, - core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list_response, + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableClassListResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_list_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list_response_dispose( +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_list_response_dispose( GObject* object) { - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoUint8ListResponse* self = - CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_UINT8_LIST_RESPONSE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableClassListResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_CLASS_LIST_RESPONSE( object); g_clear_pointer(&self->error, fl_value_unref); g_clear_pointer(&self->return_value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list_response_parent_class) + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_list_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list_response_init( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoUint8ListResponse* self) {} +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_list_response_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableClassListResponse* + self) {} static void -core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list_response_class_init( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoUint8ListResponseClass* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_list_response_class_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableClassListResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list_response_dispose; + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_list_response_dispose; } -static CoreTestsPigeonTestFlutterIntegrationCoreApiEchoUint8ListResponse* -core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list_response_new( +static CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableClassListResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_list_response_new( FlValue* response) { - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoUint8ListResponse* self = - CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_UINT8_LIST_RESPONSE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableClassListResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_CLASS_LIST_RESPONSE( g_object_new( - core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list_response_get_type(), + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_list_response_get_type(), nullptr)); if (fl_value_get_length(response) > 1) { self->error = fl_value_ref(response); @@ -16955,87 +30006,92 @@ core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list_response_new } gboolean -core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list_response_is_error( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoUint8ListResponse* self) { +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_list_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableClassListResponse* + self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_UINT8_LIST_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_CLASS_LIST_RESPONSE( self), FALSE); return self->error != nullptr; } const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list_response_get_error_code( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoUint8ListResponse* self) { +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_list_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableClassListResponse* + self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_UINT8_LIST_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_CLASS_LIST_RESPONSE( self), nullptr); g_assert( - core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list_response_is_error( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_list_response_is_error( self)); return fl_value_get_string(fl_value_get_list_value(self->error, 0)); } const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list_response_get_error_message( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoUint8ListResponse* self) { +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_list_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableClassListResponse* + self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_UINT8_LIST_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_CLASS_LIST_RESPONSE( self), nullptr); g_assert( - core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list_response_is_error( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_list_response_is_error( self)); return fl_value_get_string(fl_value_get_list_value(self->error, 1)); } FlValue* -core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list_response_get_error_details( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoUint8ListResponse* self) { +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_list_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableClassListResponse* + self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_UINT8_LIST_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_CLASS_LIST_RESPONSE( self), nullptr); g_assert( - core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list_response_is_error( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_list_response_is_error( self)); return fl_value_get_list_value(self->error, 2); } -const uint8_t* -core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list_response_get_return_value( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoUint8ListResponse* self, - size_t* return_value_length) { +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_list_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableClassListResponse* + self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_UINT8_LIST_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_CLASS_LIST_RESPONSE( self), nullptr); g_assert( - !core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list_response_is_error( + !core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_list_response_is_error( self)); - if (return_value_length != nullptr) { - *return_value_length = fl_value_get_length(self->return_value); + if (fl_value_get_type(self->return_value) == FL_VALUE_TYPE_NULL) { + return nullptr; } - return fl_value_get_uint8_list(self->return_value); + return self->return_value; } static void -core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list_cb( +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_list_cb( GObject* object, GAsyncResult* result, gpointer user_data) { GTask* task = G_TASK(user_data); g_task_return_pointer(task, result, g_object_unref); } -void core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list( - CoreTestsPigeonTestFlutterIntegrationCoreApi* self, const uint8_t* list, - size_t list_length, GCancellable* cancellable, GAsyncReadyCallback callback, +void core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_list( + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, FlValue* class_list, + GCancellable* cancellable, GAsyncReadyCallback callback, gpointer user_data) { g_autoptr(FlValue) args = fl_value_new_list(); - fl_value_append_take(args, fl_value_new_uint8_list(list, list_length)); + fl_value_append_take(args, class_list != nullptr ? fl_value_ref(class_list) + : fl_value_new_null()); g_autofree gchar* channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoUint8List%s", + "echoNullableClassList%s", self->suffix); g_autoptr(CoreTestsPigeonTestMessageCodec) codec = core_tests_pigeon_test_message_codec_new(); @@ -17045,12 +30101,12 @@ void core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list( g_task_set_task_data(task, channel, g_object_unref); fl_basic_message_channel_send( channel, args, cancellable, - core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list_cb, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_list_cb, task); } -CoreTestsPigeonTestFlutterIntegrationCoreApiEchoUint8ListResponse* -core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list_finish( +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableClassListResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_list_finish( CoreTestsPigeonTestFlutterIntegrationCoreApi* self, GAsyncResult* result, GError** error) { g_autoptr(GTask) task = G_TASK(result); @@ -17062,11 +30118,12 @@ core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list_finish( if (response == nullptr) { return nullptr; } - return core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list_response_new( + return core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_list_response_new( response); } -struct _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoListResponse { +struct + _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullEnumListResponse { GObject parent_instance; FlValue* error; @@ -17074,41 +30131,44 @@ struct _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoListResponse { }; G_DEFINE_TYPE( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoListResponse, - core_tests_pigeon_test_flutter_integration_core_api_echo_list_response, + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullEnumListResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_list_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_flutter_integration_core_api_echo_list_response_dispose( +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_list_response_dispose( GObject* object) { - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoListResponse* self = - CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_LIST_RESPONSE( - object); + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullEnumListResponse* + self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_NON_NULL_ENUM_LIST_RESPONSE( + object); g_clear_pointer(&self->error, fl_value_unref); g_clear_pointer(&self->return_value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_flutter_integration_core_api_echo_list_response_parent_class) + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_list_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_flutter_integration_core_api_echo_list_response_init( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoListResponse* self) {} +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_list_response_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullEnumListResponse* + self) {} static void -core_tests_pigeon_test_flutter_integration_core_api_echo_list_response_class_init( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoListResponseClass* klass) { +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_list_response_class_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullEnumListResponseClass* + klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_flutter_integration_core_api_echo_list_response_dispose; + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_list_response_dispose; } -static CoreTestsPigeonTestFlutterIntegrationCoreApiEchoListResponse* -core_tests_pigeon_test_flutter_integration_core_api_echo_list_response_new( +static CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullEnumListResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_list_response_new( FlValue* response) { - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoListResponse* self = - CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_LIST_RESPONSE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullEnumListResponse* + self = CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_NON_NULL_ENUM_LIST_RESPONSE( g_object_new( - core_tests_pigeon_test_flutter_integration_core_api_echo_list_response_get_type(), + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_list_response_get_type(), nullptr)); if (fl_value_get_length(response) > 1) { self->error = fl_value_ref(response); @@ -17120,82 +30180,92 @@ core_tests_pigeon_test_flutter_integration_core_api_echo_list_response_new( } gboolean -core_tests_pigeon_test_flutter_integration_core_api_echo_list_response_is_error( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoListResponse* self) { +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_list_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullEnumListResponse* + self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_LIST_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_NON_NULL_ENUM_LIST_RESPONSE( self), FALSE); return self->error != nullptr; } const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_list_response_get_error_code( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoListResponse* self) { +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_list_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullEnumListResponse* + self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_LIST_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_NON_NULL_ENUM_LIST_RESPONSE( self), nullptr); g_assert( - core_tests_pigeon_test_flutter_integration_core_api_echo_list_response_is_error( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_list_response_is_error( self)); return fl_value_get_string(fl_value_get_list_value(self->error, 0)); } const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_list_response_get_error_message( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoListResponse* self) { +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_list_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullEnumListResponse* + self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_LIST_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_NON_NULL_ENUM_LIST_RESPONSE( self), nullptr); g_assert( - core_tests_pigeon_test_flutter_integration_core_api_echo_list_response_is_error( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_list_response_is_error( self)); return fl_value_get_string(fl_value_get_list_value(self->error, 1)); } FlValue* -core_tests_pigeon_test_flutter_integration_core_api_echo_list_response_get_error_details( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoListResponse* self) { +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_list_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullEnumListResponse* + self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_LIST_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_NON_NULL_ENUM_LIST_RESPONSE( self), nullptr); g_assert( - core_tests_pigeon_test_flutter_integration_core_api_echo_list_response_is_error( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_list_response_is_error( self)); return fl_value_get_list_value(self->error, 2); } FlValue* -core_tests_pigeon_test_flutter_integration_core_api_echo_list_response_get_return_value( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoListResponse* self) { +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_list_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullEnumListResponse* + self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_LIST_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_NON_NULL_ENUM_LIST_RESPONSE( self), nullptr); g_assert( - !core_tests_pigeon_test_flutter_integration_core_api_echo_list_response_is_error( + !core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_list_response_is_error( self)); + if (fl_value_get_type(self->return_value) == FL_VALUE_TYPE_NULL) { + return nullptr; + } return self->return_value; } -static void core_tests_pigeon_test_flutter_integration_core_api_echo_list_cb( +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_list_cb( GObject* object, GAsyncResult* result, gpointer user_data) { GTask* task = G_TASK(user_data); g_task_return_pointer(task, result, g_object_unref); } -void core_tests_pigeon_test_flutter_integration_core_api_echo_list( - CoreTestsPigeonTestFlutterIntegrationCoreApi* self, FlValue* list, +void core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_list( + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, FlValue* enum_list, GCancellable* cancellable, GAsyncReadyCallback callback, gpointer user_data) { g_autoptr(FlValue) args = fl_value_new_list(); - fl_value_append_take(args, fl_value_ref(list)); + fl_value_append_take(args, enum_list != nullptr ? fl_value_ref(enum_list) + : fl_value_new_null()); g_autofree gchar* channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoList%s", + "echoNullableNonNullEnumList%s", self->suffix); g_autoptr(CoreTestsPigeonTestMessageCodec) codec = core_tests_pigeon_test_message_codec_new(); @@ -17205,11 +30275,12 @@ void core_tests_pigeon_test_flutter_integration_core_api_echo_list( g_task_set_task_data(task, channel, g_object_unref); fl_basic_message_channel_send( channel, args, cancellable, - core_tests_pigeon_test_flutter_integration_core_api_echo_list_cb, task); + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_list_cb, + task); } -CoreTestsPigeonTestFlutterIntegrationCoreApiEchoListResponse* -core_tests_pigeon_test_flutter_integration_core_api_echo_list_finish( +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullEnumListResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_list_finish( CoreTestsPigeonTestFlutterIntegrationCoreApi* self, GAsyncResult* result, GError** error) { g_autoptr(GTask) task = G_TASK(result); @@ -17221,11 +30292,12 @@ core_tests_pigeon_test_flutter_integration_core_api_echo_list_finish( if (response == nullptr) { return nullptr; } - return core_tests_pigeon_test_flutter_integration_core_api_echo_list_response_new( + return core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_list_response_new( response); } -struct _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoMapResponse { +struct + _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullClassListResponse { GObject parent_instance; FlValue* error; @@ -17233,41 +30305,44 @@ struct _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoMapResponse { }; G_DEFINE_TYPE( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoMapResponse, - core_tests_pigeon_test_flutter_integration_core_api_echo_map_response, + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullClassListResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_list_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_flutter_integration_core_api_echo_map_response_dispose( +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_list_response_dispose( GObject* object) { - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoMapResponse* self = - CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_MAP_RESPONSE( - object); + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullClassListResponse* + self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_NON_NULL_CLASS_LIST_RESPONSE( + object); g_clear_pointer(&self->error, fl_value_unref); g_clear_pointer(&self->return_value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_flutter_integration_core_api_echo_map_response_parent_class) + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_list_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_flutter_integration_core_api_echo_map_response_init( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoMapResponse* self) {} +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_list_response_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullClassListResponse* + self) {} static void -core_tests_pigeon_test_flutter_integration_core_api_echo_map_response_class_init( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoMapResponseClass* klass) { +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_list_response_class_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullClassListResponseClass* + klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_flutter_integration_core_api_echo_map_response_dispose; + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_list_response_dispose; } -static CoreTestsPigeonTestFlutterIntegrationCoreApiEchoMapResponse* -core_tests_pigeon_test_flutter_integration_core_api_echo_map_response_new( +static CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullClassListResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_list_response_new( FlValue* response) { - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoMapResponse* self = - CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_MAP_RESPONSE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullClassListResponse* + self = CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_NON_NULL_CLASS_LIST_RESPONSE( g_object_new( - core_tests_pigeon_test_flutter_integration_core_api_echo_map_response_get_type(), + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_list_response_get_type(), nullptr)); if (fl_value_get_length(response) > 1) { self->error = fl_value_ref(response); @@ -17279,82 +30354,92 @@ core_tests_pigeon_test_flutter_integration_core_api_echo_map_response_new( } gboolean -core_tests_pigeon_test_flutter_integration_core_api_echo_map_response_is_error( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoMapResponse* self) { +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_list_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullClassListResponse* + self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_MAP_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_NON_NULL_CLASS_LIST_RESPONSE( self), FALSE); return self->error != nullptr; } const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_map_response_get_error_code( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoMapResponse* self) { +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_list_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullClassListResponse* + self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_MAP_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_NON_NULL_CLASS_LIST_RESPONSE( self), nullptr); g_assert( - core_tests_pigeon_test_flutter_integration_core_api_echo_map_response_is_error( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_list_response_is_error( self)); return fl_value_get_string(fl_value_get_list_value(self->error, 0)); } const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_map_response_get_error_message( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoMapResponse* self) { +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_list_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullClassListResponse* + self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_MAP_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_NON_NULL_CLASS_LIST_RESPONSE( self), nullptr); g_assert( - core_tests_pigeon_test_flutter_integration_core_api_echo_map_response_is_error( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_list_response_is_error( self)); return fl_value_get_string(fl_value_get_list_value(self->error, 1)); } FlValue* -core_tests_pigeon_test_flutter_integration_core_api_echo_map_response_get_error_details( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoMapResponse* self) { +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_list_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullClassListResponse* + self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_MAP_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_NON_NULL_CLASS_LIST_RESPONSE( self), nullptr); g_assert( - core_tests_pigeon_test_flutter_integration_core_api_echo_map_response_is_error( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_list_response_is_error( self)); return fl_value_get_list_value(self->error, 2); } FlValue* -core_tests_pigeon_test_flutter_integration_core_api_echo_map_response_get_return_value( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoMapResponse* self) { +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_list_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullClassListResponse* + self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_MAP_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_NON_NULL_CLASS_LIST_RESPONSE( self), nullptr); g_assert( - !core_tests_pigeon_test_flutter_integration_core_api_echo_map_response_is_error( + !core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_list_response_is_error( self)); + if (fl_value_get_type(self->return_value) == FL_VALUE_TYPE_NULL) { + return nullptr; + } return self->return_value; } -static void core_tests_pigeon_test_flutter_integration_core_api_echo_map_cb( +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_list_cb( GObject* object, GAsyncResult* result, gpointer user_data) { GTask* task = G_TASK(user_data); g_task_return_pointer(task, result, g_object_unref); } -void core_tests_pigeon_test_flutter_integration_core_api_echo_map( - CoreTestsPigeonTestFlutterIntegrationCoreApi* self, FlValue* a_map, +void core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_list( + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, FlValue* class_list, GCancellable* cancellable, GAsyncReadyCallback callback, gpointer user_data) { g_autoptr(FlValue) args = fl_value_new_list(); - fl_value_append_take(args, fl_value_ref(a_map)); + fl_value_append_take(args, class_list != nullptr ? fl_value_ref(class_list) + : fl_value_new_null()); g_autofree gchar* channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoMap%s", + "echoNullableNonNullClassList%s", self->suffix); g_autoptr(CoreTestsPigeonTestMessageCodec) codec = core_tests_pigeon_test_message_codec_new(); @@ -17364,11 +30449,12 @@ void core_tests_pigeon_test_flutter_integration_core_api_echo_map( g_task_set_task_data(task, channel, g_object_unref); fl_basic_message_channel_send( channel, args, cancellable, - core_tests_pigeon_test_flutter_integration_core_api_echo_map_cb, task); + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_list_cb, + task); } -CoreTestsPigeonTestFlutterIntegrationCoreApiEchoMapResponse* -core_tests_pigeon_test_flutter_integration_core_api_echo_map_finish( +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullClassListResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_list_finish( CoreTestsPigeonTestFlutterIntegrationCoreApi* self, GAsyncResult* result, GError** error) { g_autoptr(GTask) task = G_TASK(result); @@ -17380,11 +30466,11 @@ core_tests_pigeon_test_flutter_integration_core_api_echo_map_finish( if (response == nullptr) { return nullptr; } - return core_tests_pigeon_test_flutter_integration_core_api_echo_map_response_new( + return core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_list_response_new( response); } -struct _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumResponse { +struct _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableMapResponse { GObject parent_instance; FlValue* error; @@ -17392,41 +30478,43 @@ struct _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumResponse { }; G_DEFINE_TYPE( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumResponse, - core_tests_pigeon_test_flutter_integration_core_api_echo_enum_response, + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableMapResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_flutter_integration_core_api_echo_enum_response_dispose( +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_response_dispose( GObject* object) { - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumResponse* self = - CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_ENUM_RESPONSE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableMapResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_MAP_RESPONSE( object); g_clear_pointer(&self->error, fl_value_unref); g_clear_pointer(&self->return_value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_flutter_integration_core_api_echo_enum_response_parent_class) + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_flutter_integration_core_api_echo_enum_response_init( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumResponse* self) {} +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_response_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableMapResponse* self) { +} static void -core_tests_pigeon_test_flutter_integration_core_api_echo_enum_response_class_init( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumResponseClass* klass) { +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_response_class_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableMapResponseClass* + klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_flutter_integration_core_api_echo_enum_response_dispose; + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_response_dispose; } -static CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumResponse* -core_tests_pigeon_test_flutter_integration_core_api_echo_enum_response_new( +static CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableMapResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_response_new( FlValue* response) { - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumResponse* self = - CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_ENUM_RESPONSE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableMapResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_MAP_RESPONSE( g_object_new( - core_tests_pigeon_test_flutter_integration_core_api_echo_enum_response_get_type(), + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_response_get_type(), nullptr)); if (fl_value_get_length(response) > 1) { self->error = fl_value_ref(response); @@ -17438,86 +30526,87 @@ core_tests_pigeon_test_flutter_integration_core_api_echo_enum_response_new( } gboolean -core_tests_pigeon_test_flutter_integration_core_api_echo_enum_response_is_error( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumResponse* self) { +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableMapResponse* self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_ENUM_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_MAP_RESPONSE( self), FALSE); return self->error != nullptr; } const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_enum_response_get_error_code( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumResponse* self) { +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableMapResponse* self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_ENUM_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_MAP_RESPONSE( self), nullptr); g_assert( - core_tests_pigeon_test_flutter_integration_core_api_echo_enum_response_is_error( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_response_is_error( self)); return fl_value_get_string(fl_value_get_list_value(self->error, 0)); } const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_enum_response_get_error_message( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumResponse* self) { +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableMapResponse* self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_ENUM_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_MAP_RESPONSE( self), nullptr); g_assert( - core_tests_pigeon_test_flutter_integration_core_api_echo_enum_response_is_error( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_response_is_error( self)); return fl_value_get_string(fl_value_get_list_value(self->error, 1)); } FlValue* -core_tests_pigeon_test_flutter_integration_core_api_echo_enum_response_get_error_details( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumResponse* self) { +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableMapResponse* self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_ENUM_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_MAP_RESPONSE( self), nullptr); g_assert( - core_tests_pigeon_test_flutter_integration_core_api_echo_enum_response_is_error( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_response_is_error( self)); return fl_value_get_list_value(self->error, 2); } -CoreTestsPigeonTestAnEnum -core_tests_pigeon_test_flutter_integration_core_api_echo_enum_response_get_return_value( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumResponse* self) { +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableMapResponse* self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_ENUM_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_MAP_RESPONSE( self), - static_cast(0)); + nullptr); g_assert( - !core_tests_pigeon_test_flutter_integration_core_api_echo_enum_response_is_error( + !core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_response_is_error( self)); - return static_cast( - fl_value_get_int(reinterpret_cast(const_cast( - fl_value_get_custom_value(self->return_value))))); + if (fl_value_get_type(self->return_value) == FL_VALUE_TYPE_NULL) { + return nullptr; + } + return self->return_value; } -static void core_tests_pigeon_test_flutter_integration_core_api_echo_enum_cb( +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_cb( GObject* object, GAsyncResult* result, gpointer user_data) { GTask* task = G_TASK(user_data); g_task_return_pointer(task, result, g_object_unref); } -void core_tests_pigeon_test_flutter_integration_core_api_echo_enum( - CoreTestsPigeonTestFlutterIntegrationCoreApi* self, - CoreTestsPigeonTestAnEnum an_enum, GCancellable* cancellable, - GAsyncReadyCallback callback, gpointer user_data) { +void core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map( + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, FlValue* map, + GCancellable* cancellable, GAsyncReadyCallback callback, + gpointer user_data) { g_autoptr(FlValue) args = fl_value_new_list(); - fl_value_append_take(args, - fl_value_new_custom(129, fl_value_new_int(an_enum), - (GDestroyNotify)fl_value_unref)); + fl_value_append_take( + args, map != nullptr ? fl_value_ref(map) : fl_value_new_null()); g_autofree gchar* channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoEnum%s", + "echoNullableMap%s", self->suffix); g_autoptr(CoreTestsPigeonTestMessageCodec) codec = core_tests_pigeon_test_message_codec_new(); @@ -17527,11 +30616,12 @@ void core_tests_pigeon_test_flutter_integration_core_api_echo_enum( g_task_set_task_data(task, channel, g_object_unref); fl_basic_message_channel_send( channel, args, cancellable, - core_tests_pigeon_test_flutter_integration_core_api_echo_enum_cb, task); + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_cb, + task); } -CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumResponse* -core_tests_pigeon_test_flutter_integration_core_api_echo_enum_finish( +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableMapResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_finish( CoreTestsPigeonTestFlutterIntegrationCoreApi* self, GAsyncResult* result, GError** error) { g_autoptr(GTask) task = G_TASK(result); @@ -17543,11 +30633,12 @@ core_tests_pigeon_test_flutter_integration_core_api_echo_enum_finish( if (response == nullptr) { return nullptr; } - return core_tests_pigeon_test_flutter_integration_core_api_echo_enum_response_new( + return core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_response_new( response); } -struct _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAnotherEnumResponse { +struct + _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringMapResponse { GObject parent_instance; FlValue* error; @@ -17555,43 +30646,43 @@ struct _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAnotherEnumResponse { }; G_DEFINE_TYPE( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAnotherEnumResponse, - core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_response, + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringMapResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_response_dispose( +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_response_dispose( GObject* object) { - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAnotherEnumResponse* self = - CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_ANOTHER_ENUM_RESPONSE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringMapResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_STRING_MAP_RESPONSE( object); g_clear_pointer(&self->error, fl_value_unref); g_clear_pointer(&self->return_value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_response_parent_class) + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_response_init( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAnotherEnumResponse* self) { -} +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_response_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringMapResponse* + self) {} static void -core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_response_class_init( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAnotherEnumResponseClass* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_response_class_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringMapResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_response_dispose; + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_response_dispose; } -static CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAnotherEnumResponse* -core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_response_new( +static CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringMapResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_response_new( FlValue* response) { - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAnotherEnumResponse* self = - CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_ANOTHER_ENUM_RESPONSE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringMapResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_STRING_MAP_RESPONSE( g_object_new( - core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_response_get_type(), + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_response_get_type(), nullptr)); if (fl_value_get_length(response) > 1) { self->error = fl_value_ref(response); @@ -17603,87 +30694,92 @@ core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_response_n } gboolean -core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_response_is_error( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAnotherEnumResponse* self) { +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringMapResponse* + self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_ANOTHER_ENUM_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_STRING_MAP_RESPONSE( self), FALSE); return self->error != nullptr; } const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_response_get_error_code( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAnotherEnumResponse* self) { +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringMapResponse* + self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_ANOTHER_ENUM_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_STRING_MAP_RESPONSE( self), nullptr); g_assert( - core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_response_is_error( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_response_is_error( self)); return fl_value_get_string(fl_value_get_list_value(self->error, 0)); } const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_response_get_error_message( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAnotherEnumResponse* self) { +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringMapResponse* + self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_ANOTHER_ENUM_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_STRING_MAP_RESPONSE( self), nullptr); g_assert( - core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_response_is_error( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_response_is_error( self)); return fl_value_get_string(fl_value_get_list_value(self->error, 1)); } FlValue* -core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_response_get_error_details( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAnotherEnumResponse* self) { +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringMapResponse* + self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_ANOTHER_ENUM_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_STRING_MAP_RESPONSE( self), nullptr); g_assert( - core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_response_is_error( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_response_is_error( self)); return fl_value_get_list_value(self->error, 2); } -CoreTestsPigeonTestAnotherEnum -core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_response_get_return_value( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAnotherEnumResponse* self) { +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringMapResponse* + self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_ANOTHER_ENUM_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_STRING_MAP_RESPONSE( self), - static_cast(0)); + nullptr); g_assert( - !core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_response_is_error( + !core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_response_is_error( self)); - return static_cast( - fl_value_get_int(reinterpret_cast(const_cast( - fl_value_get_custom_value(self->return_value))))); + if (fl_value_get_type(self->return_value) == FL_VALUE_TYPE_NULL) { + return nullptr; + } + return self->return_value; } static void -core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_cb( +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_cb( GObject* object, GAsyncResult* result, gpointer user_data) { GTask* task = G_TASK(user_data); g_task_return_pointer(task, result, g_object_unref); } -void core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum( - CoreTestsPigeonTestFlutterIntegrationCoreApi* self, - CoreTestsPigeonTestAnotherEnum another_enum, GCancellable* cancellable, - GAsyncReadyCallback callback, gpointer user_data) { +void core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map( + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, FlValue* string_map, + GCancellable* cancellable, GAsyncReadyCallback callback, + gpointer user_data) { g_autoptr(FlValue) args = fl_value_new_list(); - fl_value_append_take(args, - fl_value_new_custom(130, fl_value_new_int(another_enum), - (GDestroyNotify)fl_value_unref)); + fl_value_append_take(args, string_map != nullptr ? fl_value_ref(string_map) + : fl_value_new_null()); g_autofree gchar* channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoAnotherEnum%s", + "echoNullableStringMap%s", self->suffix); g_autoptr(CoreTestsPigeonTestMessageCodec) codec = core_tests_pigeon_test_message_codec_new(); @@ -17693,12 +30789,12 @@ void core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum( g_task_set_task_data(task, channel, g_object_unref); fl_basic_message_channel_send( channel, args, cancellable, - core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_cb, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_cb, task); } -CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAnotherEnumResponse* -core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_finish( +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringMapResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_finish( CoreTestsPigeonTestFlutterIntegrationCoreApi* self, GAsyncResult* result, GError** error) { g_autoptr(GTask) task = G_TASK(result); @@ -17710,56 +30806,55 @@ core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_finish( if (response == nullptr) { return nullptr; } - return core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_response_new( + return core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_response_new( response); } -struct _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableBoolResponse { +struct _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntMapResponse { GObject parent_instance; FlValue* error; FlValue* return_value; - gboolean return_value_; }; G_DEFINE_TYPE( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableBoolResponse, - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_response, + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntMapResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_response_dispose( +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_response_dispose( GObject* object) { - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableBoolResponse* self = - CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_BOOL_RESPONSE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntMapResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_INT_MAP_RESPONSE( object); g_clear_pointer(&self->error, fl_value_unref); g_clear_pointer(&self->return_value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_response_parent_class) + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_response_init( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableBoolResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_response_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntMapResponse* self) {} static void -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_response_class_init( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableBoolResponseClass* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_response_class_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntMapResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_response_dispose; + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_response_dispose; } -static CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableBoolResponse* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_response_new( +static CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntMapResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_response_new( FlValue* response) { - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableBoolResponse* self = - CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_BOOL_RESPONSE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntMapResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_INT_MAP_RESPONSE( g_object_new( - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_response_get_type(), + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_response_get_type(), nullptr)); if (fl_value_get_length(response) > 1) { self->error = fl_value_ref(response); @@ -17771,93 +30866,92 @@ core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_response_ } gboolean -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_response_is_error( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableBoolResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntMapResponse* self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_BOOL_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_INT_MAP_RESPONSE( self), FALSE); return self->error != nullptr; } const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_response_get_error_code( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableBoolResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntMapResponse* self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_BOOL_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_INT_MAP_RESPONSE( self), nullptr); g_assert( - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_response_is_error( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_response_is_error( self)); return fl_value_get_string(fl_value_get_list_value(self->error, 0)); } const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_response_get_error_message( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableBoolResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntMapResponse* self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_BOOL_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_INT_MAP_RESPONSE( self), nullptr); g_assert( - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_response_is_error( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_response_is_error( self)); return fl_value_get_string(fl_value_get_list_value(self->error, 1)); } FlValue* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_response_get_error_details( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableBoolResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntMapResponse* self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_BOOL_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_INT_MAP_RESPONSE( self), nullptr); g_assert( - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_response_is_error( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_response_is_error( self)); return fl_value_get_list_value(self->error, 2); } -gboolean* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_response_get_return_value( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableBoolResponse* +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntMapResponse* self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_BOOL_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_INT_MAP_RESPONSE( self), nullptr); g_assert( - !core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_response_is_error( + !core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_response_is_error( self)); if (fl_value_get_type(self->return_value) == FL_VALUE_TYPE_NULL) { return nullptr; } - self->return_value_ = fl_value_get_bool(self->return_value); - return &self->return_value_; + return self->return_value; } static void -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_cb( +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_cb( GObject* object, GAsyncResult* result, gpointer user_data) { GTask* task = G_TASK(user_data); g_task_return_pointer(task, result, g_object_unref); } -void core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool( - CoreTestsPigeonTestFlutterIntegrationCoreApi* self, gboolean* a_bool, +void core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map( + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, FlValue* int_map, GCancellable* cancellable, GAsyncReadyCallback callback, gpointer user_data) { g_autoptr(FlValue) args = fl_value_new_list(); - fl_value_append_take(args, a_bool != nullptr ? fl_value_new_bool(*a_bool) - : fl_value_new_null()); + fl_value_append_take( + args, int_map != nullptr ? fl_value_ref(int_map) : fl_value_new_null()); g_autofree gchar* channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoNullableBool%s", + "echoNullableIntMap%s", self->suffix); g_autoptr(CoreTestsPigeonTestMessageCodec) codec = core_tests_pigeon_test_message_codec_new(); @@ -17867,12 +30961,12 @@ void core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool( g_task_set_task_data(task, channel, g_object_unref); fl_basic_message_channel_send( channel, args, cancellable, - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_cb, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_cb, task); } -CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableBoolResponse* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_finish( +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntMapResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_finish( CoreTestsPigeonTestFlutterIntegrationCoreApi* self, GAsyncResult* result, GError** error) { g_autoptr(GTask) task = G_TASK(result); @@ -17884,56 +30978,56 @@ core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_finish( if (response == nullptr) { return nullptr; } - return core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_response_new( + return core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_response_new( response); } -struct _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntResponse { +struct + _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableEnumMapResponse { GObject parent_instance; FlValue* error; FlValue* return_value; - int64_t return_value_; }; G_DEFINE_TYPE( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntResponse, - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_response, + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableEnumMapResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_map_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_response_dispose( +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_map_response_dispose( GObject* object) { - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntResponse* self = - CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_INT_RESPONSE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableEnumMapResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_ENUM_MAP_RESPONSE( object); g_clear_pointer(&self->error, fl_value_unref); g_clear_pointer(&self->return_value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_response_parent_class) + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_map_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_response_init( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntResponse* self) { -} +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_map_response_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableEnumMapResponse* + self) {} static void -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_response_class_init( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntResponseClass* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_map_response_class_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableEnumMapResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_response_dispose; + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_map_response_dispose; } -static CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntResponse* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_response_new( +static CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableEnumMapResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_map_response_new( FlValue* response) { - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntResponse* self = - CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_INT_RESPONSE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableEnumMapResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_ENUM_MAP_RESPONSE( g_object_new( - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_response_get_type(), + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_map_response_get_type(), nullptr)); if (fl_value_get_length(response) > 1) { self->error = fl_value_ref(response); @@ -17945,88 +31039,92 @@ core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_response_n } gboolean -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_response_is_error( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntResponse* self) { +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_map_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableEnumMapResponse* + self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_INT_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_ENUM_MAP_RESPONSE( self), FALSE); return self->error != nullptr; } const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_response_get_error_code( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntResponse* self) { +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_map_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableEnumMapResponse* + self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_INT_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_ENUM_MAP_RESPONSE( self), nullptr); g_assert( - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_response_is_error( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_map_response_is_error( self)); return fl_value_get_string(fl_value_get_list_value(self->error, 0)); } const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_response_get_error_message( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntResponse* self) { +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_map_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableEnumMapResponse* + self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_INT_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_ENUM_MAP_RESPONSE( self), nullptr); g_assert( - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_response_is_error( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_map_response_is_error( self)); return fl_value_get_string(fl_value_get_list_value(self->error, 1)); } FlValue* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_response_get_error_details( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntResponse* self) { +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_map_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableEnumMapResponse* + self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_INT_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_ENUM_MAP_RESPONSE( self), nullptr); g_assert( - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_response_is_error( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_map_response_is_error( self)); return fl_value_get_list_value(self->error, 2); } -int64_t* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_response_get_return_value( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntResponse* self) { +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_map_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableEnumMapResponse* + self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_INT_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_ENUM_MAP_RESPONSE( self), nullptr); g_assert( - !core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_response_is_error( + !core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_map_response_is_error( self)); if (fl_value_get_type(self->return_value) == FL_VALUE_TYPE_NULL) { return nullptr; } - self->return_value_ = fl_value_get_int(self->return_value); - return &self->return_value_; + return self->return_value; } static void -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_cb( +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_map_cb( GObject* object, GAsyncResult* result, gpointer user_data) { GTask* task = G_TASK(user_data); g_task_return_pointer(task, result, g_object_unref); } -void core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int( - CoreTestsPigeonTestFlutterIntegrationCoreApi* self, int64_t* an_int, +void core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_map( + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, FlValue* enum_map, GCancellable* cancellable, GAsyncReadyCallback callback, gpointer user_data) { g_autoptr(FlValue) args = fl_value_new_list(); - fl_value_append_take(args, an_int != nullptr ? fl_value_new_int(*an_int) - : fl_value_new_null()); + fl_value_append_take( + args, enum_map != nullptr ? fl_value_ref(enum_map) : fl_value_new_null()); g_autofree gchar* channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoNullableInt%s", + "echoNullableEnumMap%s", self->suffix); g_autoptr(CoreTestsPigeonTestMessageCodec) codec = core_tests_pigeon_test_message_codec_new(); @@ -18036,12 +31134,12 @@ void core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int( g_task_set_task_data(task, channel, g_object_unref); fl_basic_message_channel_send( channel, args, cancellable, - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_cb, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_map_cb, task); } -CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntResponse* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_finish( +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableEnumMapResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_map_finish( CoreTestsPigeonTestFlutterIntegrationCoreApi* self, GAsyncResult* result, GError** error) { g_autoptr(GTask) task = G_TASK(result); @@ -18053,56 +31151,56 @@ core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_finish( if (response == nullptr) { return nullptr; } - return core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_response_new( + return core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_map_response_new( response); } -struct _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableDoubleResponse { +struct + _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableClassMapResponse { GObject parent_instance; FlValue* error; FlValue* return_value; - double return_value_; }; G_DEFINE_TYPE( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableDoubleResponse, - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_response, + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableClassMapResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_map_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_response_dispose( +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_map_response_dispose( GObject* object) { - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableDoubleResponse* self = - CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_DOUBLE_RESPONSE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableClassMapResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_CLASS_MAP_RESPONSE( object); g_clear_pointer(&self->error, fl_value_unref); g_clear_pointer(&self->return_value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_response_parent_class) + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_map_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_response_init( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableDoubleResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_map_response_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableClassMapResponse* self) {} static void -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_response_class_init( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableDoubleResponseClass* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_map_response_class_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableClassMapResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_response_dispose; + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_map_response_dispose; } -static CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableDoubleResponse* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_response_new( +static CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableClassMapResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_map_response_new( FlValue* response) { - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableDoubleResponse* self = - CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_DOUBLE_RESPONSE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableClassMapResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_CLASS_MAP_RESPONSE( g_object_new( - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_response_get_type(), + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_map_response_get_type(), nullptr)); if (fl_value_get_length(response) > 1) { self->error = fl_value_ref(response); @@ -18114,93 +31212,92 @@ core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_respons } gboolean -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_response_is_error( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableDoubleResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_map_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableClassMapResponse* self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_DOUBLE_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_CLASS_MAP_RESPONSE( self), FALSE); return self->error != nullptr; } const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_response_get_error_code( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableDoubleResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_map_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableClassMapResponse* self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_DOUBLE_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_CLASS_MAP_RESPONSE( self), nullptr); g_assert( - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_response_is_error( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_map_response_is_error( self)); return fl_value_get_string(fl_value_get_list_value(self->error, 0)); } const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_response_get_error_message( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableDoubleResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_map_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableClassMapResponse* self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_DOUBLE_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_CLASS_MAP_RESPONSE( self), nullptr); g_assert( - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_response_is_error( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_map_response_is_error( self)); return fl_value_get_string(fl_value_get_list_value(self->error, 1)); } FlValue* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_response_get_error_details( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableDoubleResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_map_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableClassMapResponse* self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_DOUBLE_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_CLASS_MAP_RESPONSE( self), nullptr); g_assert( - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_response_is_error( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_map_response_is_error( self)); return fl_value_get_list_value(self->error, 2); } -double* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_response_get_return_value( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableDoubleResponse* +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_map_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableClassMapResponse* self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_DOUBLE_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_CLASS_MAP_RESPONSE( self), nullptr); g_assert( - !core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_response_is_error( + !core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_map_response_is_error( self)); if (fl_value_get_type(self->return_value) == FL_VALUE_TYPE_NULL) { return nullptr; } - self->return_value_ = fl_value_get_float(self->return_value); - return &self->return_value_; + return self->return_value; } static void -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_cb( +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_map_cb( GObject* object, GAsyncResult* result, gpointer user_data) { GTask* task = G_TASK(user_data); g_task_return_pointer(task, result, g_object_unref); } -void core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double( - CoreTestsPigeonTestFlutterIntegrationCoreApi* self, double* a_double, +void core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_map( + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, FlValue* class_map, GCancellable* cancellable, GAsyncReadyCallback callback, gpointer user_data) { g_autoptr(FlValue) args = fl_value_new_list(); - fl_value_append_take(args, a_double != nullptr ? fl_value_new_float(*a_double) - : fl_value_new_null()); + fl_value_append_take(args, class_map != nullptr ? fl_value_ref(class_map) + : fl_value_new_null()); g_autofree gchar* channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoNullableDouble%s", + "echoNullableClassMap%s", self->suffix); g_autoptr(CoreTestsPigeonTestMessageCodec) codec = core_tests_pigeon_test_message_codec_new(); @@ -18210,12 +31307,12 @@ void core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double( g_task_set_task_data(task, channel, g_object_unref); fl_basic_message_channel_send( channel, args, cancellable, - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_cb, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_map_cb, task); } -CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableDoubleResponse* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_finish( +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableClassMapResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_map_finish( CoreTestsPigeonTestFlutterIntegrationCoreApi* self, GAsyncResult* result, GError** error) { g_autoptr(GTask) task = G_TASK(result); @@ -18227,11 +31324,12 @@ core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_finish( if (response == nullptr) { return nullptr; } - return core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_response_new( + return core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_map_response_new( response); } -struct _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringResponse { +struct + _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullStringMapResponse { GObject parent_instance; FlValue* error; @@ -18239,43 +31337,44 @@ struct _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringResponse { }; G_DEFINE_TYPE( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringResponse, - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_response, + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullStringMapResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_string_map_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_response_dispose( +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_string_map_response_dispose( GObject* object) { - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringResponse* self = - CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_STRING_RESPONSE( - object); + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullStringMapResponse* + self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_NON_NULL_STRING_MAP_RESPONSE( + object); g_clear_pointer(&self->error, fl_value_unref); g_clear_pointer(&self->return_value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_response_parent_class) + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_string_map_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_response_init( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_string_map_response_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullStringMapResponse* self) {} static void -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_response_class_init( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringResponseClass* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_string_map_response_class_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullStringMapResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_response_dispose; + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_string_map_response_dispose; } -static CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringResponse* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_response_new( +static CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullStringMapResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_string_map_response_new( FlValue* response) { - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringResponse* self = - CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_STRING_RESPONSE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullStringMapResponse* + self = CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_NON_NULL_STRING_MAP_RESPONSE( g_object_new( - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_response_get_type(), + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_string_map_response_get_type(), nullptr)); if (fl_value_get_length(response) > 1) { self->error = fl_value_ref(response); @@ -18287,92 +31386,92 @@ core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_respons } gboolean -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_response_is_error( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_string_map_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullStringMapResponse* self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_STRING_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_NON_NULL_STRING_MAP_RESPONSE( self), FALSE); return self->error != nullptr; } const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_response_get_error_code( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_string_map_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullStringMapResponse* self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_STRING_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_NON_NULL_STRING_MAP_RESPONSE( self), nullptr); g_assert( - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_response_is_error( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_string_map_response_is_error( self)); return fl_value_get_string(fl_value_get_list_value(self->error, 0)); } const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_response_get_error_message( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_string_map_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullStringMapResponse* self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_STRING_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_NON_NULL_STRING_MAP_RESPONSE( self), nullptr); g_assert( - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_response_is_error( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_string_map_response_is_error( self)); return fl_value_get_string(fl_value_get_list_value(self->error, 1)); } FlValue* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_response_get_error_details( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_string_map_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullStringMapResponse* self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_STRING_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_NON_NULL_STRING_MAP_RESPONSE( self), nullptr); g_assert( - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_response_is_error( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_string_map_response_is_error( self)); return fl_value_get_list_value(self->error, 2); } -const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_response_get_return_value( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringResponse* +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_string_map_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullStringMapResponse* self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_STRING_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_NON_NULL_STRING_MAP_RESPONSE( self), nullptr); g_assert( - !core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_response_is_error( + !core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_string_map_response_is_error( self)); if (fl_value_get_type(self->return_value) == FL_VALUE_TYPE_NULL) { return nullptr; } - return fl_value_get_string(self->return_value); + return self->return_value; } static void -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_cb( +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_string_map_cb( GObject* object, GAsyncResult* result, gpointer user_data) { GTask* task = G_TASK(user_data); g_task_return_pointer(task, result, g_object_unref); } -void core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string( - CoreTestsPigeonTestFlutterIntegrationCoreApi* self, const gchar* a_string, +void core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_string_map( + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, FlValue* string_map, GCancellable* cancellable, GAsyncReadyCallback callback, gpointer user_data) { g_autoptr(FlValue) args = fl_value_new_list(); - fl_value_append_take(args, a_string != nullptr ? fl_value_new_string(a_string) - : fl_value_new_null()); + fl_value_append_take(args, string_map != nullptr ? fl_value_ref(string_map) + : fl_value_new_null()); g_autofree gchar* channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoNullableString%s", + "echoNullableNonNullStringMap%s", self->suffix); g_autoptr(CoreTestsPigeonTestMessageCodec) codec = core_tests_pigeon_test_message_codec_new(); @@ -18382,12 +31481,12 @@ void core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string( g_task_set_task_data(task, channel, g_object_unref); fl_basic_message_channel_send( channel, args, cancellable, - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_cb, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_string_map_cb, task); } -CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringResponse* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_finish( +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullStringMapResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_string_map_finish( CoreTestsPigeonTestFlutterIntegrationCoreApi* self, GAsyncResult* result, GError** error) { g_autoptr(GTask) task = G_TASK(result); @@ -18399,12 +31498,12 @@ core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_finish( if (response == nullptr) { return nullptr; } - return core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_response_new( + return core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_string_map_response_new( response); } struct - _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableUint8ListResponse { + _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullIntMapResponse { GObject parent_instance; FlValue* error; @@ -18412,43 +31511,44 @@ struct }; G_DEFINE_TYPE( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableUint8ListResponse, - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_response, + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullIntMapResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_int_map_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_response_dispose( +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_int_map_response_dispose( GObject* object) { - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableUint8ListResponse* self = - CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_UINT8_LIST_RESPONSE( - object); + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullIntMapResponse* + self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_NON_NULL_INT_MAP_RESPONSE( + object); g_clear_pointer(&self->error, fl_value_unref); g_clear_pointer(&self->return_value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_response_parent_class) + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_int_map_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_response_init( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableUint8ListResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_int_map_response_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullIntMapResponse* self) {} static void -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_response_class_init( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableUint8ListResponseClass* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_int_map_response_class_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullIntMapResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_response_dispose; + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_int_map_response_dispose; } -static CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableUint8ListResponse* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_response_new( +static CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullIntMapResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_int_map_response_new( FlValue* response) { - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableUint8ListResponse* self = - CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_UINT8_LIST_RESPONSE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullIntMapResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_NON_NULL_INT_MAP_RESPONSE( g_object_new( - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_response_get_type(), + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_int_map_response_get_type(), nullptr)); if (fl_value_get_length(response) > 1) { self->error = fl_value_ref(response); @@ -18460,97 +31560,92 @@ core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_res } gboolean -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_response_is_error( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableUint8ListResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_int_map_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullIntMapResponse* self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_UINT8_LIST_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_NON_NULL_INT_MAP_RESPONSE( self), FALSE); return self->error != nullptr; } const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_response_get_error_code( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableUint8ListResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_int_map_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullIntMapResponse* self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_UINT8_LIST_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_NON_NULL_INT_MAP_RESPONSE( self), nullptr); g_assert( - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_response_is_error( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_int_map_response_is_error( self)); return fl_value_get_string(fl_value_get_list_value(self->error, 0)); } const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_response_get_error_message( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableUint8ListResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_int_map_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullIntMapResponse* self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_UINT8_LIST_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_NON_NULL_INT_MAP_RESPONSE( self), nullptr); g_assert( - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_response_is_error( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_int_map_response_is_error( self)); return fl_value_get_string(fl_value_get_list_value(self->error, 1)); } FlValue* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_response_get_error_details( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableUint8ListResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_int_map_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullIntMapResponse* self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_UINT8_LIST_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_NON_NULL_INT_MAP_RESPONSE( self), nullptr); g_assert( - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_response_is_error( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_int_map_response_is_error( self)); return fl_value_get_list_value(self->error, 2); } -const uint8_t* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_response_get_return_value( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableUint8ListResponse* - self, - size_t* return_value_length) { +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_int_map_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullIntMapResponse* + self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_UINT8_LIST_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_NON_NULL_INT_MAP_RESPONSE( self), nullptr); g_assert( - !core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_response_is_error( + !core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_int_map_response_is_error( self)); if (fl_value_get_type(self->return_value) == FL_VALUE_TYPE_NULL) { return nullptr; } - if (return_value_length != nullptr) { - *return_value_length = fl_value_get_length(self->return_value); - } - return fl_value_get_uint8_list(self->return_value); + return self->return_value; } static void -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_cb( +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_int_map_cb( GObject* object, GAsyncResult* result, gpointer user_data) { GTask* task = G_TASK(user_data); g_task_return_pointer(task, result, g_object_unref); } -void core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list( - CoreTestsPigeonTestFlutterIntegrationCoreApi* self, const uint8_t* list, - size_t list_length, GCancellable* cancellable, GAsyncReadyCallback callback, +void core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_int_map( + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, FlValue* int_map, + GCancellable* cancellable, GAsyncReadyCallback callback, gpointer user_data) { g_autoptr(FlValue) args = fl_value_new_list(); - fl_value_append_take(args, list != nullptr - ? fl_value_new_uint8_list(list, list_length) - : fl_value_new_null()); + fl_value_append_take( + args, int_map != nullptr ? fl_value_ref(int_map) : fl_value_new_null()); g_autofree gchar* channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoNullableUint8List%s", + "echoNullableNonNullIntMap%s", self->suffix); g_autoptr(CoreTestsPigeonTestMessageCodec) codec = core_tests_pigeon_test_message_codec_new(); @@ -18560,12 +31655,12 @@ void core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_lis g_task_set_task_data(task, channel, g_object_unref); fl_basic_message_channel_send( channel, args, cancellable, - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_cb, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_int_map_cb, task); } -CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableUint8ListResponse* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_finish( +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullIntMapResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_int_map_finish( CoreTestsPigeonTestFlutterIntegrationCoreApi* self, GAsyncResult* result, GError** error) { g_autoptr(GTask) task = G_TASK(result); @@ -18577,11 +31672,12 @@ core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_fin if (response == nullptr) { return nullptr; } - return core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_response_new( + return core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_int_map_response_new( response); } -struct _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableListResponse { +struct + _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullEnumMapResponse { GObject parent_instance; FlValue* error; @@ -18589,43 +31685,44 @@ struct _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableListResponse { }; G_DEFINE_TYPE( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableListResponse, - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_response, + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullEnumMapResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_map_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_response_dispose( +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_map_response_dispose( GObject* object) { - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableListResponse* self = - CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_LIST_RESPONSE( - object); + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullEnumMapResponse* + self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_NON_NULL_ENUM_MAP_RESPONSE( + object); g_clear_pointer(&self->error, fl_value_unref); g_clear_pointer(&self->return_value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_response_parent_class) + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_map_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_response_init( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableListResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_map_response_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullEnumMapResponse* self) {} static void -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_response_class_init( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableListResponseClass* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_map_response_class_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullEnumMapResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_response_dispose; + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_map_response_dispose; } -static CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableListResponse* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_response_new( +static CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullEnumMapResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_map_response_new( FlValue* response) { - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableListResponse* self = - CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_LIST_RESPONSE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullEnumMapResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_NON_NULL_ENUM_MAP_RESPONSE( g_object_new( - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_response_get_type(), + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_map_response_get_type(), nullptr)); if (fl_value_get_length(response) > 1) { self->error = fl_value_ref(response); @@ -18637,68 +31734,68 @@ core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_response_ } gboolean -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_response_is_error( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableListResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_map_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullEnumMapResponse* self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_LIST_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_NON_NULL_ENUM_MAP_RESPONSE( self), FALSE); return self->error != nullptr; } const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_response_get_error_code( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableListResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_map_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullEnumMapResponse* self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_LIST_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_NON_NULL_ENUM_MAP_RESPONSE( self), nullptr); g_assert( - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_response_is_error( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_map_response_is_error( self)); return fl_value_get_string(fl_value_get_list_value(self->error, 0)); } const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_response_get_error_message( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableListResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_map_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullEnumMapResponse* self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_LIST_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_NON_NULL_ENUM_MAP_RESPONSE( self), nullptr); g_assert( - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_response_is_error( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_map_response_is_error( self)); return fl_value_get_string(fl_value_get_list_value(self->error, 1)); } FlValue* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_response_get_error_details( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableListResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_map_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullEnumMapResponse* self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_LIST_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_NON_NULL_ENUM_MAP_RESPONSE( self), nullptr); g_assert( - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_response_is_error( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_map_response_is_error( self)); return fl_value_get_list_value(self->error, 2); } FlValue* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_response_get_return_value( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableListResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_map_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullEnumMapResponse* self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_LIST_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_NON_NULL_ENUM_MAP_RESPONSE( self), nullptr); g_assert( - !core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_response_is_error( + !core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_map_response_is_error( self)); if (fl_value_get_type(self->return_value) == FL_VALUE_TYPE_NULL) { return nullptr; @@ -18707,22 +31804,22 @@ core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_response_ } static void -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_cb( +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_map_cb( GObject* object, GAsyncResult* result, gpointer user_data) { GTask* task = G_TASK(user_data); g_task_return_pointer(task, result, g_object_unref); } -void core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list( - CoreTestsPigeonTestFlutterIntegrationCoreApi* self, FlValue* list, +void core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_map( + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, FlValue* enum_map, GCancellable* cancellable, GAsyncReadyCallback callback, gpointer user_data) { g_autoptr(FlValue) args = fl_value_new_list(); fl_value_append_take( - args, list != nullptr ? fl_value_ref(list) : fl_value_new_null()); + args, enum_map != nullptr ? fl_value_ref(enum_map) : fl_value_new_null()); g_autofree gchar* channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoNullableList%s", + "echoNullableNonNullEnumMap%s", self->suffix); g_autoptr(CoreTestsPigeonTestMessageCodec) codec = core_tests_pigeon_test_message_codec_new(); @@ -18732,12 +31829,12 @@ void core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list( g_task_set_task_data(task, channel, g_object_unref); fl_basic_message_channel_send( channel, args, cancellable, - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_cb, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_map_cb, task); } -CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableListResponse* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_finish( +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullEnumMapResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_map_finish( CoreTestsPigeonTestFlutterIntegrationCoreApi* self, GAsyncResult* result, GError** error) { g_autoptr(GTask) task = G_TASK(result); @@ -18749,11 +31846,12 @@ core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_finish( if (response == nullptr) { return nullptr; } - return core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_response_new( + return core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_map_response_new( response); } -struct _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableMapResponse { +struct + _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullClassMapResponse { GObject parent_instance; FlValue* error; @@ -18761,43 +31859,44 @@ struct _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableMapResponse { }; G_DEFINE_TYPE( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableMapResponse, - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_response, + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullClassMapResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_map_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_response_dispose( +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_map_response_dispose( GObject* object) { - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableMapResponse* self = - CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_MAP_RESPONSE( - object); + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullClassMapResponse* + self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_NON_NULL_CLASS_MAP_RESPONSE( + object); g_clear_pointer(&self->error, fl_value_unref); g_clear_pointer(&self->return_value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_response_parent_class) + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_map_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_response_init( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableMapResponse* self) { -} +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_map_response_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullClassMapResponse* + self) {} static void -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_response_class_init( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableMapResponseClass* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_map_response_class_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullClassMapResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_response_dispose; + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_map_response_dispose; } -static CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableMapResponse* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_response_new( +static CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullClassMapResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_map_response_new( FlValue* response) { - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableMapResponse* self = - CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_MAP_RESPONSE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullClassMapResponse* + self = CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_NON_NULL_CLASS_MAP_RESPONSE( g_object_new( - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_response_get_type(), + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_map_response_get_type(), nullptr)); if (fl_value_get_length(response) > 1) { self->error = fl_value_ref(response); @@ -18809,63 +31908,68 @@ core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_response_n } gboolean -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_response_is_error( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableMapResponse* self) { +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_map_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullClassMapResponse* + self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_MAP_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_NON_NULL_CLASS_MAP_RESPONSE( self), FALSE); return self->error != nullptr; } const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_response_get_error_code( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableMapResponse* self) { +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_map_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullClassMapResponse* + self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_MAP_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_NON_NULL_CLASS_MAP_RESPONSE( self), nullptr); g_assert( - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_response_is_error( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_map_response_is_error( self)); return fl_value_get_string(fl_value_get_list_value(self->error, 0)); } const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_response_get_error_message( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableMapResponse* self) { +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_map_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullClassMapResponse* + self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_MAP_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_NON_NULL_CLASS_MAP_RESPONSE( self), nullptr); g_assert( - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_response_is_error( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_map_response_is_error( self)); return fl_value_get_string(fl_value_get_list_value(self->error, 1)); } FlValue* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_response_get_error_details( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableMapResponse* self) { +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_map_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullClassMapResponse* + self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_MAP_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_NON_NULL_CLASS_MAP_RESPONSE( self), nullptr); g_assert( - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_response_is_error( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_map_response_is_error( self)); return fl_value_get_list_value(self->error, 2); } FlValue* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_response_get_return_value( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableMapResponse* self) { +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_map_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullClassMapResponse* + self) { g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_MAP_RESPONSE( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_NON_NULL_CLASS_MAP_RESPONSE( self), nullptr); g_assert( - !core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_response_is_error( + !core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_map_response_is_error( self)); if (fl_value_get_type(self->return_value) == FL_VALUE_TYPE_NULL) { return nullptr; @@ -18874,22 +31978,22 @@ core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_response_g } static void -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_cb( +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_map_cb( GObject* object, GAsyncResult* result, gpointer user_data) { GTask* task = G_TASK(user_data); g_task_return_pointer(task, result, g_object_unref); } -void core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map( - CoreTestsPigeonTestFlutterIntegrationCoreApi* self, FlValue* a_map, +void core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_map( + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, FlValue* class_map, GCancellable* cancellable, GAsyncReadyCallback callback, gpointer user_data) { g_autoptr(FlValue) args = fl_value_new_list(); - fl_value_append_take( - args, a_map != nullptr ? fl_value_ref(a_map) : fl_value_new_null()); + fl_value_append_take(args, class_map != nullptr ? fl_value_ref(class_map) + : fl_value_new_null()); g_autofree gchar* channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoNullableMap%s", + "echoNullableNonNullClassMap%s", self->suffix); g_autoptr(CoreTestsPigeonTestMessageCodec) codec = core_tests_pigeon_test_message_codec_new(); @@ -18899,12 +32003,12 @@ void core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map( g_task_set_task_data(task, channel, g_object_unref); fl_basic_message_channel_send( channel, args, cancellable, - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_cb, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_map_cb, task); } -CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableMapResponse* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_finish( +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullClassMapResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_map_finish( CoreTestsPigeonTestFlutterIntegrationCoreApi* self, GAsyncResult* result, GError** error) { g_autoptr(GTask) task = G_TASK(result); @@ -18916,7 +32020,7 @@ core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_finish( if (response == nullptr) { return nullptr; } - return core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_response_new( + return core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_map_response_new( response); } @@ -20276,7 +33380,7 @@ void core_tests_pigeon_test_flutter_small_api_echo_wrapped_list( CoreTestsPigeonTestTestMessage* msg, GCancellable* cancellable, GAsyncReadyCallback callback, gpointer user_data) { g_autoptr(FlValue) args = fl_value_new_list(); - fl_value_append_take(args, fl_value_new_custom_object(135, G_OBJECT(msg))); + fl_value_append_take(args, fl_value_new_custom_object(136, G_OBJECT(msg))); g_autofree gchar* channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi." "echoWrappedList%s", diff --git a/packages/pigeon/platform_tests/test_plugin/linux/pigeon/core_tests.gen.h b/packages/pigeon/platform_tests/test_plugin/linux/pigeon/core_tests.gen.h index e6e2219c1a63..6cb79ba18548 100644 --- a/packages/pigeon/platform_tests/test_plugin/linux/pigeon/core_tests.gen.h +++ b/packages/pigeon/platform_tests/test_plugin/linux/pigeon/core_tests.gen.h @@ -38,6 +38,37 @@ typedef enum { PIGEON_INTEGRATION_TESTS_ANOTHER_ENUM_JUST_IN_CASE = 0 } CoreTestsPigeonTestAnotherEnum; +/** + * CoreTestsPigeonTestUnusedClass: + * + */ + +G_DECLARE_FINAL_TYPE(CoreTestsPigeonTestUnusedClass, + core_tests_pigeon_test_unused_class, + CORE_TESTS_PIGEON_TEST, UNUSED_CLASS, GObject) + +/** + * core_tests_pigeon_test_unused_class_new: + * a_field: field in this object. + * + * Creates a new #UnusedClass object. + * + * Returns: a new #CoreTestsPigeonTestUnusedClass + */ +CoreTestsPigeonTestUnusedClass* core_tests_pigeon_test_unused_class_new( + FlValue* a_field); + +/** + * core_tests_pigeon_test_unused_class_get_a_field + * @object: a #CoreTestsPigeonTestUnusedClass. + * + * Gets the value of the aField field of @object. + * + * Returns: the field value. + */ +FlValue* core_tests_pigeon_test_unused_class_get_a_field( + CoreTestsPigeonTestUnusedClass* object); + /** * CoreTestsPigeonTestAllTypes: * @@ -71,7 +102,17 @@ G_DECLARE_FINAL_TYPE(CoreTestsPigeonTestAllTypes, * int_list: field in this object. * double_list: field in this object. * bool_list: field in this object. + * enum_list: field in this object. + * object_list: field in this object. + * list_list: field in this object. + * map_list: field in this object. * map: field in this object. + * string_map: field in this object. + * int_map: field in this object. + * enum_map: field in this object. + * object_map: field in this object. + * list_map: field in this object. + * map_map: field in this object. * * Creates a new #AllTypes object. * @@ -86,7 +127,10 @@ CoreTestsPigeonTestAllTypes* core_tests_pigeon_test_all_types_new( CoreTestsPigeonTestAnEnum an_enum, CoreTestsPigeonTestAnotherEnum another_enum, const gchar* a_string, FlValue* an_object, FlValue* list, FlValue* string_list, FlValue* int_list, - FlValue* double_list, FlValue* bool_list, FlValue* map); + FlValue* double_list, FlValue* bool_list, FlValue* enum_list, + FlValue* object_list, FlValue* list_list, FlValue* map_list, FlValue* map, + FlValue* string_map, FlValue* int_map, FlValue* enum_map, + FlValue* object_map, FlValue* list_map, FlValue* map_map); /** * core_tests_pigeon_test_all_types_get_a_bool @@ -280,6 +324,50 @@ FlValue* core_tests_pigeon_test_all_types_get_double_list( FlValue* core_tests_pigeon_test_all_types_get_bool_list( CoreTestsPigeonTestAllTypes* object); +/** + * core_tests_pigeon_test_all_types_get_enum_list + * @object: a #CoreTestsPigeonTestAllTypes. + * + * Gets the value of the enumList field of @object. + * + * Returns: the field value. + */ +FlValue* core_tests_pigeon_test_all_types_get_enum_list( + CoreTestsPigeonTestAllTypes* object); + +/** + * core_tests_pigeon_test_all_types_get_object_list + * @object: a #CoreTestsPigeonTestAllTypes. + * + * Gets the value of the objectList field of @object. + * + * Returns: the field value. + */ +FlValue* core_tests_pigeon_test_all_types_get_object_list( + CoreTestsPigeonTestAllTypes* object); + +/** + * core_tests_pigeon_test_all_types_get_list_list + * @object: a #CoreTestsPigeonTestAllTypes. + * + * Gets the value of the listList field of @object. + * + * Returns: the field value. + */ +FlValue* core_tests_pigeon_test_all_types_get_list_list( + CoreTestsPigeonTestAllTypes* object); + +/** + * core_tests_pigeon_test_all_types_get_map_list + * @object: a #CoreTestsPigeonTestAllTypes. + * + * Gets the value of the mapList field of @object. + * + * Returns: the field value. + */ +FlValue* core_tests_pigeon_test_all_types_get_map_list( + CoreTestsPigeonTestAllTypes* object); + /** * core_tests_pigeon_test_all_types_get_map * @object: a #CoreTestsPigeonTestAllTypes. @@ -291,6 +379,72 @@ FlValue* core_tests_pigeon_test_all_types_get_bool_list( FlValue* core_tests_pigeon_test_all_types_get_map( CoreTestsPigeonTestAllTypes* object); +/** + * core_tests_pigeon_test_all_types_get_string_map + * @object: a #CoreTestsPigeonTestAllTypes. + * + * Gets the value of the stringMap field of @object. + * + * Returns: the field value. + */ +FlValue* core_tests_pigeon_test_all_types_get_string_map( + CoreTestsPigeonTestAllTypes* object); + +/** + * core_tests_pigeon_test_all_types_get_int_map + * @object: a #CoreTestsPigeonTestAllTypes. + * + * Gets the value of the intMap field of @object. + * + * Returns: the field value. + */ +FlValue* core_tests_pigeon_test_all_types_get_int_map( + CoreTestsPigeonTestAllTypes* object); + +/** + * core_tests_pigeon_test_all_types_get_enum_map + * @object: a #CoreTestsPigeonTestAllTypes. + * + * Gets the value of the enumMap field of @object. + * + * Returns: the field value. + */ +FlValue* core_tests_pigeon_test_all_types_get_enum_map( + CoreTestsPigeonTestAllTypes* object); + +/** + * core_tests_pigeon_test_all_types_get_object_map + * @object: a #CoreTestsPigeonTestAllTypes. + * + * Gets the value of the objectMap field of @object. + * + * Returns: the field value. + */ +FlValue* core_tests_pigeon_test_all_types_get_object_map( + CoreTestsPigeonTestAllTypes* object); + +/** + * core_tests_pigeon_test_all_types_get_list_map + * @object: a #CoreTestsPigeonTestAllTypes. + * + * Gets the value of the listMap field of @object. + * + * Returns: the field value. + */ +FlValue* core_tests_pigeon_test_all_types_get_list_map( + CoreTestsPigeonTestAllTypes* object); + +/** + * core_tests_pigeon_test_all_types_get_map_map + * @object: a #CoreTestsPigeonTestAllTypes. + * + * Gets the value of the mapMap field of @object. + * + * Returns: the field value. + */ +FlValue* core_tests_pigeon_test_all_types_get_map_map( + CoreTestsPigeonTestAllTypes* object); + /** * CoreTestsPigeonTestAllNullableTypes: * @@ -315,9 +469,6 @@ G_DECLARE_FINAL_TYPE(CoreTestsPigeonTestAllNullableTypes, * a_nullable8_byte_array_length: length of @a_nullable8_byte_array. * a_nullable_float_array: field in this object. * a_nullable_float_array_length: length of @a_nullable_float_array. - * nullable_nested_list: field in this object. - * nullable_map_with_annotations: field in this object. - * nullable_map_with_object: field in this object. * a_nullable_enum: field in this object. * another_nullable_enum: field in this object. * a_nullable_string: field in this object. @@ -328,8 +479,19 @@ G_DECLARE_FINAL_TYPE(CoreTestsPigeonTestAllNullableTypes, * int_list: field in this object. * double_list: field in this object. * bool_list: field in this object. - * nested_class_list: field in this object. + * enum_list: field in this object. + * object_list: field in this object. + * list_list: field in this object. + * map_list: field in this object. + * recursive_class_list: field in this object. * map: field in this object. + * string_map: field in this object. + * int_map: field in this object. + * enum_map: field in this object. + * object_map: field in this object. + * list_map: field in this object. + * map_map: field in this object. + * recursive_class_map: field in this object. * * Creates a new #AllNullableTypes object. * @@ -343,14 +505,16 @@ core_tests_pigeon_test_all_nullable_types_new( const int32_t* a_nullable4_byte_array, size_t a_nullable4_byte_array_length, const int64_t* a_nullable8_byte_array, size_t a_nullable8_byte_array_length, const double* a_nullable_float_array, size_t a_nullable_float_array_length, - FlValue* nullable_nested_list, FlValue* nullable_map_with_annotations, - FlValue* nullable_map_with_object, CoreTestsPigeonTestAnEnum* a_nullable_enum, CoreTestsPigeonTestAnotherEnum* another_nullable_enum, const gchar* a_nullable_string, FlValue* a_nullable_object, CoreTestsPigeonTestAllNullableTypes* all_nullable_types, FlValue* list, FlValue* string_list, FlValue* int_list, FlValue* double_list, - FlValue* bool_list, FlValue* nested_class_list, FlValue* map); + FlValue* bool_list, FlValue* enum_list, FlValue* object_list, + FlValue* list_list, FlValue* map_list, FlValue* recursive_class_list, + FlValue* map, FlValue* string_map, FlValue* int_map, FlValue* enum_map, + FlValue* object_map, FlValue* list_map, FlValue* map_map, + FlValue* recursive_class_map); /** * core_tests_pigeon_test_all_nullable_types_get_a_nullable_bool @@ -448,40 +612,6 @@ const double* core_tests_pigeon_test_all_nullable_types_get_a_nullable_float_array( CoreTestsPigeonTestAllNullableTypes* object, size_t* length); -/** - * core_tests_pigeon_test_all_nullable_types_get_nullable_nested_list - * @object: a #CoreTestsPigeonTestAllNullableTypes. - * - * Gets the value of the nullableNestedList field of @object. - * - * Returns: the field value. - */ -FlValue* core_tests_pigeon_test_all_nullable_types_get_nullable_nested_list( - CoreTestsPigeonTestAllNullableTypes* object); - -/** - * core_tests_pigeon_test_all_nullable_types_get_nullable_map_with_annotations - * @object: a #CoreTestsPigeonTestAllNullableTypes. - * - * Gets the value of the nullableMapWithAnnotations field of @object. - * - * Returns: the field value. - */ -FlValue* -core_tests_pigeon_test_all_nullable_types_get_nullable_map_with_annotations( - CoreTestsPigeonTestAllNullableTypes* object); - -/** - * core_tests_pigeon_test_all_nullable_types_get_nullable_map_with_object - * @object: a #CoreTestsPigeonTestAllNullableTypes. - * - * Gets the value of the nullableMapWithObject field of @object. - * - * Returns: the field value. - */ -FlValue* core_tests_pigeon_test_all_nullable_types_get_nullable_map_with_object( - CoreTestsPigeonTestAllNullableTypes* object); - /** * core_tests_pigeon_test_all_nullable_types_get_a_nullable_enum * @object: a #CoreTestsPigeonTestAllNullableTypes. @@ -596,14 +726,58 @@ FlValue* core_tests_pigeon_test_all_nullable_types_get_bool_list( CoreTestsPigeonTestAllNullableTypes* object); /** - * core_tests_pigeon_test_all_nullable_types_get_nested_class_list + * core_tests_pigeon_test_all_nullable_types_get_enum_list + * @object: a #CoreTestsPigeonTestAllNullableTypes. + * + * Gets the value of the enumList field of @object. + * + * Returns: the field value. + */ +FlValue* core_tests_pigeon_test_all_nullable_types_get_enum_list( + CoreTestsPigeonTestAllNullableTypes* object); + +/** + * core_tests_pigeon_test_all_nullable_types_get_object_list + * @object: a #CoreTestsPigeonTestAllNullableTypes. + * + * Gets the value of the objectList field of @object. + * + * Returns: the field value. + */ +FlValue* core_tests_pigeon_test_all_nullable_types_get_object_list( + CoreTestsPigeonTestAllNullableTypes* object); + +/** + * core_tests_pigeon_test_all_nullable_types_get_list_list + * @object: a #CoreTestsPigeonTestAllNullableTypes. + * + * Gets the value of the listList field of @object. + * + * Returns: the field value. + */ +FlValue* core_tests_pigeon_test_all_nullable_types_get_list_list( + CoreTestsPigeonTestAllNullableTypes* object); + +/** + * core_tests_pigeon_test_all_nullable_types_get_map_list + * @object: a #CoreTestsPigeonTestAllNullableTypes. + * + * Gets the value of the mapList field of @object. + * + * Returns: the field value. + */ +FlValue* core_tests_pigeon_test_all_nullable_types_get_map_list( + CoreTestsPigeonTestAllNullableTypes* object); + +/** + * core_tests_pigeon_test_all_nullable_types_get_recursive_class_list * @object: a #CoreTestsPigeonTestAllNullableTypes. * - * Gets the value of the nestedClassList field of @object. + * Gets the value of the recursiveClassList field of @object. * * Returns: the field value. */ -FlValue* core_tests_pigeon_test_all_nullable_types_get_nested_class_list( +FlValue* core_tests_pigeon_test_all_nullable_types_get_recursive_class_list( CoreTestsPigeonTestAllNullableTypes* object); /** @@ -617,6 +791,83 @@ FlValue* core_tests_pigeon_test_all_nullable_types_get_nested_class_list( FlValue* core_tests_pigeon_test_all_nullable_types_get_map( CoreTestsPigeonTestAllNullableTypes* object); +/** + * core_tests_pigeon_test_all_nullable_types_get_string_map + * @object: a #CoreTestsPigeonTestAllNullableTypes. + * + * Gets the value of the stringMap field of @object. + * + * Returns: the field value. + */ +FlValue* core_tests_pigeon_test_all_nullable_types_get_string_map( + CoreTestsPigeonTestAllNullableTypes* object); + +/** + * core_tests_pigeon_test_all_nullable_types_get_int_map + * @object: a #CoreTestsPigeonTestAllNullableTypes. + * + * Gets the value of the intMap field of @object. + * + * Returns: the field value. + */ +FlValue* core_tests_pigeon_test_all_nullable_types_get_int_map( + CoreTestsPigeonTestAllNullableTypes* object); + +/** + * core_tests_pigeon_test_all_nullable_types_get_enum_map + * @object: a #CoreTestsPigeonTestAllNullableTypes. + * + * Gets the value of the enumMap field of @object. + * + * Returns: the field value. + */ +FlValue* core_tests_pigeon_test_all_nullable_types_get_enum_map( + CoreTestsPigeonTestAllNullableTypes* object); + +/** + * core_tests_pigeon_test_all_nullable_types_get_object_map + * @object: a #CoreTestsPigeonTestAllNullableTypes. + * + * Gets the value of the objectMap field of @object. + * + * Returns: the field value. + */ +FlValue* core_tests_pigeon_test_all_nullable_types_get_object_map( + CoreTestsPigeonTestAllNullableTypes* object); + +/** + * core_tests_pigeon_test_all_nullable_types_get_list_map + * @object: a #CoreTestsPigeonTestAllNullableTypes. + * + * Gets the value of the listMap field of @object. + * + * Returns: the field value. + */ +FlValue* core_tests_pigeon_test_all_nullable_types_get_list_map( + CoreTestsPigeonTestAllNullableTypes* object); + +/** + * core_tests_pigeon_test_all_nullable_types_get_map_map + * @object: a #CoreTestsPigeonTestAllNullableTypes. + * + * Gets the value of the mapMap field of @object. + * + * Returns: the field value. + */ +FlValue* core_tests_pigeon_test_all_nullable_types_get_map_map( + CoreTestsPigeonTestAllNullableTypes* object); + +/** + * core_tests_pigeon_test_all_nullable_types_get_recursive_class_map + * @object: a #CoreTestsPigeonTestAllNullableTypes. + * + * Gets the value of the recursiveClassMap field of @object. + * + * Returns: the field value. + */ +FlValue* core_tests_pigeon_test_all_nullable_types_get_recursive_class_map( + CoreTestsPigeonTestAllNullableTypes* object); + /** * CoreTestsPigeonTestAllNullableTypesWithoutRecursion: * @@ -644,9 +895,6 @@ G_DECLARE_FINAL_TYPE( * a_nullable8_byte_array_length: length of @a_nullable8_byte_array. * a_nullable_float_array: field in this object. * a_nullable_float_array_length: length of @a_nullable_float_array. - * nullable_nested_list: field in this object. - * nullable_map_with_annotations: field in this object. - * nullable_map_with_object: field in this object. * a_nullable_enum: field in this object. * another_nullable_enum: field in this object. * a_nullable_string: field in this object. @@ -656,7 +904,17 @@ G_DECLARE_FINAL_TYPE( * int_list: field in this object. * double_list: field in this object. * bool_list: field in this object. + * enum_list: field in this object. + * object_list: field in this object. + * list_list: field in this object. + * map_list: field in this object. * map: field in this object. + * string_map: field in this object. + * int_map: field in this object. + * enum_map: field in this object. + * object_map: field in this object. + * list_map: field in this object. + * map_map: field in this object. * * Creates a new #AllNullableTypesWithoutRecursion object. * @@ -670,13 +928,14 @@ core_tests_pigeon_test_all_nullable_types_without_recursion_new( const int32_t* a_nullable4_byte_array, size_t a_nullable4_byte_array_length, const int64_t* a_nullable8_byte_array, size_t a_nullable8_byte_array_length, const double* a_nullable_float_array, size_t a_nullable_float_array_length, - FlValue* nullable_nested_list, FlValue* nullable_map_with_annotations, - FlValue* nullable_map_with_object, CoreTestsPigeonTestAnEnum* a_nullable_enum, CoreTestsPigeonTestAnotherEnum* another_nullable_enum, const gchar* a_nullable_string, FlValue* a_nullable_object, FlValue* list, FlValue* string_list, FlValue* int_list, FlValue* double_list, - FlValue* bool_list, FlValue* map); + FlValue* bool_list, FlValue* enum_list, FlValue* object_list, + FlValue* list_list, FlValue* map_list, FlValue* map, FlValue* string_map, + FlValue* int_map, FlValue* enum_map, FlValue* object_map, FlValue* list_map, + FlValue* map_map); /** * core_tests_pigeon_test_all_nullable_types_without_recursion_get_a_nullable_bool @@ -782,42 +1041,6 @@ core_tests_pigeon_test_all_nullable_types_without_recursion_get_a_nullable_float CoreTestsPigeonTestAllNullableTypesWithoutRecursion* object, size_t* length); -/** - * core_tests_pigeon_test_all_nullable_types_without_recursion_get_nullable_nested_list - * @object: a #CoreTestsPigeonTestAllNullableTypesWithoutRecursion. - * - * Gets the value of the nullableNestedList field of @object. - * - * Returns: the field value. - */ -FlValue* -core_tests_pigeon_test_all_nullable_types_without_recursion_get_nullable_nested_list( - CoreTestsPigeonTestAllNullableTypesWithoutRecursion* object); - -/** - * core_tests_pigeon_test_all_nullable_types_without_recursion_get_nullable_map_with_annotations - * @object: a #CoreTestsPigeonTestAllNullableTypesWithoutRecursion. - * - * Gets the value of the nullableMapWithAnnotations field of @object. - * - * Returns: the field value. - */ -FlValue* -core_tests_pigeon_test_all_nullable_types_without_recursion_get_nullable_map_with_annotations( - CoreTestsPigeonTestAllNullableTypesWithoutRecursion* object); - -/** - * core_tests_pigeon_test_all_nullable_types_without_recursion_get_nullable_map_with_object - * @object: a #CoreTestsPigeonTestAllNullableTypesWithoutRecursion. - * - * Gets the value of the nullableMapWithObject field of @object. - * - * Returns: the field value. - */ -FlValue* -core_tests_pigeon_test_all_nullable_types_without_recursion_get_nullable_map_with_object( - CoreTestsPigeonTestAllNullableTypesWithoutRecursion* object); - /** * core_tests_pigeon_test_all_nullable_types_without_recursion_get_a_nullable_enum * @object: a #CoreTestsPigeonTestAllNullableTypesWithoutRecursion. @@ -926,35 +1149,159 @@ core_tests_pigeon_test_all_nullable_types_without_recursion_get_bool_list( CoreTestsPigeonTestAllNullableTypesWithoutRecursion* object); /** - * core_tests_pigeon_test_all_nullable_types_without_recursion_get_map + * core_tests_pigeon_test_all_nullable_types_without_recursion_get_enum_list * @object: a #CoreTestsPigeonTestAllNullableTypesWithoutRecursion. * - * Gets the value of the map field of @object. + * Gets the value of the enumList field of @object. * * Returns: the field value. */ -FlValue* core_tests_pigeon_test_all_nullable_types_without_recursion_get_map( +FlValue* +core_tests_pigeon_test_all_nullable_types_without_recursion_get_enum_list( CoreTestsPigeonTestAllNullableTypesWithoutRecursion* object); /** - * CoreTestsPigeonTestAllClassesWrapper: + * core_tests_pigeon_test_all_nullable_types_without_recursion_get_object_list + * @object: a #CoreTestsPigeonTestAllNullableTypesWithoutRecursion. * - * A class for testing nested class handling. + * Gets the value of the objectList field of @object. * - * This is needed to test nested nullable and non-nullable classes, - * `AllNullableTypes` is non-nullable here as it is easier to instantiate - * than `AllTypes` when testing doesn't require both (ie. testing null classes). + * Returns: the field value. */ - -G_DECLARE_FINAL_TYPE(CoreTestsPigeonTestAllClassesWrapper, - core_tests_pigeon_test_all_classes_wrapper, - CORE_TESTS_PIGEON_TEST, ALL_CLASSES_WRAPPER, GObject) +FlValue* +core_tests_pigeon_test_all_nullable_types_without_recursion_get_object_list( + CoreTestsPigeonTestAllNullableTypesWithoutRecursion* object); /** - * core_tests_pigeon_test_all_classes_wrapper_new: - * all_nullable_types: field in this object. - * all_nullable_types_without_recursion: field in this object. + * core_tests_pigeon_test_all_nullable_types_without_recursion_get_list_list + * @object: a #CoreTestsPigeonTestAllNullableTypesWithoutRecursion. + * + * Gets the value of the listList field of @object. + * + * Returns: the field value. + */ +FlValue* +core_tests_pigeon_test_all_nullable_types_without_recursion_get_list_list( + CoreTestsPigeonTestAllNullableTypesWithoutRecursion* object); + +/** + * core_tests_pigeon_test_all_nullable_types_without_recursion_get_map_list + * @object: a #CoreTestsPigeonTestAllNullableTypesWithoutRecursion. + * + * Gets the value of the mapList field of @object. + * + * Returns: the field value. + */ +FlValue* +core_tests_pigeon_test_all_nullable_types_without_recursion_get_map_list( + CoreTestsPigeonTestAllNullableTypesWithoutRecursion* object); + +/** + * core_tests_pigeon_test_all_nullable_types_without_recursion_get_map + * @object: a #CoreTestsPigeonTestAllNullableTypesWithoutRecursion. + * + * Gets the value of the map field of @object. + * + * Returns: the field value. + */ +FlValue* core_tests_pigeon_test_all_nullable_types_without_recursion_get_map( + CoreTestsPigeonTestAllNullableTypesWithoutRecursion* object); + +/** + * core_tests_pigeon_test_all_nullable_types_without_recursion_get_string_map + * @object: a #CoreTestsPigeonTestAllNullableTypesWithoutRecursion. + * + * Gets the value of the stringMap field of @object. + * + * Returns: the field value. + */ +FlValue* +core_tests_pigeon_test_all_nullable_types_without_recursion_get_string_map( + CoreTestsPigeonTestAllNullableTypesWithoutRecursion* object); + +/** + * core_tests_pigeon_test_all_nullable_types_without_recursion_get_int_map + * @object: a #CoreTestsPigeonTestAllNullableTypesWithoutRecursion. + * + * Gets the value of the intMap field of @object. + * + * Returns: the field value. + */ +FlValue* +core_tests_pigeon_test_all_nullable_types_without_recursion_get_int_map( + CoreTestsPigeonTestAllNullableTypesWithoutRecursion* object); + +/** + * core_tests_pigeon_test_all_nullable_types_without_recursion_get_enum_map + * @object: a #CoreTestsPigeonTestAllNullableTypesWithoutRecursion. + * + * Gets the value of the enumMap field of @object. + * + * Returns: the field value. + */ +FlValue* +core_tests_pigeon_test_all_nullable_types_without_recursion_get_enum_map( + CoreTestsPigeonTestAllNullableTypesWithoutRecursion* object); + +/** + * core_tests_pigeon_test_all_nullable_types_without_recursion_get_object_map + * @object: a #CoreTestsPigeonTestAllNullableTypesWithoutRecursion. + * + * Gets the value of the objectMap field of @object. + * + * Returns: the field value. + */ +FlValue* +core_tests_pigeon_test_all_nullable_types_without_recursion_get_object_map( + CoreTestsPigeonTestAllNullableTypesWithoutRecursion* object); + +/** + * core_tests_pigeon_test_all_nullable_types_without_recursion_get_list_map + * @object: a #CoreTestsPigeonTestAllNullableTypesWithoutRecursion. + * + * Gets the value of the listMap field of @object. + * + * Returns: the field value. + */ +FlValue* +core_tests_pigeon_test_all_nullable_types_without_recursion_get_list_map( + CoreTestsPigeonTestAllNullableTypesWithoutRecursion* object); + +/** + * core_tests_pigeon_test_all_nullable_types_without_recursion_get_map_map + * @object: a #CoreTestsPigeonTestAllNullableTypesWithoutRecursion. + * + * Gets the value of the mapMap field of @object. + * + * Returns: the field value. + */ +FlValue* +core_tests_pigeon_test_all_nullable_types_without_recursion_get_map_map( + CoreTestsPigeonTestAllNullableTypesWithoutRecursion* object); + +/** + * CoreTestsPigeonTestAllClassesWrapper: + * + * A class for testing nested class handling. + * + * This is needed to test nested nullable and non-nullable classes, + * `AllNullableTypes` is non-nullable here as it is easier to instantiate + * than `AllTypes` when testing doesn't require both (ie. testing null classes). + */ + +G_DECLARE_FINAL_TYPE(CoreTestsPigeonTestAllClassesWrapper, + core_tests_pigeon_test_all_classes_wrapper, + CORE_TESTS_PIGEON_TEST, ALL_CLASSES_WRAPPER, GObject) + +/** + * core_tests_pigeon_test_all_classes_wrapper_new: + * all_nullable_types: field in this object. + * all_nullable_types_without_recursion: field in this object. * all_types: field in this object. + * class_list: field in this object. + * nullable_class_list: field in this object. + * class_map: field in this object. + * nullable_class_map: field in this object. * * Creates a new #AllClassesWrapper object. * @@ -965,7 +1312,9 @@ core_tests_pigeon_test_all_classes_wrapper_new( CoreTestsPigeonTestAllNullableTypes* all_nullable_types, CoreTestsPigeonTestAllNullableTypesWithoutRecursion* all_nullable_types_without_recursion, - CoreTestsPigeonTestAllTypes* all_types); + CoreTestsPigeonTestAllTypes* all_types, FlValue* class_list, + FlValue* nullable_class_list, FlValue* class_map, + FlValue* nullable_class_map); /** * core_tests_pigeon_test_all_classes_wrapper_get_all_nullable_types @@ -1003,6 +1352,50 @@ CoreTestsPigeonTestAllTypes* core_tests_pigeon_test_all_classes_wrapper_get_all_types( CoreTestsPigeonTestAllClassesWrapper* object); +/** + * core_tests_pigeon_test_all_classes_wrapper_get_class_list + * @object: a #CoreTestsPigeonTestAllClassesWrapper. + * + * Gets the value of the classList field of @object. + * + * Returns: the field value. + */ +FlValue* core_tests_pigeon_test_all_classes_wrapper_get_class_list( + CoreTestsPigeonTestAllClassesWrapper* object); + +/** + * core_tests_pigeon_test_all_classes_wrapper_get_nullable_class_list + * @object: a #CoreTestsPigeonTestAllClassesWrapper. + * + * Gets the value of the nullableClassList field of @object. + * + * Returns: the field value. + */ +FlValue* core_tests_pigeon_test_all_classes_wrapper_get_nullable_class_list( + CoreTestsPigeonTestAllClassesWrapper* object); + +/** + * core_tests_pigeon_test_all_classes_wrapper_get_class_map + * @object: a #CoreTestsPigeonTestAllClassesWrapper. + * + * Gets the value of the classMap field of @object. + * + * Returns: the field value. + */ +FlValue* core_tests_pigeon_test_all_classes_wrapper_get_class_map( + CoreTestsPigeonTestAllClassesWrapper* object); + +/** + * core_tests_pigeon_test_all_classes_wrapper_get_nullable_class_map + * @object: a #CoreTestsPigeonTestAllClassesWrapper. + * + * Gets the value of the nullableClassMap field of @object. + * + * Returns: the field value. + */ +FlValue* core_tests_pigeon_test_all_classes_wrapper_get_nullable_class_map( + CoreTestsPigeonTestAllClassesWrapper* object); + /** * CoreTestsPigeonTestTestMessage: * @@ -1416,884 +1809,1704 @@ core_tests_pigeon_test_host_integration_core_api_echo_list_response_new_error( const gchar* code, const gchar* message, FlValue* details); G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoMapResponse, - core_tests_pigeon_test_host_integration_core_api_echo_map_response, - CORE_TESTS_PIGEON_TEST, HOST_INTEGRATION_CORE_API_ECHO_MAP_RESPONSE, + CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumListResponse, + core_tests_pigeon_test_host_integration_core_api_echo_enum_list_response, + CORE_TESTS_PIGEON_TEST, HOST_INTEGRATION_CORE_API_ECHO_ENUM_LIST_RESPONSE, GObject) /** - * core_tests_pigeon_test_host_integration_core_api_echo_map_response_new: + * core_tests_pigeon_test_host_integration_core_api_echo_enum_list_response_new: * - * Creates a new response to HostIntegrationCoreApi.echoMap. + * Creates a new response to HostIntegrationCoreApi.echoEnumList. * - * Returns: a new #CoreTestsPigeonTestHostIntegrationCoreApiEchoMapResponse + * Returns: a new #CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumListResponse */ -CoreTestsPigeonTestHostIntegrationCoreApiEchoMapResponse* -core_tests_pigeon_test_host_integration_core_api_echo_map_response_new( +CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumListResponse* +core_tests_pigeon_test_host_integration_core_api_echo_enum_list_response_new( FlValue* return_value); /** - * core_tests_pigeon_test_host_integration_core_api_echo_map_response_new_error: + * core_tests_pigeon_test_host_integration_core_api_echo_enum_list_response_new_error: * @code: error code. * @message: error message. * @details: (allow-none): error details or %NULL. * - * Creates a new error response to HostIntegrationCoreApi.echoMap. + * Creates a new error response to HostIntegrationCoreApi.echoEnumList. * - * Returns: a new #CoreTestsPigeonTestHostIntegrationCoreApiEchoMapResponse + * Returns: a new #CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumListResponse */ -CoreTestsPigeonTestHostIntegrationCoreApiEchoMapResponse* -core_tests_pigeon_test_host_integration_core_api_echo_map_response_new_error( +CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumListResponse* +core_tests_pigeon_test_host_integration_core_api_echo_enum_list_response_new_error( const gchar* code, const gchar* message, FlValue* details); G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoClassWrapperResponse, - core_tests_pigeon_test_host_integration_core_api_echo_class_wrapper_response, - CORE_TESTS_PIGEON_TEST, - HOST_INTEGRATION_CORE_API_ECHO_CLASS_WRAPPER_RESPONSE, GObject) + CoreTestsPigeonTestHostIntegrationCoreApiEchoClassListResponse, + core_tests_pigeon_test_host_integration_core_api_echo_class_list_response, + CORE_TESTS_PIGEON_TEST, HOST_INTEGRATION_CORE_API_ECHO_CLASS_LIST_RESPONSE, + GObject) /** - * core_tests_pigeon_test_host_integration_core_api_echo_class_wrapper_response_new: + * core_tests_pigeon_test_host_integration_core_api_echo_class_list_response_new: * - * Creates a new response to HostIntegrationCoreApi.echoClassWrapper. + * Creates a new response to HostIntegrationCoreApi.echoClassList. * * Returns: a new - * #CoreTestsPigeonTestHostIntegrationCoreApiEchoClassWrapperResponse + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoClassListResponse */ -CoreTestsPigeonTestHostIntegrationCoreApiEchoClassWrapperResponse* -core_tests_pigeon_test_host_integration_core_api_echo_class_wrapper_response_new( - CoreTestsPigeonTestAllClassesWrapper* return_value); +CoreTestsPigeonTestHostIntegrationCoreApiEchoClassListResponse* +core_tests_pigeon_test_host_integration_core_api_echo_class_list_response_new( + FlValue* return_value); /** - * core_tests_pigeon_test_host_integration_core_api_echo_class_wrapper_response_new_error: + * core_tests_pigeon_test_host_integration_core_api_echo_class_list_response_new_error: * @code: error code. * @message: error message. * @details: (allow-none): error details or %NULL. * - * Creates a new error response to HostIntegrationCoreApi.echoClassWrapper. + * Creates a new error response to HostIntegrationCoreApi.echoClassList. * * Returns: a new - * #CoreTestsPigeonTestHostIntegrationCoreApiEchoClassWrapperResponse + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoClassListResponse */ -CoreTestsPigeonTestHostIntegrationCoreApiEchoClassWrapperResponse* -core_tests_pigeon_test_host_integration_core_api_echo_class_wrapper_response_new_error( +CoreTestsPigeonTestHostIntegrationCoreApiEchoClassListResponse* +core_tests_pigeon_test_host_integration_core_api_echo_class_list_response_new_error( const gchar* code, const gchar* message, FlValue* details); G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumResponse, - core_tests_pigeon_test_host_integration_core_api_echo_enum_response, - CORE_TESTS_PIGEON_TEST, HOST_INTEGRATION_CORE_API_ECHO_ENUM_RESPONSE, - GObject) + CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullEnumListResponse, + core_tests_pigeon_test_host_integration_core_api_echo_non_null_enum_list_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_ECHO_NON_NULL_ENUM_LIST_RESPONSE, GObject) /** - * core_tests_pigeon_test_host_integration_core_api_echo_enum_response_new: + * core_tests_pigeon_test_host_integration_core_api_echo_non_null_enum_list_response_new: * - * Creates a new response to HostIntegrationCoreApi.echoEnum. + * Creates a new response to HostIntegrationCoreApi.echoNonNullEnumList. * - * Returns: a new #CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumResponse + * Returns: a new + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullEnumListResponse */ -CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumResponse* -core_tests_pigeon_test_host_integration_core_api_echo_enum_response_new( - CoreTestsPigeonTestAnEnum return_value); +CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullEnumListResponse* +core_tests_pigeon_test_host_integration_core_api_echo_non_null_enum_list_response_new( + FlValue* return_value); /** - * core_tests_pigeon_test_host_integration_core_api_echo_enum_response_new_error: + * core_tests_pigeon_test_host_integration_core_api_echo_non_null_enum_list_response_new_error: * @code: error code. * @message: error message. * @details: (allow-none): error details or %NULL. * - * Creates a new error response to HostIntegrationCoreApi.echoEnum. + * Creates a new error response to HostIntegrationCoreApi.echoNonNullEnumList. * - * Returns: a new #CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumResponse + * Returns: a new + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullEnumListResponse */ -CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumResponse* -core_tests_pigeon_test_host_integration_core_api_echo_enum_response_new_error( +CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullEnumListResponse* +core_tests_pigeon_test_host_integration_core_api_echo_non_null_enum_list_response_new_error( const gchar* code, const gchar* message, FlValue* details); G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherEnumResponse, - core_tests_pigeon_test_host_integration_core_api_echo_another_enum_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullClassListResponse, + core_tests_pigeon_test_host_integration_core_api_echo_non_null_class_list_response, CORE_TESTS_PIGEON_TEST, - HOST_INTEGRATION_CORE_API_ECHO_ANOTHER_ENUM_RESPONSE, GObject) + HOST_INTEGRATION_CORE_API_ECHO_NON_NULL_CLASS_LIST_RESPONSE, GObject) /** - * core_tests_pigeon_test_host_integration_core_api_echo_another_enum_response_new: + * core_tests_pigeon_test_host_integration_core_api_echo_non_null_class_list_response_new: * - * Creates a new response to HostIntegrationCoreApi.echoAnotherEnum. + * Creates a new response to HostIntegrationCoreApi.echoNonNullClassList. * * Returns: a new - * #CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherEnumResponse + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullClassListResponse */ -CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherEnumResponse* -core_tests_pigeon_test_host_integration_core_api_echo_another_enum_response_new( - CoreTestsPigeonTestAnotherEnum return_value); +CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullClassListResponse* +core_tests_pigeon_test_host_integration_core_api_echo_non_null_class_list_response_new( + FlValue* return_value); /** - * core_tests_pigeon_test_host_integration_core_api_echo_another_enum_response_new_error: + * core_tests_pigeon_test_host_integration_core_api_echo_non_null_class_list_response_new_error: * @code: error code. * @message: error message. * @details: (allow-none): error details or %NULL. * - * Creates a new error response to HostIntegrationCoreApi.echoAnotherEnum. + * Creates a new error response to HostIntegrationCoreApi.echoNonNullClassList. * * Returns: a new - * #CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherEnumResponse + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullClassListResponse */ -CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherEnumResponse* -core_tests_pigeon_test_host_integration_core_api_echo_another_enum_response_new_error( +CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullClassListResponse* +core_tests_pigeon_test_host_integration_core_api_echo_non_null_class_list_response_new_error( const gchar* code, const gchar* message, FlValue* details); G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoNamedDefaultStringResponse, - core_tests_pigeon_test_host_integration_core_api_echo_named_default_string_response, - CORE_TESTS_PIGEON_TEST, - HOST_INTEGRATION_CORE_API_ECHO_NAMED_DEFAULT_STRING_RESPONSE, GObject) + CoreTestsPigeonTestHostIntegrationCoreApiEchoMapResponse, + core_tests_pigeon_test_host_integration_core_api_echo_map_response, + CORE_TESTS_PIGEON_TEST, HOST_INTEGRATION_CORE_API_ECHO_MAP_RESPONSE, + GObject) /** - * core_tests_pigeon_test_host_integration_core_api_echo_named_default_string_response_new: + * core_tests_pigeon_test_host_integration_core_api_echo_map_response_new: * - * Creates a new response to HostIntegrationCoreApi.echoNamedDefaultString. + * Creates a new response to HostIntegrationCoreApi.echoMap. * - * Returns: a new - * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNamedDefaultStringResponse + * Returns: a new #CoreTestsPigeonTestHostIntegrationCoreApiEchoMapResponse */ -CoreTestsPigeonTestHostIntegrationCoreApiEchoNamedDefaultStringResponse* -core_tests_pigeon_test_host_integration_core_api_echo_named_default_string_response_new( - const gchar* return_value); +CoreTestsPigeonTestHostIntegrationCoreApiEchoMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_map_response_new( + FlValue* return_value); /** - * core_tests_pigeon_test_host_integration_core_api_echo_named_default_string_response_new_error: + * core_tests_pigeon_test_host_integration_core_api_echo_map_response_new_error: * @code: error code. * @message: error message. * @details: (allow-none): error details or %NULL. * - * Creates a new error response to - * HostIntegrationCoreApi.echoNamedDefaultString. + * Creates a new error response to HostIntegrationCoreApi.echoMap. * - * Returns: a new - * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNamedDefaultStringResponse + * Returns: a new #CoreTestsPigeonTestHostIntegrationCoreApiEchoMapResponse */ -CoreTestsPigeonTestHostIntegrationCoreApiEchoNamedDefaultStringResponse* -core_tests_pigeon_test_host_integration_core_api_echo_named_default_string_response_new_error( +CoreTestsPigeonTestHostIntegrationCoreApiEchoMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_map_response_new_error( const gchar* code, const gchar* message, FlValue* details); G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoOptionalDefaultDoubleResponse, - core_tests_pigeon_test_host_integration_core_api_echo_optional_default_double_response, - CORE_TESTS_PIGEON_TEST, - HOST_INTEGRATION_CORE_API_ECHO_OPTIONAL_DEFAULT_DOUBLE_RESPONSE, GObject) + CoreTestsPigeonTestHostIntegrationCoreApiEchoStringMapResponse, + core_tests_pigeon_test_host_integration_core_api_echo_string_map_response, + CORE_TESTS_PIGEON_TEST, HOST_INTEGRATION_CORE_API_ECHO_STRING_MAP_RESPONSE, + GObject) /** - * core_tests_pigeon_test_host_integration_core_api_echo_optional_default_double_response_new: + * core_tests_pigeon_test_host_integration_core_api_echo_string_map_response_new: * - * Creates a new response to HostIntegrationCoreApi.echoOptionalDefaultDouble. + * Creates a new response to HostIntegrationCoreApi.echoStringMap. * * Returns: a new - * #CoreTestsPigeonTestHostIntegrationCoreApiEchoOptionalDefaultDoubleResponse + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoStringMapResponse */ -CoreTestsPigeonTestHostIntegrationCoreApiEchoOptionalDefaultDoubleResponse* -core_tests_pigeon_test_host_integration_core_api_echo_optional_default_double_response_new( - double return_value); +CoreTestsPigeonTestHostIntegrationCoreApiEchoStringMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_string_map_response_new( + FlValue* return_value); /** - * core_tests_pigeon_test_host_integration_core_api_echo_optional_default_double_response_new_error: + * core_tests_pigeon_test_host_integration_core_api_echo_string_map_response_new_error: * @code: error code. * @message: error message. * @details: (allow-none): error details or %NULL. * - * Creates a new error response to - * HostIntegrationCoreApi.echoOptionalDefaultDouble. + * Creates a new error response to HostIntegrationCoreApi.echoStringMap. * * Returns: a new - * #CoreTestsPigeonTestHostIntegrationCoreApiEchoOptionalDefaultDoubleResponse + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoStringMapResponse */ -CoreTestsPigeonTestHostIntegrationCoreApiEchoOptionalDefaultDoubleResponse* -core_tests_pigeon_test_host_integration_core_api_echo_optional_default_double_response_new_error( +CoreTestsPigeonTestHostIntegrationCoreApiEchoStringMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_string_map_response_new_error( const gchar* code, const gchar* message, FlValue* details); G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoRequiredIntResponse, - core_tests_pigeon_test_host_integration_core_api_echo_required_int_response, - CORE_TESTS_PIGEON_TEST, - HOST_INTEGRATION_CORE_API_ECHO_REQUIRED_INT_RESPONSE, GObject) + CoreTestsPigeonTestHostIntegrationCoreApiEchoIntMapResponse, + core_tests_pigeon_test_host_integration_core_api_echo_int_map_response, + CORE_TESTS_PIGEON_TEST, HOST_INTEGRATION_CORE_API_ECHO_INT_MAP_RESPONSE, + GObject) /** - * core_tests_pigeon_test_host_integration_core_api_echo_required_int_response_new: + * core_tests_pigeon_test_host_integration_core_api_echo_int_map_response_new: * - * Creates a new response to HostIntegrationCoreApi.echoRequiredInt. + * Creates a new response to HostIntegrationCoreApi.echoIntMap. * - * Returns: a new - * #CoreTestsPigeonTestHostIntegrationCoreApiEchoRequiredIntResponse + * Returns: a new #CoreTestsPigeonTestHostIntegrationCoreApiEchoIntMapResponse */ -CoreTestsPigeonTestHostIntegrationCoreApiEchoRequiredIntResponse* -core_tests_pigeon_test_host_integration_core_api_echo_required_int_response_new( - int64_t return_value); +CoreTestsPigeonTestHostIntegrationCoreApiEchoIntMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_int_map_response_new( + FlValue* return_value); /** - * core_tests_pigeon_test_host_integration_core_api_echo_required_int_response_new_error: + * core_tests_pigeon_test_host_integration_core_api_echo_int_map_response_new_error: * @code: error code. * @message: error message. * @details: (allow-none): error details or %NULL. * - * Creates a new error response to HostIntegrationCoreApi.echoRequiredInt. + * Creates a new error response to HostIntegrationCoreApi.echoIntMap. * - * Returns: a new - * #CoreTestsPigeonTestHostIntegrationCoreApiEchoRequiredIntResponse + * Returns: a new #CoreTestsPigeonTestHostIntegrationCoreApiEchoIntMapResponse */ -CoreTestsPigeonTestHostIntegrationCoreApiEchoRequiredIntResponse* -core_tests_pigeon_test_host_integration_core_api_echo_required_int_response_new_error( +CoreTestsPigeonTestHostIntegrationCoreApiEchoIntMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_int_map_response_new_error( const gchar* code, const gchar* message, FlValue* details); G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAllNullableTypesResponse, - core_tests_pigeon_test_host_integration_core_api_echo_all_nullable_types_response, - CORE_TESTS_PIGEON_TEST, - HOST_INTEGRATION_CORE_API_ECHO_ALL_NULLABLE_TYPES_RESPONSE, GObject) + CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumMapResponse, + core_tests_pigeon_test_host_integration_core_api_echo_enum_map_response, + CORE_TESTS_PIGEON_TEST, HOST_INTEGRATION_CORE_API_ECHO_ENUM_MAP_RESPONSE, + GObject) /** - * core_tests_pigeon_test_host_integration_core_api_echo_all_nullable_types_response_new: + * core_tests_pigeon_test_host_integration_core_api_echo_enum_map_response_new: * - * Creates a new response to HostIntegrationCoreApi.echoAllNullableTypes. + * Creates a new response to HostIntegrationCoreApi.echoEnumMap. * - * Returns: a new - * #CoreTestsPigeonTestHostIntegrationCoreApiEchoAllNullableTypesResponse + * Returns: a new #CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumMapResponse */ -CoreTestsPigeonTestHostIntegrationCoreApiEchoAllNullableTypesResponse* -core_tests_pigeon_test_host_integration_core_api_echo_all_nullable_types_response_new( - CoreTestsPigeonTestAllNullableTypes* return_value); +CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_enum_map_response_new( + FlValue* return_value); /** - * core_tests_pigeon_test_host_integration_core_api_echo_all_nullable_types_response_new_error: + * core_tests_pigeon_test_host_integration_core_api_echo_enum_map_response_new_error: * @code: error code. * @message: error message. * @details: (allow-none): error details or %NULL. * - * Creates a new error response to HostIntegrationCoreApi.echoAllNullableTypes. + * Creates a new error response to HostIntegrationCoreApi.echoEnumMap. * - * Returns: a new - * #CoreTestsPigeonTestHostIntegrationCoreApiEchoAllNullableTypesResponse + * Returns: a new #CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumMapResponse */ -CoreTestsPigeonTestHostIntegrationCoreApiEchoAllNullableTypesResponse* -core_tests_pigeon_test_host_integration_core_api_echo_all_nullable_types_response_new_error( +CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_enum_map_response_new_error( const gchar* code, const gchar* message, FlValue* details); G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponse, - core_tests_pigeon_test_host_integration_core_api_echo_all_nullable_types_without_recursion_response, - CORE_TESTS_PIGEON_TEST, - HOST_INTEGRATION_CORE_API_ECHO_ALL_NULLABLE_TYPES_WITHOUT_RECURSION_RESPONSE, + CoreTestsPigeonTestHostIntegrationCoreApiEchoClassMapResponse, + core_tests_pigeon_test_host_integration_core_api_echo_class_map_response, + CORE_TESTS_PIGEON_TEST, HOST_INTEGRATION_CORE_API_ECHO_CLASS_MAP_RESPONSE, GObject) /** - * core_tests_pigeon_test_host_integration_core_api_echo_all_nullable_types_without_recursion_response_new: + * core_tests_pigeon_test_host_integration_core_api_echo_class_map_response_new: * - * Creates a new response to - * HostIntegrationCoreApi.echoAllNullableTypesWithoutRecursion. + * Creates a new response to HostIntegrationCoreApi.echoClassMap. * - * Returns: a new - * #CoreTestsPigeonTestHostIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponse + * Returns: a new #CoreTestsPigeonTestHostIntegrationCoreApiEchoClassMapResponse */ -CoreTestsPigeonTestHostIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponse* -core_tests_pigeon_test_host_integration_core_api_echo_all_nullable_types_without_recursion_response_new( - CoreTestsPigeonTestAllNullableTypesWithoutRecursion* return_value); +CoreTestsPigeonTestHostIntegrationCoreApiEchoClassMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_class_map_response_new( + FlValue* return_value); /** - * core_tests_pigeon_test_host_integration_core_api_echo_all_nullable_types_without_recursion_response_new_error: + * core_tests_pigeon_test_host_integration_core_api_echo_class_map_response_new_error: * @code: error code. * @message: error message. * @details: (allow-none): error details or %NULL. * - * Creates a new error response to - * HostIntegrationCoreApi.echoAllNullableTypesWithoutRecursion. + * Creates a new error response to HostIntegrationCoreApi.echoClassMap. * - * Returns: a new - * #CoreTestsPigeonTestHostIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponse + * Returns: a new #CoreTestsPigeonTestHostIntegrationCoreApiEchoClassMapResponse */ -CoreTestsPigeonTestHostIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponse* -core_tests_pigeon_test_host_integration_core_api_echo_all_nullable_types_without_recursion_response_new_error( +CoreTestsPigeonTestHostIntegrationCoreApiEchoClassMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_class_map_response_new_error( const gchar* code, const gchar* message, FlValue* details); G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiExtractNestedNullableStringResponse, - core_tests_pigeon_test_host_integration_core_api_extract_nested_nullable_string_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullStringMapResponse, + core_tests_pigeon_test_host_integration_core_api_echo_non_null_string_map_response, CORE_TESTS_PIGEON_TEST, - HOST_INTEGRATION_CORE_API_EXTRACT_NESTED_NULLABLE_STRING_RESPONSE, GObject) + HOST_INTEGRATION_CORE_API_ECHO_NON_NULL_STRING_MAP_RESPONSE, GObject) /** - * core_tests_pigeon_test_host_integration_core_api_extract_nested_nullable_string_response_new: + * core_tests_pigeon_test_host_integration_core_api_echo_non_null_string_map_response_new: * - * Creates a new response to HostIntegrationCoreApi.extractNestedNullableString. + * Creates a new response to HostIntegrationCoreApi.echoNonNullStringMap. * * Returns: a new - * #CoreTestsPigeonTestHostIntegrationCoreApiExtractNestedNullableStringResponse + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullStringMapResponse */ -CoreTestsPigeonTestHostIntegrationCoreApiExtractNestedNullableStringResponse* -core_tests_pigeon_test_host_integration_core_api_extract_nested_nullable_string_response_new( - const gchar* return_value); +CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullStringMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_non_null_string_map_response_new( + FlValue* return_value); /** - * core_tests_pigeon_test_host_integration_core_api_extract_nested_nullable_string_response_new_error: + * core_tests_pigeon_test_host_integration_core_api_echo_non_null_string_map_response_new_error: * @code: error code. * @message: error message. * @details: (allow-none): error details or %NULL. * - * Creates a new error response to - * HostIntegrationCoreApi.extractNestedNullableString. + * Creates a new error response to HostIntegrationCoreApi.echoNonNullStringMap. * * Returns: a new - * #CoreTestsPigeonTestHostIntegrationCoreApiExtractNestedNullableStringResponse + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullStringMapResponse */ -CoreTestsPigeonTestHostIntegrationCoreApiExtractNestedNullableStringResponse* -core_tests_pigeon_test_host_integration_core_api_extract_nested_nullable_string_response_new_error( +CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullStringMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_non_null_string_map_response_new_error( const gchar* code, const gchar* message, FlValue* details); G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiCreateNestedNullableStringResponse, - core_tests_pigeon_test_host_integration_core_api_create_nested_nullable_string_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullIntMapResponse, + core_tests_pigeon_test_host_integration_core_api_echo_non_null_int_map_response, CORE_TESTS_PIGEON_TEST, - HOST_INTEGRATION_CORE_API_CREATE_NESTED_NULLABLE_STRING_RESPONSE, GObject) + HOST_INTEGRATION_CORE_API_ECHO_NON_NULL_INT_MAP_RESPONSE, GObject) /** - * core_tests_pigeon_test_host_integration_core_api_create_nested_nullable_string_response_new: + * core_tests_pigeon_test_host_integration_core_api_echo_non_null_int_map_response_new: * - * Creates a new response to HostIntegrationCoreApi.createNestedNullableString. + * Creates a new response to HostIntegrationCoreApi.echoNonNullIntMap. * * Returns: a new - * #CoreTestsPigeonTestHostIntegrationCoreApiCreateNestedNullableStringResponse + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullIntMapResponse */ -CoreTestsPigeonTestHostIntegrationCoreApiCreateNestedNullableStringResponse* -core_tests_pigeon_test_host_integration_core_api_create_nested_nullable_string_response_new( - CoreTestsPigeonTestAllClassesWrapper* return_value); +CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullIntMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_non_null_int_map_response_new( + FlValue* return_value); /** - * core_tests_pigeon_test_host_integration_core_api_create_nested_nullable_string_response_new_error: + * core_tests_pigeon_test_host_integration_core_api_echo_non_null_int_map_response_new_error: * @code: error code. * @message: error message. * @details: (allow-none): error details or %NULL. * - * Creates a new error response to - * HostIntegrationCoreApi.createNestedNullableString. + * Creates a new error response to HostIntegrationCoreApi.echoNonNullIntMap. * * Returns: a new - * #CoreTestsPigeonTestHostIntegrationCoreApiCreateNestedNullableStringResponse + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullIntMapResponse */ -CoreTestsPigeonTestHostIntegrationCoreApiCreateNestedNullableStringResponse* -core_tests_pigeon_test_host_integration_core_api_create_nested_nullable_string_response_new_error( +CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullIntMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_non_null_int_map_response_new_error( const gchar* code, const gchar* message, FlValue* details); G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiSendMultipleNullableTypesResponse, - core_tests_pigeon_test_host_integration_core_api_send_multiple_nullable_types_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullEnumMapResponse, + core_tests_pigeon_test_host_integration_core_api_echo_non_null_enum_map_response, CORE_TESTS_PIGEON_TEST, - HOST_INTEGRATION_CORE_API_SEND_MULTIPLE_NULLABLE_TYPES_RESPONSE, GObject) + HOST_INTEGRATION_CORE_API_ECHO_NON_NULL_ENUM_MAP_RESPONSE, GObject) /** - * core_tests_pigeon_test_host_integration_core_api_send_multiple_nullable_types_response_new: + * core_tests_pigeon_test_host_integration_core_api_echo_non_null_enum_map_response_new: * - * Creates a new response to HostIntegrationCoreApi.sendMultipleNullableTypes. + * Creates a new response to HostIntegrationCoreApi.echoNonNullEnumMap. * * Returns: a new - * #CoreTestsPigeonTestHostIntegrationCoreApiSendMultipleNullableTypesResponse + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullEnumMapResponse */ -CoreTestsPigeonTestHostIntegrationCoreApiSendMultipleNullableTypesResponse* -core_tests_pigeon_test_host_integration_core_api_send_multiple_nullable_types_response_new( - CoreTestsPigeonTestAllNullableTypes* return_value); +CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullEnumMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_non_null_enum_map_response_new( + FlValue* return_value); /** - * core_tests_pigeon_test_host_integration_core_api_send_multiple_nullable_types_response_new_error: + * core_tests_pigeon_test_host_integration_core_api_echo_non_null_enum_map_response_new_error: * @code: error code. * @message: error message. * @details: (allow-none): error details or %NULL. * - * Creates a new error response to - * HostIntegrationCoreApi.sendMultipleNullableTypes. + * Creates a new error response to HostIntegrationCoreApi.echoNonNullEnumMap. * * Returns: a new - * #CoreTestsPigeonTestHostIntegrationCoreApiSendMultipleNullableTypesResponse + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullEnumMapResponse */ -CoreTestsPigeonTestHostIntegrationCoreApiSendMultipleNullableTypesResponse* -core_tests_pigeon_test_host_integration_core_api_send_multiple_nullable_types_response_new_error( +CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullEnumMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_non_null_enum_map_response_new_error( const gchar* code, const gchar* message, FlValue* details); G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponse, - core_tests_pigeon_test_host_integration_core_api_send_multiple_nullable_types_without_recursion_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullClassMapResponse, + core_tests_pigeon_test_host_integration_core_api_echo_non_null_class_map_response, CORE_TESTS_PIGEON_TEST, - HOST_INTEGRATION_CORE_API_SEND_MULTIPLE_NULLABLE_TYPES_WITHOUT_RECURSION_RESPONSE, - GObject) + HOST_INTEGRATION_CORE_API_ECHO_NON_NULL_CLASS_MAP_RESPONSE, GObject) /** - * core_tests_pigeon_test_host_integration_core_api_send_multiple_nullable_types_without_recursion_response_new: + * core_tests_pigeon_test_host_integration_core_api_echo_non_null_class_map_response_new: * - * Creates a new response to - * HostIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion. + * Creates a new response to HostIntegrationCoreApi.echoNonNullClassMap. * * Returns: a new - * #CoreTestsPigeonTestHostIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponse + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullClassMapResponse */ -CoreTestsPigeonTestHostIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponse* -core_tests_pigeon_test_host_integration_core_api_send_multiple_nullable_types_without_recursion_response_new( - CoreTestsPigeonTestAllNullableTypesWithoutRecursion* return_value); +CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullClassMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_non_null_class_map_response_new( + FlValue* return_value); /** - * core_tests_pigeon_test_host_integration_core_api_send_multiple_nullable_types_without_recursion_response_new_error: + * core_tests_pigeon_test_host_integration_core_api_echo_non_null_class_map_response_new_error: * @code: error code. * @message: error message. * @details: (allow-none): error details or %NULL. * - * Creates a new error response to - * HostIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion. + * Creates a new error response to HostIntegrationCoreApi.echoNonNullClassMap. * * Returns: a new - * #CoreTestsPigeonTestHostIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponse + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullClassMapResponse */ -CoreTestsPigeonTestHostIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponse* -core_tests_pigeon_test_host_integration_core_api_send_multiple_nullable_types_without_recursion_response_new_error( +CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullClassMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_non_null_class_map_response_new_error( const gchar* code, const gchar* message, FlValue* details); G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableIntResponse, - core_tests_pigeon_test_host_integration_core_api_echo_nullable_int_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoClassWrapperResponse, + core_tests_pigeon_test_host_integration_core_api_echo_class_wrapper_response, CORE_TESTS_PIGEON_TEST, - HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_INT_RESPONSE, GObject) + HOST_INTEGRATION_CORE_API_ECHO_CLASS_WRAPPER_RESPONSE, GObject) /** - * core_tests_pigeon_test_host_integration_core_api_echo_nullable_int_response_new: + * core_tests_pigeon_test_host_integration_core_api_echo_class_wrapper_response_new: * - * Creates a new response to HostIntegrationCoreApi.echoNullableInt. + * Creates a new response to HostIntegrationCoreApi.echoClassWrapper. * * Returns: a new - * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableIntResponse + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoClassWrapperResponse */ -CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableIntResponse* -core_tests_pigeon_test_host_integration_core_api_echo_nullable_int_response_new( - int64_t* return_value); +CoreTestsPigeonTestHostIntegrationCoreApiEchoClassWrapperResponse* +core_tests_pigeon_test_host_integration_core_api_echo_class_wrapper_response_new( + CoreTestsPigeonTestAllClassesWrapper* return_value); /** - * core_tests_pigeon_test_host_integration_core_api_echo_nullable_int_response_new_error: + * core_tests_pigeon_test_host_integration_core_api_echo_class_wrapper_response_new_error: * @code: error code. * @message: error message. * @details: (allow-none): error details or %NULL. * - * Creates a new error response to HostIntegrationCoreApi.echoNullableInt. + * Creates a new error response to HostIntegrationCoreApi.echoClassWrapper. * * Returns: a new - * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableIntResponse + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoClassWrapperResponse */ -CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableIntResponse* -core_tests_pigeon_test_host_integration_core_api_echo_nullable_int_response_new_error( +CoreTestsPigeonTestHostIntegrationCoreApiEchoClassWrapperResponse* +core_tests_pigeon_test_host_integration_core_api_echo_class_wrapper_response_new_error( const gchar* code, const gchar* message, FlValue* details); G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableDoubleResponse, - core_tests_pigeon_test_host_integration_core_api_echo_nullable_double_response, - CORE_TESTS_PIGEON_TEST, - HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_DOUBLE_RESPONSE, GObject) + CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumResponse, + core_tests_pigeon_test_host_integration_core_api_echo_enum_response, + CORE_TESTS_PIGEON_TEST, HOST_INTEGRATION_CORE_API_ECHO_ENUM_RESPONSE, + GObject) /** - * core_tests_pigeon_test_host_integration_core_api_echo_nullable_double_response_new: + * core_tests_pigeon_test_host_integration_core_api_echo_enum_response_new: * - * Creates a new response to HostIntegrationCoreApi.echoNullableDouble. + * Creates a new response to HostIntegrationCoreApi.echoEnum. * - * Returns: a new - * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableDoubleResponse + * Returns: a new #CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumResponse */ -CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableDoubleResponse* -core_tests_pigeon_test_host_integration_core_api_echo_nullable_double_response_new( - double* return_value); +CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumResponse* +core_tests_pigeon_test_host_integration_core_api_echo_enum_response_new( + CoreTestsPigeonTestAnEnum return_value); /** - * core_tests_pigeon_test_host_integration_core_api_echo_nullable_double_response_new_error: + * core_tests_pigeon_test_host_integration_core_api_echo_enum_response_new_error: * @code: error code. * @message: error message. * @details: (allow-none): error details or %NULL. * - * Creates a new error response to HostIntegrationCoreApi.echoNullableDouble. + * Creates a new error response to HostIntegrationCoreApi.echoEnum. * - * Returns: a new - * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableDoubleResponse + * Returns: a new #CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumResponse */ -CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableDoubleResponse* -core_tests_pigeon_test_host_integration_core_api_echo_nullable_double_response_new_error( +CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumResponse* +core_tests_pigeon_test_host_integration_core_api_echo_enum_response_new_error( const gchar* code, const gchar* message, FlValue* details); G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableBoolResponse, - core_tests_pigeon_test_host_integration_core_api_echo_nullable_bool_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherEnumResponse, + core_tests_pigeon_test_host_integration_core_api_echo_another_enum_response, CORE_TESTS_PIGEON_TEST, - HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_BOOL_RESPONSE, GObject) + HOST_INTEGRATION_CORE_API_ECHO_ANOTHER_ENUM_RESPONSE, GObject) /** - * core_tests_pigeon_test_host_integration_core_api_echo_nullable_bool_response_new: + * core_tests_pigeon_test_host_integration_core_api_echo_another_enum_response_new: * - * Creates a new response to HostIntegrationCoreApi.echoNullableBool. + * Creates a new response to HostIntegrationCoreApi.echoAnotherEnum. * * Returns: a new - * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableBoolResponse + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherEnumResponse */ -CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableBoolResponse* -core_tests_pigeon_test_host_integration_core_api_echo_nullable_bool_response_new( - gboolean* return_value); +CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherEnumResponse* +core_tests_pigeon_test_host_integration_core_api_echo_another_enum_response_new( + CoreTestsPigeonTestAnotherEnum return_value); /** - * core_tests_pigeon_test_host_integration_core_api_echo_nullable_bool_response_new_error: + * core_tests_pigeon_test_host_integration_core_api_echo_another_enum_response_new_error: * @code: error code. * @message: error message. * @details: (allow-none): error details or %NULL. * - * Creates a new error response to HostIntegrationCoreApi.echoNullableBool. + * Creates a new error response to HostIntegrationCoreApi.echoAnotherEnum. * * Returns: a new - * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableBoolResponse + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherEnumResponse */ -CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableBoolResponse* -core_tests_pigeon_test_host_integration_core_api_echo_nullable_bool_response_new_error( +CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherEnumResponse* +core_tests_pigeon_test_host_integration_core_api_echo_another_enum_response_new_error( const gchar* code, const gchar* message, FlValue* details); G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableStringResponse, - core_tests_pigeon_test_host_integration_core_api_echo_nullable_string_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoNamedDefaultStringResponse, + core_tests_pigeon_test_host_integration_core_api_echo_named_default_string_response, CORE_TESTS_PIGEON_TEST, - HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_STRING_RESPONSE, GObject) + HOST_INTEGRATION_CORE_API_ECHO_NAMED_DEFAULT_STRING_RESPONSE, GObject) /** - * core_tests_pigeon_test_host_integration_core_api_echo_nullable_string_response_new: + * core_tests_pigeon_test_host_integration_core_api_echo_named_default_string_response_new: * - * Creates a new response to HostIntegrationCoreApi.echoNullableString. + * Creates a new response to HostIntegrationCoreApi.echoNamedDefaultString. * * Returns: a new - * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableStringResponse + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNamedDefaultStringResponse */ -CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableStringResponse* -core_tests_pigeon_test_host_integration_core_api_echo_nullable_string_response_new( +CoreTestsPigeonTestHostIntegrationCoreApiEchoNamedDefaultStringResponse* +core_tests_pigeon_test_host_integration_core_api_echo_named_default_string_response_new( const gchar* return_value); /** - * core_tests_pigeon_test_host_integration_core_api_echo_nullable_string_response_new_error: + * core_tests_pigeon_test_host_integration_core_api_echo_named_default_string_response_new_error: * @code: error code. * @message: error message. * @details: (allow-none): error details or %NULL. * - * Creates a new error response to HostIntegrationCoreApi.echoNullableString. + * Creates a new error response to + * HostIntegrationCoreApi.echoNamedDefaultString. * * Returns: a new - * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableStringResponse + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNamedDefaultStringResponse */ -CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableStringResponse* -core_tests_pigeon_test_host_integration_core_api_echo_nullable_string_response_new_error( +CoreTestsPigeonTestHostIntegrationCoreApiEchoNamedDefaultStringResponse* +core_tests_pigeon_test_host_integration_core_api_echo_named_default_string_response_new_error( const gchar* code, const gchar* message, FlValue* details); G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableUint8ListResponse, - core_tests_pigeon_test_host_integration_core_api_echo_nullable_uint8_list_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoOptionalDefaultDoubleResponse, + core_tests_pigeon_test_host_integration_core_api_echo_optional_default_double_response, CORE_TESTS_PIGEON_TEST, - HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_UINT8_LIST_RESPONSE, GObject) + HOST_INTEGRATION_CORE_API_ECHO_OPTIONAL_DEFAULT_DOUBLE_RESPONSE, GObject) /** - * core_tests_pigeon_test_host_integration_core_api_echo_nullable_uint8_list_response_new: + * core_tests_pigeon_test_host_integration_core_api_echo_optional_default_double_response_new: * - * Creates a new response to HostIntegrationCoreApi.echoNullableUint8List. + * Creates a new response to HostIntegrationCoreApi.echoOptionalDefaultDouble. * * Returns: a new - * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableUint8ListResponse + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoOptionalDefaultDoubleResponse */ -CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableUint8ListResponse* -core_tests_pigeon_test_host_integration_core_api_echo_nullable_uint8_list_response_new( - const uint8_t* return_value, size_t return_value_length); +CoreTestsPigeonTestHostIntegrationCoreApiEchoOptionalDefaultDoubleResponse* +core_tests_pigeon_test_host_integration_core_api_echo_optional_default_double_response_new( + double return_value); /** - * core_tests_pigeon_test_host_integration_core_api_echo_nullable_uint8_list_response_new_error: + * core_tests_pigeon_test_host_integration_core_api_echo_optional_default_double_response_new_error: * @code: error code. * @message: error message. * @details: (allow-none): error details or %NULL. * - * Creates a new error response to HostIntegrationCoreApi.echoNullableUint8List. + * Creates a new error response to + * HostIntegrationCoreApi.echoOptionalDefaultDouble. * * Returns: a new - * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableUint8ListResponse + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoOptionalDefaultDoubleResponse */ -CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableUint8ListResponse* -core_tests_pigeon_test_host_integration_core_api_echo_nullable_uint8_list_response_new_error( +CoreTestsPigeonTestHostIntegrationCoreApiEchoOptionalDefaultDoubleResponse* +core_tests_pigeon_test_host_integration_core_api_echo_optional_default_double_response_new_error( const gchar* code, const gchar* message, FlValue* details); G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableObjectResponse, - core_tests_pigeon_test_host_integration_core_api_echo_nullable_object_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoRequiredIntResponse, + core_tests_pigeon_test_host_integration_core_api_echo_required_int_response, CORE_TESTS_PIGEON_TEST, - HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_OBJECT_RESPONSE, GObject) + HOST_INTEGRATION_CORE_API_ECHO_REQUIRED_INT_RESPONSE, GObject) /** - * core_tests_pigeon_test_host_integration_core_api_echo_nullable_object_response_new: + * core_tests_pigeon_test_host_integration_core_api_echo_required_int_response_new: * - * Creates a new response to HostIntegrationCoreApi.echoNullableObject. + * Creates a new response to HostIntegrationCoreApi.echoRequiredInt. * * Returns: a new - * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableObjectResponse + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoRequiredIntResponse */ -CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableObjectResponse* -core_tests_pigeon_test_host_integration_core_api_echo_nullable_object_response_new( - FlValue* return_value); +CoreTestsPigeonTestHostIntegrationCoreApiEchoRequiredIntResponse* +core_tests_pigeon_test_host_integration_core_api_echo_required_int_response_new( + int64_t return_value); /** - * core_tests_pigeon_test_host_integration_core_api_echo_nullable_object_response_new_error: + * core_tests_pigeon_test_host_integration_core_api_echo_required_int_response_new_error: * @code: error code. * @message: error message. * @details: (allow-none): error details or %NULL. * - * Creates a new error response to HostIntegrationCoreApi.echoNullableObject. + * Creates a new error response to HostIntegrationCoreApi.echoRequiredInt. * * Returns: a new - * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableObjectResponse + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoRequiredIntResponse */ -CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableObjectResponse* -core_tests_pigeon_test_host_integration_core_api_echo_nullable_object_response_new_error( +CoreTestsPigeonTestHostIntegrationCoreApiEchoRequiredIntResponse* +core_tests_pigeon_test_host_integration_core_api_echo_required_int_response_new_error( const gchar* code, const gchar* message, FlValue* details); G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableListResponse, - core_tests_pigeon_test_host_integration_core_api_echo_nullable_list_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoAllNullableTypesResponse, + core_tests_pigeon_test_host_integration_core_api_echo_all_nullable_types_response, CORE_TESTS_PIGEON_TEST, - HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_LIST_RESPONSE, GObject) + HOST_INTEGRATION_CORE_API_ECHO_ALL_NULLABLE_TYPES_RESPONSE, GObject) /** - * core_tests_pigeon_test_host_integration_core_api_echo_nullable_list_response_new: + * core_tests_pigeon_test_host_integration_core_api_echo_all_nullable_types_response_new: * - * Creates a new response to HostIntegrationCoreApi.echoNullableList. + * Creates a new response to HostIntegrationCoreApi.echoAllNullableTypes. * * Returns: a new - * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableListResponse + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoAllNullableTypesResponse */ -CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableListResponse* -core_tests_pigeon_test_host_integration_core_api_echo_nullable_list_response_new( - FlValue* return_value); +CoreTestsPigeonTestHostIntegrationCoreApiEchoAllNullableTypesResponse* +core_tests_pigeon_test_host_integration_core_api_echo_all_nullable_types_response_new( + CoreTestsPigeonTestAllNullableTypes* return_value); /** - * core_tests_pigeon_test_host_integration_core_api_echo_nullable_list_response_new_error: + * core_tests_pigeon_test_host_integration_core_api_echo_all_nullable_types_response_new_error: * @code: error code. * @message: error message. * @details: (allow-none): error details or %NULL. * - * Creates a new error response to HostIntegrationCoreApi.echoNullableList. + * Creates a new error response to HostIntegrationCoreApi.echoAllNullableTypes. * * Returns: a new - * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableListResponse + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoAllNullableTypesResponse */ -CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableListResponse* -core_tests_pigeon_test_host_integration_core_api_echo_nullable_list_response_new_error( +CoreTestsPigeonTestHostIntegrationCoreApiEchoAllNullableTypesResponse* +core_tests_pigeon_test_host_integration_core_api_echo_all_nullable_types_response_new_error( const gchar* code, const gchar* message, FlValue* details); G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableMapResponse, - core_tests_pigeon_test_host_integration_core_api_echo_nullable_map_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponse, + core_tests_pigeon_test_host_integration_core_api_echo_all_nullable_types_without_recursion_response, CORE_TESTS_PIGEON_TEST, - HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_MAP_RESPONSE, GObject) + HOST_INTEGRATION_CORE_API_ECHO_ALL_NULLABLE_TYPES_WITHOUT_RECURSION_RESPONSE, + GObject) /** - * core_tests_pigeon_test_host_integration_core_api_echo_nullable_map_response_new: + * core_tests_pigeon_test_host_integration_core_api_echo_all_nullable_types_without_recursion_response_new: * - * Creates a new response to HostIntegrationCoreApi.echoNullableMap. + * Creates a new response to + * HostIntegrationCoreApi.echoAllNullableTypesWithoutRecursion. * * Returns: a new - * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableMapResponse + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponse */ -CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableMapResponse* -core_tests_pigeon_test_host_integration_core_api_echo_nullable_map_response_new( - FlValue* return_value); +CoreTestsPigeonTestHostIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponse* +core_tests_pigeon_test_host_integration_core_api_echo_all_nullable_types_without_recursion_response_new( + CoreTestsPigeonTestAllNullableTypesWithoutRecursion* return_value); /** - * core_tests_pigeon_test_host_integration_core_api_echo_nullable_map_response_new_error: + * core_tests_pigeon_test_host_integration_core_api_echo_all_nullable_types_without_recursion_response_new_error: * @code: error code. * @message: error message. * @details: (allow-none): error details or %NULL. * - * Creates a new error response to HostIntegrationCoreApi.echoNullableMap. + * Creates a new error response to + * HostIntegrationCoreApi.echoAllNullableTypesWithoutRecursion. * * Returns: a new - * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableMapResponse + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponse */ -CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableMapResponse* -core_tests_pigeon_test_host_integration_core_api_echo_nullable_map_response_new_error( +CoreTestsPigeonTestHostIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponse* +core_tests_pigeon_test_host_integration_core_api_echo_all_nullable_types_without_recursion_response_new_error( const gchar* code, const gchar* message, FlValue* details); G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableEnumResponse, - core_tests_pigeon_test_host_integration_core_api_echo_nullable_enum_response, + CoreTestsPigeonTestHostIntegrationCoreApiExtractNestedNullableStringResponse, + core_tests_pigeon_test_host_integration_core_api_extract_nested_nullable_string_response, CORE_TESTS_PIGEON_TEST, - HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_ENUM_RESPONSE, GObject) + HOST_INTEGRATION_CORE_API_EXTRACT_NESTED_NULLABLE_STRING_RESPONSE, GObject) /** - * core_tests_pigeon_test_host_integration_core_api_echo_nullable_enum_response_new: + * core_tests_pigeon_test_host_integration_core_api_extract_nested_nullable_string_response_new: * - * Creates a new response to HostIntegrationCoreApi.echoNullableEnum. + * Creates a new response to HostIntegrationCoreApi.extractNestedNullableString. * * Returns: a new - * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableEnumResponse + * #CoreTestsPigeonTestHostIntegrationCoreApiExtractNestedNullableStringResponse */ -CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableEnumResponse* -core_tests_pigeon_test_host_integration_core_api_echo_nullable_enum_response_new( - CoreTestsPigeonTestAnEnum* return_value); +CoreTestsPigeonTestHostIntegrationCoreApiExtractNestedNullableStringResponse* +core_tests_pigeon_test_host_integration_core_api_extract_nested_nullable_string_response_new( + const gchar* return_value); /** - * core_tests_pigeon_test_host_integration_core_api_echo_nullable_enum_response_new_error: + * core_tests_pigeon_test_host_integration_core_api_extract_nested_nullable_string_response_new_error: * @code: error code. * @message: error message. * @details: (allow-none): error details or %NULL. * - * Creates a new error response to HostIntegrationCoreApi.echoNullableEnum. + * Creates a new error response to + * HostIntegrationCoreApi.extractNestedNullableString. * * Returns: a new - * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableEnumResponse + * #CoreTestsPigeonTestHostIntegrationCoreApiExtractNestedNullableStringResponse */ -CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableEnumResponse* -core_tests_pigeon_test_host_integration_core_api_echo_nullable_enum_response_new_error( +CoreTestsPigeonTestHostIntegrationCoreApiExtractNestedNullableStringResponse* +core_tests_pigeon_test_host_integration_core_api_extract_nested_nullable_string_response_new_error( const gchar* code, const gchar* message, FlValue* details); G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherNullableEnumResponse, - core_tests_pigeon_test_host_integration_core_api_echo_another_nullable_enum_response, + CoreTestsPigeonTestHostIntegrationCoreApiCreateNestedNullableStringResponse, + core_tests_pigeon_test_host_integration_core_api_create_nested_nullable_string_response, CORE_TESTS_PIGEON_TEST, - HOST_INTEGRATION_CORE_API_ECHO_ANOTHER_NULLABLE_ENUM_RESPONSE, GObject) + HOST_INTEGRATION_CORE_API_CREATE_NESTED_NULLABLE_STRING_RESPONSE, GObject) /** - * core_tests_pigeon_test_host_integration_core_api_echo_another_nullable_enum_response_new: + * core_tests_pigeon_test_host_integration_core_api_create_nested_nullable_string_response_new: * - * Creates a new response to HostIntegrationCoreApi.echoAnotherNullableEnum. + * Creates a new response to HostIntegrationCoreApi.createNestedNullableString. * * Returns: a new - * #CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherNullableEnumResponse + * #CoreTestsPigeonTestHostIntegrationCoreApiCreateNestedNullableStringResponse */ -CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherNullableEnumResponse* -core_tests_pigeon_test_host_integration_core_api_echo_another_nullable_enum_response_new( - CoreTestsPigeonTestAnotherEnum* return_value); +CoreTestsPigeonTestHostIntegrationCoreApiCreateNestedNullableStringResponse* +core_tests_pigeon_test_host_integration_core_api_create_nested_nullable_string_response_new( + CoreTestsPigeonTestAllClassesWrapper* return_value); /** - * core_tests_pigeon_test_host_integration_core_api_echo_another_nullable_enum_response_new_error: + * core_tests_pigeon_test_host_integration_core_api_create_nested_nullable_string_response_new_error: * @code: error code. * @message: error message. * @details: (allow-none): error details or %NULL. * * Creates a new error response to - * HostIntegrationCoreApi.echoAnotherNullableEnum. + * HostIntegrationCoreApi.createNestedNullableString. * * Returns: a new - * #CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherNullableEnumResponse + * #CoreTestsPigeonTestHostIntegrationCoreApiCreateNestedNullableStringResponse */ -CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherNullableEnumResponse* -core_tests_pigeon_test_host_integration_core_api_echo_another_nullable_enum_response_new_error( +CoreTestsPigeonTestHostIntegrationCoreApiCreateNestedNullableStringResponse* +core_tests_pigeon_test_host_integration_core_api_create_nested_nullable_string_response_new_error( const gchar* code, const gchar* message, FlValue* details); G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoOptionalNullableIntResponse, - core_tests_pigeon_test_host_integration_core_api_echo_optional_nullable_int_response, + CoreTestsPigeonTestHostIntegrationCoreApiSendMultipleNullableTypesResponse, + core_tests_pigeon_test_host_integration_core_api_send_multiple_nullable_types_response, CORE_TESTS_PIGEON_TEST, - HOST_INTEGRATION_CORE_API_ECHO_OPTIONAL_NULLABLE_INT_RESPONSE, GObject) + HOST_INTEGRATION_CORE_API_SEND_MULTIPLE_NULLABLE_TYPES_RESPONSE, GObject) /** - * core_tests_pigeon_test_host_integration_core_api_echo_optional_nullable_int_response_new: + * core_tests_pigeon_test_host_integration_core_api_send_multiple_nullable_types_response_new: * - * Creates a new response to HostIntegrationCoreApi.echoOptionalNullableInt. + * Creates a new response to HostIntegrationCoreApi.sendMultipleNullableTypes. * * Returns: a new - * #CoreTestsPigeonTestHostIntegrationCoreApiEchoOptionalNullableIntResponse + * #CoreTestsPigeonTestHostIntegrationCoreApiSendMultipleNullableTypesResponse */ -CoreTestsPigeonTestHostIntegrationCoreApiEchoOptionalNullableIntResponse* -core_tests_pigeon_test_host_integration_core_api_echo_optional_nullable_int_response_new( - int64_t* return_value); +CoreTestsPigeonTestHostIntegrationCoreApiSendMultipleNullableTypesResponse* +core_tests_pigeon_test_host_integration_core_api_send_multiple_nullable_types_response_new( + CoreTestsPigeonTestAllNullableTypes* return_value); /** - * core_tests_pigeon_test_host_integration_core_api_echo_optional_nullable_int_response_new_error: + * core_tests_pigeon_test_host_integration_core_api_send_multiple_nullable_types_response_new_error: * @code: error code. * @message: error message. * @details: (allow-none): error details or %NULL. * * Creates a new error response to - * HostIntegrationCoreApi.echoOptionalNullableInt. + * HostIntegrationCoreApi.sendMultipleNullableTypes. * * Returns: a new - * #CoreTestsPigeonTestHostIntegrationCoreApiEchoOptionalNullableIntResponse + * #CoreTestsPigeonTestHostIntegrationCoreApiSendMultipleNullableTypesResponse */ -CoreTestsPigeonTestHostIntegrationCoreApiEchoOptionalNullableIntResponse* -core_tests_pigeon_test_host_integration_core_api_echo_optional_nullable_int_response_new_error( +CoreTestsPigeonTestHostIntegrationCoreApiSendMultipleNullableTypesResponse* +core_tests_pigeon_test_host_integration_core_api_send_multiple_nullable_types_response_new_error( const gchar* code, const gchar* message, FlValue* details); G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoNamedNullableStringResponse, - core_tests_pigeon_test_host_integration_core_api_echo_named_nullable_string_response, + CoreTestsPigeonTestHostIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponse, + core_tests_pigeon_test_host_integration_core_api_send_multiple_nullable_types_without_recursion_response, CORE_TESTS_PIGEON_TEST, - HOST_INTEGRATION_CORE_API_ECHO_NAMED_NULLABLE_STRING_RESPONSE, GObject) + HOST_INTEGRATION_CORE_API_SEND_MULTIPLE_NULLABLE_TYPES_WITHOUT_RECURSION_RESPONSE, + GObject) /** - * core_tests_pigeon_test_host_integration_core_api_echo_named_nullable_string_response_new: + * core_tests_pigeon_test_host_integration_core_api_send_multiple_nullable_types_without_recursion_response_new: * - * Creates a new response to HostIntegrationCoreApi.echoNamedNullableString. + * Creates a new response to + * HostIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion. * * Returns: a new - * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNamedNullableStringResponse + * #CoreTestsPigeonTestHostIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponse */ -CoreTestsPigeonTestHostIntegrationCoreApiEchoNamedNullableStringResponse* -core_tests_pigeon_test_host_integration_core_api_echo_named_nullable_string_response_new( - const gchar* return_value); +CoreTestsPigeonTestHostIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponse* +core_tests_pigeon_test_host_integration_core_api_send_multiple_nullable_types_without_recursion_response_new( + CoreTestsPigeonTestAllNullableTypesWithoutRecursion* return_value); /** - * core_tests_pigeon_test_host_integration_core_api_echo_named_nullable_string_response_new_error: + * core_tests_pigeon_test_host_integration_core_api_send_multiple_nullable_types_without_recursion_response_new_error: * @code: error code. * @message: error message. * @details: (allow-none): error details or %NULL. * * Creates a new error response to - * HostIntegrationCoreApi.echoNamedNullableString. + * HostIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion. * * Returns: a new - * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNamedNullableStringResponse + * #CoreTestsPigeonTestHostIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponse */ -CoreTestsPigeonTestHostIntegrationCoreApiEchoNamedNullableStringResponse* -core_tests_pigeon_test_host_integration_core_api_echo_named_nullable_string_response_new_error( +CoreTestsPigeonTestHostIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponse* +core_tests_pigeon_test_host_integration_core_api_send_multiple_nullable_types_without_recursion_response_new_error( const gchar* code, const gchar* message, FlValue* details); +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableIntResponse, + core_tests_pigeon_test_host_integration_core_api_echo_nullable_int_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_INT_RESPONSE, GObject) + /** - * CoreTestsPigeonTestHostIntegrationCoreApiVTable: + * core_tests_pigeon_test_host_integration_core_api_echo_nullable_int_response_new: * - * Table of functions exposed by HostIntegrationCoreApi to be implemented by the - * API provider. + * Creates a new response to HostIntegrationCoreApi.echoNullableInt. + * + * Returns: a new + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableIntResponse */ -typedef struct { - CoreTestsPigeonTestHostIntegrationCoreApiNoopResponse* (*noop)( - gpointer user_data); - CoreTestsPigeonTestHostIntegrationCoreApiEchoAllTypesResponse* ( - *echo_all_types)(CoreTestsPigeonTestAllTypes* everything, - gpointer user_data); - CoreTestsPigeonTestHostIntegrationCoreApiThrowErrorResponse* (*throw_error)( - gpointer user_data); - CoreTestsPigeonTestHostIntegrationCoreApiThrowErrorFromVoidResponse* ( - *throw_error_from_void)(gpointer user_data); - CoreTestsPigeonTestHostIntegrationCoreApiThrowFlutterErrorResponse* ( - *throw_flutter_error)(gpointer user_data); - CoreTestsPigeonTestHostIntegrationCoreApiEchoIntResponse* (*echo_int)( - int64_t an_int, gpointer user_data); - CoreTestsPigeonTestHostIntegrationCoreApiEchoDoubleResponse* (*echo_double)( - double a_double, gpointer user_data); - CoreTestsPigeonTestHostIntegrationCoreApiEchoBoolResponse* (*echo_bool)( - gboolean a_bool, gpointer user_data); - CoreTestsPigeonTestHostIntegrationCoreApiEchoStringResponse* (*echo_string)( - const gchar* a_string, gpointer user_data); - CoreTestsPigeonTestHostIntegrationCoreApiEchoUint8ListResponse* ( - *echo_uint8_list)(const uint8_t* a_uint8_list, size_t a_uint8_list_length, - gpointer user_data); - CoreTestsPigeonTestHostIntegrationCoreApiEchoObjectResponse* (*echo_object)( - FlValue* an_object, gpointer user_data); - CoreTestsPigeonTestHostIntegrationCoreApiEchoListResponse* (*echo_list)( - FlValue* list, gpointer user_data); - CoreTestsPigeonTestHostIntegrationCoreApiEchoMapResponse* (*echo_map)( - FlValue* a_map, gpointer user_data); - CoreTestsPigeonTestHostIntegrationCoreApiEchoClassWrapperResponse* ( - *echo_class_wrapper)(CoreTestsPigeonTestAllClassesWrapper* wrapper, - gpointer user_data); - CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumResponse* (*echo_enum)( - CoreTestsPigeonTestAnEnum an_enum, gpointer user_data); - CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherEnumResponse* ( - *echo_another_enum)(CoreTestsPigeonTestAnotherEnum another_enum, - gpointer user_data); - CoreTestsPigeonTestHostIntegrationCoreApiEchoNamedDefaultStringResponse* ( +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableIntResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_int_response_new( + int64_t* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_echo_nullable_int_response_new_error: + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Creates a new error response to HostIntegrationCoreApi.echoNullableInt. + * + * Returns: a new + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableIntResponse + */ +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableIntResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_int_response_new_error( + const gchar* code, const gchar* message, FlValue* details); + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableDoubleResponse, + core_tests_pigeon_test_host_integration_core_api_echo_nullable_double_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_DOUBLE_RESPONSE, GObject) + +/** + * core_tests_pigeon_test_host_integration_core_api_echo_nullable_double_response_new: + * + * Creates a new response to HostIntegrationCoreApi.echoNullableDouble. + * + * Returns: a new + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableDoubleResponse + */ +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableDoubleResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_double_response_new( + double* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_echo_nullable_double_response_new_error: + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Creates a new error response to HostIntegrationCoreApi.echoNullableDouble. + * + * Returns: a new + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableDoubleResponse + */ +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableDoubleResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_double_response_new_error( + const gchar* code, const gchar* message, FlValue* details); + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableBoolResponse, + core_tests_pigeon_test_host_integration_core_api_echo_nullable_bool_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_BOOL_RESPONSE, GObject) + +/** + * core_tests_pigeon_test_host_integration_core_api_echo_nullable_bool_response_new: + * + * Creates a new response to HostIntegrationCoreApi.echoNullableBool. + * + * Returns: a new + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableBoolResponse + */ +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableBoolResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_bool_response_new( + gboolean* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_echo_nullable_bool_response_new_error: + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Creates a new error response to HostIntegrationCoreApi.echoNullableBool. + * + * Returns: a new + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableBoolResponse + */ +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableBoolResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_bool_response_new_error( + const gchar* code, const gchar* message, FlValue* details); + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableStringResponse, + core_tests_pigeon_test_host_integration_core_api_echo_nullable_string_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_STRING_RESPONSE, GObject) + +/** + * core_tests_pigeon_test_host_integration_core_api_echo_nullable_string_response_new: + * + * Creates a new response to HostIntegrationCoreApi.echoNullableString. + * + * Returns: a new + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableStringResponse + */ +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableStringResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_string_response_new( + const gchar* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_echo_nullable_string_response_new_error: + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Creates a new error response to HostIntegrationCoreApi.echoNullableString. + * + * Returns: a new + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableStringResponse + */ +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableStringResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_string_response_new_error( + const gchar* code, const gchar* message, FlValue* details); + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableUint8ListResponse, + core_tests_pigeon_test_host_integration_core_api_echo_nullable_uint8_list_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_UINT8_LIST_RESPONSE, GObject) + +/** + * core_tests_pigeon_test_host_integration_core_api_echo_nullable_uint8_list_response_new: + * + * Creates a new response to HostIntegrationCoreApi.echoNullableUint8List. + * + * Returns: a new + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableUint8ListResponse + */ +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableUint8ListResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_uint8_list_response_new( + const uint8_t* return_value, size_t return_value_length); + +/** + * core_tests_pigeon_test_host_integration_core_api_echo_nullable_uint8_list_response_new_error: + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Creates a new error response to HostIntegrationCoreApi.echoNullableUint8List. + * + * Returns: a new + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableUint8ListResponse + */ +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableUint8ListResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_uint8_list_response_new_error( + const gchar* code, const gchar* message, FlValue* details); + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableObjectResponse, + core_tests_pigeon_test_host_integration_core_api_echo_nullable_object_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_OBJECT_RESPONSE, GObject) + +/** + * core_tests_pigeon_test_host_integration_core_api_echo_nullable_object_response_new: + * + * Creates a new response to HostIntegrationCoreApi.echoNullableObject. + * + * Returns: a new + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableObjectResponse + */ +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableObjectResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_object_response_new( + FlValue* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_echo_nullable_object_response_new_error: + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Creates a new error response to HostIntegrationCoreApi.echoNullableObject. + * + * Returns: a new + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableObjectResponse + */ +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableObjectResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_object_response_new_error( + const gchar* code, const gchar* message, FlValue* details); + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableListResponse, + core_tests_pigeon_test_host_integration_core_api_echo_nullable_list_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_LIST_RESPONSE, GObject) + +/** + * core_tests_pigeon_test_host_integration_core_api_echo_nullable_list_response_new: + * + * Creates a new response to HostIntegrationCoreApi.echoNullableList. + * + * Returns: a new + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableListResponse + */ +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableListResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_list_response_new( + FlValue* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_echo_nullable_list_response_new_error: + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Creates a new error response to HostIntegrationCoreApi.echoNullableList. + * + * Returns: a new + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableListResponse + */ +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableListResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_list_response_new_error( + const gchar* code, const gchar* message, FlValue* details); + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableEnumListResponse, + core_tests_pigeon_test_host_integration_core_api_echo_nullable_enum_list_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_ENUM_LIST_RESPONSE, GObject) + +/** + * core_tests_pigeon_test_host_integration_core_api_echo_nullable_enum_list_response_new: + * + * Creates a new response to HostIntegrationCoreApi.echoNullableEnumList. + * + * Returns: a new + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableEnumListResponse + */ +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableEnumListResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_enum_list_response_new( + FlValue* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_echo_nullable_enum_list_response_new_error: + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Creates a new error response to HostIntegrationCoreApi.echoNullableEnumList. + * + * Returns: a new + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableEnumListResponse + */ +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableEnumListResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_enum_list_response_new_error( + const gchar* code, const gchar* message, FlValue* details); + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableClassListResponse, + core_tests_pigeon_test_host_integration_core_api_echo_nullable_class_list_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_CLASS_LIST_RESPONSE, GObject) + +/** + * core_tests_pigeon_test_host_integration_core_api_echo_nullable_class_list_response_new: + * + * Creates a new response to HostIntegrationCoreApi.echoNullableClassList. + * + * Returns: a new + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableClassListResponse + */ +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableClassListResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_class_list_response_new( + FlValue* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_echo_nullable_class_list_response_new_error: + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Creates a new error response to HostIntegrationCoreApi.echoNullableClassList. + * + * Returns: a new + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableClassListResponse + */ +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableClassListResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_class_list_response_new_error( + const gchar* code, const gchar* message, FlValue* details); + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullEnumListResponse, + core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_enum_list_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_NON_NULL_ENUM_LIST_RESPONSE, + GObject) + +/** + * core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_enum_list_response_new: + * + * Creates a new response to HostIntegrationCoreApi.echoNullableNonNullEnumList. + * + * Returns: a new + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullEnumListResponse + */ +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullEnumListResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_enum_list_response_new( + FlValue* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_enum_list_response_new_error: + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Creates a new error response to + * HostIntegrationCoreApi.echoNullableNonNullEnumList. + * + * Returns: a new + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullEnumListResponse + */ +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullEnumListResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_enum_list_response_new_error( + const gchar* code, const gchar* message, FlValue* details); + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullClassListResponse, + core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_class_list_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_NON_NULL_CLASS_LIST_RESPONSE, + GObject) + +/** + * core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_class_list_response_new: + * + * Creates a new response to + * HostIntegrationCoreApi.echoNullableNonNullClassList. + * + * Returns: a new + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullClassListResponse + */ +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullClassListResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_class_list_response_new( + FlValue* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_class_list_response_new_error: + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Creates a new error response to + * HostIntegrationCoreApi.echoNullableNonNullClassList. + * + * Returns: a new + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullClassListResponse + */ +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullClassListResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_class_list_response_new_error( + const gchar* code, const gchar* message, FlValue* details); + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableMapResponse, + core_tests_pigeon_test_host_integration_core_api_echo_nullable_map_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_MAP_RESPONSE, GObject) + +/** + * core_tests_pigeon_test_host_integration_core_api_echo_nullable_map_response_new: + * + * Creates a new response to HostIntegrationCoreApi.echoNullableMap. + * + * Returns: a new + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableMapResponse + */ +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_map_response_new( + FlValue* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_echo_nullable_map_response_new_error: + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Creates a new error response to HostIntegrationCoreApi.echoNullableMap. + * + * Returns: a new + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableMapResponse + */ +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_map_response_new_error( + const gchar* code, const gchar* message, FlValue* details); + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableStringMapResponse, + core_tests_pigeon_test_host_integration_core_api_echo_nullable_string_map_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_STRING_MAP_RESPONSE, GObject) + +/** + * core_tests_pigeon_test_host_integration_core_api_echo_nullable_string_map_response_new: + * + * Creates a new response to HostIntegrationCoreApi.echoNullableStringMap. + * + * Returns: a new + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableStringMapResponse + */ +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableStringMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_string_map_response_new( + FlValue* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_echo_nullable_string_map_response_new_error: + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Creates a new error response to HostIntegrationCoreApi.echoNullableStringMap. + * + * Returns: a new + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableStringMapResponse + */ +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableStringMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_string_map_response_new_error( + const gchar* code, const gchar* message, FlValue* details); + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableIntMapResponse, + core_tests_pigeon_test_host_integration_core_api_echo_nullable_int_map_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_INT_MAP_RESPONSE, GObject) + +/** + * core_tests_pigeon_test_host_integration_core_api_echo_nullable_int_map_response_new: + * + * Creates a new response to HostIntegrationCoreApi.echoNullableIntMap. + * + * Returns: a new + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableIntMapResponse + */ +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableIntMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_int_map_response_new( + FlValue* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_echo_nullable_int_map_response_new_error: + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Creates a new error response to HostIntegrationCoreApi.echoNullableIntMap. + * + * Returns: a new + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableIntMapResponse + */ +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableIntMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_int_map_response_new_error( + const gchar* code, const gchar* message, FlValue* details); + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableEnumMapResponse, + core_tests_pigeon_test_host_integration_core_api_echo_nullable_enum_map_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_ENUM_MAP_RESPONSE, GObject) + +/** + * core_tests_pigeon_test_host_integration_core_api_echo_nullable_enum_map_response_new: + * + * Creates a new response to HostIntegrationCoreApi.echoNullableEnumMap. + * + * Returns: a new + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableEnumMapResponse + */ +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableEnumMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_enum_map_response_new( + FlValue* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_echo_nullable_enum_map_response_new_error: + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Creates a new error response to HostIntegrationCoreApi.echoNullableEnumMap. + * + * Returns: a new + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableEnumMapResponse + */ +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableEnumMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_enum_map_response_new_error( + const gchar* code, const gchar* message, FlValue* details); + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableClassMapResponse, + core_tests_pigeon_test_host_integration_core_api_echo_nullable_class_map_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_CLASS_MAP_RESPONSE, GObject) + +/** + * core_tests_pigeon_test_host_integration_core_api_echo_nullable_class_map_response_new: + * + * Creates a new response to HostIntegrationCoreApi.echoNullableClassMap. + * + * Returns: a new + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableClassMapResponse + */ +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableClassMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_class_map_response_new( + FlValue* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_echo_nullable_class_map_response_new_error: + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Creates a new error response to HostIntegrationCoreApi.echoNullableClassMap. + * + * Returns: a new + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableClassMapResponse + */ +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableClassMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_class_map_response_new_error( + const gchar* code, const gchar* message, FlValue* details); + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullStringMapResponse, + core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_string_map_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_NON_NULL_STRING_MAP_RESPONSE, + GObject) + +/** + * core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_string_map_response_new: + * + * Creates a new response to + * HostIntegrationCoreApi.echoNullableNonNullStringMap. + * + * Returns: a new + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullStringMapResponse + */ +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullStringMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_string_map_response_new( + FlValue* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_string_map_response_new_error: + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Creates a new error response to + * HostIntegrationCoreApi.echoNullableNonNullStringMap. + * + * Returns: a new + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullStringMapResponse + */ +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullStringMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_string_map_response_new_error( + const gchar* code, const gchar* message, FlValue* details); + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullIntMapResponse, + core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_int_map_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_NON_NULL_INT_MAP_RESPONSE, GObject) + +/** + * core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_int_map_response_new: + * + * Creates a new response to HostIntegrationCoreApi.echoNullableNonNullIntMap. + * + * Returns: a new + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullIntMapResponse + */ +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullIntMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_int_map_response_new( + FlValue* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_int_map_response_new_error: + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Creates a new error response to + * HostIntegrationCoreApi.echoNullableNonNullIntMap. + * + * Returns: a new + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullIntMapResponse + */ +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullIntMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_int_map_response_new_error( + const gchar* code, const gchar* message, FlValue* details); + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullEnumMapResponse, + core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_enum_map_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_NON_NULL_ENUM_MAP_RESPONSE, GObject) + +/** + * core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_enum_map_response_new: + * + * Creates a new response to HostIntegrationCoreApi.echoNullableNonNullEnumMap. + * + * Returns: a new + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullEnumMapResponse + */ +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullEnumMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_enum_map_response_new( + FlValue* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_enum_map_response_new_error: + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Creates a new error response to + * HostIntegrationCoreApi.echoNullableNonNullEnumMap. + * + * Returns: a new + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullEnumMapResponse + */ +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullEnumMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_enum_map_response_new_error( + const gchar* code, const gchar* message, FlValue* details); + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullClassMapResponse, + core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_class_map_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_NON_NULL_CLASS_MAP_RESPONSE, + GObject) + +/** + * core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_class_map_response_new: + * + * Creates a new response to HostIntegrationCoreApi.echoNullableNonNullClassMap. + * + * Returns: a new + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullClassMapResponse + */ +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullClassMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_class_map_response_new( + FlValue* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_class_map_response_new_error: + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Creates a new error response to + * HostIntegrationCoreApi.echoNullableNonNullClassMap. + * + * Returns: a new + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullClassMapResponse + */ +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullClassMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_class_map_response_new_error( + const gchar* code, const gchar* message, FlValue* details); + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableEnumResponse, + core_tests_pigeon_test_host_integration_core_api_echo_nullable_enum_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_ENUM_RESPONSE, GObject) + +/** + * core_tests_pigeon_test_host_integration_core_api_echo_nullable_enum_response_new: + * + * Creates a new response to HostIntegrationCoreApi.echoNullableEnum. + * + * Returns: a new + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableEnumResponse + */ +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableEnumResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_enum_response_new( + CoreTestsPigeonTestAnEnum* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_echo_nullable_enum_response_new_error: + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Creates a new error response to HostIntegrationCoreApi.echoNullableEnum. + * + * Returns: a new + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableEnumResponse + */ +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableEnumResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_enum_response_new_error( + const gchar* code, const gchar* message, FlValue* details); + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherNullableEnumResponse, + core_tests_pigeon_test_host_integration_core_api_echo_another_nullable_enum_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_ECHO_ANOTHER_NULLABLE_ENUM_RESPONSE, GObject) + +/** + * core_tests_pigeon_test_host_integration_core_api_echo_another_nullable_enum_response_new: + * + * Creates a new response to HostIntegrationCoreApi.echoAnotherNullableEnum. + * + * Returns: a new + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherNullableEnumResponse + */ +CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherNullableEnumResponse* +core_tests_pigeon_test_host_integration_core_api_echo_another_nullable_enum_response_new( + CoreTestsPigeonTestAnotherEnum* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_echo_another_nullable_enum_response_new_error: + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Creates a new error response to + * HostIntegrationCoreApi.echoAnotherNullableEnum. + * + * Returns: a new + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherNullableEnumResponse + */ +CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherNullableEnumResponse* +core_tests_pigeon_test_host_integration_core_api_echo_another_nullable_enum_response_new_error( + const gchar* code, const gchar* message, FlValue* details); + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoOptionalNullableIntResponse, + core_tests_pigeon_test_host_integration_core_api_echo_optional_nullable_int_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_ECHO_OPTIONAL_NULLABLE_INT_RESPONSE, GObject) + +/** + * core_tests_pigeon_test_host_integration_core_api_echo_optional_nullable_int_response_new: + * + * Creates a new response to HostIntegrationCoreApi.echoOptionalNullableInt. + * + * Returns: a new + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoOptionalNullableIntResponse + */ +CoreTestsPigeonTestHostIntegrationCoreApiEchoOptionalNullableIntResponse* +core_tests_pigeon_test_host_integration_core_api_echo_optional_nullable_int_response_new( + int64_t* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_echo_optional_nullable_int_response_new_error: + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Creates a new error response to + * HostIntegrationCoreApi.echoOptionalNullableInt. + * + * Returns: a new + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoOptionalNullableIntResponse + */ +CoreTestsPigeonTestHostIntegrationCoreApiEchoOptionalNullableIntResponse* +core_tests_pigeon_test_host_integration_core_api_echo_optional_nullable_int_response_new_error( + const gchar* code, const gchar* message, FlValue* details); + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNamedNullableStringResponse, + core_tests_pigeon_test_host_integration_core_api_echo_named_nullable_string_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_ECHO_NAMED_NULLABLE_STRING_RESPONSE, GObject) + +/** + * core_tests_pigeon_test_host_integration_core_api_echo_named_nullable_string_response_new: + * + * Creates a new response to HostIntegrationCoreApi.echoNamedNullableString. + * + * Returns: a new + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNamedNullableStringResponse + */ +CoreTestsPigeonTestHostIntegrationCoreApiEchoNamedNullableStringResponse* +core_tests_pigeon_test_host_integration_core_api_echo_named_nullable_string_response_new( + const gchar* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_echo_named_nullable_string_response_new_error: + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Creates a new error response to + * HostIntegrationCoreApi.echoNamedNullableString. + * + * Returns: a new + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNamedNullableStringResponse + */ +CoreTestsPigeonTestHostIntegrationCoreApiEchoNamedNullableStringResponse* +core_tests_pigeon_test_host_integration_core_api_echo_named_nullable_string_response_new_error( + const gchar* code, const gchar* message, FlValue* details); + +/** + * CoreTestsPigeonTestHostIntegrationCoreApiVTable: + * + * Table of functions exposed by HostIntegrationCoreApi to be implemented by the + * API provider. + */ +typedef struct { + CoreTestsPigeonTestHostIntegrationCoreApiNoopResponse* (*noop)( + gpointer user_data); + CoreTestsPigeonTestHostIntegrationCoreApiEchoAllTypesResponse* ( + *echo_all_types)(CoreTestsPigeonTestAllTypes* everything, + gpointer user_data); + CoreTestsPigeonTestHostIntegrationCoreApiThrowErrorResponse* (*throw_error)( + gpointer user_data); + CoreTestsPigeonTestHostIntegrationCoreApiThrowErrorFromVoidResponse* ( + *throw_error_from_void)(gpointer user_data); + CoreTestsPigeonTestHostIntegrationCoreApiThrowFlutterErrorResponse* ( + *throw_flutter_error)(gpointer user_data); + CoreTestsPigeonTestHostIntegrationCoreApiEchoIntResponse* (*echo_int)( + int64_t an_int, gpointer user_data); + CoreTestsPigeonTestHostIntegrationCoreApiEchoDoubleResponse* (*echo_double)( + double a_double, gpointer user_data); + CoreTestsPigeonTestHostIntegrationCoreApiEchoBoolResponse* (*echo_bool)( + gboolean a_bool, gpointer user_data); + CoreTestsPigeonTestHostIntegrationCoreApiEchoStringResponse* (*echo_string)( + const gchar* a_string, gpointer user_data); + CoreTestsPigeonTestHostIntegrationCoreApiEchoUint8ListResponse* ( + *echo_uint8_list)(const uint8_t* a_uint8_list, size_t a_uint8_list_length, + gpointer user_data); + CoreTestsPigeonTestHostIntegrationCoreApiEchoObjectResponse* (*echo_object)( + FlValue* an_object, gpointer user_data); + CoreTestsPigeonTestHostIntegrationCoreApiEchoListResponse* (*echo_list)( + FlValue* list, gpointer user_data); + CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumListResponse* ( + *echo_enum_list)(FlValue* enum_list, gpointer user_data); + CoreTestsPigeonTestHostIntegrationCoreApiEchoClassListResponse* ( + *echo_class_list)(FlValue* class_list, gpointer user_data); + CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullEnumListResponse* ( + *echo_non_null_enum_list)(FlValue* enum_list, gpointer user_data); + CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullClassListResponse* ( + *echo_non_null_class_list)(FlValue* class_list, gpointer user_data); + CoreTestsPigeonTestHostIntegrationCoreApiEchoMapResponse* (*echo_map)( + FlValue* map, gpointer user_data); + CoreTestsPigeonTestHostIntegrationCoreApiEchoStringMapResponse* ( + *echo_string_map)(FlValue* string_map, gpointer user_data); + CoreTestsPigeonTestHostIntegrationCoreApiEchoIntMapResponse* (*echo_int_map)( + FlValue* int_map, gpointer user_data); + CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumMapResponse* ( + *echo_enum_map)(FlValue* enum_map, gpointer user_data); + CoreTestsPigeonTestHostIntegrationCoreApiEchoClassMapResponse* ( + *echo_class_map)(FlValue* class_map, gpointer user_data); + CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullStringMapResponse* ( + *echo_non_null_string_map)(FlValue* string_map, gpointer user_data); + CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullIntMapResponse* ( + *echo_non_null_int_map)(FlValue* int_map, gpointer user_data); + CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullEnumMapResponse* ( + *echo_non_null_enum_map)(FlValue* enum_map, gpointer user_data); + CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullClassMapResponse* ( + *echo_non_null_class_map)(FlValue* class_map, gpointer user_data); + CoreTestsPigeonTestHostIntegrationCoreApiEchoClassWrapperResponse* ( + *echo_class_wrapper)(CoreTestsPigeonTestAllClassesWrapper* wrapper, + gpointer user_data); + CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumResponse* (*echo_enum)( + CoreTestsPigeonTestAnEnum an_enum, gpointer user_data); + CoreTestsPigeonTestHostIntegrationCoreApiEchoAnotherEnumResponse* ( + *echo_another_enum)(CoreTestsPigeonTestAnotherEnum another_enum, + gpointer user_data); + CoreTestsPigeonTestHostIntegrationCoreApiEchoNamedDefaultStringResponse* ( *echo_named_default_string)(const gchar* a_string, gpointer user_data); CoreTestsPigeonTestHostIntegrationCoreApiEchoOptionalDefaultDoubleResponse* ( *echo_optional_default_double)(double a_double, gpointer user_data); @@ -2338,8 +3551,36 @@ typedef struct { *echo_nullable_object)(FlValue* a_nullable_object, gpointer user_data); CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableListResponse* ( *echo_nullable_list)(FlValue* a_nullable_list, gpointer user_data); + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableEnumListResponse* ( + *echo_nullable_enum_list)(FlValue* enum_list, gpointer user_data); + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableClassListResponse* ( + *echo_nullable_class_list)(FlValue* class_list, gpointer user_data); + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullEnumListResponse* ( + *echo_nullable_non_null_enum_list)(FlValue* enum_list, + gpointer user_data); + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullClassListResponse* ( + *echo_nullable_non_null_class_list)(FlValue* class_list, + gpointer user_data); CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableMapResponse* ( - *echo_nullable_map)(FlValue* a_nullable_map, gpointer user_data); + *echo_nullable_map)(FlValue* map, gpointer user_data); + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableStringMapResponse* ( + *echo_nullable_string_map)(FlValue* string_map, gpointer user_data); + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableIntMapResponse* ( + *echo_nullable_int_map)(FlValue* int_map, gpointer user_data); + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableEnumMapResponse* ( + *echo_nullable_enum_map)(FlValue* enum_map, gpointer user_data); + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableClassMapResponse* ( + *echo_nullable_class_map)(FlValue* class_map, gpointer user_data); + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullStringMapResponse* ( + *echo_nullable_non_null_string_map)(FlValue* string_map, + gpointer user_data); + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullIntMapResponse* ( + *echo_nullable_non_null_int_map)(FlValue* int_map, gpointer user_data); + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullEnumMapResponse* ( + *echo_nullable_non_null_enum_map)(FlValue* enum_map, gpointer user_data); + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullClassMapResponse* ( + *echo_nullable_non_null_class_map)(FlValue* class_map, + gpointer user_data); CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableEnumResponse* ( *echo_nullable_enum)(CoreTestsPigeonTestAnEnum* an_enum, gpointer user_data); @@ -2374,16 +3615,40 @@ typedef struct { const uint8_t* a_uint8_list, size_t a_uint8_list_length, CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, gpointer user_data); - void (*echo_async_object)( - FlValue* an_object, + void (*echo_async_object)( + FlValue* an_object, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data); + void (*echo_async_list)( + FlValue* list, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data); + void (*echo_async_enum_list)( + FlValue* enum_list, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data); + void (*echo_async_class_list)( + FlValue* class_list, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data); + void (*echo_async_map)( + FlValue* map, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data); + void (*echo_async_string_map)( + FlValue* string_map, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data); + void (*echo_async_int_map)( + FlValue* int_map, CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, gpointer user_data); - void (*echo_async_list)( - FlValue* list, + void (*echo_async_enum_map)( + FlValue* enum_map, CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, gpointer user_data); - void (*echo_async_map)( - FlValue* a_map, + void (*echo_async_class_map)( + FlValue* class_map, CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, gpointer user_data); void (*echo_async_enum)( @@ -2443,8 +3708,32 @@ typedef struct { FlValue* list, CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, gpointer user_data); + void (*echo_async_nullable_enum_list)( + FlValue* enum_list, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data); + void (*echo_async_nullable_class_list)( + FlValue* class_list, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data); void (*echo_async_nullable_map)( - FlValue* a_map, + FlValue* map, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data); + void (*echo_async_nullable_string_map)( + FlValue* string_map, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data); + void (*echo_async_nullable_int_map)( + FlValue* int_map, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data); + void (*echo_async_nullable_enum_map)( + FlValue* enum_map, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data); + void (*echo_async_nullable_class_map)( + FlValue* class_map, CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, gpointer user_data); void (*echo_async_nullable_enum)( @@ -2510,8 +3799,56 @@ typedef struct { FlValue* list, CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, gpointer user_data); + void (*call_flutter_echo_enum_list)( + FlValue* enum_list, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data); + void (*call_flutter_echo_class_list)( + FlValue* class_list, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data); + void (*call_flutter_echo_non_null_enum_list)( + FlValue* enum_list, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data); + void (*call_flutter_echo_non_null_class_list)( + FlValue* class_list, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data); void (*call_flutter_echo_map)( - FlValue* a_map, + FlValue* map, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data); + void (*call_flutter_echo_string_map)( + FlValue* string_map, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data); + void (*call_flutter_echo_int_map)( + FlValue* int_map, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data); + void (*call_flutter_echo_enum_map)( + FlValue* enum_map, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data); + void (*call_flutter_echo_class_map)( + FlValue* class_map, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data); + void (*call_flutter_echo_non_null_string_map)( + FlValue* string_map, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data); + void (*call_flutter_echo_non_null_int_map)( + FlValue* int_map, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data); + void (*call_flutter_echo_non_null_enum_map)( + FlValue* enum_map, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data); + void (*call_flutter_echo_non_null_class_map)( + FlValue* class_map, CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, gpointer user_data); void (*call_flutter_echo_enum)( @@ -2546,8 +3883,56 @@ typedef struct { FlValue* list, CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, gpointer user_data); + void (*call_flutter_echo_nullable_enum_list)( + FlValue* enum_list, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data); + void (*call_flutter_echo_nullable_class_list)( + FlValue* class_list, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data); + void (*call_flutter_echo_nullable_non_null_enum_list)( + FlValue* enum_list, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data); + void (*call_flutter_echo_nullable_non_null_class_list)( + FlValue* class_list, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data); void (*call_flutter_echo_nullable_map)( - FlValue* a_map, + FlValue* map, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data); + void (*call_flutter_echo_nullable_string_map)( + FlValue* string_map, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data); + void (*call_flutter_echo_nullable_int_map)( + FlValue* int_map, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data); + void (*call_flutter_echo_nullable_enum_map)( + FlValue* enum_map, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data); + void (*call_flutter_echo_nullable_class_map)( + FlValue* class_map, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data); + void (*call_flutter_echo_nullable_non_null_string_map)( + FlValue* string_map, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data); + void (*call_flutter_echo_nullable_non_null_int_map)( + FlValue* int_map, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data); + void (*call_flutter_echo_nullable_non_null_enum_map)( + FlValue* enum_map, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data); + void (*call_flutter_echo_nullable_non_null_class_map)( + FlValue* class_map, CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, gpointer user_data); void (*call_flutter_echo_nullable_enum)( @@ -2565,3843 +3950,7393 @@ typedef struct { } CoreTestsPigeonTestHostIntegrationCoreApiVTable; /** - * core_tests_pigeon_test_host_integration_core_api_set_method_handlers: + * core_tests_pigeon_test_host_integration_core_api_set_method_handlers: + * + * @messenger: an #FlBinaryMessenger. + * @suffix: (allow-none): a suffix to add to the API or %NULL for none. + * @vtable: implementations of the methods in this API. + * @user_data: (closure): user data to pass to the functions in @vtable. + * @user_data_free_func: (allow-none): a function which gets called to free + * @user_data, or %NULL. + * + * Connects the method handlers in the HostIntegrationCoreApi API. + */ +void core_tests_pigeon_test_host_integration_core_api_set_method_handlers( + FlBinaryMessenger* messenger, const gchar* suffix, + const CoreTestsPigeonTestHostIntegrationCoreApiVTable* vtable, + gpointer user_data, GDestroyNotify user_data_free_func); + +/** + * core_tests_pigeon_test_host_integration_core_api_clear_method_handlers: + * + * @messenger: an #FlBinaryMessenger. + * @suffix: (allow-none): a suffix to add to the API or %NULL for none. + * + * Clears the method handlers in the HostIntegrationCoreApi API. + */ +void core_tests_pigeon_test_host_integration_core_api_clear_method_handlers( + FlBinaryMessenger* messenger, const gchar* suffix); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_noop_async: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * + * Responds to HostIntegrationCoreApi.noopAsync. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_noop_async( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_noop_async: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to HostIntegrationCoreApi.noopAsync. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_noop_async( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_echo_async_int: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.echoAsyncInt. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_int( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + int64_t return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_int: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to HostIntegrationCoreApi.echoAsyncInt. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_int( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_echo_async_double: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.echoAsyncDouble. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_double( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + double return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_double: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to HostIntegrationCoreApi.echoAsyncDouble. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_double( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_echo_async_bool: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.echoAsyncBool. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_bool( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gboolean return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_bool: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to HostIntegrationCoreApi.echoAsyncBool. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_bool( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_echo_async_string: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.echoAsyncString. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_string( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_string: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to HostIntegrationCoreApi.echoAsyncString. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_string( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_echo_async_uint8_list: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * @return_value_length: (allow-none): location to write length of @return_value + * or %NULL to ignore. + * + * Responds to HostIntegrationCoreApi.echoAsyncUint8List. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_uint8_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const uint8_t* return_value, size_t return_value_length); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_uint8_list: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to HostIntegrationCoreApi.echoAsyncUint8List. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_uint8_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_echo_async_object: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.echoAsyncObject. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_object( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_object: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to HostIntegrationCoreApi.echoAsyncObject. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_object( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_echo_async_list: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.echoAsyncList. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_list: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to HostIntegrationCoreApi.echoAsyncList. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_echo_async_enum_list: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.echoAsyncEnumList. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_enum_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_enum_list: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to HostIntegrationCoreApi.echoAsyncEnumList. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_enum_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_echo_async_class_list: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.echoAsyncClassList. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_class_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_class_list: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to HostIntegrationCoreApi.echoAsyncClassList. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_class_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_echo_async_map: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.echoAsyncMap. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_map: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to HostIntegrationCoreApi.echoAsyncMap. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_echo_async_string_map: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.echoAsyncStringMap. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_string_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_string_map: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to HostIntegrationCoreApi.echoAsyncStringMap. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_string_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_echo_async_int_map: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.echoAsyncIntMap. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_int_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_int_map: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to HostIntegrationCoreApi.echoAsyncIntMap. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_int_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_echo_async_enum_map: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.echoAsyncEnumMap. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_enum_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_enum_map: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to HostIntegrationCoreApi.echoAsyncEnumMap. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_enum_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_echo_async_class_map: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.echoAsyncClassMap. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_class_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_class_map: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to HostIntegrationCoreApi.echoAsyncClassMap. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_class_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_echo_async_enum: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.echoAsyncEnum. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_enum( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + CoreTestsPigeonTestAnEnum return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_enum: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to HostIntegrationCoreApi.echoAsyncEnum. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_enum( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_echo_another_async_enum: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.echoAnotherAsyncEnum. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_echo_another_async_enum( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + CoreTestsPigeonTestAnotherEnum return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_echo_another_async_enum: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to HostIntegrationCoreApi.echoAnotherAsyncEnum. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_another_async_enum( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_throw_async_error: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.throwAsyncError. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_throw_async_error( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_throw_async_error: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to HostIntegrationCoreApi.throwAsyncError. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_throw_async_error( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_throw_async_error_from_void: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * + * Responds to HostIntegrationCoreApi.throwAsyncErrorFromVoid. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_throw_async_error_from_void( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_throw_async_error_from_void: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to HostIntegrationCoreApi.throwAsyncErrorFromVoid. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_throw_async_error_from_void( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_throw_async_flutter_error: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.throwAsyncFlutterError. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_throw_async_flutter_error( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_throw_async_flutter_error: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to HostIntegrationCoreApi.throwAsyncFlutterError. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_throw_async_flutter_error( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_echo_async_all_types: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.echoAsyncAllTypes. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_all_types( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + CoreTestsPigeonTestAllTypes* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_all_types: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to HostIntegrationCoreApi.echoAsyncAllTypes. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_all_types( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_all_nullable_types: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.echoAsyncNullableAllNullableTypes. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_all_nullable_types( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + CoreTestsPigeonTestAllNullableTypes* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_all_nullable_types: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to + * HostIntegrationCoreApi.echoAsyncNullableAllNullableTypes. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_all_nullable_types( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_all_nullable_types_without_recursion: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to + * HostIntegrationCoreApi.echoAsyncNullableAllNullableTypesWithoutRecursion. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_all_nullable_types_without_recursion( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + CoreTestsPigeonTestAllNullableTypesWithoutRecursion* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_all_nullable_types_without_recursion: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to + * HostIntegrationCoreApi.echoAsyncNullableAllNullableTypesWithoutRecursion. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_all_nullable_types_without_recursion( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_int: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.echoAsyncNullableInt. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_int( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + int64_t* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_int: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to HostIntegrationCoreApi.echoAsyncNullableInt. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_int( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_double: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.echoAsyncNullableDouble. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_double( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + double* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_double: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to HostIntegrationCoreApi.echoAsyncNullableDouble. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_double( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_bool: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.echoAsyncNullableBool. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_bool( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gboolean* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_bool: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to HostIntegrationCoreApi.echoAsyncNullableBool. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_bool( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_string: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.echoAsyncNullableString. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_string( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_string: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to HostIntegrationCoreApi.echoAsyncNullableString. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_string( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_uint8_list: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * @return_value_length: (allow-none): location to write length of @return_value + * or %NULL to ignore. + * + * Responds to HostIntegrationCoreApi.echoAsyncNullableUint8List. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_uint8_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const uint8_t* return_value, size_t return_value_length); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_uint8_list: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to HostIntegrationCoreApi.echoAsyncNullableUint8List. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_uint8_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_object: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.echoAsyncNullableObject. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_object( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_object: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to HostIntegrationCoreApi.echoAsyncNullableObject. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_object( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_list: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.echoAsyncNullableList. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_list: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to HostIntegrationCoreApi.echoAsyncNullableList. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_enum_list: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.echoAsyncNullableEnumList. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_enum_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_enum_list: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to HostIntegrationCoreApi.echoAsyncNullableEnumList. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_enum_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_class_list: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.echoAsyncNullableClassList. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_class_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_class_list: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to HostIntegrationCoreApi.echoAsyncNullableClassList. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_class_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_map: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.echoAsyncNullableMap. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_map: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to HostIntegrationCoreApi.echoAsyncNullableMap. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_string_map: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.echoAsyncNullableStringMap. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_string_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_string_map: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to HostIntegrationCoreApi.echoAsyncNullableStringMap. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_string_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_int_map: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.echoAsyncNullableIntMap. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_int_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_int_map: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to HostIntegrationCoreApi.echoAsyncNullableIntMap. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_int_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_enum_map: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.echoAsyncNullableEnumMap. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_enum_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_enum_map: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to HostIntegrationCoreApi.echoAsyncNullableEnumMap. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_enum_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_class_map: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.echoAsyncNullableClassMap. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_class_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_class_map: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to HostIntegrationCoreApi.echoAsyncNullableClassMap. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_class_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_enum: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.echoAsyncNullableEnum. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_enum( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + CoreTestsPigeonTestAnEnum* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_enum: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to HostIntegrationCoreApi.echoAsyncNullableEnum. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_enum( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_echo_another_async_nullable_enum: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.echoAnotherAsyncNullableEnum. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_echo_another_async_nullable_enum( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + CoreTestsPigeonTestAnotherEnum* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_echo_another_async_nullable_enum: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to + * HostIntegrationCoreApi.echoAnotherAsyncNullableEnum. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_another_async_nullable_enum( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_noop: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * + * Responds to HostIntegrationCoreApi.callFlutterNoop. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_noop( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_noop: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to HostIntegrationCoreApi.callFlutterNoop. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_noop( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_throw_error: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.callFlutterThrowError. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_throw_error( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_throw_error: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to HostIntegrationCoreApi.callFlutterThrowError. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_throw_error( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_throw_error_from_void: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * + * Responds to HostIntegrationCoreApi.callFlutterThrowErrorFromVoid. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_throw_error_from_void( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_throw_error_from_void: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to + * HostIntegrationCoreApi.callFlutterThrowErrorFromVoid. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_throw_error_from_void( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_all_types: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.callFlutterEchoAllTypes. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_all_types( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + CoreTestsPigeonTestAllTypes* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_all_types: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to HostIntegrationCoreApi.callFlutterEchoAllTypes. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_all_types( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_all_nullable_types: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.callFlutterEchoAllNullableTypes. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_all_nullable_types( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + CoreTestsPigeonTestAllNullableTypes* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_all_nullable_types: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to + * HostIntegrationCoreApi.callFlutterEchoAllNullableTypes. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_all_nullable_types( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_send_multiple_nullable_types: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.callFlutterSendMultipleNullableTypes. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_send_multiple_nullable_types( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + CoreTestsPigeonTestAllNullableTypes* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_send_multiple_nullable_types: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to + * HostIntegrationCoreApi.callFlutterSendMultipleNullableTypes. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_send_multiple_nullable_types( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_all_nullable_types_without_recursion: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to + * HostIntegrationCoreApi.callFlutterEchoAllNullableTypesWithoutRecursion. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_all_nullable_types_without_recursion( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + CoreTestsPigeonTestAllNullableTypesWithoutRecursion* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_all_nullable_types_without_recursion: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to + * HostIntegrationCoreApi.callFlutterEchoAllNullableTypesWithoutRecursion. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_all_nullable_types_without_recursion( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_send_multiple_nullable_types_without_recursion: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to + * HostIntegrationCoreApi.callFlutterSendMultipleNullableTypesWithoutRecursion. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_send_multiple_nullable_types_without_recursion( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + CoreTestsPigeonTestAllNullableTypesWithoutRecursion* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_send_multiple_nullable_types_without_recursion: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to + * HostIntegrationCoreApi.callFlutterSendMultipleNullableTypesWithoutRecursion. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_send_multiple_nullable_types_without_recursion( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_bool: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.callFlutterEchoBool. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_bool( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gboolean return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_bool: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to HostIntegrationCoreApi.callFlutterEchoBool. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_bool( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_int: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.callFlutterEchoInt. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_int( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + int64_t return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_int: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to HostIntegrationCoreApi.callFlutterEchoInt. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_int( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_double: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.callFlutterEchoDouble. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_double( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + double return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_double: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to HostIntegrationCoreApi.callFlutterEchoDouble. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_double( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_string: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.callFlutterEchoString. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_string( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_string: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to HostIntegrationCoreApi.callFlutterEchoString. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_string( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_uint8_list: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * @return_value_length: (allow-none): location to write length of @return_value + * or %NULL to ignore. + * + * Responds to HostIntegrationCoreApi.callFlutterEchoUint8List. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_uint8_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const uint8_t* return_value, size_t return_value_length); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_uint8_list: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to HostIntegrationCoreApi.callFlutterEchoUint8List. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_uint8_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_list: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.callFlutterEchoList. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_list: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to HostIntegrationCoreApi.callFlutterEchoList. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_enum_list: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.callFlutterEchoEnumList. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_enum_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_enum_list: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to HostIntegrationCoreApi.callFlutterEchoEnumList. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_enum_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_class_list: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.callFlutterEchoClassList. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_class_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_class_list: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to HostIntegrationCoreApi.callFlutterEchoClassList. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_class_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_non_null_enum_list: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.callFlutterEchoNonNullEnumList. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_non_null_enum_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_non_null_enum_list: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to + * HostIntegrationCoreApi.callFlutterEchoNonNullEnumList. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_non_null_enum_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_non_null_class_list: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.callFlutterEchoNonNullClassList. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_non_null_class_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_non_null_class_list: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to + * HostIntegrationCoreApi.callFlutterEchoNonNullClassList. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_non_null_class_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_map: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.callFlutterEchoMap. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_map: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to HostIntegrationCoreApi.callFlutterEchoMap. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_string_map: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.callFlutterEchoStringMap. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_string_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_string_map: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to HostIntegrationCoreApi.callFlutterEchoStringMap. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_string_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_int_map: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.callFlutterEchoIntMap. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_int_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_int_map: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to HostIntegrationCoreApi.callFlutterEchoIntMap. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_int_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_enum_map: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.callFlutterEchoEnumMap. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_enum_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_enum_map: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to HostIntegrationCoreApi.callFlutterEchoEnumMap. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_enum_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_class_map: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.callFlutterEchoClassMap. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_class_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_class_map: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to HostIntegrationCoreApi.callFlutterEchoClassMap. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_class_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_non_null_string_map: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.callFlutterEchoNonNullStringMap. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_non_null_string_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_non_null_string_map: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to + * HostIntegrationCoreApi.callFlutterEchoNonNullStringMap. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_non_null_string_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_non_null_int_map: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.callFlutterEchoNonNullIntMap. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_non_null_int_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_non_null_int_map: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to + * HostIntegrationCoreApi.callFlutterEchoNonNullIntMap. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_non_null_int_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_non_null_enum_map: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.callFlutterEchoNonNullEnumMap. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_non_null_enum_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_non_null_enum_map: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to + * HostIntegrationCoreApi.callFlutterEchoNonNullEnumMap. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_non_null_enum_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_non_null_class_map: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.callFlutterEchoNonNullClassMap. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_non_null_class_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_non_null_class_map: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to + * HostIntegrationCoreApi.callFlutterEchoNonNullClassMap. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_non_null_class_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_enum: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.callFlutterEchoEnum. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_enum( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + CoreTestsPigeonTestAnEnum return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_enum: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to HostIntegrationCoreApi.callFlutterEchoEnum. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_enum( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_another_enum: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.callFlutterEchoAnotherEnum. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_another_enum( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + CoreTestsPigeonTestAnotherEnum return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_another_enum: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to HostIntegrationCoreApi.callFlutterEchoAnotherEnum. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_another_enum( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_bool: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.callFlutterEchoNullableBool. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_bool( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gboolean* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_bool: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to HostIntegrationCoreApi.callFlutterEchoNullableBool. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_bool( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_int: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.callFlutterEchoNullableInt. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_int( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + int64_t* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_int: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to HostIntegrationCoreApi.callFlutterEchoNullableInt. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_int( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_double: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.callFlutterEchoNullableDouble. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_double( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + double* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_double: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to + * HostIntegrationCoreApi.callFlutterEchoNullableDouble. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_double( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_string: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.callFlutterEchoNullableString. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_string( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_string: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to + * HostIntegrationCoreApi.callFlutterEchoNullableString. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_string( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_uint8_list: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * @return_value_length: (allow-none): location to write length of @return_value + * or %NULL to ignore. + * + * Responds to HostIntegrationCoreApi.callFlutterEchoNullableUint8List. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_uint8_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const uint8_t* return_value, size_t return_value_length); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_uint8_list: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to + * HostIntegrationCoreApi.callFlutterEchoNullableUint8List. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_uint8_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_list: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.callFlutterEchoNullableList. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_list: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to HostIntegrationCoreApi.callFlutterEchoNullableList. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_enum_list: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.callFlutterEchoNullableEnumList. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_enum_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_enum_list: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to + * HostIntegrationCoreApi.callFlutterEchoNullableEnumList. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_enum_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_class_list: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.callFlutterEchoNullableClassList. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_class_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_class_list: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to + * HostIntegrationCoreApi.callFlutterEchoNullableClassList. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_class_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_non_null_enum_list: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.callFlutterEchoNullableNonNullEnumList. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_non_null_enum_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_non_null_enum_list: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to + * HostIntegrationCoreApi.callFlutterEchoNullableNonNullEnumList. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_non_null_enum_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_non_null_class_list: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.callFlutterEchoNullableNonNullClassList. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_non_null_class_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_non_null_class_list: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to + * HostIntegrationCoreApi.callFlutterEchoNullableNonNullClassList. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_non_null_class_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_map: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.callFlutterEchoNullableMap. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_map: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to HostIntegrationCoreApi.callFlutterEchoNullableMap. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_string_map: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.callFlutterEchoNullableStringMap. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_string_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_string_map: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to + * HostIntegrationCoreApi.callFlutterEchoNullableStringMap. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_string_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_int_map: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.callFlutterEchoNullableIntMap. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_int_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_int_map: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to + * HostIntegrationCoreApi.callFlutterEchoNullableIntMap. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_int_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_enum_map: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.callFlutterEchoNullableEnumMap. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_enum_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_enum_map: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to + * HostIntegrationCoreApi.callFlutterEchoNullableEnumMap. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_enum_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_class_map: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.callFlutterEchoNullableClassMap. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_class_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_class_map: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to + * HostIntegrationCoreApi.callFlutterEchoNullableClassMap. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_class_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_non_null_string_map: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.callFlutterEchoNullableNonNullStringMap. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_non_null_string_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_non_null_string_map: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to + * HostIntegrationCoreApi.callFlutterEchoNullableNonNullStringMap. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_non_null_string_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_non_null_int_map: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.callFlutterEchoNullableNonNullIntMap. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_non_null_int_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_non_null_int_map: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to + * HostIntegrationCoreApi.callFlutterEchoNullableNonNullIntMap. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_non_null_int_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_non_null_enum_map: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.callFlutterEchoNullableNonNullEnumMap. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_non_null_enum_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_non_null_enum_map: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to + * HostIntegrationCoreApi.callFlutterEchoNullableNonNullEnumMap. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_non_null_enum_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_non_null_class_map: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.callFlutterEchoNullableNonNullClassMap. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_non_null_class_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_non_null_class_map: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to + * HostIntegrationCoreApi.callFlutterEchoNullableNonNullClassMap. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_non_null_class_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_enum: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.callFlutterEchoNullableEnum. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_enum( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + CoreTestsPigeonTestAnEnum* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_enum: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to HostIntegrationCoreApi.callFlutterEchoNullableEnum. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_enum( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_another_nullable_enum: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.callFlutterEchoAnotherNullableEnum. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_another_nullable_enum( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + CoreTestsPigeonTestAnotherEnum* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_another_nullable_enum: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to + * HostIntegrationCoreApi.callFlutterEchoAnotherNullableEnum. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_another_nullable_enum( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_small_api_echo_string: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.callFlutterSmallApiEchoString. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_small_api_echo_string( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_small_api_echo_string: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to + * HostIntegrationCoreApi.callFlutterSmallApiEchoString. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_small_api_echo_string( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestFlutterIntegrationCoreApiNoopResponse, + core_tests_pigeon_test_flutter_integration_core_api_noop_response, + CORE_TESTS_PIGEON_TEST, FLUTTER_INTEGRATION_CORE_API_NOOP_RESPONSE, GObject) + +/** + * core_tests_pigeon_test_flutter_integration_core_api_noop_response_is_error: + * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiNoopResponse. + * + * Checks if a response to FlutterIntegrationCoreApi.noop is an error. + * + * Returns: a %TRUE if this response is an error. + */ +gboolean +core_tests_pigeon_test_flutter_integration_core_api_noop_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiNoopResponse* response); + +/** + * core_tests_pigeon_test_flutter_integration_core_api_noop_response_get_error_code: + * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiNoopResponse. + * + * Get the error code for this response. + * + * Returns: an error code or %NULL if not an error. + */ +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_noop_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiNoopResponse* response); + +/** + * core_tests_pigeon_test_flutter_integration_core_api_noop_response_get_error_message: + * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiNoopResponse. + * + * Get the error message for this response. + * + * Returns: an error message. + */ +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_noop_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiNoopResponse* response); + +/** + * core_tests_pigeon_test_flutter_integration_core_api_noop_response_get_error_details: + * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiNoopResponse. + * + * Get the error details for this response. + * + * Returns: (allow-none): an error details or %NULL. + */ +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_noop_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiNoopResponse* response); + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorResponse, + core_tests_pigeon_test_flutter_integration_core_api_throw_error_response, + CORE_TESTS_PIGEON_TEST, FLUTTER_INTEGRATION_CORE_API_THROW_ERROR_RESPONSE, + GObject) + +/** + * core_tests_pigeon_test_flutter_integration_core_api_throw_error_response_is_error: + * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorResponse. + * + * Checks if a response to FlutterIntegrationCoreApi.throwError is an error. + * + * Returns: a %TRUE if this response is an error. + */ +gboolean +core_tests_pigeon_test_flutter_integration_core_api_throw_error_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorResponse* response); + +/** + * core_tests_pigeon_test_flutter_integration_core_api_throw_error_response_get_error_code: + * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorResponse. + * + * Get the error code for this response. + * + * Returns: an error code or %NULL if not an error. + */ +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_throw_error_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorResponse* response); + +/** + * core_tests_pigeon_test_flutter_integration_core_api_throw_error_response_get_error_message: + * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorResponse. + * + * Get the error message for this response. + * + * Returns: an error message. + */ +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_throw_error_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorResponse* response); + +/** + * core_tests_pigeon_test_flutter_integration_core_api_throw_error_response_get_error_details: + * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorResponse. + * + * Get the error details for this response. + * + * Returns: (allow-none): an error details or %NULL. + */ +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_throw_error_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorResponse* response); + +/** + * core_tests_pigeon_test_flutter_integration_core_api_throw_error_response_get_return_value: + * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorResponse. + * + * Get the return value for this response. + * + * Returns: (allow-none): a return value or %NULL. + */ +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_throw_error_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorResponse* response); + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorFromVoidResponse, + core_tests_pigeon_test_flutter_integration_core_api_throw_error_from_void_response, + CORE_TESTS_PIGEON_TEST, + FLUTTER_INTEGRATION_CORE_API_THROW_ERROR_FROM_VOID_RESPONSE, GObject) + +/** + * core_tests_pigeon_test_flutter_integration_core_api_throw_error_from_void_response_is_error: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorFromVoidResponse. + * + * Checks if a response to FlutterIntegrationCoreApi.throwErrorFromVoid is an + * error. + * + * Returns: a %TRUE if this response is an error. + */ +gboolean +core_tests_pigeon_test_flutter_integration_core_api_throw_error_from_void_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorFromVoidResponse* + response); + +/** + * core_tests_pigeon_test_flutter_integration_core_api_throw_error_from_void_response_get_error_code: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorFromVoidResponse. + * + * Get the error code for this response. + * + * Returns: an error code or %NULL if not an error. + */ +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_throw_error_from_void_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorFromVoidResponse* + response); + +/** + * core_tests_pigeon_test_flutter_integration_core_api_throw_error_from_void_response_get_error_message: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorFromVoidResponse. + * + * Get the error message for this response. + * + * Returns: an error message. + */ +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_throw_error_from_void_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorFromVoidResponse* + response); + +/** + * core_tests_pigeon_test_flutter_integration_core_api_throw_error_from_void_response_get_error_details: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorFromVoidResponse. + * + * Get the error details for this response. + * + * Returns: (allow-none): an error details or %NULL. + */ +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_throw_error_from_void_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorFromVoidResponse* + response); + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllTypesResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_all_types_response, + CORE_TESTS_PIGEON_TEST, + FLUTTER_INTEGRATION_CORE_API_ECHO_ALL_TYPES_RESPONSE, GObject) + +/** + * core_tests_pigeon_test_flutter_integration_core_api_echo_all_types_response_is_error: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllTypesResponse. + * + * Checks if a response to FlutterIntegrationCoreApi.echoAllTypes is an error. + * + * Returns: a %TRUE if this response is an error. + */ +gboolean +core_tests_pigeon_test_flutter_integration_core_api_echo_all_types_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllTypesResponse* response); + +/** + * core_tests_pigeon_test_flutter_integration_core_api_echo_all_types_response_get_error_code: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllTypesResponse. + * + * Get the error code for this response. + * + * Returns: an error code or %NULL if not an error. + */ +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_all_types_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllTypesResponse* response); + +/** + * core_tests_pigeon_test_flutter_integration_core_api_echo_all_types_response_get_error_message: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllTypesResponse. + * + * Get the error message for this response. + * + * Returns: an error message. + */ +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_all_types_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllTypesResponse* response); + +/** + * core_tests_pigeon_test_flutter_integration_core_api_echo_all_types_response_get_error_details: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllTypesResponse. + * + * Get the error details for this response. + * + * Returns: (allow-none): an error details or %NULL. + */ +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_all_types_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllTypesResponse* response); + +/** + * core_tests_pigeon_test_flutter_integration_core_api_echo_all_types_response_get_return_value: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllTypesResponse. + * + * Get the return value for this response. + * + * Returns: a return value. + */ +CoreTestsPigeonTestAllTypes* +core_tests_pigeon_test_flutter_integration_core_api_echo_all_types_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllTypesResponse* response); + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_response, + CORE_TESTS_PIGEON_TEST, + FLUTTER_INTEGRATION_CORE_API_ECHO_ALL_NULLABLE_TYPES_RESPONSE, GObject) + +/** + * core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_response_is_error: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesResponse. + * + * Checks if a response to FlutterIntegrationCoreApi.echoAllNullableTypes is an + * error. + * + * Returns: a %TRUE if this response is an error. + */ +gboolean +core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesResponse* + response); + +/** + * core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_response_get_error_code: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesResponse. + * + * Get the error code for this response. + * + * Returns: an error code or %NULL if not an error. + */ +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesResponse* + response); + +/** + * core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_response_get_error_message: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesResponse. + * + * Get the error message for this response. + * + * Returns: an error message. + */ +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesResponse* + response); + +/** + * core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_response_get_error_details: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesResponse. + * + * Get the error details for this response. + * + * Returns: (allow-none): an error details or %NULL. + */ +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesResponse* + response); + +/** + * core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_response_get_return_value: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesResponse. + * + * Get the return value for this response. + * + * Returns: (allow-none): a return value or %NULL. + */ +CoreTestsPigeonTestAllNullableTypes* +core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesResponse* + response); + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesResponse, + core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_response, + CORE_TESTS_PIGEON_TEST, + FLUTTER_INTEGRATION_CORE_API_SEND_MULTIPLE_NULLABLE_TYPES_RESPONSE, GObject) + +/** + * core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_response_is_error: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesResponse. + * + * Checks if a response to FlutterIntegrationCoreApi.sendMultipleNullableTypes + * is an error. + * + * Returns: a %TRUE if this response is an error. + */ +gboolean +core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesResponse* + response); + +/** + * core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_response_get_error_code: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesResponse. + * + * Get the error code for this response. + * + * Returns: an error code or %NULL if not an error. + */ +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesResponse* + response); + +/** + * core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_response_get_error_message: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesResponse. + * + * Get the error message for this response. + * + * Returns: an error message. + */ +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesResponse* + response); + +/** + * core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_response_get_error_details: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesResponse. + * + * Get the error details for this response. + * + * Returns: (allow-none): an error details or %NULL. + */ +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesResponse* + response); + +/** + * core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_response_get_return_value: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesResponse. + * + * Get the return value for this response. + * + * Returns: a return value. + */ +CoreTestsPigeonTestAllNullableTypes* +core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesResponse* + response); + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_without_recursion_response, + CORE_TESTS_PIGEON_TEST, + FLUTTER_INTEGRATION_CORE_API_ECHO_ALL_NULLABLE_TYPES_WITHOUT_RECURSION_RESPONSE, + GObject) + +/** + * core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_without_recursion_response_is_error: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponse. + * + * Checks if a response to + * FlutterIntegrationCoreApi.echoAllNullableTypesWithoutRecursion is an error. + * + * Returns: a %TRUE if this response is an error. + */ +gboolean +core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_without_recursion_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponse* + response); + +/** + * core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_without_recursion_response_get_error_code: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponse. + * + * Get the error code for this response. + * + * Returns: an error code or %NULL if not an error. + */ +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_without_recursion_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponse* + response); + +/** + * core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_without_recursion_response_get_error_message: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponse. + * + * Get the error message for this response. + * + * Returns: an error message. + */ +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_without_recursion_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponse* + response); + +/** + * core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_without_recursion_response_get_error_details: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponse. + * + * Get the error details for this response. + * + * Returns: (allow-none): an error details or %NULL. + */ +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_without_recursion_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponse* + response); + +/** + * core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_without_recursion_response_get_return_value: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponse. + * + * Get the return value for this response. + * + * Returns: (allow-none): a return value or %NULL. + */ +CoreTestsPigeonTestAllNullableTypesWithoutRecursion* +core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_without_recursion_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponse* + response); + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponse, + core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_without_recursion_response, + CORE_TESTS_PIGEON_TEST, + FLUTTER_INTEGRATION_CORE_API_SEND_MULTIPLE_NULLABLE_TYPES_WITHOUT_RECURSION_RESPONSE, + GObject) + +/** + * core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_without_recursion_response_is_error: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponse. * - * @messenger: an #FlBinaryMessenger. - * @suffix: (allow-none): a suffix to add to the API or %NULL for none. - * @vtable: implementations of the methods in this API. - * @user_data: (closure): user data to pass to the functions in @vtable. - * @user_data_free_func: (allow-none): a function which gets called to free - * @user_data, or %NULL. + * Checks if a response to + * FlutterIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion is an + * error. * - * Connects the method handlers in the HostIntegrationCoreApi API. + * Returns: a %TRUE if this response is an error. */ -void core_tests_pigeon_test_host_integration_core_api_set_method_handlers( - FlBinaryMessenger* messenger, const gchar* suffix, - const CoreTestsPigeonTestHostIntegrationCoreApiVTable* vtable, - gpointer user_data, GDestroyNotify user_data_free_func); +gboolean +core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_without_recursion_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponse* + response); /** - * core_tests_pigeon_test_host_integration_core_api_clear_method_handlers: + * core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_without_recursion_response_get_error_code: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponse. * - * @messenger: an #FlBinaryMessenger. - * @suffix: (allow-none): a suffix to add to the API or %NULL for none. + * Get the error code for this response. * - * Clears the method handlers in the HostIntegrationCoreApi API. + * Returns: an error code or %NULL if not an error. */ -void core_tests_pigeon_test_host_integration_core_api_clear_method_handlers( - FlBinaryMessenger* messenger, const gchar* suffix); +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_without_recursion_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponse* + response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_noop_async: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_without_recursion_response_get_error_message: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponse. * - * Responds to HostIntegrationCoreApi.noopAsync. + * Get the error message for this response. + * + * Returns: an error message. */ -void core_tests_pigeon_test_host_integration_core_api_respond_noop_async( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle); +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_without_recursion_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponse* + response); + +/** + * core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_without_recursion_response_get_error_details: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponse. + * + * Get the error details for this response. + * + * Returns: (allow-none): an error details or %NULL. + */ +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_without_recursion_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponse* + response); + +/** + * core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_without_recursion_response_get_return_value: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponse. + * + * Get the return value for this response. + * + * Returns: a return value. + */ +CoreTestsPigeonTestAllNullableTypesWithoutRecursion* +core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_without_recursion_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponse* + response); + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoBoolResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_bool_response, + CORE_TESTS_PIGEON_TEST, FLUTTER_INTEGRATION_CORE_API_ECHO_BOOL_RESPONSE, + GObject) + +/** + * core_tests_pigeon_test_flutter_integration_core_api_echo_bool_response_is_error: + * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoBoolResponse. + * + * Checks if a response to FlutterIntegrationCoreApi.echoBool is an error. + * + * Returns: a %TRUE if this response is an error. + */ +gboolean +core_tests_pigeon_test_flutter_integration_core_api_echo_bool_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoBoolResponse* response); + +/** + * core_tests_pigeon_test_flutter_integration_core_api_echo_bool_response_get_error_code: + * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoBoolResponse. + * + * Get the error code for this response. + * + * Returns: an error code or %NULL if not an error. + */ +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_bool_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoBoolResponse* response); + +/** + * core_tests_pigeon_test_flutter_integration_core_api_echo_bool_response_get_error_message: + * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoBoolResponse. + * + * Get the error message for this response. + * + * Returns: an error message. + */ +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_bool_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoBoolResponse* response); + +/** + * core_tests_pigeon_test_flutter_integration_core_api_echo_bool_response_get_error_details: + * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoBoolResponse. + * + * Get the error details for this response. + * + * Returns: (allow-none): an error details or %NULL. + */ +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_bool_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoBoolResponse* response); + +/** + * core_tests_pigeon_test_flutter_integration_core_api_echo_bool_response_get_return_value: + * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoBoolResponse. + * + * Get the return value for this response. + * + * Returns: a return value. + */ +gboolean +core_tests_pigeon_test_flutter_integration_core_api_echo_bool_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoBoolResponse* response); + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_int_response, + CORE_TESTS_PIGEON_TEST, FLUTTER_INTEGRATION_CORE_API_ECHO_INT_RESPONSE, + GObject) + +/** + * core_tests_pigeon_test_flutter_integration_core_api_echo_int_response_is_error: + * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntResponse. + * + * Checks if a response to FlutterIntegrationCoreApi.echoInt is an error. + * + * Returns: a %TRUE if this response is an error. + */ +gboolean +core_tests_pigeon_test_flutter_integration_core_api_echo_int_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntResponse* response); + +/** + * core_tests_pigeon_test_flutter_integration_core_api_echo_int_response_get_error_code: + * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntResponse. + * + * Get the error code for this response. + * + * Returns: an error code or %NULL if not an error. + */ +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_int_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntResponse* response); + +/** + * core_tests_pigeon_test_flutter_integration_core_api_echo_int_response_get_error_message: + * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntResponse. + * + * Get the error message for this response. + * + * Returns: an error message. + */ +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_int_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntResponse* response); + +/** + * core_tests_pigeon_test_flutter_integration_core_api_echo_int_response_get_error_details: + * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntResponse. + * + * Get the error details for this response. + * + * Returns: (allow-none): an error details or %NULL. + */ +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_int_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntResponse* response); + +/** + * core_tests_pigeon_test_flutter_integration_core_api_echo_int_response_get_return_value: + * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntResponse. + * + * Get the return value for this response. + * + * Returns: a return value. + */ +int64_t +core_tests_pigeon_test_flutter_integration_core_api_echo_int_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntResponse* response); + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoDoubleResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_double_response, + CORE_TESTS_PIGEON_TEST, FLUTTER_INTEGRATION_CORE_API_ECHO_DOUBLE_RESPONSE, + GObject) + +/** + * core_tests_pigeon_test_flutter_integration_core_api_echo_double_response_is_error: + * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoDoubleResponse. + * + * Checks if a response to FlutterIntegrationCoreApi.echoDouble is an error. + * + * Returns: a %TRUE if this response is an error. + */ +gboolean +core_tests_pigeon_test_flutter_integration_core_api_echo_double_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoDoubleResponse* response); + +/** + * core_tests_pigeon_test_flutter_integration_core_api_echo_double_response_get_error_code: + * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoDoubleResponse. + * + * Get the error code for this response. + * + * Returns: an error code or %NULL if not an error. + */ +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_double_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoDoubleResponse* response); + +/** + * core_tests_pigeon_test_flutter_integration_core_api_echo_double_response_get_error_message: + * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoDoubleResponse. + * + * Get the error message for this response. + * + * Returns: an error message. + */ +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_double_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoDoubleResponse* response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_error_noop_async: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @code: error code. - * @message: error message. - * @details: (allow-none): error details or %NULL. + * core_tests_pigeon_test_flutter_integration_core_api_echo_double_response_get_error_details: + * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoDoubleResponse. * - * Responds with an error to HostIntegrationCoreApi.noopAsync. + * Get the error details for this response. + * + * Returns: (allow-none): an error details or %NULL. */ -void core_tests_pigeon_test_host_integration_core_api_respond_error_noop_async( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details); +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_double_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoDoubleResponse* response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_echo_async_int: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @return_value: location to write the value returned by this method. + * core_tests_pigeon_test_flutter_integration_core_api_echo_double_response_get_return_value: + * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoDoubleResponse. * - * Responds to HostIntegrationCoreApi.echoAsyncInt. + * Get the return value for this response. + * + * Returns: a return value. */ -void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_int( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - int64_t return_value); +double +core_tests_pigeon_test_flutter_integration_core_api_echo_double_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoDoubleResponse* response); + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_string_response, + CORE_TESTS_PIGEON_TEST, FLUTTER_INTEGRATION_CORE_API_ECHO_STRING_RESPONSE, + GObject) /** - * core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_int: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @code: error code. - * @message: error message. - * @details: (allow-none): error details or %NULL. + * core_tests_pigeon_test_flutter_integration_core_api_echo_string_response_is_error: + * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringResponse. * - * Responds with an error to HostIntegrationCoreApi.echoAsyncInt. + * Checks if a response to FlutterIntegrationCoreApi.echoString is an error. + * + * Returns: a %TRUE if this response is an error. */ -void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_int( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details); +gboolean +core_tests_pigeon_test_flutter_integration_core_api_echo_string_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringResponse* response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_echo_async_double: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @return_value: location to write the value returned by this method. + * core_tests_pigeon_test_flutter_integration_core_api_echo_string_response_get_error_code: + * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringResponse. * - * Responds to HostIntegrationCoreApi.echoAsyncDouble. + * Get the error code for this response. + * + * Returns: an error code or %NULL if not an error. */ -void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_double( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - double return_value); +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_string_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringResponse* response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_double: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @code: error code. - * @message: error message. - * @details: (allow-none): error details or %NULL. + * core_tests_pigeon_test_flutter_integration_core_api_echo_string_response_get_error_message: + * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringResponse. * - * Responds with an error to HostIntegrationCoreApi.echoAsyncDouble. + * Get the error message for this response. + * + * Returns: an error message. */ -void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_double( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details); +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_string_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringResponse* response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_echo_async_bool: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @return_value: location to write the value returned by this method. + * core_tests_pigeon_test_flutter_integration_core_api_echo_string_response_get_error_details: + * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringResponse. * - * Responds to HostIntegrationCoreApi.echoAsyncBool. + * Get the error details for this response. + * + * Returns: (allow-none): an error details or %NULL. */ -void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_bool( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - gboolean return_value); +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_string_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringResponse* response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_bool: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @code: error code. - * @message: error message. - * @details: (allow-none): error details or %NULL. + * core_tests_pigeon_test_flutter_integration_core_api_echo_string_response_get_return_value: + * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringResponse. * - * Responds with an error to HostIntegrationCoreApi.echoAsyncBool. + * Get the return value for this response. + * + * Returns: a return value. */ -void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_bool( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details); +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_string_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringResponse* response); + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoUint8ListResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list_response, + CORE_TESTS_PIGEON_TEST, + FLUTTER_INTEGRATION_CORE_API_ECHO_UINT8_LIST_RESPONSE, GObject) /** - * core_tests_pigeon_test_host_integration_core_api_respond_echo_async_string: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @return_value: location to write the value returned by this method. + * core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list_response_is_error: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoUint8ListResponse. * - * Responds to HostIntegrationCoreApi.echoAsyncString. + * Checks if a response to FlutterIntegrationCoreApi.echoUint8List is an error. + * + * Returns: a %TRUE if this response is an error. */ -void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_string( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* return_value); +gboolean +core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoUint8ListResponse* + response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_string: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @code: error code. - * @message: error message. - * @details: (allow-none): error details or %NULL. + * core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list_response_get_error_code: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoUint8ListResponse. * - * Responds with an error to HostIntegrationCoreApi.echoAsyncString. + * Get the error code for this response. + * + * Returns: an error code or %NULL if not an error. */ -void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_string( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details); +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoUint8ListResponse* + response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_echo_async_uint8_list: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @return_value: location to write the value returned by this method. - * @return_value_length: (allow-none): location to write length of @return_value - * or %NULL to ignore. + * core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list_response_get_error_message: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoUint8ListResponse. * - * Responds to HostIntegrationCoreApi.echoAsyncUint8List. + * Get the error message for this response. + * + * Returns: an error message. */ -void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_uint8_list( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const uint8_t* return_value, size_t return_value_length); +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoUint8ListResponse* + response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_uint8_list: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @code: error code. - * @message: error message. - * @details: (allow-none): error details or %NULL. + * core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list_response_get_error_details: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoUint8ListResponse. * - * Responds with an error to HostIntegrationCoreApi.echoAsyncUint8List. + * Get the error details for this response. + * + * Returns: (allow-none): an error details or %NULL. */ -void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_uint8_list( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details); +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoUint8ListResponse* + response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_echo_async_object: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @return_value: location to write the value returned by this method. + * core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list_response_get_return_value: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoUint8ListResponse. + * @return_value_length: (allow-none): location to write length of the return + * value or %NULL to ignore. * - * Responds to HostIntegrationCoreApi.echoAsyncObject. + * Get the return value for this response. + * + * Returns: a return value. */ -void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_object( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - FlValue* return_value); +const uint8_t* +core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoUint8ListResponse* response, + size_t* return_value_length); + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoListResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_list_response, + CORE_TESTS_PIGEON_TEST, FLUTTER_INTEGRATION_CORE_API_ECHO_LIST_RESPONSE, + GObject) /** - * core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_object: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @code: error code. - * @message: error message. - * @details: (allow-none): error details or %NULL. + * core_tests_pigeon_test_flutter_integration_core_api_echo_list_response_is_error: + * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoListResponse. * - * Responds with an error to HostIntegrationCoreApi.echoAsyncObject. + * Checks if a response to FlutterIntegrationCoreApi.echoList is an error. + * + * Returns: a %TRUE if this response is an error. */ -void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_object( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details); +gboolean +core_tests_pigeon_test_flutter_integration_core_api_echo_list_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoListResponse* response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_echo_async_list: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @return_value: location to write the value returned by this method. + * core_tests_pigeon_test_flutter_integration_core_api_echo_list_response_get_error_code: + * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoListResponse. * - * Responds to HostIntegrationCoreApi.echoAsyncList. - */ -void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_list( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - FlValue* return_value); + * Get the error code for this response. + * + * Returns: an error code or %NULL if not an error. + */ +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_list_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoListResponse* response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_list: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @code: error code. - * @message: error message. - * @details: (allow-none): error details or %NULL. + * core_tests_pigeon_test_flutter_integration_core_api_echo_list_response_get_error_message: + * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoListResponse. * - * Responds with an error to HostIntegrationCoreApi.echoAsyncList. + * Get the error message for this response. + * + * Returns: an error message. */ -void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_list( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details); +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_list_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoListResponse* response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_echo_async_map: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @return_value: location to write the value returned by this method. + * core_tests_pigeon_test_flutter_integration_core_api_echo_list_response_get_error_details: + * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoListResponse. * - * Responds to HostIntegrationCoreApi.echoAsyncMap. + * Get the error details for this response. + * + * Returns: (allow-none): an error details or %NULL. */ -void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_map( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - FlValue* return_value); +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_list_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoListResponse* response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_map: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @code: error code. - * @message: error message. - * @details: (allow-none): error details or %NULL. + * core_tests_pigeon_test_flutter_integration_core_api_echo_list_response_get_return_value: + * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoListResponse. * - * Responds with an error to HostIntegrationCoreApi.echoAsyncMap. + * Get the return value for this response. + * + * Returns: a return value. */ -void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_map( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details); +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_list_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoListResponse* response); + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumListResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_enum_list_response, + CORE_TESTS_PIGEON_TEST, + FLUTTER_INTEGRATION_CORE_API_ECHO_ENUM_LIST_RESPONSE, GObject) /** - * core_tests_pigeon_test_host_integration_core_api_respond_echo_async_enum: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @return_value: location to write the value returned by this method. + * core_tests_pigeon_test_flutter_integration_core_api_echo_enum_list_response_is_error: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumListResponse. * - * Responds to HostIntegrationCoreApi.echoAsyncEnum. + * Checks if a response to FlutterIntegrationCoreApi.echoEnumList is an error. + * + * Returns: a %TRUE if this response is an error. */ -void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_enum( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - CoreTestsPigeonTestAnEnum return_value); +gboolean +core_tests_pigeon_test_flutter_integration_core_api_echo_enum_list_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumListResponse* response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_enum: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @code: error code. - * @message: error message. - * @details: (allow-none): error details or %NULL. + * core_tests_pigeon_test_flutter_integration_core_api_echo_enum_list_response_get_error_code: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumListResponse. * - * Responds with an error to HostIntegrationCoreApi.echoAsyncEnum. + * Get the error code for this response. + * + * Returns: an error code or %NULL if not an error. */ -void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_enum( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details); +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_enum_list_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumListResponse* response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_echo_another_async_enum: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @return_value: location to write the value returned by this method. + * core_tests_pigeon_test_flutter_integration_core_api_echo_enum_list_response_get_error_message: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumListResponse. * - * Responds to HostIntegrationCoreApi.echoAnotherAsyncEnum. + * Get the error message for this response. + * + * Returns: an error message. */ -void core_tests_pigeon_test_host_integration_core_api_respond_echo_another_async_enum( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - CoreTestsPigeonTestAnotherEnum return_value); +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_enum_list_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumListResponse* response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_error_echo_another_async_enum: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @code: error code. - * @message: error message. - * @details: (allow-none): error details or %NULL. + * core_tests_pigeon_test_flutter_integration_core_api_echo_enum_list_response_get_error_details: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumListResponse. * - * Responds with an error to HostIntegrationCoreApi.echoAnotherAsyncEnum. + * Get the error details for this response. + * + * Returns: (allow-none): an error details or %NULL. */ -void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_another_async_enum( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details); +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_enum_list_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumListResponse* response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_throw_async_error: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @return_value: location to write the value returned by this method. + * core_tests_pigeon_test_flutter_integration_core_api_echo_enum_list_response_get_return_value: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumListResponse. * - * Responds to HostIntegrationCoreApi.throwAsyncError. + * Get the return value for this response. + * + * Returns: a return value. */ -void core_tests_pigeon_test_host_integration_core_api_respond_throw_async_error( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - FlValue* return_value); +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_enum_list_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumListResponse* response); + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoClassListResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_class_list_response, + CORE_TESTS_PIGEON_TEST, + FLUTTER_INTEGRATION_CORE_API_ECHO_CLASS_LIST_RESPONSE, GObject) /** - * core_tests_pigeon_test_host_integration_core_api_respond_error_throw_async_error: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @code: error code. - * @message: error message. - * @details: (allow-none): error details or %NULL. + * core_tests_pigeon_test_flutter_integration_core_api_echo_class_list_response_is_error: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoClassListResponse. * - * Responds with an error to HostIntegrationCoreApi.throwAsyncError. + * Checks if a response to FlutterIntegrationCoreApi.echoClassList is an error. + * + * Returns: a %TRUE if this response is an error. */ -void core_tests_pigeon_test_host_integration_core_api_respond_error_throw_async_error( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details); +gboolean +core_tests_pigeon_test_flutter_integration_core_api_echo_class_list_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoClassListResponse* + response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_throw_async_error_from_void: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * core_tests_pigeon_test_flutter_integration_core_api_echo_class_list_response_get_error_code: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoClassListResponse. * - * Responds to HostIntegrationCoreApi.throwAsyncErrorFromVoid. + * Get the error code for this response. + * + * Returns: an error code or %NULL if not an error. */ -void core_tests_pigeon_test_host_integration_core_api_respond_throw_async_error_from_void( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle); +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_class_list_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoClassListResponse* + response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_error_throw_async_error_from_void: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @code: error code. - * @message: error message. - * @details: (allow-none): error details or %NULL. + * core_tests_pigeon_test_flutter_integration_core_api_echo_class_list_response_get_error_message: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoClassListResponse. * - * Responds with an error to HostIntegrationCoreApi.throwAsyncErrorFromVoid. + * Get the error message for this response. + * + * Returns: an error message. */ -void core_tests_pigeon_test_host_integration_core_api_respond_error_throw_async_error_from_void( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details); +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_class_list_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoClassListResponse* + response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_throw_async_flutter_error: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @return_value: location to write the value returned by this method. + * core_tests_pigeon_test_flutter_integration_core_api_echo_class_list_response_get_error_details: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoClassListResponse. * - * Responds to HostIntegrationCoreApi.throwAsyncFlutterError. + * Get the error details for this response. + * + * Returns: (allow-none): an error details or %NULL. */ -void core_tests_pigeon_test_host_integration_core_api_respond_throw_async_flutter_error( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - FlValue* return_value); +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_class_list_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoClassListResponse* + response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_error_throw_async_flutter_error: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @code: error code. - * @message: error message. - * @details: (allow-none): error details or %NULL. + * core_tests_pigeon_test_flutter_integration_core_api_echo_class_list_response_get_return_value: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoClassListResponse. * - * Responds with an error to HostIntegrationCoreApi.throwAsyncFlutterError. + * Get the return value for this response. + * + * Returns: a return value. */ -void core_tests_pigeon_test_host_integration_core_api_respond_error_throw_async_flutter_error( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details); +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_class_list_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoClassListResponse* + response); + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullEnumListResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_list_response, + CORE_TESTS_PIGEON_TEST, + FLUTTER_INTEGRATION_CORE_API_ECHO_NON_NULL_ENUM_LIST_RESPONSE, GObject) /** - * core_tests_pigeon_test_host_integration_core_api_respond_echo_async_all_types: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @return_value: location to write the value returned by this method. + * core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_list_response_is_error: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullEnumListResponse. * - * Responds to HostIntegrationCoreApi.echoAsyncAllTypes. + * Checks if a response to FlutterIntegrationCoreApi.echoNonNullEnumList is an + * error. + * + * Returns: a %TRUE if this response is an error. */ -void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_all_types( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - CoreTestsPigeonTestAllTypes* return_value); +gboolean +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_list_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullEnumListResponse* + response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_all_types: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @code: error code. - * @message: error message. - * @details: (allow-none): error details or %NULL. + * core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_list_response_get_error_code: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullEnumListResponse. * - * Responds with an error to HostIntegrationCoreApi.echoAsyncAllTypes. + * Get the error code for this response. + * + * Returns: an error code or %NULL if not an error. */ -void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_all_types( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details); +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_list_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullEnumListResponse* + response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_all_nullable_types: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @return_value: location to write the value returned by this method. + * core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_list_response_get_error_message: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullEnumListResponse. * - * Responds to HostIntegrationCoreApi.echoAsyncNullableAllNullableTypes. + * Get the error message for this response. + * + * Returns: an error message. */ -void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_all_nullable_types( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - CoreTestsPigeonTestAllNullableTypes* return_value); +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_list_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullEnumListResponse* + response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_all_nullable_types: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @code: error code. - * @message: error message. - * @details: (allow-none): error details or %NULL. + * core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_list_response_get_error_details: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullEnumListResponse. * - * Responds with an error to - * HostIntegrationCoreApi.echoAsyncNullableAllNullableTypes. + * Get the error details for this response. + * + * Returns: (allow-none): an error details or %NULL. */ -void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_all_nullable_types( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details); +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_list_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullEnumListResponse* + response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_all_nullable_types_without_recursion: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @return_value: location to write the value returned by this method. + * core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_list_response_get_return_value: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullEnumListResponse. + * + * Get the return value for this response. * - * Responds to - * HostIntegrationCoreApi.echoAsyncNullableAllNullableTypesWithoutRecursion. + * Returns: a return value. */ -void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_all_nullable_types_without_recursion( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - CoreTestsPigeonTestAllNullableTypesWithoutRecursion* return_value); +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_list_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullEnumListResponse* + response); + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullClassListResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_list_response, + CORE_TESTS_PIGEON_TEST, + FLUTTER_INTEGRATION_CORE_API_ECHO_NON_NULL_CLASS_LIST_RESPONSE, GObject) /** - * core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_all_nullable_types_without_recursion: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @code: error code. - * @message: error message. - * @details: (allow-none): error details or %NULL. + * core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_list_response_is_error: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullClassListResponse. * - * Responds with an error to - * HostIntegrationCoreApi.echoAsyncNullableAllNullableTypesWithoutRecursion. + * Checks if a response to FlutterIntegrationCoreApi.echoNonNullClassList is an + * error. + * + * Returns: a %TRUE if this response is an error. */ -void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_all_nullable_types_without_recursion( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details); +gboolean +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_list_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullClassListResponse* + response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_int: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @return_value: location to write the value returned by this method. + * core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_list_response_get_error_code: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullClassListResponse. * - * Responds to HostIntegrationCoreApi.echoAsyncNullableInt. + * Get the error code for this response. + * + * Returns: an error code or %NULL if not an error. */ -void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_int( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - int64_t* return_value); +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_list_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullClassListResponse* + response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_int: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @code: error code. - * @message: error message. - * @details: (allow-none): error details or %NULL. + * core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_list_response_get_error_message: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullClassListResponse. * - * Responds with an error to HostIntegrationCoreApi.echoAsyncNullableInt. + * Get the error message for this response. + * + * Returns: an error message. */ -void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_int( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details); +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_list_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullClassListResponse* + response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_double: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @return_value: location to write the value returned by this method. + * core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_list_response_get_error_details: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullClassListResponse. * - * Responds to HostIntegrationCoreApi.echoAsyncNullableDouble. + * Get the error details for this response. + * + * Returns: (allow-none): an error details or %NULL. */ -void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_double( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - double* return_value); +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_list_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullClassListResponse* + response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_double: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @code: error code. - * @message: error message. - * @details: (allow-none): error details or %NULL. + * core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_list_response_get_return_value: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullClassListResponse. * - * Responds with an error to HostIntegrationCoreApi.echoAsyncNullableDouble. + * Get the return value for this response. + * + * Returns: a return value. */ -void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_double( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details); +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_list_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullClassListResponse* + response); + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoMapResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_map_response, + CORE_TESTS_PIGEON_TEST, FLUTTER_INTEGRATION_CORE_API_ECHO_MAP_RESPONSE, + GObject) /** - * core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_bool: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @return_value: location to write the value returned by this method. + * core_tests_pigeon_test_flutter_integration_core_api_echo_map_response_is_error: + * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoMapResponse. * - * Responds to HostIntegrationCoreApi.echoAsyncNullableBool. + * Checks if a response to FlutterIntegrationCoreApi.echoMap is an error. + * + * Returns: a %TRUE if this response is an error. */ -void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_bool( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - gboolean* return_value); +gboolean +core_tests_pigeon_test_flutter_integration_core_api_echo_map_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoMapResponse* response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_bool: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @code: error code. - * @message: error message. - * @details: (allow-none): error details or %NULL. + * core_tests_pigeon_test_flutter_integration_core_api_echo_map_response_get_error_code: + * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoMapResponse. * - * Responds with an error to HostIntegrationCoreApi.echoAsyncNullableBool. + * Get the error code for this response. + * + * Returns: an error code or %NULL if not an error. */ -void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_bool( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details); +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_map_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoMapResponse* response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_string: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @return_value: location to write the value returned by this method. + * core_tests_pigeon_test_flutter_integration_core_api_echo_map_response_get_error_message: + * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoMapResponse. * - * Responds to HostIntegrationCoreApi.echoAsyncNullableString. + * Get the error message for this response. + * + * Returns: an error message. */ -void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_string( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* return_value); +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_map_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoMapResponse* response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_string: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @code: error code. - * @message: error message. - * @details: (allow-none): error details or %NULL. + * core_tests_pigeon_test_flutter_integration_core_api_echo_map_response_get_error_details: + * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoMapResponse. * - * Responds with an error to HostIntegrationCoreApi.echoAsyncNullableString. + * Get the error details for this response. + * + * Returns: (allow-none): an error details or %NULL. */ -void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_string( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details); +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_map_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoMapResponse* response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_uint8_list: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @return_value: location to write the value returned by this method. - * @return_value_length: (allow-none): location to write length of @return_value - * or %NULL to ignore. + * core_tests_pigeon_test_flutter_integration_core_api_echo_map_response_get_return_value: + * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoMapResponse. * - * Responds to HostIntegrationCoreApi.echoAsyncNullableUint8List. + * Get the return value for this response. + * + * Returns: a return value. */ -void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_uint8_list( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const uint8_t* return_value, size_t return_value_length); +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_map_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoMapResponse* response); + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringMapResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_response, + CORE_TESTS_PIGEON_TEST, + FLUTTER_INTEGRATION_CORE_API_ECHO_STRING_MAP_RESPONSE, GObject) /** - * core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_uint8_list: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @code: error code. - * @message: error message. - * @details: (allow-none): error details or %NULL. + * core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_response_is_error: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringMapResponse. * - * Responds with an error to HostIntegrationCoreApi.echoAsyncNullableUint8List. + * Checks if a response to FlutterIntegrationCoreApi.echoStringMap is an error. + * + * Returns: a %TRUE if this response is an error. */ -void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_uint8_list( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details); +gboolean +core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringMapResponse* + response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_object: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @return_value: location to write the value returned by this method. + * core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_response_get_error_code: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringMapResponse. * - * Responds to HostIntegrationCoreApi.echoAsyncNullableObject. + * Get the error code for this response. + * + * Returns: an error code or %NULL if not an error. */ -void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_object( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - FlValue* return_value); +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringMapResponse* + response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_object: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @code: error code. - * @message: error message. - * @details: (allow-none): error details or %NULL. + * core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_response_get_error_message: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringMapResponse. * - * Responds with an error to HostIntegrationCoreApi.echoAsyncNullableObject. + * Get the error message for this response. + * + * Returns: an error message. */ -void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_object( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details); +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringMapResponse* + response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_list: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @return_value: location to write the value returned by this method. + * core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_response_get_error_details: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringMapResponse. * - * Responds to HostIntegrationCoreApi.echoAsyncNullableList. + * Get the error details for this response. + * + * Returns: (allow-none): an error details or %NULL. */ -void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_list( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - FlValue* return_value); +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringMapResponse* + response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_list: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @code: error code. - * @message: error message. - * @details: (allow-none): error details or %NULL. + * core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_response_get_return_value: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringMapResponse. * - * Responds with an error to HostIntegrationCoreApi.echoAsyncNullableList. + * Get the return value for this response. + * + * Returns: a return value. */ -void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_list( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details); +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringMapResponse* + response); + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntMapResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_response, + CORE_TESTS_PIGEON_TEST, FLUTTER_INTEGRATION_CORE_API_ECHO_INT_MAP_RESPONSE, + GObject) /** - * core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_map: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @return_value: location to write the value returned by this method. + * core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_response_is_error: + * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntMapResponse. * - * Responds to HostIntegrationCoreApi.echoAsyncNullableMap. + * Checks if a response to FlutterIntegrationCoreApi.echoIntMap is an error. + * + * Returns: a %TRUE if this response is an error. */ -void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_map( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - FlValue* return_value); +gboolean +core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntMapResponse* response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_map: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @code: error code. - * @message: error message. - * @details: (allow-none): error details or %NULL. + * core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_response_get_error_code: + * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntMapResponse. * - * Responds with an error to HostIntegrationCoreApi.echoAsyncNullableMap. + * Get the error code for this response. + * + * Returns: an error code or %NULL if not an error. */ -void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_map( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details); +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntMapResponse* response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_enum: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @return_value: location to write the value returned by this method. + * core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_response_get_error_message: + * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntMapResponse. * - * Responds to HostIntegrationCoreApi.echoAsyncNullableEnum. + * Get the error message for this response. + * + * Returns: an error message. */ -void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_enum( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - CoreTestsPigeonTestAnEnum* return_value); +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntMapResponse* response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_enum: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @code: error code. - * @message: error message. - * @details: (allow-none): error details or %NULL. + * core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_response_get_error_details: + * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntMapResponse. * - * Responds with an error to HostIntegrationCoreApi.echoAsyncNullableEnum. + * Get the error details for this response. + * + * Returns: (allow-none): an error details or %NULL. */ -void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_enum( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details); +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntMapResponse* response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_echo_another_async_nullable_enum: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @return_value: location to write the value returned by this method. + * core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_response_get_return_value: + * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntMapResponse. * - * Responds to HostIntegrationCoreApi.echoAnotherAsyncNullableEnum. + * Get the return value for this response. + * + * Returns: a return value. */ -void core_tests_pigeon_test_host_integration_core_api_respond_echo_another_async_nullable_enum( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - CoreTestsPigeonTestAnotherEnum* return_value); +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntMapResponse* response); + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumMapResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_enum_map_response, + CORE_TESTS_PIGEON_TEST, FLUTTER_INTEGRATION_CORE_API_ECHO_ENUM_MAP_RESPONSE, + GObject) /** - * core_tests_pigeon_test_host_integration_core_api_respond_error_echo_another_async_nullable_enum: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @code: error code. - * @message: error message. - * @details: (allow-none): error details or %NULL. + * core_tests_pigeon_test_flutter_integration_core_api_echo_enum_map_response_is_error: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumMapResponse. * - * Responds with an error to - * HostIntegrationCoreApi.echoAnotherAsyncNullableEnum. + * Checks if a response to FlutterIntegrationCoreApi.echoEnumMap is an error. + * + * Returns: a %TRUE if this response is an error. */ -void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_another_async_nullable_enum( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details); +gboolean +core_tests_pigeon_test_flutter_integration_core_api_echo_enum_map_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumMapResponse* response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_noop: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * core_tests_pigeon_test_flutter_integration_core_api_echo_enum_map_response_get_error_code: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumMapResponse. * - * Responds to HostIntegrationCoreApi.callFlutterNoop. + * Get the error code for this response. + * + * Returns: an error code or %NULL if not an error. */ -void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_noop( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle); +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_enum_map_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumMapResponse* response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_noop: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @code: error code. - * @message: error message. - * @details: (allow-none): error details or %NULL. + * core_tests_pigeon_test_flutter_integration_core_api_echo_enum_map_response_get_error_message: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumMapResponse. * - * Responds with an error to HostIntegrationCoreApi.callFlutterNoop. + * Get the error message for this response. + * + * Returns: an error message. */ -void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_noop( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details); +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_enum_map_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumMapResponse* response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_throw_error: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @return_value: location to write the value returned by this method. + * core_tests_pigeon_test_flutter_integration_core_api_echo_enum_map_response_get_error_details: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumMapResponse. * - * Responds to HostIntegrationCoreApi.callFlutterThrowError. + * Get the error details for this response. + * + * Returns: (allow-none): an error details or %NULL. */ -void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_throw_error( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - FlValue* return_value); +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_enum_map_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumMapResponse* response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_throw_error: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @code: error code. - * @message: error message. - * @details: (allow-none): error details or %NULL. + * core_tests_pigeon_test_flutter_integration_core_api_echo_enum_map_response_get_return_value: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumMapResponse. * - * Responds with an error to HostIntegrationCoreApi.callFlutterThrowError. + * Get the return value for this response. + * + * Returns: a return value. */ -void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_throw_error( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details); +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_enum_map_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumMapResponse* response); + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoClassMapResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_class_map_response, + CORE_TESTS_PIGEON_TEST, + FLUTTER_INTEGRATION_CORE_API_ECHO_CLASS_MAP_RESPONSE, GObject) /** - * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_throw_error_from_void: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * core_tests_pigeon_test_flutter_integration_core_api_echo_class_map_response_is_error: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoClassMapResponse. * - * Responds to HostIntegrationCoreApi.callFlutterThrowErrorFromVoid. + * Checks if a response to FlutterIntegrationCoreApi.echoClassMap is an error. + * + * Returns: a %TRUE if this response is an error. */ -void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_throw_error_from_void( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle); +gboolean +core_tests_pigeon_test_flutter_integration_core_api_echo_class_map_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoClassMapResponse* response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_throw_error_from_void: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @code: error code. - * @message: error message. - * @details: (allow-none): error details or %NULL. + * core_tests_pigeon_test_flutter_integration_core_api_echo_class_map_response_get_error_code: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoClassMapResponse. * - * Responds with an error to - * HostIntegrationCoreApi.callFlutterThrowErrorFromVoid. + * Get the error code for this response. + * + * Returns: an error code or %NULL if not an error. */ -void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_throw_error_from_void( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details); +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_class_map_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoClassMapResponse* response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_all_types: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @return_value: location to write the value returned by this method. + * core_tests_pigeon_test_flutter_integration_core_api_echo_class_map_response_get_error_message: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoClassMapResponse. * - * Responds to HostIntegrationCoreApi.callFlutterEchoAllTypes. + * Get the error message for this response. + * + * Returns: an error message. */ -void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_all_types( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - CoreTestsPigeonTestAllTypes* return_value); +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_class_map_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoClassMapResponse* response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_all_types: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @code: error code. - * @message: error message. - * @details: (allow-none): error details or %NULL. + * core_tests_pigeon_test_flutter_integration_core_api_echo_class_map_response_get_error_details: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoClassMapResponse. * - * Responds with an error to HostIntegrationCoreApi.callFlutterEchoAllTypes. + * Get the error details for this response. + * + * Returns: (allow-none): an error details or %NULL. */ -void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_all_types( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details); +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_class_map_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoClassMapResponse* response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_all_nullable_types: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @return_value: location to write the value returned by this method. + * core_tests_pigeon_test_flutter_integration_core_api_echo_class_map_response_get_return_value: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoClassMapResponse. * - * Responds to HostIntegrationCoreApi.callFlutterEchoAllNullableTypes. + * Get the return value for this response. + * + * Returns: a return value. */ -void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_all_nullable_types( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - CoreTestsPigeonTestAllNullableTypes* return_value); +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_class_map_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoClassMapResponse* response); + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullStringMapResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_string_map_response, + CORE_TESTS_PIGEON_TEST, + FLUTTER_INTEGRATION_CORE_API_ECHO_NON_NULL_STRING_MAP_RESPONSE, GObject) /** - * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_all_nullable_types: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @code: error code. - * @message: error message. - * @details: (allow-none): error details or %NULL. + * core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_string_map_response_is_error: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullStringMapResponse. * - * Responds with an error to - * HostIntegrationCoreApi.callFlutterEchoAllNullableTypes. + * Checks if a response to FlutterIntegrationCoreApi.echoNonNullStringMap is an + * error. + * + * Returns: a %TRUE if this response is an error. */ -void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_all_nullable_types( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details); +gboolean +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_string_map_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullStringMapResponse* + response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_send_multiple_nullable_types: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @return_value: location to write the value returned by this method. + * core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_string_map_response_get_error_code: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullStringMapResponse. * - * Responds to HostIntegrationCoreApi.callFlutterSendMultipleNullableTypes. + * Get the error code for this response. + * + * Returns: an error code or %NULL if not an error. */ -void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_send_multiple_nullable_types( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - CoreTestsPigeonTestAllNullableTypes* return_value); +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_string_map_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullStringMapResponse* + response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_send_multiple_nullable_types: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @code: error code. - * @message: error message. - * @details: (allow-none): error details or %NULL. + * core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_string_map_response_get_error_message: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullStringMapResponse. * - * Responds with an error to - * HostIntegrationCoreApi.callFlutterSendMultipleNullableTypes. + * Get the error message for this response. + * + * Returns: an error message. */ -void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_send_multiple_nullable_types( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details); +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_string_map_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullStringMapResponse* + response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_all_nullable_types_without_recursion: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @return_value: location to write the value returned by this method. + * core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_string_map_response_get_error_details: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullStringMapResponse. * - * Responds to - * HostIntegrationCoreApi.callFlutterEchoAllNullableTypesWithoutRecursion. + * Get the error details for this response. + * + * Returns: (allow-none): an error details or %NULL. */ -void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_all_nullable_types_without_recursion( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - CoreTestsPigeonTestAllNullableTypesWithoutRecursion* return_value); +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_string_map_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullStringMapResponse* + response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_all_nullable_types_without_recursion: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @code: error code. - * @message: error message. - * @details: (allow-none): error details or %NULL. + * core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_string_map_response_get_return_value: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullStringMapResponse. * - * Responds with an error to - * HostIntegrationCoreApi.callFlutterEchoAllNullableTypesWithoutRecursion. - */ -void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_all_nullable_types_without_recursion( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details); + * Get the return value for this response. + * + * Returns: a return value. + */ +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_string_map_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullStringMapResponse* + response); + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullIntMapResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_int_map_response, + CORE_TESTS_PIGEON_TEST, + FLUTTER_INTEGRATION_CORE_API_ECHO_NON_NULL_INT_MAP_RESPONSE, GObject) /** - * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_send_multiple_nullable_types_without_recursion: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @return_value: location to write the value returned by this method. + * core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_int_map_response_is_error: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullIntMapResponse. * - * Responds to - * HostIntegrationCoreApi.callFlutterSendMultipleNullableTypesWithoutRecursion. + * Checks if a response to FlutterIntegrationCoreApi.echoNonNullIntMap is an + * error. + * + * Returns: a %TRUE if this response is an error. */ -void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_send_multiple_nullable_types_without_recursion( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - CoreTestsPigeonTestAllNullableTypesWithoutRecursion* return_value); +gboolean +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_int_map_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullIntMapResponse* + response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_send_multiple_nullable_types_without_recursion: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @code: error code. - * @message: error message. - * @details: (allow-none): error details or %NULL. + * core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_int_map_response_get_error_code: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullIntMapResponse. * - * Responds with an error to - * HostIntegrationCoreApi.callFlutterSendMultipleNullableTypesWithoutRecursion. + * Get the error code for this response. + * + * Returns: an error code or %NULL if not an error. */ -void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_send_multiple_nullable_types_without_recursion( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details); +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_int_map_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullIntMapResponse* + response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_bool: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @return_value: location to write the value returned by this method. + * core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_int_map_response_get_error_message: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullIntMapResponse. * - * Responds to HostIntegrationCoreApi.callFlutterEchoBool. + * Get the error message for this response. + * + * Returns: an error message. */ -void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_bool( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - gboolean return_value); +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_int_map_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullIntMapResponse* + response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_bool: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @code: error code. - * @message: error message. - * @details: (allow-none): error details or %NULL. + * core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_int_map_response_get_error_details: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullIntMapResponse. * - * Responds with an error to HostIntegrationCoreApi.callFlutterEchoBool. + * Get the error details for this response. + * + * Returns: (allow-none): an error details or %NULL. */ -void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_bool( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details); +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_int_map_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullIntMapResponse* + response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_int: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @return_value: location to write the value returned by this method. + * core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_int_map_response_get_return_value: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullIntMapResponse. * - * Responds to HostIntegrationCoreApi.callFlutterEchoInt. + * Get the return value for this response. + * + * Returns: a return value. */ -void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_int( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - int64_t return_value); +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_int_map_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullIntMapResponse* + response); + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullEnumMapResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_map_response, + CORE_TESTS_PIGEON_TEST, + FLUTTER_INTEGRATION_CORE_API_ECHO_NON_NULL_ENUM_MAP_RESPONSE, GObject) /** - * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_int: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @code: error code. - * @message: error message. - * @details: (allow-none): error details or %NULL. + * core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_map_response_is_error: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullEnumMapResponse. * - * Responds with an error to HostIntegrationCoreApi.callFlutterEchoInt. + * Checks if a response to FlutterIntegrationCoreApi.echoNonNullEnumMap is an + * error. + * + * Returns: a %TRUE if this response is an error. */ -void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_int( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details); +gboolean +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_map_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullEnumMapResponse* + response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_double: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @return_value: location to write the value returned by this method. + * core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_map_response_get_error_code: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullEnumMapResponse. * - * Responds to HostIntegrationCoreApi.callFlutterEchoDouble. + * Get the error code for this response. + * + * Returns: an error code or %NULL if not an error. */ -void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_double( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - double return_value); +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_map_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullEnumMapResponse* + response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_double: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @code: error code. - * @message: error message. - * @details: (allow-none): error details or %NULL. + * core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_map_response_get_error_message: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullEnumMapResponse. * - * Responds with an error to HostIntegrationCoreApi.callFlutterEchoDouble. + * Get the error message for this response. + * + * Returns: an error message. */ -void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_double( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details); +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_map_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullEnumMapResponse* + response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_string: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @return_value: location to write the value returned by this method. + * core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_map_response_get_error_details: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullEnumMapResponse. * - * Responds to HostIntegrationCoreApi.callFlutterEchoString. + * Get the error details for this response. + * + * Returns: (allow-none): an error details or %NULL. */ -void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_string( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* return_value); +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_map_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullEnumMapResponse* + response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_string: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @code: error code. - * @message: error message. - * @details: (allow-none): error details or %NULL. + * core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_map_response_get_return_value: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullEnumMapResponse. * - * Responds with an error to HostIntegrationCoreApi.callFlutterEchoString. + * Get the return value for this response. + * + * Returns: a return value. */ -void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_string( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details); +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_map_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullEnumMapResponse* + response); + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullClassMapResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_map_response, + CORE_TESTS_PIGEON_TEST, + FLUTTER_INTEGRATION_CORE_API_ECHO_NON_NULL_CLASS_MAP_RESPONSE, GObject) /** - * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_uint8_list: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @return_value: location to write the value returned by this method. - * @return_value_length: (allow-none): location to write length of @return_value - * or %NULL to ignore. + * core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_map_response_is_error: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullClassMapResponse. * - * Responds to HostIntegrationCoreApi.callFlutterEchoUint8List. + * Checks if a response to FlutterIntegrationCoreApi.echoNonNullClassMap is an + * error. + * + * Returns: a %TRUE if this response is an error. */ -void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_uint8_list( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const uint8_t* return_value, size_t return_value_length); +gboolean +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_map_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullClassMapResponse* + response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_uint8_list: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @code: error code. - * @message: error message. - * @details: (allow-none): error details or %NULL. + * core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_map_response_get_error_code: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullClassMapResponse. * - * Responds with an error to HostIntegrationCoreApi.callFlutterEchoUint8List. + * Get the error code for this response. + * + * Returns: an error code or %NULL if not an error. */ -void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_uint8_list( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details); +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_map_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullClassMapResponse* + response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_list: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @return_value: location to write the value returned by this method. + * core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_map_response_get_error_message: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullClassMapResponse. * - * Responds to HostIntegrationCoreApi.callFlutterEchoList. + * Get the error message for this response. + * + * Returns: an error message. */ -void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_list( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - FlValue* return_value); +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_map_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullClassMapResponse* + response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_list: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @code: error code. - * @message: error message. - * @details: (allow-none): error details or %NULL. + * core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_map_response_get_error_details: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullClassMapResponse. * - * Responds with an error to HostIntegrationCoreApi.callFlutterEchoList. + * Get the error details for this response. + * + * Returns: (allow-none): an error details or %NULL. */ -void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_list( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details); +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_map_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullClassMapResponse* + response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_map: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @return_value: location to write the value returned by this method. + * core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_map_response_get_return_value: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullClassMapResponse. * - * Responds to HostIntegrationCoreApi.callFlutterEchoMap. + * Get the return value for this response. + * + * Returns: a return value. */ -void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_map( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - FlValue* return_value); +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_map_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullClassMapResponse* + response); + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_enum_response, + CORE_TESTS_PIGEON_TEST, FLUTTER_INTEGRATION_CORE_API_ECHO_ENUM_RESPONSE, + GObject) /** - * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_map: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @code: error code. - * @message: error message. - * @details: (allow-none): error details or %NULL. + * core_tests_pigeon_test_flutter_integration_core_api_echo_enum_response_is_error: + * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumResponse. * - * Responds with an error to HostIntegrationCoreApi.callFlutterEchoMap. + * Checks if a response to FlutterIntegrationCoreApi.echoEnum is an error. + * + * Returns: a %TRUE if this response is an error. */ -void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_map( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details); +gboolean +core_tests_pigeon_test_flutter_integration_core_api_echo_enum_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumResponse* response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_enum: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @return_value: location to write the value returned by this method. + * core_tests_pigeon_test_flutter_integration_core_api_echo_enum_response_get_error_code: + * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumResponse. + * + * Get the error code for this response. * - * Responds to HostIntegrationCoreApi.callFlutterEchoEnum. + * Returns: an error code or %NULL if not an error. */ -void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_enum( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - CoreTestsPigeonTestAnEnum return_value); +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_enum_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumResponse* response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_enum: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @code: error code. - * @message: error message. - * @details: (allow-none): error details or %NULL. + * core_tests_pigeon_test_flutter_integration_core_api_echo_enum_response_get_error_message: + * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumResponse. * - * Responds with an error to HostIntegrationCoreApi.callFlutterEchoEnum. + * Get the error message for this response. + * + * Returns: an error message. */ -void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_enum( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details); +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_enum_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumResponse* response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_another_enum: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @return_value: location to write the value returned by this method. + * core_tests_pigeon_test_flutter_integration_core_api_echo_enum_response_get_error_details: + * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumResponse. * - * Responds to HostIntegrationCoreApi.callFlutterEchoAnotherEnum. + * Get the error details for this response. + * + * Returns: (allow-none): an error details or %NULL. */ -void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_another_enum( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - CoreTestsPigeonTestAnotherEnum return_value); +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_enum_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumResponse* response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_another_enum: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @code: error code. - * @message: error message. - * @details: (allow-none): error details or %NULL. + * core_tests_pigeon_test_flutter_integration_core_api_echo_enum_response_get_return_value: + * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumResponse. * - * Responds with an error to HostIntegrationCoreApi.callFlutterEchoAnotherEnum. + * Get the return value for this response. + * + * Returns: a return value. */ -void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_another_enum( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details); +CoreTestsPigeonTestAnEnum +core_tests_pigeon_test_flutter_integration_core_api_echo_enum_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumResponse* response); + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAnotherEnumResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_response, + CORE_TESTS_PIGEON_TEST, + FLUTTER_INTEGRATION_CORE_API_ECHO_ANOTHER_ENUM_RESPONSE, GObject) /** - * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_bool: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @return_value: location to write the value returned by this method. + * core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_response_is_error: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAnotherEnumResponse. * - * Responds to HostIntegrationCoreApi.callFlutterEchoNullableBool. + * Checks if a response to FlutterIntegrationCoreApi.echoAnotherEnum is an + * error. + * + * Returns: a %TRUE if this response is an error. */ -void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_bool( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - gboolean* return_value); +gboolean +core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAnotherEnumResponse* + response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_bool: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @code: error code. - * @message: error message. - * @details: (allow-none): error details or %NULL. + * core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_response_get_error_code: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAnotherEnumResponse. * - * Responds with an error to HostIntegrationCoreApi.callFlutterEchoNullableBool. + * Get the error code for this response. + * + * Returns: an error code or %NULL if not an error. */ -void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_bool( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details); +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAnotherEnumResponse* + response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_int: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @return_value: location to write the value returned by this method. + * core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_response_get_error_message: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAnotherEnumResponse. * - * Responds to HostIntegrationCoreApi.callFlutterEchoNullableInt. + * Get the error message for this response. + * + * Returns: an error message. */ -void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_int( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - int64_t* return_value); +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAnotherEnumResponse* + response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_int: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @code: error code. - * @message: error message. - * @details: (allow-none): error details or %NULL. + * core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_response_get_error_details: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAnotherEnumResponse. * - * Responds with an error to HostIntegrationCoreApi.callFlutterEchoNullableInt. + * Get the error details for this response. + * + * Returns: (allow-none): an error details or %NULL. */ -void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_int( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details); +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAnotherEnumResponse* + response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_double: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @return_value: location to write the value returned by this method. + * core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_response_get_return_value: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAnotherEnumResponse. * - * Responds to HostIntegrationCoreApi.callFlutterEchoNullableDouble. + * Get the return value for this response. + * + * Returns: a return value. */ -void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_double( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - double* return_value); +CoreTestsPigeonTestAnotherEnum +core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAnotherEnumResponse* + response); + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableBoolResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_response, + CORE_TESTS_PIGEON_TEST, + FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_BOOL_RESPONSE, GObject) /** - * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_double: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @code: error code. - * @message: error message. - * @details: (allow-none): error details or %NULL. + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_response_is_error: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableBoolResponse. * - * Responds with an error to - * HostIntegrationCoreApi.callFlutterEchoNullableDouble. + * Checks if a response to FlutterIntegrationCoreApi.echoNullableBool is an + * error. + * + * Returns: a %TRUE if this response is an error. */ -void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_double( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details); +gboolean +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableBoolResponse* + response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_string: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @return_value: location to write the value returned by this method. + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_response_get_error_code: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableBoolResponse. * - * Responds to HostIntegrationCoreApi.callFlutterEchoNullableString. + * Get the error code for this response. + * + * Returns: an error code or %NULL if not an error. */ -void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_string( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* return_value); +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableBoolResponse* + response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_string: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @code: error code. - * @message: error message. - * @details: (allow-none): error details or %NULL. + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_response_get_error_message: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableBoolResponse. * - * Responds with an error to - * HostIntegrationCoreApi.callFlutterEchoNullableString. + * Get the error message for this response. + * + * Returns: an error message. */ -void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_string( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details); +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableBoolResponse* + response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_uint8_list: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @return_value: location to write the value returned by this method. - * @return_value_length: (allow-none): location to write length of @return_value - * or %NULL to ignore. + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_response_get_error_details: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableBoolResponse. * - * Responds to HostIntegrationCoreApi.callFlutterEchoNullableUint8List. + * Get the error details for this response. + * + * Returns: (allow-none): an error details or %NULL. */ -void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_uint8_list( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const uint8_t* return_value, size_t return_value_length); +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableBoolResponse* + response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_uint8_list: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @code: error code. - * @message: error message. - * @details: (allow-none): error details or %NULL. + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_response_get_return_value: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableBoolResponse. * - * Responds with an error to - * HostIntegrationCoreApi.callFlutterEchoNullableUint8List. + * Get the return value for this response. + * + * Returns: (allow-none): a return value or %NULL. */ -void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_uint8_list( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details); +gboolean* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableBoolResponse* + response); + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_response, + CORE_TESTS_PIGEON_TEST, + FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_INT_RESPONSE, GObject) /** - * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_list: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @return_value: location to write the value returned by this method. + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_response_is_error: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntResponse. * - * Responds to HostIntegrationCoreApi.callFlutterEchoNullableList. + * Checks if a response to FlutterIntegrationCoreApi.echoNullableInt is an + * error. + * + * Returns: a %TRUE if this response is an error. */ -void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_list( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - FlValue* return_value); +gboolean +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntResponse* + response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_list: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @code: error code. - * @message: error message. - * @details: (allow-none): error details or %NULL. + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_response_get_error_code: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntResponse. * - * Responds with an error to HostIntegrationCoreApi.callFlutterEchoNullableList. + * Get the error code for this response. + * + * Returns: an error code or %NULL if not an error. */ -void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_list( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details); +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntResponse* + response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_map: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @return_value: location to write the value returned by this method. + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_response_get_error_message: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntResponse. * - * Responds to HostIntegrationCoreApi.callFlutterEchoNullableMap. + * Get the error message for this response. + * + * Returns: an error message. */ -void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_map( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - FlValue* return_value); +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntResponse* + response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_map: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @code: error code. - * @message: error message. - * @details: (allow-none): error details or %NULL. + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_response_get_error_details: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntResponse. * - * Responds with an error to HostIntegrationCoreApi.callFlutterEchoNullableMap. + * Get the error details for this response. + * + * Returns: (allow-none): an error details or %NULL. */ -void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_map( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details); +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntResponse* + response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_enum: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @return_value: location to write the value returned by this method. + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_response_get_return_value: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntResponse. * - * Responds to HostIntegrationCoreApi.callFlutterEchoNullableEnum. + * Get the return value for this response. + * + * Returns: (allow-none): a return value or %NULL. */ -void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_enum( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - CoreTestsPigeonTestAnEnum* return_value); +int64_t* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntResponse* + response); + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableDoubleResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_response, + CORE_TESTS_PIGEON_TEST, + FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_DOUBLE_RESPONSE, GObject) /** - * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_enum: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @code: error code. - * @message: error message. - * @details: (allow-none): error details or %NULL. + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_response_is_error: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableDoubleResponse. * - * Responds with an error to HostIntegrationCoreApi.callFlutterEchoNullableEnum. + * Checks if a response to FlutterIntegrationCoreApi.echoNullableDouble is an + * error. + * + * Returns: a %TRUE if this response is an error. */ -void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_enum( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details); +gboolean +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableDoubleResponse* + response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_another_nullable_enum: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @return_value: location to write the value returned by this method. + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_response_get_error_code: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableDoubleResponse. * - * Responds to HostIntegrationCoreApi.callFlutterEchoAnotherNullableEnum. + * Get the error code for this response. + * + * Returns: an error code or %NULL if not an error. */ -void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_another_nullable_enum( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - CoreTestsPigeonTestAnotherEnum* return_value); +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableDoubleResponse* + response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_another_nullable_enum: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @code: error code. - * @message: error message. - * @details: (allow-none): error details or %NULL. + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_response_get_error_message: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableDoubleResponse. * - * Responds with an error to - * HostIntegrationCoreApi.callFlutterEchoAnotherNullableEnum. + * Get the error message for this response. + * + * Returns: an error message. */ -void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_another_nullable_enum( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details); +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableDoubleResponse* + response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_small_api_echo_string: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @return_value: location to write the value returned by this method. + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_response_get_error_details: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableDoubleResponse. * - * Responds to HostIntegrationCoreApi.callFlutterSmallApiEchoString. + * Get the error details for this response. + * + * Returns: (allow-none): an error details or %NULL. */ -void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_small_api_echo_string( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* return_value); +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableDoubleResponse* + response); /** - * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_small_api_echo_string: - * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. - * @code: error code. - * @message: error message. - * @details: (allow-none): error details or %NULL. + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_response_get_return_value: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableDoubleResponse. * - * Responds with an error to - * HostIntegrationCoreApi.callFlutterSmallApiEchoString. + * Get the return value for this response. + * + * Returns: (allow-none): a return value or %NULL. */ -void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_small_api_echo_string( - CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - const gchar* code, const gchar* message, FlValue* details); +double* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableDoubleResponse* + response); G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestFlutterIntegrationCoreApiNoopResponse, - core_tests_pigeon_test_flutter_integration_core_api_noop_response, - CORE_TESTS_PIGEON_TEST, FLUTTER_INTEGRATION_CORE_API_NOOP_RESPONSE, GObject) + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_response, + CORE_TESTS_PIGEON_TEST, + FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_STRING_RESPONSE, GObject) /** - * core_tests_pigeon_test_flutter_integration_core_api_noop_response_is_error: - * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiNoopResponse. + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_response_is_error: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringResponse. * - * Checks if a response to FlutterIntegrationCoreApi.noop is an error. + * Checks if a response to FlutterIntegrationCoreApi.echoNullableString is an + * error. * * Returns: a %TRUE if this response is an error. */ gboolean -core_tests_pigeon_test_flutter_integration_core_api_noop_response_is_error( - CoreTestsPigeonTestFlutterIntegrationCoreApiNoopResponse* response); +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringResponse* + response); /** - * core_tests_pigeon_test_flutter_integration_core_api_noop_response_get_error_code: - * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiNoopResponse. + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_response_get_error_code: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringResponse. * * Get the error code for this response. * * Returns: an error code or %NULL if not an error. */ const gchar* -core_tests_pigeon_test_flutter_integration_core_api_noop_response_get_error_code( - CoreTestsPigeonTestFlutterIntegrationCoreApiNoopResponse* response); +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringResponse* + response); /** - * core_tests_pigeon_test_flutter_integration_core_api_noop_response_get_error_message: - * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiNoopResponse. + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_response_get_error_message: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringResponse. * * Get the error message for this response. * * Returns: an error message. */ const gchar* -core_tests_pigeon_test_flutter_integration_core_api_noop_response_get_error_message( - CoreTestsPigeonTestFlutterIntegrationCoreApiNoopResponse* response); +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringResponse* + response); /** - * core_tests_pigeon_test_flutter_integration_core_api_noop_response_get_error_details: - * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiNoopResponse. + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_response_get_error_details: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringResponse. * * Get the error details for this response. * * Returns: (allow-none): an error details or %NULL. */ FlValue* -core_tests_pigeon_test_flutter_integration_core_api_noop_response_get_error_details( - CoreTestsPigeonTestFlutterIntegrationCoreApiNoopResponse* response); +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringResponse* + response); + +/** + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_response_get_return_value: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringResponse. + * + * Get the return value for this response. + * + * Returns: (allow-none): a return value or %NULL. + */ +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringResponse* + response); G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorResponse, - core_tests_pigeon_test_flutter_integration_core_api_throw_error_response, - CORE_TESTS_PIGEON_TEST, FLUTTER_INTEGRATION_CORE_API_THROW_ERROR_RESPONSE, - GObject) + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableUint8ListResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_response, + CORE_TESTS_PIGEON_TEST, + FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_UINT8_LIST_RESPONSE, GObject) /** - * core_tests_pigeon_test_flutter_integration_core_api_throw_error_response_is_error: - * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorResponse. + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_response_is_error: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableUint8ListResponse. * - * Checks if a response to FlutterIntegrationCoreApi.throwError is an error. + * Checks if a response to FlutterIntegrationCoreApi.echoNullableUint8List is an + * error. * * Returns: a %TRUE if this response is an error. */ gboolean -core_tests_pigeon_test_flutter_integration_core_api_throw_error_response_is_error( - CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorResponse* response); +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableUint8ListResponse* + response); /** - * core_tests_pigeon_test_flutter_integration_core_api_throw_error_response_get_error_code: - * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorResponse. + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_response_get_error_code: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableUint8ListResponse. * * Get the error code for this response. * * Returns: an error code or %NULL if not an error. */ const gchar* -core_tests_pigeon_test_flutter_integration_core_api_throw_error_response_get_error_code( - CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorResponse* response); +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableUint8ListResponse* + response); /** - * core_tests_pigeon_test_flutter_integration_core_api_throw_error_response_get_error_message: - * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorResponse. + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_response_get_error_message: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableUint8ListResponse. * * Get the error message for this response. * * Returns: an error message. */ const gchar* -core_tests_pigeon_test_flutter_integration_core_api_throw_error_response_get_error_message( - CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorResponse* response); +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableUint8ListResponse* + response); /** - * core_tests_pigeon_test_flutter_integration_core_api_throw_error_response_get_error_details: - * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorResponse. + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_response_get_error_details: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableUint8ListResponse. * * Get the error details for this response. * * Returns: (allow-none): an error details or %NULL. */ FlValue* -core_tests_pigeon_test_flutter_integration_core_api_throw_error_response_get_error_details( - CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorResponse* response); +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableUint8ListResponse* + response); /** - * core_tests_pigeon_test_flutter_integration_core_api_throw_error_response_get_return_value: - * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorResponse. + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_response_get_return_value: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableUint8ListResponse. + * @return_value_length: (allow-none): location to write length of the return + * value or %NULL to ignore. * * Get the return value for this response. * * Returns: (allow-none): a return value or %NULL. */ -FlValue* -core_tests_pigeon_test_flutter_integration_core_api_throw_error_response_get_return_value( - CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorResponse* response); +const uint8_t* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableUint8ListResponse* + response, + size_t* return_value_length); G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorFromVoidResponse, - core_tests_pigeon_test_flutter_integration_core_api_throw_error_from_void_response, + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableListResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_response, CORE_TESTS_PIGEON_TEST, - FLUTTER_INTEGRATION_CORE_API_THROW_ERROR_FROM_VOID_RESPONSE, GObject) + FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_LIST_RESPONSE, GObject) /** - * core_tests_pigeon_test_flutter_integration_core_api_throw_error_from_void_response_is_error: + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_response_is_error: * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorFromVoidResponse. + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableListResponse. * - * Checks if a response to FlutterIntegrationCoreApi.throwErrorFromVoid is an + * Checks if a response to FlutterIntegrationCoreApi.echoNullableList is an * error. * * Returns: a %TRUE if this response is an error. */ gboolean -core_tests_pigeon_test_flutter_integration_core_api_throw_error_from_void_response_is_error( - CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorFromVoidResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableListResponse* response); /** - * core_tests_pigeon_test_flutter_integration_core_api_throw_error_from_void_response_get_error_code: + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_response_get_error_code: * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorFromVoidResponse. + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableListResponse. * * Get the error code for this response. * * Returns: an error code or %NULL if not an error. */ const gchar* -core_tests_pigeon_test_flutter_integration_core_api_throw_error_from_void_response_get_error_code( - CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorFromVoidResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableListResponse* response); /** - * core_tests_pigeon_test_flutter_integration_core_api_throw_error_from_void_response_get_error_message: + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_response_get_error_message: * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorFromVoidResponse. + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableListResponse. * * Get the error message for this response. * * Returns: an error message. */ const gchar* -core_tests_pigeon_test_flutter_integration_core_api_throw_error_from_void_response_get_error_message( - CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorFromVoidResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableListResponse* response); /** - * core_tests_pigeon_test_flutter_integration_core_api_throw_error_from_void_response_get_error_details: + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_response_get_error_details: * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorFromVoidResponse. + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableListResponse. * * Get the error details for this response. * * Returns: (allow-none): an error details or %NULL. */ FlValue* -core_tests_pigeon_test_flutter_integration_core_api_throw_error_from_void_response_get_error_details( - CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorFromVoidResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableListResponse* + response); + +/** + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_response_get_return_value: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableListResponse. + * + * Get the return value for this response. + * + * Returns: (allow-none): a return value or %NULL. + */ +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableListResponse* response); G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllTypesResponse, - core_tests_pigeon_test_flutter_integration_core_api_echo_all_types_response, + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableEnumListResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_list_response, CORE_TESTS_PIGEON_TEST, - FLUTTER_INTEGRATION_CORE_API_ECHO_ALL_TYPES_RESPONSE, GObject) + FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_ENUM_LIST_RESPONSE, GObject) /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_all_types_response_is_error: + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_list_response_is_error: * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllTypesResponse. + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableEnumListResponse. * - * Checks if a response to FlutterIntegrationCoreApi.echoAllTypes is an error. + * Checks if a response to FlutterIntegrationCoreApi.echoNullableEnumList is an + * error. * * Returns: a %TRUE if this response is an error. */ gboolean -core_tests_pigeon_test_flutter_integration_core_api_echo_all_types_response_is_error( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllTypesResponse* response); +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_list_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableEnumListResponse* + response); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_all_types_response_get_error_code: + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_list_response_get_error_code: * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllTypesResponse. + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableEnumListResponse. * * Get the error code for this response. * * Returns: an error code or %NULL if not an error. */ const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_all_types_response_get_error_code( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllTypesResponse* response); +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_list_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableEnumListResponse* + response); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_all_types_response_get_error_message: + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_list_response_get_error_message: * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllTypesResponse. + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableEnumListResponse. * * Get the error message for this response. * * Returns: an error message. */ const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_all_types_response_get_error_message( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllTypesResponse* response); +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_list_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableEnumListResponse* + response); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_all_types_response_get_error_details: + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_list_response_get_error_details: * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllTypesResponse. + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableEnumListResponse. * * Get the error details for this response. * * Returns: (allow-none): an error details or %NULL. */ FlValue* -core_tests_pigeon_test_flutter_integration_core_api_echo_all_types_response_get_error_details( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllTypesResponse* response); +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_list_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableEnumListResponse* + response); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_all_types_response_get_return_value: + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_list_response_get_return_value: * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllTypesResponse. + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableEnumListResponse. * * Get the return value for this response. * - * Returns: a return value. + * Returns: (allow-none): a return value or %NULL. */ -CoreTestsPigeonTestAllTypes* -core_tests_pigeon_test_flutter_integration_core_api_echo_all_types_response_get_return_value( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllTypesResponse* response); +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_list_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableEnumListResponse* + response); G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesResponse, - core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_response, + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableClassListResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_list_response, CORE_TESTS_PIGEON_TEST, - FLUTTER_INTEGRATION_CORE_API_ECHO_ALL_NULLABLE_TYPES_RESPONSE, GObject) + FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_CLASS_LIST_RESPONSE, GObject) /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_response_is_error: + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_list_response_is_error: * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesResponse. + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableClassListResponse. * - * Checks if a response to FlutterIntegrationCoreApi.echoAllNullableTypes is an + * Checks if a response to FlutterIntegrationCoreApi.echoNullableClassList is an * error. * * Returns: a %TRUE if this response is an error. */ gboolean -core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_response_is_error( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_list_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableClassListResponse* response); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_response_get_error_code: + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_list_response_get_error_code: * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesResponse. + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableClassListResponse. * * Get the error code for this response. * * Returns: an error code or %NULL if not an error. */ const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_response_get_error_code( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_list_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableClassListResponse* response); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_response_get_error_message: + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_list_response_get_error_message: * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesResponse. + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableClassListResponse. * * Get the error message for this response. * * Returns: an error message. */ const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_response_get_error_message( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_list_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableClassListResponse* response); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_response_get_error_details: + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_list_response_get_error_details: * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesResponse. + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableClassListResponse. * * Get the error details for this response. * * Returns: (allow-none): an error details or %NULL. */ FlValue* -core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_response_get_error_details( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_list_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableClassListResponse* response); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_response_get_return_value: + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_list_response_get_return_value: * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesResponse. + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableClassListResponse. * * Get the return value for this response. * * Returns: (allow-none): a return value or %NULL. */ -CoreTestsPigeonTestAllNullableTypes* -core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_response_get_return_value( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesResponse* +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_list_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableClassListResponse* response); G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesResponse, - core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_response, + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullEnumListResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_list_response, CORE_TESTS_PIGEON_TEST, - FLUTTER_INTEGRATION_CORE_API_SEND_MULTIPLE_NULLABLE_TYPES_RESPONSE, GObject) + FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_NON_NULL_ENUM_LIST_RESPONSE, + GObject) /** - * core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_response_is_error: + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_list_response_is_error: * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesResponse. + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullEnumListResponse. * - * Checks if a response to FlutterIntegrationCoreApi.sendMultipleNullableTypes + * Checks if a response to FlutterIntegrationCoreApi.echoNullableNonNullEnumList * is an error. * * Returns: a %TRUE if this response is an error. */ gboolean -core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_response_is_error( - CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_list_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullEnumListResponse* response); /** - * core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_response_get_error_code: + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_list_response_get_error_code: * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesResponse. + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullEnumListResponse. * * Get the error code for this response. * * Returns: an error code or %NULL if not an error. */ const gchar* -core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_response_get_error_code( - CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_list_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullEnumListResponse* response); /** - * core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_response_get_error_message: + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_list_response_get_error_message: * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesResponse. + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullEnumListResponse. * * Get the error message for this response. * * Returns: an error message. */ const gchar* -core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_response_get_error_message( - CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_list_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullEnumListResponse* response); /** - * core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_response_get_error_details: + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_list_response_get_error_details: * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesResponse. + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullEnumListResponse. * * Get the error details for this response. * * Returns: (allow-none): an error details or %NULL. */ FlValue* -core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_response_get_error_details( - CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_list_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullEnumListResponse* response); /** - * core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_response_get_return_value: + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_list_response_get_return_value: * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesResponse. + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullEnumListResponse. * * Get the return value for this response. * - * Returns: a return value. + * Returns: (allow-none): a return value or %NULL. */ -CoreTestsPigeonTestAllNullableTypes* -core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_response_get_return_value( - CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesResponse* +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_list_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullEnumListResponse* response); G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponse, - core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_without_recursion_response, + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullClassListResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_list_response, CORE_TESTS_PIGEON_TEST, - FLUTTER_INTEGRATION_CORE_API_ECHO_ALL_NULLABLE_TYPES_WITHOUT_RECURSION_RESPONSE, + FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_NON_NULL_CLASS_LIST_RESPONSE, GObject) /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_without_recursion_response_is_error: + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_list_response_is_error: * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponse. + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullClassListResponse. * * Checks if a response to - * FlutterIntegrationCoreApi.echoAllNullableTypesWithoutRecursion is an error. + * FlutterIntegrationCoreApi.echoNullableNonNullClassList is an error. * * Returns: a %TRUE if this response is an error. */ gboolean -core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_without_recursion_response_is_error( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_list_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullClassListResponse* response); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_without_recursion_response_get_error_code: + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_list_response_get_error_code: * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponse. + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullClassListResponse. * * Get the error code for this response. * * Returns: an error code or %NULL if not an error. */ const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_without_recursion_response_get_error_code( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_list_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullClassListResponse* response); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_without_recursion_response_get_error_message: + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_list_response_get_error_message: * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponse. + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullClassListResponse. * * Get the error message for this response. * * Returns: an error message. */ const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_without_recursion_response_get_error_message( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_list_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullClassListResponse* response); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_without_recursion_response_get_error_details: + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_list_response_get_error_details: * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponse. + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullClassListResponse. * * Get the error details for this response. * * Returns: (allow-none): an error details or %NULL. */ FlValue* -core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_without_recursion_response_get_error_details( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_list_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullClassListResponse* response); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_without_recursion_response_get_return_value: + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_list_response_get_return_value: * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponse. + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullClassListResponse. * * Get the return value for this response. * * Returns: (allow-none): a return value or %NULL. */ -CoreTestsPigeonTestAllNullableTypesWithoutRecursion* -core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_without_recursion_response_get_return_value( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponse* +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_list_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullClassListResponse* response); G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponse, - core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_without_recursion_response, + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableMapResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_response, CORE_TESTS_PIGEON_TEST, - FLUTTER_INTEGRATION_CORE_API_SEND_MULTIPLE_NULLABLE_TYPES_WITHOUT_RECURSION_RESPONSE, - GObject) + FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_MAP_RESPONSE, GObject) /** - * core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_without_recursion_response_is_error: + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_response_is_error: * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponse. + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableMapResponse. * - * Checks if a response to - * FlutterIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion is an + * Checks if a response to FlutterIntegrationCoreApi.echoNullableMap is an * error. * * Returns: a %TRUE if this response is an error. */ gboolean -core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_without_recursion_response_is_error( - CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableMapResponse* response); /** - * core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_without_recursion_response_get_error_code: + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_response_get_error_code: * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponse. + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableMapResponse. * * Get the error code for this response. * * Returns: an error code or %NULL if not an error. */ const gchar* -core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_without_recursion_response_get_error_code( - CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableMapResponse* response); /** - * core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_without_recursion_response_get_error_message: + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_response_get_error_message: * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponse. + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableMapResponse. * * Get the error message for this response. * * Returns: an error message. */ const gchar* -core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_without_recursion_response_get_error_message( - CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableMapResponse* response); /** - * core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_without_recursion_response_get_error_details: + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_response_get_error_details: * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponse. + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableMapResponse. * * Get the error details for this response. * * Returns: (allow-none): an error details or %NULL. */ FlValue* -core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_without_recursion_response_get_error_details( - CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableMapResponse* response); /** - * core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_without_recursion_response_get_return_value: + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_response_get_return_value: * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponse. + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableMapResponse. * * Get the return value for this response. * - * Returns: a return value. + * Returns: (allow-none): a return value or %NULL. */ -CoreTestsPigeonTestAllNullableTypesWithoutRecursion* -core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_without_recursion_response_get_return_value( - CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponse* +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableMapResponse* response); G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoBoolResponse, - core_tests_pigeon_test_flutter_integration_core_api_echo_bool_response, - CORE_TESTS_PIGEON_TEST, FLUTTER_INTEGRATION_CORE_API_ECHO_BOOL_RESPONSE, - GObject) + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringMapResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_response, + CORE_TESTS_PIGEON_TEST, + FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_STRING_MAP_RESPONSE, GObject) /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_bool_response_is_error: - * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoBoolResponse. + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_response_is_error: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringMapResponse. * - * Checks if a response to FlutterIntegrationCoreApi.echoBool is an error. + * Checks if a response to FlutterIntegrationCoreApi.echoNullableStringMap is an + * error. * * Returns: a %TRUE if this response is an error. */ gboolean -core_tests_pigeon_test_flutter_integration_core_api_echo_bool_response_is_error( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoBoolResponse* response); +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringMapResponse* + response); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_bool_response_get_error_code: - * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoBoolResponse. + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_response_get_error_code: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringMapResponse. * * Get the error code for this response. * * Returns: an error code or %NULL if not an error. */ const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_bool_response_get_error_code( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoBoolResponse* response); +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringMapResponse* + response); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_bool_response_get_error_message: - * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoBoolResponse. + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_response_get_error_message: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringMapResponse. * * Get the error message for this response. * * Returns: an error message. */ const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_bool_response_get_error_message( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoBoolResponse* response); +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringMapResponse* + response); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_bool_response_get_error_details: - * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoBoolResponse. + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_response_get_error_details: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringMapResponse. * * Get the error details for this response. * * Returns: (allow-none): an error details or %NULL. */ FlValue* -core_tests_pigeon_test_flutter_integration_core_api_echo_bool_response_get_error_details( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoBoolResponse* response); +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringMapResponse* + response); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_bool_response_get_return_value: - * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoBoolResponse. + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_response_get_return_value: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringMapResponse. * * Get the return value for this response. * - * Returns: a return value. + * Returns: (allow-none): a return value or %NULL. */ -gboolean -core_tests_pigeon_test_flutter_integration_core_api_echo_bool_response_get_return_value( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoBoolResponse* response); +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringMapResponse* + response); G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntResponse, - core_tests_pigeon_test_flutter_integration_core_api_echo_int_response, - CORE_TESTS_PIGEON_TEST, FLUTTER_INTEGRATION_CORE_API_ECHO_INT_RESPONSE, - GObject) + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntMapResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_response, + CORE_TESTS_PIGEON_TEST, + FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_INT_MAP_RESPONSE, GObject) /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_int_response_is_error: - * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntResponse. + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_response_is_error: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntMapResponse. * - * Checks if a response to FlutterIntegrationCoreApi.echoInt is an error. + * Checks if a response to FlutterIntegrationCoreApi.echoNullableIntMap is an + * error. * * Returns: a %TRUE if this response is an error. */ gboolean -core_tests_pigeon_test_flutter_integration_core_api_echo_int_response_is_error( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntResponse* response); +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntMapResponse* + response); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_int_response_get_error_code: - * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntResponse. + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_response_get_error_code: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntMapResponse. * * Get the error code for this response. * * Returns: an error code or %NULL if not an error. */ const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_int_response_get_error_code( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntResponse* response); +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntMapResponse* + response); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_int_response_get_error_message: - * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntResponse. + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_response_get_error_message: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntMapResponse. * * Get the error message for this response. * * Returns: an error message. */ const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_int_response_get_error_message( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntResponse* response); +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntMapResponse* + response); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_int_response_get_error_details: - * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntResponse. + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_response_get_error_details: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntMapResponse. * * Get the error details for this response. * * Returns: (allow-none): an error details or %NULL. */ FlValue* -core_tests_pigeon_test_flutter_integration_core_api_echo_int_response_get_error_details( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntResponse* response); +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntMapResponse* + response); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_int_response_get_return_value: - * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntResponse. + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_response_get_return_value: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntMapResponse. * * Get the return value for this response. * - * Returns: a return value. + * Returns: (allow-none): a return value or %NULL. */ -int64_t -core_tests_pigeon_test_flutter_integration_core_api_echo_int_response_get_return_value( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntResponse* response); +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntMapResponse* + response); G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoDoubleResponse, - core_tests_pigeon_test_flutter_integration_core_api_echo_double_response, - CORE_TESTS_PIGEON_TEST, FLUTTER_INTEGRATION_CORE_API_ECHO_DOUBLE_RESPONSE, - GObject) + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableEnumMapResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_map_response, + CORE_TESTS_PIGEON_TEST, + FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_ENUM_MAP_RESPONSE, GObject) /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_double_response_is_error: - * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoDoubleResponse. + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_map_response_is_error: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableEnumMapResponse. * - * Checks if a response to FlutterIntegrationCoreApi.echoDouble is an error. + * Checks if a response to FlutterIntegrationCoreApi.echoNullableEnumMap is an + * error. * * Returns: a %TRUE if this response is an error. */ gboolean -core_tests_pigeon_test_flutter_integration_core_api_echo_double_response_is_error( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoDoubleResponse* response); +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_map_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableEnumMapResponse* + response); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_double_response_get_error_code: - * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoDoubleResponse. + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_map_response_get_error_code: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableEnumMapResponse. * * Get the error code for this response. * * Returns: an error code or %NULL if not an error. */ const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_double_response_get_error_code( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoDoubleResponse* response); +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_map_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableEnumMapResponse* + response); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_double_response_get_error_message: - * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoDoubleResponse. + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_map_response_get_error_message: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableEnumMapResponse. * * Get the error message for this response. * * Returns: an error message. */ const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_double_response_get_error_message( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoDoubleResponse* response); +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_map_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableEnumMapResponse* + response); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_double_response_get_error_details: - * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoDoubleResponse. + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_map_response_get_error_details: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableEnumMapResponse. * * Get the error details for this response. * * Returns: (allow-none): an error details or %NULL. */ FlValue* -core_tests_pigeon_test_flutter_integration_core_api_echo_double_response_get_error_details( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoDoubleResponse* response); +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_map_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableEnumMapResponse* + response); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_double_response_get_return_value: - * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoDoubleResponse. + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_map_response_get_return_value: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableEnumMapResponse. * * Get the return value for this response. * - * Returns: a return value. + * Returns: (allow-none): a return value or %NULL. */ -double -core_tests_pigeon_test_flutter_integration_core_api_echo_double_response_get_return_value( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoDoubleResponse* response); +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_map_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableEnumMapResponse* + response); G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringResponse, - core_tests_pigeon_test_flutter_integration_core_api_echo_string_response, - CORE_TESTS_PIGEON_TEST, FLUTTER_INTEGRATION_CORE_API_ECHO_STRING_RESPONSE, - GObject) + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableClassMapResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_map_response, + CORE_TESTS_PIGEON_TEST, + FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_CLASS_MAP_RESPONSE, GObject) /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_string_response_is_error: - * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringResponse. + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_map_response_is_error: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableClassMapResponse. * - * Checks if a response to FlutterIntegrationCoreApi.echoString is an error. + * Checks if a response to FlutterIntegrationCoreApi.echoNullableClassMap is an + * error. * * Returns: a %TRUE if this response is an error. */ gboolean -core_tests_pigeon_test_flutter_integration_core_api_echo_string_response_is_error( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringResponse* response); +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_map_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableClassMapResponse* + response); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_string_response_get_error_code: - * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringResponse. + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_map_response_get_error_code: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableClassMapResponse. * * Get the error code for this response. * * Returns: an error code or %NULL if not an error. */ const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_string_response_get_error_code( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringResponse* response); +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_map_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableClassMapResponse* + response); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_string_response_get_error_message: - * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringResponse. + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_map_response_get_error_message: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableClassMapResponse. * * Get the error message for this response. * * Returns: an error message. */ const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_string_response_get_error_message( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringResponse* response); +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_map_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableClassMapResponse* + response); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_string_response_get_error_details: - * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringResponse. + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_map_response_get_error_details: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableClassMapResponse. * * Get the error details for this response. * * Returns: (allow-none): an error details or %NULL. */ FlValue* -core_tests_pigeon_test_flutter_integration_core_api_echo_string_response_get_error_details( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringResponse* response); +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_map_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableClassMapResponse* + response); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_string_response_get_return_value: - * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringResponse. + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_map_response_get_return_value: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableClassMapResponse. * * Get the return value for this response. * - * Returns: a return value. + * Returns: (allow-none): a return value or %NULL. */ -const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_string_response_get_return_value( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringResponse* response); +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_map_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableClassMapResponse* + response); G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoUint8ListResponse, - core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list_response, + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullStringMapResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_string_map_response, CORE_TESTS_PIGEON_TEST, - FLUTTER_INTEGRATION_CORE_API_ECHO_UINT8_LIST_RESPONSE, GObject) + FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_NON_NULL_STRING_MAP_RESPONSE, + GObject) /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list_response_is_error: + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_string_map_response_is_error: * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoUint8ListResponse. + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullStringMapResponse. * - * Checks if a response to FlutterIntegrationCoreApi.echoUint8List is an error. + * Checks if a response to + * FlutterIntegrationCoreApi.echoNullableNonNullStringMap is an error. * * Returns: a %TRUE if this response is an error. */ gboolean -core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list_response_is_error( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoUint8ListResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_string_map_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullStringMapResponse* response); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list_response_get_error_code: + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_string_map_response_get_error_code: * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoUint8ListResponse. + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullStringMapResponse. * * Get the error code for this response. * * Returns: an error code or %NULL if not an error. */ const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list_response_get_error_code( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoUint8ListResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_string_map_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullStringMapResponse* response); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list_response_get_error_message: + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_string_map_response_get_error_message: * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoUint8ListResponse. + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullStringMapResponse. * * Get the error message for this response. * * Returns: an error message. */ const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list_response_get_error_message( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoUint8ListResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_string_map_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullStringMapResponse* response); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list_response_get_error_details: + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_string_map_response_get_error_details: * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoUint8ListResponse. + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullStringMapResponse. * * Get the error details for this response. * * Returns: (allow-none): an error details or %NULL. */ FlValue* -core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list_response_get_error_details( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoUint8ListResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_string_map_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullStringMapResponse* response); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list_response_get_return_value: + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_string_map_response_get_return_value: * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoUint8ListResponse. - * @return_value_length: (allow-none): location to write length of the return - * value or %NULL to ignore. + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullStringMapResponse. * * Get the return value for this response. * - * Returns: a return value. + * Returns: (allow-none): a return value or %NULL. */ -const uint8_t* -core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list_response_get_return_value( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoUint8ListResponse* response, - size_t* return_value_length); +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_string_map_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullStringMapResponse* + response); G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoListResponse, - core_tests_pigeon_test_flutter_integration_core_api_echo_list_response, - CORE_TESTS_PIGEON_TEST, FLUTTER_INTEGRATION_CORE_API_ECHO_LIST_RESPONSE, + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullIntMapResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_int_map_response, + CORE_TESTS_PIGEON_TEST, + FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_NON_NULL_INT_MAP_RESPONSE, GObject) /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_list_response_is_error: - * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoListResponse. + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_int_map_response_is_error: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullIntMapResponse. * - * Checks if a response to FlutterIntegrationCoreApi.echoList is an error. + * Checks if a response to FlutterIntegrationCoreApi.echoNullableNonNullIntMap + * is an error. * * Returns: a %TRUE if this response is an error. */ gboolean -core_tests_pigeon_test_flutter_integration_core_api_echo_list_response_is_error( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoListResponse* response); +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_int_map_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullIntMapResponse* + response); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_list_response_get_error_code: - * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoListResponse. + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_int_map_response_get_error_code: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullIntMapResponse. * * Get the error code for this response. * * Returns: an error code or %NULL if not an error. */ const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_list_response_get_error_code( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoListResponse* response); +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_int_map_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullIntMapResponse* + response); -/** - * core_tests_pigeon_test_flutter_integration_core_api_echo_list_response_get_error_message: - * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoListResponse. +/** + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_int_map_response_get_error_message: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullIntMapResponse. * * Get the error message for this response. * * Returns: an error message. */ const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_list_response_get_error_message( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoListResponse* response); +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_int_map_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullIntMapResponse* + response); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_list_response_get_error_details: - * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoListResponse. + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_int_map_response_get_error_details: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullIntMapResponse. * * Get the error details for this response. * * Returns: (allow-none): an error details or %NULL. */ FlValue* -core_tests_pigeon_test_flutter_integration_core_api_echo_list_response_get_error_details( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoListResponse* response); +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_int_map_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullIntMapResponse* + response); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_list_response_get_return_value: - * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoListResponse. + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_int_map_response_get_return_value: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullIntMapResponse. * * Get the return value for this response. * - * Returns: a return value. + * Returns: (allow-none): a return value or %NULL. */ FlValue* -core_tests_pigeon_test_flutter_integration_core_api_echo_list_response_get_return_value( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoListResponse* response); +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_int_map_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullIntMapResponse* + response); G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoMapResponse, - core_tests_pigeon_test_flutter_integration_core_api_echo_map_response, - CORE_TESTS_PIGEON_TEST, FLUTTER_INTEGRATION_CORE_API_ECHO_MAP_RESPONSE, + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullEnumMapResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_map_response, + CORE_TESTS_PIGEON_TEST, + FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_NON_NULL_ENUM_MAP_RESPONSE, GObject) /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_map_response_is_error: - * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoMapResponse. + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_map_response_is_error: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullEnumMapResponse. * - * Checks if a response to FlutterIntegrationCoreApi.echoMap is an error. + * Checks if a response to FlutterIntegrationCoreApi.echoNullableNonNullEnumMap + * is an error. * * Returns: a %TRUE if this response is an error. */ gboolean -core_tests_pigeon_test_flutter_integration_core_api_echo_map_response_is_error( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoMapResponse* response); +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_map_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullEnumMapResponse* + response); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_map_response_get_error_code: - * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoMapResponse. + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_map_response_get_error_code: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullEnumMapResponse. * * Get the error code for this response. * * Returns: an error code or %NULL if not an error. */ const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_map_response_get_error_code( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoMapResponse* response); +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_map_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullEnumMapResponse* + response); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_map_response_get_error_message: - * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoMapResponse. + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_map_response_get_error_message: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullEnumMapResponse. * * Get the error message for this response. * * Returns: an error message. */ const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_map_response_get_error_message( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoMapResponse* response); +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_map_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullEnumMapResponse* + response); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_map_response_get_error_details: - * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoMapResponse. + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_map_response_get_error_details: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullEnumMapResponse. * * Get the error details for this response. * * Returns: (allow-none): an error details or %NULL. */ FlValue* -core_tests_pigeon_test_flutter_integration_core_api_echo_map_response_get_error_details( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoMapResponse* response); +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_map_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullEnumMapResponse* + response); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_map_response_get_return_value: - * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoMapResponse. + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_map_response_get_return_value: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullEnumMapResponse. * * Get the return value for this response. * - * Returns: a return value. + * Returns: (allow-none): a return value or %NULL. */ FlValue* -core_tests_pigeon_test_flutter_integration_core_api_echo_map_response_get_return_value( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoMapResponse* response); +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_map_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullEnumMapResponse* + response); G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumResponse, - core_tests_pigeon_test_flutter_integration_core_api_echo_enum_response, - CORE_TESTS_PIGEON_TEST, FLUTTER_INTEGRATION_CORE_API_ECHO_ENUM_RESPONSE, + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullClassMapResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_map_response, + CORE_TESTS_PIGEON_TEST, + FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_NON_NULL_CLASS_MAP_RESPONSE, GObject) /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_enum_response_is_error: - * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumResponse. + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_map_response_is_error: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullClassMapResponse. * - * Checks if a response to FlutterIntegrationCoreApi.echoEnum is an error. + * Checks if a response to FlutterIntegrationCoreApi.echoNullableNonNullClassMap + * is an error. * * Returns: a %TRUE if this response is an error. */ gboolean -core_tests_pigeon_test_flutter_integration_core_api_echo_enum_response_is_error( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumResponse* response); +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_map_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullClassMapResponse* + response); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_enum_response_get_error_code: - * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumResponse. + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_map_response_get_error_code: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullClassMapResponse. * * Get the error code for this response. * * Returns: an error code or %NULL if not an error. */ const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_enum_response_get_error_code( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumResponse* response); +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_map_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullClassMapResponse* + response); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_enum_response_get_error_message: - * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumResponse. + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_map_response_get_error_message: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullClassMapResponse. * * Get the error message for this response. * * Returns: an error message. */ const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_enum_response_get_error_message( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumResponse* response); +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_map_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullClassMapResponse* + response); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_enum_response_get_error_details: - * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumResponse. + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_map_response_get_error_details: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullClassMapResponse. * * Get the error details for this response. * * Returns: (allow-none): an error details or %NULL. */ FlValue* -core_tests_pigeon_test_flutter_integration_core_api_echo_enum_response_get_error_details( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumResponse* response); +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_map_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullClassMapResponse* + response); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_enum_response_get_return_value: - * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumResponse. + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_map_response_get_return_value: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullClassMapResponse. * * Get the return value for this response. * - * Returns: a return value. + * Returns: (allow-none): a return value or %NULL. */ -CoreTestsPigeonTestAnEnum -core_tests_pigeon_test_flutter_integration_core_api_echo_enum_response_get_return_value( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumResponse* response); +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_map_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullClassMapResponse* + response); G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAnotherEnumResponse, - core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_response, + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableEnumResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_response, CORE_TESTS_PIGEON_TEST, - FLUTTER_INTEGRATION_CORE_API_ECHO_ANOTHER_ENUM_RESPONSE, GObject) + FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_ENUM_RESPONSE, GObject) /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_response_is_error: + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_response_is_error: * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAnotherEnumResponse. + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableEnumResponse. * - * Checks if a response to FlutterIntegrationCoreApi.echoAnotherEnum is an + * Checks if a response to FlutterIntegrationCoreApi.echoNullableEnum is an * error. * * Returns: a %TRUE if this response is an error. */ gboolean -core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_response_is_error( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAnotherEnumResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableEnumResponse* response); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_response_get_error_code: + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_response_get_error_code: * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAnotherEnumResponse. + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableEnumResponse. * * Get the error code for this response. * * Returns: an error code or %NULL if not an error. */ const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_response_get_error_code( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAnotherEnumResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableEnumResponse* response); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_response_get_error_message: + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_response_get_error_message: * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAnotherEnumResponse. + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableEnumResponse. * * Get the error message for this response. * * Returns: an error message. */ const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_response_get_error_message( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAnotherEnumResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableEnumResponse* response); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_response_get_error_details: + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_response_get_error_details: * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAnotherEnumResponse. + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableEnumResponse. * * Get the error details for this response. * * Returns: (allow-none): an error details or %NULL. */ FlValue* -core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_response_get_error_details( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAnotherEnumResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableEnumResponse* response); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_response_get_return_value: + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_response_get_return_value: * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAnotherEnumResponse. + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableEnumResponse. * * Get the return value for this response. * - * Returns: a return value. + * Returns: (allow-none): a return value or %NULL. */ -CoreTestsPigeonTestAnotherEnum -core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_response_get_return_value( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAnotherEnumResponse* +CoreTestsPigeonTestAnEnum* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableEnumResponse* response); G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableBoolResponse, - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_response, + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAnotherNullableEnumResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_another_nullable_enum_response, CORE_TESTS_PIGEON_TEST, - FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_BOOL_RESPONSE, GObject) + FLUTTER_INTEGRATION_CORE_API_ECHO_ANOTHER_NULLABLE_ENUM_RESPONSE, GObject) /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_response_is_error: + * core_tests_pigeon_test_flutter_integration_core_api_echo_another_nullable_enum_response_is_error: * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableBoolResponse. + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAnotherNullableEnumResponse. * - * Checks if a response to FlutterIntegrationCoreApi.echoNullableBool is an - * error. + * Checks if a response to FlutterIntegrationCoreApi.echoAnotherNullableEnum is + * an error. * * Returns: a %TRUE if this response is an error. */ gboolean -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_response_is_error( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableBoolResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_another_nullable_enum_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAnotherNullableEnumResponse* response); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_response_get_error_code: + * core_tests_pigeon_test_flutter_integration_core_api_echo_another_nullable_enum_response_get_error_code: * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableBoolResponse. + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAnotherNullableEnumResponse. * * Get the error code for this response. * * Returns: an error code or %NULL if not an error. */ const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_response_get_error_code( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableBoolResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_another_nullable_enum_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAnotherNullableEnumResponse* response); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_response_get_error_message: + * core_tests_pigeon_test_flutter_integration_core_api_echo_another_nullable_enum_response_get_error_message: * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableBoolResponse. + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAnotherNullableEnumResponse. * * Get the error message for this response. * * Returns: an error message. */ const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_response_get_error_message( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableBoolResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_another_nullable_enum_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAnotherNullableEnumResponse* response); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_response_get_error_details: + * core_tests_pigeon_test_flutter_integration_core_api_echo_another_nullable_enum_response_get_error_details: * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableBoolResponse. + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAnotherNullableEnumResponse. * * Get the error details for this response. * * Returns: (allow-none): an error details or %NULL. */ FlValue* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_response_get_error_details( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableBoolResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_another_nullable_enum_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAnotherNullableEnumResponse* response); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_response_get_return_value: + * core_tests_pigeon_test_flutter_integration_core_api_echo_another_nullable_enum_response_get_return_value: * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableBoolResponse. + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAnotherNullableEnumResponse. * * Get the return value for this response. * * Returns: (allow-none): a return value or %NULL. */ -gboolean* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_response_get_return_value( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableBoolResponse* +CoreTestsPigeonTestAnotherEnum* +core_tests_pigeon_test_flutter_integration_core_api_echo_another_nullable_enum_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAnotherNullableEnumResponse* response); G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntResponse, - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_response, + CoreTestsPigeonTestFlutterIntegrationCoreApiNoopAsyncResponse, + core_tests_pigeon_test_flutter_integration_core_api_noop_async_response, + CORE_TESTS_PIGEON_TEST, FLUTTER_INTEGRATION_CORE_API_NOOP_ASYNC_RESPONSE, + GObject) + +/** + * core_tests_pigeon_test_flutter_integration_core_api_noop_async_response_is_error: + * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiNoopAsyncResponse. + * + * Checks if a response to FlutterIntegrationCoreApi.noopAsync is an error. + * + * Returns: a %TRUE if this response is an error. + */ +gboolean +core_tests_pigeon_test_flutter_integration_core_api_noop_async_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiNoopAsyncResponse* response); + +/** + * core_tests_pigeon_test_flutter_integration_core_api_noop_async_response_get_error_code: + * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiNoopAsyncResponse. + * + * Get the error code for this response. + * + * Returns: an error code or %NULL if not an error. + */ +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_noop_async_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiNoopAsyncResponse* response); + +/** + * core_tests_pigeon_test_flutter_integration_core_api_noop_async_response_get_error_message: + * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiNoopAsyncResponse. + * + * Get the error message for this response. + * + * Returns: an error message. + */ +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_noop_async_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiNoopAsyncResponse* response); + +/** + * core_tests_pigeon_test_flutter_integration_core_api_noop_async_response_get_error_details: + * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiNoopAsyncResponse. + * + * Get the error details for this response. + * + * Returns: (allow-none): an error details or %NULL. + */ +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_noop_async_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiNoopAsyncResponse* response); + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAsyncStringResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_async_string_response, CORE_TESTS_PIGEON_TEST, - FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_INT_RESPONSE, GObject) + FLUTTER_INTEGRATION_CORE_API_ECHO_ASYNC_STRING_RESPONSE, GObject) /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_response_is_error: + * core_tests_pigeon_test_flutter_integration_core_api_echo_async_string_response_is_error: * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntResponse. + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAsyncStringResponse. * - * Checks if a response to FlutterIntegrationCoreApi.echoNullableInt is an + * Checks if a response to FlutterIntegrationCoreApi.echoAsyncString is an * error. * * Returns: a %TRUE if this response is an error. */ gboolean -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_response_is_error( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_async_string_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAsyncStringResponse* response); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_response_get_error_code: + * core_tests_pigeon_test_flutter_integration_core_api_echo_async_string_response_get_error_code: * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntResponse. + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAsyncStringResponse. * * Get the error code for this response. * * Returns: an error code or %NULL if not an error. */ const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_response_get_error_code( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_async_string_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAsyncStringResponse* response); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_response_get_error_message: + * core_tests_pigeon_test_flutter_integration_core_api_echo_async_string_response_get_error_message: * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntResponse. + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAsyncStringResponse. * * Get the error message for this response. * * Returns: an error message. */ const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_response_get_error_message( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_async_string_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAsyncStringResponse* response); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_response_get_error_details: + * core_tests_pigeon_test_flutter_integration_core_api_echo_async_string_response_get_error_details: * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntResponse. + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAsyncStringResponse. * * Get the error details for this response. * * Returns: (allow-none): an error details or %NULL. */ FlValue* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_response_get_error_details( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_async_string_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAsyncStringResponse* response); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_response_get_return_value: + * core_tests_pigeon_test_flutter_integration_core_api_echo_async_string_response_get_return_value: * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntResponse. + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAsyncStringResponse. * * Get the return value for this response. * - * Returns: (allow-none): a return value or %NULL. + * Returns: a return value. */ -int64_t* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_response_get_return_value( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntResponse* +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_async_string_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAsyncStringResponse* response); -G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableDoubleResponse, - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_response, - CORE_TESTS_PIGEON_TEST, - FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_DOUBLE_RESPONSE, GObject) +/** + * CoreTestsPigeonTestFlutterIntegrationCoreApi: + * + * The core interface that the Dart platform_test code implements for host + * integration tests to call into. + */ + +G_DECLARE_FINAL_TYPE(CoreTestsPigeonTestFlutterIntegrationCoreApi, + core_tests_pigeon_test_flutter_integration_core_api, + CORE_TESTS_PIGEON_TEST, FLUTTER_INTEGRATION_CORE_API, + GObject) /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_response_is_error: - * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableDoubleResponse. + * core_tests_pigeon_test_flutter_integration_core_api_new: + * @messenger: an #FlBinaryMessenger. + * @suffix: (allow-none): a suffix to add to the API or %NULL for none. * - * Checks if a response to FlutterIntegrationCoreApi.echoNullableDouble is an - * error. + * Creates a new object to access the FlutterIntegrationCoreApi API. * - * Returns: a %TRUE if this response is an error. + * Returns: a new #CoreTestsPigeonTestFlutterIntegrationCoreApi */ -gboolean -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_response_is_error( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableDoubleResponse* - response); +CoreTestsPigeonTestFlutterIntegrationCoreApi* +core_tests_pigeon_test_flutter_integration_core_api_new( + FlBinaryMessenger* messenger, const gchar* suffix); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_response_get_error_code: - * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableDoubleResponse. - * - * Get the error code for this response. + * core_tests_pigeon_test_flutter_integration_core_api_noop: + * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. + * @cancellable: (allow-none): a #GCancellable or %NULL. + * @callback: (scope async): (allow-none): a #GAsyncReadyCallback to call when + * the call is complete or %NULL to ignore the response. + * @user_data: (closure): user data to pass to @callback. * - * Returns: an error code or %NULL if not an error. + * A no-op function taking no arguments and returning no value, to sanity + * test basic calling. */ -const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_response_get_error_code( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableDoubleResponse* - response); +void core_tests_pigeon_test_flutter_integration_core_api_noop( + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, + GCancellable* cancellable, GAsyncReadyCallback callback, + gpointer user_data); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_response_get_error_message: - * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableDoubleResponse. + * core_tests_pigeon_test_flutter_integration_core_api_noop_finish: + * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. + * @result: a #GAsyncResult. + * @error: (allow-none): #GError location to store the error occurring, or %NULL + * to ignore. * - * Get the error message for this response. + * Completes a core_tests_pigeon_test_flutter_integration_core_api_noop() call. * - * Returns: an error message. + * Returns: a #CoreTestsPigeonTestFlutterIntegrationCoreApiNoopResponse or %NULL + * on error. */ -const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_response_get_error_message( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableDoubleResponse* - response); +CoreTestsPigeonTestFlutterIntegrationCoreApiNoopResponse* +core_tests_pigeon_test_flutter_integration_core_api_noop_finish( + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, GAsyncResult* result, + GError** error); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_response_get_error_details: - * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableDoubleResponse. - * - * Get the error details for this response. + * core_tests_pigeon_test_flutter_integration_core_api_throw_error: + * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. + * @cancellable: (allow-none): a #GCancellable or %NULL. + * @callback: (scope async): (allow-none): a #GAsyncReadyCallback to call when + * the call is complete or %NULL to ignore the response. + * @user_data: (closure): user data to pass to @callback. * - * Returns: (allow-none): an error details or %NULL. + * Responds with an error from an async function returning a value. */ -FlValue* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_response_get_error_details( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableDoubleResponse* - response); +void core_tests_pigeon_test_flutter_integration_core_api_throw_error( + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, + GCancellable* cancellable, GAsyncReadyCallback callback, + gpointer user_data); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_response_get_return_value: - * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableDoubleResponse. + * core_tests_pigeon_test_flutter_integration_core_api_throw_error_finish: + * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. + * @result: a #GAsyncResult. + * @error: (allow-none): #GError location to store the error occurring, or %NULL + * to ignore. * - * Get the return value for this response. + * Completes a core_tests_pigeon_test_flutter_integration_core_api_throw_error() + * call. * - * Returns: (allow-none): a return value or %NULL. + * Returns: a #CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorResponse or + * %NULL on error. */ -double* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_response_get_return_value( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableDoubleResponse* - response); +CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorResponse* +core_tests_pigeon_test_flutter_integration_core_api_throw_error_finish( + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, GAsyncResult* result, + GError** error); -G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringResponse, - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_response, - CORE_TESTS_PIGEON_TEST, - FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_STRING_RESPONSE, GObject) +/** + * core_tests_pigeon_test_flutter_integration_core_api_throw_error_from_void: + * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. + * @cancellable: (allow-none): a #GCancellable or %NULL. + * @callback: (scope async): (allow-none): a #GAsyncReadyCallback to call when + * the call is complete or %NULL to ignore the response. + * @user_data: (closure): user data to pass to @callback. + * + * Responds with an error from an async void function. + */ +void core_tests_pigeon_test_flutter_integration_core_api_throw_error_from_void( + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, + GCancellable* cancellable, GAsyncReadyCallback callback, + gpointer user_data); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_response_is_error: - * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringResponse. + * core_tests_pigeon_test_flutter_integration_core_api_throw_error_from_void_finish: + * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. + * @result: a #GAsyncResult. + * @error: (allow-none): #GError location to store the error occurring, or %NULL + * to ignore. * - * Checks if a response to FlutterIntegrationCoreApi.echoNullableString is an - * error. + * Completes a + * core_tests_pigeon_test_flutter_integration_core_api_throw_error_from_void() + * call. * - * Returns: a %TRUE if this response is an error. + * Returns: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorFromVoidResponse or + * %NULL on error. */ -gboolean -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_response_is_error( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringResponse* - response); +CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorFromVoidResponse* +core_tests_pigeon_test_flutter_integration_core_api_throw_error_from_void_finish( + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, GAsyncResult* result, + GError** error); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_response_get_error_code: - * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringResponse. + * core_tests_pigeon_test_flutter_integration_core_api_echo_all_types: + * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. + * @everything: parameter for this method. + * @cancellable: (allow-none): a #GCancellable or %NULL. + * @callback: (scope async): (allow-none): a #GAsyncReadyCallback to call when + * the call is complete or %NULL to ignore the response. + * @user_data: (closure): user data to pass to @callback. * - * Get the error code for this response. + * Returns the passed object, to test serialization and deserialization. + */ +void core_tests_pigeon_test_flutter_integration_core_api_echo_all_types( + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, + CoreTestsPigeonTestAllTypes* everything, GCancellable* cancellable, + GAsyncReadyCallback callback, gpointer user_data); + +/** + * core_tests_pigeon_test_flutter_integration_core_api_echo_all_types_finish: + * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. + * @result: a #GAsyncResult. + * @error: (allow-none): #GError location to store the error occurring, or %NULL + * to ignore. + * + * Completes a + * core_tests_pigeon_test_flutter_integration_core_api_echo_all_types() call. + * + * Returns: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllTypesResponse + * or %NULL on error. + */ +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllTypesResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_all_types_finish( + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, GAsyncResult* result, + GError** error); + +/** + * core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types: + * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. + * @everything: (allow-none): parameter for this method. + * @cancellable: (allow-none): a #GCancellable or %NULL. + * @callback: (scope async): (allow-none): a #GAsyncReadyCallback to call when + * the call is complete or %NULL to ignore the response. + * @user_data: (closure): user data to pass to @callback. * - * Returns: an error code or %NULL if not an error. + * Returns the passed object, to test serialization and deserialization. */ -const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_response_get_error_code( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringResponse* - response); +void core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types( + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, + CoreTestsPigeonTestAllNullableTypes* everything, GCancellable* cancellable, + GAsyncReadyCallback callback, gpointer user_data); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_response_get_error_message: - * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringResponse. + * core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_finish: + * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. + * @result: a #GAsyncResult. + * @error: (allow-none): #GError location to store the error occurring, or %NULL + * to ignore. * - * Get the error message for this response. + * Completes a + * core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types() + * call. * - * Returns: an error message. + * Returns: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesResponse or + * %NULL on error. */ -const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_response_get_error_message( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringResponse* - response); +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_finish( + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, GAsyncResult* result, + GError** error); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_response_get_error_details: - * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringResponse. + * core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types: + * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. + * @a_nullable_bool: (allow-none): parameter for this method. + * @a_nullable_int: (allow-none): parameter for this method. + * @a_nullable_string: (allow-none): parameter for this method. + * @cancellable: (allow-none): a #GCancellable or %NULL. + * @callback: (scope async): (allow-none): a #GAsyncReadyCallback to call when + * the call is complete or %NULL to ignore the response. + * @user_data: (closure): user data to pass to @callback. * - * Get the error details for this response. + * Returns passed in arguments of multiple types. * - * Returns: (allow-none): an error details or %NULL. + * Tests multiple-arity FlutterApi handling. */ -FlValue* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_response_get_error_details( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringResponse* - response); +void core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types( + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, + gboolean* a_nullable_bool, int64_t* a_nullable_int, + const gchar* a_nullable_string, GCancellable* cancellable, + GAsyncReadyCallback callback, gpointer user_data); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_response_get_return_value: - * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringResponse. + * core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_finish: + * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. + * @result: a #GAsyncResult. + * @error: (allow-none): #GError location to store the error occurring, or %NULL + * to ignore. * - * Get the return value for this response. + * Completes a + * core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types() + * call. * - * Returns: (allow-none): a return value or %NULL. + * Returns: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesResponse + * or %NULL on error. */ -const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_response_get_return_value( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringResponse* - response); - -G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableUint8ListResponse, - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_response, - CORE_TESTS_PIGEON_TEST, - FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_UINT8_LIST_RESPONSE, GObject) +CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesResponse* +core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_finish( + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, GAsyncResult* result, + GError** error); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_response_is_error: - * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableUint8ListResponse. - * - * Checks if a response to FlutterIntegrationCoreApi.echoNullableUint8List is an - * error. + * core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_without_recursion: + * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. + * @everything: (allow-none): parameter for this method. + * @cancellable: (allow-none): a #GCancellable or %NULL. + * @callback: (scope async): (allow-none): a #GAsyncReadyCallback to call when + * the call is complete or %NULL to ignore the response. + * @user_data: (closure): user data to pass to @callback. * - * Returns: a %TRUE if this response is an error. + * Returns the passed object, to test serialization and deserialization. */ -gboolean -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_response_is_error( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableUint8ListResponse* - response); +void core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_without_recursion( + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, + CoreTestsPigeonTestAllNullableTypesWithoutRecursion* everything, + GCancellable* cancellable, GAsyncReadyCallback callback, + gpointer user_data); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_response_get_error_code: - * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableUint8ListResponse. + * core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_without_recursion_finish: + * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. + * @result: a #GAsyncResult. + * @error: (allow-none): #GError location to store the error occurring, or %NULL + * to ignore. * - * Get the error code for this response. + * Completes a + * core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_without_recursion() + * call. * - * Returns: an error code or %NULL if not an error. + * Returns: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponse + * or %NULL on error. */ -const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_response_get_error_code( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableUint8ListResponse* - response); +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_without_recursion_finish( + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, GAsyncResult* result, + GError** error); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_response_get_error_message: - * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableUint8ListResponse. + * core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_without_recursion: + * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. + * @a_nullable_bool: (allow-none): parameter for this method. + * @a_nullable_int: (allow-none): parameter for this method. + * @a_nullable_string: (allow-none): parameter for this method. + * @cancellable: (allow-none): a #GCancellable or %NULL. + * @callback: (scope async): (allow-none): a #GAsyncReadyCallback to call when + * the call is complete or %NULL to ignore the response. + * @user_data: (closure): user data to pass to @callback. * - * Get the error message for this response. + * Returns passed in arguments of multiple types. * - * Returns: an error message. + * Tests multiple-arity FlutterApi handling. */ -const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_response_get_error_message( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableUint8ListResponse* - response); +void core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_without_recursion( + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, + gboolean* a_nullable_bool, int64_t* a_nullable_int, + const gchar* a_nullable_string, GCancellable* cancellable, + GAsyncReadyCallback callback, gpointer user_data); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_response_get_error_details: - * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableUint8ListResponse. + * core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_without_recursion_finish: + * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. + * @result: a #GAsyncResult. + * @error: (allow-none): #GError location to store the error occurring, or %NULL + * to ignore. * - * Get the error details for this response. + * Completes a + * core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_without_recursion() + * call. * - * Returns: (allow-none): an error details or %NULL. + * Returns: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponse + * or %NULL on error. */ -FlValue* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_response_get_error_details( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableUint8ListResponse* - response); +CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponse* +core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_without_recursion_finish( + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, GAsyncResult* result, + GError** error); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_response_get_return_value: - * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableUint8ListResponse. - * @return_value_length: (allow-none): location to write length of the return - * value or %NULL to ignore. - * - * Get the return value for this response. + * core_tests_pigeon_test_flutter_integration_core_api_echo_bool: + * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. + * @a_bool: parameter for this method. + * @cancellable: (allow-none): a #GCancellable or %NULL. + * @callback: (scope async): (allow-none): a #GAsyncReadyCallback to call when + * the call is complete or %NULL to ignore the response. + * @user_data: (closure): user data to pass to @callback. * - * Returns: (allow-none): a return value or %NULL. + * Returns the passed boolean, to test serialization and deserialization. */ -const uint8_t* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_response_get_return_value( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableUint8ListResponse* - response, - size_t* return_value_length); - -G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableListResponse, - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_response, - CORE_TESTS_PIGEON_TEST, - FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_LIST_RESPONSE, GObject) +void core_tests_pigeon_test_flutter_integration_core_api_echo_bool( + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, gboolean a_bool, + GCancellable* cancellable, GAsyncReadyCallback callback, + gpointer user_data); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_response_is_error: - * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableListResponse. + * core_tests_pigeon_test_flutter_integration_core_api_echo_bool_finish: + * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. + * @result: a #GAsyncResult. + * @error: (allow-none): #GError location to store the error occurring, or %NULL + * to ignore. * - * Checks if a response to FlutterIntegrationCoreApi.echoNullableList is an - * error. + * Completes a core_tests_pigeon_test_flutter_integration_core_api_echo_bool() + * call. * - * Returns: a %TRUE if this response is an error. + * Returns: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoBoolResponse or + * %NULL on error. */ -gboolean -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_response_is_error( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableListResponse* - response); +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoBoolResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_bool_finish( + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, GAsyncResult* result, + GError** error); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_response_get_error_code: - * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableListResponse. - * - * Get the error code for this response. + * core_tests_pigeon_test_flutter_integration_core_api_echo_int: + * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. + * @an_int: parameter for this method. + * @cancellable: (allow-none): a #GCancellable or %NULL. + * @callback: (scope async): (allow-none): a #GAsyncReadyCallback to call when + * the call is complete or %NULL to ignore the response. + * @user_data: (closure): user data to pass to @callback. * - * Returns: an error code or %NULL if not an error. + * Returns the passed int, to test serialization and deserialization. */ -const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_response_get_error_code( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableListResponse* - response); +void core_tests_pigeon_test_flutter_integration_core_api_echo_int( + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, int64_t an_int, + GCancellable* cancellable, GAsyncReadyCallback callback, + gpointer user_data); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_response_get_error_message: - * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableListResponse. + * core_tests_pigeon_test_flutter_integration_core_api_echo_int_finish: + * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. + * @result: a #GAsyncResult. + * @error: (allow-none): #GError location to store the error occurring, or %NULL + * to ignore. * - * Get the error message for this response. + * Completes a core_tests_pigeon_test_flutter_integration_core_api_echo_int() + * call. * - * Returns: an error message. + * Returns: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntResponse or + * %NULL on error. */ -const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_response_get_error_message( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableListResponse* - response); +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_int_finish( + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, GAsyncResult* result, + GError** error); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_response_get_error_details: - * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableListResponse. - * - * Get the error details for this response. + * core_tests_pigeon_test_flutter_integration_core_api_echo_double: + * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. + * @a_double: parameter for this method. + * @cancellable: (allow-none): a #GCancellable or %NULL. + * @callback: (scope async): (allow-none): a #GAsyncReadyCallback to call when + * the call is complete or %NULL to ignore the response. + * @user_data: (closure): user data to pass to @callback. * - * Returns: (allow-none): an error details or %NULL. + * Returns the passed double, to test serialization and deserialization. */ -FlValue* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_response_get_error_details( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableListResponse* - response); +void core_tests_pigeon_test_flutter_integration_core_api_echo_double( + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, double a_double, + GCancellable* cancellable, GAsyncReadyCallback callback, + gpointer user_data); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_response_get_return_value: - * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableListResponse. + * core_tests_pigeon_test_flutter_integration_core_api_echo_double_finish: + * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. + * @result: a #GAsyncResult. + * @error: (allow-none): #GError location to store the error occurring, or %NULL + * to ignore. * - * Get the return value for this response. + * Completes a core_tests_pigeon_test_flutter_integration_core_api_echo_double() + * call. * - * Returns: (allow-none): a return value or %NULL. + * Returns: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoDoubleResponse or + * %NULL on error. */ -FlValue* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_response_get_return_value( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableListResponse* - response); - -G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableMapResponse, - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_response, - CORE_TESTS_PIGEON_TEST, - FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_MAP_RESPONSE, GObject) +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoDoubleResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_double_finish( + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, GAsyncResult* result, + GError** error); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_response_is_error: - * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableMapResponse. - * - * Checks if a response to FlutterIntegrationCoreApi.echoNullableMap is an - * error. + * core_tests_pigeon_test_flutter_integration_core_api_echo_string: + * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. + * @a_string: parameter for this method. + * @cancellable: (allow-none): a #GCancellable or %NULL. + * @callback: (scope async): (allow-none): a #GAsyncReadyCallback to call when + * the call is complete or %NULL to ignore the response. + * @user_data: (closure): user data to pass to @callback. * - * Returns: a %TRUE if this response is an error. + * Returns the passed string, to test serialization and deserialization. */ -gboolean -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_response_is_error( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableMapResponse* - response); +void core_tests_pigeon_test_flutter_integration_core_api_echo_string( + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, const gchar* a_string, + GCancellable* cancellable, GAsyncReadyCallback callback, + gpointer user_data); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_response_get_error_code: - * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableMapResponse. + * core_tests_pigeon_test_flutter_integration_core_api_echo_string_finish: + * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. + * @result: a #GAsyncResult. + * @error: (allow-none): #GError location to store the error occurring, or %NULL + * to ignore. * - * Get the error code for this response. + * Completes a core_tests_pigeon_test_flutter_integration_core_api_echo_string() + * call. * - * Returns: an error code or %NULL if not an error. + * Returns: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringResponse or + * %NULL on error. */ -const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_response_get_error_code( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableMapResponse* - response); +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_string_finish( + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, GAsyncResult* result, + GError** error); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_response_get_error_message: - * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableMapResponse. - * - * Get the error message for this response. + * core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list: + * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. + * @list: parameter for this method. + * @list_length: length of list. + * @cancellable: (allow-none): a #GCancellable or %NULL. + * @callback: (scope async): (allow-none): a #GAsyncReadyCallback to call when + * the call is complete or %NULL to ignore the response. + * @user_data: (closure): user data to pass to @callback. * - * Returns: an error message. + * Returns the passed byte list, to test serialization and deserialization. */ -const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_response_get_error_message( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableMapResponse* - response); +void core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list( + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, const uint8_t* list, + size_t list_length, GCancellable* cancellable, GAsyncReadyCallback callback, + gpointer user_data); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_response_get_error_details: - * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableMapResponse. + * core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list_finish: + * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. + * @result: a #GAsyncResult. + * @error: (allow-none): #GError location to store the error occurring, or %NULL + * to ignore. * - * Get the error details for this response. + * Completes a + * core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list() call. * - * Returns: (allow-none): an error details or %NULL. + * Returns: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoUint8ListResponse + * or %NULL on error. */ -FlValue* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_response_get_error_details( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableMapResponse* - response); +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoUint8ListResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list_finish( + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, GAsyncResult* result, + GError** error); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_response_get_return_value: - * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableMapResponse. - * - * Get the return value for this response. + * core_tests_pigeon_test_flutter_integration_core_api_echo_list: + * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. + * @list: parameter for this method. + * @cancellable: (allow-none): a #GCancellable or %NULL. + * @callback: (scope async): (allow-none): a #GAsyncReadyCallback to call when + * the call is complete or %NULL to ignore the response. + * @user_data: (closure): user data to pass to @callback. * - * Returns: (allow-none): a return value or %NULL. + * Returns the passed list, to test serialization and deserialization. */ -FlValue* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_response_get_return_value( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableMapResponse* - response); - -G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableEnumResponse, - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_response, - CORE_TESTS_PIGEON_TEST, - FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_ENUM_RESPONSE, GObject) +void core_tests_pigeon_test_flutter_integration_core_api_echo_list( + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, FlValue* list, + GCancellable* cancellable, GAsyncReadyCallback callback, + gpointer user_data); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_response_is_error: - * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableEnumResponse. + * core_tests_pigeon_test_flutter_integration_core_api_echo_list_finish: + * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. + * @result: a #GAsyncResult. + * @error: (allow-none): #GError location to store the error occurring, or %NULL + * to ignore. * - * Checks if a response to FlutterIntegrationCoreApi.echoNullableEnum is an - * error. + * Completes a core_tests_pigeon_test_flutter_integration_core_api_echo_list() + * call. * - * Returns: a %TRUE if this response is an error. + * Returns: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoListResponse or + * %NULL on error. */ -gboolean -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_response_is_error( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableEnumResponse* - response); +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoListResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_list_finish( + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, GAsyncResult* result, + GError** error); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_response_get_error_code: - * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableEnumResponse. - * - * Get the error code for this response. + * core_tests_pigeon_test_flutter_integration_core_api_echo_enum_list: + * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. + * @enum_list: parameter for this method. + * @cancellable: (allow-none): a #GCancellable or %NULL. + * @callback: (scope async): (allow-none): a #GAsyncReadyCallback to call when + * the call is complete or %NULL to ignore the response. + * @user_data: (closure): user data to pass to @callback. * - * Returns: an error code or %NULL if not an error. + * Returns the passed list, to test serialization and deserialization. */ -const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_response_get_error_code( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableEnumResponse* - response); +void core_tests_pigeon_test_flutter_integration_core_api_echo_enum_list( + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, FlValue* enum_list, + GCancellable* cancellable, GAsyncReadyCallback callback, + gpointer user_data); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_response_get_error_message: - * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableEnumResponse. + * core_tests_pigeon_test_flutter_integration_core_api_echo_enum_list_finish: + * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. + * @result: a #GAsyncResult. + * @error: (allow-none): #GError location to store the error occurring, or %NULL + * to ignore. * - * Get the error message for this response. + * Completes a + * core_tests_pigeon_test_flutter_integration_core_api_echo_enum_list() call. * - * Returns: an error message. + * Returns: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumListResponse + * or %NULL on error. */ -const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_response_get_error_message( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableEnumResponse* - response); +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumListResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_enum_list_finish( + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, GAsyncResult* result, + GError** error); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_response_get_error_details: - * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableEnumResponse. - * - * Get the error details for this response. + * core_tests_pigeon_test_flutter_integration_core_api_echo_class_list: + * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. + * @class_list: parameter for this method. + * @cancellable: (allow-none): a #GCancellable or %NULL. + * @callback: (scope async): (allow-none): a #GAsyncReadyCallback to call when + * the call is complete or %NULL to ignore the response. + * @user_data: (closure): user data to pass to @callback. * - * Returns: (allow-none): an error details or %NULL. + * Returns the passed list, to test serialization and deserialization. */ -FlValue* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_response_get_error_details( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableEnumResponse* - response); +void core_tests_pigeon_test_flutter_integration_core_api_echo_class_list( + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, FlValue* class_list, + GCancellable* cancellable, GAsyncReadyCallback callback, + gpointer user_data); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_response_get_return_value: - * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableEnumResponse. + * core_tests_pigeon_test_flutter_integration_core_api_echo_class_list_finish: + * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. + * @result: a #GAsyncResult. + * @error: (allow-none): #GError location to store the error occurring, or %NULL + * to ignore. * - * Get the return value for this response. + * Completes a + * core_tests_pigeon_test_flutter_integration_core_api_echo_class_list() call. * - * Returns: (allow-none): a return value or %NULL. + * Returns: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoClassListResponse + * or %NULL on error. */ -CoreTestsPigeonTestAnEnum* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_response_get_return_value( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableEnumResponse* - response); - -G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAnotherNullableEnumResponse, - core_tests_pigeon_test_flutter_integration_core_api_echo_another_nullable_enum_response, - CORE_TESTS_PIGEON_TEST, - FLUTTER_INTEGRATION_CORE_API_ECHO_ANOTHER_NULLABLE_ENUM_RESPONSE, GObject) +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoClassListResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_class_list_finish( + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, GAsyncResult* result, + GError** error); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_another_nullable_enum_response_is_error: - * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAnotherNullableEnumResponse. - * - * Checks if a response to FlutterIntegrationCoreApi.echoAnotherNullableEnum is - * an error. + * core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_list: + * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. + * @enum_list: parameter for this method. + * @cancellable: (allow-none): a #GCancellable or %NULL. + * @callback: (scope async): (allow-none): a #GAsyncReadyCallback to call when + * the call is complete or %NULL to ignore the response. + * @user_data: (closure): user data to pass to @callback. * - * Returns: a %TRUE if this response is an error. + * Returns the passed list, to test serialization and deserialization. */ -gboolean -core_tests_pigeon_test_flutter_integration_core_api_echo_another_nullable_enum_response_is_error( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAnotherNullableEnumResponse* - response); +void core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_list( + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, FlValue* enum_list, + GCancellable* cancellable, GAsyncReadyCallback callback, + gpointer user_data); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_another_nullable_enum_response_get_error_code: - * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAnotherNullableEnumResponse. + * core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_list_finish: + * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. + * @result: a #GAsyncResult. + * @error: (allow-none): #GError location to store the error occurring, or %NULL + * to ignore. * - * Get the error code for this response. + * Completes a + * core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_list() + * call. * - * Returns: an error code or %NULL if not an error. + * Returns: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullEnumListResponse or + * %NULL on error. */ -const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_another_nullable_enum_response_get_error_code( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAnotherNullableEnumResponse* - response); +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullEnumListResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_list_finish( + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, GAsyncResult* result, + GError** error); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_another_nullable_enum_response_get_error_message: - * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAnotherNullableEnumResponse. - * - * Get the error message for this response. + * core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_list: + * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. + * @class_list: parameter for this method. + * @cancellable: (allow-none): a #GCancellable or %NULL. + * @callback: (scope async): (allow-none): a #GAsyncReadyCallback to call when + * the call is complete or %NULL to ignore the response. + * @user_data: (closure): user data to pass to @callback. * - * Returns: an error message. + * Returns the passed list, to test serialization and deserialization. */ -const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_another_nullable_enum_response_get_error_message( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAnotherNullableEnumResponse* - response); +void core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_list( + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, FlValue* class_list, + GCancellable* cancellable, GAsyncReadyCallback callback, + gpointer user_data); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_another_nullable_enum_response_get_error_details: - * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAnotherNullableEnumResponse. + * core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_list_finish: + * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. + * @result: a #GAsyncResult. + * @error: (allow-none): #GError location to store the error occurring, or %NULL + * to ignore. * - * Get the error details for this response. + * Completes a + * core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_list() + * call. * - * Returns: (allow-none): an error details or %NULL. + * Returns: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullClassListResponse or + * %NULL on error. */ -FlValue* -core_tests_pigeon_test_flutter_integration_core_api_echo_another_nullable_enum_response_get_error_details( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAnotherNullableEnumResponse* - response); +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullClassListResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_list_finish( + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, GAsyncResult* result, + GError** error); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_another_nullable_enum_response_get_return_value: - * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAnotherNullableEnumResponse. - * - * Get the return value for this response. + * core_tests_pigeon_test_flutter_integration_core_api_echo_map: + * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. + * @map: parameter for this method. + * @cancellable: (allow-none): a #GCancellable or %NULL. + * @callback: (scope async): (allow-none): a #GAsyncReadyCallback to call when + * the call is complete or %NULL to ignore the response. + * @user_data: (closure): user data to pass to @callback. * - * Returns: (allow-none): a return value or %NULL. + * Returns the passed map, to test serialization and deserialization. */ -CoreTestsPigeonTestAnotherEnum* -core_tests_pigeon_test_flutter_integration_core_api_echo_another_nullable_enum_response_get_return_value( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAnotherNullableEnumResponse* - response); - -G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestFlutterIntegrationCoreApiNoopAsyncResponse, - core_tests_pigeon_test_flutter_integration_core_api_noop_async_response, - CORE_TESTS_PIGEON_TEST, FLUTTER_INTEGRATION_CORE_API_NOOP_ASYNC_RESPONSE, - GObject) +void core_tests_pigeon_test_flutter_integration_core_api_echo_map( + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, FlValue* map, + GCancellable* cancellable, GAsyncReadyCallback callback, + gpointer user_data); /** - * core_tests_pigeon_test_flutter_integration_core_api_noop_async_response_is_error: - * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiNoopAsyncResponse. + * core_tests_pigeon_test_flutter_integration_core_api_echo_map_finish: + * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. + * @result: a #GAsyncResult. + * @error: (allow-none): #GError location to store the error occurring, or %NULL + * to ignore. * - * Checks if a response to FlutterIntegrationCoreApi.noopAsync is an error. + * Completes a core_tests_pigeon_test_flutter_integration_core_api_echo_map() + * call. * - * Returns: a %TRUE if this response is an error. + * Returns: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoMapResponse or + * %NULL on error. */ -gboolean -core_tests_pigeon_test_flutter_integration_core_api_noop_async_response_is_error( - CoreTestsPigeonTestFlutterIntegrationCoreApiNoopAsyncResponse* response); +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoMapResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_map_finish( + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, GAsyncResult* result, + GError** error); /** - * core_tests_pigeon_test_flutter_integration_core_api_noop_async_response_get_error_code: - * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiNoopAsyncResponse. - * - * Get the error code for this response. + * core_tests_pigeon_test_flutter_integration_core_api_echo_string_map: + * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. + * @string_map: parameter for this method. + * @cancellable: (allow-none): a #GCancellable or %NULL. + * @callback: (scope async): (allow-none): a #GAsyncReadyCallback to call when + * the call is complete or %NULL to ignore the response. + * @user_data: (closure): user data to pass to @callback. * - * Returns: an error code or %NULL if not an error. + * Returns the passed map, to test serialization and deserialization. */ -const gchar* -core_tests_pigeon_test_flutter_integration_core_api_noop_async_response_get_error_code( - CoreTestsPigeonTestFlutterIntegrationCoreApiNoopAsyncResponse* response); +void core_tests_pigeon_test_flutter_integration_core_api_echo_string_map( + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, FlValue* string_map, + GCancellable* cancellable, GAsyncReadyCallback callback, + gpointer user_data); /** - * core_tests_pigeon_test_flutter_integration_core_api_noop_async_response_get_error_message: - * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiNoopAsyncResponse. + * core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_finish: + * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. + * @result: a #GAsyncResult. + * @error: (allow-none): #GError location to store the error occurring, or %NULL + * to ignore. * - * Get the error message for this response. + * Completes a + * core_tests_pigeon_test_flutter_integration_core_api_echo_string_map() call. * - * Returns: an error message. + * Returns: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringMapResponse + * or %NULL on error. */ -const gchar* -core_tests_pigeon_test_flutter_integration_core_api_noop_async_response_get_error_message( - CoreTestsPigeonTestFlutterIntegrationCoreApiNoopAsyncResponse* response); +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringMapResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_finish( + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, GAsyncResult* result, + GError** error); /** - * core_tests_pigeon_test_flutter_integration_core_api_noop_async_response_get_error_details: - * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiNoopAsyncResponse. - * - * Get the error details for this response. + * core_tests_pigeon_test_flutter_integration_core_api_echo_int_map: + * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. + * @int_map: parameter for this method. + * @cancellable: (allow-none): a #GCancellable or %NULL. + * @callback: (scope async): (allow-none): a #GAsyncReadyCallback to call when + * the call is complete or %NULL to ignore the response. + * @user_data: (closure): user data to pass to @callback. * - * Returns: (allow-none): an error details or %NULL. + * Returns the passed map, to test serialization and deserialization. */ -FlValue* -core_tests_pigeon_test_flutter_integration_core_api_noop_async_response_get_error_details( - CoreTestsPigeonTestFlutterIntegrationCoreApiNoopAsyncResponse* response); - -G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAsyncStringResponse, - core_tests_pigeon_test_flutter_integration_core_api_echo_async_string_response, - CORE_TESTS_PIGEON_TEST, - FLUTTER_INTEGRATION_CORE_API_ECHO_ASYNC_STRING_RESPONSE, GObject) +void core_tests_pigeon_test_flutter_integration_core_api_echo_int_map( + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, FlValue* int_map, + GCancellable* cancellable, GAsyncReadyCallback callback, + gpointer user_data); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_async_string_response_is_error: - * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAsyncStringResponse. + * core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_finish: + * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. + * @result: a #GAsyncResult. + * @error: (allow-none): #GError location to store the error occurring, or %NULL + * to ignore. * - * Checks if a response to FlutterIntegrationCoreApi.echoAsyncString is an - * error. + * Completes a + * core_tests_pigeon_test_flutter_integration_core_api_echo_int_map() call. * - * Returns: a %TRUE if this response is an error. + * Returns: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntMapResponse or + * %NULL on error. */ -gboolean -core_tests_pigeon_test_flutter_integration_core_api_echo_async_string_response_is_error( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAsyncStringResponse* - response); +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntMapResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_finish( + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, GAsyncResult* result, + GError** error); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_async_string_response_get_error_code: - * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAsyncStringResponse. - * - * Get the error code for this response. + * core_tests_pigeon_test_flutter_integration_core_api_echo_enum_map: + * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. + * @enum_map: parameter for this method. + * @cancellable: (allow-none): a #GCancellable or %NULL. + * @callback: (scope async): (allow-none): a #GAsyncReadyCallback to call when + * the call is complete or %NULL to ignore the response. + * @user_data: (closure): user data to pass to @callback. * - * Returns: an error code or %NULL if not an error. + * Returns the passed map, to test serialization and deserialization. */ -const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_async_string_response_get_error_code( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAsyncStringResponse* - response); +void core_tests_pigeon_test_flutter_integration_core_api_echo_enum_map( + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, FlValue* enum_map, + GCancellable* cancellable, GAsyncReadyCallback callback, + gpointer user_data); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_async_string_response_get_error_message: - * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAsyncStringResponse. + * core_tests_pigeon_test_flutter_integration_core_api_echo_enum_map_finish: + * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. + * @result: a #GAsyncResult. + * @error: (allow-none): #GError location to store the error occurring, or %NULL + * to ignore. * - * Get the error message for this response. + * Completes a + * core_tests_pigeon_test_flutter_integration_core_api_echo_enum_map() call. * - * Returns: an error message. + * Returns: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumMapResponse + * or %NULL on error. */ -const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_async_string_response_get_error_message( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAsyncStringResponse* - response); +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumMapResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_enum_map_finish( + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, GAsyncResult* result, + GError** error); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_async_string_response_get_error_details: - * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAsyncStringResponse. - * - * Get the error details for this response. + * core_tests_pigeon_test_flutter_integration_core_api_echo_class_map: + * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. + * @class_map: parameter for this method. + * @cancellable: (allow-none): a #GCancellable or %NULL. + * @callback: (scope async): (allow-none): a #GAsyncReadyCallback to call when + * the call is complete or %NULL to ignore the response. + * @user_data: (closure): user data to pass to @callback. * - * Returns: (allow-none): an error details or %NULL. + * Returns the passed map, to test serialization and deserialization. */ -FlValue* -core_tests_pigeon_test_flutter_integration_core_api_echo_async_string_response_get_error_details( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAsyncStringResponse* - response); +void core_tests_pigeon_test_flutter_integration_core_api_echo_class_map( + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, FlValue* class_map, + GCancellable* cancellable, GAsyncReadyCallback callback, + gpointer user_data); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_async_string_response_get_return_value: - * @response: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAsyncStringResponse. + * core_tests_pigeon_test_flutter_integration_core_api_echo_class_map_finish: + * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. + * @result: a #GAsyncResult. + * @error: (allow-none): #GError location to store the error occurring, or %NULL + * to ignore. * - * Get the return value for this response. + * Completes a + * core_tests_pigeon_test_flutter_integration_core_api_echo_class_map() call. * - * Returns: a return value. + * Returns: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoClassMapResponse + * or %NULL on error. */ -const gchar* -core_tests_pigeon_test_flutter_integration_core_api_echo_async_string_response_get_return_value( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAsyncStringResponse* - response); +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoClassMapResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_class_map_finish( + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, GAsyncResult* result, + GError** error); /** - * CoreTestsPigeonTestFlutterIntegrationCoreApi: + * core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_string_map: + * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. + * @string_map: parameter for this method. + * @cancellable: (allow-none): a #GCancellable or %NULL. + * @callback: (scope async): (allow-none): a #GAsyncReadyCallback to call when + * the call is complete or %NULL to ignore the response. + * @user_data: (closure): user data to pass to @callback. * - * The core interface that the Dart platform_test code implements for host - * integration tests to call into. + * Returns the passed map, to test serialization and deserialization. */ - -G_DECLARE_FINAL_TYPE(CoreTestsPigeonTestFlutterIntegrationCoreApi, - core_tests_pigeon_test_flutter_integration_core_api, - CORE_TESTS_PIGEON_TEST, FLUTTER_INTEGRATION_CORE_API, - GObject) +void core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_string_map( + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, FlValue* string_map, + GCancellable* cancellable, GAsyncReadyCallback callback, + gpointer user_data); /** - * core_tests_pigeon_test_flutter_integration_core_api_new: - * @messenger: an #FlBinaryMessenger. - * @suffix: (allow-none): a suffix to add to the API or %NULL for none. + * core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_string_map_finish: + * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. + * @result: a #GAsyncResult. + * @error: (allow-none): #GError location to store the error occurring, or %NULL + * to ignore. * - * Creates a new object to access the FlutterIntegrationCoreApi API. + * Completes a + * core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_string_map() + * call. * - * Returns: a new #CoreTestsPigeonTestFlutterIntegrationCoreApi + * Returns: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullStringMapResponse or + * %NULL on error. */ -CoreTestsPigeonTestFlutterIntegrationCoreApi* -core_tests_pigeon_test_flutter_integration_core_api_new( - FlBinaryMessenger* messenger, const gchar* suffix); +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullStringMapResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_string_map_finish( + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, GAsyncResult* result, + GError** error); /** - * core_tests_pigeon_test_flutter_integration_core_api_noop: + * core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_int_map: * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. + * @int_map: parameter for this method. * @cancellable: (allow-none): a #GCancellable or %NULL. * @callback: (scope async): (allow-none): a #GAsyncReadyCallback to call when * the call is complete or %NULL to ignore the response. * @user_data: (closure): user data to pass to @callback. * - * A no-op function taking no arguments and returning no value, to sanity - * test basic calling. + * Returns the passed map, to test serialization and deserialization. */ -void core_tests_pigeon_test_flutter_integration_core_api_noop( - CoreTestsPigeonTestFlutterIntegrationCoreApi* api, +void core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_int_map( + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, FlValue* int_map, GCancellable* cancellable, GAsyncReadyCallback callback, gpointer user_data); /** - * core_tests_pigeon_test_flutter_integration_core_api_noop_finish: + * core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_int_map_finish: * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. * @result: a #GAsyncResult. * @error: (allow-none): #GError location to store the error occurring, or %NULL * to ignore. * - * Completes a core_tests_pigeon_test_flutter_integration_core_api_noop() call. + * Completes a + * core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_int_map() + * call. * - * Returns: a #CoreTestsPigeonTestFlutterIntegrationCoreApiNoopResponse or %NULL - * on error. + * Returns: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullIntMapResponse or + * %NULL on error. */ -CoreTestsPigeonTestFlutterIntegrationCoreApiNoopResponse* -core_tests_pigeon_test_flutter_integration_core_api_noop_finish( +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullIntMapResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_int_map_finish( CoreTestsPigeonTestFlutterIntegrationCoreApi* api, GAsyncResult* result, GError** error); /** - * core_tests_pigeon_test_flutter_integration_core_api_throw_error: + * core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_map: * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. + * @enum_map: parameter for this method. * @cancellable: (allow-none): a #GCancellable or %NULL. * @callback: (scope async): (allow-none): a #GAsyncReadyCallback to call when * the call is complete or %NULL to ignore the response. * @user_data: (closure): user data to pass to @callback. * - * Responds with an error from an async function returning a value. + * Returns the passed map, to test serialization and deserialization. */ -void core_tests_pigeon_test_flutter_integration_core_api_throw_error( - CoreTestsPigeonTestFlutterIntegrationCoreApi* api, +void core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_map( + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, FlValue* enum_map, GCancellable* cancellable, GAsyncReadyCallback callback, gpointer user_data); /** - * core_tests_pigeon_test_flutter_integration_core_api_throw_error_finish: + * core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_map_finish: * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. * @result: a #GAsyncResult. * @error: (allow-none): #GError location to store the error occurring, or %NULL * to ignore. * - * Completes a core_tests_pigeon_test_flutter_integration_core_api_throw_error() + * Completes a + * core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_map() * call. * - * Returns: a #CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorResponse or + * Returns: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullEnumMapResponse or * %NULL on error. */ -CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorResponse* -core_tests_pigeon_test_flutter_integration_core_api_throw_error_finish( +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullEnumMapResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_map_finish( CoreTestsPigeonTestFlutterIntegrationCoreApi* api, GAsyncResult* result, GError** error); /** - * core_tests_pigeon_test_flutter_integration_core_api_throw_error_from_void: + * core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_map: * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. + * @class_map: parameter for this method. * @cancellable: (allow-none): a #GCancellable or %NULL. * @callback: (scope async): (allow-none): a #GAsyncReadyCallback to call when * the call is complete or %NULL to ignore the response. * @user_data: (closure): user data to pass to @callback. * - * Responds with an error from an async void function. + * Returns the passed map, to test serialization and deserialization. */ -void core_tests_pigeon_test_flutter_integration_core_api_throw_error_from_void( - CoreTestsPigeonTestFlutterIntegrationCoreApi* api, +void core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_map( + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, FlValue* class_map, GCancellable* cancellable, GAsyncReadyCallback callback, gpointer user_data); /** - * core_tests_pigeon_test_flutter_integration_core_api_throw_error_from_void_finish: + * core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_map_finish: * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. * @result: a #GAsyncResult. * @error: (allow-none): #GError location to store the error occurring, or %NULL * to ignore. * * Completes a - * core_tests_pigeon_test_flutter_integration_core_api_throw_error_from_void() + * core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_map() * call. * * Returns: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorFromVoidResponse or + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullClassMapResponse or * %NULL on error. */ -CoreTestsPigeonTestFlutterIntegrationCoreApiThrowErrorFromVoidResponse* -core_tests_pigeon_test_flutter_integration_core_api_throw_error_from_void_finish( +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullClassMapResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_map_finish( CoreTestsPigeonTestFlutterIntegrationCoreApi* api, GAsyncResult* result, GError** error); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_all_types: + * core_tests_pigeon_test_flutter_integration_core_api_echo_enum: * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. - * @everything: parameter for this method. + * @an_enum: parameter for this method. * @cancellable: (allow-none): a #GCancellable or %NULL. * @callback: (scope async): (allow-none): a #GAsyncReadyCallback to call when * the call is complete or %NULL to ignore the response. * @user_data: (closure): user data to pass to @callback. * - * Returns the passed object, to test serialization and deserialization. + * Returns the passed enum to test serialization and deserialization. */ -void core_tests_pigeon_test_flutter_integration_core_api_echo_all_types( +void core_tests_pigeon_test_flutter_integration_core_api_echo_enum( CoreTestsPigeonTestFlutterIntegrationCoreApi* api, - CoreTestsPigeonTestAllTypes* everything, GCancellable* cancellable, + CoreTestsPigeonTestAnEnum an_enum, GCancellable* cancellable, GAsyncReadyCallback callback, gpointer user_data); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_all_types_finish: + * core_tests_pigeon_test_flutter_integration_core_api_echo_enum_finish: * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. * @result: a #GAsyncResult. * @error: (allow-none): #GError location to store the error occurring, or %NULL * to ignore. * - * Completes a - * core_tests_pigeon_test_flutter_integration_core_api_echo_all_types() call. + * Completes a core_tests_pigeon_test_flutter_integration_core_api_echo_enum() + * call. * - * Returns: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllTypesResponse - * or %NULL on error. + * Returns: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumResponse or + * %NULL on error. */ -CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllTypesResponse* -core_tests_pigeon_test_flutter_integration_core_api_echo_all_types_finish( +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_enum_finish( CoreTestsPigeonTestFlutterIntegrationCoreApi* api, GAsyncResult* result, GError** error); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types: + * core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum: * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. - * @everything: (allow-none): parameter for this method. + * @another_enum: parameter for this method. * @cancellable: (allow-none): a #GCancellable or %NULL. * @callback: (scope async): (allow-none): a #GAsyncReadyCallback to call when * the call is complete or %NULL to ignore the response. * @user_data: (closure): user data to pass to @callback. * - * Returns the passed object, to test serialization and deserialization. + * Returns the passed enum to test serialization and deserialization. */ -void core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types( +void core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum( CoreTestsPigeonTestFlutterIntegrationCoreApi* api, - CoreTestsPigeonTestAllNullableTypes* everything, GCancellable* cancellable, + CoreTestsPigeonTestAnotherEnum another_enum, GCancellable* cancellable, GAsyncReadyCallback callback, gpointer user_data); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_finish: + * core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_finish: * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. * @result: a #GAsyncResult. * @error: (allow-none): #GError location to store the error occurring, or %NULL * to ignore. * * Completes a - * core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types() - * call. + * core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum() call. * * Returns: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesResponse or - * %NULL on error. + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAnotherEnumResponse or %NULL + * on error. */ -CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesResponse* -core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_finish( +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAnotherEnumResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_finish( CoreTestsPigeonTestFlutterIntegrationCoreApi* api, GAsyncResult* result, GError** error); /** - * core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types: + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool: * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. - * @a_nullable_bool: (allow-none): parameter for this method. - * @a_nullable_int: (allow-none): parameter for this method. - * @a_nullable_string: (allow-none): parameter for this method. + * @a_bool: (allow-none): parameter for this method. * @cancellable: (allow-none): a #GCancellable or %NULL. * @callback: (scope async): (allow-none): a #GAsyncReadyCallback to call when * the call is complete or %NULL to ignore the response. * @user_data: (closure): user data to pass to @callback. * - * Returns passed in arguments of multiple types. - * - * Tests multiple-arity FlutterApi handling. + * Returns the passed boolean, to test serialization and deserialization. */ -void core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types( - CoreTestsPigeonTestFlutterIntegrationCoreApi* api, - gboolean* a_nullable_bool, int64_t* a_nullable_int, - const gchar* a_nullable_string, GCancellable* cancellable, - GAsyncReadyCallback callback, gpointer user_data); +void core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool( + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, gboolean* a_bool, + GCancellable* cancellable, GAsyncReadyCallback callback, + gpointer user_data); /** - * core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_finish: + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_finish: * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. * @result: a #GAsyncResult. * @error: (allow-none): #GError location to store the error occurring, or %NULL * to ignore. * * Completes a - * core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types() + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool() * call. * * Returns: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesResponse - * or %NULL on error. + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableBoolResponse or + * %NULL on error. */ -CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesResponse* -core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_finish( +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableBoolResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_finish( CoreTestsPigeonTestFlutterIntegrationCoreApi* api, GAsyncResult* result, GError** error); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_without_recursion: + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int: * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. - * @everything: (allow-none): parameter for this method. + * @an_int: (allow-none): parameter for this method. * @cancellable: (allow-none): a #GCancellable or %NULL. * @callback: (scope async): (allow-none): a #GAsyncReadyCallback to call when * the call is complete or %NULL to ignore the response. * @user_data: (closure): user data to pass to @callback. * - * Returns the passed object, to test serialization and deserialization. + * Returns the passed int, to test serialization and deserialization. */ -void core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_without_recursion( - CoreTestsPigeonTestFlutterIntegrationCoreApi* api, - CoreTestsPigeonTestAllNullableTypesWithoutRecursion* everything, +void core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int( + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, int64_t* an_int, GCancellable* cancellable, GAsyncReadyCallback callback, gpointer user_data); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_without_recursion_finish: + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_finish: * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. * @result: a #GAsyncResult. * @error: (allow-none): #GError location to store the error occurring, or %NULL * to ignore. * * Completes a - * core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_without_recursion() - * call. + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int() call. * * Returns: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponse - * or %NULL on error. + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntResponse or %NULL + * on error. */ -CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAllNullableTypesWithoutRecursionResponse* -core_tests_pigeon_test_flutter_integration_core_api_echo_all_nullable_types_without_recursion_finish( +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_finish( CoreTestsPigeonTestFlutterIntegrationCoreApi* api, GAsyncResult* result, GError** error); /** - * core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_without_recursion: + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double: * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. - * @a_nullable_bool: (allow-none): parameter for this method. - * @a_nullable_int: (allow-none): parameter for this method. - * @a_nullable_string: (allow-none): parameter for this method. + * @a_double: (allow-none): parameter for this method. * @cancellable: (allow-none): a #GCancellable or %NULL. * @callback: (scope async): (allow-none): a #GAsyncReadyCallback to call when * the call is complete or %NULL to ignore the response. * @user_data: (closure): user data to pass to @callback. * - * Returns passed in arguments of multiple types. - * - * Tests multiple-arity FlutterApi handling. + * Returns the passed double, to test serialization and deserialization. */ -void core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_without_recursion( - CoreTestsPigeonTestFlutterIntegrationCoreApi* api, - gboolean* a_nullable_bool, int64_t* a_nullable_int, - const gchar* a_nullable_string, GCancellable* cancellable, - GAsyncReadyCallback callback, gpointer user_data); +void core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double( + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, double* a_double, + GCancellable* cancellable, GAsyncReadyCallback callback, + gpointer user_data); /** - * core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_without_recursion_finish: + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_finish: * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. * @result: a #GAsyncResult. * @error: (allow-none): #GError location to store the error occurring, or %NULL * to ignore. * * Completes a - * core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_without_recursion() + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double() * call. * * Returns: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponse - * or %NULL on error. + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableDoubleResponse or + * %NULL on error. */ -CoreTestsPigeonTestFlutterIntegrationCoreApiSendMultipleNullableTypesWithoutRecursionResponse* -core_tests_pigeon_test_flutter_integration_core_api_send_multiple_nullable_types_without_recursion_finish( +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableDoubleResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_finish( CoreTestsPigeonTestFlutterIntegrationCoreApi* api, GAsyncResult* result, GError** error); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_bool: + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string: * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. - * @a_bool: parameter for this method. + * @a_string: (allow-none): parameter for this method. * @cancellable: (allow-none): a #GCancellable or %NULL. * @callback: (scope async): (allow-none): a #GAsyncReadyCallback to call when * the call is complete or %NULL to ignore the response. * @user_data: (closure): user data to pass to @callback. * - * Returns the passed boolean, to test serialization and deserialization. + * Returns the passed string, to test serialization and deserialization. */ -void core_tests_pigeon_test_flutter_integration_core_api_echo_bool( - CoreTestsPigeonTestFlutterIntegrationCoreApi* api, gboolean a_bool, +void core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string( + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, const gchar* a_string, GCancellable* cancellable, GAsyncReadyCallback callback, gpointer user_data); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_bool_finish: + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_finish: * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. * @result: a #GAsyncResult. * @error: (allow-none): #GError location to store the error occurring, or %NULL * to ignore. * - * Completes a core_tests_pigeon_test_flutter_integration_core_api_echo_bool() + * Completes a + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string() * call. * - * Returns: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoBoolResponse or + * Returns: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringResponse or * %NULL on error. */ -CoreTestsPigeonTestFlutterIntegrationCoreApiEchoBoolResponse* -core_tests_pigeon_test_flutter_integration_core_api_echo_bool_finish( +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_finish( CoreTestsPigeonTestFlutterIntegrationCoreApi* api, GAsyncResult* result, GError** error); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_int: + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list: * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. - * @an_int: parameter for this method. + * @list: (allow-none): parameter for this method. + * @list_length: length of list. * @cancellable: (allow-none): a #GCancellable or %NULL. * @callback: (scope async): (allow-none): a #GAsyncReadyCallback to call when * the call is complete or %NULL to ignore the response. * @user_data: (closure): user data to pass to @callback. * - * Returns the passed int, to test serialization and deserialization. + * Returns the passed byte list, to test serialization and deserialization. */ -void core_tests_pigeon_test_flutter_integration_core_api_echo_int( - CoreTestsPigeonTestFlutterIntegrationCoreApi* api, int64_t an_int, - GCancellable* cancellable, GAsyncReadyCallback callback, +void core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list( + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, const uint8_t* list, + size_t list_length, GCancellable* cancellable, GAsyncReadyCallback callback, gpointer user_data); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_int_finish: + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_finish: * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. * @result: a #GAsyncResult. * @error: (allow-none): #GError location to store the error occurring, or %NULL * to ignore. * - * Completes a core_tests_pigeon_test_flutter_integration_core_api_echo_int() + * Completes a + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list() * call. * - * Returns: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntResponse or + * Returns: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableUint8ListResponse or * %NULL on error. */ -CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntResponse* -core_tests_pigeon_test_flutter_integration_core_api_echo_int_finish( +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableUint8ListResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_finish( CoreTestsPigeonTestFlutterIntegrationCoreApi* api, GAsyncResult* result, GError** error); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_double: + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list: * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. - * @a_double: parameter for this method. + * @list: (allow-none): parameter for this method. * @cancellable: (allow-none): a #GCancellable or %NULL. * @callback: (scope async): (allow-none): a #GAsyncReadyCallback to call when * the call is complete or %NULL to ignore the response. * @user_data: (closure): user data to pass to @callback. * - * Returns the passed double, to test serialization and deserialization. + * Returns the passed list, to test serialization and deserialization. */ -void core_tests_pigeon_test_flutter_integration_core_api_echo_double( - CoreTestsPigeonTestFlutterIntegrationCoreApi* api, double a_double, +void core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list( + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, FlValue* list, GCancellable* cancellable, GAsyncReadyCallback callback, gpointer user_data); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_double_finish: + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_finish: * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. * @result: a #GAsyncResult. * @error: (allow-none): #GError location to store the error occurring, or %NULL * to ignore. * - * Completes a core_tests_pigeon_test_flutter_integration_core_api_echo_double() + * Completes a + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list() * call. * - * Returns: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoDoubleResponse or + * Returns: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableListResponse or * %NULL on error. */ -CoreTestsPigeonTestFlutterIntegrationCoreApiEchoDoubleResponse* -core_tests_pigeon_test_flutter_integration_core_api_echo_double_finish( +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableListResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_finish( CoreTestsPigeonTestFlutterIntegrationCoreApi* api, GAsyncResult* result, GError** error); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_string: + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_list: * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. - * @a_string: parameter for this method. + * @enum_list: (allow-none): parameter for this method. * @cancellable: (allow-none): a #GCancellable or %NULL. * @callback: (scope async): (allow-none): a #GAsyncReadyCallback to call when * the call is complete or %NULL to ignore the response. * @user_data: (closure): user data to pass to @callback. * - * Returns the passed string, to test serialization and deserialization. + * Returns the passed list, to test serialization and deserialization. */ -void core_tests_pigeon_test_flutter_integration_core_api_echo_string( - CoreTestsPigeonTestFlutterIntegrationCoreApi* api, const gchar* a_string, +void core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_list( + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, FlValue* enum_list, GCancellable* cancellable, GAsyncReadyCallback callback, gpointer user_data); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_string_finish: + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_list_finish: * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. * @result: a #GAsyncResult. * @error: (allow-none): #GError location to store the error occurring, or %NULL * to ignore. * - * Completes a core_tests_pigeon_test_flutter_integration_core_api_echo_string() + * Completes a + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_list() * call. * - * Returns: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringResponse or + * Returns: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableEnumListResponse or * %NULL on error. */ -CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringResponse* -core_tests_pigeon_test_flutter_integration_core_api_echo_string_finish( +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableEnumListResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_list_finish( CoreTestsPigeonTestFlutterIntegrationCoreApi* api, GAsyncResult* result, GError** error); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list: + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_list: * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. - * @list: parameter for this method. - * @list_length: length of list. + * @class_list: (allow-none): parameter for this method. * @cancellable: (allow-none): a #GCancellable or %NULL. * @callback: (scope async): (allow-none): a #GAsyncReadyCallback to call when * the call is complete or %NULL to ignore the response. * @user_data: (closure): user data to pass to @callback. * - * Returns the passed byte list, to test serialization and deserialization. + * Returns the passed list, to test serialization and deserialization. */ -void core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list( - CoreTestsPigeonTestFlutterIntegrationCoreApi* api, const uint8_t* list, - size_t list_length, GCancellable* cancellable, GAsyncReadyCallback callback, +void core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_list( + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, FlValue* class_list, + GCancellable* cancellable, GAsyncReadyCallback callback, gpointer user_data); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list_finish: + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_list_finish: * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. * @result: a #GAsyncResult. * @error: (allow-none): #GError location to store the error occurring, or %NULL * to ignore. * * Completes a - * core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list() call. + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_list() + * call. * - * Returns: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoUint8ListResponse - * or %NULL on error. + * Returns: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableClassListResponse or + * %NULL on error. */ -CoreTestsPigeonTestFlutterIntegrationCoreApiEchoUint8ListResponse* -core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list_finish( +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableClassListResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_list_finish( CoreTestsPigeonTestFlutterIntegrationCoreApi* api, GAsyncResult* result, GError** error); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_list: + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_list: * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. - * @list: parameter for this method. + * @enum_list: (allow-none): parameter for this method. * @cancellable: (allow-none): a #GCancellable or %NULL. * @callback: (scope async): (allow-none): a #GAsyncReadyCallback to call when * the call is complete or %NULL to ignore the response. @@ -6409,352 +11344,358 @@ core_tests_pigeon_test_flutter_integration_core_api_echo_uint8_list_finish( * * Returns the passed list, to test serialization and deserialization. */ -void core_tests_pigeon_test_flutter_integration_core_api_echo_list( - CoreTestsPigeonTestFlutterIntegrationCoreApi* api, FlValue* list, +void core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_list( + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, FlValue* enum_list, GCancellable* cancellable, GAsyncReadyCallback callback, gpointer user_data); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_list_finish: + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_list_finish: * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. * @result: a #GAsyncResult. * @error: (allow-none): #GError location to store the error occurring, or %NULL * to ignore. * - * Completes a core_tests_pigeon_test_flutter_integration_core_api_echo_list() + * Completes a + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_list() * call. * - * Returns: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoListResponse or - * %NULL on error. + * Returns: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullEnumListResponse + * or %NULL on error. */ -CoreTestsPigeonTestFlutterIntegrationCoreApiEchoListResponse* -core_tests_pigeon_test_flutter_integration_core_api_echo_list_finish( +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullEnumListResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_list_finish( CoreTestsPigeonTestFlutterIntegrationCoreApi* api, GAsyncResult* result, GError** error); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_map: + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_list: * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. - * @a_map: parameter for this method. + * @class_list: (allow-none): parameter for this method. * @cancellable: (allow-none): a #GCancellable or %NULL. * @callback: (scope async): (allow-none): a #GAsyncReadyCallback to call when * the call is complete or %NULL to ignore the response. * @user_data: (closure): user data to pass to @callback. * - * Returns the passed map, to test serialization and deserialization. + * Returns the passed list, to test serialization and deserialization. */ -void core_tests_pigeon_test_flutter_integration_core_api_echo_map( - CoreTestsPigeonTestFlutterIntegrationCoreApi* api, FlValue* a_map, +void core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_list( + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, FlValue* class_list, GCancellable* cancellable, GAsyncReadyCallback callback, gpointer user_data); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_map_finish: + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_list_finish: * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. * @result: a #GAsyncResult. * @error: (allow-none): #GError location to store the error occurring, or %NULL * to ignore. * - * Completes a core_tests_pigeon_test_flutter_integration_core_api_echo_map() + * Completes a + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_list() * call. * - * Returns: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoMapResponse or - * %NULL on error. + * Returns: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullClassListResponse + * or %NULL on error. */ -CoreTestsPigeonTestFlutterIntegrationCoreApiEchoMapResponse* -core_tests_pigeon_test_flutter_integration_core_api_echo_map_finish( +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullClassListResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_list_finish( CoreTestsPigeonTestFlutterIntegrationCoreApi* api, GAsyncResult* result, GError** error); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_enum: + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map: * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. - * @an_enum: parameter for this method. + * @map: (allow-none): parameter for this method. * @cancellable: (allow-none): a #GCancellable or %NULL. * @callback: (scope async): (allow-none): a #GAsyncReadyCallback to call when * the call is complete or %NULL to ignore the response. * @user_data: (closure): user data to pass to @callback. * - * Returns the passed enum to test serialization and deserialization. + * Returns the passed map, to test serialization and deserialization. */ -void core_tests_pigeon_test_flutter_integration_core_api_echo_enum( - CoreTestsPigeonTestFlutterIntegrationCoreApi* api, - CoreTestsPigeonTestAnEnum an_enum, GCancellable* cancellable, - GAsyncReadyCallback callback, gpointer user_data); +void core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map( + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, FlValue* map, + GCancellable* cancellable, GAsyncReadyCallback callback, + gpointer user_data); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_enum_finish: + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_finish: * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. * @result: a #GAsyncResult. * @error: (allow-none): #GError location to store the error occurring, or %NULL * to ignore. * - * Completes a core_tests_pigeon_test_flutter_integration_core_api_echo_enum() - * call. + * Completes a + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map() call. * - * Returns: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumResponse or - * %NULL on error. + * Returns: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableMapResponse or %NULL + * on error. */ -CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumResponse* -core_tests_pigeon_test_flutter_integration_core_api_echo_enum_finish( +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableMapResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_finish( CoreTestsPigeonTestFlutterIntegrationCoreApi* api, GAsyncResult* result, GError** error); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum: + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map: * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. - * @another_enum: parameter for this method. + * @string_map: (allow-none): parameter for this method. * @cancellable: (allow-none): a #GCancellable or %NULL. * @callback: (scope async): (allow-none): a #GAsyncReadyCallback to call when * the call is complete or %NULL to ignore the response. * @user_data: (closure): user data to pass to @callback. * - * Returns the passed enum to test serialization and deserialization. + * Returns the passed map, to test serialization and deserialization. */ -void core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum( - CoreTestsPigeonTestFlutterIntegrationCoreApi* api, - CoreTestsPigeonTestAnotherEnum another_enum, GCancellable* cancellable, - GAsyncReadyCallback callback, gpointer user_data); +void core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map( + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, FlValue* string_map, + GCancellable* cancellable, GAsyncReadyCallback callback, + gpointer user_data); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_finish: + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_finish: * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. * @result: a #GAsyncResult. * @error: (allow-none): #GError location to store the error occurring, or %NULL * to ignore. * * Completes a - * core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum() call. + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map() + * call. * * Returns: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAnotherEnumResponse or %NULL - * on error. + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringMapResponse or + * %NULL on error. */ -CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAnotherEnumResponse* -core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_finish( +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringMapResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_finish( CoreTestsPigeonTestFlutterIntegrationCoreApi* api, GAsyncResult* result, GError** error); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool: + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map: * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. - * @a_bool: (allow-none): parameter for this method. + * @int_map: (allow-none): parameter for this method. * @cancellable: (allow-none): a #GCancellable or %NULL. * @callback: (scope async): (allow-none): a #GAsyncReadyCallback to call when * the call is complete or %NULL to ignore the response. * @user_data: (closure): user data to pass to @callback. * - * Returns the passed boolean, to test serialization and deserialization. + * Returns the passed map, to test serialization and deserialization. */ -void core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool( - CoreTestsPigeonTestFlutterIntegrationCoreApi* api, gboolean* a_bool, +void core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map( + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, FlValue* int_map, GCancellable* cancellable, GAsyncReadyCallback callback, gpointer user_data); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_finish: + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_finish: * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. * @result: a #GAsyncResult. * @error: (allow-none): #GError location to store the error occurring, or %NULL * to ignore. * * Completes a - * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool() + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map() * call. * * Returns: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableBoolResponse or + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntMapResponse or * %NULL on error. */ -CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableBoolResponse* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_finish( +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntMapResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_finish( CoreTestsPigeonTestFlutterIntegrationCoreApi* api, GAsyncResult* result, GError** error); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int: + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_map: * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. - * @an_int: (allow-none): parameter for this method. + * @enum_map: (allow-none): parameter for this method. * @cancellable: (allow-none): a #GCancellable or %NULL. * @callback: (scope async): (allow-none): a #GAsyncReadyCallback to call when * the call is complete or %NULL to ignore the response. * @user_data: (closure): user data to pass to @callback. * - * Returns the passed int, to test serialization and deserialization. + * Returns the passed map, to test serialization and deserialization. */ -void core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int( - CoreTestsPigeonTestFlutterIntegrationCoreApi* api, int64_t* an_int, +void core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_map( + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, FlValue* enum_map, GCancellable* cancellable, GAsyncReadyCallback callback, gpointer user_data); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_finish: + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_map_finish: * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. * @result: a #GAsyncResult. * @error: (allow-none): #GError location to store the error occurring, or %NULL * to ignore. * * Completes a - * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int() call. + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_map() + * call. * * Returns: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntResponse or %NULL - * on error. + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableEnumMapResponse or + * %NULL on error. */ -CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntResponse* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_finish( +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableEnumMapResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_map_finish( CoreTestsPigeonTestFlutterIntegrationCoreApi* api, GAsyncResult* result, GError** error); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double: + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_map: * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. - * @a_double: (allow-none): parameter for this method. + * @class_map: (allow-none): parameter for this method. * @cancellable: (allow-none): a #GCancellable or %NULL. * @callback: (scope async): (allow-none): a #GAsyncReadyCallback to call when * the call is complete or %NULL to ignore the response. * @user_data: (closure): user data to pass to @callback. * - * Returns the passed double, to test serialization and deserialization. + * Returns the passed map, to test serialization and deserialization. */ -void core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double( - CoreTestsPigeonTestFlutterIntegrationCoreApi* api, double* a_double, +void core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_map( + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, FlValue* class_map, GCancellable* cancellable, GAsyncReadyCallback callback, gpointer user_data); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_finish: + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_map_finish: * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. * @result: a #GAsyncResult. * @error: (allow-none): #GError location to store the error occurring, or %NULL * to ignore. * * Completes a - * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double() + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_map() * call. * * Returns: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableDoubleResponse or + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableClassMapResponse or * %NULL on error. */ -CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableDoubleResponse* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_finish( +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableClassMapResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_map_finish( CoreTestsPigeonTestFlutterIntegrationCoreApi* api, GAsyncResult* result, GError** error); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string: + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_string_map: * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. - * @a_string: (allow-none): parameter for this method. + * @string_map: (allow-none): parameter for this method. * @cancellable: (allow-none): a #GCancellable or %NULL. * @callback: (scope async): (allow-none): a #GAsyncReadyCallback to call when * the call is complete or %NULL to ignore the response. * @user_data: (closure): user data to pass to @callback. * - * Returns the passed string, to test serialization and deserialization. + * Returns the passed map, to test serialization and deserialization. */ -void core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string( - CoreTestsPigeonTestFlutterIntegrationCoreApi* api, const gchar* a_string, +void core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_string_map( + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, FlValue* string_map, GCancellable* cancellable, GAsyncReadyCallback callback, gpointer user_data); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_finish: + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_string_map_finish: * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. * @result: a #GAsyncResult. * @error: (allow-none): #GError location to store the error occurring, or %NULL * to ignore. * * Completes a - * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string() + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_string_map() * call. * * Returns: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringResponse or - * %NULL on error. + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullStringMapResponse + * or %NULL on error. */ -CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringResponse* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_finish( +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullStringMapResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_string_map_finish( CoreTestsPigeonTestFlutterIntegrationCoreApi* api, GAsyncResult* result, GError** error); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list: + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_int_map: * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. - * @list: (allow-none): parameter for this method. - * @list_length: length of list. + * @int_map: (allow-none): parameter for this method. * @cancellable: (allow-none): a #GCancellable or %NULL. * @callback: (scope async): (allow-none): a #GAsyncReadyCallback to call when * the call is complete or %NULL to ignore the response. * @user_data: (closure): user data to pass to @callback. * - * Returns the passed byte list, to test serialization and deserialization. + * Returns the passed map, to test serialization and deserialization. */ -void core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list( - CoreTestsPigeonTestFlutterIntegrationCoreApi* api, const uint8_t* list, - size_t list_length, GCancellable* cancellable, GAsyncReadyCallback callback, +void core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_int_map( + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, FlValue* int_map, + GCancellable* cancellable, GAsyncReadyCallback callback, gpointer user_data); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_finish: + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_int_map_finish: * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. * @result: a #GAsyncResult. * @error: (allow-none): #GError location to store the error occurring, or %NULL * to ignore. * * Completes a - * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list() + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_int_map() * call. * * Returns: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableUint8ListResponse or - * %NULL on error. + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullIntMapResponse + * or %NULL on error. */ -CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableUint8ListResponse* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_finish( +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullIntMapResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_int_map_finish( CoreTestsPigeonTestFlutterIntegrationCoreApi* api, GAsyncResult* result, GError** error); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list: + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_map: * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. - * @list: (allow-none): parameter for this method. + * @enum_map: (allow-none): parameter for this method. * @cancellable: (allow-none): a #GCancellable or %NULL. * @callback: (scope async): (allow-none): a #GAsyncReadyCallback to call when * the call is complete or %NULL to ignore the response. * @user_data: (closure): user data to pass to @callback. * - * Returns the passed list, to test serialization and deserialization. + * Returns the passed map, to test serialization and deserialization. */ -void core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list( - CoreTestsPigeonTestFlutterIntegrationCoreApi* api, FlValue* list, +void core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_map( + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, FlValue* enum_map, GCancellable* cancellable, GAsyncReadyCallback callback, gpointer user_data); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_finish: + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_map_finish: * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. * @result: a #GAsyncResult. * @error: (allow-none): #GError location to store the error occurring, or %NULL * to ignore. * * Completes a - * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list() + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_map() * call. * * Returns: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableListResponse or - * %NULL on error. + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullEnumMapResponse + * or %NULL on error. */ -CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableListResponse* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_finish( +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullEnumMapResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_map_finish( CoreTestsPigeonTestFlutterIntegrationCoreApi* api, GAsyncResult* result, GError** error); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map: + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_map: * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. - * @a_map: (allow-none): parameter for this method. + * @class_map: (allow-none): parameter for this method. * @cancellable: (allow-none): a #GCancellable or %NULL. * @callback: (scope async): (allow-none): a #GAsyncReadyCallback to call when * the call is complete or %NULL to ignore the response. @@ -6762,27 +11703,28 @@ core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_finish( * * Returns the passed map, to test serialization and deserialization. */ -void core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map( - CoreTestsPigeonTestFlutterIntegrationCoreApi* api, FlValue* a_map, +void core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_map( + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, FlValue* class_map, GCancellable* cancellable, GAsyncReadyCallback callback, gpointer user_data); /** - * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_finish: + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_map_finish: * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. * @result: a #GAsyncResult. * @error: (allow-none): #GError location to store the error occurring, or %NULL * to ignore. * * Completes a - * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map() call. + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_map() + * call. * * Returns: a - * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableMapResponse or %NULL - * on error. + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullClassMapResponse + * or %NULL on error. */ -CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableMapResponse* -core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_finish( +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullClassMapResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_map_finish( CoreTestsPigeonTestFlutterIntegrationCoreApi* api, GAsyncResult* result, GError** error); diff --git a/packages/pigeon/platform_tests/test_plugin/linux/test_plugin.cc b/packages/pigeon/platform_tests/test_plugin/linux/test_plugin.cc index 3c4689442dcb..14938e9980f0 100644 --- a/packages/pigeon/platform_tests/test_plugin/linux/test_plugin.cc +++ b/packages/pigeon/platform_tests/test_plugin/linux/test_plugin.cc @@ -125,10 +125,82 @@ static CoreTestsPigeonTestHostIntegrationCoreApiEchoListResponse* echo_list( a_list); } +static CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumListResponse* +echo_enum_list(FlValue* enum_list, gpointer user_data) { + return core_tests_pigeon_test_host_integration_core_api_echo_enum_list_response_new( + enum_list); +} + +static CoreTestsPigeonTestHostIntegrationCoreApiEchoClassListResponse* +echo_class_list(FlValue* class_list, gpointer user_data) { + return core_tests_pigeon_test_host_integration_core_api_echo_class_list_response_new( + class_list); +} + +static CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullEnumListResponse* +echo_non_null_enum_list(FlValue* enum_list, gpointer user_data) { + return core_tests_pigeon_test_host_integration_core_api_echo_non_null_enum_list_response_new( + enum_list); +} + +static CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullClassListResponse* +echo_non_null_class_list(FlValue* class_list, gpointer user_data) { + return core_tests_pigeon_test_host_integration_core_api_echo_non_null_class_list_response_new( + class_list); +} + static CoreTestsPigeonTestHostIntegrationCoreApiEchoMapResponse* echo_map( - FlValue* a_map, gpointer user_data) { + FlValue* map, gpointer user_data) { return core_tests_pigeon_test_host_integration_core_api_echo_map_response_new( - a_map); + map); +} + +static CoreTestsPigeonTestHostIntegrationCoreApiEchoStringMapResponse* +echo_string_map(FlValue* string_map, gpointer user_data) { + return core_tests_pigeon_test_host_integration_core_api_echo_string_map_response_new( + string_map); +} + +static CoreTestsPigeonTestHostIntegrationCoreApiEchoIntMapResponse* +echo_int_map(FlValue* int_map, gpointer user_data) { + return core_tests_pigeon_test_host_integration_core_api_echo_int_map_response_new( + int_map); +} + +static CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumMapResponse* +echo_enum_map(FlValue* _enum_map, gpointer user_data) { + return core_tests_pigeon_test_host_integration_core_api_echo_enum_map_response_new( + _enum_map); +} + +static CoreTestsPigeonTestHostIntegrationCoreApiEchoClassMapResponse* +echo_class_map(FlValue* class_map, gpointer user_data) { + return core_tests_pigeon_test_host_integration_core_api_echo_class_map_response_new( + class_map); +} + +static CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullStringMapResponse* +echo_non_null_string_map(FlValue* string_map, gpointer user_data) { + return core_tests_pigeon_test_host_integration_core_api_echo_non_null_string_map_response_new( + string_map); +} + +static CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullIntMapResponse* +echo_non_null_int_map(FlValue* int_map, gpointer user_data) { + return core_tests_pigeon_test_host_integration_core_api_echo_non_null_int_map_response_new( + int_map); +} + +static CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullEnumMapResponse* +echo_non_null_enum_map(FlValue* _enum_map, gpointer user_data) { + return core_tests_pigeon_test_host_integration_core_api_echo_non_null_enum_map_response_new( + _enum_map); +} + +static CoreTestsPigeonTestHostIntegrationCoreApiEchoNonNullClassMapResponse* +echo_non_null_class_map(FlValue* class_map, gpointer user_data) { + return core_tests_pigeon_test_host_integration_core_api_echo_non_null_class_map_response_new( + class_map); } static CoreTestsPigeonTestHostIntegrationCoreApiEchoClassWrapperResponse* @@ -203,11 +275,15 @@ create_nested_nullable_string(const gchar* nullable_string, g_autoptr(CoreTestsPigeonTestAllNullableTypes) types = core_tests_pigeon_test_all_nullable_types_new( nullptr, nullptr, nullptr, nullptr, nullptr, 0, nullptr, 0, nullptr, - 0, nullptr, 0, nullptr, nullptr, nullptr, nullptr, nullptr, - nullable_string, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, - nullptr, nullptr, nullptr); + 0, nullptr, 0, nullptr, nullptr, nullable_string, nullptr, nullptr, + nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, + nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, + nullptr, nullptr, nullptr, nullptr); + FlValue* classList = fl_value_new_list(); + FlValue* classMap = fl_value_new_map(); g_autoptr(CoreTestsPigeonTestAllClassesWrapper) wrapper = - core_tests_pigeon_test_all_classes_wrapper_new(types, nullptr, nullptr); + core_tests_pigeon_test_all_classes_wrapper_new( + types, nullptr, nullptr, classList, nullptr, classMap, nullptr); return core_tests_pigeon_test_host_integration_core_api_create_nested_nullable_string_response_new( wrapper); } @@ -219,9 +295,11 @@ send_multiple_nullable_types(gboolean* a_nullable_bool, int64_t* a_nullable_int, g_autoptr(CoreTestsPigeonTestAllNullableTypes) types = core_tests_pigeon_test_all_nullable_types_new( a_nullable_bool, a_nullable_int, nullptr, nullptr, nullptr, 0, - nullptr, 0, nullptr, 0, nullptr, 0, nullptr, nullptr, nullptr, - nullptr, nullptr, a_nullable_string, nullptr, nullptr, nullptr, - nullptr, nullptr, nullptr, nullptr, nullptr, nullptr); + nullptr, 0, nullptr, 0, nullptr, 0, nullptr, nullptr, + a_nullable_string, nullptr, nullptr, nullptr, nullptr, nullptr, + nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, + nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, + nullptr); return core_tests_pigeon_test_host_integration_core_api_send_multiple_nullable_types_response_new( types); } @@ -234,9 +312,10 @@ send_multiple_nullable_types_without_recursion(gboolean* a_nullable_bool, g_autoptr(CoreTestsPigeonTestAllNullableTypesWithoutRecursion) types = core_tests_pigeon_test_all_nullable_types_without_recursion_new( a_nullable_bool, a_nullable_int, nullptr, nullptr, nullptr, 0, - nullptr, 0, nullptr, 0, nullptr, 0, nullptr, nullptr, nullptr, - nullptr, nullptr, a_nullable_string, nullptr, nullptr, nullptr, - nullptr, nullptr, nullptr, nullptr); + nullptr, 0, nullptr, 0, nullptr, 0, nullptr, nullptr, + a_nullable_string, nullptr, nullptr, nullptr, nullptr, nullptr, + nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, + nullptr, nullptr, nullptr, nullptr, nullptr); return core_tests_pigeon_test_host_integration_core_api_send_multiple_nullable_types_without_recursion_response_new( types); } @@ -285,10 +364,82 @@ echo_nullable_list(FlValue* a_nullable_list, gpointer user_data) { a_nullable_list); } +static CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableEnumListResponse* +echo_nullable_enum_list(FlValue* enum_list, gpointer user_data) { + return core_tests_pigeon_test_host_integration_core_api_echo_nullable_enum_list_response_new( + enum_list); +} + +static CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableClassListResponse* +echo_nullable_class_list(FlValue* class_list, gpointer user_data) { + return core_tests_pigeon_test_host_integration_core_api_echo_nullable_class_list_response_new( + class_list); +} + +static CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullEnumListResponse* +echo_nullable_non_null_enum_list(FlValue* enum_list, gpointer user_data) { + return core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_enum_list_response_new( + enum_list); +} + +static CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullClassListResponse* +echo_nullable_non_null_class_list(FlValue* class_list, gpointer user_data) { + return core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_class_list_response_new( + class_list); +} + static CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableMapResponse* -echo_nullable_map(FlValue* a_nullable_map, gpointer user_data) { +echo_nullable_map(FlValue* map, gpointer user_data) { return core_tests_pigeon_test_host_integration_core_api_echo_nullable_map_response_new( - a_nullable_map); + map); +} + +static CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableStringMapResponse* +echo_nullable_string_map(FlValue* string_map, gpointer user_data) { + return core_tests_pigeon_test_host_integration_core_api_echo_nullable_string_map_response_new( + string_map); +} + +static CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableIntMapResponse* +echo_nullable_int_map(FlValue* int_map, gpointer user_data) { + return core_tests_pigeon_test_host_integration_core_api_echo_nullable_int_map_response_new( + int_map); +} + +static CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableEnumMapResponse* +echo_nullable_enum_map(FlValue* enum_map, gpointer user_data) { + return core_tests_pigeon_test_host_integration_core_api_echo_nullable_enum_map_response_new( + enum_map); +} + +static CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableClassMapResponse* +echo_nullable_class_map(FlValue* class_map, gpointer user_data) { + return core_tests_pigeon_test_host_integration_core_api_echo_nullable_class_map_response_new( + class_map); +} + +static CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullStringMapResponse* +echo_nullable_non_null_string_map(FlValue* string_map, gpointer user_data) { + return core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_string_map_response_new( + string_map); +} + +static CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullIntMapResponse* +echo_nullable_non_null_int_map(FlValue* int_map, gpointer user_data) { + return core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_int_map_response_new( + int_map); +} + +static CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullEnumMapResponse* +echo_nullable_non_null_enum_map(FlValue* enum_map, gpointer user_data) { + return core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_enum_map_response_new( + enum_map); +} + +static CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableNonNullClassMapResponse* +echo_nullable_non_null_class_map(FlValue* class_map, gpointer user_data) { + return core_tests_pigeon_test_host_integration_core_api_echo_nullable_non_null_class_map_response_new( + class_map); } static CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableEnumResponse* @@ -380,12 +531,60 @@ static void echo_async_list( response_handle, a_list); } +static void echo_async_enum_list( + FlValue* enum_list, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data) { + core_tests_pigeon_test_host_integration_core_api_respond_echo_async_enum_list( + response_handle, enum_list); +} + +static void echo_async_class_list( + FlValue* class_list, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data) { + core_tests_pigeon_test_host_integration_core_api_respond_echo_async_class_list( + response_handle, class_list); +} + static void echo_async_map( - FlValue* a_map, + FlValue* map, CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, gpointer user_data) { core_tests_pigeon_test_host_integration_core_api_respond_echo_async_map( - response_handle, a_map); + response_handle, map); +} + +static void echo_async_string_map( + FlValue* string_map, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data) { + core_tests_pigeon_test_host_integration_core_api_respond_echo_async_string_map( + response_handle, string_map); +} + +static void echo_async_int_map( + FlValue* int_map, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data) { + core_tests_pigeon_test_host_integration_core_api_respond_echo_async_int_map( + response_handle, int_map); +} + +static void echo_async_enum_map( + FlValue* enum_map, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data) { + core_tests_pigeon_test_host_integration_core_api_respond_echo_async_enum_map( + response_handle, enum_map); +} + +static void echo_async_class_map( + FlValue* class_map, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data) { + core_tests_pigeon_test_host_integration_core_api_respond_echo_async_class_map( + response_handle, class_map); } static void echo_async_enum( @@ -516,12 +715,60 @@ static void echo_async_nullable_list( response_handle, a_list); } +static void echo_async_nullable_enum_list( + FlValue* enum_list, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data) { + core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_enum_list( + response_handle, enum_list); +} + +static void echo_async_nullable_class_list( + FlValue* class_list, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data) { + core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_class_list( + response_handle, class_list); +} + static void echo_async_nullable_map( - FlValue* a_map, + FlValue* map, CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, gpointer user_data) { core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_map( - response_handle, a_map); + response_handle, map); +} + +static void echo_async_nullable_string_map( + FlValue* string_map, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data) { + core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_string_map( + response_handle, string_map); +} + +static void echo_async_nullable_int_map( + FlValue* int_map, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data) { + core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_int_map( + response_handle, int_map); +} + +static void echo_async_nullable_enum_map( + FlValue* enum_map, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data) { + core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_enum_map( + response_handle, enum_map); +} + +static void echo_async_nullable_class_map( + FlValue* class_map, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data) { + core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_class_map( + response_handle, class_map); } static void echo_async_nullable_enum( @@ -1184,462 +1431,1572 @@ static void call_flutter_echo_list( callback_data_new(self, response_handle)); } -static void echo_map_cb(GObject* object, GAsyncResult* result, - gpointer user_data) { +static void echo_enum_list_cb(GObject* object, GAsyncResult* result, + gpointer user_data) { g_autoptr(CallbackData) data = static_cast(user_data); g_autoptr(GError) error = nullptr; - g_autoptr(CoreTestsPigeonTestFlutterIntegrationCoreApiEchoMapResponse) - response = - core_tests_pigeon_test_flutter_integration_core_api_echo_map_finish( - CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API(object), - result, &error); + g_autoptr( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumListResponse) response = + core_tests_pigeon_test_flutter_integration_core_api_echo_enum_list_finish( + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API(object), result, + &error); if (response == nullptr) { - core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_map( + core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_enum_list( data->response_handle, "Internal Error", error->message, nullptr); return; } - if (core_tests_pigeon_test_flutter_integration_core_api_echo_map_response_is_error( + if (core_tests_pigeon_test_flutter_integration_core_api_echo_enum_list_response_is_error( response)) { core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_bool( data->response_handle, - core_tests_pigeon_test_flutter_integration_core_api_echo_map_response_get_error_code( + core_tests_pigeon_test_flutter_integration_core_api_echo_enum_list_response_get_error_code( response), - core_tests_pigeon_test_flutter_integration_core_api_echo_map_response_get_error_message( + core_tests_pigeon_test_flutter_integration_core_api_echo_enum_list_response_get_error_message( response), - core_tests_pigeon_test_flutter_integration_core_api_echo_map_response_get_error_details( + core_tests_pigeon_test_flutter_integration_core_api_echo_enum_list_response_get_error_details( response)); return; } - core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_map( + core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_enum_list( data->response_handle, - core_tests_pigeon_test_flutter_integration_core_api_echo_map_response_get_return_value( + core_tests_pigeon_test_flutter_integration_core_api_echo_enum_list_response_get_return_value( response)); } -static void call_flutter_echo_map( - FlValue* a_map, +static void call_flutter_echo_enum_list( + FlValue* enum_list, CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, gpointer user_data) { TestPlugin* self = TEST_PLUGIN(user_data); - core_tests_pigeon_test_flutter_integration_core_api_echo_map( - self->flutter_core_api, a_map, self->cancellable, echo_map_cb, + core_tests_pigeon_test_flutter_integration_core_api_echo_enum_list( + self->flutter_core_api, enum_list, self->cancellable, echo_enum_list_cb, callback_data_new(self, response_handle)); } -static void echo_enum_cb(GObject* object, GAsyncResult* result, - gpointer user_data) { +static void echo_class_list_cb(GObject* object, GAsyncResult* result, + gpointer user_data) { g_autoptr(CallbackData) data = static_cast(user_data); g_autoptr(GError) error = nullptr; - g_autoptr(CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumResponse) - response = - core_tests_pigeon_test_flutter_integration_core_api_echo_enum_finish( - CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API(object), - result, &error); + g_autoptr( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoClassListResponse) response = + core_tests_pigeon_test_flutter_integration_core_api_echo_class_list_finish( + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API(object), result, + &error); if (response == nullptr) { - core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_enum( + core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_class_list( data->response_handle, "Internal Error", error->message, nullptr); return; } - if (core_tests_pigeon_test_flutter_integration_core_api_echo_enum_response_is_error( + if (core_tests_pigeon_test_flutter_integration_core_api_echo_class_list_response_is_error( response)) { core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_bool( data->response_handle, - core_tests_pigeon_test_flutter_integration_core_api_echo_enum_response_get_error_code( + core_tests_pigeon_test_flutter_integration_core_api_echo_class_list_response_get_error_code( response), - core_tests_pigeon_test_flutter_integration_core_api_echo_enum_response_get_error_message( + core_tests_pigeon_test_flutter_integration_core_api_echo_class_list_response_get_error_message( response), - core_tests_pigeon_test_flutter_integration_core_api_echo_enum_response_get_error_details( + core_tests_pigeon_test_flutter_integration_core_api_echo_class_list_response_get_error_details( response)); return; } - core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_enum( + core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_class_list( data->response_handle, - core_tests_pigeon_test_flutter_integration_core_api_echo_enum_response_get_return_value( + core_tests_pigeon_test_flutter_integration_core_api_echo_class_list_response_get_return_value( response)); } -static void call_flutter_echo_enum( - - CoreTestsPigeonTestAnEnum an_enum, +static void call_flutter_echo_class_list( + FlValue* class_list, CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, gpointer user_data) { TestPlugin* self = TEST_PLUGIN(user_data); - core_tests_pigeon_test_flutter_integration_core_api_echo_enum( - self->flutter_core_api, an_enum, self->cancellable, echo_enum_cb, + core_tests_pigeon_test_flutter_integration_core_api_echo_class_list( + self->flutter_core_api, class_list, self->cancellable, echo_class_list_cb, callback_data_new(self, response_handle)); } -static void echo_another_enum_cb(GObject* object, GAsyncResult* result, - gpointer user_data) { +static void echo_non_null_enum_list_cb(GObject* object, GAsyncResult* result, + gpointer user_data) { g_autoptr(CallbackData) data = static_cast(user_data); g_autoptr(GError) error = nullptr; - g_autoptr(CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAnotherEnumResponse) + g_autoptr( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullEnumListResponse) response = - core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_finish( + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_list_finish( CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API(object), result, &error); if (response == nullptr) { - core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_another_enum( + core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_non_null_enum_list( data->response_handle, "Internal Error", error->message, nullptr); return; } - if (core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_response_is_error( + if (core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_list_response_is_error( response)) { core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_bool( data->response_handle, - core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_response_get_error_code( + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_list_response_get_error_code( response), - core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_response_get_error_message( + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_list_response_get_error_message( response), - core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_response_get_error_details( + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_list_response_get_error_details( response)); return; } - core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_another_enum( + core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_non_null_enum_list( data->response_handle, - core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_response_get_return_value( + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_list_response_get_return_value( response)); } -static void call_flutter_echo_another_enum( - - CoreTestsPigeonTestAnotherEnum another_enum, +static void call_flutter_echo_non_null_enum_list( + FlValue* enum_list, CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, gpointer user_data) { TestPlugin* self = TEST_PLUGIN(user_data); - core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum( - self->flutter_core_api, another_enum, self->cancellable, - echo_another_enum_cb, callback_data_new(self, response_handle)); + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_list( + self->flutter_core_api, enum_list, self->cancellable, + echo_non_null_enum_list_cb, callback_data_new(self, response_handle)); } -static void echo_nullable_bool_cb(GObject* object, GAsyncResult* result, - gpointer user_data) { +static void echo_non_null_class_list_cb(GObject* object, GAsyncResult* result, + gpointer user_data) { g_autoptr(CallbackData) data = static_cast(user_data); g_autoptr(GError) error = nullptr; g_autoptr( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableBoolResponse) + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullClassListResponse) response = - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_finish( + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_list_finish( CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API(object), result, &error); if (response == nullptr) { - core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_bool( + core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_non_null_class_list( data->response_handle, "Internal Error", error->message, nullptr); return; } - if (core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_response_is_error( + if (core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_list_response_is_error( response)) { core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_bool( data->response_handle, - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_response_get_error_code( + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_list_response_get_error_code( response), - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_response_get_error_message( + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_list_response_get_error_message( response), - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_response_get_error_details( + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_list_response_get_error_details( response)); return; } - core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_bool( + core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_non_null_class_list( data->response_handle, - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_response_get_return_value( + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_list_response_get_return_value( response)); } -static void call_flutter_echo_nullable_bool( - gboolean* a_bool, +static void call_flutter_echo_non_null_class_list( + FlValue* class_list, CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, gpointer user_data) { TestPlugin* self = TEST_PLUGIN(user_data); - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool( - self->flutter_core_api, a_bool, self->cancellable, echo_nullable_bool_cb, - callback_data_new(self, response_handle)); + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_list( + self->flutter_core_api, class_list, self->cancellable, + echo_non_null_class_list_cb, callback_data_new(self, response_handle)); } -static void echo_nullable_int_cb(GObject* object, GAsyncResult* result, - gpointer user_data) { +static void echo_map_cb(GObject* object, GAsyncResult* result, + gpointer user_data) { g_autoptr(CallbackData) data = static_cast(user_data); g_autoptr(GError) error = nullptr; - g_autoptr(CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntResponse) + g_autoptr(CoreTestsPigeonTestFlutterIntegrationCoreApiEchoMapResponse) response = - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_finish( + core_tests_pigeon_test_flutter_integration_core_api_echo_map_finish( CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API(object), result, &error); if (response == nullptr) { - core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_int( + core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_map( data->response_handle, "Internal Error", error->message, nullptr); return; } - if (core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_response_is_error( + if (core_tests_pigeon_test_flutter_integration_core_api_echo_map_response_is_error( response)) { core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_bool( data->response_handle, - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_response_get_error_code( + core_tests_pigeon_test_flutter_integration_core_api_echo_map_response_get_error_code( response), - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_response_get_error_message( + core_tests_pigeon_test_flutter_integration_core_api_echo_map_response_get_error_message( response), - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_response_get_error_details( + core_tests_pigeon_test_flutter_integration_core_api_echo_map_response_get_error_details( response)); return; } - core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_int( + core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_map( data->response_handle, - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_response_get_return_value( + core_tests_pigeon_test_flutter_integration_core_api_echo_map_response_get_return_value( response)); } -static void call_flutter_echo_nullable_int( - int64_t* an_int, +static void call_flutter_echo_map( + FlValue* map, CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, gpointer user_data) { TestPlugin* self = TEST_PLUGIN(user_data); - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int( - self->flutter_core_api, an_int, self->cancellable, echo_nullable_int_cb, + core_tests_pigeon_test_flutter_integration_core_api_echo_map( + self->flutter_core_api, map, self->cancellable, echo_map_cb, callback_data_new(self, response_handle)); } -static void echo_nullable_double_cb(GObject* object, GAsyncResult* result, - gpointer user_data) { +static void echo_string_map_cb(GObject* object, GAsyncResult* result, + gpointer user_data) { g_autoptr(CallbackData) data = static_cast(user_data); g_autoptr(GError) error = nullptr; g_autoptr( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableDoubleResponse) - response = - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_finish( - CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API(object), - result, &error); + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringMapResponse) response = + core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_finish( + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API(object), result, + &error); if (response == nullptr) { - core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_double( + core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_string_map( data->response_handle, "Internal Error", error->message, nullptr); return; } - if (core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_response_is_error( + if (core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_response_is_error( response)) { core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_bool( data->response_handle, - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_response_get_error_code( + core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_response_get_error_code( response), - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_response_get_error_message( + core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_response_get_error_message( response), - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_response_get_error_details( + core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_response_get_error_details( response)); return; } - core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_double( + core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_string_map( data->response_handle, - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_response_get_return_value( + core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_response_get_return_value( response)); } -static void call_flutter_echo_nullable_double( - double* a_double, +static void call_flutter_echo_string_map( + FlValue* string_map, CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, gpointer user_data) { TestPlugin* self = TEST_PLUGIN(user_data); - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double( - self->flutter_core_api, a_double, self->cancellable, - echo_nullable_double_cb, callback_data_new(self, response_handle)); + core_tests_pigeon_test_flutter_integration_core_api_echo_string_map( + self->flutter_core_api, string_map, self->cancellable, echo_string_map_cb, + callback_data_new(self, response_handle)); } -static void echo_nullable_string_cb(GObject* object, GAsyncResult* result, - gpointer user_data) { +static void echo_int_map_cb(GObject* object, GAsyncResult* result, + gpointer user_data) { g_autoptr(CallbackData) data = static_cast(user_data); g_autoptr(GError) error = nullptr; g_autoptr( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringResponse) - response = - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_finish( - CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API(object), - result, &error); + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntMapResponse) response = + core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_finish( + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API(object), result, + &error); if (response == nullptr) { - core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_string( + core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_int_map( data->response_handle, "Internal Error", error->message, nullptr); return; } - if (core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_response_is_error( + if (core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_response_is_error( response)) { core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_bool( data->response_handle, - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_response_get_error_code( + core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_response_get_error_code( response), - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_response_get_error_message( + core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_response_get_error_message( response), - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_response_get_error_details( + core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_response_get_error_details( response)); return; } - core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_string( + core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_int_map( data->response_handle, - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_response_get_return_value( + core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_response_get_return_value( response)); } -static void call_flutter_echo_nullable_string( - const gchar* a_string, +static void call_flutter_echo_int_map( + FlValue* int_map, CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, gpointer user_data) { TestPlugin* self = TEST_PLUGIN(user_data); - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string( - self->flutter_core_api, a_string, self->cancellable, - echo_nullable_string_cb, callback_data_new(self, response_handle)); + core_tests_pigeon_test_flutter_integration_core_api_echo_int_map( + self->flutter_core_api, int_map, self->cancellable, echo_int_map_cb, + callback_data_new(self, response_handle)); } -static void echo_nullable_uint8_list_cb(GObject* object, GAsyncResult* result, - gpointer user_data) { +static void echo_enum_map_cb(GObject* object, GAsyncResult* result, + gpointer user_data) { g_autoptr(CallbackData) data = static_cast(user_data); g_autoptr(GError) error = nullptr; g_autoptr( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableUint8ListResponse) - response = - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_finish( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumMapResponse) response = + core_tests_pigeon_test_flutter_integration_core_api_echo_enum_map_finish( + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API(object), result, + &error); + if (response == nullptr) { + core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_enum_map( + data->response_handle, "Internal Error", error->message, nullptr); + return; + } + if (core_tests_pigeon_test_flutter_integration_core_api_echo_enum_map_response_is_error( + response)) { + core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_bool( + data->response_handle, + core_tests_pigeon_test_flutter_integration_core_api_echo_enum_map_response_get_error_code( + response), + core_tests_pigeon_test_flutter_integration_core_api_echo_enum_map_response_get_error_message( + response), + core_tests_pigeon_test_flutter_integration_core_api_echo_enum_map_response_get_error_details( + response)); + return; + } + + core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_enum_map( + data->response_handle, + core_tests_pigeon_test_flutter_integration_core_api_echo_enum_map_response_get_return_value( + response)); +} + +static void call_flutter_echo_enum_map( + FlValue* enum_map, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data) { + TestPlugin* self = TEST_PLUGIN(user_data); + + core_tests_pigeon_test_flutter_integration_core_api_echo_enum_map( + self->flutter_core_api, enum_map, self->cancellable, echo_enum_map_cb, + callback_data_new(self, response_handle)); +} + +static void echo_class_map_cb(GObject* object, GAsyncResult* result, + gpointer user_data) { + g_autoptr(CallbackData) data = static_cast(user_data); + + g_autoptr(GError) error = nullptr; + g_autoptr( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoClassMapResponse) response = + core_tests_pigeon_test_flutter_integration_core_api_echo_class_map_finish( + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API(object), result, + &error); + if (response == nullptr) { + core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_class_map( + data->response_handle, "Internal Error", error->message, nullptr); + return; + } + if (core_tests_pigeon_test_flutter_integration_core_api_echo_class_map_response_is_error( + response)) { + core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_bool( + data->response_handle, + core_tests_pigeon_test_flutter_integration_core_api_echo_class_map_response_get_error_code( + response), + core_tests_pigeon_test_flutter_integration_core_api_echo_class_map_response_get_error_message( + response), + core_tests_pigeon_test_flutter_integration_core_api_echo_class_map_response_get_error_details( + response)); + return; + } + + core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_class_map( + data->response_handle, + core_tests_pigeon_test_flutter_integration_core_api_echo_class_map_response_get_return_value( + response)); +} + +static void call_flutter_echo_class_map( + FlValue* class_map, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data) { + TestPlugin* self = TEST_PLUGIN(user_data); + + core_tests_pigeon_test_flutter_integration_core_api_echo_class_map( + self->flutter_core_api, class_map, self->cancellable, echo_class_map_cb, + callback_data_new(self, response_handle)); +} + +static void echo_non_null_string_map_cb(GObject* object, GAsyncResult* result, + gpointer user_data) { + g_autoptr(CallbackData) data = static_cast(user_data); + + g_autoptr(GError) error = nullptr; + g_autoptr( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullStringMapResponse) + response = + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_string_map_finish( + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API(object), + result, &error); + if (response == nullptr) { + core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_non_null_string_map( + data->response_handle, "Internal Error", error->message, nullptr); + return; + } + if (core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_string_map_response_is_error( + response)) { + core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_bool( + data->response_handle, + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_string_map_response_get_error_code( + response), + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_string_map_response_get_error_message( + response), + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_string_map_response_get_error_details( + response)); + return; + } + + core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_non_null_string_map( + data->response_handle, + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_string_map_response_get_return_value( + response)); +} + +static void call_flutter_echo_non_null_string_map( + FlValue* string_map, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data) { + TestPlugin* self = TEST_PLUGIN(user_data); + + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_string_map( + self->flutter_core_api, string_map, self->cancellable, + echo_non_null_string_map_cb, callback_data_new(self, response_handle)); +} + +static void echo_non_null_int_map_cb(GObject* object, GAsyncResult* result, + gpointer user_data) { + g_autoptr(CallbackData) data = static_cast(user_data); + + g_autoptr(GError) error = nullptr; + g_autoptr( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullIntMapResponse) + response = + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_int_map_finish( + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API(object), + result, &error); + if (response == nullptr) { + core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_non_null_int_map( + data->response_handle, "Internal Error", error->message, nullptr); + return; + } + if (core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_int_map_response_is_error( + response)) { + core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_bool( + data->response_handle, + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_int_map_response_get_error_code( + response), + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_int_map_response_get_error_message( + response), + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_int_map_response_get_error_details( + response)); + return; + } + + core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_non_null_int_map( + data->response_handle, + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_int_map_response_get_return_value( + response)); +} + +static void call_flutter_echo_non_null_int_map( + FlValue* int_map, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data) { + TestPlugin* self = TEST_PLUGIN(user_data); + + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_int_map( + self->flutter_core_api, int_map, self->cancellable, + echo_non_null_int_map_cb, callback_data_new(self, response_handle)); +} + +static void echo_non_null_enum_map_cb(GObject* object, GAsyncResult* result, + gpointer user_data) { + g_autoptr(CallbackData) data = static_cast(user_data); + + g_autoptr(GError) error = nullptr; + g_autoptr( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullEnumMapResponse) + response = + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_map_finish( + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API(object), + result, &error); + if (response == nullptr) { + core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_non_null_enum_map( + data->response_handle, "Internal Error", error->message, nullptr); + return; + } + if (core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_map_response_is_error( + response)) { + core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_bool( + data->response_handle, + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_map_response_get_error_code( + response), + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_map_response_get_error_message( + response), + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_map_response_get_error_details( + response)); + return; + } + + core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_non_null_enum_map( + data->response_handle, + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_map_response_get_return_value( + response)); +} + +static void call_flutter_echo_non_null_enum_map( + FlValue* enum_map, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data) { + TestPlugin* self = TEST_PLUGIN(user_data); + + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_enum_map( + self->flutter_core_api, enum_map, self->cancellable, + echo_non_null_enum_map_cb, callback_data_new(self, response_handle)); +} + +static void echo_non_null_class_map_cb(GObject* object, GAsyncResult* result, + gpointer user_data) { + g_autoptr(CallbackData) data = static_cast(user_data); + + g_autoptr(GError) error = nullptr; + g_autoptr( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNonNullClassMapResponse) + response = + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_map_finish( + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API(object), + result, &error); + if (response == nullptr) { + core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_non_null_class_map( + data->response_handle, "Internal Error", error->message, nullptr); + return; + } + if (core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_map_response_is_error( + response)) { + core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_bool( + data->response_handle, + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_map_response_get_error_code( + response), + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_map_response_get_error_message( + response), + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_map_response_get_error_details( + response)); + return; + } + + core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_non_null_class_map( + data->response_handle, + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_map_response_get_return_value( + response)); +} + +static void call_flutter_echo_non_null_class_map( + FlValue* class_map, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data) { + TestPlugin* self = TEST_PLUGIN(user_data); + + core_tests_pigeon_test_flutter_integration_core_api_echo_non_null_class_map( + self->flutter_core_api, class_map, self->cancellable, + echo_non_null_class_map_cb, callback_data_new(self, response_handle)); +} + +static void echo_enum_cb(GObject* object, GAsyncResult* result, + gpointer user_data) { + g_autoptr(CallbackData) data = static_cast(user_data); + + g_autoptr(GError) error = nullptr; + g_autoptr(CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumResponse) + response = + core_tests_pigeon_test_flutter_integration_core_api_echo_enum_finish( + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API(object), + result, &error); + if (response == nullptr) { + core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_enum( + data->response_handle, "Internal Error", error->message, nullptr); + return; + } + if (core_tests_pigeon_test_flutter_integration_core_api_echo_enum_response_is_error( + response)) { + core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_bool( + data->response_handle, + core_tests_pigeon_test_flutter_integration_core_api_echo_enum_response_get_error_code( + response), + core_tests_pigeon_test_flutter_integration_core_api_echo_enum_response_get_error_message( + response), + core_tests_pigeon_test_flutter_integration_core_api_echo_enum_response_get_error_details( + response)); + return; + } + + core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_enum( + data->response_handle, + core_tests_pigeon_test_flutter_integration_core_api_echo_enum_response_get_return_value( + response)); +} + +static void call_flutter_echo_enum( + + CoreTestsPigeonTestAnEnum an_enum, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data) { + TestPlugin* self = TEST_PLUGIN(user_data); + + core_tests_pigeon_test_flutter_integration_core_api_echo_enum( + self->flutter_core_api, an_enum, self->cancellable, echo_enum_cb, + callback_data_new(self, response_handle)); +} + +static void echo_another_enum_cb(GObject* object, GAsyncResult* result, + gpointer user_data) { + g_autoptr(CallbackData) data = static_cast(user_data); + + g_autoptr(GError) error = nullptr; + g_autoptr(CoreTestsPigeonTestFlutterIntegrationCoreApiEchoAnotherEnumResponse) + response = + core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_finish( + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API(object), + result, &error); + if (response == nullptr) { + core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_another_enum( + data->response_handle, "Internal Error", error->message, nullptr); + return; + } + if (core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_response_is_error( + response)) { + core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_bool( + data->response_handle, + core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_response_get_error_code( + response), + core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_response_get_error_message( + response), + core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_response_get_error_details( + response)); + return; + } + + core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_another_enum( + data->response_handle, + core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum_response_get_return_value( + response)); +} + +static void call_flutter_echo_another_enum( + + CoreTestsPigeonTestAnotherEnum another_enum, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data) { + TestPlugin* self = TEST_PLUGIN(user_data); + + core_tests_pigeon_test_flutter_integration_core_api_echo_another_enum( + self->flutter_core_api, another_enum, self->cancellable, + echo_another_enum_cb, callback_data_new(self, response_handle)); +} + +static void echo_nullable_bool_cb(GObject* object, GAsyncResult* result, + gpointer user_data) { + g_autoptr(CallbackData) data = static_cast(user_data); + + g_autoptr(GError) error = nullptr; + g_autoptr( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableBoolResponse) + response = + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_finish( + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API(object), + result, &error); + if (response == nullptr) { + core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_bool( + data->response_handle, "Internal Error", error->message, nullptr); + return; + } + if (core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_response_is_error( + response)) { + core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_bool( + data->response_handle, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_response_get_error_code( + response), + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_response_get_error_message( + response), + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_response_get_error_details( + response)); + return; + } + + core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_bool( + data->response_handle, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool_response_get_return_value( + response)); +} + +static void call_flutter_echo_nullable_bool( + gboolean* a_bool, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data) { + TestPlugin* self = TEST_PLUGIN(user_data); + + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_bool( + self->flutter_core_api, a_bool, self->cancellable, echo_nullable_bool_cb, + callback_data_new(self, response_handle)); +} + +static void echo_nullable_int_cb(GObject* object, GAsyncResult* result, + gpointer user_data) { + g_autoptr(CallbackData) data = static_cast(user_data); + + g_autoptr(GError) error = nullptr; + g_autoptr(CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntResponse) + response = + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_finish( + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API(object), + result, &error); + if (response == nullptr) { + core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_int( + data->response_handle, "Internal Error", error->message, nullptr); + return; + } + if (core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_response_is_error( + response)) { + core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_bool( + data->response_handle, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_response_get_error_code( + response), + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_response_get_error_message( + response), + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_response_get_error_details( + response)); + return; + } + + core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_int( + data->response_handle, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_response_get_return_value( + response)); +} + +static void call_flutter_echo_nullable_int( + int64_t* an_int, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data) { + TestPlugin* self = TEST_PLUGIN(user_data); + + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int( + self->flutter_core_api, an_int, self->cancellable, echo_nullable_int_cb, + callback_data_new(self, response_handle)); +} + +static void echo_nullable_double_cb(GObject* object, GAsyncResult* result, + gpointer user_data) { + g_autoptr(CallbackData) data = static_cast(user_data); + + g_autoptr(GError) error = nullptr; + g_autoptr( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableDoubleResponse) + response = + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_finish( + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API(object), + result, &error); + if (response == nullptr) { + core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_double( + data->response_handle, "Internal Error", error->message, nullptr); + return; + } + if (core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_response_is_error( + response)) { + core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_bool( + data->response_handle, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_response_get_error_code( + response), + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_response_get_error_message( + response), + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_response_get_error_details( + response)); + return; + } + + core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_double( + data->response_handle, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double_response_get_return_value( + response)); +} + +static void call_flutter_echo_nullable_double( + double* a_double, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data) { + TestPlugin* self = TEST_PLUGIN(user_data); + + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_double( + self->flutter_core_api, a_double, self->cancellable, + echo_nullable_double_cb, callback_data_new(self, response_handle)); +} + +static void echo_nullable_string_cb(GObject* object, GAsyncResult* result, + gpointer user_data) { + g_autoptr(CallbackData) data = static_cast(user_data); + + g_autoptr(GError) error = nullptr; + g_autoptr( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringResponse) + response = + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_finish( + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API(object), + result, &error); + if (response == nullptr) { + core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_string( + data->response_handle, "Internal Error", error->message, nullptr); + return; + } + if (core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_response_is_error( + response)) { + core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_bool( + data->response_handle, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_response_get_error_code( + response), + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_response_get_error_message( + response), + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_response_get_error_details( + response)); + return; + } + + core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_string( + data->response_handle, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_response_get_return_value( + response)); +} + +static void call_flutter_echo_nullable_string( + const gchar* a_string, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data) { + TestPlugin* self = TEST_PLUGIN(user_data); + + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string( + self->flutter_core_api, a_string, self->cancellable, + echo_nullable_string_cb, callback_data_new(self, response_handle)); +} + +static void echo_nullable_uint8_list_cb(GObject* object, GAsyncResult* result, + gpointer user_data) { + g_autoptr(CallbackData) data = static_cast(user_data); + + g_autoptr(GError) error = nullptr; + g_autoptr( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableUint8ListResponse) + response = + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_finish( + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API(object), + result, &error); + if (response == nullptr) { + core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_uint8_list( + data->response_handle, "Internal Error", error->message, nullptr); + return; + } + if (core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_response_is_error( + response)) { + core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_bool( + data->response_handle, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_response_get_error_code( + response), + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_response_get_error_message( + response), + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_response_get_error_details( + response)); + return; + } + + size_t return_value_length; + const uint8_t* return_value = + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_response_get_return_value( + response, &return_value_length); + core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_uint8_list( + data->response_handle, return_value, return_value_length); +} + +static void call_flutter_echo_nullable_uint8_list( + const uint8_t* a_list, size_t a_list_length, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data) { + TestPlugin* self = TEST_PLUGIN(user_data); + + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list( + self->flutter_core_api, a_list, a_list_length, self->cancellable, + echo_nullable_uint8_list_cb, callback_data_new(self, response_handle)); +} + +static void echo_nullable_list_cb(GObject* object, GAsyncResult* result, + gpointer user_data) { + g_autoptr(CallbackData) data = static_cast(user_data); + + g_autoptr(GError) error = nullptr; + g_autoptr( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableListResponse) + response = + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_finish( + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API(object), + result, &error); + if (response == nullptr) { + core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_list( + data->response_handle, "Internal Error", error->message, nullptr); + return; + } + if (core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_response_is_error( + response)) { + core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_bool( + data->response_handle, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_response_get_error_code( + response), + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_response_get_error_message( + response), + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_response_get_error_details( + response)); + return; + } + + core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_list( + data->response_handle, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_response_get_return_value( + response)); +} + +static void call_flutter_echo_nullable_list( + FlValue* a_list, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data) { + TestPlugin* self = TEST_PLUGIN(user_data); + + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list( + self->flutter_core_api, a_list, self->cancellable, echo_nullable_list_cb, + callback_data_new(self, response_handle)); +} + +static void echo_nullable_enum_list_cb(GObject* object, GAsyncResult* result, + gpointer user_data) { + g_autoptr(CallbackData) data = static_cast(user_data); + + g_autoptr(GError) error = nullptr; + g_autoptr( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableEnumListResponse) + response = + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_list_finish( + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API(object), + result, &error); + if (response == nullptr) { + core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_enum_list( + data->response_handle, "Internal Error", error->message, nullptr); + return; + } + if (core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_list_response_is_error( + response)) { + core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_bool( + data->response_handle, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_list_response_get_error_code( + response), + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_list_response_get_error_message( + response), + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_list_response_get_error_details( + response)); + return; + } + + core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_enum_list( + data->response_handle, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_list_response_get_return_value( + response)); +} + +static void call_flutter_echo_nullable_enum_list( + FlValue* enum_list, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data) { + TestPlugin* self = TEST_PLUGIN(user_data); + + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_list( + self->flutter_core_api, enum_list, self->cancellable, + echo_nullable_enum_list_cb, callback_data_new(self, response_handle)); +} + +static void echo_nullable_class_list_cb(GObject* object, GAsyncResult* result, + gpointer user_data) { + g_autoptr(CallbackData) data = static_cast(user_data); + + g_autoptr(GError) error = nullptr; + g_autoptr( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableClassListResponse) + response = + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_list_finish( + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API(object), + result, &error); + if (response == nullptr) { + core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_class_list( + data->response_handle, "Internal Error", error->message, nullptr); + return; + } + if (core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_list_response_is_error( + response)) { + core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_bool( + data->response_handle, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_list_response_get_error_code( + response), + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_list_response_get_error_message( + response), + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_list_response_get_error_details( + response)); + return; + } + + core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_class_list( + data->response_handle, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_list_response_get_return_value( + response)); +} + +static void call_flutter_echo_nullable_class_list( + FlValue* class_list, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data) { + TestPlugin* self = TEST_PLUGIN(user_data); + + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_list( + self->flutter_core_api, class_list, self->cancellable, + echo_nullable_class_list_cb, callback_data_new(self, response_handle)); +} + +static void echo_nullable_non_null_enum_list_cb(GObject* object, + GAsyncResult* result, + gpointer user_data) { + g_autoptr(CallbackData) data = static_cast(user_data); + + g_autoptr(GError) error = nullptr; + g_autoptr( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullEnumListResponse) + response = + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_list_finish( + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API(object), + result, &error); + if (response == nullptr) { + core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_non_null_enum_list( + data->response_handle, "Internal Error", error->message, nullptr); + return; + } + if (core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_list_response_is_error( + response)) { + core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_bool( + data->response_handle, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_list_response_get_error_code( + response), + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_list_response_get_error_message( + response), + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_list_response_get_error_details( + response)); + return; + } + + core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_non_null_enum_list( + data->response_handle, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_list_response_get_return_value( + response)); +} + +static void call_flutter_echo_nullable_non_null_enum_list( + FlValue* enum_list, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data) { + TestPlugin* self = TEST_PLUGIN(user_data); + + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_list( + self->flutter_core_api, enum_list, self->cancellable, + echo_nullable_non_null_enum_list_cb, + callback_data_new(self, response_handle)); +} + +static void echo_nullable_non_null_class_list_cb(GObject* object, + GAsyncResult* result, + gpointer user_data) { + g_autoptr(CallbackData) data = static_cast(user_data); + + g_autoptr(GError) error = nullptr; + g_autoptr( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullClassListResponse) + response = + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_list_finish( + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API(object), + result, &error); + if (response == nullptr) { + core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_non_null_class_list( + data->response_handle, "Internal Error", error->message, nullptr); + return; + } + if (core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_list_response_is_error( + response)) { + core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_bool( + data->response_handle, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_list_response_get_error_code( + response), + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_list_response_get_error_message( + response), + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_list_response_get_error_details( + response)); + return; + } + + core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_non_null_class_list( + data->response_handle, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_list_response_get_return_value( + response)); +} + +static void call_flutter_echo_nullable_non_null_class_list( + FlValue* class_list, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data) { + TestPlugin* self = TEST_PLUGIN(user_data); + + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_list( + self->flutter_core_api, class_list, self->cancellable, + echo_nullable_non_null_class_list_cb, + callback_data_new(self, response_handle)); +} + +static void echo_nullable_map_cb(GObject* object, GAsyncResult* result, + gpointer user_data) { + g_autoptr(CallbackData) data = static_cast(user_data); + + g_autoptr(GError) error = nullptr; + g_autoptr(CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableMapResponse) + response = + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_finish( CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API(object), result, &error); if (response == nullptr) { - core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_uint8_list( + core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_map( data->response_handle, "Internal Error", error->message, nullptr); return; } - if (core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_response_is_error( + if (core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_response_is_error( response)) { core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_bool( data->response_handle, - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_response_get_error_code( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_response_get_error_code( response), - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_response_get_error_message( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_response_get_error_message( response), - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_response_get_error_details( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_response_get_error_details( response)); return; } - size_t return_value_length; - const uint8_t* return_value = - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list_response_get_return_value( - response, &return_value_length); - core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_uint8_list( - data->response_handle, return_value, return_value_length); + core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_map( + data->response_handle, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_response_get_return_value( + response)); } -static void call_flutter_echo_nullable_uint8_list( - const uint8_t* a_list, size_t a_list_length, +static void call_flutter_echo_nullable_map( + FlValue* map, CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, gpointer user_data) { TestPlugin* self = TEST_PLUGIN(user_data); - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_uint8_list( - self->flutter_core_api, a_list, a_list_length, self->cancellable, - echo_nullable_uint8_list_cb, callback_data_new(self, response_handle)); + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map( + self->flutter_core_api, map, self->cancellable, echo_nullable_map_cb, + callback_data_new(self, response_handle)); } -static void echo_nullable_list_cb(GObject* object, GAsyncResult* result, - gpointer user_data) { +static void echo_nullable_string_map_cb(GObject* object, GAsyncResult* result, + gpointer user_data) { g_autoptr(CallbackData) data = static_cast(user_data); g_autoptr(GError) error = nullptr; g_autoptr( - CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableListResponse) + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringMapResponse) response = - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_finish( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_finish( CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API(object), result, &error); if (response == nullptr) { - core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_list( + core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_string_map( data->response_handle, "Internal Error", error->message, nullptr); return; } - if (core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_response_is_error( + if (core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_response_is_error( response)) { core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_bool( data->response_handle, - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_response_get_error_code( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_response_get_error_code( response), - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_response_get_error_message( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_response_get_error_message( response), - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_response_get_error_details( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_response_get_error_details( response)); return; } - core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_list( + core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_string_map( data->response_handle, - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_response_get_return_value( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_response_get_return_value( response)); } -static void call_flutter_echo_nullable_list( - FlValue* a_list, +static void call_flutter_echo_nullable_string_map( + FlValue* string_map, CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, gpointer user_data) { TestPlugin* self = TEST_PLUGIN(user_data); - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list( - self->flutter_core_api, a_list, self->cancellable, echo_nullable_list_cb, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map( + self->flutter_core_api, string_map, self->cancellable, + echo_nullable_string_map_cb, callback_data_new(self, response_handle)); +} + +static void echo_nullable_int_map_cb(GObject* object, GAsyncResult* result, + gpointer user_data) { + g_autoptr(CallbackData) data = static_cast(user_data); + + g_autoptr(GError) error = nullptr; + g_autoptr( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntMapResponse) + response = + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_finish( + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API(object), + result, &error); + if (response == nullptr) { + core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_int_map( + data->response_handle, "Internal Error", error->message, nullptr); + return; + } + if (core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_response_is_error( + response)) { + core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_bool( + data->response_handle, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_response_get_error_code( + response), + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_response_get_error_message( + response), + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_response_get_error_details( + response)); + return; + } + + core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_int_map( + data->response_handle, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_response_get_return_value( + response)); +} + +static void call_flutter_echo_nullable_int_map( + FlValue* int_map, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data) { + TestPlugin* self = TEST_PLUGIN(user_data); + + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map( + self->flutter_core_api, int_map, self->cancellable, + echo_nullable_int_map_cb, callback_data_new(self, response_handle)); +} + +static void echo_nullable_enum_map_cb(GObject* object, GAsyncResult* result, + gpointer user_data) { + g_autoptr(CallbackData) data = static_cast(user_data); + + g_autoptr(GError) error = nullptr; + g_autoptr( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableEnumMapResponse) + response = + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_map_finish( + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API(object), + result, &error); + if (response == nullptr) { + core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_enum_map( + data->response_handle, "Internal Error", error->message, nullptr); + return; + } + if (core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_map_response_is_error( + response)) { + core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_bool( + data->response_handle, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_map_response_get_error_code( + response), + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_map_response_get_error_message( + response), + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_map_response_get_error_details( + response)); + return; + } + + core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_enum_map( + data->response_handle, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_map_response_get_return_value( + response)); +} + +static void call_flutter_echo_nullable_enum_map( + FlValue* enum_map, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data) { + TestPlugin* self = TEST_PLUGIN(user_data); + + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_map( + self->flutter_core_api, enum_map, self->cancellable, + echo_nullable_enum_map_cb, callback_data_new(self, response_handle)); +} + +static void echo_nullable_class_map_cb(GObject* object, GAsyncResult* result, + gpointer user_data) { + g_autoptr(CallbackData) data = static_cast(user_data); + + g_autoptr(GError) error = nullptr; + g_autoptr( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableClassMapResponse) + response = + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_map_finish( + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API(object), + result, &error); + if (response == nullptr) { + core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_class_map( + data->response_handle, "Internal Error", error->message, nullptr); + return; + } + if (core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_map_response_is_error( + response)) { + core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_bool( + data->response_handle, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_map_response_get_error_code( + response), + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_map_response_get_error_message( + response), + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_map_response_get_error_details( + response)); + return; + } + + core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_class_map( + data->response_handle, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_map_response_get_return_value( + response)); +} + +static void call_flutter_echo_nullable_class_map( + FlValue* class_map, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data) { + TestPlugin* self = TEST_PLUGIN(user_data); + + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_class_map( + self->flutter_core_api, class_map, self->cancellable, + echo_nullable_class_map_cb, callback_data_new(self, response_handle)); +} + +static void echo_nullable_non_null_string_map_cb(GObject* object, + GAsyncResult* result, + gpointer user_data) { + g_autoptr(CallbackData) data = static_cast(user_data); + + g_autoptr(GError) error = nullptr; + g_autoptr( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullStringMapResponse) + response = + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_string_map_finish( + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API(object), + result, &error); + if (response == nullptr) { + core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_non_null_string_map( + data->response_handle, "Internal Error", error->message, nullptr); + return; + } + if (core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_string_map_response_is_error( + response)) { + core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_bool( + data->response_handle, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_string_map_response_get_error_code( + response), + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_string_map_response_get_error_message( + response), + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_string_map_response_get_error_details( + response)); + return; + } + + core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_non_null_string_map( + data->response_handle, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_string_map_response_get_return_value( + response)); +} + +static void call_flutter_echo_nullable_non_null_string_map( + FlValue* string_map, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data) { + TestPlugin* self = TEST_PLUGIN(user_data); + + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_string_map( + self->flutter_core_api, string_map, self->cancellable, + echo_nullable_non_null_string_map_cb, callback_data_new(self, response_handle)); } -static void echo_nullable_map_cb(GObject* object, GAsyncResult* result, - gpointer user_data) { +static void echo_nullable_non_null_int_map_cb(GObject* object, + GAsyncResult* result, + gpointer user_data) { g_autoptr(CallbackData) data = static_cast(user_data); g_autoptr(GError) error = nullptr; - g_autoptr(CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableMapResponse) + g_autoptr( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullIntMapResponse) response = - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_finish( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_int_map_finish( CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API(object), result, &error); if (response == nullptr) { - core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_map( + core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_non_null_int_map( data->response_handle, "Internal Error", error->message, nullptr); return; } - if (core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_response_is_error( + if (core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_int_map_response_is_error( response)) { core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_bool( data->response_handle, - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_response_get_error_code( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_int_map_response_get_error_code( response), - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_response_get_error_message( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_int_map_response_get_error_message( response), - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_response_get_error_details( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_int_map_response_get_error_details( response)); return; } - core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_map( + core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_non_null_int_map( data->response_handle, - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_response_get_return_value( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_int_map_response_get_return_value( response)); } -static void call_flutter_echo_nullable_map( - FlValue* a_map, +static void call_flutter_echo_nullable_non_null_int_map( + FlValue* int_map, CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, gpointer user_data) { TestPlugin* self = TEST_PLUGIN(user_data); - core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map( - self->flutter_core_api, a_map, self->cancellable, echo_nullable_map_cb, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_int_map( + self->flutter_core_api, int_map, self->cancellable, + echo_nullable_non_null_int_map_cb, + callback_data_new(self, response_handle)); +} + +static void echo_nullable_non_null_enum_map_cb(GObject* object, + GAsyncResult* result, + gpointer user_data) { + g_autoptr(CallbackData) data = static_cast(user_data); + + g_autoptr(GError) error = nullptr; + g_autoptr( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullEnumMapResponse) + response = + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_map_finish( + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API(object), + result, &error); + if (response == nullptr) { + core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_non_null_enum_map( + data->response_handle, "Internal Error", error->message, nullptr); + return; + } + if (core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_map_response_is_error( + response)) { + core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_bool( + data->response_handle, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_map_response_get_error_code( + response), + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_map_response_get_error_message( + response), + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_map_response_get_error_details( + response)); + return; + } + + core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_non_null_enum_map( + data->response_handle, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_map_response_get_return_value( + response)); +} + +static void call_flutter_echo_nullable_non_null_enum_map( + FlValue* enum_map, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data) { + TestPlugin* self = TEST_PLUGIN(user_data); + + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_enum_map( + self->flutter_core_api, enum_map, self->cancellable, + echo_nullable_non_null_enum_map_cb, + callback_data_new(self, response_handle)); +} + +static void echo_nullable_non_null_class_map_cb(GObject* object, + GAsyncResult* result, + gpointer user_data) { + g_autoptr(CallbackData) data = static_cast(user_data); + + g_autoptr(GError) error = nullptr; + g_autoptr( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableNonNullClassMapResponse) + response = + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_map_finish( + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API(object), + result, &error); + if (response == nullptr) { + core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_non_null_class_map( + data->response_handle, "Internal Error", error->message, nullptr); + return; + } + if (core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_map_response_is_error( + response)) { + core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_bool( + data->response_handle, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_map_response_get_error_code( + response), + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_map_response_get_error_message( + response), + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_map_response_get_error_details( + response)); + return; + } + + core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_non_null_class_map( + data->response_handle, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_map_response_get_return_value( + response)); +} + +static void call_flutter_echo_nullable_non_null_class_map( + FlValue* class_map, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data) { + TestPlugin* self = TEST_PLUGIN(user_data); + + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_non_null_class_map( + self->flutter_core_api, class_map, self->cancellable, + echo_nullable_non_null_class_map_cb, callback_data_new(self, response_handle)); } @@ -1814,6 +3171,10 @@ static void call_flutter_small_api_echo_string( small_api_one_echo_string_cb, callback_data_new(self, response_handle)); } +CoreTestsPigeonTestUnusedClass* test_unused_class_generated() { + return core_tests_pigeon_test_unused_class_new(nullptr); +} + static CoreTestsPigeonTestHostIntegrationCoreApiVTable host_core_api_vtable = { .noop = noop, .echo_all_types = echo_all_types, @@ -1827,7 +3188,19 @@ static CoreTestsPigeonTestHostIntegrationCoreApiVTable host_core_api_vtable = { .echo_uint8_list = echo_uint8_list, .echo_object = echo_object, .echo_list = echo_list, + .echo_enum_list = echo_enum_list, + .echo_class_list = echo_class_list, + .echo_non_null_enum_list = echo_non_null_enum_list, + .echo_non_null_class_list = echo_non_null_class_list, .echo_map = echo_map, + .echo_string_map = echo_string_map, + .echo_int_map = echo_int_map, + .echo_enum_map = echo_enum_map, + .echo_class_map = echo_class_map, + .echo_non_null_string_map = echo_non_null_string_map, + .echo_non_null_int_map = echo_non_null_int_map, + .echo_non_null_enum_map = echo_non_null_enum_map, + .echo_non_null_class_map = echo_non_null_class_map, .echo_class_wrapper = echo_class_wrapper, .echo_enum = echo_enum, .echo_another_enum = echo_another_enum, @@ -1849,7 +3222,19 @@ static CoreTestsPigeonTestHostIntegrationCoreApiVTable host_core_api_vtable = { .echo_nullable_uint8_list = echo_nullable_uint8_list, .echo_nullable_object = echo_nullable_object, .echo_nullable_list = echo_nullable_list, + .echo_nullable_enum_list = echo_nullable_enum_list, + .echo_nullable_class_list = echo_nullable_class_list, + .echo_nullable_non_null_enum_list = echo_nullable_non_null_enum_list, + .echo_nullable_non_null_class_list = echo_nullable_non_null_class_list, .echo_nullable_map = echo_nullable_map, + .echo_nullable_string_map = echo_nullable_string_map, + .echo_nullable_int_map = echo_nullable_int_map, + .echo_nullable_enum_map = echo_nullable_enum_map, + .echo_nullable_class_map = echo_nullable_class_map, + .echo_nullable_non_null_string_map = echo_nullable_non_null_string_map, + .echo_nullable_non_null_int_map = echo_nullable_non_null_int_map, + .echo_nullable_non_null_enum_map = echo_nullable_non_null_enum_map, + .echo_nullable_non_null_class_map = echo_nullable_non_null_class_map, .echo_nullable_enum = echo_nullable_enum, .echo_another_nullable_enum = echo_another_nullable_enum, .echo_optional_nullable_int = echo_optional_nullable_int, @@ -1862,7 +3247,13 @@ static CoreTestsPigeonTestHostIntegrationCoreApiVTable host_core_api_vtable = { .echo_async_uint8_list = echo_async_uint8_list, .echo_async_object = echo_async_object, .echo_async_list = echo_async_list, + .echo_async_enum_list = echo_async_enum_list, + .echo_async_class_list = echo_async_class_list, .echo_async_map = echo_async_map, + .echo_async_string_map = echo_async_string_map, + .echo_async_int_map = echo_async_int_map, + .echo_async_enum_map = echo_async_enum_map, + .echo_async_class_map = echo_async_class_map, .echo_async_enum = echo_async_enum, .echo_another_async_enum = echo_another_async_enum, .throw_async_error = throw_async_error, @@ -1880,7 +3271,13 @@ static CoreTestsPigeonTestHostIntegrationCoreApiVTable host_core_api_vtable = { .echo_async_nullable_uint8_list = echo_async_nullable_uint8_list, .echo_async_nullable_object = echo_async_nullable_object, .echo_async_nullable_list = echo_async_nullable_list, + .echo_async_nullable_enum_list = echo_async_nullable_enum_list, + .echo_async_nullable_class_list = echo_async_nullable_class_list, .echo_async_nullable_map = echo_async_nullable_map, + .echo_async_nullable_string_map = echo_async_nullable_string_map, + .echo_async_nullable_int_map = echo_async_nullable_int_map, + .echo_async_nullable_enum_map = echo_async_nullable_enum_map, + .echo_async_nullable_class_map = echo_async_nullable_class_map, .echo_async_nullable_enum = echo_async_nullable_enum, .echo_another_async_nullable_enum = echo_another_async_nullable_enum, .call_flutter_noop = call_flutter_noop, @@ -1901,7 +3298,23 @@ static CoreTestsPigeonTestHostIntegrationCoreApiVTable host_core_api_vtable = { .call_flutter_echo_string = call_flutter_echo_string, .call_flutter_echo_uint8_list = call_flutter_echo_uint8_list, .call_flutter_echo_list = call_flutter_echo_list, + .call_flutter_echo_enum_list = call_flutter_echo_enum_list, + .call_flutter_echo_class_list = call_flutter_echo_class_list, + .call_flutter_echo_non_null_enum_list = + call_flutter_echo_non_null_enum_list, + .call_flutter_echo_non_null_class_list = + call_flutter_echo_non_null_class_list, .call_flutter_echo_map = call_flutter_echo_map, + .call_flutter_echo_string_map = call_flutter_echo_string_map, + .call_flutter_echo_int_map = call_flutter_echo_int_map, + .call_flutter_echo_enum_map = call_flutter_echo_enum_map, + .call_flutter_echo_class_map = call_flutter_echo_class_map, + .call_flutter_echo_non_null_string_map = + call_flutter_echo_non_null_string_map, + .call_flutter_echo_non_null_int_map = call_flutter_echo_non_null_int_map, + .call_flutter_echo_non_null_enum_map = call_flutter_echo_non_null_enum_map, + .call_flutter_echo_non_null_class_map = + call_flutter_echo_non_null_class_map, .call_flutter_echo_enum = call_flutter_echo_enum, .call_flutter_echo_another_enum = call_flutter_echo_another_enum, .call_flutter_echo_nullable_bool = call_flutter_echo_nullable_bool, @@ -1911,7 +3324,29 @@ static CoreTestsPigeonTestHostIntegrationCoreApiVTable host_core_api_vtable = { .call_flutter_echo_nullable_uint8_list = call_flutter_echo_nullable_uint8_list, .call_flutter_echo_nullable_list = call_flutter_echo_nullable_list, + .call_flutter_echo_nullable_enum_list = + call_flutter_echo_nullable_enum_list, + .call_flutter_echo_nullable_class_list = + call_flutter_echo_nullable_class_list, + .call_flutter_echo_nullable_non_null_enum_list = + call_flutter_echo_nullable_non_null_enum_list, + .call_flutter_echo_nullable_non_null_class_list = + call_flutter_echo_nullable_non_null_class_list, .call_flutter_echo_nullable_map = call_flutter_echo_nullable_map, + .call_flutter_echo_nullable_string_map = + call_flutter_echo_nullable_string_map, + .call_flutter_echo_nullable_int_map = call_flutter_echo_nullable_int_map, + .call_flutter_echo_nullable_enum_map = call_flutter_echo_nullable_enum_map, + .call_flutter_echo_nullable_class_map = + call_flutter_echo_nullable_class_map, + .call_flutter_echo_nullable_non_null_string_map = + call_flutter_echo_nullable_non_null_string_map, + .call_flutter_echo_nullable_non_null_int_map = + call_flutter_echo_nullable_non_null_int_map, + .call_flutter_echo_nullable_non_null_enum_map = + call_flutter_echo_nullable_non_null_enum_map, + .call_flutter_echo_nullable_non_null_class_map = + call_flutter_echo_nullable_non_null_class_map, .call_flutter_echo_nullable_enum = call_flutter_echo_nullable_enum, .call_flutter_echo_another_nullable_enum = call_flutter_echo_another_nullable_enum, diff --git a/packages/pigeon/platform_tests/test_plugin/macos/Classes/.gitignore b/packages/pigeon/platform_tests/test_plugin/macos/Classes/.gitignore index 65eaa145c8ac..7a58c79195bb 100644 --- a/packages/pigeon/platform_tests/test_plugin/macos/Classes/.gitignore +++ b/packages/pigeon/platform_tests/test_plugin/macos/Classes/.gitignore @@ -2,4 +2,8 @@ # changes on generated files. This will need a way to avoid unnecessary churn, # such as a flag to suppress version stamp generation. *.gen.swift -!CoreTests.gen.swift \ No newline at end of file +!CoreTests.gen.swift +# Keeping this makes it easier to review changes to ProxyApi generation. +!ProxyApiTests.gen.swift +# Contains the class declartions for testing ProxyApis. +!ProxyApiTestClass.swift \ No newline at end of file diff --git a/packages/pigeon/platform_tests/test_plugin/macos/Classes/CoreTests.gen.swift b/packages/pigeon/platform_tests/test_plugin/macos/Classes/CoreTests.gen.swift index 00fd797edcef..2b2001d6aa44 100644 --- a/packages/pigeon/platform_tests/test_plugin/macos/Classes/CoreTests.gen.swift +++ b/packages/pigeon/platform_tests/test_plugin/macos/Classes/CoreTests.gen.swift @@ -86,6 +86,25 @@ enum AnotherEnum: Int { case justInCase = 0 } +/// Generated class from Pigeon that represents data sent in messages. +struct UnusedClass { + var aField: Any? = nil + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> UnusedClass? { + let aField: Any? = pigeonVar_list[0] + + return UnusedClass( + aField: aField + ) + } + func toList() -> [Any?] { + return [ + aField + ] + } +} + /// A class containing all supported types. /// /// Generated class from Pigeon that represents data sent in messages. @@ -103,19 +122,27 @@ struct AllTypes { var aString: String var anObject: Any var list: [Any?] - var stringList: [String?] - var intList: [Int64?] - var doubleList: [Double?] - var boolList: [Bool?] - var map: [AnyHashable: Any?] + var stringList: [String] + var intList: [Int64] + var doubleList: [Double] + var boolList: [Bool] + var enumList: [AnEnum] + var objectList: [Any] + var listList: [[Any?]] + var mapList: [[AnyHashable?: Any?]] + var map: [AnyHashable?: Any?] + var stringMap: [String: String] + var intMap: [Int64: Int64] + var enumMap: [AnEnum: AnEnum] + var objectMap: [AnyHashable: Any] + var listMap: [Int64: [Any?]] + var mapMap: [Int64: [AnyHashable?: Any?]] // swift-format-ignore: AlwaysUseLowerCamelCase static func fromList(_ pigeonVar_list: [Any?]) -> AllTypes? { let aBool = pigeonVar_list[0] as! Bool - let anInt = - pigeonVar_list[1] is Int64 ? pigeonVar_list[1] as! Int64 : Int64(pigeonVar_list[1] as! Int32) - let anInt64 = - pigeonVar_list[2] is Int64 ? pigeonVar_list[2] as! Int64 : Int64(pigeonVar_list[2] as! Int32) + let anInt = pigeonVar_list[1] as! Int64 + let anInt64 = pigeonVar_list[2] as! Int64 let aDouble = pigeonVar_list[3] as! Double let aByteArray = pigeonVar_list[4] as! FlutterStandardTypedData let a4ByteArray = pigeonVar_list[5] as! FlutterStandardTypedData @@ -126,11 +153,21 @@ struct AllTypes { let aString = pigeonVar_list[10] as! String let anObject = pigeonVar_list[11]! let list = pigeonVar_list[12] as! [Any?] - let stringList = pigeonVar_list[13] as! [String?] - let intList = pigeonVar_list[14] as! [Int64?] - let doubleList = pigeonVar_list[15] as! [Double?] - let boolList = pigeonVar_list[16] as! [Bool?] - let map = pigeonVar_list[17] as! [AnyHashable: Any?] + let stringList = pigeonVar_list[13] as! [String] + let intList = pigeonVar_list[14] as! [Int64] + let doubleList = pigeonVar_list[15] as! [Double] + let boolList = pigeonVar_list[16] as! [Bool] + let enumList = pigeonVar_list[17] as! [AnEnum] + let objectList = pigeonVar_list[18] as! [Any] + let listList = pigeonVar_list[19] as! [[Any?]] + let mapList = pigeonVar_list[20] as! [[AnyHashable?: Any?]] + let map = pigeonVar_list[21] as! [AnyHashable?: Any?] + let stringMap = pigeonVar_list[22] as! [String: String] + let intMap = pigeonVar_list[23] as! [Int64: Int64] + let enumMap = pigeonVar_list[24] as? [AnEnum: AnEnum] + let objectMap = pigeonVar_list[25] as! [AnyHashable: Any] + let listMap = pigeonVar_list[26] as! [Int64: [Any?]] + let mapMap = pigeonVar_list[27] as! [Int64: [AnyHashable?: Any?]] return AllTypes( aBool: aBool, @@ -150,7 +187,17 @@ struct AllTypes { intList: intList, doubleList: doubleList, boolList: boolList, - map: map + enumList: enumList, + objectList: objectList, + listList: listList, + mapList: mapList, + map: map, + stringMap: stringMap, + intMap: intMap, + enumMap: enumMap!, + objectMap: objectMap, + listMap: listMap, + mapMap: mapMap ) } func toList() -> [Any?] { @@ -172,7 +219,17 @@ struct AllTypes { intList, doubleList, boolList, + enumList, + objectList, + listList, + mapList, map, + stringMap, + intMap, + enumMap, + objectMap, + listMap, + mapMap, ] } } @@ -190,9 +247,6 @@ class AllNullableTypes { aNullable4ByteArray: FlutterStandardTypedData? = nil, aNullable8ByteArray: FlutterStandardTypedData? = nil, aNullableFloatArray: FlutterStandardTypedData? = nil, - nullableNestedList: [[Bool?]?]? = nil, - nullableMapWithAnnotations: [String?: String?]? = nil, - nullableMapWithObject: [String?: Any?]? = nil, aNullableEnum: AnEnum? = nil, anotherNullableEnum: AnotherEnum? = nil, aNullableString: String? = nil, @@ -203,8 +257,19 @@ class AllNullableTypes { intList: [Int64?]? = nil, doubleList: [Double?]? = nil, boolList: [Bool?]? = nil, - nestedClassList: [AllNullableTypes?]? = nil, - map: [AnyHashable: Any?]? = nil + enumList: [AnEnum?]? = nil, + objectList: [Any?]? = nil, + listList: [[Any?]?]? = nil, + mapList: [[AnyHashable?: Any?]?]? = nil, + recursiveClassList: [AllNullableTypes?]? = nil, + map: [AnyHashable?: Any?]? = nil, + stringMap: [String?: String?]? = nil, + intMap: [Int64?: Int64?]? = nil, + enumMap: [AnEnum?: AnEnum?]? = nil, + objectMap: [AnyHashable?: Any?]? = nil, + listMap: [Int64?: [Any?]?]? = nil, + mapMap: [Int64?: [AnyHashable?: Any?]?]? = nil, + recursiveClassMap: [Int64?: AllNullableTypes?]? = nil ) { self.aNullableBool = aNullableBool self.aNullableInt = aNullableInt @@ -214,9 +279,6 @@ class AllNullableTypes { self.aNullable4ByteArray = aNullable4ByteArray self.aNullable8ByteArray = aNullable8ByteArray self.aNullableFloatArray = aNullableFloatArray - self.nullableNestedList = nullableNestedList - self.nullableMapWithAnnotations = nullableMapWithAnnotations - self.nullableMapWithObject = nullableMapWithObject self.aNullableEnum = aNullableEnum self.anotherNullableEnum = anotherNullableEnum self.aNullableString = aNullableString @@ -227,8 +289,19 @@ class AllNullableTypes { self.intList = intList self.doubleList = doubleList self.boolList = boolList - self.nestedClassList = nestedClassList + self.enumList = enumList + self.objectList = objectList + self.listList = listList + self.mapList = mapList + self.recursiveClassList = recursiveClassList self.map = map + self.stringMap = stringMap + self.intMap = intMap + self.enumMap = enumMap + self.objectMap = objectMap + self.listMap = listMap + self.mapMap = mapMap + self.recursiveClassMap = recursiveClassMap } var aNullableBool: Bool? var aNullableInt: Int64? @@ -238,9 +311,6 @@ class AllNullableTypes { var aNullable4ByteArray: FlutterStandardTypedData? var aNullable8ByteArray: FlutterStandardTypedData? var aNullableFloatArray: FlutterStandardTypedData? - var nullableNestedList: [[Bool?]?]? - var nullableMapWithAnnotations: [String?: String?]? - var nullableMapWithObject: [String?: Any?]? var aNullableEnum: AnEnum? var anotherNullableEnum: AnotherEnum? var aNullableString: String? @@ -251,42 +321,53 @@ class AllNullableTypes { var intList: [Int64?]? var doubleList: [Double?]? var boolList: [Bool?]? - var nestedClassList: [AllNullableTypes?]? - var map: [AnyHashable: Any?]? + var enumList: [AnEnum?]? + var objectList: [Any?]? + var listList: [[Any?]?]? + var mapList: [[AnyHashable?: Any?]?]? + var recursiveClassList: [AllNullableTypes?]? + var map: [AnyHashable?: Any?]? + var stringMap: [String?: String?]? + var intMap: [Int64?: Int64?]? + var enumMap: [AnEnum?: AnEnum?]? + var objectMap: [AnyHashable?: Any?]? + var listMap: [Int64?: [Any?]?]? + var mapMap: [Int64?: [AnyHashable?: Any?]?]? + var recursiveClassMap: [Int64?: AllNullableTypes?]? // swift-format-ignore: AlwaysUseLowerCamelCase static func fromList(_ pigeonVar_list: [Any?]) -> AllNullableTypes? { let aNullableBool: Bool? = nilOrValue(pigeonVar_list[0]) - let aNullableInt: Int64? = - isNullish(pigeonVar_list[1]) - ? nil - : (pigeonVar_list[1] is Int64? - ? pigeonVar_list[1] as! Int64? : Int64(pigeonVar_list[1] as! Int32)) - let aNullableInt64: Int64? = - isNullish(pigeonVar_list[2]) - ? nil - : (pigeonVar_list[2] is Int64? - ? pigeonVar_list[2] as! Int64? : Int64(pigeonVar_list[2] as! Int32)) + let aNullableInt: Int64? = nilOrValue(pigeonVar_list[1]) + let aNullableInt64: Int64? = nilOrValue(pigeonVar_list[2]) let aNullableDouble: Double? = nilOrValue(pigeonVar_list[3]) let aNullableByteArray: FlutterStandardTypedData? = nilOrValue(pigeonVar_list[4]) let aNullable4ByteArray: FlutterStandardTypedData? = nilOrValue(pigeonVar_list[5]) let aNullable8ByteArray: FlutterStandardTypedData? = nilOrValue(pigeonVar_list[6]) let aNullableFloatArray: FlutterStandardTypedData? = nilOrValue(pigeonVar_list[7]) - let nullableNestedList: [[Bool?]?]? = nilOrValue(pigeonVar_list[8]) - let nullableMapWithAnnotations: [String?: String?]? = nilOrValue(pigeonVar_list[9]) - let nullableMapWithObject: [String?: Any?]? = nilOrValue(pigeonVar_list[10]) - let aNullableEnum: AnEnum? = nilOrValue(pigeonVar_list[11]) - let anotherNullableEnum: AnotherEnum? = nilOrValue(pigeonVar_list[12]) - let aNullableString: String? = nilOrValue(pigeonVar_list[13]) - let aNullableObject: Any? = pigeonVar_list[14] - let allNullableTypes: AllNullableTypes? = nilOrValue(pigeonVar_list[15]) - let list: [Any?]? = nilOrValue(pigeonVar_list[16]) - let stringList: [String?]? = nilOrValue(pigeonVar_list[17]) - let intList: [Int64?]? = nilOrValue(pigeonVar_list[18]) - let doubleList: [Double?]? = nilOrValue(pigeonVar_list[19]) - let boolList: [Bool?]? = nilOrValue(pigeonVar_list[20]) - let nestedClassList: [AllNullableTypes?]? = nilOrValue(pigeonVar_list[21]) - let map: [AnyHashable: Any?]? = nilOrValue(pigeonVar_list[22]) + let aNullableEnum: AnEnum? = nilOrValue(pigeonVar_list[8]) + let anotherNullableEnum: AnotherEnum? = nilOrValue(pigeonVar_list[9]) + let aNullableString: String? = nilOrValue(pigeonVar_list[10]) + let aNullableObject: Any? = pigeonVar_list[11] + let allNullableTypes: AllNullableTypes? = nilOrValue(pigeonVar_list[12]) + let list: [Any?]? = nilOrValue(pigeonVar_list[13]) + let stringList: [String?]? = nilOrValue(pigeonVar_list[14]) + let intList: [Int64?]? = nilOrValue(pigeonVar_list[15]) + let doubleList: [Double?]? = nilOrValue(pigeonVar_list[16]) + let boolList: [Bool?]? = nilOrValue(pigeonVar_list[17]) + let enumList: [AnEnum?]? = nilOrValue(pigeonVar_list[18]) + let objectList: [Any?]? = nilOrValue(pigeonVar_list[19]) + let listList: [[Any?]?]? = nilOrValue(pigeonVar_list[20]) + let mapList: [[AnyHashable?: Any?]?]? = nilOrValue(pigeonVar_list[21]) + let recursiveClassList: [AllNullableTypes?]? = nilOrValue(pigeonVar_list[22]) + let map: [AnyHashable?: Any?]? = nilOrValue(pigeonVar_list[23]) + let stringMap: [String?: String?]? = nilOrValue(pigeonVar_list[24]) + let intMap: [Int64?: Int64?]? = nilOrValue(pigeonVar_list[25]) + let enumMap: [AnEnum?: AnEnum?]? = pigeonVar_list[26] as? [AnEnum?: AnEnum?] + let objectMap: [AnyHashable?: Any?]? = nilOrValue(pigeonVar_list[27]) + let listMap: [Int64?: [Any?]?]? = nilOrValue(pigeonVar_list[28]) + let mapMap: [Int64?: [AnyHashable?: Any?]?]? = nilOrValue(pigeonVar_list[29]) + let recursiveClassMap: [Int64?: AllNullableTypes?]? = nilOrValue(pigeonVar_list[30]) return AllNullableTypes( aNullableBool: aNullableBool, @@ -297,9 +378,6 @@ class AllNullableTypes { aNullable4ByteArray: aNullable4ByteArray, aNullable8ByteArray: aNullable8ByteArray, aNullableFloatArray: aNullableFloatArray, - nullableNestedList: nullableNestedList, - nullableMapWithAnnotations: nullableMapWithAnnotations, - nullableMapWithObject: nullableMapWithObject, aNullableEnum: aNullableEnum, anotherNullableEnum: anotherNullableEnum, aNullableString: aNullableString, @@ -310,8 +388,19 @@ class AllNullableTypes { intList: intList, doubleList: doubleList, boolList: boolList, - nestedClassList: nestedClassList, - map: map + enumList: enumList, + objectList: objectList, + listList: listList, + mapList: mapList, + recursiveClassList: recursiveClassList, + map: map, + stringMap: stringMap, + intMap: intMap, + enumMap: enumMap, + objectMap: objectMap, + listMap: listMap, + mapMap: mapMap, + recursiveClassMap: recursiveClassMap ) } func toList() -> [Any?] { @@ -324,9 +413,6 @@ class AllNullableTypes { aNullable4ByteArray, aNullable8ByteArray, aNullableFloatArray, - nullableNestedList, - nullableMapWithAnnotations, - nullableMapWithObject, aNullableEnum, anotherNullableEnum, aNullableString, @@ -337,8 +423,19 @@ class AllNullableTypes { intList, doubleList, boolList, - nestedClassList, + enumList, + objectList, + listList, + mapList, + recursiveClassList, map, + stringMap, + intMap, + enumMap, + objectMap, + listMap, + mapMap, + recursiveClassMap, ] } } @@ -357,9 +454,6 @@ struct AllNullableTypesWithoutRecursion { var aNullable4ByteArray: FlutterStandardTypedData? = nil var aNullable8ByteArray: FlutterStandardTypedData? = nil var aNullableFloatArray: FlutterStandardTypedData? = nil - var nullableNestedList: [[Bool?]?]? = nil - var nullableMapWithAnnotations: [String?: String?]? = nil - var nullableMapWithObject: [String?: Any?]? = nil var aNullableEnum: AnEnum? = nil var anotherNullableEnum: AnotherEnum? = nil var aNullableString: String? = nil @@ -369,39 +463,48 @@ struct AllNullableTypesWithoutRecursion { var intList: [Int64?]? = nil var doubleList: [Double?]? = nil var boolList: [Bool?]? = nil - var map: [AnyHashable: Any?]? = nil + var enumList: [AnEnum?]? = nil + var objectList: [Any?]? = nil + var listList: [[Any?]?]? = nil + var mapList: [[AnyHashable?: Any?]?]? = nil + var map: [AnyHashable?: Any?]? = nil + var stringMap: [String?: String?]? = nil + var intMap: [Int64?: Int64?]? = nil + var enumMap: [AnEnum?: AnEnum?]? = nil + var objectMap: [AnyHashable?: Any?]? = nil + var listMap: [Int64?: [Any?]?]? = nil + var mapMap: [Int64?: [AnyHashable?: Any?]?]? = nil // swift-format-ignore: AlwaysUseLowerCamelCase static func fromList(_ pigeonVar_list: [Any?]) -> AllNullableTypesWithoutRecursion? { let aNullableBool: Bool? = nilOrValue(pigeonVar_list[0]) - let aNullableInt: Int64? = - isNullish(pigeonVar_list[1]) - ? nil - : (pigeonVar_list[1] is Int64? - ? pigeonVar_list[1] as! Int64? : Int64(pigeonVar_list[1] as! Int32)) - let aNullableInt64: Int64? = - isNullish(pigeonVar_list[2]) - ? nil - : (pigeonVar_list[2] is Int64? - ? pigeonVar_list[2] as! Int64? : Int64(pigeonVar_list[2] as! Int32)) + let aNullableInt: Int64? = nilOrValue(pigeonVar_list[1]) + let aNullableInt64: Int64? = nilOrValue(pigeonVar_list[2]) let aNullableDouble: Double? = nilOrValue(pigeonVar_list[3]) let aNullableByteArray: FlutterStandardTypedData? = nilOrValue(pigeonVar_list[4]) let aNullable4ByteArray: FlutterStandardTypedData? = nilOrValue(pigeonVar_list[5]) let aNullable8ByteArray: FlutterStandardTypedData? = nilOrValue(pigeonVar_list[6]) let aNullableFloatArray: FlutterStandardTypedData? = nilOrValue(pigeonVar_list[7]) - let nullableNestedList: [[Bool?]?]? = nilOrValue(pigeonVar_list[8]) - let nullableMapWithAnnotations: [String?: String?]? = nilOrValue(pigeonVar_list[9]) - let nullableMapWithObject: [String?: Any?]? = nilOrValue(pigeonVar_list[10]) - let aNullableEnum: AnEnum? = nilOrValue(pigeonVar_list[11]) - let anotherNullableEnum: AnotherEnum? = nilOrValue(pigeonVar_list[12]) - let aNullableString: String? = nilOrValue(pigeonVar_list[13]) - let aNullableObject: Any? = pigeonVar_list[14] - let list: [Any?]? = nilOrValue(pigeonVar_list[15]) - let stringList: [String?]? = nilOrValue(pigeonVar_list[16]) - let intList: [Int64?]? = nilOrValue(pigeonVar_list[17]) - let doubleList: [Double?]? = nilOrValue(pigeonVar_list[18]) - let boolList: [Bool?]? = nilOrValue(pigeonVar_list[19]) - let map: [AnyHashable: Any?]? = nilOrValue(pigeonVar_list[20]) + let aNullableEnum: AnEnum? = nilOrValue(pigeonVar_list[8]) + let anotherNullableEnum: AnotherEnum? = nilOrValue(pigeonVar_list[9]) + let aNullableString: String? = nilOrValue(pigeonVar_list[10]) + let aNullableObject: Any? = pigeonVar_list[11] + let list: [Any?]? = nilOrValue(pigeonVar_list[12]) + let stringList: [String?]? = nilOrValue(pigeonVar_list[13]) + let intList: [Int64?]? = nilOrValue(pigeonVar_list[14]) + let doubleList: [Double?]? = nilOrValue(pigeonVar_list[15]) + let boolList: [Bool?]? = nilOrValue(pigeonVar_list[16]) + let enumList: [AnEnum?]? = nilOrValue(pigeonVar_list[17]) + let objectList: [Any?]? = nilOrValue(pigeonVar_list[18]) + let listList: [[Any?]?]? = nilOrValue(pigeonVar_list[19]) + let mapList: [[AnyHashable?: Any?]?]? = nilOrValue(pigeonVar_list[20]) + let map: [AnyHashable?: Any?]? = nilOrValue(pigeonVar_list[21]) + let stringMap: [String?: String?]? = nilOrValue(pigeonVar_list[22]) + let intMap: [Int64?: Int64?]? = nilOrValue(pigeonVar_list[23]) + let enumMap: [AnEnum?: AnEnum?]? = pigeonVar_list[24] as? [AnEnum?: AnEnum?] + let objectMap: [AnyHashable?: Any?]? = nilOrValue(pigeonVar_list[25]) + let listMap: [Int64?: [Any?]?]? = nilOrValue(pigeonVar_list[26]) + let mapMap: [Int64?: [AnyHashable?: Any?]?]? = nilOrValue(pigeonVar_list[27]) return AllNullableTypesWithoutRecursion( aNullableBool: aNullableBool, @@ -412,9 +515,6 @@ struct AllNullableTypesWithoutRecursion { aNullable4ByteArray: aNullable4ByteArray, aNullable8ByteArray: aNullable8ByteArray, aNullableFloatArray: aNullableFloatArray, - nullableNestedList: nullableNestedList, - nullableMapWithAnnotations: nullableMapWithAnnotations, - nullableMapWithObject: nullableMapWithObject, aNullableEnum: aNullableEnum, anotherNullableEnum: anotherNullableEnum, aNullableString: aNullableString, @@ -424,7 +524,17 @@ struct AllNullableTypesWithoutRecursion { intList: intList, doubleList: doubleList, boolList: boolList, - map: map + enumList: enumList, + objectList: objectList, + listList: listList, + mapList: mapList, + map: map, + stringMap: stringMap, + intMap: intMap, + enumMap: enumMap, + objectMap: objectMap, + listMap: listMap, + mapMap: mapMap ) } func toList() -> [Any?] { @@ -437,9 +547,6 @@ struct AllNullableTypesWithoutRecursion { aNullable4ByteArray, aNullable8ByteArray, aNullableFloatArray, - nullableNestedList, - nullableMapWithAnnotations, - nullableMapWithObject, aNullableEnum, anotherNullableEnum, aNullableString, @@ -449,7 +556,17 @@ struct AllNullableTypesWithoutRecursion { intList, doubleList, boolList, + enumList, + objectList, + listList, + mapList, map, + stringMap, + intMap, + enumMap, + objectMap, + listMap, + mapMap, ] } } @@ -465,6 +582,10 @@ struct AllClassesWrapper { var allNullableTypes: AllNullableTypes var allNullableTypesWithoutRecursion: AllNullableTypesWithoutRecursion? = nil var allTypes: AllTypes? = nil + var classList: [AllTypes?] + var nullableClassList: [AllNullableTypesWithoutRecursion?]? = nil + var classMap: [Int64?: AllTypes?] + var nullableClassMap: [Int64?: AllNullableTypesWithoutRecursion?]? = nil // swift-format-ignore: AlwaysUseLowerCamelCase static func fromList(_ pigeonVar_list: [Any?]) -> AllClassesWrapper? { @@ -472,11 +593,20 @@ struct AllClassesWrapper { let allNullableTypesWithoutRecursion: AllNullableTypesWithoutRecursion? = nilOrValue( pigeonVar_list[1]) let allTypes: AllTypes? = nilOrValue(pigeonVar_list[2]) + let classList = pigeonVar_list[3] as! [AllTypes?] + let nullableClassList: [AllNullableTypesWithoutRecursion?]? = nilOrValue(pigeonVar_list[4]) + let classMap = pigeonVar_list[5] as! [Int64?: AllTypes?] + let nullableClassMap: [Int64?: AllNullableTypesWithoutRecursion?]? = nilOrValue( + pigeonVar_list[6]) return AllClassesWrapper( allNullableTypes: allNullableTypes, allNullableTypesWithoutRecursion: allNullableTypesWithoutRecursion, - allTypes: allTypes + allTypes: allTypes, + classList: classList, + nullableClassList: nullableClassList, + classMap: classMap, + nullableClassMap: nullableClassMap ) } func toList() -> [Any?] { @@ -484,6 +614,10 @@ struct AllClassesWrapper { allNullableTypes, allNullableTypesWithoutRecursion, allTypes, + classList, + nullableClassList, + classMap, + nullableClassMap, ] } } @@ -513,26 +647,28 @@ private class CoreTestsPigeonCodecReader: FlutterStandardReader { override func readValue(ofType type: UInt8) -> Any? { switch type { case 129: - let enumResultAsInt: Int? = nilOrValue(self.readValue() as? Int) + let enumResultAsInt: Int? = nilOrValue(self.readValue() as! Int?) if let enumResultAsInt = enumResultAsInt { return AnEnum(rawValue: enumResultAsInt) } return nil case 130: - let enumResultAsInt: Int? = nilOrValue(self.readValue() as? Int) + let enumResultAsInt: Int? = nilOrValue(self.readValue() as! Int?) if let enumResultAsInt = enumResultAsInt { return AnotherEnum(rawValue: enumResultAsInt) } return nil case 131: - return AllTypes.fromList(self.readValue() as! [Any?]) + return UnusedClass.fromList(self.readValue() as! [Any?]) case 132: - return AllNullableTypes.fromList(self.readValue() as! [Any?]) + return AllTypes.fromList(self.readValue() as! [Any?]) case 133: - return AllNullableTypesWithoutRecursion.fromList(self.readValue() as! [Any?]) + return AllNullableTypes.fromList(self.readValue() as! [Any?]) case 134: - return AllClassesWrapper.fromList(self.readValue() as! [Any?]) + return AllNullableTypesWithoutRecursion.fromList(self.readValue() as! [Any?]) case 135: + return AllClassesWrapper.fromList(self.readValue() as! [Any?]) + case 136: return TestMessage.fromList(self.readValue() as! [Any?]) default: return super.readValue(ofType: type) @@ -548,21 +684,24 @@ private class CoreTestsPigeonCodecWriter: FlutterStandardWriter { } else if let value = value as? AnotherEnum { super.writeByte(130) super.writeValue(value.rawValue) - } else if let value = value as? AllTypes { + } else if let value = value as? UnusedClass { super.writeByte(131) super.writeValue(value.toList()) - } else if let value = value as? AllNullableTypes { + } else if let value = value as? AllTypes { super.writeByte(132) super.writeValue(value.toList()) - } else if let value = value as? AllNullableTypesWithoutRecursion { + } else if let value = value as? AllNullableTypes { super.writeByte(133) super.writeValue(value.toList()) - } else if let value = value as? AllClassesWrapper { + } else if let value = value as? AllNullableTypesWithoutRecursion { super.writeByte(134) super.writeValue(value.toList()) - } else if let value = value as? TestMessage { + } else if let value = value as? AllClassesWrapper { super.writeByte(135) super.writeValue(value.toList()) + } else if let value = value as? TestMessage { + super.writeByte(136) + super.writeValue(value.toList()) } else { super.writeValue(value) } @@ -613,9 +752,33 @@ protocol HostIntegrationCoreApi { func echo(_ anObject: Any) throws -> Any /// Returns the passed list, to test serialization and deserialization. func echo(_ list: [Any?]) throws -> [Any?] + /// Returns the passed list, to test serialization and deserialization. + func echo(enumList: [AnEnum?]) throws -> [AnEnum?] + /// Returns the passed list, to test serialization and deserialization. + func echo(classList: [AllNullableTypes?]) throws -> [AllNullableTypes?] + /// Returns the passed list, to test serialization and deserialization. + func echoNonNull(enumList: [AnEnum]) throws -> [AnEnum] + /// Returns the passed list, to test serialization and deserialization. + func echoNonNull(classList: [AllNullableTypes]) throws -> [AllNullableTypes] + /// Returns the passed map, to test serialization and deserialization. + func echo(_ map: [AnyHashable?: Any?]) throws -> [AnyHashable?: Any?] + /// Returns the passed map, to test serialization and deserialization. + func echo(stringMap: [String?: String?]) throws -> [String?: String?] + /// Returns the passed map, to test serialization and deserialization. + func echo(intMap: [Int64?: Int64?]) throws -> [Int64?: Int64?] + /// Returns the passed map, to test serialization and deserialization. + func echo(enumMap: [AnEnum?: AnEnum?]) throws -> [AnEnum?: AnEnum?] + /// Returns the passed map, to test serialization and deserialization. + func echo(classMap: [Int64?: AllNullableTypes?]) throws -> [Int64?: AllNullableTypes?] /// Returns the passed map, to test serialization and deserialization. - func echo(_ aMap: [String?: Any?]) throws -> [String?: Any?] - /// Returns the passed map to test nested class serialization and deserialization. + func echoNonNull(stringMap: [String: String]) throws -> [String: String] + /// Returns the passed map, to test serialization and deserialization. + func echoNonNull(intMap: [Int64: Int64]) throws -> [Int64: Int64] + /// Returns the passed map, to test serialization and deserialization. + func echoNonNull(enumMap: [AnEnum: AnEnum]) throws -> [AnEnum: AnEnum] + /// Returns the passed map, to test serialization and deserialization. + func echoNonNull(classMap: [Int64: AllNullableTypes]) throws -> [Int64: AllNullableTypes] + /// Returns the passed class to test nested class serialization and deserialization. func echo(_ wrapper: AllClassesWrapper) throws -> AllClassesWrapper /// Returns the passed enum to test serialization and deserialization. func echo(_ anEnum: AnEnum) throws -> AnEnum @@ -660,8 +823,33 @@ protocol HostIntegrationCoreApi { func echo(_ aNullableObject: Any?) throws -> Any? /// Returns the passed list, to test serialization and deserialization. func echoNullable(_ aNullableList: [Any?]?) throws -> [Any?]? + /// Returns the passed list, to test serialization and deserialization. + func echoNullable(enumList: [AnEnum?]?) throws -> [AnEnum?]? + /// Returns the passed list, to test serialization and deserialization. + func echoNullable(classList: [AllNullableTypes?]?) throws -> [AllNullableTypes?]? + /// Returns the passed list, to test serialization and deserialization. + func echoNullableNonNull(enumList: [AnEnum]?) throws -> [AnEnum]? + /// Returns the passed list, to test serialization and deserialization. + func echoNullableNonNull(classList: [AllNullableTypes]?) throws -> [AllNullableTypes]? + /// Returns the passed map, to test serialization and deserialization. + func echoNullable(_ map: [AnyHashable?: Any?]?) throws -> [AnyHashable?: Any?]? /// Returns the passed map, to test serialization and deserialization. - func echoNullable(_ aNullableMap: [String?: Any?]?) throws -> [String?: Any?]? + func echoNullable(stringMap: [String?: String?]?) throws -> [String?: String?]? + /// Returns the passed map, to test serialization and deserialization. + func echoNullable(intMap: [Int64?: Int64?]?) throws -> [Int64?: Int64?]? + /// Returns the passed map, to test serialization and deserialization. + func echoNullable(enumMap: [AnEnum?: AnEnum?]?) throws -> [AnEnum?: AnEnum?]? + /// Returns the passed map, to test serialization and deserialization. + func echoNullable(classMap: [Int64?: AllNullableTypes?]?) throws -> [Int64?: AllNullableTypes?]? + /// Returns the passed map, to test serialization and deserialization. + func echoNullableNonNull(stringMap: [String: String]?) throws -> [String: String]? + /// Returns the passed map, to test serialization and deserialization. + func echoNullableNonNull(intMap: [Int64: Int64]?) throws -> [Int64: Int64]? + /// Returns the passed map, to test serialization and deserialization. + func echoNullableNonNull(enumMap: [AnEnum: AnEnum]?) throws -> [AnEnum: AnEnum]? + /// Returns the passed map, to test serialization and deserialization. + func echoNullableNonNull(classMap: [Int64: AllNullableTypes]?) throws -> [Int64: + AllNullableTypes]? func echoNullable(_ anEnum: AnEnum?) throws -> AnEnum? func echoNullable(_ anotherEnum: AnotherEnum?) throws -> AnotherEnum? /// Returns passed in int. @@ -687,9 +875,30 @@ protocol HostIntegrationCoreApi { func echoAsync(_ anObject: Any, completion: @escaping (Result) -> Void) /// Returns the passed list, to test asynchronous serialization and deserialization. func echoAsync(_ list: [Any?], completion: @escaping (Result<[Any?], Error>) -> Void) + /// Returns the passed list, to test asynchronous serialization and deserialization. + func echoAsync(enumList: [AnEnum?], completion: @escaping (Result<[AnEnum?], Error>) -> Void) + /// Returns the passed list, to test asynchronous serialization and deserialization. + func echoAsync( + classList: [AllNullableTypes?], + completion: @escaping (Result<[AllNullableTypes?], Error>) -> Void) + /// Returns the passed map, to test asynchronous serialization and deserialization. + func echoAsync( + _ map: [AnyHashable?: Any?], completion: @escaping (Result<[AnyHashable?: Any?], Error>) -> Void + ) + /// Returns the passed map, to test asynchronous serialization and deserialization. + func echoAsync( + stringMap: [String?: String?], completion: @escaping (Result<[String?: String?], Error>) -> Void + ) /// Returns the passed map, to test asynchronous serialization and deserialization. func echoAsync( - _ aMap: [String?: Any?], completion: @escaping (Result<[String?: Any?], Error>) -> Void) + intMap: [Int64?: Int64?], completion: @escaping (Result<[Int64?: Int64?], Error>) -> Void) + /// Returns the passed map, to test asynchronous serialization and deserialization. + func echoAsync( + enumMap: [AnEnum?: AnEnum?], completion: @escaping (Result<[AnEnum?: AnEnum?], Error>) -> Void) + /// Returns the passed map, to test asynchronous serialization and deserialization. + func echoAsync( + classMap: [Int64?: AllNullableTypes?], + completion: @escaping (Result<[Int64?: AllNullableTypes?], Error>) -> Void) /// Returns the passed enum, to test asynchronous serialization and deserialization. func echoAsync(_ anEnum: AnEnum, completion: @escaping (Result) -> Void) /// Returns the passed enum, to test asynchronous serialization and deserialization. @@ -727,9 +936,32 @@ protocol HostIntegrationCoreApi { func echoAsyncNullable(_ anObject: Any?, completion: @escaping (Result) -> Void) /// Returns the passed list, to test asynchronous serialization and deserialization. func echoAsyncNullable(_ list: [Any?]?, completion: @escaping (Result<[Any?]?, Error>) -> Void) + /// Returns the passed list, to test asynchronous serialization and deserialization. + func echoAsyncNullable( + enumList: [AnEnum?]?, completion: @escaping (Result<[AnEnum?]?, Error>) -> Void) + /// Returns the passed list, to test asynchronous serialization and deserialization. + func echoAsyncNullable( + classList: [AllNullableTypes?]?, + completion: @escaping (Result<[AllNullableTypes?]?, Error>) -> Void) + /// Returns the passed map, to test asynchronous serialization and deserialization. + func echoAsyncNullable( + _ map: [AnyHashable?: Any?]?, + completion: @escaping (Result<[AnyHashable?: Any?]?, Error>) -> Void) + /// Returns the passed map, to test asynchronous serialization and deserialization. + func echoAsyncNullable( + stringMap: [String?: String?]?, + completion: @escaping (Result<[String?: String?]?, Error>) -> Void) + /// Returns the passed map, to test asynchronous serialization and deserialization. + func echoAsyncNullable( + intMap: [Int64?: Int64?]?, completion: @escaping (Result<[Int64?: Int64?]?, Error>) -> Void) + /// Returns the passed map, to test asynchronous serialization and deserialization. + func echoAsyncNullable( + enumMap: [AnEnum?: AnEnum?]?, completion: @escaping (Result<[AnEnum?: AnEnum?]?, Error>) -> Void + ) /// Returns the passed map, to test asynchronous serialization and deserialization. func echoAsyncNullable( - _ aMap: [String?: Any?]?, completion: @escaping (Result<[String?: Any?]?, Error>) -> Void) + classMap: [Int64?: AllNullableTypes?]?, + completion: @escaping (Result<[Int64?: AllNullableTypes?]?, Error>) -> Void) /// Returns the passed enum, to test asynchronous serialization and deserialization. func echoAsyncNullable(_ anEnum: AnEnum?, completion: @escaping (Result) -> Void) /// Returns the passed enum, to test asynchronous serialization and deserialization. @@ -761,7 +993,37 @@ protocol HostIntegrationCoreApi { completion: @escaping (Result) -> Void) func callFlutterEcho(_ list: [Any?], completion: @escaping (Result<[Any?], Error>) -> Void) func callFlutterEcho( - _ aMap: [String?: Any?], completion: @escaping (Result<[String?: Any?], Error>) -> Void) + enumList: [AnEnum?], completion: @escaping (Result<[AnEnum?], Error>) -> Void) + func callFlutterEcho( + classList: [AllNullableTypes?], + completion: @escaping (Result<[AllNullableTypes?], Error>) -> Void) + func callFlutterEchoNonNull( + enumList: [AnEnum], completion: @escaping (Result<[AnEnum], Error>) -> Void) + func callFlutterEchoNonNull( + classList: [AllNullableTypes], completion: @escaping (Result<[AllNullableTypes], Error>) -> Void + ) + func callFlutterEcho( + _ map: [AnyHashable?: Any?], completion: @escaping (Result<[AnyHashable?: Any?], Error>) -> Void + ) + func callFlutterEcho( + stringMap: [String?: String?], completion: @escaping (Result<[String?: String?], Error>) -> Void + ) + func callFlutterEcho( + intMap: [Int64?: Int64?], completion: @escaping (Result<[Int64?: Int64?], Error>) -> Void) + func callFlutterEcho( + enumMap: [AnEnum?: AnEnum?], completion: @escaping (Result<[AnEnum?: AnEnum?], Error>) -> Void) + func callFlutterEcho( + classMap: [Int64?: AllNullableTypes?], + completion: @escaping (Result<[Int64?: AllNullableTypes?], Error>) -> Void) + func callFlutterEchoNonNull( + stringMap: [String: String], completion: @escaping (Result<[String: String], Error>) -> Void) + func callFlutterEchoNonNull( + intMap: [Int64: Int64], completion: @escaping (Result<[Int64: Int64], Error>) -> Void) + func callFlutterEchoNonNull( + enumMap: [AnEnum: AnEnum], completion: @escaping (Result<[AnEnum: AnEnum], Error>) -> Void) + func callFlutterEchoNonNull( + classMap: [Int64: AllNullableTypes], + completion: @escaping (Result<[Int64: AllNullableTypes], Error>) -> Void) func callFlutterEcho(_ anEnum: AnEnum, completion: @escaping (Result) -> Void) func callFlutterEcho( _ anotherEnum: AnotherEnum, completion: @escaping (Result) -> Void) @@ -778,7 +1040,38 @@ protocol HostIntegrationCoreApi { func callFlutterEchoNullable( _ list: [Any?]?, completion: @escaping (Result<[Any?]?, Error>) -> Void) func callFlutterEchoNullable( - _ aMap: [String?: Any?]?, completion: @escaping (Result<[String?: Any?]?, Error>) -> Void) + enumList: [AnEnum?]?, completion: @escaping (Result<[AnEnum?]?, Error>) -> Void) + func callFlutterEchoNullable( + classList: [AllNullableTypes?]?, + completion: @escaping (Result<[AllNullableTypes?]?, Error>) -> Void) + func callFlutterEchoNullableNonNull( + enumList: [AnEnum]?, completion: @escaping (Result<[AnEnum]?, Error>) -> Void) + func callFlutterEchoNullableNonNull( + classList: [AllNullableTypes]?, + completion: @escaping (Result<[AllNullableTypes]?, Error>) -> Void) + func callFlutterEchoNullable( + _ map: [AnyHashable?: Any?]?, + completion: @escaping (Result<[AnyHashable?: Any?]?, Error>) -> Void) + func callFlutterEchoNullable( + stringMap: [String?: String?]?, + completion: @escaping (Result<[String?: String?]?, Error>) -> Void) + func callFlutterEchoNullable( + intMap: [Int64?: Int64?]?, completion: @escaping (Result<[Int64?: Int64?]?, Error>) -> Void) + func callFlutterEchoNullable( + enumMap: [AnEnum?: AnEnum?]?, completion: @escaping (Result<[AnEnum?: AnEnum?]?, Error>) -> Void + ) + func callFlutterEchoNullable( + classMap: [Int64?: AllNullableTypes?]?, + completion: @escaping (Result<[Int64?: AllNullableTypes?]?, Error>) -> Void) + func callFlutterEchoNullableNonNull( + stringMap: [String: String]?, completion: @escaping (Result<[String: String]?, Error>) -> Void) + func callFlutterEchoNullableNonNull( + intMap: [Int64: Int64]?, completion: @escaping (Result<[Int64: Int64]?, Error>) -> Void) + func callFlutterEchoNullableNonNull( + enumMap: [AnEnum: AnEnum]?, completion: @escaping (Result<[AnEnum: AnEnum]?, Error>) -> Void) + func callFlutterEchoNullableNonNull( + classMap: [Int64: AllNullableTypes]?, + completion: @escaping (Result<[Int64: AllNullableTypes]?, Error>) -> Void) func callFlutterEchoNullable( _ anEnum: AnEnum?, completion: @escaping (Result) -> Void) func callFlutterEchoNullable( @@ -892,7 +1185,7 @@ class HostIntegrationCoreApiSetup { if let api = api { echoIntChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let anIntArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) + let anIntArg = args[0] as! Int64 do { let result = try api.echo(anIntArg) reply(wrapResult(result)) @@ -1017,6 +1310,82 @@ class HostIntegrationCoreApiSetup { } else { echoListChannel.setMessageHandler(nil) } + /// Returns the passed list, to test serialization and deserialization. + let echoEnumListChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoEnumList\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoEnumListChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let enumListArg = args[0] as! [AnEnum?] + do { + let result = try api.echo(enumList: enumListArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoEnumListChannel.setMessageHandler(nil) + } + /// Returns the passed list, to test serialization and deserialization. + let echoClassListChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoClassList\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoClassListChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let classListArg = args[0] as! [AllNullableTypes?] + do { + let result = try api.echo(classList: classListArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoClassListChannel.setMessageHandler(nil) + } + /// Returns the passed list, to test serialization and deserialization. + let echoNonNullEnumListChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNonNullEnumList\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoNonNullEnumListChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let enumListArg = args[0] as! [AnEnum] + do { + let result = try api.echoNonNull(enumList: enumListArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoNonNullEnumListChannel.setMessageHandler(nil) + } + /// Returns the passed list, to test serialization and deserialization. + let echoNonNullClassListChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNonNullClassList\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoNonNullClassListChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let classListArg = args[0] as! [AllNullableTypes] + do { + let result = try api.echoNonNull(classList: classListArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoNonNullClassListChannel.setMessageHandler(nil) + } /// Returns the passed map, to test serialization and deserialization. let echoMapChannel = FlutterBasicMessageChannel( name: @@ -1025,9 +1394,9 @@ class HostIntegrationCoreApiSetup { if let api = api { echoMapChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let aMapArg = args[0] as! [String?: Any?] + let mapArg = args[0] as! [AnyHashable?: Any?] do { - let result = try api.echo(aMapArg) + let result = try api.echo(mapArg) reply(wrapResult(result)) } catch { reply(wrapError(error)) @@ -1036,7 +1405,159 @@ class HostIntegrationCoreApiSetup { } else { echoMapChannel.setMessageHandler(nil) } - /// Returns the passed map to test nested class serialization and deserialization. + /// Returns the passed map, to test serialization and deserialization. + let echoStringMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoStringMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoStringMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let stringMapArg = args[0] as! [String?: String?] + do { + let result = try api.echo(stringMap: stringMapArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoStringMapChannel.setMessageHandler(nil) + } + /// Returns the passed map, to test serialization and deserialization. + let echoIntMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoIntMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoIntMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let intMapArg = args[0] as! [Int64?: Int64?] + do { + let result = try api.echo(intMap: intMapArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoIntMapChannel.setMessageHandler(nil) + } + /// Returns the passed map, to test serialization and deserialization. + let echoEnumMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoEnumMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoEnumMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let enumMapArg = args[0] as? [AnEnum?: AnEnum?] + do { + let result = try api.echo(enumMap: enumMapArg!) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoEnumMapChannel.setMessageHandler(nil) + } + /// Returns the passed map, to test serialization and deserialization. + let echoClassMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoClassMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoClassMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let classMapArg = args[0] as! [Int64?: AllNullableTypes?] + do { + let result = try api.echo(classMap: classMapArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoClassMapChannel.setMessageHandler(nil) + } + /// Returns the passed map, to test serialization and deserialization. + let echoNonNullStringMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNonNullStringMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoNonNullStringMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let stringMapArg = args[0] as! [String: String] + do { + let result = try api.echoNonNull(stringMap: stringMapArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoNonNullStringMapChannel.setMessageHandler(nil) + } + /// Returns the passed map, to test serialization and deserialization. + let echoNonNullIntMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNonNullIntMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoNonNullIntMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let intMapArg = args[0] as! [Int64: Int64] + do { + let result = try api.echoNonNull(intMap: intMapArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoNonNullIntMapChannel.setMessageHandler(nil) + } + /// Returns the passed map, to test serialization and deserialization. + let echoNonNullEnumMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNonNullEnumMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoNonNullEnumMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let enumMapArg = args[0] as? [AnEnum: AnEnum] + do { + let result = try api.echoNonNull(enumMap: enumMapArg!) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoNonNullEnumMapChannel.setMessageHandler(nil) + } + /// Returns the passed map, to test serialization and deserialization. + let echoNonNullClassMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNonNullClassMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoNonNullClassMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let classMapArg = args[0] as! [Int64: AllNullableTypes] + do { + let result = try api.echoNonNull(classMap: classMapArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoNonNullClassMapChannel.setMessageHandler(nil) + } + /// Returns the passed class to test nested class serialization and deserialization. let echoClassWrapperChannel = FlutterBasicMessageChannel( name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoClassWrapper\(channelSuffix)", @@ -1139,7 +1660,7 @@ class HostIntegrationCoreApiSetup { if let api = api { echoRequiredIntChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let anIntArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) + let anIntArg = args[0] as! Int64 do { let result = try api.echoRequired(anIntArg) reply(wrapResult(result)) @@ -1237,9 +1758,7 @@ class HostIntegrationCoreApiSetup { sendMultipleNullableTypesChannel.setMessageHandler { message, reply in let args = message as! [Any?] let aNullableBoolArg: Bool? = nilOrValue(args[0]) - let aNullableIntArg: Int64? = - isNullish(args[1]) - ? nil : (args[1] is Int64? ? args[1] as! Int64? : Int64(args[1] as! Int32)) + let aNullableIntArg: Int64? = nilOrValue(args[1]) let aNullableStringArg: String? = nilOrValue(args[2]) do { let result = try api.sendMultipleNullableTypes( @@ -1261,9 +1780,7 @@ class HostIntegrationCoreApiSetup { sendMultipleNullableTypesWithoutRecursionChannel.setMessageHandler { message, reply in let args = message as! [Any?] let aNullableBoolArg: Bool? = nilOrValue(args[0]) - let aNullableIntArg: Int64? = - isNullish(args[1]) - ? nil : (args[1] is Int64? ? args[1] as! Int64? : Int64(args[1] as! Int32)) + let aNullableIntArg: Int64? = nilOrValue(args[1]) let aNullableStringArg: String? = nilOrValue(args[2]) do { let result = try api.sendMultipleNullableTypesWithoutRecursion( @@ -1284,9 +1801,7 @@ class HostIntegrationCoreApiSetup { if let api = api { echoNullableIntChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let aNullableIntArg: Int64? = - isNullish(args[0]) - ? nil : (args[0] is Int64? ? args[0] as! Int64? : Int64(args[0] as! Int32)) + let aNullableIntArg: Int64? = nilOrValue(args[0]) do { let result = try api.echo(aNullableIntArg) reply(wrapResult(result)) @@ -1411,17 +1926,93 @@ class HostIntegrationCoreApiSetup { } else { echoNullableListChannel.setMessageHandler(nil) } - /// Returns the passed map, to test serialization and deserialization. - let echoNullableMapChannel = FlutterBasicMessageChannel( + /// Returns the passed list, to test serialization and deserialization. + let echoNullableEnumListChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableEnumList\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoNullableEnumListChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let enumListArg: [AnEnum?]? = nilOrValue(args[0]) + do { + let result = try api.echoNullable(enumList: enumListArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoNullableEnumListChannel.setMessageHandler(nil) + } + /// Returns the passed list, to test serialization and deserialization. + let echoNullableClassListChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableClassList\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoNullableClassListChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let classListArg: [AllNullableTypes?]? = nilOrValue(args[0]) + do { + let result = try api.echoNullable(classList: classListArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoNullableClassListChannel.setMessageHandler(nil) + } + /// Returns the passed list, to test serialization and deserialization. + let echoNullableNonNullEnumListChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableNonNullEnumList\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoNullableNonNullEnumListChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let enumListArg: [AnEnum]? = nilOrValue(args[0]) + do { + let result = try api.echoNullableNonNull(enumList: enumListArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoNullableNonNullEnumListChannel.setMessageHandler(nil) + } + /// Returns the passed list, to test serialization and deserialization. + let echoNullableNonNullClassListChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableNonNullClassList\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoNullableNonNullClassListChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let classListArg: [AllNullableTypes]? = nilOrValue(args[0]) + do { + let result = try api.echoNullableNonNull(classList: classListArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoNullableNonNullClassListChannel.setMessageHandler(nil) + } + /// Returns the passed map, to test serialization and deserialization. + let echoNullableMapChannel = FlutterBasicMessageChannel( name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableMap\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoNullableMapChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let aNullableMapArg: [String?: Any?]? = nilOrValue(args[0]) + let mapArg: [AnyHashable?: Any?]? = nilOrValue(args[0]) do { - let result = try api.echoNullable(aNullableMapArg) + let result = try api.echoNullable(mapArg) reply(wrapResult(result)) } catch { reply(wrapError(error)) @@ -1430,6 +2021,158 @@ class HostIntegrationCoreApiSetup { } else { echoNullableMapChannel.setMessageHandler(nil) } + /// Returns the passed map, to test serialization and deserialization. + let echoNullableStringMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableStringMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoNullableStringMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let stringMapArg: [String?: String?]? = nilOrValue(args[0]) + do { + let result = try api.echoNullable(stringMap: stringMapArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoNullableStringMapChannel.setMessageHandler(nil) + } + /// Returns the passed map, to test serialization and deserialization. + let echoNullableIntMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableIntMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoNullableIntMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let intMapArg: [Int64?: Int64?]? = nilOrValue(args[0]) + do { + let result = try api.echoNullable(intMap: intMapArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoNullableIntMapChannel.setMessageHandler(nil) + } + /// Returns the passed map, to test serialization and deserialization. + let echoNullableEnumMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableEnumMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoNullableEnumMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let enumMapArg: [AnEnum?: AnEnum?]? = args[0] as? [AnEnum?: AnEnum?] + do { + let result = try api.echoNullable(enumMap: enumMapArg!) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoNullableEnumMapChannel.setMessageHandler(nil) + } + /// Returns the passed map, to test serialization and deserialization. + let echoNullableClassMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableClassMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoNullableClassMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let classMapArg: [Int64?: AllNullableTypes?]? = nilOrValue(args[0]) + do { + let result = try api.echoNullable(classMap: classMapArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoNullableClassMapChannel.setMessageHandler(nil) + } + /// Returns the passed map, to test serialization and deserialization. + let echoNullableNonNullStringMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableNonNullStringMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoNullableNonNullStringMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let stringMapArg: [String: String]? = nilOrValue(args[0]) + do { + let result = try api.echoNullableNonNull(stringMap: stringMapArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoNullableNonNullStringMapChannel.setMessageHandler(nil) + } + /// Returns the passed map, to test serialization and deserialization. + let echoNullableNonNullIntMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableNonNullIntMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoNullableNonNullIntMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let intMapArg: [Int64: Int64]? = nilOrValue(args[0]) + do { + let result = try api.echoNullableNonNull(intMap: intMapArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoNullableNonNullIntMapChannel.setMessageHandler(nil) + } + /// Returns the passed map, to test serialization and deserialization. + let echoNullableNonNullEnumMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableNonNullEnumMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoNullableNonNullEnumMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let enumMapArg: [AnEnum: AnEnum]? = args[0] as? [AnEnum: AnEnum] + do { + let result = try api.echoNullableNonNull(enumMap: enumMapArg!) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoNullableNonNullEnumMapChannel.setMessageHandler(nil) + } + /// Returns the passed map, to test serialization and deserialization. + let echoNullableNonNullClassMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableNonNullClassMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoNullableNonNullClassMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let classMapArg: [Int64: AllNullableTypes]? = nilOrValue(args[0]) + do { + let result = try api.echoNullableNonNull(classMap: classMapArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoNullableNonNullClassMapChannel.setMessageHandler(nil) + } let echoNullableEnumChannel = FlutterBasicMessageChannel( name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableEnum\(channelSuffix)", @@ -1474,9 +2217,7 @@ class HostIntegrationCoreApiSetup { if let api = api { echoOptionalNullableIntChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let aNullableIntArg: Int64? = - isNullish(args[0]) - ? nil : (args[0] is Int64? ? args[0] as! Int64? : Int64(args[0] as! Int32)) + let aNullableIntArg: Int64? = nilOrValue(args[0]) do { let result = try api.echoOptional(aNullableIntArg) reply(wrapResult(result)) @@ -1534,7 +2275,7 @@ class HostIntegrationCoreApiSetup { if let api = api { echoAsyncIntChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let anIntArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) + let anIntArg = args[0] as! Int64 api.echoAsync(anIntArg) { result in switch result { case .success(let res): @@ -1673,6 +2414,48 @@ class HostIntegrationCoreApiSetup { } else { echoAsyncListChannel.setMessageHandler(nil) } + /// Returns the passed list, to test asynchronous serialization and deserialization. + let echoAsyncEnumListChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncEnumList\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoAsyncEnumListChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let enumListArg = args[0] as! [AnEnum?] + api.echoAsync(enumList: enumListArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + echoAsyncEnumListChannel.setMessageHandler(nil) + } + /// Returns the passed list, to test asynchronous serialization and deserialization. + let echoAsyncClassListChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncClassList\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoAsyncClassListChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let classListArg = args[0] as! [AllNullableTypes?] + api.echoAsync(classList: classListArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + echoAsyncClassListChannel.setMessageHandler(nil) + } /// Returns the passed map, to test asynchronous serialization and deserialization. let echoAsyncMapChannel = FlutterBasicMessageChannel( name: @@ -1681,8 +2464,8 @@ class HostIntegrationCoreApiSetup { if let api = api { echoAsyncMapChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let aMapArg = args[0] as! [String?: Any?] - api.echoAsync(aMapArg) { result in + let mapArg = args[0] as! [AnyHashable?: Any?] + api.echoAsync(mapArg) { result in switch result { case .success(let res): reply(wrapResult(res)) @@ -1694,6 +2477,90 @@ class HostIntegrationCoreApiSetup { } else { echoAsyncMapChannel.setMessageHandler(nil) } + /// Returns the passed map, to test asynchronous serialization and deserialization. + let echoAsyncStringMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncStringMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoAsyncStringMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let stringMapArg = args[0] as! [String?: String?] + api.echoAsync(stringMap: stringMapArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + echoAsyncStringMapChannel.setMessageHandler(nil) + } + /// Returns the passed map, to test asynchronous serialization and deserialization. + let echoAsyncIntMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncIntMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoAsyncIntMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let intMapArg = args[0] as! [Int64?: Int64?] + api.echoAsync(intMap: intMapArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + echoAsyncIntMapChannel.setMessageHandler(nil) + } + /// Returns the passed map, to test asynchronous serialization and deserialization. + let echoAsyncEnumMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncEnumMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoAsyncEnumMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let enumMapArg = args[0] as? [AnEnum?: AnEnum?] + api.echoAsync(enumMap: enumMapArg!) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + echoAsyncEnumMapChannel.setMessageHandler(nil) + } + /// Returns the passed map, to test asynchronous serialization and deserialization. + let echoAsyncClassMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncClassMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoAsyncClassMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let classMapArg = args[0] as! [Int64?: AllNullableTypes?] + api.echoAsync(classMap: classMapArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + echoAsyncClassMapChannel.setMessageHandler(nil) + } /// Returns the passed enum, to test asynchronous serialization and deserialization. let echoAsyncEnumChannel = FlutterBasicMessageChannel( name: @@ -1864,9 +2731,7 @@ class HostIntegrationCoreApiSetup { if let api = api { echoAsyncNullableIntChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let anIntArg: Int64? = - isNullish(args[0]) - ? nil : (args[0] is Int64? ? args[0] as! Int64? : Int64(args[0] as! Int32)) + let anIntArg: Int64? = nilOrValue(args[0]) api.echoAsyncNullable(anIntArg) { result in switch result { case .success(let res): @@ -2005,16 +2870,16 @@ class HostIntegrationCoreApiSetup { } else { echoAsyncNullableListChannel.setMessageHandler(nil) } - /// Returns the passed map, to test asynchronous serialization and deserialization. - let echoAsyncNullableMapChannel = FlutterBasicMessageChannel( + /// Returns the passed list, to test asynchronous serialization and deserialization. + let echoAsyncNullableEnumListChannel = FlutterBasicMessageChannel( name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableMap\(channelSuffix)", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableEnumList\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { - echoAsyncNullableMapChannel.setMessageHandler { message, reply in + echoAsyncNullableEnumListChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let aMapArg: [String?: Any?]? = nilOrValue(args[0]) - api.echoAsyncNullable(aMapArg) { result in + let enumListArg: [AnEnum?]? = nilOrValue(args[0]) + api.echoAsyncNullable(enumList: enumListArg) { result in switch result { case .success(let res): reply(wrapResult(res)) @@ -2024,10 +2889,136 @@ class HostIntegrationCoreApiSetup { } } } else { - echoAsyncNullableMapChannel.setMessageHandler(nil) + echoAsyncNullableEnumListChannel.setMessageHandler(nil) } - /// Returns the passed enum, to test asynchronous serialization and deserialization. - let echoAsyncNullableEnumChannel = FlutterBasicMessageChannel( + /// Returns the passed list, to test asynchronous serialization and deserialization. + let echoAsyncNullableClassListChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableClassList\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoAsyncNullableClassListChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let classListArg: [AllNullableTypes?]? = nilOrValue(args[0]) + api.echoAsyncNullable(classList: classListArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + echoAsyncNullableClassListChannel.setMessageHandler(nil) + } + /// Returns the passed map, to test asynchronous serialization and deserialization. + let echoAsyncNullableMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoAsyncNullableMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let mapArg: [AnyHashable?: Any?]? = nilOrValue(args[0]) + api.echoAsyncNullable(mapArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + echoAsyncNullableMapChannel.setMessageHandler(nil) + } + /// Returns the passed map, to test asynchronous serialization and deserialization. + let echoAsyncNullableStringMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableStringMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoAsyncNullableStringMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let stringMapArg: [String?: String?]? = nilOrValue(args[0]) + api.echoAsyncNullable(stringMap: stringMapArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + echoAsyncNullableStringMapChannel.setMessageHandler(nil) + } + /// Returns the passed map, to test asynchronous serialization and deserialization. + let echoAsyncNullableIntMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableIntMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoAsyncNullableIntMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let intMapArg: [Int64?: Int64?]? = nilOrValue(args[0]) + api.echoAsyncNullable(intMap: intMapArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + echoAsyncNullableIntMapChannel.setMessageHandler(nil) + } + /// Returns the passed map, to test asynchronous serialization and deserialization. + let echoAsyncNullableEnumMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableEnumMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoAsyncNullableEnumMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let enumMapArg: [AnEnum?: AnEnum?]? = args[0] as? [AnEnum?: AnEnum?] + api.echoAsyncNullable(enumMap: enumMapArg!) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + echoAsyncNullableEnumMapChannel.setMessageHandler(nil) + } + /// Returns the passed map, to test asynchronous serialization and deserialization. + let echoAsyncNullableClassMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableClassMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoAsyncNullableClassMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let classMapArg: [Int64?: AllNullableTypes?]? = nilOrValue(args[0]) + api.echoAsyncNullable(classMap: classMapArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + echoAsyncNullableClassMapChannel.setMessageHandler(nil) + } + /// Returns the passed enum, to test asynchronous serialization and deserialization. + let echoAsyncNullableEnumChannel = FlutterBasicMessageChannel( name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableEnum\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) @@ -2170,9 +3161,7 @@ class HostIntegrationCoreApiSetup { callFlutterSendMultipleNullableTypesChannel.setMessageHandler { message, reply in let args = message as! [Any?] let aNullableBoolArg: Bool? = nilOrValue(args[0]) - let aNullableIntArg: Int64? = - isNullish(args[1]) - ? nil : (args[1] is Int64? ? args[1] as! Int64? : Int64(args[1] as! Int32)) + let aNullableIntArg: Int64? = nilOrValue(args[1]) let aNullableStringArg: String? = nilOrValue(args[2]) api.callFlutterSendMultipleNullableTypes( aBool: aNullableBoolArg, anInt: aNullableIntArg, aString: aNullableStringArg @@ -2217,9 +3206,7 @@ class HostIntegrationCoreApiSetup { message, reply in let args = message as! [Any?] let aNullableBoolArg: Bool? = nilOrValue(args[0]) - let aNullableIntArg: Int64? = - isNullish(args[1]) - ? nil : (args[1] is Int64? ? args[1] as! Int64? : Int64(args[1] as! Int32)) + let aNullableIntArg: Int64? = nilOrValue(args[1]) let aNullableStringArg: String? = nilOrValue(args[2]) api.callFlutterSendMultipleNullableTypesWithoutRecursion( aBool: aNullableBoolArg, anInt: aNullableIntArg, aString: aNullableStringArg @@ -2262,7 +3249,7 @@ class HostIntegrationCoreApiSetup { if let api = api { callFlutterEchoIntChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let anIntArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32) + let anIntArg = args[0] as! Int64 api.callFlutterEcho(anIntArg) { result in switch result { case .success(let res): @@ -2355,6 +3342,86 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoListChannel.setMessageHandler(nil) } + let callFlutterEchoEnumListChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoEnumList\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoEnumListChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let enumListArg = args[0] as! [AnEnum?] + api.callFlutterEcho(enumList: enumListArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoEnumListChannel.setMessageHandler(nil) + } + let callFlutterEchoClassListChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoClassList\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoClassListChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let classListArg = args[0] as! [AllNullableTypes?] + api.callFlutterEcho(classList: classListArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoClassListChannel.setMessageHandler(nil) + } + let callFlutterEchoNonNullEnumListChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNonNullEnumList\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoNonNullEnumListChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let enumListArg = args[0] as! [AnEnum] + api.callFlutterEchoNonNull(enumList: enumListArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoNonNullEnumListChannel.setMessageHandler(nil) + } + let callFlutterEchoNonNullClassListChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNonNullClassList\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoNonNullClassListChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let classListArg = args[0] as! [AllNullableTypes] + api.callFlutterEchoNonNull(classList: classListArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoNonNullClassListChannel.setMessageHandler(nil) + } let callFlutterEchoMapChannel = FlutterBasicMessageChannel( name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoMap\(channelSuffix)", @@ -2362,8 +3429,8 @@ class HostIntegrationCoreApiSetup { if let api = api { callFlutterEchoMapChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let aMapArg = args[0] as! [String?: Any?] - api.callFlutterEcho(aMapArg) { result in + let mapArg = args[0] as! [AnyHashable?: Any?] + api.callFlutterEcho(mapArg) { result in switch result { case .success(let res): reply(wrapResult(res)) @@ -2375,15 +3442,15 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoMapChannel.setMessageHandler(nil) } - let callFlutterEchoEnumChannel = FlutterBasicMessageChannel( + let callFlutterEchoStringMapChannel = FlutterBasicMessageChannel( name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoEnum\(channelSuffix)", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoStringMap\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { - callFlutterEchoEnumChannel.setMessageHandler { message, reply in + callFlutterEchoStringMapChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let anEnumArg = args[0] as! AnEnum - api.callFlutterEcho(anEnumArg) { result in + let stringMapArg = args[0] as! [String?: String?] + api.callFlutterEcho(stringMap: stringMapArg) { result in switch result { case .success(let res): reply(wrapResult(res)) @@ -2393,17 +3460,17 @@ class HostIntegrationCoreApiSetup { } } } else { - callFlutterEchoEnumChannel.setMessageHandler(nil) + callFlutterEchoStringMapChannel.setMessageHandler(nil) } - let callFlutterEchoAnotherEnumChannel = FlutterBasicMessageChannel( + let callFlutterEchoIntMapChannel = FlutterBasicMessageChannel( name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAnotherEnum\(channelSuffix)", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoIntMap\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { - callFlutterEchoAnotherEnumChannel.setMessageHandler { message, reply in + callFlutterEchoIntMapChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let anotherEnumArg = args[0] as! AnotherEnum - api.callFlutterEcho(anotherEnumArg) { result in + let intMapArg = args[0] as! [Int64?: Int64?] + api.callFlutterEcho(intMap: intMapArg) { result in switch result { case .success(let res): reply(wrapResult(res)) @@ -2413,17 +3480,17 @@ class HostIntegrationCoreApiSetup { } } } else { - callFlutterEchoAnotherEnumChannel.setMessageHandler(nil) + callFlutterEchoIntMapChannel.setMessageHandler(nil) } - let callFlutterEchoNullableBoolChannel = FlutterBasicMessageChannel( + let callFlutterEchoEnumMapChannel = FlutterBasicMessageChannel( name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableBool\(channelSuffix)", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoEnumMap\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { - callFlutterEchoNullableBoolChannel.setMessageHandler { message, reply in + callFlutterEchoEnumMapChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let aBoolArg: Bool? = nilOrValue(args[0]) - api.callFlutterEchoNullable(aBoolArg) { result in + let enumMapArg = args[0] as? [AnEnum?: AnEnum?] + api.callFlutterEcho(enumMap: enumMapArg!) { result in switch result { case .success(let res): reply(wrapResult(res)) @@ -2433,19 +3500,17 @@ class HostIntegrationCoreApiSetup { } } } else { - callFlutterEchoNullableBoolChannel.setMessageHandler(nil) + callFlutterEchoEnumMapChannel.setMessageHandler(nil) } - let callFlutterEchoNullableIntChannel = FlutterBasicMessageChannel( + let callFlutterEchoClassMapChannel = FlutterBasicMessageChannel( name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableInt\(channelSuffix)", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoClassMap\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { - callFlutterEchoNullableIntChannel.setMessageHandler { message, reply in + callFlutterEchoClassMapChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let anIntArg: Int64? = - isNullish(args[0]) - ? nil : (args[0] is Int64? ? args[0] as! Int64? : Int64(args[0] as! Int32)) - api.callFlutterEchoNullable(anIntArg) { result in + let classMapArg = args[0] as! [Int64?: AllNullableTypes?] + api.callFlutterEcho(classMap: classMapArg) { result in switch result { case .success(let res): reply(wrapResult(res)) @@ -2455,17 +3520,17 @@ class HostIntegrationCoreApiSetup { } } } else { - callFlutterEchoNullableIntChannel.setMessageHandler(nil) + callFlutterEchoClassMapChannel.setMessageHandler(nil) } - let callFlutterEchoNullableDoubleChannel = FlutterBasicMessageChannel( + let callFlutterEchoNonNullStringMapChannel = FlutterBasicMessageChannel( name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableDouble\(channelSuffix)", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNonNullStringMap\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { - callFlutterEchoNullableDoubleChannel.setMessageHandler { message, reply in + callFlutterEchoNonNullStringMapChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let aDoubleArg: Double? = nilOrValue(args[0]) - api.callFlutterEchoNullable(aDoubleArg) { result in + let stringMapArg = args[0] as! [String: String] + api.callFlutterEchoNonNull(stringMap: stringMapArg) { result in switch result { case .success(let res): reply(wrapResult(res)) @@ -2475,17 +3540,17 @@ class HostIntegrationCoreApiSetup { } } } else { - callFlutterEchoNullableDoubleChannel.setMessageHandler(nil) + callFlutterEchoNonNullStringMapChannel.setMessageHandler(nil) } - let callFlutterEchoNullableStringChannel = FlutterBasicMessageChannel( + let callFlutterEchoNonNullIntMapChannel = FlutterBasicMessageChannel( name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableString\(channelSuffix)", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNonNullIntMap\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { - callFlutterEchoNullableStringChannel.setMessageHandler { message, reply in + callFlutterEchoNonNullIntMapChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let aStringArg: String? = nilOrValue(args[0]) - api.callFlutterEchoNullable(aStringArg) { result in + let intMapArg = args[0] as! [Int64: Int64] + api.callFlutterEchoNonNull(intMap: intMapArg) { result in switch result { case .success(let res): reply(wrapResult(res)) @@ -2495,17 +3560,17 @@ class HostIntegrationCoreApiSetup { } } } else { - callFlutterEchoNullableStringChannel.setMessageHandler(nil) + callFlutterEchoNonNullIntMapChannel.setMessageHandler(nil) } - let callFlutterEchoNullableUint8ListChannel = FlutterBasicMessageChannel( + let callFlutterEchoNonNullEnumMapChannel = FlutterBasicMessageChannel( name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableUint8List\(channelSuffix)", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNonNullEnumMap\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { - callFlutterEchoNullableUint8ListChannel.setMessageHandler { message, reply in + callFlutterEchoNonNullEnumMapChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let listArg: FlutterStandardTypedData? = nilOrValue(args[0]) - api.callFlutterEchoNullable(listArg) { result in + let enumMapArg = args[0] as? [AnEnum: AnEnum] + api.callFlutterEchoNonNull(enumMap: enumMapArg!) { result in switch result { case .success(let res): reply(wrapResult(res)) @@ -2515,17 +3580,17 @@ class HostIntegrationCoreApiSetup { } } } else { - callFlutterEchoNullableUint8ListChannel.setMessageHandler(nil) + callFlutterEchoNonNullEnumMapChannel.setMessageHandler(nil) } - let callFlutterEchoNullableListChannel = FlutterBasicMessageChannel( + let callFlutterEchoNonNullClassMapChannel = FlutterBasicMessageChannel( name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableList\(channelSuffix)", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNonNullClassMap\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { - callFlutterEchoNullableListChannel.setMessageHandler { message, reply in + callFlutterEchoNonNullClassMapChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let listArg: [Any?]? = nilOrValue(args[0]) - api.callFlutterEchoNullable(listArg) { result in + let classMapArg = args[0] as! [Int64: AllNullableTypes] + api.callFlutterEchoNonNull(classMap: classMapArg) { result in switch result { case .success(let res): reply(wrapResult(res)) @@ -2535,17 +3600,17 @@ class HostIntegrationCoreApiSetup { } } } else { - callFlutterEchoNullableListChannel.setMessageHandler(nil) + callFlutterEchoNonNullClassMapChannel.setMessageHandler(nil) } - let callFlutterEchoNullableMapChannel = FlutterBasicMessageChannel( + let callFlutterEchoEnumChannel = FlutterBasicMessageChannel( name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableMap\(channelSuffix)", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoEnum\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { - callFlutterEchoNullableMapChannel.setMessageHandler { message, reply in + callFlutterEchoEnumChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let aMapArg: [String?: Any?]? = nilOrValue(args[0]) - api.callFlutterEchoNullable(aMapArg) { result in + let anEnumArg = args[0] as! AnEnum + api.callFlutterEcho(anEnumArg) { result in switch result { case .success(let res): reply(wrapResult(res)) @@ -2555,17 +3620,17 @@ class HostIntegrationCoreApiSetup { } } } else { - callFlutterEchoNullableMapChannel.setMessageHandler(nil) + callFlutterEchoEnumChannel.setMessageHandler(nil) } - let callFlutterEchoNullableEnumChannel = FlutterBasicMessageChannel( + let callFlutterEchoAnotherEnumChannel = FlutterBasicMessageChannel( name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableEnum\(channelSuffix)", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAnotherEnum\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { - callFlutterEchoNullableEnumChannel.setMessageHandler { message, reply in + callFlutterEchoAnotherEnumChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let anEnumArg: AnEnum? = nilOrValue(args[0]) - api.callFlutterEchoNullable(anEnumArg) { result in + let anotherEnumArg = args[0] as! AnotherEnum + api.callFlutterEcho(anotherEnumArg) { result in switch result { case .success(let res): reply(wrapResult(res)) @@ -2575,17 +3640,17 @@ class HostIntegrationCoreApiSetup { } } } else { - callFlutterEchoNullableEnumChannel.setMessageHandler(nil) + callFlutterEchoAnotherEnumChannel.setMessageHandler(nil) } - let callFlutterEchoAnotherNullableEnumChannel = FlutterBasicMessageChannel( + let callFlutterEchoNullableBoolChannel = FlutterBasicMessageChannel( name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAnotherNullableEnum\(channelSuffix)", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableBool\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { - callFlutterEchoAnotherNullableEnumChannel.setMessageHandler { message, reply in + callFlutterEchoNullableBoolChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let anotherEnumArg: AnotherEnum? = nilOrValue(args[0]) - api.callFlutterEchoNullable(anotherEnumArg) { result in + let aBoolArg: Bool? = nilOrValue(args[0]) + api.callFlutterEchoNullable(aBoolArg) { result in switch result { case .success(let res): reply(wrapResult(res)) @@ -2595,17 +3660,17 @@ class HostIntegrationCoreApiSetup { } } } else { - callFlutterEchoAnotherNullableEnumChannel.setMessageHandler(nil) + callFlutterEchoNullableBoolChannel.setMessageHandler(nil) } - let callFlutterSmallApiEchoStringChannel = FlutterBasicMessageChannel( + let callFlutterEchoNullableIntChannel = FlutterBasicMessageChannel( name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSmallApiEchoString\(channelSuffix)", + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableInt\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { - callFlutterSmallApiEchoStringChannel.setMessageHandler { message, reply in + callFlutterEchoNullableIntChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let aStringArg = args[0] as! String - api.callFlutterSmallApiEcho(aStringArg) { result in + let anIntArg: Int64? = nilOrValue(args[0]) + api.callFlutterEchoNullable(anIntArg) { result in switch result { case .success(let res): reply(wrapResult(res)) @@ -2615,122 +3680,1156 @@ class HostIntegrationCoreApiSetup { } } } else { - callFlutterSmallApiEchoStringChannel.setMessageHandler(nil) + callFlutterEchoNullableIntChannel.setMessageHandler(nil) } - } -} -/// The core interface that the Dart platform_test code implements for host -/// integration tests to call into. -/// -/// Generated protocol from Pigeon that represents Flutter messages that can be called from Swift. -protocol FlutterIntegrationCoreApiProtocol { - /// A no-op function taking no arguments and returning no value, to sanity - /// test basic calling. - func noop(completion: @escaping (Result) -> Void) - /// Responds with an error from an async function returning a value. - func throwError(completion: @escaping (Result) -> Void) - /// Responds with an error from an async void function. + let callFlutterEchoNullableDoubleChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableDouble\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoNullableDoubleChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let aDoubleArg: Double? = nilOrValue(args[0]) + api.callFlutterEchoNullable(aDoubleArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoNullableDoubleChannel.setMessageHandler(nil) + } + let callFlutterEchoNullableStringChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableString\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoNullableStringChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let aStringArg: String? = nilOrValue(args[0]) + api.callFlutterEchoNullable(aStringArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoNullableStringChannel.setMessageHandler(nil) + } + let callFlutterEchoNullableUint8ListChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableUint8List\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoNullableUint8ListChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let listArg: FlutterStandardTypedData? = nilOrValue(args[0]) + api.callFlutterEchoNullable(listArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoNullableUint8ListChannel.setMessageHandler(nil) + } + let callFlutterEchoNullableListChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableList\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoNullableListChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let listArg: [Any?]? = nilOrValue(args[0]) + api.callFlutterEchoNullable(listArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoNullableListChannel.setMessageHandler(nil) + } + let callFlutterEchoNullableEnumListChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableEnumList\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoNullableEnumListChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let enumListArg: [AnEnum?]? = nilOrValue(args[0]) + api.callFlutterEchoNullable(enumList: enumListArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoNullableEnumListChannel.setMessageHandler(nil) + } + let callFlutterEchoNullableClassListChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableClassList\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoNullableClassListChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let classListArg: [AllNullableTypes?]? = nilOrValue(args[0]) + api.callFlutterEchoNullable(classList: classListArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoNullableClassListChannel.setMessageHandler(nil) + } + let callFlutterEchoNullableNonNullEnumListChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableNonNullEnumList\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoNullableNonNullEnumListChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let enumListArg: [AnEnum]? = nilOrValue(args[0]) + api.callFlutterEchoNullableNonNull(enumList: enumListArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoNullableNonNullEnumListChannel.setMessageHandler(nil) + } + let callFlutterEchoNullableNonNullClassListChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableNonNullClassList\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoNullableNonNullClassListChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let classListArg: [AllNullableTypes]? = nilOrValue(args[0]) + api.callFlutterEchoNullableNonNull(classList: classListArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoNullableNonNullClassListChannel.setMessageHandler(nil) + } + let callFlutterEchoNullableMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoNullableMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let mapArg: [AnyHashable?: Any?]? = nilOrValue(args[0]) + api.callFlutterEchoNullable(mapArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoNullableMapChannel.setMessageHandler(nil) + } + let callFlutterEchoNullableStringMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableStringMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoNullableStringMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let stringMapArg: [String?: String?]? = nilOrValue(args[0]) + api.callFlutterEchoNullable(stringMap: stringMapArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoNullableStringMapChannel.setMessageHandler(nil) + } + let callFlutterEchoNullableIntMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableIntMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoNullableIntMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let intMapArg: [Int64?: Int64?]? = nilOrValue(args[0]) + api.callFlutterEchoNullable(intMap: intMapArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoNullableIntMapChannel.setMessageHandler(nil) + } + let callFlutterEchoNullableEnumMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableEnumMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoNullableEnumMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let enumMapArg: [AnEnum?: AnEnum?]? = args[0] as? [AnEnum?: AnEnum?] + api.callFlutterEchoNullable(enumMap: enumMapArg!) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoNullableEnumMapChannel.setMessageHandler(nil) + } + let callFlutterEchoNullableClassMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableClassMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoNullableClassMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let classMapArg: [Int64?: AllNullableTypes?]? = nilOrValue(args[0]) + api.callFlutterEchoNullable(classMap: classMapArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoNullableClassMapChannel.setMessageHandler(nil) + } + let callFlutterEchoNullableNonNullStringMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableNonNullStringMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoNullableNonNullStringMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let stringMapArg: [String: String]? = nilOrValue(args[0]) + api.callFlutterEchoNullableNonNull(stringMap: stringMapArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoNullableNonNullStringMapChannel.setMessageHandler(nil) + } + let callFlutterEchoNullableNonNullIntMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableNonNullIntMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoNullableNonNullIntMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let intMapArg: [Int64: Int64]? = nilOrValue(args[0]) + api.callFlutterEchoNullableNonNull(intMap: intMapArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoNullableNonNullIntMapChannel.setMessageHandler(nil) + } + let callFlutterEchoNullableNonNullEnumMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableNonNullEnumMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoNullableNonNullEnumMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let enumMapArg: [AnEnum: AnEnum]? = args[0] as? [AnEnum: AnEnum] + api.callFlutterEchoNullableNonNull(enumMap: enumMapArg!) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoNullableNonNullEnumMapChannel.setMessageHandler(nil) + } + let callFlutterEchoNullableNonNullClassMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableNonNullClassMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoNullableNonNullClassMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let classMapArg: [Int64: AllNullableTypes]? = nilOrValue(args[0]) + api.callFlutterEchoNullableNonNull(classMap: classMapArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoNullableNonNullClassMapChannel.setMessageHandler(nil) + } + let callFlutterEchoNullableEnumChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableEnum\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoNullableEnumChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let anEnumArg: AnEnum? = nilOrValue(args[0]) + api.callFlutterEchoNullable(anEnumArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoNullableEnumChannel.setMessageHandler(nil) + } + let callFlutterEchoAnotherNullableEnumChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAnotherNullableEnum\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoAnotherNullableEnumChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let anotherEnumArg: AnotherEnum? = nilOrValue(args[0]) + api.callFlutterEchoNullable(anotherEnumArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoAnotherNullableEnumChannel.setMessageHandler(nil) + } + let callFlutterSmallApiEchoStringChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSmallApiEchoString\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterSmallApiEchoStringChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let aStringArg = args[0] as! String + api.callFlutterSmallApiEcho(aStringArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterSmallApiEchoStringChannel.setMessageHandler(nil) + } + } +} +/// The core interface that the Dart platform_test code implements for host +/// integration tests to call into. +/// +/// Generated protocol from Pigeon that represents Flutter messages that can be called from Swift. +protocol FlutterIntegrationCoreApiProtocol { + /// A no-op function taking no arguments and returning no value, to sanity + /// test basic calling. + func noop(completion: @escaping (Result) -> Void) + /// Responds with an error from an async function returning a value. + func throwError(completion: @escaping (Result) -> Void) + /// Responds with an error from an async void function. func throwErrorFromVoid(completion: @escaping (Result) -> Void) /// Returns the passed object, to test serialization and deserialization. func echo( - _ everythingArg: AllTypes, completion: @escaping (Result) -> Void) + _ everythingArg: AllTypes, completion: @escaping (Result) -> Void) + /// Returns the passed object, to test serialization and deserialization. + func echoNullable( + _ everythingArg: AllNullableTypes?, + completion: @escaping (Result) -> Void) + /// Returns passed in arguments of multiple types. + /// + /// Tests multiple-arity FlutterApi handling. + func sendMultipleNullableTypes( + aBool aNullableBoolArg: Bool?, anInt aNullableIntArg: Int64?, + aString aNullableStringArg: String?, + completion: @escaping (Result) -> Void) + /// Returns the passed object, to test serialization and deserialization. + func echoNullable( + _ everythingArg: AllNullableTypesWithoutRecursion?, + completion: @escaping (Result) -> Void) + /// Returns passed in arguments of multiple types. + /// + /// Tests multiple-arity FlutterApi handling. + func sendMultipleNullableTypesWithoutRecursion( + aBool aNullableBoolArg: Bool?, anInt aNullableIntArg: Int64?, + aString aNullableStringArg: String?, + completion: @escaping (Result) -> Void) + /// Returns the passed boolean, to test serialization and deserialization. + func echo(_ aBoolArg: Bool, completion: @escaping (Result) -> Void) + /// Returns the passed int, to test serialization and deserialization. + func echo(_ anIntArg: Int64, completion: @escaping (Result) -> Void) + /// Returns the passed double, to test serialization and deserialization. + func echo(_ aDoubleArg: Double, completion: @escaping (Result) -> Void) + /// Returns the passed string, to test serialization and deserialization. + func echo(_ aStringArg: String, completion: @escaping (Result) -> Void) + /// Returns the passed byte list, to test serialization and deserialization. + func echo( + _ listArg: FlutterStandardTypedData, + completion: @escaping (Result) -> Void) + /// Returns the passed list, to test serialization and deserialization. + func echo(_ listArg: [Any?], completion: @escaping (Result<[Any?], PigeonError>) -> Void) + /// Returns the passed list, to test serialization and deserialization. + func echo( + enumList enumListArg: [AnEnum?], completion: @escaping (Result<[AnEnum?], PigeonError>) -> Void) + /// Returns the passed list, to test serialization and deserialization. + func echo( + classList classListArg: [AllNullableTypes?], + completion: @escaping (Result<[AllNullableTypes?], PigeonError>) -> Void) + /// Returns the passed list, to test serialization and deserialization. + func echoNonNull( + enumList enumListArg: [AnEnum], completion: @escaping (Result<[AnEnum], PigeonError>) -> Void) + /// Returns the passed list, to test serialization and deserialization. + func echoNonNull( + classList classListArg: [AllNullableTypes], + completion: @escaping (Result<[AllNullableTypes], PigeonError>) -> Void) + /// Returns the passed map, to test serialization and deserialization. + func echo( + _ mapArg: [AnyHashable?: Any?], + completion: @escaping (Result<[AnyHashable?: Any?], PigeonError>) -> Void) + /// Returns the passed map, to test serialization and deserialization. + func echo( + stringMap stringMapArg: [String?: String?], + completion: @escaping (Result<[String?: String?], PigeonError>) -> Void) + /// Returns the passed map, to test serialization and deserialization. + func echo( + intMap intMapArg: [Int64?: Int64?], + completion: @escaping (Result<[Int64?: Int64?], PigeonError>) -> Void) + /// Returns the passed map, to test serialization and deserialization. + func echo( + enumMap enumMapArg: [AnEnum?: AnEnum?], + completion: @escaping (Result<[AnEnum?: AnEnum?], PigeonError>) -> Void) + /// Returns the passed map, to test serialization and deserialization. + func echo( + classMap classMapArg: [Int64?: AllNullableTypes?], + completion: @escaping (Result<[Int64?: AllNullableTypes?], PigeonError>) -> Void) + /// Returns the passed map, to test serialization and deserialization. + func echoNonNull( + stringMap stringMapArg: [String: String], + completion: @escaping (Result<[String: String], PigeonError>) -> Void) + /// Returns the passed map, to test serialization and deserialization. + func echoNonNull( + intMap intMapArg: [Int64: Int64], + completion: @escaping (Result<[Int64: Int64], PigeonError>) -> Void) + /// Returns the passed map, to test serialization and deserialization. + func echoNonNull( + enumMap enumMapArg: [AnEnum: AnEnum], + completion: @escaping (Result<[AnEnum: AnEnum], PigeonError>) -> Void) + /// Returns the passed map, to test serialization and deserialization. + func echoNonNull( + classMap classMapArg: [Int64: AllNullableTypes], + completion: @escaping (Result<[Int64: AllNullableTypes], PigeonError>) -> Void) + /// Returns the passed enum to test serialization and deserialization. + func echo(_ anEnumArg: AnEnum, completion: @escaping (Result) -> Void) + /// Returns the passed enum to test serialization and deserialization. + func echo( + _ anotherEnumArg: AnotherEnum, completion: @escaping (Result) -> Void) + /// Returns the passed boolean, to test serialization and deserialization. + func echoNullable(_ aBoolArg: Bool?, completion: @escaping (Result) -> Void) + /// Returns the passed int, to test serialization and deserialization. + func echoNullable(_ anIntArg: Int64?, completion: @escaping (Result) -> Void) + /// Returns the passed double, to test serialization and deserialization. + func echoNullable( + _ aDoubleArg: Double?, completion: @escaping (Result) -> Void) + /// Returns the passed string, to test serialization and deserialization. + func echoNullable( + _ aStringArg: String?, completion: @escaping (Result) -> Void) + /// Returns the passed byte list, to test serialization and deserialization. + func echoNullable( + _ listArg: FlutterStandardTypedData?, + completion: @escaping (Result) -> Void) + /// Returns the passed list, to test serialization and deserialization. + func echoNullable( + _ listArg: [Any?]?, completion: @escaping (Result<[Any?]?, PigeonError>) -> Void) + /// Returns the passed list, to test serialization and deserialization. + func echoNullable( + enumList enumListArg: [AnEnum?]?, + completion: @escaping (Result<[AnEnum?]?, PigeonError>) -> Void) + /// Returns the passed list, to test serialization and deserialization. + func echoNullable( + classList classListArg: [AllNullableTypes?]?, + completion: @escaping (Result<[AllNullableTypes?]?, PigeonError>) -> Void) + /// Returns the passed list, to test serialization and deserialization. + func echoNullableNonNull( + enumList enumListArg: [AnEnum]?, completion: @escaping (Result<[AnEnum]?, PigeonError>) -> Void) + /// Returns the passed list, to test serialization and deserialization. + func echoNullableNonNull( + classList classListArg: [AllNullableTypes]?, + completion: @escaping (Result<[AllNullableTypes]?, PigeonError>) -> Void) + /// Returns the passed map, to test serialization and deserialization. + func echoNullable( + _ mapArg: [AnyHashable?: Any?]?, + completion: @escaping (Result<[AnyHashable?: Any?]?, PigeonError>) -> Void) + /// Returns the passed map, to test serialization and deserialization. + func echoNullable( + stringMap stringMapArg: [String?: String?]?, + completion: @escaping (Result<[String?: String?]?, PigeonError>) -> Void) + /// Returns the passed map, to test serialization and deserialization. + func echoNullable( + intMap intMapArg: [Int64?: Int64?]?, + completion: @escaping (Result<[Int64?: Int64?]?, PigeonError>) -> Void) + /// Returns the passed map, to test serialization and deserialization. + func echoNullable( + enumMap enumMapArg: [AnEnum?: AnEnum?]?, + completion: @escaping (Result<[AnEnum?: AnEnum?]?, PigeonError>) -> Void) + /// Returns the passed map, to test serialization and deserialization. + func echoNullable( + classMap classMapArg: [Int64?: AllNullableTypes?]?, + completion: @escaping (Result<[Int64?: AllNullableTypes?]?, PigeonError>) -> Void) + /// Returns the passed map, to test serialization and deserialization. + func echoNullableNonNull( + stringMap stringMapArg: [String: String]?, + completion: @escaping (Result<[String: String]?, PigeonError>) -> Void) + /// Returns the passed map, to test serialization and deserialization. + func echoNullableNonNull( + intMap intMapArg: [Int64: Int64]?, + completion: @escaping (Result<[Int64: Int64]?, PigeonError>) -> Void) + /// Returns the passed map, to test serialization and deserialization. + func echoNullableNonNull( + enumMap enumMapArg: [AnEnum: AnEnum]?, + completion: @escaping (Result<[AnEnum: AnEnum]?, PigeonError>) -> Void) + /// Returns the passed map, to test serialization and deserialization. + func echoNullableNonNull( + classMap classMapArg: [Int64: AllNullableTypes]?, + completion: @escaping (Result<[Int64: AllNullableTypes]?, PigeonError>) -> Void) + /// Returns the passed enum to test serialization and deserialization. + func echoNullable( + _ anEnumArg: AnEnum?, completion: @escaping (Result) -> Void) + /// Returns the passed enum to test serialization and deserialization. + func echoNullable( + _ anotherEnumArg: AnotherEnum?, + completion: @escaping (Result) -> Void) + /// A no-op function taking no arguments and returning no value, to sanity + /// test basic asynchronous calling. + func noopAsync(completion: @escaping (Result) -> Void) + /// Returns the passed in generic Object asynchronously. + func echoAsync(_ aStringArg: String, completion: @escaping (Result) -> Void) +} +class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { + private let binaryMessenger: FlutterBinaryMessenger + private let messageChannelSuffix: String + init(binaryMessenger: FlutterBinaryMessenger, messageChannelSuffix: String = "") { + self.binaryMessenger = binaryMessenger + self.messageChannelSuffix = messageChannelSuffix.count > 0 ? ".\(messageChannelSuffix)" : "" + } + var codec: CoreTestsPigeonCodec { + return CoreTestsPigeonCodec.shared + } + /// A no-op function taking no arguments and returning no value, to sanity + /// test basic calling. + func noop(completion: @escaping (Result) -> Void) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noop\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage(nil) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(Void())) + } + } + } + /// Responds with an error from an async function returning a value. + func throwError(completion: @escaping (Result) -> Void) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwError\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage(nil) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + let result: Any? = listResponse[0] + completion(.success(result)) + } + } + } + /// Responds with an error from an async void function. + func throwErrorFromVoid(completion: @escaping (Result) -> Void) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwErrorFromVoid\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage(nil) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(Void())) + } + } + } + /// Returns the passed object, to test serialization and deserialization. + func echo( + _ everythingArg: AllTypes, completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllTypes\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([everythingArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else if listResponse[0] == nil { + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) + } else { + let result = listResponse[0] as! AllTypes + completion(.success(result)) + } + } + } /// Returns the passed object, to test serialization and deserialization. func echoNullable( _ everythingArg: AllNullableTypes?, - completion: @escaping (Result) -> Void) + completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypes\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([everythingArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + let result: AllNullableTypes? = nilOrValue(listResponse[0]) + completion(.success(result)) + } + } + } /// Returns passed in arguments of multiple types. /// /// Tests multiple-arity FlutterApi handling. func sendMultipleNullableTypes( aBool aNullableBoolArg: Bool?, anInt aNullableIntArg: Int64?, aString aNullableStringArg: String?, - completion: @escaping (Result) -> Void) + completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypes\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([aNullableBoolArg, aNullableIntArg, aNullableStringArg] as [Any?]) { + response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else if listResponse[0] == nil { + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) + } else { + let result = listResponse[0] as! AllNullableTypes + completion(.success(result)) + } + } + } /// Returns the passed object, to test serialization and deserialization. func echoNullable( _ everythingArg: AllNullableTypesWithoutRecursion?, - completion: @escaping (Result) -> Void) + completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypesWithoutRecursion\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([everythingArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + let result: AllNullableTypesWithoutRecursion? = nilOrValue(listResponse[0]) + completion(.success(result)) + } + } + } /// Returns passed in arguments of multiple types. /// /// Tests multiple-arity FlutterApi handling. func sendMultipleNullableTypesWithoutRecursion( aBool aNullableBoolArg: Bool?, anInt aNullableIntArg: Int64?, aString aNullableStringArg: String?, - completion: @escaping (Result) -> Void) + completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([aNullableBoolArg, aNullableIntArg, aNullableStringArg] as [Any?]) { + response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else if listResponse[0] == nil { + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) + } else { + let result = listResponse[0] as! AllNullableTypesWithoutRecursion + completion(.success(result)) + } + } + } /// Returns the passed boolean, to test serialization and deserialization. - func echo(_ aBoolArg: Bool, completion: @escaping (Result) -> Void) + func echo(_ aBoolArg: Bool, completion: @escaping (Result) -> Void) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoBool\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([aBoolArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else if listResponse[0] == nil { + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) + } else { + let result = listResponse[0] as! Bool + completion(.success(result)) + } + } + } /// Returns the passed int, to test serialization and deserialization. - func echo(_ anIntArg: Int64, completion: @escaping (Result) -> Void) + func echo(_ anIntArg: Int64, completion: @escaping (Result) -> Void) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoInt\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([anIntArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else if listResponse[0] == nil { + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) + } else { + let result = listResponse[0] as! Int64 + completion(.success(result)) + } + } + } /// Returns the passed double, to test serialization and deserialization. - func echo(_ aDoubleArg: Double, completion: @escaping (Result) -> Void) + func echo(_ aDoubleArg: Double, completion: @escaping (Result) -> Void) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoDouble\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([aDoubleArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else if listResponse[0] == nil { + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) + } else { + let result = listResponse[0] as! Double + completion(.success(result)) + } + } + } /// Returns the passed string, to test serialization and deserialization. - func echo(_ aStringArg: String, completion: @escaping (Result) -> Void) + func echo(_ aStringArg: String, completion: @escaping (Result) -> Void) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoString\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([aStringArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else if listResponse[0] == nil { + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) + } else { + let result = listResponse[0] as! String + completion(.success(result)) + } + } + } /// Returns the passed byte list, to test serialization and deserialization. func echo( _ listArg: FlutterStandardTypedData, - completion: @escaping (Result) -> Void) + completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoUint8List\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([listArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else if listResponse[0] == nil { + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) + } else { + let result = listResponse[0] as! FlutterStandardTypedData + completion(.success(result)) + } + } + } + /// Returns the passed list, to test serialization and deserialization. + func echo(_ listArg: [Any?], completion: @escaping (Result<[Any?], PigeonError>) -> Void) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoList\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([listArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else if listResponse[0] == nil { + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) + } else { + let result = listResponse[0] as! [Any?] + completion(.success(result)) + } + } + } + /// Returns the passed list, to test serialization and deserialization. + func echo( + enumList enumListArg: [AnEnum?], completion: @escaping (Result<[AnEnum?], PigeonError>) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnumList\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([enumListArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else if listResponse[0] == nil { + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) + } else { + let result = listResponse[0] as! [AnEnum?] + completion(.success(result)) + } + } + } + /// Returns the passed list, to test serialization and deserialization. + func echo( + classList classListArg: [AllNullableTypes?], + completion: @escaping (Result<[AllNullableTypes?], PigeonError>) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoClassList\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([classListArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else if listResponse[0] == nil { + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) + } else { + let result = listResponse[0] as! [AllNullableTypes?] + completion(.success(result)) + } + } + } /// Returns the passed list, to test serialization and deserialization. - func echo(_ listArg: [Any?], completion: @escaping (Result<[Any?], PigeonError>) -> Void) - /// Returns the passed map, to test serialization and deserialization. - func echo( - _ aMapArg: [String?: Any?], completion: @escaping (Result<[String?: Any?], PigeonError>) -> Void - ) - /// Returns the passed enum to test serialization and deserialization. - func echo(_ anEnumArg: AnEnum, completion: @escaping (Result) -> Void) - /// Returns the passed enum to test serialization and deserialization. - func echo( - _ anotherEnumArg: AnotherEnum, completion: @escaping (Result) -> Void) - /// Returns the passed boolean, to test serialization and deserialization. - func echoNullable(_ aBoolArg: Bool?, completion: @escaping (Result) -> Void) - /// Returns the passed int, to test serialization and deserialization. - func echoNullable(_ anIntArg: Int64?, completion: @escaping (Result) -> Void) - /// Returns the passed double, to test serialization and deserialization. - func echoNullable( - _ aDoubleArg: Double?, completion: @escaping (Result) -> Void) - /// Returns the passed string, to test serialization and deserialization. - func echoNullable( - _ aStringArg: String?, completion: @escaping (Result) -> Void) - /// Returns the passed byte list, to test serialization and deserialization. - func echoNullable( - _ listArg: FlutterStandardTypedData?, - completion: @escaping (Result) -> Void) + func echoNonNull( + enumList enumListArg: [AnEnum], completion: @escaping (Result<[AnEnum], PigeonError>) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNonNullEnumList\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([enumListArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else if listResponse[0] == nil { + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) + } else { + let result = listResponse[0] as! [AnEnum] + completion(.success(result)) + } + } + } /// Returns the passed list, to test serialization and deserialization. - func echoNullable( - _ listArg: [Any?]?, completion: @escaping (Result<[Any?]?, PigeonError>) -> Void) - /// Returns the passed map, to test serialization and deserialization. - func echoNullable( - _ aMapArg: [String?: Any?]?, - completion: @escaping (Result<[String?: Any?]?, PigeonError>) -> Void) - /// Returns the passed enum to test serialization and deserialization. - func echoNullable( - _ anEnumArg: AnEnum?, completion: @escaping (Result) -> Void) - /// Returns the passed enum to test serialization and deserialization. - func echoNullable( - _ anotherEnumArg: AnotherEnum?, - completion: @escaping (Result) -> Void) - /// A no-op function taking no arguments and returning no value, to sanity - /// test basic asynchronous calling. - func noopAsync(completion: @escaping (Result) -> Void) - /// Returns the passed in generic Object asynchronously. - func echoAsync(_ aStringArg: String, completion: @escaping (Result) -> Void) -} -class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { - private let binaryMessenger: FlutterBinaryMessenger - private let messageChannelSuffix: String - init(binaryMessenger: FlutterBinaryMessenger, messageChannelSuffix: String = "") { - self.binaryMessenger = binaryMessenger - self.messageChannelSuffix = messageChannelSuffix.count > 0 ? ".\(messageChannelSuffix)" : "" + func echoNonNull( + classList classListArg: [AllNullableTypes], + completion: @escaping (Result<[AllNullableTypes], PigeonError>) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNonNullClassList\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([classListArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else if listResponse[0] == nil { + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) + } else { + let result = listResponse[0] as! [AllNullableTypes] + completion(.success(result)) + } + } } - var codec: CoreTestsPigeonCodec { - return CoreTestsPigeonCodec.shared + /// Returns the passed map, to test serialization and deserialization. + func echo( + _ mapArg: [AnyHashable?: Any?], + completion: @escaping (Result<[AnyHashable?: Any?], PigeonError>) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoMap\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([mapArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else if listResponse[0] == nil { + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) + } else { + let result = listResponse[0] as! [AnyHashable?: Any?] + completion(.success(result)) + } + } } - /// A no-op function taking no arguments and returning no value, to sanity - /// test basic calling. - func noop(completion: @escaping (Result) -> Void) { + /// Returns the passed map, to test serialization and deserialization. + func echo( + stringMap stringMapArg: [String?: String?], + completion: @escaping (Result<[String?: String?], PigeonError>) -> Void + ) { let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noop\(messageChannelSuffix)" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoStringMap\(messageChannelSuffix)" let channel = FlutterBasicMessageChannel( name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage(nil) { response in + channel.sendMessage([stringMapArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -2740,18 +4839,28 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let message: String? = nilOrValue(listResponse[1]) let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) + } else if listResponse[0] == nil { + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) } else { - completion(.success(Void())) + let result = listResponse[0] as! [String?: String?] + completion(.success(result)) } } } - /// Responds with an error from an async function returning a value. - func throwError(completion: @escaping (Result) -> Void) { + /// Returns the passed map, to test serialization and deserialization. + func echo( + intMap intMapArg: [Int64?: Int64?], + completion: @escaping (Result<[Int64?: Int64?], PigeonError>) -> Void + ) { let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwError\(messageChannelSuffix)" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoIntMap\(messageChannelSuffix)" let channel = FlutterBasicMessageChannel( name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage(nil) { response in + channel.sendMessage([intMapArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -2761,19 +4870,28 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let message: String? = nilOrValue(listResponse[1]) let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) + } else if listResponse[0] == nil { + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) } else { - let result: Any? = listResponse[0] + let result = listResponse[0] as! [Int64?: Int64?] completion(.success(result)) } } } - /// Responds with an error from an async void function. - func throwErrorFromVoid(completion: @escaping (Result) -> Void) { + /// Returns the passed map, to test serialization and deserialization. + func echo( + enumMap enumMapArg: [AnEnum?: AnEnum?], + completion: @escaping (Result<[AnEnum?: AnEnum?], PigeonError>) -> Void + ) { let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwErrorFromVoid\(messageChannelSuffix)" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnumMap\(messageChannelSuffix)" let channel = FlutterBasicMessageChannel( name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage(nil) { response in + channel.sendMessage([enumMapArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -2783,20 +4901,28 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let message: String? = nilOrValue(listResponse[1]) let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) + } else if listResponse[0] == nil { + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) } else { - completion(.success(Void())) + let result = listResponse[0] as? [AnEnum?: AnEnum?] + completion(.success(result!)) } } } - /// Returns the passed object, to test serialization and deserialization. + /// Returns the passed map, to test serialization and deserialization. func echo( - _ everythingArg: AllTypes, completion: @escaping (Result) -> Void + classMap classMapArg: [Int64?: AllNullableTypes?], + completion: @escaping (Result<[Int64?: AllNullableTypes?], PigeonError>) -> Void ) { let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllTypes\(messageChannelSuffix)" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoClassMap\(messageChannelSuffix)" let channel = FlutterBasicMessageChannel( name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([everythingArg] as [Any?]) { response in + channel.sendMessage([classMapArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -2813,21 +4939,52 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) } else { - let result = listResponse[0] as! AllTypes + let result = listResponse[0] as! [Int64?: AllNullableTypes?] completion(.success(result)) } } } - /// Returns the passed object, to test serialization and deserialization. - func echoNullable( - _ everythingArg: AllNullableTypes?, - completion: @escaping (Result) -> Void + /// Returns the passed map, to test serialization and deserialization. + func echoNonNull( + stringMap stringMapArg: [String: String], + completion: @escaping (Result<[String: String], PigeonError>) -> Void ) { let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypes\(messageChannelSuffix)" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNonNullStringMap\(messageChannelSuffix)" let channel = FlutterBasicMessageChannel( name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([everythingArg] as [Any?]) { response in + channel.sendMessage([stringMapArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else if listResponse[0] == nil { + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) + } else { + let result = listResponse[0] as! [String: String] + completion(.success(result)) + } + } + } + /// Returns the passed map, to test serialization and deserialization. + func echoNonNull( + intMap intMapArg: [Int64: Int64], + completion: @escaping (Result<[Int64: Int64], PigeonError>) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNonNullIntMap\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([intMapArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -2837,26 +4994,59 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let message: String? = nilOrValue(listResponse[1]) let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) + } else if listResponse[0] == nil { + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) } else { - let result: AllNullableTypes? = nilOrValue(listResponse[0]) + let result = listResponse[0] as! [Int64: Int64] completion(.success(result)) } } } - /// Returns passed in arguments of multiple types. - /// - /// Tests multiple-arity FlutterApi handling. - func sendMultipleNullableTypes( - aBool aNullableBoolArg: Bool?, anInt aNullableIntArg: Int64?, - aString aNullableStringArg: String?, - completion: @escaping (Result) -> Void + /// Returns the passed map, to test serialization and deserialization. + func echoNonNull( + enumMap enumMapArg: [AnEnum: AnEnum], + completion: @escaping (Result<[AnEnum: AnEnum], PigeonError>) -> Void ) { let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypes\(messageChannelSuffix)" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNonNullEnumMap\(messageChannelSuffix)" let channel = FlutterBasicMessageChannel( name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([aNullableBoolArg, aNullableIntArg, aNullableStringArg] as [Any?]) { - response in + channel.sendMessage([enumMapArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else if listResponse[0] == nil { + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) + } else { + let result = listResponse[0] as? [AnEnum: AnEnum] + completion(.success(result!)) + } + } + } + /// Returns the passed map, to test serialization and deserialization. + func echoNonNull( + classMap classMapArg: [Int64: AllNullableTypes], + completion: @escaping (Result<[Int64: AllNullableTypes], PigeonError>) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNonNullClassMap\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([classMapArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -2873,21 +5063,18 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) } else { - let result = listResponse[0] as! AllNullableTypes + let result = listResponse[0] as! [Int64: AllNullableTypes] completion(.success(result)) } } } - /// Returns the passed object, to test serialization and deserialization. - func echoNullable( - _ everythingArg: AllNullableTypesWithoutRecursion?, - completion: @escaping (Result) -> Void - ) { + /// Returns the passed enum to test serialization and deserialization. + func echo(_ anEnumArg: AnEnum, completion: @escaping (Result) -> Void) { let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypesWithoutRecursion\(messageChannelSuffix)" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnum\(messageChannelSuffix)" let channel = FlutterBasicMessageChannel( name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([everythingArg] as [Any?]) { response in + channel.sendMessage([anEnumArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -2897,26 +5084,27 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let message: String? = nilOrValue(listResponse[1]) let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) + } else if listResponse[0] == nil { + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) } else { - let result: AllNullableTypesWithoutRecursion? = nilOrValue(listResponse[0]) + let result = listResponse[0] as! AnEnum completion(.success(result)) } } } - /// Returns passed in arguments of multiple types. - /// - /// Tests multiple-arity FlutterApi handling. - func sendMultipleNullableTypesWithoutRecursion( - aBool aNullableBoolArg: Bool?, anInt aNullableIntArg: Int64?, - aString aNullableStringArg: String?, - completion: @escaping (Result) -> Void + /// Returns the passed enum to test serialization and deserialization. + func echo( + _ anotherEnumArg: AnotherEnum, completion: @escaping (Result) -> Void ) { let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion\(messageChannelSuffix)" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAnotherEnum\(messageChannelSuffix)" let channel = FlutterBasicMessageChannel( name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([aNullableBoolArg, aNullableIntArg, aNullableStringArg] as [Any?]) { - response in + channel.sendMessage([anotherEnumArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -2933,15 +5121,15 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) } else { - let result = listResponse[0] as! AllNullableTypesWithoutRecursion + let result = listResponse[0] as! AnotherEnum completion(.success(result)) } } } /// Returns the passed boolean, to test serialization and deserialization. - func echo(_ aBoolArg: Bool, completion: @escaping (Result) -> Void) { + func echoNullable(_ aBoolArg: Bool?, completion: @escaping (Result) -> Void) { let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoBool\(messageChannelSuffix)" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableBool\(messageChannelSuffix)" let channel = FlutterBasicMessageChannel( name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([aBoolArg] as [Any?]) { response in @@ -2954,22 +5142,17 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let message: String? = nilOrValue(listResponse[1]) let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) - } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) } else { - let result = listResponse[0] as! Bool + let result: Bool? = nilOrValue(listResponse[0]) completion(.success(result)) } } } /// Returns the passed int, to test serialization and deserialization. - func echo(_ anIntArg: Int64, completion: @escaping (Result) -> Void) { + func echoNullable(_ anIntArg: Int64?, completion: @escaping (Result) -> Void) + { let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoInt\(messageChannelSuffix)" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableInt\(messageChannelSuffix)" let channel = FlutterBasicMessageChannel( name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([anIntArg] as [Any?]) { response in @@ -2982,23 +5165,18 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let message: String? = nilOrValue(listResponse[1]) let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) - } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) } else { - let result = - listResponse[0] is Int64 ? listResponse[0] as! Int64 : Int64(listResponse[0] as! Int32) + let result: Int64? = nilOrValue(listResponse[0]) completion(.success(result)) } } } /// Returns the passed double, to test serialization and deserialization. - func echo(_ aDoubleArg: Double, completion: @escaping (Result) -> Void) { + func echoNullable( + _ aDoubleArg: Double?, completion: @escaping (Result) -> Void + ) { let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoDouble\(messageChannelSuffix)" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableDouble\(messageChannelSuffix)" let channel = FlutterBasicMessageChannel( name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([aDoubleArg] as [Any?]) { response in @@ -3011,22 +5189,18 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let message: String? = nilOrValue(listResponse[1]) let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) - } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) } else { - let result = listResponse[0] as! Double + let result: Double? = nilOrValue(listResponse[0]) completion(.success(result)) } } } /// Returns the passed string, to test serialization and deserialization. - func echo(_ aStringArg: String, completion: @escaping (Result) -> Void) { + func echoNullable( + _ aStringArg: String?, completion: @escaping (Result) -> Void + ) { let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoString\(messageChannelSuffix)" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableString\(messageChannelSuffix)" let channel = FlutterBasicMessageChannel( name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([aStringArg] as [Any?]) { response in @@ -3039,25 +5213,19 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let message: String? = nilOrValue(listResponse[1]) let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) - } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) } else { - let result = listResponse[0] as! String + let result: String? = nilOrValue(listResponse[0]) completion(.success(result)) } } } /// Returns the passed byte list, to test serialization and deserialization. - func echo( - _ listArg: FlutterStandardTypedData, - completion: @escaping (Result) -> Void + func echoNullable( + _ listArg: FlutterStandardTypedData?, + completion: @escaping (Result) -> Void ) { let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoUint8List\(messageChannelSuffix)" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableUint8List\(messageChannelSuffix)" let channel = FlutterBasicMessageChannel( name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([listArg] as [Any?]) { response in @@ -3070,22 +5238,18 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let message: String? = nilOrValue(listResponse[1]) let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) - } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) } else { - let result = listResponse[0] as! FlutterStandardTypedData + let result: FlutterStandardTypedData? = nilOrValue(listResponse[0]) completion(.success(result)) } } } /// Returns the passed list, to test serialization and deserialization. - func echo(_ listArg: [Any?], completion: @escaping (Result<[Any?], PigeonError>) -> Void) { + func echoNullable( + _ listArg: [Any?]?, completion: @escaping (Result<[Any?]?, PigeonError>) -> Void + ) { let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoList\(messageChannelSuffix)" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableList\(messageChannelSuffix)" let channel = FlutterBasicMessageChannel( name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([listArg] as [Any?]) { response in @@ -3098,27 +5262,22 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let message: String? = nilOrValue(listResponse[1]) let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) - } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) } else { - let result = listResponse[0] as! [Any?] + let result: [Any?]? = nilOrValue(listResponse[0]) completion(.success(result)) } } } - /// Returns the passed map, to test serialization and deserialization. - func echo( - _ aMapArg: [String?: Any?], completion: @escaping (Result<[String?: Any?], PigeonError>) -> Void + /// Returns the passed list, to test serialization and deserialization. + func echoNullable( + enumList enumListArg: [AnEnum?]?, + completion: @escaping (Result<[AnEnum?]?, PigeonError>) -> Void ) { let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoMap\(messageChannelSuffix)" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableEnumList\(messageChannelSuffix)" let channel = FlutterBasicMessageChannel( name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([aMapArg] as [Any?]) { response in + channel.sendMessage([enumListArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -3128,25 +5287,22 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let message: String? = nilOrValue(listResponse[1]) let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) - } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) } else { - let result = listResponse[0] as! [String?: Any?] + let result: [AnEnum?]? = nilOrValue(listResponse[0]) completion(.success(result)) } } } - /// Returns the passed enum to test serialization and deserialization. - func echo(_ anEnumArg: AnEnum, completion: @escaping (Result) -> Void) { + /// Returns the passed list, to test serialization and deserialization. + func echoNullable( + classList classListArg: [AllNullableTypes?]?, + completion: @escaping (Result<[AllNullableTypes?]?, PigeonError>) -> Void + ) { let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnum\(messageChannelSuffix)" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableClassList\(messageChannelSuffix)" let channel = FlutterBasicMessageChannel( name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([anEnumArg] as [Any?]) { response in + channel.sendMessage([classListArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -3156,27 +5312,21 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let message: String? = nilOrValue(listResponse[1]) let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) - } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) } else { - let result = listResponse[0] as! AnEnum + let result: [AllNullableTypes?]? = nilOrValue(listResponse[0]) completion(.success(result)) } } } - /// Returns the passed enum to test serialization and deserialization. - func echo( - _ anotherEnumArg: AnotherEnum, completion: @escaping (Result) -> Void + /// Returns the passed list, to test serialization and deserialization. + func echoNullableNonNull( + enumList enumListArg: [AnEnum]?, completion: @escaping (Result<[AnEnum]?, PigeonError>) -> Void ) { let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAnotherEnum\(messageChannelSuffix)" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableNonNullEnumList\(messageChannelSuffix)" let channel = FlutterBasicMessageChannel( name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([anotherEnumArg] as [Any?]) { response in + channel.sendMessage([enumListArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -3186,25 +5336,22 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let message: String? = nilOrValue(listResponse[1]) let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) - } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) } else { - let result = listResponse[0] as! AnotherEnum + let result: [AnEnum]? = nilOrValue(listResponse[0]) completion(.success(result)) } } } - /// Returns the passed boolean, to test serialization and deserialization. - func echoNullable(_ aBoolArg: Bool?, completion: @escaping (Result) -> Void) { + /// Returns the passed list, to test serialization and deserialization. + func echoNullableNonNull( + classList classListArg: [AllNullableTypes]?, + completion: @escaping (Result<[AllNullableTypes]?, PigeonError>) -> Void + ) { let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableBool\(messageChannelSuffix)" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableNonNullClassList\(messageChannelSuffix)" let channel = FlutterBasicMessageChannel( name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([aBoolArg] as [Any?]) { response in + channel.sendMessage([classListArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -3215,19 +5362,21 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else { - let result: Bool? = nilOrValue(listResponse[0]) + let result: [AllNullableTypes]? = nilOrValue(listResponse[0]) completion(.success(result)) } } } - /// Returns the passed int, to test serialization and deserialization. - func echoNullable(_ anIntArg: Int64?, completion: @escaping (Result) -> Void) - { + /// Returns the passed map, to test serialization and deserialization. + func echoNullable( + _ mapArg: [AnyHashable?: Any?]?, + completion: @escaping (Result<[AnyHashable?: Any?]?, PigeonError>) -> Void + ) { let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableInt\(messageChannelSuffix)" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableMap\(messageChannelSuffix)" let channel = FlutterBasicMessageChannel( name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([anIntArg] as [Any?]) { response in + channel.sendMessage([mapArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -3238,24 +5387,21 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else { - let result: Int64? = - isNullish(listResponse[0]) - ? nil - : (listResponse[0] is Int64? - ? listResponse[0] as! Int64? : Int64(listResponse[0] as! Int32)) + let result: [AnyHashable?: Any?]? = nilOrValue(listResponse[0]) completion(.success(result)) } } } - /// Returns the passed double, to test serialization and deserialization. + /// Returns the passed map, to test serialization and deserialization. func echoNullable( - _ aDoubleArg: Double?, completion: @escaping (Result) -> Void + stringMap stringMapArg: [String?: String?]?, + completion: @escaping (Result<[String?: String?]?, PigeonError>) -> Void ) { let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableDouble\(messageChannelSuffix)" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableStringMap\(messageChannelSuffix)" let channel = FlutterBasicMessageChannel( name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([aDoubleArg] as [Any?]) { response in + channel.sendMessage([stringMapArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -3266,20 +5412,21 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else { - let result: Double? = nilOrValue(listResponse[0]) + let result: [String?: String?]? = nilOrValue(listResponse[0]) completion(.success(result)) } } } - /// Returns the passed string, to test serialization and deserialization. + /// Returns the passed map, to test serialization and deserialization. func echoNullable( - _ aStringArg: String?, completion: @escaping (Result) -> Void + intMap intMapArg: [Int64?: Int64?]?, + completion: @escaping (Result<[Int64?: Int64?]?, PigeonError>) -> Void ) { let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableString\(messageChannelSuffix)" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableIntMap\(messageChannelSuffix)" let channel = FlutterBasicMessageChannel( name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([aStringArg] as [Any?]) { response in + channel.sendMessage([intMapArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -3290,21 +5437,21 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else { - let result: String? = nilOrValue(listResponse[0]) + let result: [Int64?: Int64?]? = nilOrValue(listResponse[0]) completion(.success(result)) } } } - /// Returns the passed byte list, to test serialization and deserialization. + /// Returns the passed map, to test serialization and deserialization. func echoNullable( - _ listArg: FlutterStandardTypedData?, - completion: @escaping (Result) -> Void + enumMap enumMapArg: [AnEnum?: AnEnum?]?, + completion: @escaping (Result<[AnEnum?: AnEnum?]?, PigeonError>) -> Void ) { let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableUint8List\(messageChannelSuffix)" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableEnumMap\(messageChannelSuffix)" let channel = FlutterBasicMessageChannel( name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([listArg] as [Any?]) { response in + channel.sendMessage([enumMapArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -3315,20 +5462,21 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else { - let result: FlutterStandardTypedData? = nilOrValue(listResponse[0]) - completion(.success(result)) + let result: [AnEnum?: AnEnum?]? = listResponse[0] as? [AnEnum?: AnEnum?] + completion(.success(result!)) } } } - /// Returns the passed list, to test serialization and deserialization. + /// Returns the passed map, to test serialization and deserialization. func echoNullable( - _ listArg: [Any?]?, completion: @escaping (Result<[Any?]?, PigeonError>) -> Void + classMap classMapArg: [Int64?: AllNullableTypes?]?, + completion: @escaping (Result<[Int64?: AllNullableTypes?]?, PigeonError>) -> Void ) { let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableList\(messageChannelSuffix)" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableClassMap\(messageChannelSuffix)" let channel = FlutterBasicMessageChannel( name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([listArg] as [Any?]) { response in + channel.sendMessage([classMapArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -3339,21 +5487,96 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else { - let result: [Any?]? = nilOrValue(listResponse[0]) + let result: [Int64?: AllNullableTypes?]? = nilOrValue(listResponse[0]) completion(.success(result)) } } } /// Returns the passed map, to test serialization and deserialization. - func echoNullable( - _ aMapArg: [String?: Any?]?, - completion: @escaping (Result<[String?: Any?]?, PigeonError>) -> Void + func echoNullableNonNull( + stringMap stringMapArg: [String: String]?, + completion: @escaping (Result<[String: String]?, PigeonError>) -> Void ) { let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableMap\(messageChannelSuffix)" + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableNonNullStringMap\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([stringMapArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + let result: [String: String]? = nilOrValue(listResponse[0]) + completion(.success(result)) + } + } + } + /// Returns the passed map, to test serialization and deserialization. + func echoNullableNonNull( + intMap intMapArg: [Int64: Int64]?, + completion: @escaping (Result<[Int64: Int64]?, PigeonError>) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableNonNullIntMap\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([intMapArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + let result: [Int64: Int64]? = nilOrValue(listResponse[0]) + completion(.success(result)) + } + } + } + /// Returns the passed map, to test serialization and deserialization. + func echoNullableNonNull( + enumMap enumMapArg: [AnEnum: AnEnum]?, + completion: @escaping (Result<[AnEnum: AnEnum]?, PigeonError>) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableNonNullEnumMap\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([enumMapArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + let result: [AnEnum: AnEnum]? = listResponse[0] as? [AnEnum: AnEnum] + completion(.success(result!)) + } + } + } + /// Returns the passed map, to test serialization and deserialization. + func echoNullableNonNull( + classMap classMapArg: [Int64: AllNullableTypes]?, + completion: @escaping (Result<[Int64: AllNullableTypes]?, PigeonError>) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableNonNullClassMap\(messageChannelSuffix)" let channel = FlutterBasicMessageChannel( name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([aMapArg] as [Any?]) { response in + channel.sendMessage([classMapArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -3364,7 +5587,7 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else { - let result: [String?: Any?]? = nilOrValue(listResponse[0]) + let result: [Int64: AllNullableTypes]? = nilOrValue(listResponse[0]) completion(.success(result)) } } diff --git a/packages/pigeon/platform_tests/test_plugin/macos/Classes/ProxyApiTestClass.swift b/packages/pigeon/platform_tests/test_plugin/macos/Classes/ProxyApiTestClass.swift new file mode 100644 index 000000000000..f6e7eed44cb4 --- /dev/null +++ b/packages/pigeon/platform_tests/test_plugin/macos/Classes/ProxyApiTestClass.swift @@ -0,0 +1,14 @@ +// 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 Foundation + +class ProxyApiTestClass: ProxyApiSuperClass, ProxyApiInterface {} + +open class ProxyApiSuperClass {} + +protocol ProxyApiInterface {} + +@available(macOS 10, *) +class ClassWithApiRequirement {} diff --git a/packages/pigeon/platform_tests/test_plugin/macos/Classes/ProxyApiTests.gen.swift b/packages/pigeon/platform_tests/test_plugin/macos/Classes/ProxyApiTests.gen.swift new file mode 100644 index 000000000000..d3a699ca47a9 --- /dev/null +++ b/packages/pigeon/platform_tests/test_plugin/macos/Classes/ProxyApiTests.gen.swift @@ -0,0 +1,4191 @@ +// 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, do not edit directly. +// See also: https://pub.dev/packages/pigeon + +import Foundation + +#if os(iOS) + import Flutter +#elseif os(macOS) + import FlutterMacOS +#else + #error("Unsupported platform.") +#endif + +/// Error class for passing custom error details to Dart side. +final class ProxyApiTestsError: Error { + let code: String + let message: String? + let details: Any? + + init(code: String, message: String?, details: Any?) { + self.code = code + self.message = message + self.details = details + } + + var localizedDescription: String { + return + "ProxyApiTestsError(code: \(code), message: \(message ?? ""), details: \(details ?? "")" + } +} + +private func wrapResult(_ result: Any?) -> [Any?] { + return [result] +} + +private func wrapError(_ error: Any) -> [Any?] { + if let pigeonError = error as? ProxyApiTestsError { + return [ + pigeonError.code, + pigeonError.message, + pigeonError.details, + ] + } + if let flutterError = error as? FlutterError { + return [ + flutterError.code, + flutterError.message, + flutterError.details, + ] + } + return [ + "\(error)", + "\(type(of: error))", + "Stacktrace: \(Thread.callStackSymbols)", + ] +} + +private func createConnectionError(withChannelName channelName: String) -> ProxyApiTestsError { + return ProxyApiTestsError( + code: "channel-error", message: "Unable to establish connection on channel: '\(channelName)'.", + details: "") +} + +private func isNullish(_ value: Any?) -> Bool { + return value is NSNull || value == nil +} + +private func nilOrValue(_ value: Any?) -> T? { + if value is NSNull { return nil } + return value as! T? +} +/// Handles the callback when an object is deallocated. +protocol ProxyApiTestsPigeonInternalFinalizerDelegate: AnyObject { + /// Invoked when the strong reference of an object is deallocated in an `InstanceManager`. + func onDeinit(identifier: Int64) +} + +// Attaches to an object to receive a callback when the object is deallocated. +internal final class ProxyApiTestsPigeonInternalFinalizer { + private static let associatedObjectKey = malloc(1)! + + private let identifier: Int64 + // Reference to the delegate is weak because the callback should be ignored if the + // `InstanceManager` is deallocated. + private weak var delegate: ProxyApiTestsPigeonInternalFinalizerDelegate? + + private init(identifier: Int64, delegate: ProxyApiTestsPigeonInternalFinalizerDelegate) { + self.identifier = identifier + self.delegate = delegate + } + + internal static func attach( + to instance: AnyObject, identifier: Int64, + delegate: ProxyApiTestsPigeonInternalFinalizerDelegate + ) { + let finalizer = ProxyApiTestsPigeonInternalFinalizer(identifier: identifier, delegate: delegate) + objc_setAssociatedObject(instance, associatedObjectKey, finalizer, .OBJC_ASSOCIATION_RETAIN) + } + + static func detach(from instance: AnyObject) { + objc_setAssociatedObject(instance, associatedObjectKey, nil, .OBJC_ASSOCIATION_ASSIGN) + } + + deinit { + delegate?.onDeinit(identifier: identifier) + } +} + +/// Maintains instances used to communicate with the corresponding objects in Dart. +/// +/// Objects stored in this container are represented by an object in Dart that is also stored in +/// an InstanceManager with the same identifier. +/// +/// When an instance is added with an identifier, either can be used to retrieve the other. +/// +/// Added instances are added as a weak reference and a strong reference. When the strong +/// reference is removed and the weak reference is deallocated,`ProxyApiTestsPigeonInternalFinalizerDelegate.onDeinit` +/// is called with the instance's identifier. However, if the strong reference is removed and then the identifier is +/// retrieved with the intention to pass the identifier to Dart (e.g. by calling `identifierWithStrongReference`), +/// the strong reference to the instance is re-added. The strong reference will then need to be removed manually +/// again. +/// +/// Accessing and inserting to an InstanceManager is thread safe. +final class ProxyApiTestsPigeonInstanceManager { + // Identifiers are locked to a specific range to avoid collisions with objects + // created simultaneously from Dart. + // Host uses identifiers >= 2^16 and Dart is expected to use values n where, + // 0 <= n < 2^16. + private static let minHostCreatedIdentifier: Int64 = 65536 + + private let lockQueue = DispatchQueue(label: "ProxyApiTestsPigeonInstanceManager") + private let identifiers: NSMapTable = NSMapTable( + keyOptions: [.weakMemory, .objectPointerPersonality], valueOptions: .strongMemory) + private let weakInstances: NSMapTable = NSMapTable( + keyOptions: .strongMemory, valueOptions: [.weakMemory, .objectPointerPersonality]) + private let strongInstances: NSMapTable = NSMapTable( + keyOptions: .strongMemory, valueOptions: [.strongMemory, .objectPointerPersonality]) + private let finalizerDelegate: ProxyApiTestsPigeonInternalFinalizerDelegate + private var nextIdentifier: Int64 = minHostCreatedIdentifier + + public init(finalizerDelegate: ProxyApiTestsPigeonInternalFinalizerDelegate) { + self.finalizerDelegate = finalizerDelegate + } + + /// Adds a new instance that was instantiated from Dart. + /// + /// The same instance can be added multiple times, but each identifier must be unique. This allows + /// two objects that are equivalent (e.g. conforms to `Equatable`) to both be added. + /// + /// - Parameters: + /// - instance: the instance to be stored + /// - identifier: the identifier to be paired with instance. This value must be >= 0 and unique + func addDartCreatedInstance(_ instance: AnyObject, withIdentifier identifier: Int64) { + lockQueue.async { + self.addInstance(instance, withIdentifier: identifier) + } + } + + /// Adds a new instance that was instantiated from the host platform. + /// + /// - Parameters: + /// - instance: the instance to be stored. This must be unique to all other added instances. + /// - Returns: the unique identifier (>= 0) stored with instance + func addHostCreatedInstance(_ instance: AnyObject) -> Int64 { + assert(!containsInstance(instance), "Instance of \(instance) has already been added.") + var identifier: Int64 = -1 + lockQueue.sync { + identifier = nextIdentifier + nextIdentifier += 1 + self.addInstance(instance, withIdentifier: identifier) + } + return identifier + } + + /// Removes `instanceIdentifier` and its associated strongly referenced instance, if present, from the manager. + /// + /// - Parameters: + /// - instanceIdentifier: the identifier paired to an instance. + /// - Returns: removed instance if the manager contains the given identifier, otherwise `nil` if + /// the manager doesn't contain the value + func removeInstance(withIdentifier instanceIdentifier: Int64) throws -> T? { + var instance: AnyObject? = nil + lockQueue.sync { + instance = strongInstances.object(forKey: NSNumber(value: instanceIdentifier)) + strongInstances.removeObject(forKey: NSNumber(value: instanceIdentifier)) + } + return instance as? T + } + + /// Retrieves the instance associated with identifier. + /// + /// - Parameters: + /// - instanceIdentifier: the identifier associated with an instance + /// - Returns: the instance associated with `instanceIdentifier` if the manager contains the value, otherwise + /// `nil` if the manager doesn't contain the value + func instance(forIdentifier instanceIdentifier: Int64) -> T? { + var instance: AnyObject? = nil + lockQueue.sync { + instance = weakInstances.object(forKey: NSNumber(value: instanceIdentifier)) + } + return instance as? T + } + + private func addInstance(_ instance: AnyObject, withIdentifier identifier: Int64) { + assert(identifier >= 0) + assert( + weakInstances.object(forKey: identifier as NSNumber) == nil, + "Identifier has already been added: \(identifier)") + identifiers.setObject(NSNumber(value: identifier), forKey: instance) + weakInstances.setObject(instance, forKey: NSNumber(value: identifier)) + strongInstances.setObject(instance, forKey: NSNumber(value: identifier)) + ProxyApiTestsPigeonInternalFinalizer.attach( + to: instance, identifier: identifier, delegate: finalizerDelegate) + } + + /// Retrieves the identifier paired with an instance. + /// + /// If the manager contains a strong reference to `instance`, it will return the identifier + /// associated with `instance`. If the manager contains only a weak reference to `instance`, a new + /// strong reference to `instance` will be added and will need to be removed again with `removeInstance`. + /// + /// If this method returns a nonnull identifier, this method also expects the Dart + /// `ProxyApiTestsPigeonInstanceManager` to have, or recreate, a weak reference to the Dart instance the + /// identifier is associated with. + /// + /// - Parameters: + /// - instance: an instance that may be stored in the manager + /// - Returns: the identifier associated with `instance` if the manager contains the value, otherwise + /// `nil` if the manager doesn't contain the value + func identifierWithStrongReference(forInstance instance: AnyObject) -> Int64? { + var identifier: Int64? = nil + lockQueue.sync { + if let existingIdentifier = identifiers.object(forKey: instance)?.int64Value { + strongInstances.setObject(instance, forKey: NSNumber(value: existingIdentifier)) + identifier = existingIdentifier + } + } + return identifier + } + + /// Whether this manager contains the given `instance`. + /// + /// - Parameters: + /// - instance: the instance whose presence in this manager is to be tested + /// - Returns: whether this manager contains the given `instance` + func containsInstance(_ instance: AnyObject) -> Bool { + var containsInstance = false + lockQueue.sync { + containsInstance = identifiers.object(forKey: instance) != nil + } + return containsInstance + } + + /// Removes all of the instances from this manager. + /// + /// The manager will be empty after this call returns. + func removeAllObjects() throws { + lockQueue.sync { + identifiers.removeAllObjects() + weakInstances.removeAllObjects() + strongInstances.removeAllObjects() + nextIdentifier = ProxyApiTestsPigeonInstanceManager.minHostCreatedIdentifier + } + } + + /// The number of instances stored as a strong reference. + /// + /// For debugging and testing purposes. + internal var strongInstanceCount: Int { + var count: Int = 0 + lockQueue.sync { + count = strongInstances.count + } + return count + } + + /// The number of instances stored as a weak reference. + /// + /// For debugging and testing purposes. NSMapTables that store keys or objects as weak + /// reference will be reclaimed non-deterministically. + internal var weakInstanceCount: Int { + var count: Int = 0 + lockQueue.sync { + count = weakInstances.count + } + return count + } +} + +private class ProxyApiTestsPigeonInstanceManagerApi { + /// The codec used for serializing messages. + var codec: FlutterStandardMessageCodec { ProxyApiTestsPigeonCodec.shared } + + /// Handles sending and receiving messages with Dart. + unowned let binaryMessenger: FlutterBinaryMessenger + + init(binaryMessenger: FlutterBinaryMessenger) { + self.binaryMessenger = binaryMessenger + } + + /// Sets up an instance of `ProxyApiTestsPigeonInstanceManagerApi` to handle messages through the `binaryMessenger`. + static func setUpMessageHandlers( + binaryMessenger: FlutterBinaryMessenger, instanceManager: ProxyApiTestsPigeonInstanceManager? + ) { + let codec = ProxyApiTestsPigeonCodec.shared + let removeStrongReferenceChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.PigeonInternalInstanceManager.removeStrongReference", + binaryMessenger: binaryMessenger, codec: codec) + if let instanceManager = instanceManager { + removeStrongReferenceChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let identifierArg = args[0] as! Int64 + do { + let _: AnyObject? = try instanceManager.removeInstance(withIdentifier: identifierArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + removeStrongReferenceChannel.setMessageHandler(nil) + } + let clearChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.PigeonInternalInstanceManager.clear", + binaryMessenger: binaryMessenger, codec: codec) + if let instanceManager = instanceManager { + clearChannel.setMessageHandler { _, reply in + do { + try instanceManager.removeAllObjects() + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + clearChannel.setMessageHandler(nil) + } + } + + /// Sends a message to the Dart `InstanceManager` to remove the strong reference of the instance associated with `identifier`. + func removeStrongReference( + identifier identifierArg: Int64, + completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.PigeonInternalInstanceManager.removeStrongReference" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([identifierArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(ProxyApiTestsError(code: code, message: message, details: details))) + } else { + completion(.success(Void())) + } + } + } +} +protocol ProxyApiTestsPigeonProxyApiDelegate { + /// An implementation of [PigeonApiProxyApiTestClass] used to add a new Dart instance of + /// `ProxyApiTestClass` to the Dart `InstanceManager` and make calls to Dart. + func pigeonApiProxyApiTestClass(_ registrar: ProxyApiTestsPigeonProxyApiRegistrar) + -> PigeonApiProxyApiTestClass + /// An implementation of [PigeonApiProxyApiSuperClass] used to add a new Dart instance of + /// `ProxyApiSuperClass` to the Dart `InstanceManager` and make calls to Dart. + func pigeonApiProxyApiSuperClass(_ registrar: ProxyApiTestsPigeonProxyApiRegistrar) + -> PigeonApiProxyApiSuperClass + /// An implementation of [PigeonApiProxyApiInterface] used to add a new Dart instance of + /// `ProxyApiInterface` to the Dart `InstanceManager` and make calls to Dart. + func pigeonApiProxyApiInterface(_ registrar: ProxyApiTestsPigeonProxyApiRegistrar) + -> PigeonApiProxyApiInterface + /// An implementation of [PigeonApiClassWithApiRequirement] used to add a new Dart instance of + /// `ClassWithApiRequirement` to the Dart `InstanceManager` and make calls to Dart. + func pigeonApiClassWithApiRequirement(_ registrar: ProxyApiTestsPigeonProxyApiRegistrar) + -> PigeonApiClassWithApiRequirement +} + +extension ProxyApiTestsPigeonProxyApiDelegate { + func pigeonApiProxyApiInterface(_ registrar: ProxyApiTestsPigeonProxyApiRegistrar) + -> PigeonApiProxyApiInterface + { + return PigeonApiProxyApiInterface( + pigeonRegistrar: registrar, delegate: PigeonApiDelegateProxyApiInterface()) + } +} + +open class ProxyApiTestsPigeonProxyApiRegistrar { + let binaryMessenger: FlutterBinaryMessenger + let apiDelegate: ProxyApiTestsPigeonProxyApiDelegate + let instanceManager: ProxyApiTestsPigeonInstanceManager + /// Whether APIs should ignore calling to Dart. + public var ignoreCallsToDart = false + private var _codec: FlutterStandardMessageCodec? + var codec: FlutterStandardMessageCodec { + if _codec == nil { + _codec = FlutterStandardMessageCodec( + readerWriter: ProxyApiTestsPigeonInternalProxyApiCodecReaderWriter(pigeonRegistrar: self)) + } + return _codec! + } + + private class InstanceManagerApiFinalizerDelegate: ProxyApiTestsPigeonInternalFinalizerDelegate { + let api: ProxyApiTestsPigeonInstanceManagerApi + + init(_ api: ProxyApiTestsPigeonInstanceManagerApi) { + self.api = api + } + + public func onDeinit(identifier: Int64) { + api.removeStrongReference(identifier: identifier) { + _ in + } + } + } + + init(binaryMessenger: FlutterBinaryMessenger, apiDelegate: ProxyApiTestsPigeonProxyApiDelegate) { + self.binaryMessenger = binaryMessenger + self.apiDelegate = apiDelegate + self.instanceManager = ProxyApiTestsPigeonInstanceManager( + finalizerDelegate: InstanceManagerApiFinalizerDelegate( + ProxyApiTestsPigeonInstanceManagerApi(binaryMessenger: binaryMessenger))) + } + + func setUp() { + ProxyApiTestsPigeonInstanceManagerApi.setUpMessageHandlers( + binaryMessenger: binaryMessenger, instanceManager: instanceManager) + PigeonApiProxyApiTestClass.setUpMessageHandlers( + binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiProxyApiTestClass(self)) + PigeonApiProxyApiSuperClass.setUpMessageHandlers( + binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiProxyApiSuperClass(self)) + PigeonApiClassWithApiRequirement.setUpMessageHandlers( + binaryMessenger: binaryMessenger, api: apiDelegate.pigeonApiClassWithApiRequirement(self)) + } + func tearDown() { + ProxyApiTestsPigeonInstanceManagerApi.setUpMessageHandlers( + binaryMessenger: binaryMessenger, instanceManager: nil) + PigeonApiProxyApiTestClass.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) + PigeonApiProxyApiSuperClass.setUpMessageHandlers(binaryMessenger: binaryMessenger, api: nil) + PigeonApiClassWithApiRequirement.setUpMessageHandlers( + binaryMessenger: binaryMessenger, api: nil) + } +} +private class ProxyApiTestsPigeonInternalProxyApiCodecReaderWriter: FlutterStandardReaderWriter { + unowned let pigeonRegistrar: ProxyApiTestsPigeonProxyApiRegistrar + + private class ProxyApiTestsPigeonInternalProxyApiCodecReader: ProxyApiTestsPigeonCodecReader { + unowned let pigeonRegistrar: ProxyApiTestsPigeonProxyApiRegistrar + + init(data: Data, pigeonRegistrar: ProxyApiTestsPigeonProxyApiRegistrar) { + self.pigeonRegistrar = pigeonRegistrar + super.init(data: data) + } + + override func readValue(ofType type: UInt8) -> Any? { + switch type { + case 128: + let identifier = self.readValue() + let instance: AnyObject? = pigeonRegistrar.instanceManager.instance( + forIdentifier: identifier is Int64 ? identifier as! Int64 : Int64(identifier as! Int32)) + return instance + default: + return super.readValue(ofType: type) + } + } + } + + private class ProxyApiTestsPigeonInternalProxyApiCodecWriter: ProxyApiTestsPigeonCodecWriter { + unowned let pigeonRegistrar: ProxyApiTestsPigeonProxyApiRegistrar + + init(data: NSMutableData, pigeonRegistrar: ProxyApiTestsPigeonProxyApiRegistrar) { + self.pigeonRegistrar = pigeonRegistrar + super.init(data: data) + } + + override func writeValue(_ value: Any) { + if value is [Any] || value is Bool || value is Data || value is [AnyHashable: Any] + || value is Double || value is FlutterStandardTypedData || value is Int64 || value is String + || value is ProxyApiTestEnum + { + super.writeValue(value) + return + } + + if let instance = value as? ProxyApiTestClass { + pigeonRegistrar.apiDelegate.pigeonApiProxyApiTestClass(pigeonRegistrar).pigeonNewInstance( + pigeonInstance: instance + ) { _ in } + super.writeByte(128) + super.writeValue( + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) + return + } + + if let instance = value as? ProxyApiSuperClass { + pigeonRegistrar.apiDelegate.pigeonApiProxyApiSuperClass(pigeonRegistrar).pigeonNewInstance( + pigeonInstance: instance + ) { _ in } + super.writeByte(128) + super.writeValue( + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) + return + } + + if let instance = value as? ProxyApiInterface { + pigeonRegistrar.apiDelegate.pigeonApiProxyApiInterface(pigeonRegistrar).pigeonNewInstance( + pigeonInstance: instance + ) { _ in } + super.writeByte(128) + super.writeValue( + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) + return + } + + if #available(iOS 15.0.0, macOS 10.0.0, *), let instance = value as? ClassWithApiRequirement { + pigeonRegistrar.apiDelegate.pigeonApiClassWithApiRequirement(pigeonRegistrar) + .pigeonNewInstance( + pigeonInstance: instance + ) { _ in } + super.writeByte(128) + super.writeValue( + pigeonRegistrar.instanceManager.identifierWithStrongReference( + forInstance: instance as AnyObject)!) + return + } + + if let instance = value as AnyObject?, + pigeonRegistrar.instanceManager.containsInstance(instance) + { + super.writeByte(128) + super.writeValue( + pigeonRegistrar.instanceManager.identifierWithStrongReference(forInstance: instance)!) + } else { + print("Unsupported value: \(value) of \(type(of: value))") + assert(false, "Unsupported value for ProxyApiTestsPigeonInternalProxyApiCodecWriter") + } + + } + } + + init(pigeonRegistrar: ProxyApiTestsPigeonProxyApiRegistrar) { + self.pigeonRegistrar = pigeonRegistrar + } + + override func reader(with data: Data) -> FlutterStandardReader { + return ProxyApiTestsPigeonInternalProxyApiCodecReader( + data: data, pigeonRegistrar: pigeonRegistrar) + } + + override func writer(with data: NSMutableData) -> FlutterStandardWriter { + return ProxyApiTestsPigeonInternalProxyApiCodecWriter( + data: data, pigeonRegistrar: pigeonRegistrar) + } +} + +enum ProxyApiTestEnum: Int { + case one = 0 + case two = 1 + case three = 2 +} + +private class ProxyApiTestsPigeonCodecReader: FlutterStandardReader { + override func readValue(ofType type: UInt8) -> Any? { + switch type { + case 129: + let enumResultAsInt: Int? = nilOrValue(self.readValue() as! Int?) + if let enumResultAsInt = enumResultAsInt { + return ProxyApiTestEnum(rawValue: enumResultAsInt) + } + return nil + default: + return super.readValue(ofType: type) + } + } +} + +private class ProxyApiTestsPigeonCodecWriter: FlutterStandardWriter { + override func writeValue(_ value: Any) { + if let value = value as? ProxyApiTestEnum { + super.writeByte(129) + super.writeValue(value.rawValue) + } else { + super.writeValue(value) + } + } +} + +private class ProxyApiTestsPigeonCodecReaderWriter: FlutterStandardReaderWriter { + override func reader(with data: Data) -> FlutterStandardReader { + return ProxyApiTestsPigeonCodecReader(data: data) + } + + override func writer(with data: NSMutableData) -> FlutterStandardWriter { + return ProxyApiTestsPigeonCodecWriter(data: data) + } +} + +class ProxyApiTestsPigeonCodec: FlutterStandardMessageCodec, @unchecked Sendable { + static let shared = ProxyApiTestsPigeonCodec(readerWriter: ProxyApiTestsPigeonCodecReaderWriter()) +} + +protocol PigeonApiDelegateProxyApiTestClass { + func pigeonDefaultConstructor( + pigeonApi: PigeonApiProxyApiTestClass, aBool: Bool, anInt: Int64, aDouble: Double, + aString: String, aUint8List: FlutterStandardTypedData, aList: [Any?], aMap: [String?: Any?], + anEnum: ProxyApiTestEnum, aProxyApi: ProxyApiSuperClass, aNullableBool: Bool?, + aNullableInt: Int64?, aNullableDouble: Double?, aNullableString: String?, + aNullableUint8List: FlutterStandardTypedData?, aNullableList: [Any?]?, + aNullableMap: [String?: Any?]?, aNullableEnum: ProxyApiTestEnum?, + aNullableProxyApi: ProxyApiSuperClass?, boolParam: Bool, intParam: Int64, doubleParam: Double, + stringParam: String, aUint8ListParam: FlutterStandardTypedData, listParam: [Any?], + mapParam: [String?: Any?], enumParam: ProxyApiTestEnum, proxyApiParam: ProxyApiSuperClass, + nullableBoolParam: Bool?, nullableIntParam: Int64?, nullableDoubleParam: Double?, + nullableStringParam: String?, nullableUint8ListParam: FlutterStandardTypedData?, + nullableListParam: [Any?]?, nullableMapParam: [String?: Any?]?, + nullableEnumParam: ProxyApiTestEnum?, nullableProxyApiParam: ProxyApiSuperClass? + ) throws -> ProxyApiTestClass + func attachedField(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) + throws -> ProxyApiSuperClass + func staticAttachedField(pigeonApi: PigeonApiProxyApiTestClass) throws -> ProxyApiSuperClass + func aBool(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) throws + -> Bool + func anInt(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) throws + -> Int64 + func aDouble(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) throws + -> Double + func aString(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) throws + -> String + func aUint8List(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) throws + -> FlutterStandardTypedData + func aList(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) throws + -> [Any?] + func aMap(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) throws + -> [String?: Any?] + func anEnum(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) throws + -> ProxyApiTestEnum + func aProxyApi(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) throws + -> ProxyApiSuperClass + func aNullableBool(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) + throws -> Bool? + func aNullableInt(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) throws + -> Int64? + func aNullableDouble(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) + throws -> Double? + func aNullableString(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) + throws -> String? + func aNullableUint8List(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) + throws -> FlutterStandardTypedData? + func aNullableList(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) + throws -> [Any?]? + func aNullableMap(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) throws + -> [String?: Any?]? + func aNullableEnum(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) + throws -> ProxyApiTestEnum? + func aNullableProxyApi(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) + throws -> ProxyApiSuperClass? + /// A no-op function taking no arguments and returning no value, to sanity + /// test basic calling. + func noop(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) throws + /// Returns an error, to test error handling. + func throwError(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) throws + -> Any? + /// Returns an error from a void function, to test error handling. + func throwErrorFromVoid(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) + throws + /// Returns a Flutter error, to test error handling. + func throwFlutterError(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) + throws -> Any? + /// Returns passed in int. + func echoInt( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, anInt: Int64 + ) throws -> Int64 + /// Returns passed in double. + func echoDouble( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aDouble: Double + ) throws -> Double + /// Returns the passed in boolean. + func echoBool( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aBool: Bool + ) throws -> Bool + /// Returns the passed in string. + func echoString( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aString: String + ) throws -> String + /// Returns the passed in Uint8List. + func echoUint8List( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aUint8List: FlutterStandardTypedData + ) throws -> FlutterStandardTypedData + /// Returns the passed in generic Object. + func echoObject( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, anObject: Any + ) throws -> Any + /// Returns the passed list, to test serialization and deserialization. + func echoList( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aList: [Any?] + ) throws -> [Any?] + /// Returns the passed list with ProxyApis, to test serialization and + /// deserialization. + func echoProxyApiList( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aList: [ProxyApiTestClass] + ) throws -> [ProxyApiTestClass] + /// Returns the passed map, to test serialization and deserialization. + func echoMap( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aMap: [String?: Any?] + ) throws -> [String?: Any?] + /// Returns the passed map with ProxyApis, to test serialization and + /// deserialization. + func echoProxyApiMap( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aMap: [String: ProxyApiTestClass] + ) throws -> [String: ProxyApiTestClass] + /// Returns the passed enum to test serialization and deserialization. + func echoEnum( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + anEnum: ProxyApiTestEnum + ) throws -> ProxyApiTestEnum + /// Returns the passed ProxyApi to test serialization and deserialization. + func echoProxyApi( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aProxyApi: ProxyApiSuperClass + ) throws -> ProxyApiSuperClass + /// Returns passed in int. + func echoNullableInt( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aNullableInt: Int64? + ) throws -> Int64? + /// Returns passed in double. + func echoNullableDouble( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aNullableDouble: Double? + ) throws -> Double? + /// Returns the passed in boolean. + func echoNullableBool( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aNullableBool: Bool? + ) throws -> Bool? + /// Returns the passed in string. + func echoNullableString( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aNullableString: String? + ) throws -> String? + /// Returns the passed in Uint8List. + func echoNullableUint8List( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aNullableUint8List: FlutterStandardTypedData? + ) throws -> FlutterStandardTypedData? + /// Returns the passed in generic Object. + func echoNullableObject( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aNullableObject: Any? + ) throws -> Any? + /// Returns the passed list, to test serialization and deserialization. + func echoNullableList( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aNullableList: [Any?]? + ) throws -> [Any?]? + /// Returns the passed map, to test serialization and deserialization. + func echoNullableMap( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aNullableMap: [String?: Any?]? + ) throws -> [String?: Any?]? + func echoNullableEnum( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aNullableEnum: ProxyApiTestEnum? + ) throws -> ProxyApiTestEnum? + /// Returns the passed ProxyApi to test serialization and deserialization. + func echoNullableProxyApi( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aNullableProxyApi: ProxyApiSuperClass? + ) throws -> ProxyApiSuperClass? + /// A no-op function taking no arguments and returning no value, to sanity + /// test basic asynchronous calling. + func noopAsync( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + completion: @escaping (Result) -> Void) + /// Returns passed in int asynchronously. + func echoAsyncInt( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, anInt: Int64, + completion: @escaping (Result) -> Void) + /// Returns passed in double asynchronously. + func echoAsyncDouble( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aDouble: Double, + completion: @escaping (Result) -> Void) + /// Returns the passed in boolean asynchronously. + func echoAsyncBool( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aBool: Bool, + completion: @escaping (Result) -> Void) + /// Returns the passed string asynchronously. + func echoAsyncString( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aString: String, + completion: @escaping (Result) -> Void) + /// Returns the passed in Uint8List asynchronously. + func echoAsyncUint8List( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aUint8List: FlutterStandardTypedData, + completion: @escaping (Result) -> Void) + /// Returns the passed in generic Object asynchronously. + func echoAsyncObject( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, anObject: Any, + completion: @escaping (Result) -> Void) + /// Returns the passed list, to test asynchronous serialization and deserialization. + func echoAsyncList( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aList: [Any?], + completion: @escaping (Result<[Any?], Error>) -> Void) + /// Returns the passed map, to test asynchronous serialization and deserialization. + func echoAsyncMap( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aMap: [String?: Any?], + completion: @escaping (Result<[String?: Any?], Error>) -> Void) + /// Returns the passed enum, to test asynchronous serialization and deserialization. + func echoAsyncEnum( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + anEnum: ProxyApiTestEnum, completion: @escaping (Result) -> Void) + /// Responds with an error from an async function returning a value. + func throwAsyncError( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + completion: @escaping (Result) -> Void) + /// Responds with an error from an async void function. + func throwAsyncErrorFromVoid( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + completion: @escaping (Result) -> Void) + /// Responds with a Flutter error from an async function returning a value. + func throwAsyncFlutterError( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + completion: @escaping (Result) -> Void) + /// Returns passed in int asynchronously. + func echoAsyncNullableInt( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, anInt: Int64?, + completion: @escaping (Result) -> Void) + /// Returns passed in double asynchronously. + func echoAsyncNullableDouble( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aDouble: Double?, + completion: @escaping (Result) -> Void) + /// Returns the passed in boolean asynchronously. + func echoAsyncNullableBool( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aBool: Bool?, + completion: @escaping (Result) -> Void) + /// Returns the passed string asynchronously. + func echoAsyncNullableString( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aString: String?, + completion: @escaping (Result) -> Void) + /// Returns the passed in Uint8List asynchronously. + func echoAsyncNullableUint8List( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aUint8List: FlutterStandardTypedData?, + completion: @escaping (Result) -> Void) + /// Returns the passed in generic Object asynchronously. + func echoAsyncNullableObject( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, anObject: Any?, + completion: @escaping (Result) -> Void) + /// Returns the passed list, to test asynchronous serialization and deserialization. + func echoAsyncNullableList( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aList: [Any?]?, + completion: @escaping (Result<[Any?]?, Error>) -> Void) + /// Returns the passed map, to test asynchronous serialization and deserialization. + func echoAsyncNullableMap( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aMap: [String?: Any?]?, completion: @escaping (Result<[String?: Any?]?, Error>) -> Void) + /// Returns the passed enum, to test asynchronous serialization and deserialization. + func echoAsyncNullableEnum( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + anEnum: ProxyApiTestEnum?, completion: @escaping (Result) -> Void) + func staticNoop(pigeonApi: PigeonApiProxyApiTestClass) throws + func echoStaticString(pigeonApi: PigeonApiProxyApiTestClass, aString: String) throws -> String + func staticAsyncNoop( + pigeonApi: PigeonApiProxyApiTestClass, completion: @escaping (Result) -> Void) + func callFlutterNoop( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + completion: @escaping (Result) -> Void) + func callFlutterThrowError( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + completion: @escaping (Result) -> Void) + func callFlutterThrowErrorFromVoid( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + completion: @escaping (Result) -> Void) + func callFlutterEchoBool( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aBool: Bool, + completion: @escaping (Result) -> Void) + func callFlutterEchoInt( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, anInt: Int64, + completion: @escaping (Result) -> Void) + func callFlutterEchoDouble( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aDouble: Double, + completion: @escaping (Result) -> Void) + func callFlutterEchoString( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aString: String, + completion: @escaping (Result) -> Void) + func callFlutterEchoUint8List( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aUint8List: FlutterStandardTypedData, + completion: @escaping (Result) -> Void) + func callFlutterEchoList( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aList: [Any?], + completion: @escaping (Result<[Any?], Error>) -> Void) + func callFlutterEchoProxyApiList( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aList: [ProxyApiTestClass?], completion: @escaping (Result<[ProxyApiTestClass?], Error>) -> Void + ) + func callFlutterEchoMap( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aMap: [String?: Any?], + completion: @escaping (Result<[String?: Any?], Error>) -> Void) + func callFlutterEchoProxyApiMap( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aMap: [String?: ProxyApiTestClass?], + completion: @escaping (Result<[String?: ProxyApiTestClass?], Error>) -> Void) + func callFlutterEchoEnum( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + anEnum: ProxyApiTestEnum, completion: @escaping (Result) -> Void) + func callFlutterEchoProxyApi( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aProxyApi: ProxyApiSuperClass, completion: @escaping (Result) -> Void + ) + func callFlutterEchoNullableBool( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aBool: Bool?, + completion: @escaping (Result) -> Void) + func callFlutterEchoNullableInt( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, anInt: Int64?, + completion: @escaping (Result) -> Void) + func callFlutterEchoNullableDouble( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aDouble: Double?, + completion: @escaping (Result) -> Void) + func callFlutterEchoNullableString( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aString: String?, + completion: @escaping (Result) -> Void) + func callFlutterEchoNullableUint8List( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aUint8List: FlutterStandardTypedData?, + completion: @escaping (Result) -> Void) + func callFlutterEchoNullableList( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aList: [Any?]?, + completion: @escaping (Result<[Any?]?, Error>) -> Void) + func callFlutterEchoNullableMap( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aMap: [String?: Any?]?, completion: @escaping (Result<[String?: Any?]?, Error>) -> Void) + func callFlutterEchoNullableEnum( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + anEnum: ProxyApiTestEnum?, completion: @escaping (Result) -> Void) + func callFlutterEchoNullableProxyApi( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aProxyApi: ProxyApiSuperClass?, + completion: @escaping (Result) -> Void) + func callFlutterNoopAsync( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + completion: @escaping (Result) -> Void) + func callFlutterEchoAsyncString( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aString: String, + completion: @escaping (Result) -> Void) +} + +protocol PigeonApiProtocolProxyApiTestClass { + /// A no-op function taking no arguments and returning no value, to sanity + /// test basic calling. + func flutterNoop( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, + completion: @escaping (Result) -> Void) + /// Responds with an error from an async function returning a value. + func flutterThrowError( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, + completion: @escaping (Result) -> Void) + /// Responds with an error from an async void function. + func flutterThrowErrorFromVoid( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, + completion: @escaping (Result) -> Void) + /// Returns the passed boolean, to test serialization and deserialization. + func flutterEchoBool( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aBool aBoolArg: Bool, + completion: @escaping (Result) -> Void) + /// Returns the passed int, to test serialization and deserialization. + func flutterEchoInt( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, anInt anIntArg: Int64, + completion: @escaping (Result) -> Void) + /// Returns the passed double, to test serialization and deserialization. + func flutterEchoDouble( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aDouble aDoubleArg: Double, + completion: @escaping (Result) -> Void) + /// Returns the passed string, to test serialization and deserialization. + func flutterEchoString( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aString aStringArg: String, + completion: @escaping (Result) -> Void) + /// Returns the passed byte list, to test serialization and deserialization. + func flutterEchoUint8List( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aList aListArg: FlutterStandardTypedData, + completion: @escaping (Result) -> Void) + /// Returns the passed list, to test serialization and deserialization. + func flutterEchoList( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aList aListArg: [Any?], + completion: @escaping (Result<[Any?], ProxyApiTestsError>) -> Void) + /// Returns the passed list with ProxyApis, to test serialization and + /// deserialization. + func flutterEchoProxyApiList( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aList aListArg: [ProxyApiTestClass?], + completion: @escaping (Result<[ProxyApiTestClass?], ProxyApiTestsError>) -> Void) + /// Returns the passed map, to test serialization and deserialization. + func flutterEchoMap( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aMap aMapArg: [String?: Any?], + completion: @escaping (Result<[String?: Any?], ProxyApiTestsError>) -> Void) + /// Returns the passed map with ProxyApis, to test serialization and + /// deserialization. + func flutterEchoProxyApiMap( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, + aMap aMapArg: [String?: ProxyApiTestClass?], + completion: @escaping (Result<[String?: ProxyApiTestClass?], ProxyApiTestsError>) -> Void) + /// Returns the passed enum to test serialization and deserialization. + func flutterEchoEnum( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, anEnum anEnumArg: ProxyApiTestEnum, + completion: @escaping (Result) -> Void) + /// Returns the passed ProxyApi to test serialization and deserialization. + func flutterEchoProxyApi( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aProxyApi aProxyApiArg: ProxyApiSuperClass, + completion: @escaping (Result) -> Void) + /// Returns the passed boolean, to test serialization and deserialization. + func flutterEchoNullableBool( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aBool aBoolArg: Bool?, + completion: @escaping (Result) -> Void) + /// Returns the passed int, to test serialization and deserialization. + func flutterEchoNullableInt( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, anInt anIntArg: Int64?, + completion: @escaping (Result) -> Void) + /// Returns the passed double, to test serialization and deserialization. + func flutterEchoNullableDouble( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aDouble aDoubleArg: Double?, + completion: @escaping (Result) -> Void) + /// Returns the passed string, to test serialization and deserialization. + func flutterEchoNullableString( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aString aStringArg: String?, + completion: @escaping (Result) -> Void) + /// Returns the passed byte list, to test serialization and deserialization. + func flutterEchoNullableUint8List( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aList aListArg: FlutterStandardTypedData?, + completion: @escaping (Result) -> Void) + /// Returns the passed list, to test serialization and deserialization. + func flutterEchoNullableList( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aList aListArg: [Any?]?, + completion: @escaping (Result<[Any?]?, ProxyApiTestsError>) -> Void) + /// Returns the passed map, to test serialization and deserialization. + func flutterEchoNullableMap( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aMap aMapArg: [String?: Any?]?, + completion: @escaping (Result<[String?: Any?]?, ProxyApiTestsError>) -> Void) + /// Returns the passed enum to test serialization and deserialization. + func flutterEchoNullableEnum( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, anEnum anEnumArg: ProxyApiTestEnum?, + completion: @escaping (Result) -> Void) + /// Returns the passed ProxyApi to test serialization and deserialization. + func flutterEchoNullableProxyApi( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, + aProxyApi aProxyApiArg: ProxyApiSuperClass?, + completion: @escaping (Result) -> Void) + /// A no-op function taking no arguments and returning no value, to sanity + /// test basic asynchronous calling. + func flutterNoopAsync( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, + completion: @escaping (Result) -> Void) + /// Returns the passed in generic Object asynchronously. + func flutterEchoAsyncString( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aString aStringArg: String, + completion: @escaping (Result) -> Void) +} + +final class PigeonApiProxyApiTestClass: PigeonApiProtocolProxyApiTestClass { + unowned let pigeonRegistrar: ProxyApiTestsPigeonProxyApiRegistrar + let pigeonDelegate: PigeonApiDelegateProxyApiTestClass + ///An implementation of [ProxyApiSuperClass] used to access callback methods + var pigeonApiProxyApiSuperClass: PigeonApiProxyApiSuperClass { + return pigeonRegistrar.apiDelegate.pigeonApiProxyApiSuperClass(pigeonRegistrar) + } + + ///An implementation of [ProxyApiInterface] used to access callback methods + var pigeonApiProxyApiInterface: PigeonApiProxyApiInterface { + return pigeonRegistrar.apiDelegate.pigeonApiProxyApiInterface(pigeonRegistrar) + } + + init( + pigeonRegistrar: ProxyApiTestsPigeonProxyApiRegistrar, + delegate: PigeonApiDelegateProxyApiTestClass + ) { + self.pigeonRegistrar = pigeonRegistrar + self.pigeonDelegate = delegate + } + static func setUpMessageHandlers( + binaryMessenger: FlutterBinaryMessenger, api: PigeonApiProxyApiTestClass? + ) { + let codec: FlutterStandardMessageCodec = + api != nil + ? FlutterStandardMessageCodec( + readerWriter: ProxyApiTestsPigeonInternalProxyApiCodecReaderWriter( + pigeonRegistrar: api!.pigeonRegistrar)) + : FlutterStandardMessageCodec.sharedInstance() + let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.pigeon_defaultConstructor", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + pigeonDefaultConstructorChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonIdentifierArg = args[0] as! Int64 + let aBoolArg = args[1] as! Bool + let anIntArg = args[2] as! Int64 + let aDoubleArg = args[3] as! Double + let aStringArg = args[4] as! String + let aUint8ListArg = args[5] as! FlutterStandardTypedData + let aListArg = args[6] as! [Any?] + let aMapArg = args[7] as! [String?: Any?] + let anEnumArg = args[8] as! ProxyApiTestEnum + let aProxyApiArg = args[9] as! ProxyApiSuperClass + let aNullableBoolArg: Bool? = nilOrValue(args[10]) + let aNullableIntArg: Int64? = nilOrValue(args[11]) + let aNullableDoubleArg: Double? = nilOrValue(args[12]) + let aNullableStringArg: String? = nilOrValue(args[13]) + let aNullableUint8ListArg: FlutterStandardTypedData? = nilOrValue(args[14]) + let aNullableListArg: [Any?]? = nilOrValue(args[15]) + let aNullableMapArg: [String?: Any?]? = nilOrValue(args[16]) + let aNullableEnumArg: ProxyApiTestEnum? = nilOrValue(args[17]) + let aNullableProxyApiArg: ProxyApiSuperClass? = nilOrValue(args[18]) + let boolParamArg = args[19] as! Bool + let intParamArg = args[20] as! Int64 + let doubleParamArg = args[21] as! Double + let stringParamArg = args[22] as! String + let aUint8ListParamArg = args[23] as! FlutterStandardTypedData + let listParamArg = args[24] as! [Any?] + let mapParamArg = args[25] as! [String?: Any?] + let enumParamArg = args[26] as! ProxyApiTestEnum + let proxyApiParamArg = args[27] as! ProxyApiSuperClass + let nullableBoolParamArg: Bool? = nilOrValue(args[28]) + let nullableIntParamArg: Int64? = nilOrValue(args[29]) + let nullableDoubleParamArg: Double? = nilOrValue(args[30]) + let nullableStringParamArg: String? = nilOrValue(args[31]) + let nullableUint8ListParamArg: FlutterStandardTypedData? = nilOrValue(args[32]) + let nullableListParamArg: [Any?]? = nilOrValue(args[33]) + let nullableMapParamArg: [String?: Any?]? = nilOrValue(args[34]) + let nullableEnumParamArg: ProxyApiTestEnum? = nilOrValue(args[35]) + let nullableProxyApiParamArg: ProxyApiSuperClass? = nilOrValue(args[36]) + do { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + try api.pigeonDelegate.pigeonDefaultConstructor( + pigeonApi: api, aBool: aBoolArg, anInt: anIntArg, aDouble: aDoubleArg, + aString: aStringArg, aUint8List: aUint8ListArg, aList: aListArg, aMap: aMapArg, + anEnum: anEnumArg, aProxyApi: aProxyApiArg, aNullableBool: aNullableBoolArg, + aNullableInt: aNullableIntArg, aNullableDouble: aNullableDoubleArg, + aNullableString: aNullableStringArg, aNullableUint8List: aNullableUint8ListArg, + aNullableList: aNullableListArg, aNullableMap: aNullableMapArg, + aNullableEnum: aNullableEnumArg, aNullableProxyApi: aNullableProxyApiArg, + boolParam: boolParamArg, intParam: intParamArg, doubleParam: doubleParamArg, + stringParam: stringParamArg, aUint8ListParam: aUint8ListParamArg, + listParam: listParamArg, mapParam: mapParamArg, enumParam: enumParamArg, + proxyApiParam: proxyApiParamArg, nullableBoolParam: nullableBoolParamArg, + nullableIntParam: nullableIntParamArg, nullableDoubleParam: nullableDoubleParamArg, + nullableStringParam: nullableStringParamArg, + nullableUint8ListParam: nullableUint8ListParamArg, + nullableListParam: nullableListParamArg, nullableMapParam: nullableMapParamArg, + nullableEnumParam: nullableEnumParamArg, + nullableProxyApiParam: nullableProxyApiParamArg), + withIdentifier: pigeonIdentifierArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + pigeonDefaultConstructorChannel.setMessageHandler(nil) + } + let attachedFieldChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.attachedField", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + attachedFieldChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let pigeonIdentifierArg = args[1] as! Int64 + do { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + try api.pigeonDelegate.attachedField(pigeonApi: api, pigeonInstance: pigeonInstanceArg), + withIdentifier: pigeonIdentifierArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + attachedFieldChannel.setMessageHandler(nil) + } + let staticAttachedFieldChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.staticAttachedField", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + staticAttachedFieldChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonIdentifierArg = args[0] as! Int64 + do { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + try api.pigeonDelegate.staticAttachedField(pigeonApi: api), + withIdentifier: pigeonIdentifierArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + staticAttachedFieldChannel.setMessageHandler(nil) + } + let noopChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.noop", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + noopChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + do { + try api.pigeonDelegate.noop(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + noopChannel.setMessageHandler(nil) + } + let throwErrorChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.throwError", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + throwErrorChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + do { + let result = try api.pigeonDelegate.throwError( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + throwErrorChannel.setMessageHandler(nil) + } + let throwErrorFromVoidChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.throwErrorFromVoid", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + throwErrorFromVoidChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + do { + try api.pigeonDelegate.throwErrorFromVoid( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + throwErrorFromVoidChannel.setMessageHandler(nil) + } + let throwFlutterErrorChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.throwFlutterError", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + throwFlutterErrorChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + do { + let result = try api.pigeonDelegate.throwFlutterError( + pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + throwFlutterErrorChannel.setMessageHandler(nil) + } + let echoIntChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoInt", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoIntChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let anIntArg = args[1] as! Int64 + do { + let result = try api.pigeonDelegate.echoInt( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, anInt: anIntArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoIntChannel.setMessageHandler(nil) + } + let echoDoubleChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoDouble", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoDoubleChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aDoubleArg = args[1] as! Double + do { + let result = try api.pigeonDelegate.echoDouble( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aDouble: aDoubleArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoDoubleChannel.setMessageHandler(nil) + } + let echoBoolChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoBool", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoBoolChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aBoolArg = args[1] as! Bool + do { + let result = try api.pigeonDelegate.echoBool( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aBool: aBoolArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoBoolChannel.setMessageHandler(nil) + } + let echoStringChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoString", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoStringChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aStringArg = args[1] as! String + do { + let result = try api.pigeonDelegate.echoString( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aString: aStringArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoStringChannel.setMessageHandler(nil) + } + let echoUint8ListChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoUint8List", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoUint8ListChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aUint8ListArg = args[1] as! FlutterStandardTypedData + do { + let result = try api.pigeonDelegate.echoUint8List( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aUint8List: aUint8ListArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoUint8ListChannel.setMessageHandler(nil) + } + let echoObjectChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoObject", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoObjectChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let anObjectArg = args[1]! + do { + let result = try api.pigeonDelegate.echoObject( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, anObject: anObjectArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoObjectChannel.setMessageHandler(nil) + } + let echoListChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoList", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoListChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aListArg = args[1] as! [Any?] + do { + let result = try api.pigeonDelegate.echoList( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aList: aListArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoListChannel.setMessageHandler(nil) + } + let echoProxyApiListChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoProxyApiList", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoProxyApiListChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aListArg = args[1] as! [ProxyApiTestClass] + do { + let result = try api.pigeonDelegate.echoProxyApiList( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aList: aListArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoProxyApiListChannel.setMessageHandler(nil) + } + let echoMapChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoMap", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aMapArg = args[1] as! [String?: Any?] + do { + let result = try api.pigeonDelegate.echoMap( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aMap: aMapArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoMapChannel.setMessageHandler(nil) + } + let echoProxyApiMapChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoProxyApiMap", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoProxyApiMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aMapArg = args[1] as! [String: ProxyApiTestClass] + do { + let result = try api.pigeonDelegate.echoProxyApiMap( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aMap: aMapArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoProxyApiMapChannel.setMessageHandler(nil) + } + let echoEnumChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoEnum", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoEnumChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let anEnumArg = args[1] as! ProxyApiTestEnum + do { + let result = try api.pigeonDelegate.echoEnum( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, anEnum: anEnumArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoEnumChannel.setMessageHandler(nil) + } + let echoProxyApiChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoProxyApi", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoProxyApiChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aProxyApiArg = args[1] as! ProxyApiSuperClass + do { + let result = try api.pigeonDelegate.echoProxyApi( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aProxyApi: aProxyApiArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoProxyApiChannel.setMessageHandler(nil) + } + let echoNullableIntChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableInt", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoNullableIntChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aNullableIntArg: Int64? = nilOrValue(args[1]) + do { + let result = try api.pigeonDelegate.echoNullableInt( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aNullableInt: aNullableIntArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoNullableIntChannel.setMessageHandler(nil) + } + let echoNullableDoubleChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableDouble", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoNullableDoubleChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aNullableDoubleArg: Double? = nilOrValue(args[1]) + do { + let result = try api.pigeonDelegate.echoNullableDouble( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aNullableDouble: aNullableDoubleArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoNullableDoubleChannel.setMessageHandler(nil) + } + let echoNullableBoolChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableBool", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoNullableBoolChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aNullableBoolArg: Bool? = nilOrValue(args[1]) + do { + let result = try api.pigeonDelegate.echoNullableBool( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aNullableBool: aNullableBoolArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoNullableBoolChannel.setMessageHandler(nil) + } + let echoNullableStringChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableString", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoNullableStringChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aNullableStringArg: String? = nilOrValue(args[1]) + do { + let result = try api.pigeonDelegate.echoNullableString( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aNullableString: aNullableStringArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoNullableStringChannel.setMessageHandler(nil) + } + let echoNullableUint8ListChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableUint8List", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoNullableUint8ListChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aNullableUint8ListArg: FlutterStandardTypedData? = nilOrValue(args[1]) + do { + let result = try api.pigeonDelegate.echoNullableUint8List( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, + aNullableUint8List: aNullableUint8ListArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoNullableUint8ListChannel.setMessageHandler(nil) + } + let echoNullableObjectChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableObject", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoNullableObjectChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aNullableObjectArg: Any? = args[1] + do { + let result = try api.pigeonDelegate.echoNullableObject( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aNullableObject: aNullableObjectArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoNullableObjectChannel.setMessageHandler(nil) + } + let echoNullableListChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableList", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoNullableListChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aNullableListArg: [Any?]? = nilOrValue(args[1]) + do { + let result = try api.pigeonDelegate.echoNullableList( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aNullableList: aNullableListArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoNullableListChannel.setMessageHandler(nil) + } + let echoNullableMapChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableMap", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoNullableMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aNullableMapArg: [String?: Any?]? = nilOrValue(args[1]) + do { + let result = try api.pigeonDelegate.echoNullableMap( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aNullableMap: aNullableMapArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoNullableMapChannel.setMessageHandler(nil) + } + let echoNullableEnumChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableEnum", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoNullableEnumChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aNullableEnumArg: ProxyApiTestEnum? = nilOrValue(args[1]) + do { + let result = try api.pigeonDelegate.echoNullableEnum( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aNullableEnum: aNullableEnumArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoNullableEnumChannel.setMessageHandler(nil) + } + let echoNullableProxyApiChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableProxyApi", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoNullableProxyApiChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aNullableProxyApiArg: ProxyApiSuperClass? = nilOrValue(args[1]) + do { + let result = try api.pigeonDelegate.echoNullableProxyApi( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, + aNullableProxyApi: aNullableProxyApiArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoNullableProxyApiChannel.setMessageHandler(nil) + } + let noopAsyncChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.noopAsync", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + noopAsyncChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + api.pigeonDelegate.noopAsync(pigeonApi: api, pigeonInstance: pigeonInstanceArg) { result in + switch result { + case .success: + reply(wrapResult(nil)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + noopAsyncChannel.setMessageHandler(nil) + } + let echoAsyncIntChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncInt", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoAsyncIntChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let anIntArg = args[1] as! Int64 + api.pigeonDelegate.echoAsyncInt( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, anInt: anIntArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + echoAsyncIntChannel.setMessageHandler(nil) + } + let echoAsyncDoubleChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncDouble", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoAsyncDoubleChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aDoubleArg = args[1] as! Double + api.pigeonDelegate.echoAsyncDouble( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aDouble: aDoubleArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + echoAsyncDoubleChannel.setMessageHandler(nil) + } + let echoAsyncBoolChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncBool", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoAsyncBoolChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aBoolArg = args[1] as! Bool + api.pigeonDelegate.echoAsyncBool( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aBool: aBoolArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + echoAsyncBoolChannel.setMessageHandler(nil) + } + let echoAsyncStringChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncString", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoAsyncStringChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aStringArg = args[1] as! String + api.pigeonDelegate.echoAsyncString( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aString: aStringArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + echoAsyncStringChannel.setMessageHandler(nil) + } + let echoAsyncUint8ListChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncUint8List", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoAsyncUint8ListChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aUint8ListArg = args[1] as! FlutterStandardTypedData + api.pigeonDelegate.echoAsyncUint8List( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aUint8List: aUint8ListArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + echoAsyncUint8ListChannel.setMessageHandler(nil) + } + let echoAsyncObjectChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncObject", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoAsyncObjectChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let anObjectArg = args[1]! + api.pigeonDelegate.echoAsyncObject( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, anObject: anObjectArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + echoAsyncObjectChannel.setMessageHandler(nil) + } + let echoAsyncListChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncList", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoAsyncListChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aListArg = args[1] as! [Any?] + api.pigeonDelegate.echoAsyncList( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aList: aListArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + echoAsyncListChannel.setMessageHandler(nil) + } + let echoAsyncMapChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncMap", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoAsyncMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aMapArg = args[1] as! [String?: Any?] + api.pigeonDelegate.echoAsyncMap( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aMap: aMapArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + echoAsyncMapChannel.setMessageHandler(nil) + } + let echoAsyncEnumChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncEnum", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoAsyncEnumChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let anEnumArg = args[1] as! ProxyApiTestEnum + api.pigeonDelegate.echoAsyncEnum( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, anEnum: anEnumArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + echoAsyncEnumChannel.setMessageHandler(nil) + } + let throwAsyncErrorChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.throwAsyncError", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + throwAsyncErrorChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + api.pigeonDelegate.throwAsyncError(pigeonApi: api, pigeonInstance: pigeonInstanceArg) { + result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + throwAsyncErrorChannel.setMessageHandler(nil) + } + let throwAsyncErrorFromVoidChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.throwAsyncErrorFromVoid", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + throwAsyncErrorFromVoidChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + api.pigeonDelegate.throwAsyncErrorFromVoid( + pigeonApi: api, pigeonInstance: pigeonInstanceArg + ) { result in + switch result { + case .success: + reply(wrapResult(nil)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + throwAsyncErrorFromVoidChannel.setMessageHandler(nil) + } + let throwAsyncFlutterErrorChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.throwAsyncFlutterError", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + throwAsyncFlutterErrorChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + api.pigeonDelegate.throwAsyncFlutterError(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + throwAsyncFlutterErrorChannel.setMessageHandler(nil) + } + let echoAsyncNullableIntChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableInt", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoAsyncNullableIntChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let anIntArg: Int64? = nilOrValue(args[1]) + api.pigeonDelegate.echoAsyncNullableInt( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, anInt: anIntArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + echoAsyncNullableIntChannel.setMessageHandler(nil) + } + let echoAsyncNullableDoubleChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableDouble", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoAsyncNullableDoubleChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aDoubleArg: Double? = nilOrValue(args[1]) + api.pigeonDelegate.echoAsyncNullableDouble( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aDouble: aDoubleArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + echoAsyncNullableDoubleChannel.setMessageHandler(nil) + } + let echoAsyncNullableBoolChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableBool", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoAsyncNullableBoolChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aBoolArg: Bool? = nilOrValue(args[1]) + api.pigeonDelegate.echoAsyncNullableBool( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aBool: aBoolArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + echoAsyncNullableBoolChannel.setMessageHandler(nil) + } + let echoAsyncNullableStringChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableString", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoAsyncNullableStringChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aStringArg: String? = nilOrValue(args[1]) + api.pigeonDelegate.echoAsyncNullableString( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aString: aStringArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + echoAsyncNullableStringChannel.setMessageHandler(nil) + } + let echoAsyncNullableUint8ListChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableUint8List", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoAsyncNullableUint8ListChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aUint8ListArg: FlutterStandardTypedData? = nilOrValue(args[1]) + api.pigeonDelegate.echoAsyncNullableUint8List( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aUint8List: aUint8ListArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + echoAsyncNullableUint8ListChannel.setMessageHandler(nil) + } + let echoAsyncNullableObjectChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableObject", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoAsyncNullableObjectChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let anObjectArg: Any? = args[1] + api.pigeonDelegate.echoAsyncNullableObject( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, anObject: anObjectArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + echoAsyncNullableObjectChannel.setMessageHandler(nil) + } + let echoAsyncNullableListChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableList", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoAsyncNullableListChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aListArg: [Any?]? = nilOrValue(args[1]) + api.pigeonDelegate.echoAsyncNullableList( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aList: aListArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + echoAsyncNullableListChannel.setMessageHandler(nil) + } + let echoAsyncNullableMapChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableMap", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoAsyncNullableMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aMapArg: [String?: Any?]? = nilOrValue(args[1]) + api.pigeonDelegate.echoAsyncNullableMap( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aMap: aMapArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + echoAsyncNullableMapChannel.setMessageHandler(nil) + } + let echoAsyncNullableEnumChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableEnum", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoAsyncNullableEnumChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let anEnumArg: ProxyApiTestEnum? = nilOrValue(args[1]) + api.pigeonDelegate.echoAsyncNullableEnum( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, anEnum: anEnumArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + echoAsyncNullableEnumChannel.setMessageHandler(nil) + } + let staticNoopChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.staticNoop", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + staticNoopChannel.setMessageHandler { _, reply in + do { + try api.pigeonDelegate.staticNoop(pigeonApi: api) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + staticNoopChannel.setMessageHandler(nil) + } + let echoStaticStringChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoStaticString", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoStaticStringChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let aStringArg = args[0] as! String + do { + let result = try api.pigeonDelegate.echoStaticString(pigeonApi: api, aString: aStringArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoStaticStringChannel.setMessageHandler(nil) + } + let staticAsyncNoopChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.staticAsyncNoop", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + staticAsyncNoopChannel.setMessageHandler { _, reply in + api.pigeonDelegate.staticAsyncNoop(pigeonApi: api) { result in + switch result { + case .success: + reply(wrapResult(nil)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + staticAsyncNoopChannel.setMessageHandler(nil) + } + let callFlutterNoopChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterNoop", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterNoopChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + api.pigeonDelegate.callFlutterNoop(pigeonApi: api, pigeonInstance: pigeonInstanceArg) { + result in + switch result { + case .success: + reply(wrapResult(nil)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterNoopChannel.setMessageHandler(nil) + } + let callFlutterThrowErrorChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterThrowError", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterThrowErrorChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + api.pigeonDelegate.callFlutterThrowError(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterThrowErrorChannel.setMessageHandler(nil) + } + let callFlutterThrowErrorFromVoidChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterThrowErrorFromVoid", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterThrowErrorFromVoidChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + api.pigeonDelegate.callFlutterThrowErrorFromVoid( + pigeonApi: api, pigeonInstance: pigeonInstanceArg + ) { result in + switch result { + case .success: + reply(wrapResult(nil)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterThrowErrorFromVoidChannel.setMessageHandler(nil) + } + let callFlutterEchoBoolChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoBool", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoBoolChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aBoolArg = args[1] as! Bool + api.pigeonDelegate.callFlutterEchoBool( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aBool: aBoolArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoBoolChannel.setMessageHandler(nil) + } + let callFlutterEchoIntChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoInt", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoIntChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let anIntArg = args[1] as! Int64 + api.pigeonDelegate.callFlutterEchoInt( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, anInt: anIntArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoIntChannel.setMessageHandler(nil) + } + let callFlutterEchoDoubleChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoDouble", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoDoubleChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aDoubleArg = args[1] as! Double + api.pigeonDelegate.callFlutterEchoDouble( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aDouble: aDoubleArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoDoubleChannel.setMessageHandler(nil) + } + let callFlutterEchoStringChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoString", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoStringChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aStringArg = args[1] as! String + api.pigeonDelegate.callFlutterEchoString( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aString: aStringArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoStringChannel.setMessageHandler(nil) + } + let callFlutterEchoUint8ListChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoUint8List", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoUint8ListChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aUint8ListArg = args[1] as! FlutterStandardTypedData + api.pigeonDelegate.callFlutterEchoUint8List( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aUint8List: aUint8ListArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoUint8ListChannel.setMessageHandler(nil) + } + let callFlutterEchoListChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoList", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoListChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aListArg = args[1] as! [Any?] + api.pigeonDelegate.callFlutterEchoList( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aList: aListArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoListChannel.setMessageHandler(nil) + } + let callFlutterEchoProxyApiListChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoProxyApiList", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoProxyApiListChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aListArg = args[1] as! [ProxyApiTestClass?] + api.pigeonDelegate.callFlutterEchoProxyApiList( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aList: aListArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoProxyApiListChannel.setMessageHandler(nil) + } + let callFlutterEchoMapChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoMap", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aMapArg = args[1] as! [String?: Any?] + api.pigeonDelegate.callFlutterEchoMap( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aMap: aMapArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoMapChannel.setMessageHandler(nil) + } + let callFlutterEchoProxyApiMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoProxyApiMap", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoProxyApiMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aMapArg = args[1] as! [String?: ProxyApiTestClass?] + api.pigeonDelegate.callFlutterEchoProxyApiMap( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aMap: aMapArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoProxyApiMapChannel.setMessageHandler(nil) + } + let callFlutterEchoEnumChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoEnum", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoEnumChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let anEnumArg = args[1] as! ProxyApiTestEnum + api.pigeonDelegate.callFlutterEchoEnum( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, anEnum: anEnumArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoEnumChannel.setMessageHandler(nil) + } + let callFlutterEchoProxyApiChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoProxyApi", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoProxyApiChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aProxyApiArg = args[1] as! ProxyApiSuperClass + api.pigeonDelegate.callFlutterEchoProxyApi( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aProxyApi: aProxyApiArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoProxyApiChannel.setMessageHandler(nil) + } + let callFlutterEchoNullableBoolChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableBool", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoNullableBoolChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aBoolArg: Bool? = nilOrValue(args[1]) + api.pigeonDelegate.callFlutterEchoNullableBool( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aBool: aBoolArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoNullableBoolChannel.setMessageHandler(nil) + } + let callFlutterEchoNullableIntChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableInt", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoNullableIntChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let anIntArg: Int64? = nilOrValue(args[1]) + api.pigeonDelegate.callFlutterEchoNullableInt( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, anInt: anIntArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoNullableIntChannel.setMessageHandler(nil) + } + let callFlutterEchoNullableDoubleChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableDouble", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoNullableDoubleChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aDoubleArg: Double? = nilOrValue(args[1]) + api.pigeonDelegate.callFlutterEchoNullableDouble( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aDouble: aDoubleArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoNullableDoubleChannel.setMessageHandler(nil) + } + let callFlutterEchoNullableStringChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableString", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoNullableStringChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aStringArg: String? = nilOrValue(args[1]) + api.pigeonDelegate.callFlutterEchoNullableString( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aString: aStringArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoNullableStringChannel.setMessageHandler(nil) + } + let callFlutterEchoNullableUint8ListChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableUint8List", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoNullableUint8ListChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aUint8ListArg: FlutterStandardTypedData? = nilOrValue(args[1]) + api.pigeonDelegate.callFlutterEchoNullableUint8List( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aUint8List: aUint8ListArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoNullableUint8ListChannel.setMessageHandler(nil) + } + let callFlutterEchoNullableListChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableList", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoNullableListChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aListArg: [Any?]? = nilOrValue(args[1]) + api.pigeonDelegate.callFlutterEchoNullableList( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aList: aListArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoNullableListChannel.setMessageHandler(nil) + } + let callFlutterEchoNullableMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableMap", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoNullableMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aMapArg: [String?: Any?]? = nilOrValue(args[1]) + api.pigeonDelegate.callFlutterEchoNullableMap( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aMap: aMapArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoNullableMapChannel.setMessageHandler(nil) + } + let callFlutterEchoNullableEnumChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableEnum", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoNullableEnumChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let anEnumArg: ProxyApiTestEnum? = nilOrValue(args[1]) + api.pigeonDelegate.callFlutterEchoNullableEnum( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, anEnum: anEnumArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoNullableEnumChannel.setMessageHandler(nil) + } + let callFlutterEchoNullableProxyApiChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableProxyApi", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoNullableProxyApiChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aProxyApiArg: ProxyApiSuperClass? = nilOrValue(args[1]) + api.pigeonDelegate.callFlutterEchoNullableProxyApi( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aProxyApi: aProxyApiArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoNullableProxyApiChannel.setMessageHandler(nil) + } + let callFlutterNoopAsyncChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterNoopAsync", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterNoopAsyncChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + api.pigeonDelegate.callFlutterNoopAsync(pigeonApi: api, pigeonInstance: pigeonInstanceArg) { + result in + switch result { + case .success: + reply(wrapResult(nil)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterNoopAsyncChannel.setMessageHandler(nil) + } + let callFlutterEchoAsyncStringChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoAsyncString", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoAsyncStringChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiTestClass + let aStringArg = args[1] as! String + api.pigeonDelegate.callFlutterEchoAsyncString( + pigeonApi: api, pigeonInstance: pigeonInstanceArg, aString: aStringArg + ) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoAsyncStringChannel.setMessageHandler(nil) + } + } + + ///Creates a Dart instance of ProxyApiTestClass and attaches it to [pigeonInstance]. + func pigeonNewInstance( + pigeonInstance: ProxyApiTestClass, + completion: @escaping (Result) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + ProxyApiTestsError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { + completion(.success(Void())) + return + } + let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( + pigeonInstance as AnyObject) + let aBoolArg = try! pigeonDelegate.aBool(pigeonApi: self, pigeonInstance: pigeonInstance) + let anIntArg = try! pigeonDelegate.anInt(pigeonApi: self, pigeonInstance: pigeonInstance) + let aDoubleArg = try! pigeonDelegate.aDouble(pigeonApi: self, pigeonInstance: pigeonInstance) + let aStringArg = try! pigeonDelegate.aString(pigeonApi: self, pigeonInstance: pigeonInstance) + let aUint8ListArg = try! pigeonDelegate.aUint8List( + pigeonApi: self, pigeonInstance: pigeonInstance) + let aListArg = try! pigeonDelegate.aList(pigeonApi: self, pigeonInstance: pigeonInstance) + let aMapArg = try! pigeonDelegate.aMap(pigeonApi: self, pigeonInstance: pigeonInstance) + let anEnumArg = try! pigeonDelegate.anEnum(pigeonApi: self, pigeonInstance: pigeonInstance) + let aProxyApiArg = try! pigeonDelegate.aProxyApi( + pigeonApi: self, pigeonInstance: pigeonInstance) + let aNullableBoolArg = try! pigeonDelegate.aNullableBool( + pigeonApi: self, pigeonInstance: pigeonInstance) + let aNullableIntArg = try! pigeonDelegate.aNullableInt( + pigeonApi: self, pigeonInstance: pigeonInstance) + let aNullableDoubleArg = try! pigeonDelegate.aNullableDouble( + pigeonApi: self, pigeonInstance: pigeonInstance) + let aNullableStringArg = try! pigeonDelegate.aNullableString( + pigeonApi: self, pigeonInstance: pigeonInstance) + let aNullableUint8ListArg = try! pigeonDelegate.aNullableUint8List( + pigeonApi: self, pigeonInstance: pigeonInstance) + let aNullableListArg = try! pigeonDelegate.aNullableList( + pigeonApi: self, pigeonInstance: pigeonInstance) + let aNullableMapArg = try! pigeonDelegate.aNullableMap( + pigeonApi: self, pigeonInstance: pigeonInstance) + let aNullableEnumArg = try! pigeonDelegate.aNullableEnum( + pigeonApi: self, pigeonInstance: pigeonInstance) + let aNullableProxyApiArg = try! pigeonDelegate.aNullableProxyApi( + pigeonApi: self, pigeonInstance: pigeonInstance) + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.pigeon_newInstance" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage( + [ + pigeonIdentifierArg, aBoolArg, anIntArg, aDoubleArg, aStringArg, aUint8ListArg, aListArg, + aMapArg, anEnumArg, aProxyApiArg, aNullableBoolArg, aNullableIntArg, aNullableDoubleArg, + aNullableStringArg, aNullableUint8ListArg, aNullableListArg, aNullableMapArg, + aNullableEnumArg, aNullableProxyApiArg, + ] as [Any?] + ) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(ProxyApiTestsError(code: code, message: message, details: details))) + } else { + completion(.success(Void())) + } + } + } + /// A no-op function taking no arguments and returning no value, to sanity + /// test basic calling. + func flutterNoop( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, + completion: @escaping (Result) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + ProxyApiTestsError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterNoop" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(ProxyApiTestsError(code: code, message: message, details: details))) + } else { + completion(.success(Void())) + } + } + } + + /// Responds with an error from an async function returning a value. + func flutterThrowError( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, + completion: @escaping (Result) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + ProxyApiTestsError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterThrowError" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(ProxyApiTestsError(code: code, message: message, details: details))) + } else { + let result: Any? = listResponse[0] + completion(.success(result)) + } + } + } + + /// Responds with an error from an async void function. + func flutterThrowErrorFromVoid( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, + completion: @escaping (Result) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + ProxyApiTestsError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterThrowErrorFromVoid" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(ProxyApiTestsError(code: code, message: message, details: details))) + } else { + completion(.success(Void())) + } + } + } + + /// Returns the passed boolean, to test serialization and deserialization. + func flutterEchoBool( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aBool aBoolArg: Bool, + completion: @escaping (Result) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + ProxyApiTestsError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoBool" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, aBoolArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(ProxyApiTestsError(code: code, message: message, details: details))) + } else if listResponse[0] == nil { + completion( + .failure( + ProxyApiTestsError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) + } else { + let result = listResponse[0] as! Bool + completion(.success(result)) + } + } + } + + /// Returns the passed int, to test serialization and deserialization. + func flutterEchoInt( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, anInt anIntArg: Int64, + completion: @escaping (Result) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + ProxyApiTestsError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoInt" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, anIntArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(ProxyApiTestsError(code: code, message: message, details: details))) + } else if listResponse[0] == nil { + completion( + .failure( + ProxyApiTestsError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) + } else { + let result = listResponse[0] as! Int64 + completion(.success(result)) + } + } + } + + /// Returns the passed double, to test serialization and deserialization. + func flutterEchoDouble( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aDouble aDoubleArg: Double, + completion: @escaping (Result) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + ProxyApiTestsError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoDouble" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, aDoubleArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(ProxyApiTestsError(code: code, message: message, details: details))) + } else if listResponse[0] == nil { + completion( + .failure( + ProxyApiTestsError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) + } else { + let result = listResponse[0] as! Double + completion(.success(result)) + } + } + } + + /// Returns the passed string, to test serialization and deserialization. + func flutterEchoString( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aString aStringArg: String, + completion: @escaping (Result) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + ProxyApiTestsError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoString" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, aStringArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(ProxyApiTestsError(code: code, message: message, details: details))) + } else if listResponse[0] == nil { + completion( + .failure( + ProxyApiTestsError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) + } else { + let result = listResponse[0] as! String + completion(.success(result)) + } + } + } + + /// Returns the passed byte list, to test serialization and deserialization. + func flutterEchoUint8List( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aList aListArg: FlutterStandardTypedData, + completion: @escaping (Result) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + ProxyApiTestsError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoUint8List" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, aListArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(ProxyApiTestsError(code: code, message: message, details: details))) + } else if listResponse[0] == nil { + completion( + .failure( + ProxyApiTestsError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) + } else { + let result = listResponse[0] as! FlutterStandardTypedData + completion(.success(result)) + } + } + } + + /// Returns the passed list, to test serialization and deserialization. + func flutterEchoList( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aList aListArg: [Any?], + completion: @escaping (Result<[Any?], ProxyApiTestsError>) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + ProxyApiTestsError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoList" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, aListArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(ProxyApiTestsError(code: code, message: message, details: details))) + } else if listResponse[0] == nil { + completion( + .failure( + ProxyApiTestsError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) + } else { + let result = listResponse[0] as! [Any?] + completion(.success(result)) + } + } + } + + /// Returns the passed list with ProxyApis, to test serialization and + /// deserialization. + func flutterEchoProxyApiList( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aList aListArg: [ProxyApiTestClass?], + completion: @escaping (Result<[ProxyApiTestClass?], ProxyApiTestsError>) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + ProxyApiTestsError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoProxyApiList" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, aListArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(ProxyApiTestsError(code: code, message: message, details: details))) + } else if listResponse[0] == nil { + completion( + .failure( + ProxyApiTestsError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) + } else { + let result = listResponse[0] as! [ProxyApiTestClass?] + completion(.success(result)) + } + } + } + + /// Returns the passed map, to test serialization and deserialization. + func flutterEchoMap( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aMap aMapArg: [String?: Any?], + completion: @escaping (Result<[String?: Any?], ProxyApiTestsError>) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + ProxyApiTestsError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoMap" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, aMapArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(ProxyApiTestsError(code: code, message: message, details: details))) + } else if listResponse[0] == nil { + completion( + .failure( + ProxyApiTestsError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) + } else { + let result = listResponse[0] as! [String?: Any?] + completion(.success(result)) + } + } + } + + /// Returns the passed map with ProxyApis, to test serialization and + /// deserialization. + func flutterEchoProxyApiMap( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, + aMap aMapArg: [String?: ProxyApiTestClass?], + completion: @escaping (Result<[String?: ProxyApiTestClass?], ProxyApiTestsError>) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + ProxyApiTestsError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoProxyApiMap" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, aMapArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(ProxyApiTestsError(code: code, message: message, details: details))) + } else if listResponse[0] == nil { + completion( + .failure( + ProxyApiTestsError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) + } else { + let result = listResponse[0] as! [String?: ProxyApiTestClass?] + completion(.success(result)) + } + } + } + + /// Returns the passed enum to test serialization and deserialization. + func flutterEchoEnum( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, anEnum anEnumArg: ProxyApiTestEnum, + completion: @escaping (Result) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + ProxyApiTestsError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoEnum" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, anEnumArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(ProxyApiTestsError(code: code, message: message, details: details))) + } else if listResponse[0] == nil { + completion( + .failure( + ProxyApiTestsError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) + } else { + let result = listResponse[0] as! ProxyApiTestEnum + completion(.success(result)) + } + } + } + + /// Returns the passed ProxyApi to test serialization and deserialization. + func flutterEchoProxyApi( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aProxyApi aProxyApiArg: ProxyApiSuperClass, + completion: @escaping (Result) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + ProxyApiTestsError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoProxyApi" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, aProxyApiArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(ProxyApiTestsError(code: code, message: message, details: details))) + } else if listResponse[0] == nil { + completion( + .failure( + ProxyApiTestsError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) + } else { + let result = listResponse[0] as! ProxyApiSuperClass + completion(.success(result)) + } + } + } + + /// Returns the passed boolean, to test serialization and deserialization. + func flutterEchoNullableBool( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aBool aBoolArg: Bool?, + completion: @escaping (Result) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + ProxyApiTestsError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableBool" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, aBoolArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(ProxyApiTestsError(code: code, message: message, details: details))) + } else { + let result: Bool? = nilOrValue(listResponse[0]) + completion(.success(result)) + } + } + } + + /// Returns the passed int, to test serialization and deserialization. + func flutterEchoNullableInt( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, anInt anIntArg: Int64?, + completion: @escaping (Result) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + ProxyApiTestsError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableInt" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, anIntArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(ProxyApiTestsError(code: code, message: message, details: details))) + } else { + let result: Int64? = nilOrValue(listResponse[0]) + completion(.success(result)) + } + } + } + + /// Returns the passed double, to test serialization and deserialization. + func flutterEchoNullableDouble( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aDouble aDoubleArg: Double?, + completion: @escaping (Result) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + ProxyApiTestsError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableDouble" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, aDoubleArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(ProxyApiTestsError(code: code, message: message, details: details))) + } else { + let result: Double? = nilOrValue(listResponse[0]) + completion(.success(result)) + } + } + } + + /// Returns the passed string, to test serialization and deserialization. + func flutterEchoNullableString( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aString aStringArg: String?, + completion: @escaping (Result) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + ProxyApiTestsError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableString" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, aStringArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(ProxyApiTestsError(code: code, message: message, details: details))) + } else { + let result: String? = nilOrValue(listResponse[0]) + completion(.success(result)) + } + } + } + + /// Returns the passed byte list, to test serialization and deserialization. + func flutterEchoNullableUint8List( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aList aListArg: FlutterStandardTypedData?, + completion: @escaping (Result) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + ProxyApiTestsError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableUint8List" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, aListArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(ProxyApiTestsError(code: code, message: message, details: details))) + } else { + let result: FlutterStandardTypedData? = nilOrValue(listResponse[0]) + completion(.success(result)) + } + } + } + + /// Returns the passed list, to test serialization and deserialization. + func flutterEchoNullableList( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aList aListArg: [Any?]?, + completion: @escaping (Result<[Any?]?, ProxyApiTestsError>) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + ProxyApiTestsError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableList" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, aListArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(ProxyApiTestsError(code: code, message: message, details: details))) + } else { + let result: [Any?]? = nilOrValue(listResponse[0]) + completion(.success(result)) + } + } + } + + /// Returns the passed map, to test serialization and deserialization. + func flutterEchoNullableMap( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aMap aMapArg: [String?: Any?]?, + completion: @escaping (Result<[String?: Any?]?, ProxyApiTestsError>) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + ProxyApiTestsError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableMap" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, aMapArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(ProxyApiTestsError(code: code, message: message, details: details))) + } else { + let result: [String?: Any?]? = nilOrValue(listResponse[0]) + completion(.success(result)) + } + } + } + + /// Returns the passed enum to test serialization and deserialization. + func flutterEchoNullableEnum( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, anEnum anEnumArg: ProxyApiTestEnum?, + completion: @escaping (Result) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + ProxyApiTestsError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableEnum" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, anEnumArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(ProxyApiTestsError(code: code, message: message, details: details))) + } else { + let result: ProxyApiTestEnum? = nilOrValue(listResponse[0]) + completion(.success(result)) + } + } + } + + /// Returns the passed ProxyApi to test serialization and deserialization. + func flutterEchoNullableProxyApi( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, + aProxyApi aProxyApiArg: ProxyApiSuperClass?, + completion: @escaping (Result) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + ProxyApiTestsError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableProxyApi" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, aProxyApiArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(ProxyApiTestsError(code: code, message: message, details: details))) + } else { + let result: ProxyApiSuperClass? = nilOrValue(listResponse[0]) + completion(.success(result)) + } + } + } + + /// A no-op function taking no arguments and returning no value, to sanity + /// test basic asynchronous calling. + func flutterNoopAsync( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, + completion: @escaping (Result) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + ProxyApiTestsError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterNoopAsync" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(ProxyApiTestsError(code: code, message: message, details: details))) + } else { + completion(.success(Void())) + } + } + } + + /// Returns the passed in generic Object asynchronously. + func flutterEchoAsyncString( + pigeonInstance pigeonInstanceArg: ProxyApiTestClass, aString aStringArg: String, + completion: @escaping (Result) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + ProxyApiTestsError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoAsyncString" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg, aStringArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(ProxyApiTestsError(code: code, message: message, details: details))) + } else if listResponse[0] == nil { + completion( + .failure( + ProxyApiTestsError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) + } else { + let result = listResponse[0] as! String + completion(.success(result)) + } + } + } + +} +protocol PigeonApiDelegateProxyApiSuperClass { + func pigeonDefaultConstructor(pigeonApi: PigeonApiProxyApiSuperClass) throws -> ProxyApiSuperClass + func aSuperMethod(pigeonApi: PigeonApiProxyApiSuperClass, pigeonInstance: ProxyApiSuperClass) + throws +} + +protocol PigeonApiProtocolProxyApiSuperClass { +} + +final class PigeonApiProxyApiSuperClass: PigeonApiProtocolProxyApiSuperClass { + unowned let pigeonRegistrar: ProxyApiTestsPigeonProxyApiRegistrar + let pigeonDelegate: PigeonApiDelegateProxyApiSuperClass + init( + pigeonRegistrar: ProxyApiTestsPigeonProxyApiRegistrar, + delegate: PigeonApiDelegateProxyApiSuperClass + ) { + self.pigeonRegistrar = pigeonRegistrar + self.pigeonDelegate = delegate + } + static func setUpMessageHandlers( + binaryMessenger: FlutterBinaryMessenger, api: PigeonApiProxyApiSuperClass? + ) { + let codec: FlutterStandardMessageCodec = + api != nil + ? FlutterStandardMessageCodec( + readerWriter: ProxyApiTestsPigeonInternalProxyApiCodecReaderWriter( + pigeonRegistrar: api!.pigeonRegistrar)) + : FlutterStandardMessageCodec.sharedInstance() + let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiSuperClass.pigeon_defaultConstructor", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + pigeonDefaultConstructorChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonIdentifierArg = args[0] as! Int64 + do { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api), + withIdentifier: pigeonIdentifierArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + pigeonDefaultConstructorChannel.setMessageHandler(nil) + } + let aSuperMethodChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiSuperClass.aSuperMethod", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + aSuperMethodChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ProxyApiSuperClass + do { + try api.pigeonDelegate.aSuperMethod(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + aSuperMethodChannel.setMessageHandler(nil) + } + } + + ///Creates a Dart instance of ProxyApiSuperClass and attaches it to [pigeonInstance]. + func pigeonNewInstance( + pigeonInstance: ProxyApiSuperClass, + completion: @escaping (Result) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + ProxyApiTestsError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { + completion(.success(Void())) + return + } + let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( + pigeonInstance as AnyObject) + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiSuperClass.pigeon_newInstance" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonIdentifierArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(ProxyApiTestsError(code: code, message: message, details: details))) + } else { + completion(.success(Void())) + } + } + } +} +open class PigeonApiDelegateProxyApiInterface { +} + +protocol PigeonApiProtocolProxyApiInterface { + func anInterfaceMethod( + pigeonInstance pigeonInstanceArg: ProxyApiInterface, + completion: @escaping (Result) -> Void) +} + +final class PigeonApiProxyApiInterface: PigeonApiProtocolProxyApiInterface { + unowned let pigeonRegistrar: ProxyApiTestsPigeonProxyApiRegistrar + let pigeonDelegate: PigeonApiDelegateProxyApiInterface + init( + pigeonRegistrar: ProxyApiTestsPigeonProxyApiRegistrar, + delegate: PigeonApiDelegateProxyApiInterface + ) { + self.pigeonRegistrar = pigeonRegistrar + self.pigeonDelegate = delegate + } + ///Creates a Dart instance of ProxyApiInterface and attaches it to [pigeonInstance]. + func pigeonNewInstance( + pigeonInstance: ProxyApiInterface, + completion: @escaping (Result) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + ProxyApiTestsError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { + completion(.success(Void())) + return + } + let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( + pigeonInstance as AnyObject) + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiInterface.pigeon_newInstance" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonIdentifierArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(ProxyApiTestsError(code: code, message: message, details: details))) + } else { + completion(.success(Void())) + } + } + } + func anInterfaceMethod( + pigeonInstance pigeonInstanceArg: ProxyApiInterface, + completion: @escaping (Result) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + ProxyApiTestsError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiInterface.anInterfaceMethod" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonInstanceArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(ProxyApiTestsError(code: code, message: message, details: details))) + } else { + completion(.success(Void())) + } + } + } + +} +protocol PigeonApiDelegateClassWithApiRequirement { + @available(iOS 15.0.0, macOS 10.0.0, *) + func pigeonDefaultConstructor(pigeonApi: PigeonApiClassWithApiRequirement) throws + -> ClassWithApiRequirement + @available(iOS 15.0.0, macOS 10.0.0, *) + func aMethod(pigeonApi: PigeonApiClassWithApiRequirement, pigeonInstance: ClassWithApiRequirement) + throws +} + +protocol PigeonApiProtocolClassWithApiRequirement { +} + +final class PigeonApiClassWithApiRequirement: PigeonApiProtocolClassWithApiRequirement { + unowned let pigeonRegistrar: ProxyApiTestsPigeonProxyApiRegistrar + let pigeonDelegate: PigeonApiDelegateClassWithApiRequirement + init( + pigeonRegistrar: ProxyApiTestsPigeonProxyApiRegistrar, + delegate: PigeonApiDelegateClassWithApiRequirement + ) { + self.pigeonRegistrar = pigeonRegistrar + self.pigeonDelegate = delegate + } + static func setUpMessageHandlers( + binaryMessenger: FlutterBinaryMessenger, api: PigeonApiClassWithApiRequirement? + ) { + let codec: FlutterStandardMessageCodec = + api != nil + ? FlutterStandardMessageCodec( + readerWriter: ProxyApiTestsPigeonInternalProxyApiCodecReaderWriter( + pigeonRegistrar: api!.pigeonRegistrar)) + : FlutterStandardMessageCodec.sharedInstance() + if #available(iOS 15.0.0, macOS 10.0.0, *) { + let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.ClassWithApiRequirement.pigeon_defaultConstructor", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + pigeonDefaultConstructorChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonIdentifierArg = args[0] as! Int64 + do { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + try api.pigeonDelegate.pigeonDefaultConstructor(pigeonApi: api), + withIdentifier: pigeonIdentifierArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + pigeonDefaultConstructorChannel.setMessageHandler(nil) + } + } else { + let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.ClassWithApiRequirement.pigeon_defaultConstructor", + binaryMessenger: binaryMessenger, codec: codec) + if api != nil { + pigeonDefaultConstructorChannel.setMessageHandler { message, reply in + reply( + wrapError( + FlutterError( + code: "PigeonUnsupportedOperationError", + message: + "Call to pigeonDefaultConstructor requires @available(iOS 15.0.0, macOS 10.0.0, *).", + details: nil + ))) + } + } else { + pigeonDefaultConstructorChannel.setMessageHandler(nil) + } + } + if #available(iOS 15.0.0, macOS 10.0.0, *) { + let aMethodChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ClassWithApiRequirement.aMethod", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + aMethodChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let pigeonInstanceArg = args[0] as! ClassWithApiRequirement + do { + try api.pigeonDelegate.aMethod(pigeonApi: api, pigeonInstance: pigeonInstanceArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + aMethodChannel.setMessageHandler(nil) + } + } else { + let aMethodChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.ClassWithApiRequirement.aMethod", + binaryMessenger: binaryMessenger, codec: codec) + if api != nil { + aMethodChannel.setMessageHandler { message, reply in + reply( + wrapError( + FlutterError( + code: "PigeonUnsupportedOperationError", + message: "Call to aMethod requires @available(iOS 15.0.0, macOS 10.0.0, *).", + details: nil + ))) + } + } else { + aMethodChannel.setMessageHandler(nil) + } + } + } + + ///Creates a Dart instance of ClassWithApiRequirement and attaches it to [pigeonInstance]. + @available(iOS 15.0.0, macOS 10.0.0, *) + func pigeonNewInstance( + pigeonInstance: ClassWithApiRequirement, + completion: @escaping (Result) -> Void + ) { + if pigeonRegistrar.ignoreCallsToDart { + completion( + .failure( + ProxyApiTestsError( + code: "ignore-calls-error", + message: "Calls to Dart are being ignored.", details: ""))) + return + } + if pigeonRegistrar.instanceManager.containsInstance(pigeonInstance as AnyObject) { + completion(.success(Void())) + return + } + let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( + pigeonInstance as AnyObject) + let binaryMessenger = pigeonRegistrar.binaryMessenger + let codec = pigeonRegistrar.codec + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.ClassWithApiRequirement.pigeon_newInstance" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([pigeonIdentifierArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(ProxyApiTestsError(code: code, message: message, details: details))) + } else { + completion(.success(Void())) + } + } + } +} diff --git a/packages/pigeon/platform_tests/test_plugin/macos/Classes/TestPlugin.swift b/packages/pigeon/platform_tests/test_plugin/macos/Classes/TestPlugin.swift index af7a7f895579..fb5c21dabf18 100644 --- a/packages/pigeon/platform_tests/test_plugin/macos/Classes/TestPlugin.swift +++ b/packages/pigeon/platform_tests/test_plugin/macos/Classes/TestPlugin.swift @@ -11,12 +11,14 @@ public class TestPlugin: NSObject, FlutterPlugin, HostIntegrationCoreApi { var flutterAPI: FlutterIntegrationCoreApi var flutterSmallApiOne: FlutterSmallApi var flutterSmallApiTwo: FlutterSmallApi + var proxyApiRegistrar: ProxyApiTestsPigeonProxyApiRegistrar? public static func register(with registrar: FlutterPluginRegistrar) { let plugin = TestPlugin(binaryMessenger: registrar.messenger) HostIntegrationCoreApiSetup.setUp(binaryMessenger: registrar.messenger, api: plugin) TestPluginWithSuffix.register(with: registrar, suffix: "suffixOne") TestPluginWithSuffix.register(with: registrar, suffix: "suffixTwo") + registrar.publish(plugin) } init(binaryMessenger: FlutterBinaryMessenger) { @@ -25,6 +27,14 @@ public class TestPlugin: NSObject, FlutterPlugin, HostIntegrationCoreApi { binaryMessenger: binaryMessenger, messageChannelSuffix: "suffixOne") flutterSmallApiTwo = FlutterSmallApi( binaryMessenger: binaryMessenger, messageChannelSuffix: "suffixTwo") + proxyApiRegistrar = ProxyApiTestsPigeonProxyApiRegistrar( + binaryMessenger: binaryMessenger, apiDelegate: ProxyApiDelegate()) + proxyApiRegistrar!.setUp() + } + + public func detachFromEngine(for registrar: FlutterPluginRegistrar) { + proxyApiRegistrar!.tearDown() + proxyApiRegistrar = nil } // MARK: HostIntegrationCoreApi implementation @@ -86,8 +96,56 @@ public class TestPlugin: NSObject, FlutterPlugin, HostIntegrationCoreApi { return list } - func echo(_ aMap: [String?: Any?]) throws -> [String?: Any?] { - return aMap + func echo(enumList: [AnEnum?]) throws -> [AnEnum?] { + return enumList + } + + func echo(classList: [AllNullableTypes?]) throws -> [AllNullableTypes?] { + return classList + } + + func echoNonNull(enumList: [AnEnum]) throws -> [AnEnum] { + return enumList + } + + func echoNonNull(classList: [AllNullableTypes]) throws -> [AllNullableTypes] { + return classList + } + + func echo(_ map: [AnyHashable?: Any?]) throws -> [AnyHashable?: Any?] { + return map + } + + func echo(stringMap: [String?: String?]) throws -> [String?: String?] { + return stringMap + } + + func echo(intMap: [Int64?: Int64?]) throws -> [Int64?: Int64?] { + return intMap + } + + func echo(enumMap: [AnEnum?: AnEnum?]) throws -> [AnEnum?: AnEnum?] { + return enumMap + } + + func echo(classMap: [Int64?: AllNullableTypes?]) throws -> [Int64?: AllNullableTypes?] { + return classMap + } + + func echoNonNull(stringMap: [String: String]) throws -> [String: String] { + return stringMap + } + + func echoNonNull(intMap: [Int64: Int64]) throws -> [Int64: Int64] { + return intMap + } + + func echoNonNull(enumMap: [AnEnum: AnEnum]) throws -> [AnEnum: AnEnum] { + return enumMap + } + + func echoNonNull(classMap: [Int64: AllNullableTypes]) throws -> [Int64: AllNullableTypes] { + return classMap } func echo(_ wrapper: AllClassesWrapper) throws -> AllClassesWrapper { @@ -107,7 +165,9 @@ public class TestPlugin: NSObject, FlutterPlugin, HostIntegrationCoreApi { } func createNestedObject(with nullableString: String?) -> AllClassesWrapper { - return AllClassesWrapper(allNullableTypes: AllNullableTypes(aNullableString: nullableString)) + return AllClassesWrapper( + allNullableTypes: AllNullableTypes(aNullableString: nullableString), classList: [], + classMap: [:]) } func sendMultipleNullableTypes( @@ -166,8 +226,58 @@ public class TestPlugin: NSObject, FlutterPlugin, HostIntegrationCoreApi { return aNullableList } - func echoNullable(_ aNullableMap: [String?: Any?]?) throws -> [String?: Any?]? { - return aNullableMap + func echoNullable(enumList: [AnEnum?]?) throws -> [AnEnum?]? { + return enumList + } + + func echoNullable(classList: [AllNullableTypes?]?) throws -> [AllNullableTypes?]? { + return classList + } + + func echoNullableNonNull(enumList: [AnEnum]?) throws -> [AnEnum]? { + return enumList + } + + func echoNullableNonNull(classList: [AllNullableTypes]?) throws -> [AllNullableTypes]? { + return classList + } + + func echoNullable(_ map: [AnyHashable?: Any?]?) throws -> [AnyHashable?: Any?]? { + return map + } + + func echoNullable(stringMap: [String?: String?]?) throws -> [String?: String?]? { + return stringMap + } + + func echoNullable(intMap: [Int64?: Int64?]?) throws -> [Int64?: Int64?]? { + return intMap + } + + func echoNullable(enumMap: [AnEnum?: AnEnum?]?) throws -> [AnEnum?: AnEnum?]? { + return enumMap + } + + func echoNullable(classMap: [Int64?: AllNullableTypes?]?) throws -> [Int64?: AllNullableTypes?]? { + return classMap + } + + func echoNullableNonNull(stringMap: [String: String]?) throws -> [String: String]? { + return stringMap + } + + func echoNullableNonNull(intMap: [Int64: Int64]?) throws -> [Int64: Int64]? { + return intMap + } + + func echoNullableNonNull(enumMap: [AnEnum: AnEnum]?) throws -> [AnEnum: AnEnum]? { + return enumMap + } + + func echoNullableNonNull(classMap: [Int64: AllNullableTypes]?) throws -> [Int64: + AllNullableTypes]? + { + return classMap } func echoNullable(_ anEnum: AnEnum?) throws -> AnEnum? { @@ -251,10 +361,46 @@ public class TestPlugin: NSObject, FlutterPlugin, HostIntegrationCoreApi { completion(.success(list)) } + func echoAsync(enumList: [AnEnum?], completion: @escaping (Result<[AnEnum?], Error>) -> Void) { + completion(.success(enumList)) + } + + func echoAsync( + classList: [AllNullableTypes?], + completion: @escaping (Result<[AllNullableTypes?], Error>) -> Void + ) { + completion(.success(classList)) + } + + func echoAsync( + _ map: [AnyHashable?: Any?], completion: @escaping (Result<[AnyHashable?: Any?], Error>) -> Void + ) { + completion(.success(map)) + } + + func echoAsync( + stringMap: [String?: String?], completion: @escaping (Result<[String?: String?], Error>) -> Void + ) { + completion(.success(stringMap)) + } + + func echoAsync( + intMap: [Int64?: Int64?], completion: @escaping (Result<[Int64?: Int64?], Error>) -> Void + ) { + completion(.success(intMap)) + } + + func echoAsync( + enumMap: [AnEnum?: AnEnum?], completion: @escaping (Result<[AnEnum?: AnEnum?], Error>) -> Void + ) { + completion(.success(enumMap)) + } + func echoAsync( - _ aMap: [String?: Any?], completion: @escaping (Result<[String?: Any?], Error>) -> Void + classMap: [Int64?: AllNullableTypes?], + completion: @escaping (Result<[Int64?: AllNullableTypes?], Error>) -> Void ) { - completion(.success(aMap)) + completion(.success(classMap)) } func echoAsync(_ anEnum: AnEnum, completion: @escaping (Result) -> Void) { @@ -301,13 +447,54 @@ public class TestPlugin: NSObject, FlutterPlugin, HostIntegrationCoreApi { } func echoAsyncNullable( - _ aMap: [String?: Any?]?, completion: @escaping (Result<[String?: Any?]?, Error>) -> Void + enumList: [AnEnum?]?, completion: @escaping (Result<[AnEnum?]?, Error>) -> Void ) { - completion(.success(aMap)) + completion(.success(enumList)) } - func echoAsyncNullable(_ anEnum: AnEnum?, completion: @escaping (Result) -> Void) - { + func echoAsyncNullable( + classList: [AllNullableTypes?]?, + completion: @escaping (Result<[AllNullableTypes?]?, Error>) -> Void + ) { + completion(.success(classList)) + } + + func echoAsyncNullable( + _ map: [AnyHashable?: Any?]?, + completion: @escaping (Result<[AnyHashable?: Any?]?, Error>) -> Void + ) { + completion(.success(map)) + } + + func echoAsyncNullable( + stringMap: [String?: String?]?, + completion: @escaping (Result<[String?: String?]?, Error>) -> Void + ) { + completion(.success(stringMap)) + } + + func echoAsyncNullable( + intMap: [Int64?: Int64?]?, completion: @escaping (Result<[Int64?: Int64?]?, Error>) -> Void + ) { + completion(.success(intMap)) + } + + func echoAsyncNullable( + enumMap: [AnEnum?: AnEnum?]?, completion: @escaping (Result<[AnEnum?: AnEnum?]?, Error>) -> Void + ) { + completion(.success(enumMap)) + } + + func echoAsyncNullable( + classMap: [Int64?: AllNullableTypes?]?, + completion: @escaping (Result<[Int64?: AllNullableTypes?]?, Error>) -> Void + ) { + completion(.success(classMap)) + } + + func echoAsyncNullable( + _ anEnum: AnEnum?, completion: @escaping (Result) -> Void + ) { completion(.success(anEnum)) } @@ -499,9 +686,168 @@ public class TestPlugin: NSObject, FlutterPlugin, HostIntegrationCoreApi { } func callFlutterEcho( - _ aMap: [String?: Any?], completion: @escaping (Result<[String?: Any?], Error>) -> Void + enumList: [AnEnum?], completion: @escaping (Result<[AnEnum?], Error>) -> Void + ) { + flutterAPI.echo(enumList: enumList) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEcho( + classList: [AllNullableTypes?], + completion: @escaping (Result<[AllNullableTypes?], Error>) -> Void + ) { + flutterAPI.echo(classList: classList) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoNonNull( + enumList: [AnEnum], completion: @escaping (Result<[AnEnum], Error>) -> Void + ) { + flutterAPI.echoNonNull(enumList: enumList) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoNonNull( + classList: [AllNullableTypes], completion: @escaping (Result<[AllNullableTypes], Error>) -> Void + ) { + flutterAPI.echoNonNull(classList: classList) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEcho( + _ map: [AnyHashable?: Any?], completion: @escaping (Result<[AnyHashable?: Any?], Error>) -> Void + ) { + flutterAPI.echo(map) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEcho( + stringMap: [String?: String?], completion: @escaping (Result<[String?: String?], Error>) -> Void + ) { + flutterAPI.echo(stringMap: stringMap) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEcho( + intMap: [Int64?: Int64?], completion: @escaping (Result<[Int64?: Int64?], Error>) -> Void + ) { + flutterAPI.echo(intMap: intMap) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEcho( + enumMap: [AnEnum?: AnEnum?], completion: @escaping (Result<[AnEnum?: AnEnum?], Error>) -> Void + ) { + flutterAPI.echo(enumMap: enumMap) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEcho( + classMap: [Int64?: AllNullableTypes?], + completion: @escaping (Result<[Int64?: AllNullableTypes?], Error>) -> Void + ) { + flutterAPI.echo(classMap: classMap) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoNonNull( + stringMap: [String: String], completion: @escaping (Result<[String: String], Error>) -> Void + ) { + flutterAPI.echoNonNull(stringMap: stringMap) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoNonNull( + intMap: [Int64: Int64], completion: @escaping (Result<[Int64: Int64], Error>) -> Void + ) { + flutterAPI.echoNonNull(intMap: intMap) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoNonNull( + enumMap: [AnEnum: AnEnum], completion: @escaping (Result<[AnEnum: AnEnum], Error>) -> Void + ) { + flutterAPI.echoNonNull(enumMap: enumMap) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoNonNull( + classMap: [Int64: AllNullableTypes], + completion: @escaping (Result<[Int64: AllNullableTypes], Error>) -> Void ) { - flutterAPI.echo(aMap) { response in + flutterAPI.echoNonNull(classMap: classMap) { response in switch response { case .success(let res): completion(.success(res)) @@ -511,7 +857,9 @@ public class TestPlugin: NSObject, FlutterPlugin, HostIntegrationCoreApi { } } - func callFlutterEcho(_ anEnum: AnEnum, completion: @escaping (Result) -> Void) { + func callFlutterEcho( + _ anEnum: AnEnum, completion: @escaping (Result) -> Void + ) { flutterAPI.echo(anEnum) { response in switch response { case .success(let res): @@ -614,9 +962,9 @@ public class TestPlugin: NSObject, FlutterPlugin, HostIntegrationCoreApi { } func callFlutterEchoNullable( - _ aMap: [String?: Any?]?, completion: @escaping (Result<[String?: Any?]?, Error>) -> Void + enumList: [AnEnum?]?, completion: @escaping (Result<[AnEnum?]?, Error>) -> Void ) { - flutterAPI.echoNullable(aMap) { response in + flutterAPI.echoNullable(enumList: enumList) { response in switch response { case .success(let res): completion(.success(res)) @@ -627,9 +975,37 @@ public class TestPlugin: NSObject, FlutterPlugin, HostIntegrationCoreApi { } func callFlutterEchoNullable( - _ anEnum: AnEnum?, completion: @escaping (Result) -> Void + classList: [AllNullableTypes?]?, + completion: @escaping (Result<[AllNullableTypes?]?, Error>) -> Void ) { - flutterAPI.echoNullable(anEnum) { response in + flutterAPI.echoNullable(classList: classList) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoNullableNonNull( + enumList: [AnEnum]?, completion: @escaping (Result<[AnEnum]?, Error>) -> Void + ) { + flutterAPI.echoNullableNonNull(enumList: enumList) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoNullableNonNull( + classList: [AllNullableTypes]?, + completion: @escaping (Result<[AllNullableTypes]?, Error>) -> Void + ) { + flutterAPI.echoNullableNonNull(classList: classList) { response in switch response { case .success(let res): completion(.success(res)) @@ -640,9 +1016,10 @@ public class TestPlugin: NSObject, FlutterPlugin, HostIntegrationCoreApi { } func callFlutterEchoNullable( - _ anotherEnum: AnotherEnum?, completion: @escaping (Result) -> Void + _ map: [AnyHashable?: Any?]?, + completion: @escaping (Result<[AnyHashable?: Any?]?, Error>) -> Void ) { - flutterAPI.echoNullable(anotherEnum) { response in + flutterAPI.echoNullable(map) { response in switch response { case .success(let res): completion(.success(res)) @@ -652,8 +1029,141 @@ public class TestPlugin: NSObject, FlutterPlugin, HostIntegrationCoreApi { } } - func callFlutterSmallApiEcho( - _ aString: String, completion: @escaping (Result) -> Void + func callFlutterEchoNullable( + stringMap: [String?: String?]?, + completion: @escaping (Result<[String?: String?]?, Error>) -> Void + ) { + flutterAPI.echoNullable(stringMap: stringMap) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoNullable( + intMap: [Int64?: Int64?]?, completion: @escaping (Result<[Int64?: Int64?]?, Error>) -> Void + ) { + flutterAPI.echoNullable(intMap: intMap) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoNullable( + enumMap: [AnEnum?: AnEnum?]?, completion: @escaping (Result<[AnEnum?: AnEnum?]?, Error>) -> Void + ) { + flutterAPI.echoNullable(enumMap: enumMap) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoNullable( + classMap: [Int64?: AllNullableTypes?]?, + completion: @escaping (Result<[Int64?: AllNullableTypes?]?, Error>) -> Void + ) { + flutterAPI.echoNullable(classMap: classMap) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoNullableNonNull( + stringMap: [String: String]?, completion: @escaping (Result<[String: String]?, Error>) -> Void + ) { + flutterAPI.echoNullableNonNull(stringMap: stringMap) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoNullableNonNull( + intMap: [Int64: Int64]?, completion: @escaping (Result<[Int64: Int64]?, Error>) -> Void + ) { + flutterAPI.echoNullableNonNull(intMap: intMap) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoNullableNonNull( + enumMap: [AnEnum: AnEnum]?, completion: @escaping (Result<[AnEnum: AnEnum]?, Error>) -> Void + ) { + flutterAPI.echoNullableNonNull(enumMap: enumMap) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoNullableNonNull( + classMap: [Int64: AllNullableTypes]?, + completion: @escaping (Result<[Int64: AllNullableTypes]?, Error>) -> Void + ) { + flutterAPI.echoNullableNonNull(classMap: classMap) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoNullable( + _ anEnum: AnEnum?, completion: @escaping (Result) -> Void + ) { + flutterAPI.echoNullable(anEnum) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoNullable( + _ anotherEnum: AnotherEnum?, completion: @escaping (Result) -> Void + ) { + flutterAPI.echoNullable(anotherEnum) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterSmallApiEcho( + _ aString: String, completion: @escaping (Result) -> Void ) { flutterSmallApiOne.echo(string: aString) { responseOne in self.flutterSmallApiTwo.echo(string: aString) { responseTwo in @@ -680,6 +1190,10 @@ public class TestPlugin: NSObject, FlutterPlugin, HostIntegrationCoreApi { } } } + + func testUnusedClassesGenerate() -> UnusedClass { + return UnusedClass() + } } public class TestPluginWithSuffix: HostSmallApi { @@ -698,3 +1212,910 @@ public class TestPluginWithSuffix: HostSmallApi { } } + +class ProxyApiDelegate: ProxyApiTestsPigeonProxyApiDelegate { + func pigeonApiProxyApiTestClass(_ registrar: ProxyApiTestsPigeonProxyApiRegistrar) + -> PigeonApiProxyApiTestClass + { + class ProxyApiTestClassDelegate: PigeonApiDelegateProxyApiTestClass { + func pigeonDefaultConstructor( + pigeonApi: PigeonApiProxyApiTestClass, aBool: Bool, anInt: Int64, aDouble: Double, + aString: String, aUint8List: FlutterStandardTypedData, aList: [Any?], aMap: [String?: Any?], + anEnum: ProxyApiTestEnum, aProxyApi: ProxyApiSuperClass, aNullableBool: Bool?, + aNullableInt: Int64?, aNullableDouble: Double?, aNullableString: String?, + aNullableUint8List: FlutterStandardTypedData?, aNullableList: [Any?]?, + aNullableMap: [String?: Any?]?, aNullableEnum: ProxyApiTestEnum?, + aNullableProxyApi: ProxyApiSuperClass?, boolParam: Bool, intParam: Int64, + doubleParam: Double, stringParam: String, aUint8ListParam: FlutterStandardTypedData, + listParam: [Any?], mapParam: [String?: Any?], enumParam: ProxyApiTestEnum, + proxyApiParam: ProxyApiSuperClass, nullableBoolParam: Bool?, nullableIntParam: Int64?, + nullableDoubleParam: Double?, nullableStringParam: String?, + nullableUint8ListParam: FlutterStandardTypedData?, nullableListParam: [Any?]?, + nullableMapParam: [String?: Any?]?, nullableEnumParam: ProxyApiTestEnum?, + nullableProxyApiParam: ProxyApiSuperClass? + ) throws -> ProxyApiTestClass { + return ProxyApiTestClass() + } + + func attachedField(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) + throws -> ProxyApiSuperClass + { + return ProxyApiSuperClass() + } + + func staticAttachedField(pigeonApi: PigeonApiProxyApiTestClass) throws -> ProxyApiSuperClass { + return ProxyApiSuperClass() + } + + func aBool(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) throws + -> Bool + { + return true + } + + func anInt(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) throws + -> Int64 + { + return 0 + } + + func aDouble(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) throws + -> Double + { + return 0.0 + } + + func aString(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) throws + -> String + { + return "" + } + + func aUint8List(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) + throws -> FlutterStandardTypedData + { + return FlutterStandardTypedData(bytes: Data()) + } + + func aList(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) throws + -> [Any?] + { + return [] + } + + func aMap(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) throws + -> [String?: Any?] + { + return [:] + } + + func anEnum(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) throws + -> ProxyApiTestEnum + { + return ProxyApiTestEnum.one + } + + func aProxyApi(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) + throws -> ProxyApiSuperClass + { + return ProxyApiSuperClass() + } + + func aNullableBool(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) + throws -> Bool? + { + return nil + } + + func aNullableInt(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) + throws -> Int64? + { + return nil + } + + func aNullableDouble(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) + throws -> Double? + { + return nil + } + + func aNullableString(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) + throws -> String? + { + return nil + } + + func aNullableUint8List( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass + ) throws -> FlutterStandardTypedData? { + return nil + } + + func aNullableList(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) + throws -> [Any?]? + { + return nil + } + + func aNullableMap(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) + throws -> [String?: Any?]? + { + return nil + } + + func aNullableEnum(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) + throws -> ProxyApiTestEnum? + { + return nil + } + + func aNullableProxyApi( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass + ) throws -> ProxyApiSuperClass? { + return nil + } + + func noop(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) throws { + } + + func throwError(pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass) + throws -> Any? + { + throw ProxyApiTestsError(code: "code", message: "message", details: "details") + } + + func throwErrorFromVoid( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass + ) throws { + throw ProxyApiTestsError(code: "code", message: "message", details: "details") + } + + func throwFlutterError( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass + ) throws -> Any? { + throw ProxyApiTestsError(code: "code", message: "message", details: "details") + } + + func echoInt( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, anInt: Int64 + ) throws -> Int64 { + return anInt + } + + func echoDouble( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aDouble: Double + ) throws -> Double { + return aDouble + } + + func echoBool( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aBool: Bool + ) throws -> Bool { + return aBool + } + + func echoString( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aString: String + ) throws -> String { + return aString + } + + func echoUint8List( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aUint8List: FlutterStandardTypedData + ) throws -> FlutterStandardTypedData { + return aUint8List + } + + func echoObject( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, anObject: Any + ) throws -> Any { + return anObject + } + + func echoList( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aList: [Any?] + ) throws -> [Any?] { + return aList + } + + func echoProxyApiList( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aList: [ProxyApiTestClass] + ) throws -> [ProxyApiTestClass] { + return aList + } + + func echoMap( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aMap: [String?: Any?] + ) throws -> [String?: Any?] { + return aMap + } + + func echoProxyApiMap( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aMap: [String: ProxyApiTestClass] + ) throws -> [String: ProxyApiTestClass] { + return aMap + } + + func echoEnum( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + anEnum: ProxyApiTestEnum + ) throws -> ProxyApiTestEnum { + return anEnum + } + + func echoProxyApi( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aProxyApi: ProxyApiSuperClass + ) throws -> ProxyApiSuperClass { + return aProxyApi + } + + func echoNullableInt( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aNullableInt: Int64? + ) throws -> Int64? { + return aNullableInt + } + + func echoNullableDouble( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aNullableDouble: Double? + ) throws -> Double? { + return aNullableDouble + } + + func echoNullableBool( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aNullableBool: Bool? + ) throws -> Bool? { + return aNullableBool + } + + func echoNullableString( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aNullableString: String? + ) throws -> String? { + return aNullableString + } + + func echoNullableUint8List( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aNullableUint8List: FlutterStandardTypedData? + ) throws -> FlutterStandardTypedData? { + return aNullableUint8List + } + + func echoNullableObject( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aNullableObject: Any? + ) throws -> Any? { + return aNullableObject + } + + func echoNullableList( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aNullableList: [Any?]? + ) throws -> [Any?]? { + return aNullableList + } + + func echoNullableMap( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aNullableMap: [String?: Any?]? + ) throws -> [String?: Any?]? { + return aNullableMap + } + + func echoNullableEnum( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aNullableEnum: ProxyApiTestEnum? + ) throws -> ProxyApiTestEnum? { + return aNullableEnum + } + + func echoNullableProxyApi( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aNullableProxyApi: ProxyApiSuperClass? + ) throws -> ProxyApiSuperClass? { + return aNullableProxyApi + } + + func noopAsync( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + completion: @escaping (Result) -> Void + ) { + completion(.success(Void())) + } + + func echoAsyncInt( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, anInt: Int64, + completion: @escaping (Result) -> Void + ) { + completion(.success(anInt)) + } + + func echoAsyncDouble( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aDouble: Double, + completion: @escaping (Result) -> Void + ) { + completion(.success(aDouble)) + } + + func echoAsyncBool( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aBool: Bool, + completion: @escaping (Result) -> Void + ) { + completion(.success(aBool)) + } + + func echoAsyncString( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aString: String, + completion: @escaping (Result) -> Void + ) { + completion(.success(aString)) + } + + func echoAsyncUint8List( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aUint8List: FlutterStandardTypedData, + completion: @escaping (Result) -> Void + ) { + completion(.success(aUint8List)) + } + + func echoAsyncObject( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, anObject: Any, + completion: @escaping (Result) -> Void + ) { + completion(.success(anObject)) + } + + func echoAsyncList( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aList: [Any?], + completion: @escaping (Result<[Any?], Error>) -> Void + ) { + completion(.success(aList)) + } + + func echoAsyncMap( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aMap: [String?: Any?], completion: @escaping (Result<[String?: Any?], Error>) -> Void + ) { + completion(.success(aMap)) + } + + func echoAsyncEnum( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + anEnum: ProxyApiTestEnum, completion: @escaping (Result) -> Void + ) { + completion(.success(anEnum)) + } + + func throwAsyncError( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + completion: @escaping (Result) -> Void + ) { + completion( + .failure(ProxyApiTestsError(code: "code", message: "message", details: "details"))) + } + + func throwAsyncErrorFromVoid( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + completion: @escaping (Result) -> Void + ) { + completion( + .failure(ProxyApiTestsError(code: "code", message: "message", details: "details"))) + } + + func throwAsyncFlutterError( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + completion: @escaping (Result) -> Void + ) { + completion( + .failure(ProxyApiTestsError(code: "code", message: "message", details: "details"))) + } + + func echoAsyncNullableInt( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, anInt: Int64?, + completion: @escaping (Result) -> Void + ) { + completion(.success(anInt)) + } + + func echoAsyncNullableDouble( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aDouble: Double?, + completion: @escaping (Result) -> Void + ) { + completion(.success(aDouble)) + } + + func echoAsyncNullableBool( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aBool: Bool?, + completion: @escaping (Result) -> Void + ) { + completion(.success(aBool)) + } + + func echoAsyncNullableString( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aString: String?, + completion: @escaping (Result) -> Void + ) { + completion(.success(aString)) + } + + func echoAsyncNullableUint8List( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aUint8List: FlutterStandardTypedData?, + completion: @escaping (Result) -> Void + ) { + completion(.success(aUint8List)) + } + + func echoAsyncNullableObject( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, anObject: Any?, + completion: @escaping (Result) -> Void + ) { + completion(.success(anObject)) + } + + func echoAsyncNullableList( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aList: [Any?]?, + completion: @escaping (Result<[Any?]?, Error>) -> Void + ) { + completion(.success(aList)) + } + + func echoAsyncNullableMap( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aMap: [String?: Any?]?, completion: @escaping (Result<[String?: Any?]?, Error>) -> Void + ) { + completion(.success(aMap)) + } + + func echoAsyncNullableEnum( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + anEnum: ProxyApiTestEnum?, completion: @escaping (Result) -> Void + ) { + completion(.success(anEnum)) + } + + func staticNoop(pigeonApi: PigeonApiProxyApiTestClass) throws { + + } + + func echoStaticString(pigeonApi: PigeonApiProxyApiTestClass, aString: String) throws -> String + { + return aString + } + + func staticAsyncNoop( + pigeonApi: PigeonApiProxyApiTestClass, completion: @escaping (Result) -> Void + ) { + completion(.success(Void())) + } + + func callFlutterNoop( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + completion: @escaping (Result) -> Void + ) { + pigeonApi.flutterNoop(pigeonInstance: pigeonInstance) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterThrowError( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + completion: @escaping (Result) -> Void + ) { + pigeonApi.flutterThrowError(pigeonInstance: pigeonInstance) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterThrowErrorFromVoid( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + completion: @escaping (Result) -> Void + ) { + pigeonApi.flutterThrowErrorFromVoid(pigeonInstance: pigeonInstance) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoBool( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aBool: Bool, + completion: @escaping (Result) -> Void + ) { + pigeonApi.flutterEchoBool(pigeonInstance: pigeonInstance, aBool: aBool) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoInt( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, anInt: Int64, + completion: @escaping (Result) -> Void + ) { + pigeonApi.flutterEchoInt(pigeonInstance: pigeonInstance, anInt: anInt) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoDouble( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aDouble: Double, + completion: @escaping (Result) -> Void + ) { + pigeonApi.flutterEchoDouble(pigeonInstance: pigeonInstance, aDouble: aDouble) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoString( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aString: String, + completion: @escaping (Result) -> Void + ) { + pigeonApi.flutterEchoString(pigeonInstance: pigeonInstance, aString: aString) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoUint8List( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aUint8List: FlutterStandardTypedData, + completion: @escaping (Result) -> Void + ) { + pigeonApi.flutterEchoUint8List(pigeonInstance: pigeonInstance, aList: aUint8List) { + response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoList( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aList: [Any?], + completion: @escaping (Result<[Any?], Error>) -> Void + ) { + pigeonApi.flutterEchoList(pigeonInstance: pigeonInstance, aList: aList) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoProxyApiList( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aList: [ProxyApiTestClass?], + completion: @escaping (Result<[ProxyApiTestClass?], Error>) -> Void + ) { + pigeonApi.flutterEchoProxyApiList(pigeonInstance: pigeonInstance, aList: aList) { + response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoMap( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aMap: [String?: Any?], completion: @escaping (Result<[String?: Any?], Error>) -> Void + ) { + pigeonApi.flutterEchoMap(pigeonInstance: pigeonInstance, aMap: aMap) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoProxyApiMap( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aMap: [String?: ProxyApiTestClass?], + completion: @escaping (Result<[String?: ProxyApiTestClass?], Error>) -> Void + ) { + pigeonApi.flutterEchoProxyApiMap(pigeonInstance: pigeonInstance, aMap: aMap) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoEnum( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + anEnum: ProxyApiTestEnum, completion: @escaping (Result) -> Void + ) { + pigeonApi.flutterEchoEnum(pigeonInstance: pigeonInstance, anEnum: anEnum) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoProxyApi( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aProxyApi: ProxyApiSuperClass, + completion: @escaping (Result) -> Void + ) { + pigeonApi.flutterEchoProxyApi(pigeonInstance: pigeonInstance, aProxyApi: aProxyApi) { + response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoNullableBool( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aBool: Bool?, + completion: @escaping (Result) -> Void + ) { + pigeonApi.flutterEchoNullableBool(pigeonInstance: pigeonInstance, aBool: aBool) { + response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoNullableInt( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, anInt: Int64?, + completion: @escaping (Result) -> Void + ) { + pigeonApi.flutterEchoNullableInt(pigeonInstance: pigeonInstance, anInt: anInt) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoNullableDouble( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aDouble: Double?, + completion: @escaping (Result) -> Void + ) { + pigeonApi.flutterEchoNullableDouble(pigeonInstance: pigeonInstance, aDouble: aDouble) { + response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoNullableString( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aString: String?, + completion: @escaping (Result) -> Void + ) { + pigeonApi.flutterEchoNullableString(pigeonInstance: pigeonInstance, aString: aString) { + response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoNullableUint8List( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aUint8List: FlutterStandardTypedData?, + completion: @escaping (Result) -> Void + ) { + pigeonApi.flutterEchoNullableUint8List(pigeonInstance: pigeonInstance, aList: aUint8List) { + response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoNullableList( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aList: [Any?]?, + completion: @escaping (Result<[Any?]?, Error>) -> Void + ) { + pigeonApi.flutterEchoNullableList(pigeonInstance: pigeonInstance, aList: aList) { + response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoNullableMap( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aMap: [String?: Any?]?, completion: @escaping (Result<[String?: Any?]?, Error>) -> Void + ) { + pigeonApi.flutterEchoNullableMap(pigeonInstance: pigeonInstance, aMap: aMap) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoNullableEnum( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + anEnum: ProxyApiTestEnum?, completion: @escaping (Result) -> Void + ) { + pigeonApi.flutterEchoNullableEnum(pigeonInstance: pigeonInstance, anEnum: anEnum) { + response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoNullableProxyApi( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + aProxyApi: ProxyApiSuperClass?, + completion: @escaping (Result) -> Void + ) { + pigeonApi.flutterEchoNullableProxyApi(pigeonInstance: pigeonInstance, aProxyApi: aProxyApi) + { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterNoopAsync( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, + completion: @escaping (Result) -> Void + ) { + pigeonApi.flutterNoopAsync(pigeonInstance: pigeonInstance) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoAsyncString( + pigeonApi: PigeonApiProxyApiTestClass, pigeonInstance: ProxyApiTestClass, aString: String, + completion: @escaping (Result) -> Void + ) { + pigeonApi.flutterEchoAsyncString(pigeonInstance: pigeonInstance, aString: aString) { + response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + } + return PigeonApiProxyApiTestClass( + pigeonRegistrar: registrar, delegate: ProxyApiTestClassDelegate()) + } + + func pigeonApiProxyApiSuperClass(_ registrar: ProxyApiTestsPigeonProxyApiRegistrar) + -> PigeonApiProxyApiSuperClass + { + class ProxyApiSuperClassDelegate: PigeonApiDelegateProxyApiSuperClass { + func pigeonDefaultConstructor(pigeonApi: PigeonApiProxyApiSuperClass) throws + -> ProxyApiSuperClass + { + return ProxyApiSuperClass() + } + + func aSuperMethod(pigeonApi: PigeonApiProxyApiSuperClass, pigeonInstance: ProxyApiSuperClass) + throws + {} + } + return PigeonApiProxyApiSuperClass( + pigeonRegistrar: registrar, delegate: ProxyApiSuperClassDelegate()) + } + + func pigeonApiProxyApiInterface(_ registrar: ProxyApiTestsPigeonProxyApiRegistrar) + -> PigeonApiProxyApiInterface + { + class ProxyApiInterfaceDelegate: PigeonApiDelegateProxyApiInterface {} + return PigeonApiProxyApiInterface( + pigeonRegistrar: registrar, delegate: ProxyApiInterfaceDelegate()) + } + + func pigeonApiClassWithApiRequirement(_ registrar: ProxyApiTestsPigeonProxyApiRegistrar) + -> PigeonApiClassWithApiRequirement + { + class ClassWithApiRequirementDelegate: PigeonApiDelegateClassWithApiRequirement { + @available(macOS 10, *) + func pigeonDefaultConstructor(pigeonApi: PigeonApiClassWithApiRequirement) throws + -> ClassWithApiRequirement + { + return ClassWithApiRequirement() + } + + @available(macOS 10, *) + func aMethod( + pigeonApi: PigeonApiClassWithApiRequirement, pigeonInstance: ClassWithApiRequirement + ) throws { + + } + } + + return PigeonApiClassWithApiRequirement( + pigeonRegistrar: registrar, delegate: ClassWithApiRequirementDelegate()) + } +} diff --git a/packages/pigeon/platform_tests/test_plugin/windows/pigeon/core_tests.gen.cpp b/packages/pigeon/platform_tests/test_plugin/windows/pigeon/core_tests.gen.cpp index c2ae05c413c6..c47e3a16e2e2 100644 --- a/packages/pigeon/platform_tests/test_plugin/windows/pigeon/core_tests.gen.cpp +++ b/packages/pigeon/platform_tests/test_plugin/windows/pigeon/core_tests.gen.cpp @@ -32,6 +32,43 @@ FlutterError CreateConnectionError(const std::string channel_name) { EncodableValue("")); } +// UnusedClass + +UnusedClass::UnusedClass() {} + +UnusedClass::UnusedClass(const EncodableValue* a_field) + : a_field_(a_field ? std::optional(*a_field) + : std::nullopt) {} + +const EncodableValue* UnusedClass::a_field() const { + return a_field_ ? &(*a_field_) : nullptr; +} + +void UnusedClass::set_a_field(const EncodableValue* value_arg) { + a_field_ = + value_arg ? std::optional(*value_arg) : std::nullopt; +} + +void UnusedClass::set_a_field(const EncodableValue& value_arg) { + a_field_ = value_arg; +} + +EncodableList UnusedClass::ToEncodableList() const { + EncodableList list; + list.reserve(1); + list.push_back(a_field_ ? *a_field_ : EncodableValue()); + return list; +} + +UnusedClass UnusedClass::FromEncodableList(const EncodableList& list) { + UnusedClass decoded; + auto& encodable_a_field = list[0]; + if (!encodable_a_field.IsNull()) { + decoded.set_a_field(encodable_a_field); + } + return decoded; +} + // AllTypes AllTypes::AllTypes(bool a_bool, int64_t an_int, int64_t an_int64, @@ -44,7 +81,14 @@ AllTypes::AllTypes(bool a_bool, int64_t an_int, int64_t an_int64, const EncodableList& list, const EncodableList& string_list, const EncodableList& int_list, const EncodableList& double_list, - const EncodableList& bool_list, const EncodableMap& map) + const EncodableList& bool_list, + const EncodableList& enum_list, + const EncodableList& object_list, + const EncodableList& list_list, + const EncodableList& map_list, const EncodableMap& map, + const EncodableMap& string_map, const EncodableMap& int_map, + const EncodableMap& enum_map, const EncodableMap& object_map, + const EncodableMap& list_map, const EncodableMap& map_map) : a_bool_(a_bool), an_int_(an_int), an_int64_(an_int64), @@ -62,7 +106,17 @@ AllTypes::AllTypes(bool a_bool, int64_t an_int, int64_t an_int64, int_list_(int_list), double_list_(double_list), bool_list_(bool_list), - map_(map) {} + enum_list_(enum_list), + object_list_(object_list), + list_list_(list_list), + map_list_(map_list), + map_(map), + string_map_(string_map), + int_map_(int_map), + enum_map_(enum_map), + object_map_(object_map), + list_map_(list_map), + map_map_(map_map) {} bool AllTypes::a_bool() const { return a_bool_; } @@ -162,13 +216,73 @@ void AllTypes::set_bool_list(const EncodableList& value_arg) { bool_list_ = value_arg; } +const EncodableList& AllTypes::enum_list() const { return enum_list_; } + +void AllTypes::set_enum_list(const EncodableList& value_arg) { + enum_list_ = value_arg; +} + +const EncodableList& AllTypes::object_list() const { return object_list_; } + +void AllTypes::set_object_list(const EncodableList& value_arg) { + object_list_ = value_arg; +} + +const EncodableList& AllTypes::list_list() const { return list_list_; } + +void AllTypes::set_list_list(const EncodableList& value_arg) { + list_list_ = value_arg; +} + +const EncodableList& AllTypes::map_list() const { return map_list_; } + +void AllTypes::set_map_list(const EncodableList& value_arg) { + map_list_ = value_arg; +} + const EncodableMap& AllTypes::map() const { return map_; } void AllTypes::set_map(const EncodableMap& value_arg) { map_ = value_arg; } +const EncodableMap& AllTypes::string_map() const { return string_map_; } + +void AllTypes::set_string_map(const EncodableMap& value_arg) { + string_map_ = value_arg; +} + +const EncodableMap& AllTypes::int_map() const { return int_map_; } + +void AllTypes::set_int_map(const EncodableMap& value_arg) { + int_map_ = value_arg; +} + +const EncodableMap& AllTypes::enum_map() const { return enum_map_; } + +void AllTypes::set_enum_map(const EncodableMap& value_arg) { + enum_map_ = value_arg; +} + +const EncodableMap& AllTypes::object_map() const { return object_map_; } + +void AllTypes::set_object_map(const EncodableMap& value_arg) { + object_map_ = value_arg; +} + +const EncodableMap& AllTypes::list_map() const { return list_map_; } + +void AllTypes::set_list_map(const EncodableMap& value_arg) { + list_map_ = value_arg; +} + +const EncodableMap& AllTypes::map_map() const { return map_map_; } + +void AllTypes::set_map_map(const EncodableMap& value_arg) { + map_map_ = value_arg; +} + EncodableList AllTypes::ToEncodableList() const { EncodableList list; - list.reserve(18); + list.reserve(28); list.push_back(EncodableValue(a_bool_)); list.push_back(EncodableValue(an_int_)); list.push_back(EncodableValue(an_int64_)); @@ -186,14 +300,25 @@ EncodableList AllTypes::ToEncodableList() const { list.push_back(EncodableValue(int_list_)); list.push_back(EncodableValue(double_list_)); list.push_back(EncodableValue(bool_list_)); + list.push_back(EncodableValue(enum_list_)); + list.push_back(EncodableValue(object_list_)); + list.push_back(EncodableValue(list_list_)); + list.push_back(EncodableValue(map_list_)); list.push_back(EncodableValue(map_)); + list.push_back(EncodableValue(string_map_)); + list.push_back(EncodableValue(int_map_)); + list.push_back(EncodableValue(enum_map_)); + list.push_back(EncodableValue(object_map_)); + list.push_back(EncodableValue(list_map_)); + list.push_back(EncodableValue(map_map_)); return list; } AllTypes AllTypes::FromEncodableList(const EncodableList& list) { AllTypes decoded( - std::get(list[0]), list[1].LongValue(), list[2].LongValue(), - std::get(list[3]), std::get>(list[4]), + std::get(list[0]), std::get(list[1]), + std::get(list[2]), std::get(list[3]), + std::get>(list[4]), std::get>(list[5]), std::get>(list[6]), std::get>(list[7]), @@ -203,7 +328,12 @@ AllTypes AllTypes::FromEncodableList(const EncodableList& list) { std::get(list[10]), list[11], std::get(list[12]), std::get(list[13]), std::get(list[14]), std::get(list[15]), - std::get(list[16]), std::get(list[17])); + std::get(list[16]), std::get(list[17]), + std::get(list[18]), std::get(list[19]), + std::get(list[20]), std::get(list[21]), + std::get(list[22]), std::get(list[23]), + std::get(list[24]), std::get(list[25]), + std::get(list[26]), std::get(list[27])); return decoded; } @@ -218,16 +348,19 @@ AllNullableTypes::AllNullableTypes( const std::vector* a_nullable4_byte_array, const std::vector* a_nullable8_byte_array, const std::vector* a_nullable_float_array, - const EncodableList* nullable_nested_list, - const EncodableMap* nullable_map_with_annotations, - const EncodableMap* nullable_map_with_object, const AnEnum* a_nullable_enum, - const AnotherEnum* another_nullable_enum, + const AnEnum* a_nullable_enum, const AnotherEnum* another_nullable_enum, const std::string* a_nullable_string, const EncodableValue* a_nullable_object, const AllNullableTypes* all_nullable_types, const EncodableList* list, const EncodableList* string_list, const EncodableList* int_list, const EncodableList* double_list, const EncodableList* bool_list, - const EncodableList* nested_class_list, const EncodableMap* map) + const EncodableList* enum_list, const EncodableList* object_list, + const EncodableList* list_list, const EncodableList* map_list, + const EncodableList* recursive_class_list, const EncodableMap* map, + const EncodableMap* string_map, const EncodableMap* int_map, + const EncodableMap* enum_map, const EncodableMap* object_map, + const EncodableMap* list_map, const EncodableMap* map_map, + const EncodableMap* recursive_class_map) : a_nullable_bool_(a_nullable_bool ? std::optional(*a_nullable_bool) : std::nullopt), a_nullable_int_(a_nullable_int ? std::optional(*a_nullable_int) @@ -254,17 +387,6 @@ AllNullableTypes::AllNullableTypes( a_nullable_float_array ? std::optional>(*a_nullable_float_array) : std::nullopt), - nullable_nested_list_(nullable_nested_list ? std::optional( - *nullable_nested_list) - : std::nullopt), - nullable_map_with_annotations_( - nullable_map_with_annotations - ? std::optional(*nullable_map_with_annotations) - : std::nullopt), - nullable_map_with_object_( - nullable_map_with_object - ? std::optional(*nullable_map_with_object) - : std::nullopt), a_nullable_enum_(a_nullable_enum ? std::optional(*a_nullable_enum) : std::nullopt), another_nullable_enum_(another_nullable_enum ? std::optional( @@ -289,10 +411,31 @@ AllNullableTypes::AllNullableTypes( : std::nullopt), bool_list_(bool_list ? std::optional(*bool_list) : std::nullopt), - nested_class_list_(nested_class_list - ? std::optional(*nested_class_list) + enum_list_(enum_list ? std::optional(*enum_list) + : std::nullopt), + object_list_(object_list ? std::optional(*object_list) + : std::nullopt), + list_list_(list_list ? std::optional(*list_list) + : std::nullopt), + map_list_(map_list ? std::optional(*map_list) + : std::nullopt), + recursive_class_list_(recursive_class_list ? std::optional( + *recursive_class_list) + : std::nullopt), + map_(map ? std::optional(*map) : std::nullopt), + string_map_(string_map ? std::optional(*string_map) + : std::nullopt), + int_map_(int_map ? std::optional(*int_map) : std::nullopt), + enum_map_(enum_map ? std::optional(*enum_map) + : std::nullopt), + object_map_(object_map ? std::optional(*object_map) : std::nullopt), - map_(map ? std::optional(*map) : std::nullopt) {} + list_map_(list_map ? std::optional(*list_map) + : std::nullopt), + map_map_(map_map ? std::optional(*map_map) : std::nullopt), + recursive_class_map_(recursive_class_map ? std::optional( + *recursive_class_map) + : std::nullopt) {} AllNullableTypes::AllNullableTypes(const AllNullableTypes& other) : a_nullable_bool_(other.a_nullable_bool_ @@ -323,19 +466,6 @@ AllNullableTypes::AllNullableTypes(const AllNullableTypes& other) ? std::optional>( *other.a_nullable_float_array_) : std::nullopt), - nullable_nested_list_( - other.nullable_nested_list_ - ? std::optional(*other.nullable_nested_list_) - : std::nullopt), - nullable_map_with_annotations_( - other.nullable_map_with_annotations_ - ? std::optional( - *other.nullable_map_with_annotations_) - : std::nullopt), - nullable_map_with_object_( - other.nullable_map_with_object_ - ? std::optional(*other.nullable_map_with_object_) - : std::nullopt), a_nullable_enum_(other.a_nullable_enum_ ? std::optional(*other.a_nullable_enum_) : std::nullopt), @@ -368,12 +498,41 @@ AllNullableTypes::AllNullableTypes(const AllNullableTypes& other) bool_list_(other.bool_list_ ? std::optional(*other.bool_list_) : std::nullopt), - nested_class_list_( - other.nested_class_list_ - ? std::optional(*other.nested_class_list_) + enum_list_(other.enum_list_ + ? std::optional(*other.enum_list_) + : std::nullopt), + object_list_(other.object_list_ + ? std::optional(*other.object_list_) + : std::nullopt), + list_list_(other.list_list_ + ? std::optional(*other.list_list_) + : std::nullopt), + map_list_(other.map_list_ ? std::optional(*other.map_list_) + : std::nullopt), + recursive_class_list_( + other.recursive_class_list_ + ? std::optional(*other.recursive_class_list_) : std::nullopt), map_(other.map_ ? std::optional(*other.map_) - : std::nullopt) {} + : std::nullopt), + string_map_(other.string_map_ + ? std::optional(*other.string_map_) + : std::nullopt), + int_map_(other.int_map_ ? std::optional(*other.int_map_) + : std::nullopt), + enum_map_(other.enum_map_ ? std::optional(*other.enum_map_) + : std::nullopt), + object_map_(other.object_map_ + ? std::optional(*other.object_map_) + : std::nullopt), + list_map_(other.list_map_ ? std::optional(*other.list_map_) + : std::nullopt), + map_map_(other.map_map_ ? std::optional(*other.map_map_) + : std::nullopt), + recursive_class_map_( + other.recursive_class_map_ + ? std::optional(*other.recursive_class_map_) + : std::nullopt) {} AllNullableTypes& AllNullableTypes::operator=(const AllNullableTypes& other) { a_nullable_bool_ = other.a_nullable_bool_; @@ -384,9 +543,6 @@ AllNullableTypes& AllNullableTypes::operator=(const AllNullableTypes& other) { a_nullable4_byte_array_ = other.a_nullable4_byte_array_; a_nullable8_byte_array_ = other.a_nullable8_byte_array_; a_nullable_float_array_ = other.a_nullable_float_array_; - nullable_nested_list_ = other.nullable_nested_list_; - nullable_map_with_annotations_ = other.nullable_map_with_annotations_; - nullable_map_with_object_ = other.nullable_map_with_object_; a_nullable_enum_ = other.a_nullable_enum_; another_nullable_enum_ = other.another_nullable_enum_; a_nullable_string_ = other.a_nullable_string_; @@ -400,8 +556,19 @@ AllNullableTypes& AllNullableTypes::operator=(const AllNullableTypes& other) { int_list_ = other.int_list_; double_list_ = other.double_list_; bool_list_ = other.bool_list_; - nested_class_list_ = other.nested_class_list_; + enum_list_ = other.enum_list_; + object_list_ = other.object_list_; + list_list_ = other.list_list_; + map_list_ = other.map_list_; + recursive_class_list_ = other.recursive_class_list_; map_ = other.map_; + string_map_ = other.string_map_; + int_map_ = other.int_map_; + enum_map_ = other.enum_map_; + object_map_ = other.object_map_; + list_map_ = other.list_map_; + map_map_ = other.map_map_; + recursive_class_map_ = other.recursive_class_map_; return *this; } @@ -519,52 +686,6 @@ void AllNullableTypes::set_a_nullable_float_array( a_nullable_float_array_ = value_arg; } -const EncodableList* AllNullableTypes::nullable_nested_list() const { - return nullable_nested_list_ ? &(*nullable_nested_list_) : nullptr; -} - -void AllNullableTypes::set_nullable_nested_list( - const EncodableList* value_arg) { - nullable_nested_list_ = - value_arg ? std::optional(*value_arg) : std::nullopt; -} - -void AllNullableTypes::set_nullable_nested_list( - const EncodableList& value_arg) { - nullable_nested_list_ = value_arg; -} - -const EncodableMap* AllNullableTypes::nullable_map_with_annotations() const { - return nullable_map_with_annotations_ ? &(*nullable_map_with_annotations_) - : nullptr; -} - -void AllNullableTypes::set_nullable_map_with_annotations( - const EncodableMap* value_arg) { - nullable_map_with_annotations_ = - value_arg ? std::optional(*value_arg) : std::nullopt; -} - -void AllNullableTypes::set_nullable_map_with_annotations( - const EncodableMap& value_arg) { - nullable_map_with_annotations_ = value_arg; -} - -const EncodableMap* AllNullableTypes::nullable_map_with_object() const { - return nullable_map_with_object_ ? &(*nullable_map_with_object_) : nullptr; -} - -void AllNullableTypes::set_nullable_map_with_object( - const EncodableMap* value_arg) { - nullable_map_with_object_ = - value_arg ? std::optional(*value_arg) : std::nullopt; -} - -void AllNullableTypes::set_nullable_map_with_object( - const EncodableMap& value_arg) { - nullable_map_with_object_ = value_arg; -} - const AnEnum* AllNullableTypes::a_nullable_enum() const { return a_nullable_enum_ ? &(*a_nullable_enum_) : nullptr; } @@ -697,17 +818,71 @@ void AllNullableTypes::set_bool_list(const EncodableList& value_arg) { bool_list_ = value_arg; } -const EncodableList* AllNullableTypes::nested_class_list() const { - return nested_class_list_ ? &(*nested_class_list_) : nullptr; +const EncodableList* AllNullableTypes::enum_list() const { + return enum_list_ ? &(*enum_list_) : nullptr; } -void AllNullableTypes::set_nested_class_list(const EncodableList* value_arg) { - nested_class_list_ = +void AllNullableTypes::set_enum_list(const EncodableList* value_arg) { + enum_list_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void AllNullableTypes::set_nested_class_list(const EncodableList& value_arg) { - nested_class_list_ = value_arg; +void AllNullableTypes::set_enum_list(const EncodableList& value_arg) { + enum_list_ = value_arg; +} + +const EncodableList* AllNullableTypes::object_list() const { + return object_list_ ? &(*object_list_) : nullptr; +} + +void AllNullableTypes::set_object_list(const EncodableList* value_arg) { + object_list_ = + value_arg ? std::optional(*value_arg) : std::nullopt; +} + +void AllNullableTypes::set_object_list(const EncodableList& value_arg) { + object_list_ = value_arg; +} + +const EncodableList* AllNullableTypes::list_list() const { + return list_list_ ? &(*list_list_) : nullptr; +} + +void AllNullableTypes::set_list_list(const EncodableList* value_arg) { + list_list_ = + value_arg ? std::optional(*value_arg) : std::nullopt; +} + +void AllNullableTypes::set_list_list(const EncodableList& value_arg) { + list_list_ = value_arg; +} + +const EncodableList* AllNullableTypes::map_list() const { + return map_list_ ? &(*map_list_) : nullptr; +} + +void AllNullableTypes::set_map_list(const EncodableList* value_arg) { + map_list_ = + value_arg ? std::optional(*value_arg) : std::nullopt; +} + +void AllNullableTypes::set_map_list(const EncodableList& value_arg) { + map_list_ = value_arg; +} + +const EncodableList* AllNullableTypes::recursive_class_list() const { + return recursive_class_list_ ? &(*recursive_class_list_) : nullptr; +} + +void AllNullableTypes::set_recursive_class_list( + const EncodableList* value_arg) { + recursive_class_list_ = + value_arg ? std::optional(*value_arg) : std::nullopt; +} + +void AllNullableTypes::set_recursive_class_list( + const EncodableList& value_arg) { + recursive_class_list_ = value_arg; } const EncodableMap* AllNullableTypes::map() const { @@ -722,9 +897,98 @@ void AllNullableTypes::set_map(const EncodableMap& value_arg) { map_ = value_arg; } +const EncodableMap* AllNullableTypes::string_map() const { + return string_map_ ? &(*string_map_) : nullptr; +} + +void AllNullableTypes::set_string_map(const EncodableMap* value_arg) { + string_map_ = + value_arg ? std::optional(*value_arg) : std::nullopt; +} + +void AllNullableTypes::set_string_map(const EncodableMap& value_arg) { + string_map_ = value_arg; +} + +const EncodableMap* AllNullableTypes::int_map() const { + return int_map_ ? &(*int_map_) : nullptr; +} + +void AllNullableTypes::set_int_map(const EncodableMap* value_arg) { + int_map_ = value_arg ? std::optional(*value_arg) : std::nullopt; +} + +void AllNullableTypes::set_int_map(const EncodableMap& value_arg) { + int_map_ = value_arg; +} + +const EncodableMap* AllNullableTypes::enum_map() const { + return enum_map_ ? &(*enum_map_) : nullptr; +} + +void AllNullableTypes::set_enum_map(const EncodableMap* value_arg) { + enum_map_ = + value_arg ? std::optional(*value_arg) : std::nullopt; +} + +void AllNullableTypes::set_enum_map(const EncodableMap& value_arg) { + enum_map_ = value_arg; +} + +const EncodableMap* AllNullableTypes::object_map() const { + return object_map_ ? &(*object_map_) : nullptr; +} + +void AllNullableTypes::set_object_map(const EncodableMap* value_arg) { + object_map_ = + value_arg ? std::optional(*value_arg) : std::nullopt; +} + +void AllNullableTypes::set_object_map(const EncodableMap& value_arg) { + object_map_ = value_arg; +} + +const EncodableMap* AllNullableTypes::list_map() const { + return list_map_ ? &(*list_map_) : nullptr; +} + +void AllNullableTypes::set_list_map(const EncodableMap* value_arg) { + list_map_ = + value_arg ? std::optional(*value_arg) : std::nullopt; +} + +void AllNullableTypes::set_list_map(const EncodableMap& value_arg) { + list_map_ = value_arg; +} + +const EncodableMap* AllNullableTypes::map_map() const { + return map_map_ ? &(*map_map_) : nullptr; +} + +void AllNullableTypes::set_map_map(const EncodableMap* value_arg) { + map_map_ = value_arg ? std::optional(*value_arg) : std::nullopt; +} + +void AllNullableTypes::set_map_map(const EncodableMap& value_arg) { + map_map_ = value_arg; +} + +const EncodableMap* AllNullableTypes::recursive_class_map() const { + return recursive_class_map_ ? &(*recursive_class_map_) : nullptr; +} + +void AllNullableTypes::set_recursive_class_map(const EncodableMap* value_arg) { + recursive_class_map_ = + value_arg ? std::optional(*value_arg) : std::nullopt; +} + +void AllNullableTypes::set_recursive_class_map(const EncodableMap& value_arg) { + recursive_class_map_ = value_arg; +} + EncodableList AllNullableTypes::ToEncodableList() const { EncodableList list; - list.reserve(23); + list.reserve(31); list.push_back(a_nullable_bool_ ? EncodableValue(*a_nullable_bool_) : EncodableValue()); list.push_back(a_nullable_int_ ? EncodableValue(*a_nullable_int_) @@ -745,14 +1009,6 @@ EncodableList AllNullableTypes::ToEncodableList() const { list.push_back(a_nullable_float_array_ ? EncodableValue(*a_nullable_float_array_) : EncodableValue()); - list.push_back(nullable_nested_list_ ? EncodableValue(*nullable_nested_list_) - : EncodableValue()); - list.push_back(nullable_map_with_annotations_ - ? EncodableValue(*nullable_map_with_annotations_) - : EncodableValue()); - list.push_back(nullable_map_with_object_ - ? EncodableValue(*nullable_map_with_object_) - : EncodableValue()); list.push_back(a_nullable_enum_ ? CustomEncodableValue(*a_nullable_enum_) : EncodableValue()); list.push_back(another_nullable_enum_ @@ -771,9 +1027,22 @@ EncodableList AllNullableTypes::ToEncodableList() const { list.push_back(double_list_ ? EncodableValue(*double_list_) : EncodableValue()); list.push_back(bool_list_ ? EncodableValue(*bool_list_) : EncodableValue()); - list.push_back(nested_class_list_ ? EncodableValue(*nested_class_list_) - : EncodableValue()); + list.push_back(enum_list_ ? EncodableValue(*enum_list_) : EncodableValue()); + list.push_back(object_list_ ? EncodableValue(*object_list_) + : EncodableValue()); + list.push_back(list_list_ ? EncodableValue(*list_list_) : EncodableValue()); + list.push_back(map_list_ ? EncodableValue(*map_list_) : EncodableValue()); + list.push_back(recursive_class_list_ ? EncodableValue(*recursive_class_list_) + : EncodableValue()); list.push_back(map_ ? EncodableValue(*map_) : EncodableValue()); + list.push_back(string_map_ ? EncodableValue(*string_map_) : EncodableValue()); + list.push_back(int_map_ ? EncodableValue(*int_map_) : EncodableValue()); + list.push_back(enum_map_ ? EncodableValue(*enum_map_) : EncodableValue()); + list.push_back(object_map_ ? EncodableValue(*object_map_) : EncodableValue()); + list.push_back(list_map_ ? EncodableValue(*list_map_) : EncodableValue()); + list.push_back(map_map_ ? EncodableValue(*map_map_) : EncodableValue()); + list.push_back(recursive_class_map_ ? EncodableValue(*recursive_class_map_) + : EncodableValue()); return list; } @@ -786,11 +1055,11 @@ AllNullableTypes AllNullableTypes::FromEncodableList( } auto& encodable_a_nullable_int = list[1]; if (!encodable_a_nullable_int.IsNull()) { - decoded.set_a_nullable_int(encodable_a_nullable_int.LongValue()); + decoded.set_a_nullable_int(std::get(encodable_a_nullable_int)); } auto& encodable_a_nullable_int64 = list[2]; if (!encodable_a_nullable_int64.IsNull()) { - decoded.set_a_nullable_int64(encodable_a_nullable_int64.LongValue()); + decoded.set_a_nullable_int64(std::get(encodable_a_nullable_int64)); } auto& encodable_a_nullable_double = list[3]; if (!encodable_a_nullable_double.IsNull()) { @@ -817,74 +1086,104 @@ AllNullableTypes AllNullableTypes::FromEncodableList( decoded.set_a_nullable_float_array( std::get>(encodable_a_nullable_float_array)); } - auto& encodable_nullable_nested_list = list[8]; - if (!encodable_nullable_nested_list.IsNull()) { - decoded.set_nullable_nested_list( - std::get(encodable_nullable_nested_list)); - } - auto& encodable_nullable_map_with_annotations = list[9]; - if (!encodable_nullable_map_with_annotations.IsNull()) { - decoded.set_nullable_map_with_annotations( - std::get(encodable_nullable_map_with_annotations)); - } - auto& encodable_nullable_map_with_object = list[10]; - if (!encodable_nullable_map_with_object.IsNull()) { - decoded.set_nullable_map_with_object( - std::get(encodable_nullable_map_with_object)); - } - auto& encodable_a_nullable_enum = list[11]; + auto& encodable_a_nullable_enum = list[8]; if (!encodable_a_nullable_enum.IsNull()) { decoded.set_a_nullable_enum(std::any_cast( std::get(encodable_a_nullable_enum))); } - auto& encodable_another_nullable_enum = list[12]; + auto& encodable_another_nullable_enum = list[9]; if (!encodable_another_nullable_enum.IsNull()) { decoded.set_another_nullable_enum(std::any_cast( std::get(encodable_another_nullable_enum))); } - auto& encodable_a_nullable_string = list[13]; + auto& encodable_a_nullable_string = list[10]; if (!encodable_a_nullable_string.IsNull()) { decoded.set_a_nullable_string( std::get(encodable_a_nullable_string)); } - auto& encodable_a_nullable_object = list[14]; + auto& encodable_a_nullable_object = list[11]; if (!encodable_a_nullable_object.IsNull()) { decoded.set_a_nullable_object(encodable_a_nullable_object); } - auto& encodable_all_nullable_types = list[15]; + auto& encodable_all_nullable_types = list[12]; if (!encodable_all_nullable_types.IsNull()) { decoded.set_all_nullable_types(std::any_cast( std::get(encodable_all_nullable_types))); } - auto& encodable_list = list[16]; + auto& encodable_list = list[13]; if (!encodable_list.IsNull()) { decoded.set_list(std::get(encodable_list)); } - auto& encodable_string_list = list[17]; + auto& encodable_string_list = list[14]; if (!encodable_string_list.IsNull()) { decoded.set_string_list(std::get(encodable_string_list)); } - auto& encodable_int_list = list[18]; + auto& encodable_int_list = list[15]; if (!encodable_int_list.IsNull()) { decoded.set_int_list(std::get(encodable_int_list)); } - auto& encodable_double_list = list[19]; + auto& encodable_double_list = list[16]; if (!encodable_double_list.IsNull()) { decoded.set_double_list(std::get(encodable_double_list)); } - auto& encodable_bool_list = list[20]; + auto& encodable_bool_list = list[17]; if (!encodable_bool_list.IsNull()) { decoded.set_bool_list(std::get(encodable_bool_list)); } - auto& encodable_nested_class_list = list[21]; - if (!encodable_nested_class_list.IsNull()) { - decoded.set_nested_class_list( - std::get(encodable_nested_class_list)); + auto& encodable_enum_list = list[18]; + if (!encodable_enum_list.IsNull()) { + decoded.set_enum_list(std::get(encodable_enum_list)); + } + auto& encodable_object_list = list[19]; + if (!encodable_object_list.IsNull()) { + decoded.set_object_list(std::get(encodable_object_list)); + } + auto& encodable_list_list = list[20]; + if (!encodable_list_list.IsNull()) { + decoded.set_list_list(std::get(encodable_list_list)); } - auto& encodable_map = list[22]; + auto& encodable_map_list = list[21]; + if (!encodable_map_list.IsNull()) { + decoded.set_map_list(std::get(encodable_map_list)); + } + auto& encodable_recursive_class_list = list[22]; + if (!encodable_recursive_class_list.IsNull()) { + decoded.set_recursive_class_list( + std::get(encodable_recursive_class_list)); + } + auto& encodable_map = list[23]; if (!encodable_map.IsNull()) { decoded.set_map(std::get(encodable_map)); } + auto& encodable_string_map = list[24]; + if (!encodable_string_map.IsNull()) { + decoded.set_string_map(std::get(encodable_string_map)); + } + auto& encodable_int_map = list[25]; + if (!encodable_int_map.IsNull()) { + decoded.set_int_map(std::get(encodable_int_map)); + } + auto& encodable_enum_map = list[26]; + if (!encodable_enum_map.IsNull()) { + decoded.set_enum_map(std::get(encodable_enum_map)); + } + auto& encodable_object_map = list[27]; + if (!encodable_object_map.IsNull()) { + decoded.set_object_map(std::get(encodable_object_map)); + } + auto& encodable_list_map = list[28]; + if (!encodable_list_map.IsNull()) { + decoded.set_list_map(std::get(encodable_list_map)); + } + auto& encodable_map_map = list[29]; + if (!encodable_map_map.IsNull()) { + decoded.set_map_map(std::get(encodable_map_map)); + } + auto& encodable_recursive_class_map = list[30]; + if (!encodable_recursive_class_map.IsNull()) { + decoded.set_recursive_class_map( + std::get(encodable_recursive_class_map)); + } return decoded; } @@ -899,15 +1198,17 @@ AllNullableTypesWithoutRecursion::AllNullableTypesWithoutRecursion( const std::vector* a_nullable4_byte_array, const std::vector* a_nullable8_byte_array, const std::vector* a_nullable_float_array, - const EncodableList* nullable_nested_list, - const EncodableMap* nullable_map_with_annotations, - const EncodableMap* nullable_map_with_object, const AnEnum* a_nullable_enum, - const AnotherEnum* another_nullable_enum, + const AnEnum* a_nullable_enum, const AnotherEnum* another_nullable_enum, const std::string* a_nullable_string, const EncodableValue* a_nullable_object, const EncodableList* list, const EncodableList* string_list, const EncodableList* int_list, const EncodableList* double_list, const EncodableList* bool_list, - const EncodableMap* map) + const EncodableList* enum_list, const EncodableList* object_list, + const EncodableList* list_list, const EncodableList* map_list, + const EncodableMap* map, const EncodableMap* string_map, + const EncodableMap* int_map, const EncodableMap* enum_map, + const EncodableMap* object_map, const EncodableMap* list_map, + const EncodableMap* map_map) : a_nullable_bool_(a_nullable_bool ? std::optional(*a_nullable_bool) : std::nullopt), a_nullable_int_(a_nullable_int ? std::optional(*a_nullable_int) @@ -934,17 +1235,6 @@ AllNullableTypesWithoutRecursion::AllNullableTypesWithoutRecursion( a_nullable_float_array ? std::optional>(*a_nullable_float_array) : std::nullopt), - nullable_nested_list_(nullable_nested_list ? std::optional( - *nullable_nested_list) - : std::nullopt), - nullable_map_with_annotations_( - nullable_map_with_annotations - ? std::optional(*nullable_map_with_annotations) - : std::nullopt), - nullable_map_with_object_( - nullable_map_with_object - ? std::optional(*nullable_map_with_object) - : std::nullopt), a_nullable_enum_(a_nullable_enum ? std::optional(*a_nullable_enum) : std::nullopt), another_nullable_enum_(another_nullable_enum ? std::optional( @@ -965,7 +1255,26 @@ AllNullableTypesWithoutRecursion::AllNullableTypesWithoutRecursion( : std::nullopt), bool_list_(bool_list ? std::optional(*bool_list) : std::nullopt), - map_(map ? std::optional(*map) : std::nullopt) {} + enum_list_(enum_list ? std::optional(*enum_list) + : std::nullopt), + object_list_(object_list ? std::optional(*object_list) + : std::nullopt), + list_list_(list_list ? std::optional(*list_list) + : std::nullopt), + map_list_(map_list ? std::optional(*map_list) + : std::nullopt), + map_(map ? std::optional(*map) : std::nullopt), + string_map_(string_map ? std::optional(*string_map) + : std::nullopt), + int_map_(int_map ? std::optional(*int_map) : std::nullopt), + enum_map_(enum_map ? std::optional(*enum_map) + : std::nullopt), + object_map_(object_map ? std::optional(*object_map) + : std::nullopt), + list_map_(list_map ? std::optional(*list_map) + : std::nullopt), + map_map_(map_map ? std::optional(*map_map) : std::nullopt) { +} const bool* AllNullableTypesWithoutRecursion::a_nullable_bool() const { return a_nullable_bool_ ? &(*a_nullable_bool_) : nullptr; @@ -1089,55 +1398,6 @@ void AllNullableTypesWithoutRecursion::set_a_nullable_float_array( a_nullable_float_array_ = value_arg; } -const EncodableList* AllNullableTypesWithoutRecursion::nullable_nested_list() - const { - return nullable_nested_list_ ? &(*nullable_nested_list_) : nullptr; -} - -void AllNullableTypesWithoutRecursion::set_nullable_nested_list( - const EncodableList* value_arg) { - nullable_nested_list_ = - value_arg ? std::optional(*value_arg) : std::nullopt; -} - -void AllNullableTypesWithoutRecursion::set_nullable_nested_list( - const EncodableList& value_arg) { - nullable_nested_list_ = value_arg; -} - -const EncodableMap* -AllNullableTypesWithoutRecursion::nullable_map_with_annotations() const { - return nullable_map_with_annotations_ ? &(*nullable_map_with_annotations_) - : nullptr; -} - -void AllNullableTypesWithoutRecursion::set_nullable_map_with_annotations( - const EncodableMap* value_arg) { - nullable_map_with_annotations_ = - value_arg ? std::optional(*value_arg) : std::nullopt; -} - -void AllNullableTypesWithoutRecursion::set_nullable_map_with_annotations( - const EncodableMap& value_arg) { - nullable_map_with_annotations_ = value_arg; -} - -const EncodableMap* AllNullableTypesWithoutRecursion::nullable_map_with_object() - const { - return nullable_map_with_object_ ? &(*nullable_map_with_object_) : nullptr; -} - -void AllNullableTypesWithoutRecursion::set_nullable_map_with_object( - const EncodableMap* value_arg) { - nullable_map_with_object_ = - value_arg ? std::optional(*value_arg) : std::nullopt; -} - -void AllNullableTypesWithoutRecursion::set_nullable_map_with_object( - const EncodableMap& value_arg) { - nullable_map_with_object_ = value_arg; -} - const AnEnum* AllNullableTypesWithoutRecursion::a_nullable_enum() const { return a_nullable_enum_ ? &(*a_nullable_enum_) : nullptr; } @@ -1274,32 +1534,180 @@ void AllNullableTypesWithoutRecursion::set_bool_list( bool_list_ = value_arg; } -const EncodableMap* AllNullableTypesWithoutRecursion::map() const { - return map_ ? &(*map_) : nullptr; +const EncodableList* AllNullableTypesWithoutRecursion::enum_list() const { + return enum_list_ ? &(*enum_list_) : nullptr; } -void AllNullableTypesWithoutRecursion::set_map(const EncodableMap* value_arg) { - map_ = value_arg ? std::optional(*value_arg) : std::nullopt; +void AllNullableTypesWithoutRecursion::set_enum_list( + const EncodableList* value_arg) { + enum_list_ = + value_arg ? std::optional(*value_arg) : std::nullopt; } -void AllNullableTypesWithoutRecursion::set_map(const EncodableMap& value_arg) { - map_ = value_arg; +void AllNullableTypesWithoutRecursion::set_enum_list( + const EncodableList& value_arg) { + enum_list_ = value_arg; } -EncodableList AllNullableTypesWithoutRecursion::ToEncodableList() const { - EncodableList list; - list.reserve(21); - list.push_back(a_nullable_bool_ ? EncodableValue(*a_nullable_bool_) - : EncodableValue()); - list.push_back(a_nullable_int_ ? EncodableValue(*a_nullable_int_) - : EncodableValue()); - list.push_back(a_nullable_int64_ ? EncodableValue(*a_nullable_int64_) - : EncodableValue()); - list.push_back(a_nullable_double_ ? EncodableValue(*a_nullable_double_) - : EncodableValue()); - list.push_back(a_nullable_byte_array_ - ? EncodableValue(*a_nullable_byte_array_) - : EncodableValue()); +const EncodableList* AllNullableTypesWithoutRecursion::object_list() const { + return object_list_ ? &(*object_list_) : nullptr; +} + +void AllNullableTypesWithoutRecursion::set_object_list( + const EncodableList* value_arg) { + object_list_ = + value_arg ? std::optional(*value_arg) : std::nullopt; +} + +void AllNullableTypesWithoutRecursion::set_object_list( + const EncodableList& value_arg) { + object_list_ = value_arg; +} + +const EncodableList* AllNullableTypesWithoutRecursion::list_list() const { + return list_list_ ? &(*list_list_) : nullptr; +} + +void AllNullableTypesWithoutRecursion::set_list_list( + const EncodableList* value_arg) { + list_list_ = + value_arg ? std::optional(*value_arg) : std::nullopt; +} + +void AllNullableTypesWithoutRecursion::set_list_list( + const EncodableList& value_arg) { + list_list_ = value_arg; +} + +const EncodableList* AllNullableTypesWithoutRecursion::map_list() const { + return map_list_ ? &(*map_list_) : nullptr; +} + +void AllNullableTypesWithoutRecursion::set_map_list( + const EncodableList* value_arg) { + map_list_ = + value_arg ? std::optional(*value_arg) : std::nullopt; +} + +void AllNullableTypesWithoutRecursion::set_map_list( + const EncodableList& value_arg) { + map_list_ = value_arg; +} + +const EncodableMap* AllNullableTypesWithoutRecursion::map() const { + return map_ ? &(*map_) : nullptr; +} + +void AllNullableTypesWithoutRecursion::set_map(const EncodableMap* value_arg) { + map_ = value_arg ? std::optional(*value_arg) : std::nullopt; +} + +void AllNullableTypesWithoutRecursion::set_map(const EncodableMap& value_arg) { + map_ = value_arg; +} + +const EncodableMap* AllNullableTypesWithoutRecursion::string_map() const { + return string_map_ ? &(*string_map_) : nullptr; +} + +void AllNullableTypesWithoutRecursion::set_string_map( + const EncodableMap* value_arg) { + string_map_ = + value_arg ? std::optional(*value_arg) : std::nullopt; +} + +void AllNullableTypesWithoutRecursion::set_string_map( + const EncodableMap& value_arg) { + string_map_ = value_arg; +} + +const EncodableMap* AllNullableTypesWithoutRecursion::int_map() const { + return int_map_ ? &(*int_map_) : nullptr; +} + +void AllNullableTypesWithoutRecursion::set_int_map( + const EncodableMap* value_arg) { + int_map_ = value_arg ? std::optional(*value_arg) : std::nullopt; +} + +void AllNullableTypesWithoutRecursion::set_int_map( + const EncodableMap& value_arg) { + int_map_ = value_arg; +} + +const EncodableMap* AllNullableTypesWithoutRecursion::enum_map() const { + return enum_map_ ? &(*enum_map_) : nullptr; +} + +void AllNullableTypesWithoutRecursion::set_enum_map( + const EncodableMap* value_arg) { + enum_map_ = + value_arg ? std::optional(*value_arg) : std::nullopt; +} + +void AllNullableTypesWithoutRecursion::set_enum_map( + const EncodableMap& value_arg) { + enum_map_ = value_arg; +} + +const EncodableMap* AllNullableTypesWithoutRecursion::object_map() const { + return object_map_ ? &(*object_map_) : nullptr; +} + +void AllNullableTypesWithoutRecursion::set_object_map( + const EncodableMap* value_arg) { + object_map_ = + value_arg ? std::optional(*value_arg) : std::nullopt; +} + +void AllNullableTypesWithoutRecursion::set_object_map( + const EncodableMap& value_arg) { + object_map_ = value_arg; +} + +const EncodableMap* AllNullableTypesWithoutRecursion::list_map() const { + return list_map_ ? &(*list_map_) : nullptr; +} + +void AllNullableTypesWithoutRecursion::set_list_map( + const EncodableMap* value_arg) { + list_map_ = + value_arg ? std::optional(*value_arg) : std::nullopt; +} + +void AllNullableTypesWithoutRecursion::set_list_map( + const EncodableMap& value_arg) { + list_map_ = value_arg; +} + +const EncodableMap* AllNullableTypesWithoutRecursion::map_map() const { + return map_map_ ? &(*map_map_) : nullptr; +} + +void AllNullableTypesWithoutRecursion::set_map_map( + const EncodableMap* value_arg) { + map_map_ = value_arg ? std::optional(*value_arg) : std::nullopt; +} + +void AllNullableTypesWithoutRecursion::set_map_map( + const EncodableMap& value_arg) { + map_map_ = value_arg; +} + +EncodableList AllNullableTypesWithoutRecursion::ToEncodableList() const { + EncodableList list; + list.reserve(28); + list.push_back(a_nullable_bool_ ? EncodableValue(*a_nullable_bool_) + : EncodableValue()); + list.push_back(a_nullable_int_ ? EncodableValue(*a_nullable_int_) + : EncodableValue()); + list.push_back(a_nullable_int64_ ? EncodableValue(*a_nullable_int64_) + : EncodableValue()); + list.push_back(a_nullable_double_ ? EncodableValue(*a_nullable_double_) + : EncodableValue()); + list.push_back(a_nullable_byte_array_ + ? EncodableValue(*a_nullable_byte_array_) + : EncodableValue()); list.push_back(a_nullable4_byte_array_ ? EncodableValue(*a_nullable4_byte_array_) : EncodableValue()); @@ -1309,14 +1717,6 @@ EncodableList AllNullableTypesWithoutRecursion::ToEncodableList() const { list.push_back(a_nullable_float_array_ ? EncodableValue(*a_nullable_float_array_) : EncodableValue()); - list.push_back(nullable_nested_list_ ? EncodableValue(*nullable_nested_list_) - : EncodableValue()); - list.push_back(nullable_map_with_annotations_ - ? EncodableValue(*nullable_map_with_annotations_) - : EncodableValue()); - list.push_back(nullable_map_with_object_ - ? EncodableValue(*nullable_map_with_object_) - : EncodableValue()); list.push_back(a_nullable_enum_ ? CustomEncodableValue(*a_nullable_enum_) : EncodableValue()); list.push_back(another_nullable_enum_ @@ -1332,7 +1732,18 @@ EncodableList AllNullableTypesWithoutRecursion::ToEncodableList() const { list.push_back(double_list_ ? EncodableValue(*double_list_) : EncodableValue()); list.push_back(bool_list_ ? EncodableValue(*bool_list_) : EncodableValue()); + list.push_back(enum_list_ ? EncodableValue(*enum_list_) : EncodableValue()); + list.push_back(object_list_ ? EncodableValue(*object_list_) + : EncodableValue()); + list.push_back(list_list_ ? EncodableValue(*list_list_) : EncodableValue()); + list.push_back(map_list_ ? EncodableValue(*map_list_) : EncodableValue()); list.push_back(map_ ? EncodableValue(*map_) : EncodableValue()); + list.push_back(string_map_ ? EncodableValue(*string_map_) : EncodableValue()); + list.push_back(int_map_ ? EncodableValue(*int_map_) : EncodableValue()); + list.push_back(enum_map_ ? EncodableValue(*enum_map_) : EncodableValue()); + list.push_back(object_map_ ? EncodableValue(*object_map_) : EncodableValue()); + list.push_back(list_map_ ? EncodableValue(*list_map_) : EncodableValue()); + list.push_back(map_map_ ? EncodableValue(*map_map_) : EncodableValue()); return list; } @@ -1345,11 +1756,11 @@ AllNullableTypesWithoutRecursion::FromEncodableList(const EncodableList& list) { } auto& encodable_a_nullable_int = list[1]; if (!encodable_a_nullable_int.IsNull()) { - decoded.set_a_nullable_int(encodable_a_nullable_int.LongValue()); + decoded.set_a_nullable_int(std::get(encodable_a_nullable_int)); } auto& encodable_a_nullable_int64 = list[2]; if (!encodable_a_nullable_int64.IsNull()) { - decoded.set_a_nullable_int64(encodable_a_nullable_int64.LongValue()); + decoded.set_a_nullable_int64(std::get(encodable_a_nullable_int64)); } auto& encodable_a_nullable_double = list[3]; if (!encodable_a_nullable_double.IsNull()) { @@ -1376,77 +1787,110 @@ AllNullableTypesWithoutRecursion::FromEncodableList(const EncodableList& list) { decoded.set_a_nullable_float_array( std::get>(encodable_a_nullable_float_array)); } - auto& encodable_nullable_nested_list = list[8]; - if (!encodable_nullable_nested_list.IsNull()) { - decoded.set_nullable_nested_list( - std::get(encodable_nullable_nested_list)); - } - auto& encodable_nullable_map_with_annotations = list[9]; - if (!encodable_nullable_map_with_annotations.IsNull()) { - decoded.set_nullable_map_with_annotations( - std::get(encodable_nullable_map_with_annotations)); - } - auto& encodable_nullable_map_with_object = list[10]; - if (!encodable_nullable_map_with_object.IsNull()) { - decoded.set_nullable_map_with_object( - std::get(encodable_nullable_map_with_object)); - } - auto& encodable_a_nullable_enum = list[11]; + auto& encodable_a_nullable_enum = list[8]; if (!encodable_a_nullable_enum.IsNull()) { decoded.set_a_nullable_enum(std::any_cast( std::get(encodable_a_nullable_enum))); } - auto& encodable_another_nullable_enum = list[12]; + auto& encodable_another_nullable_enum = list[9]; if (!encodable_another_nullable_enum.IsNull()) { decoded.set_another_nullable_enum(std::any_cast( std::get(encodable_another_nullable_enum))); } - auto& encodable_a_nullable_string = list[13]; + auto& encodable_a_nullable_string = list[10]; if (!encodable_a_nullable_string.IsNull()) { decoded.set_a_nullable_string( std::get(encodable_a_nullable_string)); } - auto& encodable_a_nullable_object = list[14]; + auto& encodable_a_nullable_object = list[11]; if (!encodable_a_nullable_object.IsNull()) { decoded.set_a_nullable_object(encodable_a_nullable_object); } - auto& encodable_list = list[15]; + auto& encodable_list = list[12]; if (!encodable_list.IsNull()) { decoded.set_list(std::get(encodable_list)); } - auto& encodable_string_list = list[16]; + auto& encodable_string_list = list[13]; if (!encodable_string_list.IsNull()) { decoded.set_string_list(std::get(encodable_string_list)); } - auto& encodable_int_list = list[17]; + auto& encodable_int_list = list[14]; if (!encodable_int_list.IsNull()) { decoded.set_int_list(std::get(encodable_int_list)); } - auto& encodable_double_list = list[18]; + auto& encodable_double_list = list[15]; if (!encodable_double_list.IsNull()) { decoded.set_double_list(std::get(encodable_double_list)); } - auto& encodable_bool_list = list[19]; + auto& encodable_bool_list = list[16]; if (!encodable_bool_list.IsNull()) { decoded.set_bool_list(std::get(encodable_bool_list)); } - auto& encodable_map = list[20]; + auto& encodable_enum_list = list[17]; + if (!encodable_enum_list.IsNull()) { + decoded.set_enum_list(std::get(encodable_enum_list)); + } + auto& encodable_object_list = list[18]; + if (!encodable_object_list.IsNull()) { + decoded.set_object_list(std::get(encodable_object_list)); + } + auto& encodable_list_list = list[19]; + if (!encodable_list_list.IsNull()) { + decoded.set_list_list(std::get(encodable_list_list)); + } + auto& encodable_map_list = list[20]; + if (!encodable_map_list.IsNull()) { + decoded.set_map_list(std::get(encodable_map_list)); + } + auto& encodable_map = list[21]; if (!encodable_map.IsNull()) { decoded.set_map(std::get(encodable_map)); } + auto& encodable_string_map = list[22]; + if (!encodable_string_map.IsNull()) { + decoded.set_string_map(std::get(encodable_string_map)); + } + auto& encodable_int_map = list[23]; + if (!encodable_int_map.IsNull()) { + decoded.set_int_map(std::get(encodable_int_map)); + } + auto& encodable_enum_map = list[24]; + if (!encodable_enum_map.IsNull()) { + decoded.set_enum_map(std::get(encodable_enum_map)); + } + auto& encodable_object_map = list[25]; + if (!encodable_object_map.IsNull()) { + decoded.set_object_map(std::get(encodable_object_map)); + } + auto& encodable_list_map = list[26]; + if (!encodable_list_map.IsNull()) { + decoded.set_list_map(std::get(encodable_list_map)); + } + auto& encodable_map_map = list[27]; + if (!encodable_map_map.IsNull()) { + decoded.set_map_map(std::get(encodable_map_map)); + } return decoded; } // AllClassesWrapper -AllClassesWrapper::AllClassesWrapper(const AllNullableTypes& all_nullable_types) +AllClassesWrapper::AllClassesWrapper(const AllNullableTypes& all_nullable_types, + const EncodableList& class_list, + const EncodableMap& class_map) : all_nullable_types_( - std::make_unique(all_nullable_types)) {} + std::make_unique(all_nullable_types)), + class_list_(class_list), + class_map_(class_map) {} AllClassesWrapper::AllClassesWrapper(const AllNullableTypes& all_nullable_types, const AllNullableTypesWithoutRecursion* all_nullable_types_without_recursion, - const AllTypes* all_types) + const AllTypes* all_types, + const EncodableList& class_list, + const EncodableList* nullable_class_list, + const EncodableMap& class_map, + const EncodableMap* nullable_class_map) : all_nullable_types_( std::make_unique(all_nullable_types)), all_nullable_types_without_recursion_( @@ -1454,8 +1898,15 @@ AllClassesWrapper::AllClassesWrapper(const AllNullableTypes& all_nullable_types, ? std::make_unique( *all_nullable_types_without_recursion) : nullptr), - all_types_(all_types ? std::make_unique(*all_types) : nullptr) { -} + all_types_(all_types ? std::make_unique(*all_types) : nullptr), + class_list_(class_list), + nullable_class_list_(nullable_class_list ? std::optional( + *nullable_class_list) + : std::nullopt), + class_map_(class_map), + nullable_class_map_(nullable_class_map + ? std::optional(*nullable_class_map) + : std::nullopt) {} AllClassesWrapper::AllClassesWrapper(const AllClassesWrapper& other) : all_nullable_types_( @@ -1467,7 +1918,17 @@ AllClassesWrapper::AllClassesWrapper(const AllClassesWrapper& other) : nullptr), all_types_(other.all_types_ ? std::make_unique(*other.all_types_) - : nullptr) {} + : nullptr), + class_list_(other.class_list_), + nullable_class_list_( + other.nullable_class_list_ + ? std::optional(*other.nullable_class_list_) + : std::nullopt), + class_map_(other.class_map_), + nullable_class_map_( + other.nullable_class_map_ + ? std::optional(*other.nullable_class_map_) + : std::nullopt) {} AllClassesWrapper& AllClassesWrapper::operator=( const AllClassesWrapper& other) { @@ -1480,6 +1941,10 @@ AllClassesWrapper& AllClassesWrapper::operator=( : nullptr; all_types_ = other.all_types_ ? std::make_unique(*other.all_types_) : nullptr; + class_list_ = other.class_list_; + nullable_class_list_ = other.nullable_class_list_; + class_map_ = other.class_map_; + nullable_class_map_ = other.nullable_class_map_; return *this; } @@ -1522,9 +1987,51 @@ void AllClassesWrapper::set_all_types(const AllTypes& value_arg) { all_types_ = std::make_unique(value_arg); } +const EncodableList& AllClassesWrapper::class_list() const { + return class_list_; +} + +void AllClassesWrapper::set_class_list(const EncodableList& value_arg) { + class_list_ = value_arg; +} + +const EncodableList* AllClassesWrapper::nullable_class_list() const { + return nullable_class_list_ ? &(*nullable_class_list_) : nullptr; +} + +void AllClassesWrapper::set_nullable_class_list( + const EncodableList* value_arg) { + nullable_class_list_ = + value_arg ? std::optional(*value_arg) : std::nullopt; +} + +void AllClassesWrapper::set_nullable_class_list( + const EncodableList& value_arg) { + nullable_class_list_ = value_arg; +} + +const EncodableMap& AllClassesWrapper::class_map() const { return class_map_; } + +void AllClassesWrapper::set_class_map(const EncodableMap& value_arg) { + class_map_ = value_arg; +} + +const EncodableMap* AllClassesWrapper::nullable_class_map() const { + return nullable_class_map_ ? &(*nullable_class_map_) : nullptr; +} + +void AllClassesWrapper::set_nullable_class_map(const EncodableMap* value_arg) { + nullable_class_map_ = + value_arg ? std::optional(*value_arg) : std::nullopt; +} + +void AllClassesWrapper::set_nullable_class_map(const EncodableMap& value_arg) { + nullable_class_map_ = value_arg; +} + EncodableList AllClassesWrapper::ToEncodableList() const { EncodableList list; - list.reserve(3); + list.reserve(7); list.push_back(CustomEncodableValue(*all_nullable_types_)); list.push_back( all_nullable_types_without_recursion_ @@ -1532,13 +2039,21 @@ EncodableList AllClassesWrapper::ToEncodableList() const { : EncodableValue()); list.push_back(all_types_ ? CustomEncodableValue(*all_types_) : EncodableValue()); + list.push_back(EncodableValue(class_list_)); + list.push_back(nullable_class_list_ ? EncodableValue(*nullable_class_list_) + : EncodableValue()); + list.push_back(EncodableValue(class_map_)); + list.push_back(nullable_class_map_ ? EncodableValue(*nullable_class_map_) + : EncodableValue()); return list; } AllClassesWrapper AllClassesWrapper::FromEncodableList( const EncodableList& list) { AllClassesWrapper decoded(std::any_cast( - std::get(list[0]))); + std::get(list[0])), + std::get(list[3]), + std::get(list[5])); auto& encodable_all_nullable_types_without_recursion = list[1]; if (!encodable_all_nullable_types_without_recursion.IsNull()) { decoded.set_all_nullable_types_without_recursion( @@ -1551,6 +2066,16 @@ AllClassesWrapper AllClassesWrapper::FromEncodableList( decoded.set_all_types(std::any_cast( std::get(encodable_all_types))); } + auto& encodable_nullable_class_list = list[4]; + if (!encodable_nullable_class_list.IsNull()) { + decoded.set_nullable_class_list( + std::get(encodable_nullable_class_list)); + } + auto& encodable_nullable_class_map = list[6]; + if (!encodable_nullable_class_map.IsNull()) { + decoded.set_nullable_class_map( + std::get(encodable_nullable_class_map)); + } return decoded; } @@ -1614,23 +2139,27 @@ EncodableValue PigeonInternalCodecSerializer::ReadValueOfType( static_cast(enum_arg_value)); } case 131: { - return CustomEncodableValue(AllTypes::FromEncodableList( + return CustomEncodableValue(UnusedClass::FromEncodableList( std::get(ReadValue(stream)))); } case 132: { - return CustomEncodableValue(AllNullableTypes::FromEncodableList( + return CustomEncodableValue(AllTypes::FromEncodableList( std::get(ReadValue(stream)))); } case 133: { + return CustomEncodableValue(AllNullableTypes::FromEncodableList( + std::get(ReadValue(stream)))); + } + case 134: { return CustomEncodableValue( AllNullableTypesWithoutRecursion::FromEncodableList( std::get(ReadValue(stream)))); } - case 134: { + case 135: { return CustomEncodableValue(AllClassesWrapper::FromEncodableList( std::get(ReadValue(stream)))); } - case 135: { + case 136: { return CustomEncodableValue(TestMessage::FromEncodableList( std::get(ReadValue(stream)))); } @@ -1657,15 +2186,23 @@ void PigeonInternalCodecSerializer::WriteValue( stream); return; } - if (custom_value->type() == typeid(AllTypes)) { + if (custom_value->type() == typeid(UnusedClass)) { stream->WriteByte(131); + WriteValue( + EncodableValue( + std::any_cast(*custom_value).ToEncodableList()), + stream); + return; + } + if (custom_value->type() == typeid(AllTypes)) { + stream->WriteByte(132); WriteValue(EncodableValue( std::any_cast(*custom_value).ToEncodableList()), stream); return; } if (custom_value->type() == typeid(AllNullableTypes)) { - stream->WriteByte(132); + stream->WriteByte(133); WriteValue( EncodableValue( std::any_cast(*custom_value).ToEncodableList()), @@ -1673,7 +2210,7 @@ void PigeonInternalCodecSerializer::WriteValue( return; } if (custom_value->type() == typeid(AllNullableTypesWithoutRecursion)) { - stream->WriteByte(133); + stream->WriteByte(134); WriteValue(EncodableValue(std::any_cast( *custom_value) .ToEncodableList()), @@ -1681,14 +2218,14 @@ void PigeonInternalCodecSerializer::WriteValue( return; } if (custom_value->type() == typeid(AllClassesWrapper)) { - stream->WriteByte(134); + stream->WriteByte(135); WriteValue(EncodableValue(std::any_cast(*custom_value) .ToEncodableList()), stream); return; } if (custom_value->type() == typeid(TestMessage)) { - stream->WriteByte(135); + stream->WriteByte(136); WriteValue( EncodableValue( std::any_cast(*custom_value).ToEncodableList()), @@ -2122,7 +2659,7 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, { BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.echoMap" + + "HostIntegrationCoreApi.echoEnumList" + prepended_suffix, &GetCodec()); if (api != nullptr) { @@ -2131,14 +2668,14 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, const flutter::MessageReply& reply) { try { const auto& args = std::get(message); - const auto& encodable_a_map_arg = args.at(0); - if (encodable_a_map_arg.IsNull()) { - reply(WrapError("a_map_arg unexpectedly null.")); + const auto& encodable_enum_list_arg = args.at(0); + if (encodable_enum_list_arg.IsNull()) { + reply(WrapError("enum_list_arg unexpectedly null.")); return; } - const auto& a_map_arg = - std::get(encodable_a_map_arg); - ErrorOr output = api->EchoMap(a_map_arg); + const auto& enum_list_arg = + std::get(encodable_enum_list_arg); + ErrorOr output = api->EchoEnumList(enum_list_arg); if (output.has_error()) { reply(WrapError(output.error())); return; @@ -2157,7 +2694,7 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, { BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.echoClassWrapper" + + "HostIntegrationCoreApi.echoClassList" + prepended_suffix, &GetCodec()); if (api != nullptr) { @@ -2166,22 +2703,21 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, const flutter::MessageReply& reply) { try { const auto& args = std::get(message); - const auto& encodable_wrapper_arg = args.at(0); - if (encodable_wrapper_arg.IsNull()) { - reply(WrapError("wrapper_arg unexpectedly null.")); + const auto& encodable_class_list_arg = args.at(0); + if (encodable_class_list_arg.IsNull()) { + reply(WrapError("class_list_arg unexpectedly null.")); return; } - const auto& wrapper_arg = std::any_cast( - std::get(encodable_wrapper_arg)); - ErrorOr output = - api->EchoClassWrapper(wrapper_arg); + const auto& class_list_arg = + std::get(encodable_class_list_arg); + ErrorOr output = + api->EchoClassList(class_list_arg); if (output.has_error()) { reply(WrapError(output.error())); return; } EncodableList wrapped; - wrapped.push_back( - CustomEncodableValue(std::move(output).TakeValue())); + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); reply(EncodableValue(std::move(wrapped))); } catch (const std::exception& exception) { reply(WrapError(exception.what())); @@ -2194,7 +2730,7 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, { BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.echoEnum" + + "HostIntegrationCoreApi.echoNonNullEnumList" + prepended_suffix, &GetCodec()); if (api != nullptr) { @@ -2203,21 +2739,21 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, const flutter::MessageReply& reply) { try { const auto& args = std::get(message); - const auto& encodable_an_enum_arg = args.at(0); - if (encodable_an_enum_arg.IsNull()) { - reply(WrapError("an_enum_arg unexpectedly null.")); + const auto& encodable_enum_list_arg = args.at(0); + if (encodable_enum_list_arg.IsNull()) { + reply(WrapError("enum_list_arg unexpectedly null.")); return; } - const auto& an_enum_arg = std::any_cast( - std::get(encodable_an_enum_arg)); - ErrorOr output = api->EchoEnum(an_enum_arg); + const auto& enum_list_arg = + std::get(encodable_enum_list_arg); + ErrorOr output = + api->EchoNonNullEnumList(enum_list_arg); if (output.has_error()) { reply(WrapError(output.error())); return; } EncodableList wrapped; - wrapped.push_back( - CustomEncodableValue(std::move(output).TakeValue())); + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); reply(EncodableValue(std::move(wrapped))); } catch (const std::exception& exception) { reply(WrapError(exception.what())); @@ -2228,33 +2764,33 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, } } { - BasicMessageChannel<> channel(binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.echoAnotherEnum" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoNonNullClassList" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, const flutter::MessageReply& reply) { try { const auto& args = std::get(message); - const auto& encodable_another_enum_arg = args.at(0); - if (encodable_another_enum_arg.IsNull()) { - reply(WrapError("another_enum_arg unexpectedly null.")); + const auto& encodable_class_list_arg = args.at(0); + if (encodable_class_list_arg.IsNull()) { + reply(WrapError("class_list_arg unexpectedly null.")); return; } - const auto& another_enum_arg = std::any_cast( - std::get(encodable_another_enum_arg)); - ErrorOr output = - api->EchoAnotherEnum(another_enum_arg); + const auto& class_list_arg = + std::get(encodable_class_list_arg); + ErrorOr output = + api->EchoNonNullClassList(class_list_arg); if (output.has_error()) { reply(WrapError(output.error())); return; } EncodableList wrapped; - wrapped.push_back( - CustomEncodableValue(std::move(output).TakeValue())); + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); reply(EncodableValue(std::move(wrapped))); } catch (const std::exception& exception) { reply(WrapError(exception.what())); @@ -2265,27 +2801,24 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, } } { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoNamedDefaultString" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.echoMap" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, const flutter::MessageReply& reply) { try { const auto& args = std::get(message); - const auto& encodable_a_string_arg = args.at(0); - if (encodable_a_string_arg.IsNull()) { - reply(WrapError("a_string_arg unexpectedly null.")); + const auto& encodable_map_arg = args.at(0); + if (encodable_map_arg.IsNull()) { + reply(WrapError("map_arg unexpectedly null.")); return; } - const auto& a_string_arg = - std::get(encodable_a_string_arg); - ErrorOr output = - api->EchoNamedDefaultString(a_string_arg); + const auto& map_arg = std::get(encodable_map_arg); + ErrorOr output = api->EchoMap(map_arg); if (output.has_error()) { reply(WrapError(output.error())); return; @@ -2302,27 +2835,25 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, } } { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoOptionalDefaultDouble" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.echoStringMap" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, const flutter::MessageReply& reply) { try { const auto& args = std::get(message); - const auto& encodable_a_double_arg = args.at(0); - if (encodable_a_double_arg.IsNull()) { - reply(WrapError("a_double_arg unexpectedly null.")); + const auto& encodable_string_map_arg = args.at(0); + if (encodable_string_map_arg.IsNull()) { + reply(WrapError("string_map_arg unexpectedly null.")); return; } - const auto& a_double_arg = - std::get(encodable_a_double_arg); - ErrorOr output = - api->EchoOptionalDefaultDouble(a_double_arg); + const auto& string_map_arg = + std::get(encodable_string_map_arg); + ErrorOr output = api->EchoStringMap(string_map_arg); if (output.has_error()) { reply(WrapError(output.error())); return; @@ -2341,7 +2872,7 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, { BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.echoRequiredInt" + + "HostIntegrationCoreApi.echoIntMap" + prepended_suffix, &GetCodec()); if (api != nullptr) { @@ -2350,13 +2881,14 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, const flutter::MessageReply& reply) { try { const auto& args = std::get(message); - const auto& encodable_an_int_arg = args.at(0); - if (encodable_an_int_arg.IsNull()) { - reply(WrapError("an_int_arg unexpectedly null.")); + const auto& encodable_int_map_arg = args.at(0); + if (encodable_int_map_arg.IsNull()) { + reply(WrapError("int_map_arg unexpectedly null.")); return; } - const int64_t an_int_arg = encodable_an_int_arg.LongValue(); - ErrorOr output = api->EchoRequiredInt(an_int_arg); + const auto& int_map_arg = + std::get(encodable_int_map_arg); + ErrorOr output = api->EchoIntMap(int_map_arg); if (output.has_error()) { reply(WrapError(output.error())); return; @@ -2373,39 +2905,31 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, } } { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAllNullableTypes" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.echoEnumMap" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, const flutter::MessageReply& reply) { try { const auto& args = std::get(message); - const auto& encodable_everything_arg = args.at(0); - const auto* everything_arg = - encodable_everything_arg.IsNull() - ? nullptr - : &(std::any_cast( - std::get( - encodable_everything_arg))); - ErrorOr> output = - api->EchoAllNullableTypes(everything_arg); + const auto& encodable_enum_map_arg = args.at(0); + if (encodable_enum_map_arg.IsNull()) { + reply(WrapError("enum_map_arg unexpectedly null.")); + return; + } + const auto& enum_map_arg = + std::get(encodable_enum_map_arg); + ErrorOr output = api->EchoEnumMap(enum_map_arg); if (output.has_error()) { reply(WrapError(output.error())); return; } EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - CustomEncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); reply(EncodableValue(std::move(wrapped))); } catch (const std::exception& exception) { reply(WrapError(exception.what())); @@ -2416,83 +2940,31 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, } } { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAllNullableTypesWithoutRecursion" + - prepended_suffix, - &GetCodec()); - if (api != nullptr) { - channel.SetMessageHandler([api]( - const EncodableValue& message, - const flutter::MessageReply& - reply) { - try { - const auto& args = std::get(message); - const auto& encodable_everything_arg = args.at(0); - const auto* everything_arg = - encodable_everything_arg.IsNull() - ? nullptr - : &(std::any_cast( - std::get( - encodable_everything_arg))); - ErrorOr> output = - api->EchoAllNullableTypesWithoutRecursion(everything_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - CustomEncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); - } else { - channel.SetMessageHandler(nullptr); - } - } - { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "extractNestedNullableString" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.echoClassMap" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, const flutter::MessageReply& reply) { try { const auto& args = std::get(message); - const auto& encodable_wrapper_arg = args.at(0); - if (encodable_wrapper_arg.IsNull()) { - reply(WrapError("wrapper_arg unexpectedly null.")); + const auto& encodable_class_map_arg = args.at(0); + if (encodable_class_map_arg.IsNull()) { + reply(WrapError("class_map_arg unexpectedly null.")); return; } - const auto& wrapper_arg = std::any_cast( - std::get(encodable_wrapper_arg)); - ErrorOr> output = - api->ExtractNestedNullableString(wrapper_arg); + const auto& class_map_arg = + std::get(encodable_class_map_arg); + ErrorOr output = api->EchoClassMap(class_map_arg); if (output.has_error()) { reply(WrapError(output.error())); return; } EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); reply(EncodableValue(std::move(wrapped))); } catch (const std::exception& exception) { reply(WrapError(exception.what())); @@ -2506,7 +2978,7 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, BasicMessageChannel<> channel( binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "createNestedNullableString" + + "echoNonNullStringMap" + prepended_suffix, &GetCodec()); if (api != nullptr) { @@ -2515,18 +2987,21 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, const flutter::MessageReply& reply) { try { const auto& args = std::get(message); - const auto& encodable_nullable_string_arg = args.at(0); - const auto* nullable_string_arg = - std::get_if(&encodable_nullable_string_arg); - ErrorOr output = - api->CreateNestedNullableString(nullable_string_arg); + const auto& encodable_string_map_arg = args.at(0); + if (encodable_string_map_arg.IsNull()) { + reply(WrapError("string_map_arg unexpectedly null.")); + return; + } + const auto& string_map_arg = + std::get(encodable_string_map_arg); + ErrorOr output = + api->EchoNonNullStringMap(string_map_arg); if (output.has_error()) { reply(WrapError(output.error())); return; } EncodableList wrapped; - wrapped.push_back( - CustomEncodableValue(std::move(output).TakeValue())); + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); reply(EncodableValue(std::move(wrapped))); } catch (const std::exception& exception) { reply(WrapError(exception.what())); @@ -2537,43 +3012,32 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, } } { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "sendMultipleNullableTypes" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.echoNonNullIntMap" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, const flutter::MessageReply& reply) { try { const auto& args = std::get(message); - const auto& encodable_a_nullable_bool_arg = args.at(0); - const auto* a_nullable_bool_arg = - std::get_if(&encodable_a_nullable_bool_arg); - const auto& encodable_a_nullable_int_arg = args.at(1); - const int64_t a_nullable_int_arg_value = - encodable_a_nullable_int_arg.IsNull() - ? 0 - : encodable_a_nullable_int_arg.LongValue(); - const auto* a_nullable_int_arg = - encodable_a_nullable_int_arg.IsNull() - ? nullptr - : &a_nullable_int_arg_value; - const auto& encodable_a_nullable_string_arg = args.at(2); - const auto* a_nullable_string_arg = - std::get_if(&encodable_a_nullable_string_arg); - ErrorOr output = api->SendMultipleNullableTypes( - a_nullable_bool_arg, a_nullable_int_arg, - a_nullable_string_arg); + const auto& encodable_int_map_arg = args.at(0); + if (encodable_int_map_arg.IsNull()) { + reply(WrapError("int_map_arg unexpectedly null.")); + return; + } + const auto& int_map_arg = + std::get(encodable_int_map_arg); + ErrorOr output = + api->EchoNonNullIntMap(int_map_arg); if (output.has_error()) { reply(WrapError(output.error())); return; } EncodableList wrapped; - wrapped.push_back( - CustomEncodableValue(std::move(output).TakeValue())); + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); reply(EncodableValue(std::move(wrapped))); } catch (const std::exception& exception) { reply(WrapError(exception.what())); @@ -2584,44 +3048,32 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, } } { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "sendMultipleNullableTypesWithoutRecursion" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.echoNonNullEnumMap" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, const flutter::MessageReply& reply) { try { const auto& args = std::get(message); - const auto& encodable_a_nullable_bool_arg = args.at(0); - const auto* a_nullable_bool_arg = - std::get_if(&encodable_a_nullable_bool_arg); - const auto& encodable_a_nullable_int_arg = args.at(1); - const int64_t a_nullable_int_arg_value = - encodable_a_nullable_int_arg.IsNull() - ? 0 - : encodable_a_nullable_int_arg.LongValue(); - const auto* a_nullable_int_arg = - encodable_a_nullable_int_arg.IsNull() - ? nullptr - : &a_nullable_int_arg_value; - const auto& encodable_a_nullable_string_arg = args.at(2); - const auto* a_nullable_string_arg = - std::get_if(&encodable_a_nullable_string_arg); - ErrorOr output = - api->SendMultipleNullableTypesWithoutRecursion( - a_nullable_bool_arg, a_nullable_int_arg, - a_nullable_string_arg); + const auto& encodable_enum_map_arg = args.at(0); + if (encodable_enum_map_arg.IsNull()) { + reply(WrapError("enum_map_arg unexpectedly null.")); + return; + } + const auto& enum_map_arg = + std::get(encodable_enum_map_arg); + ErrorOr output = + api->EchoNonNullEnumMap(enum_map_arg); if (output.has_error()) { reply(WrapError(output.error())); return; } EncodableList wrapped; - wrapped.push_back( - CustomEncodableValue(std::move(output).TakeValue())); + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); reply(EncodableValue(std::move(wrapped))); } catch (const std::exception& exception) { reply(WrapError(exception.what())); @@ -2634,7 +3086,7 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, { BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.echoNullableInt" + + "HostIntegrationCoreApi.echoNonNullClassMap" + prepended_suffix, &GetCodec()); if (api != nullptr) { @@ -2643,29 +3095,21 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, const flutter::MessageReply& reply) { try { const auto& args = std::get(message); - const auto& encodable_a_nullable_int_arg = args.at(0); - const int64_t a_nullable_int_arg_value = - encodable_a_nullable_int_arg.IsNull() - ? 0 - : encodable_a_nullable_int_arg.LongValue(); - const auto* a_nullable_int_arg = - encodable_a_nullable_int_arg.IsNull() - ? nullptr - : &a_nullable_int_arg_value; - ErrorOr> output = - api->EchoNullableInt(a_nullable_int_arg); + const auto& encodable_class_map_arg = args.at(0); + if (encodable_class_map_arg.IsNull()) { + reply(WrapError("class_map_arg unexpectedly null.")); + return; + } + const auto& class_map_arg = + std::get(encodable_class_map_arg); + ErrorOr output = + api->EchoNonNullClassMap(class_map_arg); if (output.has_error()) { reply(WrapError(output.error())); return; } EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); reply(EncodableValue(std::move(wrapped))); } catch (const std::exception& exception) { reply(WrapError(exception.what())); @@ -2678,7 +3122,7 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, { BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.echoNullableDouble" + + "HostIntegrationCoreApi.echoClassWrapper" + prepended_suffix, &GetCodec()); if (api != nullptr) { @@ -2687,23 +3131,22 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, const flutter::MessageReply& reply) { try { const auto& args = std::get(message); - const auto& encodable_a_nullable_double_arg = args.at(0); - const auto* a_nullable_double_arg = - std::get_if(&encodable_a_nullable_double_arg); - ErrorOr> output = - api->EchoNullableDouble(a_nullable_double_arg); + const auto& encodable_wrapper_arg = args.at(0); + if (encodable_wrapper_arg.IsNull()) { + reply(WrapError("wrapper_arg unexpectedly null.")); + return; + } + const auto& wrapper_arg = std::any_cast( + std::get(encodable_wrapper_arg)); + ErrorOr output = + api->EchoClassWrapper(wrapper_arg); if (output.has_error()) { reply(WrapError(output.error())); return; } EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } + wrapped.push_back( + CustomEncodableValue(std::move(output).TakeValue())); reply(EncodableValue(std::move(wrapped))); } catch (const std::exception& exception) { reply(WrapError(exception.what())); @@ -2716,7 +3159,7 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, { BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.echoNullableBool" + + "HostIntegrationCoreApi.echoEnum" + prepended_suffix, &GetCodec()); if (api != nullptr) { @@ -2725,23 +3168,21 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, const flutter::MessageReply& reply) { try { const auto& args = std::get(message); - const auto& encodable_a_nullable_bool_arg = args.at(0); - const auto* a_nullable_bool_arg = - std::get_if(&encodable_a_nullable_bool_arg); - ErrorOr> output = - api->EchoNullableBool(a_nullable_bool_arg); + const auto& encodable_an_enum_arg = args.at(0); + if (encodable_an_enum_arg.IsNull()) { + reply(WrapError("an_enum_arg unexpectedly null.")); + return; + } + const auto& an_enum_arg = std::any_cast( + std::get(encodable_an_enum_arg)); + ErrorOr output = api->EchoEnum(an_enum_arg); if (output.has_error()) { reply(WrapError(output.error())); return; } EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } + wrapped.push_back( + CustomEncodableValue(std::move(output).TakeValue())); reply(EncodableValue(std::move(wrapped))); } catch (const std::exception& exception) { reply(WrapError(exception.what())); @@ -2754,7 +3195,7 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, { BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.echoNullableString" + + "HostIntegrationCoreApi.echoAnotherEnum" + prepended_suffix, &GetCodec()); if (api != nullptr) { @@ -2763,23 +3204,22 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, const flutter::MessageReply& reply) { try { const auto& args = std::get(message); - const auto& encodable_a_nullable_string_arg = args.at(0); - const auto* a_nullable_string_arg = - std::get_if(&encodable_a_nullable_string_arg); - ErrorOr> output = - api->EchoNullableString(a_nullable_string_arg); + const auto& encodable_another_enum_arg = args.at(0); + if (encodable_another_enum_arg.IsNull()) { + reply(WrapError("another_enum_arg unexpectedly null.")); + return; + } + const auto& another_enum_arg = std::any_cast( + std::get(encodable_another_enum_arg)); + ErrorOr output = + api->EchoAnotherEnum(another_enum_arg); if (output.has_error()) { reply(WrapError(output.error())); return; } EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } + wrapped.push_back( + CustomEncodableValue(std::move(output).TakeValue())); reply(EncodableValue(std::move(wrapped))); } catch (const std::exception& exception) { reply(WrapError(exception.what())); @@ -2793,7 +3233,7 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, BasicMessageChannel<> channel( binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoNullableUint8List" + + "echoNamedDefaultString" + prepended_suffix, &GetCodec()); if (api != nullptr) { @@ -2802,24 +3242,21 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, const flutter::MessageReply& reply) { try { const auto& args = std::get(message); - const auto& encodable_a_nullable_uint8_list_arg = args.at(0); - const auto* a_nullable_uint8_list_arg = - std::get_if>( - &encodable_a_nullable_uint8_list_arg); - ErrorOr>> output = - api->EchoNullableUint8List(a_nullable_uint8_list_arg); + const auto& encodable_a_string_arg = args.at(0); + if (encodable_a_string_arg.IsNull()) { + reply(WrapError("a_string_arg unexpectedly null.")); + return; + } + const auto& a_string_arg = + std::get(encodable_a_string_arg); + ErrorOr output = + api->EchoNamedDefaultString(a_string_arg); if (output.has_error()) { reply(WrapError(output.error())); return; } EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); reply(EncodableValue(std::move(wrapped))); } catch (const std::exception& exception) { reply(WrapError(exception.what())); @@ -2830,34 +3267,33 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, } } { - BasicMessageChannel<> channel(binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.echoNullableObject" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoOptionalDefaultDouble" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, const flutter::MessageReply& reply) { try { const auto& args = std::get(message); - const auto& encodable_a_nullable_object_arg = args.at(0); - const auto* a_nullable_object_arg = - &encodable_a_nullable_object_arg; - ErrorOr> output = - api->EchoNullableObject(a_nullable_object_arg); + const auto& encodable_a_double_arg = args.at(0); + if (encodable_a_double_arg.IsNull()) { + reply(WrapError("a_double_arg unexpectedly null.")); + return; + } + const auto& a_double_arg = + std::get(encodable_a_double_arg); + ErrorOr output = + api->EchoOptionalDefaultDouble(a_double_arg); if (output.has_error()) { reply(WrapError(output.error())); return; } EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); reply(EncodableValue(std::move(wrapped))); } catch (const std::exception& exception) { reply(WrapError(exception.what())); @@ -2870,7 +3306,7 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, { BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.echoNullableList" + + "HostIntegrationCoreApi.echoRequiredInt" + prepended_suffix, &GetCodec()); if (api != nullptr) { @@ -2879,23 +3315,19 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, const flutter::MessageReply& reply) { try { const auto& args = std::get(message); - const auto& encodable_a_nullable_list_arg = args.at(0); - const auto* a_nullable_list_arg = - std::get_if(&encodable_a_nullable_list_arg); - ErrorOr> output = - api->EchoNullableList(a_nullable_list_arg); + const auto& encodable_an_int_arg = args.at(0); + if (encodable_an_int_arg.IsNull()) { + reply(WrapError("an_int_arg unexpectedly null.")); + return; + } + const int64_t an_int_arg = encodable_an_int_arg.LongValue(); + ErrorOr output = api->EchoRequiredInt(an_int_arg); if (output.has_error()) { reply(WrapError(output.error())); return; } EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); reply(EncodableValue(std::move(wrapped))); } catch (const std::exception& exception) { reply(WrapError(exception.what())); @@ -2906,22 +3338,27 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, } } { - BasicMessageChannel<> channel(binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.echoNullableMap" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAllNullableTypes" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, const flutter::MessageReply& reply) { try { const auto& args = std::get(message); - const auto& encodable_a_nullable_map_arg = args.at(0); - const auto* a_nullable_map_arg = - std::get_if(&encodable_a_nullable_map_arg); - ErrorOr> output = - api->EchoNullableMap(a_nullable_map_arg); + const auto& encodable_everything_arg = args.at(0); + const auto* everything_arg = + encodable_everything_arg.IsNull() + ? nullptr + : &(std::any_cast( + std::get( + encodable_everything_arg))); + ErrorOr> output = + api->EchoAllNullableTypes(everything_arg); if (output.has_error()) { reply(WrapError(output.error())); return; @@ -2930,7 +3367,7 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, auto output_optional = std::move(output).TakeValue(); if (output_optional) { wrapped.push_back( - EncodableValue(std::move(output_optional).value())); + CustomEncodableValue(std::move(output_optional).value())); } else { wrapped.push_back(EncodableValue()); } @@ -2944,27 +3381,71 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, } } { - BasicMessageChannel<> channel(binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.echoNullableEnum" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAllNullableTypesWithoutRecursion" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler([api]( + const EncodableValue& message, + const flutter::MessageReply& + reply) { + try { + const auto& args = std::get(message); + const auto& encodable_everything_arg = args.at(0); + const auto* everything_arg = + encodable_everything_arg.IsNull() + ? nullptr + : &(std::any_cast( + std::get( + encodable_everything_arg))); + ErrorOr> output = + api->EchoAllNullableTypesWithoutRecursion(everything_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + CustomEncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "extractNestedNullableString" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, const flutter::MessageReply& reply) { try { const auto& args = std::get(message); - const auto& encodable_an_enum_arg = args.at(0); - AnEnum an_enum_arg_value; - const AnEnum* an_enum_arg = nullptr; - if (!encodable_an_enum_arg.IsNull()) { - an_enum_arg_value = std::any_cast( - std::get(encodable_an_enum_arg)); - an_enum_arg = &an_enum_arg_value; + const auto& encodable_wrapper_arg = args.at(0); + if (encodable_wrapper_arg.IsNull()) { + reply(WrapError("wrapper_arg unexpectedly null.")); + return; } - ErrorOr> output = api->EchoNullableEnum( - an_enum_arg ? &(*an_enum_arg) : nullptr); + const auto& wrapper_arg = std::any_cast( + std::get(encodable_wrapper_arg)); + ErrorOr> output = + api->ExtractNestedNullableString(wrapper_arg); if (output.has_error()) { reply(WrapError(output.error())); return; @@ -2973,7 +3454,7 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, auto output_optional = std::move(output).TakeValue(); if (output_optional) { wrapped.push_back( - CustomEncodableValue(std::move(output_optional).value())); + EncodableValue(std::move(output_optional).value())); } else { wrapped.push_back(EncodableValue()); } @@ -2990,7 +3471,7 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, BasicMessageChannel<> channel( binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAnotherNullableEnum" + + "createNestedNullableString" + prepended_suffix, &GetCodec()); if (api != nullptr) { @@ -2999,29 +3480,18 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, const flutter::MessageReply& reply) { try { const auto& args = std::get(message); - const auto& encodable_another_enum_arg = args.at(0); - AnotherEnum another_enum_arg_value; - const AnotherEnum* another_enum_arg = nullptr; - if (!encodable_another_enum_arg.IsNull()) { - another_enum_arg_value = std::any_cast( - std::get(encodable_another_enum_arg)); - another_enum_arg = &another_enum_arg_value; - } - ErrorOr> output = - api->EchoAnotherNullableEnum( - another_enum_arg ? &(*another_enum_arg) : nullptr); + const auto& encodable_nullable_string_arg = args.at(0); + const auto* nullable_string_arg = + std::get_if(&encodable_nullable_string_arg); + ErrorOr output = + api->CreateNestedNullableString(nullable_string_arg); if (output.has_error()) { reply(WrapError(output.error())); return; } EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - CustomEncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } + wrapped.push_back( + CustomEncodableValue(std::move(output).TakeValue())); reply(EncodableValue(std::move(wrapped))); } catch (const std::exception& exception) { reply(WrapError(exception.what())); @@ -3035,7 +3505,7 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, BasicMessageChannel<> channel( binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoOptionalNullableInt" + + "sendMultipleNullableTypes" + prepended_suffix, &GetCodec()); if (api != nullptr) { @@ -3044,29 +3514,25 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, const flutter::MessageReply& reply) { try { const auto& args = std::get(message); - const auto& encodable_a_nullable_int_arg = args.at(0); - const int64_t a_nullable_int_arg_value = - encodable_a_nullable_int_arg.IsNull() - ? 0 - : encodable_a_nullable_int_arg.LongValue(); + const auto& encodable_a_nullable_bool_arg = args.at(0); + const auto* a_nullable_bool_arg = + std::get_if(&encodable_a_nullable_bool_arg); + const auto& encodable_a_nullable_int_arg = args.at(1); const auto* a_nullable_int_arg = - encodable_a_nullable_int_arg.IsNull() - ? nullptr - : &a_nullable_int_arg_value; - ErrorOr> output = - api->EchoOptionalNullableInt(a_nullable_int_arg); + std::get_if(&encodable_a_nullable_int_arg); + const auto& encodable_a_nullable_string_arg = args.at(2); + const auto* a_nullable_string_arg = + std::get_if(&encodable_a_nullable_string_arg); + ErrorOr output = api->SendMultipleNullableTypes( + a_nullable_bool_arg, a_nullable_int_arg, + a_nullable_string_arg); if (output.has_error()) { reply(WrapError(output.error())); return; } EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } + wrapped.push_back( + CustomEncodableValue(std::move(output).TakeValue())); reply(EncodableValue(std::move(wrapped))); } catch (const std::exception& exception) { reply(WrapError(exception.what())); @@ -3080,7 +3546,7 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, BasicMessageChannel<> channel( binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoNamedNullableString" + + "sendMultipleNullableTypesWithoutRecursion" + prepended_suffix, &GetCodec()); if (api != nullptr) { @@ -3089,23 +3555,26 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, const flutter::MessageReply& reply) { try { const auto& args = std::get(message); - const auto& encodable_a_nullable_string_arg = args.at(0); + const auto& encodable_a_nullable_bool_arg = args.at(0); + const auto* a_nullable_bool_arg = + std::get_if(&encodable_a_nullable_bool_arg); + const auto& encodable_a_nullable_int_arg = args.at(1); + const auto* a_nullable_int_arg = + std::get_if(&encodable_a_nullable_int_arg); + const auto& encodable_a_nullable_string_arg = args.at(2); const auto* a_nullable_string_arg = std::get_if(&encodable_a_nullable_string_arg); - ErrorOr> output = - api->EchoNamedNullableString(a_nullable_string_arg); + ErrorOr output = + api->SendMultipleNullableTypesWithoutRecursion( + a_nullable_bool_arg, a_nullable_int_arg, + a_nullable_string_arg); if (output.has_error()) { reply(WrapError(output.error())); return; } EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } + wrapped.push_back( + CustomEncodableValue(std::move(output).TakeValue())); reply(EncodableValue(std::move(wrapped))); } catch (const std::exception& exception) { reply(WrapError(exception.what())); @@ -3118,7 +3587,7 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, { BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.noopAsync" + + "HostIntegrationCoreApi.echoNullableInt" + prepended_suffix, &GetCodec()); if (api != nullptr) { @@ -3126,15 +3595,25 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, [api](const EncodableValue& message, const flutter::MessageReply& reply) { try { - api->NoopAsync([reply](std::optional&& output) { - if (output.has_value()) { - reply(WrapError(output.value())); - return; - } - EncodableList wrapped; + const auto& args = std::get(message); + const auto& encodable_a_nullable_int_arg = args.at(0); + const auto* a_nullable_int_arg = + std::get_if(&encodable_a_nullable_int_arg); + ErrorOr> output = + api->EchoNullableInt(a_nullable_int_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { wrapped.push_back(EncodableValue()); - reply(EncodableValue(std::move(wrapped))); - }); + } + reply(EncodableValue(std::move(wrapped))); } catch (const std::exception& exception) { reply(WrapError(exception.what())); } @@ -3146,7 +3625,7 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, { BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.echoAsyncInt" + + "HostIntegrationCoreApi.echoNullableDouble" + prepended_suffix, &GetCodec()); if (api != nullptr) { @@ -3155,22 +3634,24 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, const flutter::MessageReply& reply) { try { const auto& args = std::get(message); - const auto& encodable_an_int_arg = args.at(0); - if (encodable_an_int_arg.IsNull()) { - reply(WrapError("an_int_arg unexpectedly null.")); + const auto& encodable_a_nullable_double_arg = args.at(0); + const auto* a_nullable_double_arg = + std::get_if(&encodable_a_nullable_double_arg); + ErrorOr> output = + api->EchoNullableDouble(a_nullable_double_arg); + if (output.has_error()) { + reply(WrapError(output.error())); return; } - const int64_t an_int_arg = encodable_an_int_arg.LongValue(); - api->EchoAsyncInt(an_int_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { wrapped.push_back( - EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - }); + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); } catch (const std::exception& exception) { reply(WrapError(exception.what())); } @@ -3182,7 +3663,7 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, { BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.echoAsyncDouble" + + "HostIntegrationCoreApi.echoNullableBool" + prepended_suffix, &GetCodec()); if (api != nullptr) { @@ -3191,24 +3672,24 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, const flutter::MessageReply& reply) { try { const auto& args = std::get(message); - const auto& encodable_a_double_arg = args.at(0); - if (encodable_a_double_arg.IsNull()) { - reply(WrapError("a_double_arg unexpectedly null.")); + const auto& encodable_a_nullable_bool_arg = args.at(0); + const auto* a_nullable_bool_arg = + std::get_if(&encodable_a_nullable_bool_arg); + ErrorOr> output = + api->EchoNullableBool(a_nullable_bool_arg); + if (output.has_error()) { + reply(WrapError(output.error())); return; } - const auto& a_double_arg = - std::get(encodable_a_double_arg); - api->EchoAsyncDouble( - a_double_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - }); + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); } catch (const std::exception& exception) { reply(WrapError(exception.what())); } @@ -3220,7 +3701,7 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, { BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.echoAsyncBool" + + "HostIntegrationCoreApi.echoNullableString" + prepended_suffix, &GetCodec()); if (api != nullptr) { @@ -3229,22 +3710,24 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, const flutter::MessageReply& reply) { try { const auto& args = std::get(message); - const auto& encodable_a_bool_arg = args.at(0); - if (encodable_a_bool_arg.IsNull()) { - reply(WrapError("a_bool_arg unexpectedly null.")); + const auto& encodable_a_nullable_string_arg = args.at(0); + const auto* a_nullable_string_arg = + std::get_if(&encodable_a_nullable_string_arg); + ErrorOr> output = + api->EchoNullableString(a_nullable_string_arg); + if (output.has_error()) { + reply(WrapError(output.error())); return; } - const auto& a_bool_arg = std::get(encodable_a_bool_arg); - api->EchoAsyncBool(a_bool_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { wrapped.push_back( - EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - }); + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); } catch (const std::exception& exception) { reply(WrapError(exception.what())); } @@ -3254,35 +3737,37 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, } } { - BasicMessageChannel<> channel(binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.echoAsyncString" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoNullableUint8List" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, const flutter::MessageReply& reply) { try { const auto& args = std::get(message); - const auto& encodable_a_string_arg = args.at(0); - if (encodable_a_string_arg.IsNull()) { - reply(WrapError("a_string_arg unexpectedly null.")); + const auto& encodable_a_nullable_uint8_list_arg = args.at(0); + const auto* a_nullable_uint8_list_arg = + std::get_if>( + &encodable_a_nullable_uint8_list_arg); + ErrorOr>> output = + api->EchoNullableUint8List(a_nullable_uint8_list_arg); + if (output.has_error()) { + reply(WrapError(output.error())); return; } - const auto& a_string_arg = - std::get(encodable_a_string_arg); - api->EchoAsyncString( - a_string_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - }); + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); } catch (const std::exception& exception) { reply(WrapError(exception.what())); } @@ -3294,7 +3779,7 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, { BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.echoAsyncUint8List" + + "HostIntegrationCoreApi.echoNullableObject" + prepended_suffix, &GetCodec()); if (api != nullptr) { @@ -3303,25 +3788,24 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, const flutter::MessageReply& reply) { try { const auto& args = std::get(message); - const auto& encodable_a_uint8_list_arg = args.at(0); - if (encodable_a_uint8_list_arg.IsNull()) { - reply(WrapError("a_uint8_list_arg unexpectedly null.")); + const auto& encodable_a_nullable_object_arg = args.at(0); + const auto* a_nullable_object_arg = + &encodable_a_nullable_object_arg; + ErrorOr> output = + api->EchoNullableObject(a_nullable_object_arg); + if (output.has_error()) { + reply(WrapError(output.error())); return; } - const auto& a_uint8_list_arg = - std::get>(encodable_a_uint8_list_arg); - api->EchoAsyncUint8List( - a_uint8_list_arg, - [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - }); + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); } catch (const std::exception& exception) { reply(WrapError(exception.what())); } @@ -3333,7 +3817,7 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, { BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.echoAsyncObject" + + "HostIntegrationCoreApi.echoNullableList" + prepended_suffix, &GetCodec()); if (api != nullptr) { @@ -3342,23 +3826,24 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, const flutter::MessageReply& reply) { try { const auto& args = std::get(message); - const auto& encodable_an_object_arg = args.at(0); - if (encodable_an_object_arg.IsNull()) { - reply(WrapError("an_object_arg unexpectedly null.")); + const auto& encodable_a_nullable_list_arg = args.at(0); + const auto* a_nullable_list_arg = + std::get_if(&encodable_a_nullable_list_arg); + ErrorOr> output = + api->EchoNullableList(a_nullable_list_arg); + if (output.has_error()) { + reply(WrapError(output.error())); return; } - const auto& an_object_arg = encodable_an_object_arg; - api->EchoAsyncObject( - an_object_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - }); + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); } catch (const std::exception& exception) { reply(WrapError(exception.what())); } @@ -3368,35 +3853,36 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, } } { - BasicMessageChannel<> channel(binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.echoAsyncList" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoNullableEnumList" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, const flutter::MessageReply& reply) { try { const auto& args = std::get(message); - const auto& encodable_list_arg = args.at(0); - if (encodable_list_arg.IsNull()) { - reply(WrapError("list_arg unexpectedly null.")); + const auto& encodable_enum_list_arg = args.at(0); + const auto* enum_list_arg = + std::get_if(&encodable_enum_list_arg); + ErrorOr> output = + api->EchoNullableEnumList(enum_list_arg); + if (output.has_error()) { + reply(WrapError(output.error())); return; } - const auto& list_arg = - std::get(encodable_list_arg); - api->EchoAsyncList( - list_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - }); + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); } catch (const std::exception& exception) { reply(WrapError(exception.what())); } @@ -3406,35 +3892,36 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, } } { - BasicMessageChannel<> channel(binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.echoAsyncMap" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoNullableClassList" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, const flutter::MessageReply& reply) { try { const auto& args = std::get(message); - const auto& encodable_a_map_arg = args.at(0); - if (encodable_a_map_arg.IsNull()) { - reply(WrapError("a_map_arg unexpectedly null.")); + const auto& encodable_class_list_arg = args.at(0); + const auto* class_list_arg = + std::get_if(&encodable_class_list_arg); + ErrorOr> output = + api->EchoNullableClassList(class_list_arg); + if (output.has_error()) { + reply(WrapError(output.error())); return; } - const auto& a_map_arg = - std::get(encodable_a_map_arg); - api->EchoAsyncMap( - a_map_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - }); + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); } catch (const std::exception& exception) { reply(WrapError(exception.what())); } @@ -3444,35 +3931,36 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, } } { - BasicMessageChannel<> channel(binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.echoAsyncEnum" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoNullableNonNullEnumList" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, const flutter::MessageReply& reply) { try { const auto& args = std::get(message); - const auto& encodable_an_enum_arg = args.at(0); - if (encodable_an_enum_arg.IsNull()) { - reply(WrapError("an_enum_arg unexpectedly null.")); + const auto& encodable_enum_list_arg = args.at(0); + const auto* enum_list_arg = + std::get_if(&encodable_enum_list_arg); + ErrorOr> output = + api->EchoNullableNonNullEnumList(enum_list_arg); + if (output.has_error()) { + reply(WrapError(output.error())); return; } - const auto& an_enum_arg = std::any_cast( - std::get(encodable_an_enum_arg)); - api->EchoAsyncEnum( - an_enum_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - CustomEncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - }); + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); } catch (const std::exception& exception) { reply(WrapError(exception.what())); } @@ -3485,7 +3973,7 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, BasicMessageChannel<> channel( binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAnotherAsyncEnum" + + "echoNullableNonNullClassList" + prepended_suffix, &GetCodec()); if (api != nullptr) { @@ -3494,24 +3982,24 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, const flutter::MessageReply& reply) { try { const auto& args = std::get(message); - const auto& encodable_another_enum_arg = args.at(0); - if (encodable_another_enum_arg.IsNull()) { - reply(WrapError("another_enum_arg unexpectedly null.")); + const auto& encodable_class_list_arg = args.at(0); + const auto* class_list_arg = + std::get_if(&encodable_class_list_arg); + ErrorOr> output = + api->EchoNullableNonNullClassList(class_list_arg); + if (output.has_error()) { + reply(WrapError(output.error())); return; } - const auto& another_enum_arg = std::any_cast( - std::get(encodable_another_enum_arg)); - api->EchoAnotherAsyncEnum( - another_enum_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - CustomEncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - }); + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); } catch (const std::exception& exception) { reply(WrapError(exception.what())); } @@ -3523,7 +4011,7 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, { BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.throwAsyncError" + + "HostIntegrationCoreApi.echoNullableMap" + prepended_suffix, &GetCodec()); if (api != nullptr) { @@ -3531,22 +4019,25 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, [api](const EncodableValue& message, const flutter::MessageReply& reply) { try { - api->ThrowAsyncError( - [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - }); + const auto& args = std::get(message); + const auto& encodable_map_arg = args.at(0); + const auto* map_arg = + std::get_if(&encodable_map_arg); + ErrorOr> output = + api->EchoNullableMap(map_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); } catch (const std::exception& exception) { reply(WrapError(exception.what())); } @@ -3559,7 +4050,7 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, BasicMessageChannel<> channel( binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "throwAsyncErrorFromVoid" + + "echoNullableStringMap" + prepended_suffix, &GetCodec()); if (api != nullptr) { @@ -3567,16 +4058,25 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, [api](const EncodableValue& message, const flutter::MessageReply& reply) { try { - api->ThrowAsyncErrorFromVoid( - [reply](std::optional&& output) { - if (output.has_value()) { - reply(WrapError(output.value())); - return; - } - EncodableList wrapped; - wrapped.push_back(EncodableValue()); - reply(EncodableValue(std::move(wrapped))); - }); + const auto& args = std::get(message); + const auto& encodable_string_map_arg = args.at(0); + const auto* string_map_arg = + std::get_if(&encodable_string_map_arg); + ErrorOr> output = + api->EchoNullableStringMap(string_map_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); } catch (const std::exception& exception) { reply(WrapError(exception.what())); } @@ -3586,33 +4086,35 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, } } { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "throwAsyncFlutterError" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.echoNullableIntMap" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, const flutter::MessageReply& reply) { try { - api->ThrowAsyncFlutterError( - [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - }); + const auto& args = std::get(message); + const auto& encodable_int_map_arg = args.at(0); + const auto* int_map_arg = + std::get_if(&encodable_int_map_arg); + ErrorOr> output = + api->EchoNullableIntMap(int_map_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); } catch (const std::exception& exception) { reply(WrapError(exception.what())); } @@ -3624,7 +4126,7 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, { BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.echoAsyncAllTypes" + + "HostIntegrationCoreApi.echoNullableEnumMap" + prepended_suffix, &GetCodec()); if (api != nullptr) { @@ -3633,24 +4135,24 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, const flutter::MessageReply& reply) { try { const auto& args = std::get(message); - const auto& encodable_everything_arg = args.at(0); - if (encodable_everything_arg.IsNull()) { - reply(WrapError("everything_arg unexpectedly null.")); + const auto& encodable_enum_map_arg = args.at(0); + const auto* enum_map_arg = + std::get_if(&encodable_enum_map_arg); + ErrorOr> output = + api->EchoNullableEnumMap(enum_map_arg); + if (output.has_error()) { + reply(WrapError(output.error())); return; } - const auto& everything_arg = std::any_cast( - std::get(encodable_everything_arg)); - api->EchoAsyncAllTypes( - everything_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - CustomEncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - }); + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); } catch (const std::exception& exception) { reply(WrapError(exception.what())); } @@ -3663,7 +4165,7 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, BasicMessageChannel<> channel( binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncNullableAllNullableTypes" + + "echoNullableClassMap" + prepended_suffix, &GetCodec()); if (api != nullptr) { @@ -3672,30 +4174,24 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, const flutter::MessageReply& reply) { try { const auto& args = std::get(message); - const auto& encodable_everything_arg = args.at(0); - const auto* everything_arg = - encodable_everything_arg.IsNull() - ? nullptr - : &(std::any_cast( - std::get( - encodable_everything_arg))); - api->EchoAsyncNullableAllNullableTypes( - everything_arg, - [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back(CustomEncodableValue( - std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - }); + const auto& encodable_class_map_arg = args.at(0); + const auto* class_map_arg = + std::get_if(&encodable_class_map_arg); + ErrorOr> output = + api->EchoNullableClassMap(class_map_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); } catch (const std::exception& exception) { reply(WrapError(exception.what())); } @@ -3708,45 +4204,37 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, BasicMessageChannel<> channel( binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncNullableAllNullableTypesWithoutRecursion" + + "echoNullableNonNullStringMap" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api]( - const EncodableValue& message, - const flutter::MessageReply& - reply) { - try { - const auto& args = std::get(message); - const auto& encodable_everything_arg = args.at(0); - const auto* everything_arg = - encodable_everything_arg.IsNull() - ? nullptr - : &(std::any_cast( - std::get( - encodable_everything_arg))); - api->EchoAsyncNullableAllNullableTypesWithoutRecursion( - everything_arg, - [reply](ErrorOr>&& - output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - CustomEncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_string_map_arg = args.at(0); + const auto* string_map_arg = + std::get_if(&encodable_string_map_arg); + ErrorOr> output = + api->EchoNullableNonNullStringMap(string_map_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } @@ -3755,7 +4243,7 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, BasicMessageChannel<> channel( binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncNullableInt" + + "echoNullableNonNullIntMap" + prepended_suffix, &GetCodec()); if (api != nullptr) { @@ -3764,30 +4252,24 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, const flutter::MessageReply& reply) { try { const auto& args = std::get(message); - const auto& encodable_an_int_arg = args.at(0); - const int64_t an_int_arg_value = - encodable_an_int_arg.IsNull() - ? 0 - : encodable_an_int_arg.LongValue(); - const auto* an_int_arg = - encodable_an_int_arg.IsNull() ? nullptr : &an_int_arg_value; - api->EchoAsyncNullableInt( - an_int_arg, - [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - }); + const auto& encodable_int_map_arg = args.at(0); + const auto* int_map_arg = + std::get_if(&encodable_int_map_arg); + ErrorOr> output = + api->EchoNullableNonNullIntMap(int_map_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); } catch (const std::exception& exception) { reply(WrapError(exception.what())); } @@ -3800,7 +4282,7 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, BasicMessageChannel<> channel( binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncNullableDouble" + + "echoNullableNonNullEnumMap" + prepended_suffix, &GetCodec()); if (api != nullptr) { @@ -3809,26 +4291,24 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, const flutter::MessageReply& reply) { try { const auto& args = std::get(message); - const auto& encodable_a_double_arg = args.at(0); - const auto* a_double_arg = - std::get_if(&encodable_a_double_arg); - api->EchoAsyncNullableDouble( - a_double_arg, - [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - }); + const auto& encodable_enum_map_arg = args.at(0); + const auto* enum_map_arg = + std::get_if(&encodable_enum_map_arg); + ErrorOr> output = + api->EchoNullableNonNullEnumMap(enum_map_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); } catch (const std::exception& exception) { reply(WrapError(exception.what())); } @@ -3841,7 +4321,7 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, BasicMessageChannel<> channel( binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncNullableBool" + + "echoNullableNonNullClassMap" + prepended_suffix, &GetCodec()); if (api != nullptr) { @@ -3850,24 +4330,24 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, const flutter::MessageReply& reply) { try { const auto& args = std::get(message); - const auto& encodable_a_bool_arg = args.at(0); - const auto* a_bool_arg = std::get_if(&encodable_a_bool_arg); - api->EchoAsyncNullableBool( - a_bool_arg, [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - }); + const auto& encodable_class_map_arg = args.at(0); + const auto* class_map_arg = + std::get_if(&encodable_class_map_arg); + ErrorOr> output = + api->EchoNullableNonNullClassMap(class_map_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); } catch (const std::exception& exception) { reply(WrapError(exception.what())); } @@ -3877,38 +4357,40 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, } } { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncNullableString" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.echoNullableEnum" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, const flutter::MessageReply& reply) { try { const auto& args = std::get(message); - const auto& encodable_a_string_arg = args.at(0); - const auto* a_string_arg = - std::get_if(&encodable_a_string_arg); - api->EchoAsyncNullableString( - a_string_arg, - [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - }); + const auto& encodable_an_enum_arg = args.at(0); + AnEnum an_enum_arg_value; + const AnEnum* an_enum_arg = nullptr; + if (!encodable_an_enum_arg.IsNull()) { + an_enum_arg_value = std::any_cast( + std::get(encodable_an_enum_arg)); + an_enum_arg = &an_enum_arg_value; + } + ErrorOr> output = api->EchoNullableEnum( + an_enum_arg ? &(*an_enum_arg) : nullptr); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + CustomEncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); } catch (const std::exception& exception) { reply(WrapError(exception.what())); } @@ -3921,7 +4403,7 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, BasicMessageChannel<> channel( binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncNullableUint8List" + + "echoAnotherNullableEnum" + prepended_suffix, &GetCodec()); if (api != nullptr) { @@ -3930,27 +4412,30 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, const flutter::MessageReply& reply) { try { const auto& args = std::get(message); - const auto& encodable_a_uint8_list_arg = args.at(0); - const auto* a_uint8_list_arg = std::get_if>( - &encodable_a_uint8_list_arg); - api->EchoAsyncNullableUint8List( - a_uint8_list_arg, - [reply]( - ErrorOr>>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - }); + const auto& encodable_another_enum_arg = args.at(0); + AnotherEnum another_enum_arg_value; + const AnotherEnum* another_enum_arg = nullptr; + if (!encodable_another_enum_arg.IsNull()) { + another_enum_arg_value = std::any_cast( + std::get(encodable_another_enum_arg)); + another_enum_arg = &another_enum_arg_value; + } + ErrorOr> output = + api->EchoAnotherNullableEnum( + another_enum_arg ? &(*another_enum_arg) : nullptr); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + CustomEncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); } catch (const std::exception& exception) { reply(WrapError(exception.what())); } @@ -3963,7 +4448,7 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, BasicMessageChannel<> channel( binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncNullableObject" + + "echoOptionalNullableInt" + prepended_suffix, &GetCodec()); if (api != nullptr) { @@ -3972,25 +4457,24 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, const flutter::MessageReply& reply) { try { const auto& args = std::get(message); - const auto& encodable_an_object_arg = args.at(0); - const auto* an_object_arg = &encodable_an_object_arg; - api->EchoAsyncNullableObject( - an_object_arg, - [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - }); + const auto& encodable_a_nullable_int_arg = args.at(0); + const auto* a_nullable_int_arg = + std::get_if(&encodable_a_nullable_int_arg); + ErrorOr> output = + api->EchoOptionalNullableInt(a_nullable_int_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); } catch (const std::exception& exception) { reply(WrapError(exception.what())); } @@ -4003,7 +4487,7 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, BasicMessageChannel<> channel( binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncNullableList" + + "echoNamedNullableString" + prepended_suffix, &GetCodec()); if (api != nullptr) { @@ -4012,26 +4496,24 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, const flutter::MessageReply& reply) { try { const auto& args = std::get(message); - const auto& encodable_list_arg = args.at(0); - const auto* list_arg = - std::get_if(&encodable_list_arg); - api->EchoAsyncNullableList( - list_arg, - [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - }); + const auto& encodable_a_nullable_string_arg = args.at(0); + const auto* a_nullable_string_arg = + std::get_if(&encodable_a_nullable_string_arg); + ErrorOr> output = + api->EchoNamedNullableString(a_nullable_string_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); } catch (const std::exception& exception) { reply(WrapError(exception.what())); } @@ -4041,38 +4523,25 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, } } { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncNullableMap" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.noopAsync" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, const flutter::MessageReply& reply) { try { - const auto& args = std::get(message); - const auto& encodable_a_map_arg = args.at(0); - const auto* a_map_arg = - std::get_if(&encodable_a_map_arg); - api->EchoAsyncNullableMap( - a_map_arg, - [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - }); + api->NoopAsync([reply](std::optional&& output) { + if (output.has_value()) { + reply(WrapError(output.value())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue()); + reply(EncodableValue(std::move(wrapped))); + }); } catch (const std::exception& exception) { reply(WrapError(exception.what())); } @@ -4082,43 +4551,33 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, } } { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncNullableEnum" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.echoAsyncInt" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, const flutter::MessageReply& reply) { try { const auto& args = std::get(message); - const auto& encodable_an_enum_arg = args.at(0); - AnEnum an_enum_arg_value; - const AnEnum* an_enum_arg = nullptr; - if (!encodable_an_enum_arg.IsNull()) { - an_enum_arg_value = std::any_cast( - std::get(encodable_an_enum_arg)); - an_enum_arg = &an_enum_arg_value; + const auto& encodable_an_int_arg = args.at(0); + if (encodable_an_int_arg.IsNull()) { + reply(WrapError("an_int_arg unexpectedly null.")); + return; } - api->EchoAsyncNullableEnum( - an_enum_arg ? &(*an_enum_arg) : nullptr, - [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back(CustomEncodableValue( - std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - }); + const int64_t an_int_arg = encodable_an_int_arg.LongValue(); + api->EchoAsyncInt(an_int_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + }); } catch (const std::exception& exception) { reply(WrapError(exception.what())); } @@ -4128,41 +4587,33 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, } } { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAnotherAsyncNullableEnum" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.echoAsyncDouble" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, const flutter::MessageReply& reply) { try { const auto& args = std::get(message); - const auto& encodable_another_enum_arg = args.at(0); - AnotherEnum another_enum_arg_value; - const AnotherEnum* another_enum_arg = nullptr; - if (!encodable_another_enum_arg.IsNull()) { - another_enum_arg_value = std::any_cast( - std::get(encodable_another_enum_arg)); - another_enum_arg = &another_enum_arg_value; + const auto& encodable_a_double_arg = args.at(0); + if (encodable_a_double_arg.IsNull()) { + reply(WrapError("a_double_arg unexpectedly null.")); + return; } - api->EchoAnotherAsyncNullableEnum( - another_enum_arg ? &(*another_enum_arg) : nullptr, - [reply](ErrorOr>&& output) { + const auto& a_double_arg = + std::get(encodable_a_double_arg); + api->EchoAsyncDouble( + a_double_arg, [reply](ErrorOr&& output) { if (output.has_error()) { reply(WrapError(output.error())); return; } EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back(CustomEncodableValue( - std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); reply(EncodableValue(std::move(wrapped))); }); } catch (const std::exception& exception) { @@ -4176,7 +4627,7 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, { BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.callFlutterNoop" + + "HostIntegrationCoreApi.echoAsyncBool" + prepended_suffix, &GetCodec()); if (api != nullptr) { @@ -4184,52 +4635,23 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, [api](const EncodableValue& message, const flutter::MessageReply& reply) { try { - api->CallFlutterNoop( - [reply](std::optional&& output) { - if (output.has_value()) { - reply(WrapError(output.value())); - return; - } - EncodableList wrapped; - wrapped.push_back(EncodableValue()); - reply(EncodableValue(std::move(wrapped))); - }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); - } else { - channel.SetMessageHandler(nullptr); - } - } - { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterThrowError" + - prepended_suffix, - &GetCodec()); - if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - api->CallFlutterThrowError( - [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - }); + const auto& args = std::get(message); + const auto& encodable_a_bool_arg = args.at(0); + if (encodable_a_bool_arg.IsNull()) { + reply(WrapError("a_bool_arg unexpectedly null.")); + return; + } + const auto& a_bool_arg = std::get(encodable_a_bool_arg); + api->EchoAsyncBool(a_bool_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + }); } catch (const std::exception& exception) { reply(WrapError(exception.what())); } @@ -4239,25 +4661,33 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, } } { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterThrowErrorFromVoid" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.echoAsyncString" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, const flutter::MessageReply& reply) { try { - api->CallFlutterThrowErrorFromVoid( - [reply](std::optional&& output) { - if (output.has_value()) { - reply(WrapError(output.value())); + const auto& args = std::get(message); + const auto& encodable_a_string_arg = args.at(0); + if (encodable_a_string_arg.IsNull()) { + reply(WrapError("a_string_arg unexpectedly null.")); + return; + } + const auto& a_string_arg = + std::get(encodable_a_string_arg); + api->EchoAsyncString( + a_string_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); return; } EncodableList wrapped; - wrapped.push_back(EncodableValue()); + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); reply(EncodableValue(std::move(wrapped))); }); } catch (const std::exception& exception) { @@ -4269,34 +4699,34 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, } } { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoAllTypes" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.echoAsyncUint8List" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, const flutter::MessageReply& reply) { try { const auto& args = std::get(message); - const auto& encodable_everything_arg = args.at(0); - if (encodable_everything_arg.IsNull()) { - reply(WrapError("everything_arg unexpectedly null.")); + const auto& encodable_a_uint8_list_arg = args.at(0); + if (encodable_a_uint8_list_arg.IsNull()) { + reply(WrapError("a_uint8_list_arg unexpectedly null.")); return; } - const auto& everything_arg = std::any_cast( - std::get(encodable_everything_arg)); - api->CallFlutterEchoAllTypes( - everything_arg, [reply](ErrorOr&& output) { + const auto& a_uint8_list_arg = + std::get>(encodable_a_uint8_list_arg); + api->EchoAsyncUint8List( + a_uint8_list_arg, + [reply](ErrorOr>&& output) { if (output.has_error()) { reply(WrapError(output.error())); return; } EncodableList wrapped; wrapped.push_back( - CustomEncodableValue(std::move(output).TakeValue())); + EncodableValue(std::move(output).TakeValue())); reply(EncodableValue(std::move(wrapped))); }); } catch (const std::exception& exception) { @@ -4308,40 +4738,32 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, } } { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoAllNullableTypes" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.echoAsyncObject" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, const flutter::MessageReply& reply) { try { const auto& args = std::get(message); - const auto& encodable_everything_arg = args.at(0); - const auto* everything_arg = - encodable_everything_arg.IsNull() - ? nullptr - : &(std::any_cast( - std::get( - encodable_everything_arg))); - api->CallFlutterEchoAllNullableTypes( - everything_arg, - [reply](ErrorOr>&& output) { + const auto& encodable_an_object_arg = args.at(0); + if (encodable_an_object_arg.IsNull()) { + reply(WrapError("an_object_arg unexpectedly null.")); + return; + } + const auto& an_object_arg = encodable_an_object_arg; + api->EchoAsyncObject( + an_object_arg, [reply](ErrorOr&& output) { if (output.has_error()) { reply(WrapError(output.error())); return; } EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back(CustomEncodableValue( - std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); reply(EncodableValue(std::move(wrapped))); }); } catch (const std::exception& exception) { @@ -4353,44 +4775,33 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, } } { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterSendMultipleNullableTypes" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.echoAsyncList" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, const flutter::MessageReply& reply) { try { const auto& args = std::get(message); - const auto& encodable_a_nullable_bool_arg = args.at(0); - const auto* a_nullable_bool_arg = - std::get_if(&encodable_a_nullable_bool_arg); - const auto& encodable_a_nullable_int_arg = args.at(1); - const int64_t a_nullable_int_arg_value = - encodable_a_nullable_int_arg.IsNull() - ? 0 - : encodable_a_nullable_int_arg.LongValue(); - const auto* a_nullable_int_arg = - encodable_a_nullable_int_arg.IsNull() - ? nullptr - : &a_nullable_int_arg_value; - const auto& encodable_a_nullable_string_arg = args.at(2); - const auto* a_nullable_string_arg = - std::get_if(&encodable_a_nullable_string_arg); - api->CallFlutterSendMultipleNullableTypes( - a_nullable_bool_arg, a_nullable_int_arg, - a_nullable_string_arg, - [reply](ErrorOr&& output) { + const auto& encodable_list_arg = args.at(0); + if (encodable_list_arg.IsNull()) { + reply(WrapError("list_arg unexpectedly null.")); + return; + } + const auto& list_arg = + std::get(encodable_list_arg); + api->EchoAsyncList( + list_arg, [reply](ErrorOr&& output) { if (output.has_error()) { reply(WrapError(output.error())); return; } EncodableList wrapped; wrapped.push_back( - CustomEncodableValue(std::move(output).TakeValue())); + EncodableValue(std::move(output).TakeValue())); reply(EncodableValue(std::move(wrapped))); }); } catch (const std::exception& exception) { @@ -4402,91 +4813,33 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, } } { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoAllNullableTypesWithoutRecursion" + - prepended_suffix, - &GetCodec()); - if (api != nullptr) { - channel.SetMessageHandler([api]( - const EncodableValue& message, - const flutter::MessageReply& - reply) { - try { - const auto& args = std::get(message); - const auto& encodable_everything_arg = args.at(0); - const auto* everything_arg = - encodable_everything_arg.IsNull() - ? nullptr - : &(std::any_cast( - std::get( - encodable_everything_arg))); - api->CallFlutterEchoAllNullableTypesWithoutRecursion( - everything_arg, - [reply](ErrorOr>&& - output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - CustomEncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); - } else { - channel.SetMessageHandler(nullptr); - } - } - { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterSendMultipleNullableTypesWithoutRecursion" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.echoAsyncEnumList" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, const flutter::MessageReply& reply) { try { const auto& args = std::get(message); - const auto& encodable_a_nullable_bool_arg = args.at(0); - const auto* a_nullable_bool_arg = - std::get_if(&encodable_a_nullable_bool_arg); - const auto& encodable_a_nullable_int_arg = args.at(1); - const int64_t a_nullable_int_arg_value = - encodable_a_nullable_int_arg.IsNull() - ? 0 - : encodable_a_nullable_int_arg.LongValue(); - const auto* a_nullable_int_arg = - encodable_a_nullable_int_arg.IsNull() - ? nullptr - : &a_nullable_int_arg_value; - const auto& encodable_a_nullable_string_arg = args.at(2); - const auto* a_nullable_string_arg = - std::get_if(&encodable_a_nullable_string_arg); - api->CallFlutterSendMultipleNullableTypesWithoutRecursion( - a_nullable_bool_arg, a_nullable_int_arg, - a_nullable_string_arg, - [reply](ErrorOr&& output) { + const auto& encodable_enum_list_arg = args.at(0); + if (encodable_enum_list_arg.IsNull()) { + reply(WrapError("enum_list_arg unexpectedly null.")); + return; + } + const auto& enum_list_arg = + std::get(encodable_enum_list_arg); + api->EchoAsyncEnumList( + enum_list_arg, [reply](ErrorOr&& output) { if (output.has_error()) { reply(WrapError(output.error())); return; } EncodableList wrapped; wrapped.push_back( - CustomEncodableValue(std::move(output).TakeValue())); + EncodableValue(std::move(output).TakeValue())); reply(EncodableValue(std::move(wrapped))); }); } catch (const std::exception& exception) { @@ -4500,7 +4853,7 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, { BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.callFlutterEchoBool" + + "HostIntegrationCoreApi.echoAsyncClassList" + prepended_suffix, &GetCodec()); if (api != nullptr) { @@ -4509,14 +4862,15 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, const flutter::MessageReply& reply) { try { const auto& args = std::get(message); - const auto& encodable_a_bool_arg = args.at(0); - if (encodable_a_bool_arg.IsNull()) { - reply(WrapError("a_bool_arg unexpectedly null.")); + const auto& encodable_class_list_arg = args.at(0); + if (encodable_class_list_arg.IsNull()) { + reply(WrapError("class_list_arg unexpectedly null.")); return; } - const auto& a_bool_arg = std::get(encodable_a_bool_arg); - api->CallFlutterEchoBool( - a_bool_arg, [reply](ErrorOr&& output) { + const auto& class_list_arg = + std::get(encodable_class_list_arg); + api->EchoAsyncClassList( + class_list_arg, [reply](ErrorOr&& output) { if (output.has_error()) { reply(WrapError(output.error())); return; @@ -4537,7 +4891,7 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, { BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.callFlutterEchoInt" + + "HostIntegrationCoreApi.echoAsyncMap" + prepended_suffix, &GetCodec()); if (api != nullptr) { @@ -4546,53 +4900,14 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, const flutter::MessageReply& reply) { try { const auto& args = std::get(message); - const auto& encodable_an_int_arg = args.at(0); - if (encodable_an_int_arg.IsNull()) { - reply(WrapError("an_int_arg unexpectedly null.")); - return; - } - const int64_t an_int_arg = encodable_an_int_arg.LongValue(); - api->CallFlutterEchoInt( - an_int_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); - } else { - channel.SetMessageHandler(nullptr); - } - } - { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoDouble" + - prepended_suffix, - &GetCodec()); - if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_double_arg = args.at(0); - if (encodable_a_double_arg.IsNull()) { - reply(WrapError("a_double_arg unexpectedly null.")); + const auto& encodable_map_arg = args.at(0); + if (encodable_map_arg.IsNull()) { + reply(WrapError("map_arg unexpectedly null.")); return; } - const auto& a_double_arg = - std::get(encodable_a_double_arg); - api->CallFlutterEchoDouble( - a_double_arg, [reply](ErrorOr&& output) { + const auto& map_arg = std::get(encodable_map_arg); + api->EchoAsyncMap( + map_arg, [reply](ErrorOr&& output) { if (output.has_error()) { reply(WrapError(output.error())); return; @@ -4611,27 +4926,26 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, } } { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoString" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.echoAsyncStringMap" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, const flutter::MessageReply& reply) { try { const auto& args = std::get(message); - const auto& encodable_a_string_arg = args.at(0); - if (encodable_a_string_arg.IsNull()) { - reply(WrapError("a_string_arg unexpectedly null.")); + const auto& encodable_string_map_arg = args.at(0); + if (encodable_string_map_arg.IsNull()) { + reply(WrapError("string_map_arg unexpectedly null.")); return; } - const auto& a_string_arg = - std::get(encodable_a_string_arg); - api->CallFlutterEchoString( - a_string_arg, [reply](ErrorOr&& output) { + const auto& string_map_arg = + std::get(encodable_string_map_arg); + api->EchoAsyncStringMap( + string_map_arg, [reply](ErrorOr&& output) { if (output.has_error()) { reply(WrapError(output.error())); return; @@ -4650,27 +4964,26 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, } } { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoUint8List" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.echoAsyncIntMap" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, const flutter::MessageReply& reply) { try { const auto& args = std::get(message); - const auto& encodable_list_arg = args.at(0); - if (encodable_list_arg.IsNull()) { - reply(WrapError("list_arg unexpectedly null.")); + const auto& encodable_int_map_arg = args.at(0); + if (encodable_int_map_arg.IsNull()) { + reply(WrapError("int_map_arg unexpectedly null.")); return; } - const auto& list_arg = - std::get>(encodable_list_arg); - api->CallFlutterEchoUint8List( - list_arg, [reply](ErrorOr>&& output) { + const auto& int_map_arg = + std::get(encodable_int_map_arg); + api->EchoAsyncIntMap( + int_map_arg, [reply](ErrorOr&& output) { if (output.has_error()) { reply(WrapError(output.error())); return; @@ -4691,7 +5004,7 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, { BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.callFlutterEchoList" + + "HostIntegrationCoreApi.echoAsyncEnumMap" + prepended_suffix, &GetCodec()); if (api != nullptr) { @@ -4700,15 +5013,15 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, const flutter::MessageReply& reply) { try { const auto& args = std::get(message); - const auto& encodable_list_arg = args.at(0); - if (encodable_list_arg.IsNull()) { - reply(WrapError("list_arg unexpectedly null.")); + const auto& encodable_enum_map_arg = args.at(0); + if (encodable_enum_map_arg.IsNull()) { + reply(WrapError("enum_map_arg unexpectedly null.")); return; } - const auto& list_arg = - std::get(encodable_list_arg); - api->CallFlutterEchoList( - list_arg, [reply](ErrorOr&& output) { + const auto& enum_map_arg = + std::get(encodable_enum_map_arg); + api->EchoAsyncEnumMap( + enum_map_arg, [reply](ErrorOr&& output) { if (output.has_error()) { reply(WrapError(output.error())); return; @@ -4729,7 +5042,7 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, { BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.callFlutterEchoMap" + + "HostIntegrationCoreApi.echoAsyncClassMap" + prepended_suffix, &GetCodec()); if (api != nullptr) { @@ -4738,15 +5051,15 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, const flutter::MessageReply& reply) { try { const auto& args = std::get(message); - const auto& encodable_a_map_arg = args.at(0); - if (encodable_a_map_arg.IsNull()) { - reply(WrapError("a_map_arg unexpectedly null.")); + const auto& encodable_class_map_arg = args.at(0); + if (encodable_class_map_arg.IsNull()) { + reply(WrapError("class_map_arg unexpectedly null.")); return; } - const auto& a_map_arg = - std::get(encodable_a_map_arg); - api->CallFlutterEchoMap( - a_map_arg, [reply](ErrorOr&& output) { + const auto& class_map_arg = + std::get(encodable_class_map_arg); + api->EchoAsyncClassMap( + class_map_arg, [reply](ErrorOr&& output) { if (output.has_error()) { reply(WrapError(output.error())); return; @@ -4767,7 +5080,7 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, { BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.callFlutterEchoEnum" + + "HostIntegrationCoreApi.echoAsyncEnum" + prepended_suffix, &GetCodec()); if (api != nullptr) { @@ -4783,7 +5096,7 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, } const auto& an_enum_arg = std::any_cast( std::get(encodable_an_enum_arg)); - api->CallFlutterEchoEnum( + api->EchoAsyncEnum( an_enum_arg, [reply](ErrorOr&& output) { if (output.has_error()) { reply(WrapError(output.error())); @@ -4806,7 +5119,7 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, BasicMessageChannel<> channel( binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoAnotherEnum" + + "echoAnotherAsyncEnum" + prepended_suffix, &GetCodec()); if (api != nullptr) { @@ -4822,7 +5135,7 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, } const auto& another_enum_arg = std::any_cast( std::get(encodable_another_enum_arg)); - api->CallFlutterEchoAnotherEnum( + api->EchoAnotherAsyncEnum( another_enum_arg, [reply](ErrorOr&& output) { if (output.has_error()) { reply(WrapError(output.error())); @@ -4842,22 +5155,18 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, } } { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoNullableBool" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.throwAsyncError" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, const flutter::MessageReply& reply) { try { - const auto& args = std::get(message); - const auto& encodable_a_bool_arg = args.at(0); - const auto* a_bool_arg = std::get_if(&encodable_a_bool_arg); - api->CallFlutterEchoNullableBool( - a_bool_arg, [reply](ErrorOr>&& output) { + api->ThrowAsyncError( + [reply](ErrorOr>&& output) { if (output.has_error()) { reply(WrapError(output.error())); return; @@ -4884,7 +5193,7 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, BasicMessageChannel<> channel( binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoNullableInt" + + "throwAsyncErrorFromVoid" + prepended_suffix, &GetCodec()); if (api != nullptr) { @@ -4892,29 +5201,14 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, [api](const EncodableValue& message, const flutter::MessageReply& reply) { try { - const auto& args = std::get(message); - const auto& encodable_an_int_arg = args.at(0); - const int64_t an_int_arg_value = - encodable_an_int_arg.IsNull() - ? 0 - : encodable_an_int_arg.LongValue(); - const auto* an_int_arg = - encodable_an_int_arg.IsNull() ? nullptr : &an_int_arg_value; - api->CallFlutterEchoNullableInt( - an_int_arg, - [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); + api->ThrowAsyncErrorFromVoid( + [reply](std::optional&& output) { + if (output.has_value()) { + reply(WrapError(output.value())); return; } EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } + wrapped.push_back(EncodableValue()); reply(EncodableValue(std::move(wrapped))); }); } catch (const std::exception& exception) { @@ -4929,7 +5223,7 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, BasicMessageChannel<> channel( binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoNullableDouble" + + "throwAsyncFlutterError" + prepended_suffix, &GetCodec()); if (api != nullptr) { @@ -4937,13 +5231,8 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, [api](const EncodableValue& message, const flutter::MessageReply& reply) { try { - const auto& args = std::get(message); - const auto& encodable_a_double_arg = args.at(0); - const auto* a_double_arg = - std::get_if(&encodable_a_double_arg); - api->CallFlutterEchoNullableDouble( - a_double_arg, - [reply](ErrorOr>&& output) { + api->ThrowAsyncFlutterError( + [reply](ErrorOr>&& output) { if (output.has_error()) { reply(WrapError(output.error())); return; @@ -4967,36 +5256,33 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, } } { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoNullableString" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.echoAsyncAllTypes" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, const flutter::MessageReply& reply) { try { const auto& args = std::get(message); - const auto& encodable_a_string_arg = args.at(0); - const auto* a_string_arg = - std::get_if(&encodable_a_string_arg); - api->CallFlutterEchoNullableString( - a_string_arg, - [reply](ErrorOr>&& output) { + const auto& encodable_everything_arg = args.at(0); + if (encodable_everything_arg.IsNull()) { + reply(WrapError("everything_arg unexpectedly null.")); + return; + } + const auto& everything_arg = std::any_cast( + std::get(encodable_everything_arg)); + api->EchoAsyncAllTypes( + everything_arg, [reply](ErrorOr&& output) { if (output.has_error()) { reply(WrapError(output.error())); return; } EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } + wrapped.push_back( + CustomEncodableValue(std::move(output).TakeValue())); reply(EncodableValue(std::move(wrapped))); }); } catch (const std::exception& exception) { @@ -5011,7 +5297,7 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, BasicMessageChannel<> channel( binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoNullableUint8List" + + "echoAsyncNullableAllNullableTypes" + prepended_suffix, &GetCodec()); if (api != nullptr) { @@ -5020,13 +5306,16 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, const flutter::MessageReply& reply) { try { const auto& args = std::get(message); - const auto& encodable_list_arg = args.at(0); - const auto* list_arg = - std::get_if>(&encodable_list_arg); - api->CallFlutterEchoNullableUint8List( - list_arg, - [reply]( - ErrorOr>>&& output) { + const auto& encodable_everything_arg = args.at(0); + const auto* everything_arg = + encodable_everything_arg.IsNull() + ? nullptr + : &(std::any_cast( + std::get( + encodable_everything_arg))); + api->EchoAsyncNullableAllNullableTypes( + everything_arg, + [reply](ErrorOr>&& output) { if (output.has_error()) { reply(WrapError(output.error())); return; @@ -5034,8 +5323,8 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, EncodableList wrapped; auto output_optional = std::move(output).TakeValue(); if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); + wrapped.push_back(CustomEncodableValue( + std::move(output_optional).value())); } else { wrapped.push_back(EncodableValue()); } @@ -5053,7 +5342,54 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, BasicMessageChannel<> channel( binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoNullableList" + + "echoAsyncNullableAllNullableTypesWithoutRecursion" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler([api]( + const EncodableValue& message, + const flutter::MessageReply& + reply) { + try { + const auto& args = std::get(message); + const auto& encodable_everything_arg = args.at(0); + const auto* everything_arg = + encodable_everything_arg.IsNull() + ? nullptr + : &(std::any_cast( + std::get( + encodable_everything_arg))); + api->EchoAsyncNullableAllNullableTypesWithoutRecursion( + everything_arg, + [reply](ErrorOr>&& + output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + CustomEncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncNullableInt" + prepended_suffix, &GetCodec()); if (api != nullptr) { @@ -5062,12 +5398,12 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, const flutter::MessageReply& reply) { try { const auto& args = std::get(message); - const auto& encodable_list_arg = args.at(0); - const auto* list_arg = - std::get_if(&encodable_list_arg); - api->CallFlutterEchoNullableList( - list_arg, - [reply](ErrorOr>&& output) { + const auto& encodable_an_int_arg = args.at(0); + const auto* an_int_arg = + std::get_if(&encodable_an_int_arg); + api->EchoAsyncNullableInt( + an_int_arg, + [reply](ErrorOr>&& output) { if (output.has_error()) { reply(WrapError(output.error())); return; @@ -5094,7 +5430,7 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, BasicMessageChannel<> channel( binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoNullableMap" + + "echoAsyncNullableDouble" + prepended_suffix, &GetCodec()); if (api != nullptr) { @@ -5103,12 +5439,12 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, const flutter::MessageReply& reply) { try { const auto& args = std::get(message); - const auto& encodable_a_map_arg = args.at(0); - const auto* a_map_arg = - std::get_if(&encodable_a_map_arg); - api->CallFlutterEchoNullableMap( - a_map_arg, - [reply](ErrorOr>&& output) { + const auto& encodable_a_double_arg = args.at(0); + const auto* a_double_arg = + std::get_if(&encodable_a_double_arg); + api->EchoAsyncNullableDouble( + a_double_arg, + [reply](ErrorOr>&& output) { if (output.has_error()) { reply(WrapError(output.error())); return; @@ -5135,7 +5471,7 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, BasicMessageChannel<> channel( binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoNullableEnum" + + "echoAsyncNullableBool" + prepended_suffix, &GetCodec()); if (api != nullptr) { @@ -5144,17 +5480,10 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, const flutter::MessageReply& reply) { try { const auto& args = std::get(message); - const auto& encodable_an_enum_arg = args.at(0); - AnEnum an_enum_arg_value; - const AnEnum* an_enum_arg = nullptr; - if (!encodable_an_enum_arg.IsNull()) { - an_enum_arg_value = std::any_cast( - std::get(encodable_an_enum_arg)); - an_enum_arg = &an_enum_arg_value; - } - api->CallFlutterEchoNullableEnum( - an_enum_arg ? &(*an_enum_arg) : nullptr, - [reply](ErrorOr>&& output) { + const auto& encodable_a_bool_arg = args.at(0); + const auto* a_bool_arg = std::get_if(&encodable_a_bool_arg); + api->EchoAsyncNullableBool( + a_bool_arg, [reply](ErrorOr>&& output) { if (output.has_error()) { reply(WrapError(output.error())); return; @@ -5162,8 +5491,8 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, EncodableList wrapped; auto output_optional = std::move(output).TakeValue(); if (output_optional) { - wrapped.push_back(CustomEncodableValue( - std::move(output_optional).value())); + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); } else { wrapped.push_back(EncodableValue()); } @@ -5181,7 +5510,7 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, BasicMessageChannel<> channel( binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoAnotherNullableEnum" + + "echoAsyncNullableString" + prepended_suffix, &GetCodec()); if (api != nullptr) { @@ -5190,17 +5519,12 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, const flutter::MessageReply& reply) { try { const auto& args = std::get(message); - const auto& encodable_another_enum_arg = args.at(0); - AnotherEnum another_enum_arg_value; - const AnotherEnum* another_enum_arg = nullptr; - if (!encodable_another_enum_arg.IsNull()) { - another_enum_arg_value = std::any_cast( - std::get(encodable_another_enum_arg)); - another_enum_arg = &another_enum_arg_value; - } - api->CallFlutterEchoAnotherNullableEnum( - another_enum_arg ? &(*another_enum_arg) : nullptr, - [reply](ErrorOr>&& output) { + const auto& encodable_a_string_arg = args.at(0); + const auto* a_string_arg = + std::get_if(&encodable_a_string_arg); + api->EchoAsyncNullableString( + a_string_arg, + [reply](ErrorOr>&& output) { if (output.has_error()) { reply(WrapError(output.error())); return; @@ -5208,8 +5532,8 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, EncodableList wrapped; auto output_optional = std::move(output).TakeValue(); if (output_optional) { - wrapped.push_back(CustomEncodableValue( - std::move(output_optional).value())); + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); } else { wrapped.push_back(EncodableValue()); } @@ -5227,7 +5551,7 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, BasicMessageChannel<> channel( binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterSmallApiEchoString" + + "echoAsyncNullableUint8List" + prepended_suffix, &GetCodec()); if (api != nullptr) { @@ -5236,22 +5560,188 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, const flutter::MessageReply& reply) { try { const auto& args = std::get(message); - const auto& encodable_a_string_arg = args.at(0); - if (encodable_a_string_arg.IsNull()) { - reply(WrapError("a_string_arg unexpectedly null.")); - return; - } - const auto& a_string_arg = - std::get(encodable_a_string_arg); - api->CallFlutterSmallApiEchoString( - a_string_arg, [reply](ErrorOr&& output) { + const auto& encodable_a_uint8_list_arg = args.at(0); + const auto* a_uint8_list_arg = std::get_if>( + &encodable_a_uint8_list_arg); + api->EchoAsyncNullableUint8List( + a_uint8_list_arg, + [reply]( + ErrorOr>>&& output) { if (output.has_error()) { reply(WrapError(output.error())); return; } EncodableList wrapped; - wrapped.push_back( - EncodableValue(std::move(output).TakeValue())); + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncNullableObject" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_an_object_arg = args.at(0); + const auto* an_object_arg = &encodable_an_object_arg; + api->EchoAsyncNullableObject( + an_object_arg, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncNullableList" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_list_arg = args.at(0); + const auto* list_arg = + std::get_if(&encodable_list_arg); + api->EchoAsyncNullableList( + list_arg, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncNullableEnumList" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_enum_list_arg = args.at(0); + const auto* enum_list_arg = + std::get_if(&encodable_enum_list_arg); + api->EchoAsyncNullableEnumList( + enum_list_arg, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncNullableClassList" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_class_list_arg = args.at(0); + const auto* class_list_arg = + std::get_if(&encodable_class_list_arg); + api->EchoAsyncNullableClassList( + class_list_arg, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } reply(EncodableValue(std::move(wrapped))); }); } catch (const std::exception& exception) { @@ -5262,49 +5752,3370 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, channel.SetMessageHandler(nullptr); } } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncNullableMap" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_map_arg = args.at(0); + const auto* map_arg = + std::get_if(&encodable_map_arg); + api->EchoAsyncNullableMap( + map_arg, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncNullableStringMap" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_string_map_arg = args.at(0); + const auto* string_map_arg = + std::get_if(&encodable_string_map_arg); + api->EchoAsyncNullableStringMap( + string_map_arg, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncNullableIntMap" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_int_map_arg = args.at(0); + const auto* int_map_arg = + std::get_if(&encodable_int_map_arg); + api->EchoAsyncNullableIntMap( + int_map_arg, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncNullableEnumMap" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_enum_map_arg = args.at(0); + const auto* enum_map_arg = + std::get_if(&encodable_enum_map_arg); + api->EchoAsyncNullableEnumMap( + enum_map_arg, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncNullableClassMap" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_class_map_arg = args.at(0); + const auto* class_map_arg = + std::get_if(&encodable_class_map_arg); + api->EchoAsyncNullableClassMap( + class_map_arg, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncNullableEnum" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_an_enum_arg = args.at(0); + AnEnum an_enum_arg_value; + const AnEnum* an_enum_arg = nullptr; + if (!encodable_an_enum_arg.IsNull()) { + an_enum_arg_value = std::any_cast( + std::get(encodable_an_enum_arg)); + an_enum_arg = &an_enum_arg_value; + } + api->EchoAsyncNullableEnum( + an_enum_arg ? &(*an_enum_arg) : nullptr, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back(CustomEncodableValue( + std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAnotherAsyncNullableEnum" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_another_enum_arg = args.at(0); + AnotherEnum another_enum_arg_value; + const AnotherEnum* another_enum_arg = nullptr; + if (!encodable_another_enum_arg.IsNull()) { + another_enum_arg_value = std::any_cast( + std::get(encodable_another_enum_arg)); + another_enum_arg = &another_enum_arg_value; + } + api->EchoAnotherAsyncNullableEnum( + another_enum_arg ? &(*another_enum_arg) : nullptr, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back(CustomEncodableValue( + std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.callFlutterNoop" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + api->CallFlutterNoop( + [reply](std::optional&& output) { + if (output.has_value()) { + reply(WrapError(output.value())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue()); + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterThrowError" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + api->CallFlutterThrowError( + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterThrowErrorFromVoid" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + api->CallFlutterThrowErrorFromVoid( + [reply](std::optional&& output) { + if (output.has_value()) { + reply(WrapError(output.value())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue()); + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoAllTypes" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_everything_arg = args.at(0); + if (encodable_everything_arg.IsNull()) { + reply(WrapError("everything_arg unexpectedly null.")); + return; + } + const auto& everything_arg = std::any_cast( + std::get(encodable_everything_arg)); + api->CallFlutterEchoAllTypes( + everything_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + CustomEncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoAllNullableTypes" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_everything_arg = args.at(0); + const auto* everything_arg = + encodable_everything_arg.IsNull() + ? nullptr + : &(std::any_cast( + std::get( + encodable_everything_arg))); + api->CallFlutterEchoAllNullableTypes( + everything_arg, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back(CustomEncodableValue( + std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterSendMultipleNullableTypes" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_nullable_bool_arg = args.at(0); + const auto* a_nullable_bool_arg = + std::get_if(&encodable_a_nullable_bool_arg); + const auto& encodable_a_nullable_int_arg = args.at(1); + const auto* a_nullable_int_arg = + std::get_if(&encodable_a_nullable_int_arg); + const auto& encodable_a_nullable_string_arg = args.at(2); + const auto* a_nullable_string_arg = + std::get_if(&encodable_a_nullable_string_arg); + api->CallFlutterSendMultipleNullableTypes( + a_nullable_bool_arg, a_nullable_int_arg, + a_nullable_string_arg, + [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + CustomEncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoAllNullableTypesWithoutRecursion" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler([api]( + const EncodableValue& message, + const flutter::MessageReply& + reply) { + try { + const auto& args = std::get(message); + const auto& encodable_everything_arg = args.at(0); + const auto* everything_arg = + encodable_everything_arg.IsNull() + ? nullptr + : &(std::any_cast( + std::get( + encodable_everything_arg))); + api->CallFlutterEchoAllNullableTypesWithoutRecursion( + everything_arg, + [reply](ErrorOr>&& + output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + CustomEncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterSendMultipleNullableTypesWithoutRecursion" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_nullable_bool_arg = args.at(0); + const auto* a_nullable_bool_arg = + std::get_if(&encodable_a_nullable_bool_arg); + const auto& encodable_a_nullable_int_arg = args.at(1); + const auto* a_nullable_int_arg = + std::get_if(&encodable_a_nullable_int_arg); + const auto& encodable_a_nullable_string_arg = args.at(2); + const auto* a_nullable_string_arg = + std::get_if(&encodable_a_nullable_string_arg); + api->CallFlutterSendMultipleNullableTypesWithoutRecursion( + a_nullable_bool_arg, a_nullable_int_arg, + a_nullable_string_arg, + [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + CustomEncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.callFlutterEchoBool" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_bool_arg = args.at(0); + if (encodable_a_bool_arg.IsNull()) { + reply(WrapError("a_bool_arg unexpectedly null.")); + return; + } + const auto& a_bool_arg = std::get(encodable_a_bool_arg); + api->CallFlutterEchoBool( + a_bool_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.callFlutterEchoInt" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_an_int_arg = args.at(0); + if (encodable_an_int_arg.IsNull()) { + reply(WrapError("an_int_arg unexpectedly null.")); + return; + } + const int64_t an_int_arg = encodable_an_int_arg.LongValue(); + api->CallFlutterEchoInt( + an_int_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoDouble" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_double_arg = args.at(0); + if (encodable_a_double_arg.IsNull()) { + reply(WrapError("a_double_arg unexpectedly null.")); + return; + } + const auto& a_double_arg = + std::get(encodable_a_double_arg); + api->CallFlutterEchoDouble( + a_double_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoString" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_string_arg = args.at(0); + if (encodable_a_string_arg.IsNull()) { + reply(WrapError("a_string_arg unexpectedly null.")); + return; + } + const auto& a_string_arg = + std::get(encodable_a_string_arg); + api->CallFlutterEchoString( + a_string_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoUint8List" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_list_arg = args.at(0); + if (encodable_list_arg.IsNull()) { + reply(WrapError("list_arg unexpectedly null.")); + return; + } + const auto& list_arg = + std::get>(encodable_list_arg); + api->CallFlutterEchoUint8List( + list_arg, [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.callFlutterEchoList" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_list_arg = args.at(0); + if (encodable_list_arg.IsNull()) { + reply(WrapError("list_arg unexpectedly null.")); + return; + } + const auto& list_arg = + std::get(encodable_list_arg); + api->CallFlutterEchoList( + list_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoEnumList" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_enum_list_arg = args.at(0); + if (encodable_enum_list_arg.IsNull()) { + reply(WrapError("enum_list_arg unexpectedly null.")); + return; + } + const auto& enum_list_arg = + std::get(encodable_enum_list_arg); + api->CallFlutterEchoEnumList( + enum_list_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoClassList" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_class_list_arg = args.at(0); + if (encodable_class_list_arg.IsNull()) { + reply(WrapError("class_list_arg unexpectedly null.")); + return; + } + const auto& class_list_arg = + std::get(encodable_class_list_arg); + api->CallFlutterEchoClassList( + class_list_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNonNullEnumList" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_enum_list_arg = args.at(0); + if (encodable_enum_list_arg.IsNull()) { + reply(WrapError("enum_list_arg unexpectedly null.")); + return; + } + const auto& enum_list_arg = + std::get(encodable_enum_list_arg); + api->CallFlutterEchoNonNullEnumList( + enum_list_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNonNullClassList" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_class_list_arg = args.at(0); + if (encodable_class_list_arg.IsNull()) { + reply(WrapError("class_list_arg unexpectedly null.")); + return; + } + const auto& class_list_arg = + std::get(encodable_class_list_arg); + api->CallFlutterEchoNonNullClassList( + class_list_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.callFlutterEchoMap" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_map_arg = args.at(0); + if (encodable_map_arg.IsNull()) { + reply(WrapError("map_arg unexpectedly null.")); + return; + } + const auto& map_arg = std::get(encodable_map_arg); + api->CallFlutterEchoMap( + map_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoStringMap" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_string_map_arg = args.at(0); + if (encodable_string_map_arg.IsNull()) { + reply(WrapError("string_map_arg unexpectedly null.")); + return; + } + const auto& string_map_arg = + std::get(encodable_string_map_arg); + api->CallFlutterEchoStringMap( + string_map_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoIntMap" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_int_map_arg = args.at(0); + if (encodable_int_map_arg.IsNull()) { + reply(WrapError("int_map_arg unexpectedly null.")); + return; + } + const auto& int_map_arg = + std::get(encodable_int_map_arg); + api->CallFlutterEchoIntMap( + int_map_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoEnumMap" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_enum_map_arg = args.at(0); + if (encodable_enum_map_arg.IsNull()) { + reply(WrapError("enum_map_arg unexpectedly null.")); + return; + } + const auto& enum_map_arg = + std::get(encodable_enum_map_arg); + api->CallFlutterEchoEnumMap( + enum_map_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoClassMap" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_class_map_arg = args.at(0); + if (encodable_class_map_arg.IsNull()) { + reply(WrapError("class_map_arg unexpectedly null.")); + return; + } + const auto& class_map_arg = + std::get(encodable_class_map_arg); + api->CallFlutterEchoClassMap( + class_map_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNonNullStringMap" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_string_map_arg = args.at(0); + if (encodable_string_map_arg.IsNull()) { + reply(WrapError("string_map_arg unexpectedly null.")); + return; + } + const auto& string_map_arg = + std::get(encodable_string_map_arg); + api->CallFlutterEchoNonNullStringMap( + string_map_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNonNullIntMap" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_int_map_arg = args.at(0); + if (encodable_int_map_arg.IsNull()) { + reply(WrapError("int_map_arg unexpectedly null.")); + return; + } + const auto& int_map_arg = + std::get(encodable_int_map_arg); + api->CallFlutterEchoNonNullIntMap( + int_map_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNonNullEnumMap" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_enum_map_arg = args.at(0); + if (encodable_enum_map_arg.IsNull()) { + reply(WrapError("enum_map_arg unexpectedly null.")); + return; + } + const auto& enum_map_arg = + std::get(encodable_enum_map_arg); + api->CallFlutterEchoNonNullEnumMap( + enum_map_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNonNullClassMap" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_class_map_arg = args.at(0); + if (encodable_class_map_arg.IsNull()) { + reply(WrapError("class_map_arg unexpectedly null.")); + return; + } + const auto& class_map_arg = + std::get(encodable_class_map_arg); + api->CallFlutterEchoNonNullClassMap( + class_map_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.callFlutterEchoEnum" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_an_enum_arg = args.at(0); + if (encodable_an_enum_arg.IsNull()) { + reply(WrapError("an_enum_arg unexpectedly null.")); + return; + } + const auto& an_enum_arg = std::any_cast( + std::get(encodable_an_enum_arg)); + api->CallFlutterEchoEnum( + an_enum_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + CustomEncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoAnotherEnum" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_another_enum_arg = args.at(0); + if (encodable_another_enum_arg.IsNull()) { + reply(WrapError("another_enum_arg unexpectedly null.")); + return; + } + const auto& another_enum_arg = std::any_cast( + std::get(encodable_another_enum_arg)); + api->CallFlutterEchoAnotherEnum( + another_enum_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + CustomEncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableBool" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_bool_arg = args.at(0); + const auto* a_bool_arg = std::get_if(&encodable_a_bool_arg); + api->CallFlutterEchoNullableBool( + a_bool_arg, [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableInt" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_an_int_arg = args.at(0); + const auto* an_int_arg = + std::get_if(&encodable_an_int_arg); + api->CallFlutterEchoNullableInt( + an_int_arg, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableDouble" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_double_arg = args.at(0); + const auto* a_double_arg = + std::get_if(&encodable_a_double_arg); + api->CallFlutterEchoNullableDouble( + a_double_arg, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableString" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_string_arg = args.at(0); + const auto* a_string_arg = + std::get_if(&encodable_a_string_arg); + api->CallFlutterEchoNullableString( + a_string_arg, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableUint8List" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_list_arg = args.at(0); + const auto* list_arg = + std::get_if>(&encodable_list_arg); + api->CallFlutterEchoNullableUint8List( + list_arg, + [reply]( + ErrorOr>>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableList" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_list_arg = args.at(0); + const auto* list_arg = + std::get_if(&encodable_list_arg); + api->CallFlutterEchoNullableList( + list_arg, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableEnumList" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_enum_list_arg = args.at(0); + const auto* enum_list_arg = + std::get_if(&encodable_enum_list_arg); + api->CallFlutterEchoNullableEnumList( + enum_list_arg, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableClassList" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_class_list_arg = args.at(0); + const auto* class_list_arg = + std::get_if(&encodable_class_list_arg); + api->CallFlutterEchoNullableClassList( + class_list_arg, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableNonNullEnumList" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_enum_list_arg = args.at(0); + const auto* enum_list_arg = + std::get_if(&encodable_enum_list_arg); + api->CallFlutterEchoNullableNonNullEnumList( + enum_list_arg, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableNonNullClassList" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_class_list_arg = args.at(0); + const auto* class_list_arg = + std::get_if(&encodable_class_list_arg); + api->CallFlutterEchoNullableNonNullClassList( + class_list_arg, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableMap" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_map_arg = args.at(0); + const auto* map_arg = + std::get_if(&encodable_map_arg); + api->CallFlutterEchoNullableMap( + map_arg, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableStringMap" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_string_map_arg = args.at(0); + const auto* string_map_arg = + std::get_if(&encodable_string_map_arg); + api->CallFlutterEchoNullableStringMap( + string_map_arg, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableIntMap" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_int_map_arg = args.at(0); + const auto* int_map_arg = + std::get_if(&encodable_int_map_arg); + api->CallFlutterEchoNullableIntMap( + int_map_arg, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableEnumMap" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_enum_map_arg = args.at(0); + const auto* enum_map_arg = + std::get_if(&encodable_enum_map_arg); + api->CallFlutterEchoNullableEnumMap( + enum_map_arg, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableClassMap" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_class_map_arg = args.at(0); + const auto* class_map_arg = + std::get_if(&encodable_class_map_arg); + api->CallFlutterEchoNullableClassMap( + class_map_arg, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableNonNullStringMap" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_string_map_arg = args.at(0); + const auto* string_map_arg = + std::get_if(&encodable_string_map_arg); + api->CallFlutterEchoNullableNonNullStringMap( + string_map_arg, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableNonNullIntMap" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_int_map_arg = args.at(0); + const auto* int_map_arg = + std::get_if(&encodable_int_map_arg); + api->CallFlutterEchoNullableNonNullIntMap( + int_map_arg, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableNonNullEnumMap" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_enum_map_arg = args.at(0); + const auto* enum_map_arg = + std::get_if(&encodable_enum_map_arg); + api->CallFlutterEchoNullableNonNullEnumMap( + enum_map_arg, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableNonNullClassMap" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_class_map_arg = args.at(0); + const auto* class_map_arg = + std::get_if(&encodable_class_map_arg); + api->CallFlutterEchoNullableNonNullClassMap( + class_map_arg, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableEnum" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_an_enum_arg = args.at(0); + AnEnum an_enum_arg_value; + const AnEnum* an_enum_arg = nullptr; + if (!encodable_an_enum_arg.IsNull()) { + an_enum_arg_value = std::any_cast( + std::get(encodable_an_enum_arg)); + an_enum_arg = &an_enum_arg_value; + } + api->CallFlutterEchoNullableEnum( + an_enum_arg ? &(*an_enum_arg) : nullptr, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back(CustomEncodableValue( + std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoAnotherNullableEnum" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_another_enum_arg = args.at(0); + AnotherEnum another_enum_arg_value; + const AnotherEnum* another_enum_arg = nullptr; + if (!encodable_another_enum_arg.IsNull()) { + another_enum_arg_value = std::any_cast( + std::get(encodable_another_enum_arg)); + another_enum_arg = &another_enum_arg_value; + } + api->CallFlutterEchoAnotherNullableEnum( + another_enum_arg ? &(*another_enum_arg) : nullptr, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back(CustomEncodableValue( + std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterSmallApiEchoString" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_string_arg = args.at(0); + if (encodable_a_string_arg.IsNull()) { + reply(WrapError("a_string_arg unexpectedly null.")); + return; + } + const auto& a_string_arg = + std::get(encodable_a_string_arg); + api->CallFlutterSmallApiEchoString( + a_string_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } +} + +EncodableValue HostIntegrationCoreApi::WrapError( + std::string_view error_message) { + return EncodableValue( + EncodableList{EncodableValue(std::string(error_message)), + EncodableValue("Error"), EncodableValue()}); +} + +EncodableValue HostIntegrationCoreApi::WrapError(const FlutterError& error) { + return EncodableValue(EncodableList{EncodableValue(error.code()), + EncodableValue(error.message()), + error.details()}); +} + +// Generated class from Pigeon that represents Flutter messages that can be +// called from C++. +FlutterIntegrationCoreApi::FlutterIntegrationCoreApi( + flutter::BinaryMessenger* binary_messenger) + : binary_messenger_(binary_messenger), message_channel_suffix_("") {} + +FlutterIntegrationCoreApi::FlutterIntegrationCoreApi( + flutter::BinaryMessenger* binary_messenger, + const std::string& message_channel_suffix) + : binary_messenger_(binary_messenger), + message_channel_suffix_(message_channel_suffix.length() > 0 + ? std::string(".") + message_channel_suffix + : "") {} + +const flutter::StandardMessageCodec& FlutterIntegrationCoreApi::GetCodec() { + return flutter::StandardMessageCodec::GetInstance( + &PigeonInternalCodecSerializer::GetInstance()); +} + +void FlutterIntegrationCoreApi::Noop( + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "noop" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + on_success(); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} + +void FlutterIntegrationCoreApi::ThrowError( + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "throwError" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto* return_value = &list_return_value->at(0); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} + +void FlutterIntegrationCoreApi::ThrowErrorFromVoid( + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "throwErrorFromVoid" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + on_success(); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} + +void FlutterIntegrationCoreApi::EchoAllTypes( + const AllTypes& everything_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoAllTypes" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + CustomEncodableValue(everything_arg), + }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto& return_value = std::any_cast( + std::get(list_return_value->at(0))); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} + +void FlutterIntegrationCoreApi::EchoAllNullableTypes( + const AllNullableTypes* everything_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoAllNullableTypes" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + everything_arg ? CustomEncodableValue(*everything_arg) : EncodableValue(), + }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto* return_value = + list_return_value->at(0).IsNull() + ? nullptr + : &(std::any_cast( + std::get( + list_return_value->at(0)))); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} + +void FlutterIntegrationCoreApi::SendMultipleNullableTypes( + const bool* a_nullable_bool_arg, const int64_t* a_nullable_int_arg, + const std::string* a_nullable_string_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "sendMultipleNullableTypes" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + a_nullable_bool_arg ? EncodableValue(*a_nullable_bool_arg) + : EncodableValue(), + a_nullable_int_arg ? EncodableValue(*a_nullable_int_arg) + : EncodableValue(), + a_nullable_string_arg ? EncodableValue(*a_nullable_string_arg) + : EncodableValue(), + }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto& return_value = std::any_cast( + std::get(list_return_value->at(0))); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} + +void FlutterIntegrationCoreApi::EchoAllNullableTypesWithoutRecursion( + const AllNullableTypesWithoutRecursion* everything_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoAllNullableTypesWithoutRecursion" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + everything_arg ? CustomEncodableValue(*everything_arg) : EncodableValue(), + }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto* return_value = + list_return_value->at(0).IsNull() + ? nullptr + : &(std::any_cast( + std::get( + list_return_value->at(0)))); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} + +void FlutterIntegrationCoreApi::SendMultipleNullableTypesWithoutRecursion( + const bool* a_nullable_bool_arg, const int64_t* a_nullable_int_arg, + const std::string* a_nullable_string_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "sendMultipleNullableTypesWithoutRecursion" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + a_nullable_bool_arg ? EncodableValue(*a_nullable_bool_arg) + : EncodableValue(), + a_nullable_int_arg ? EncodableValue(*a_nullable_int_arg) + : EncodableValue(), + a_nullable_string_arg ? EncodableValue(*a_nullable_string_arg) + : EncodableValue(), + }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto& return_value = + std::any_cast( + std::get(list_return_value->at(0))); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} + +void FlutterIntegrationCoreApi::EchoBool( + bool a_bool_arg, std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoBool" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + EncodableValue(a_bool_arg), + }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto& return_value = std::get(list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} + +void FlutterIntegrationCoreApi::EchoInt( + int64_t an_int_arg, std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoInt" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + EncodableValue(an_int_arg), + }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const int64_t return_value = list_return_value->at(0).LongValue(); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} + +void FlutterIntegrationCoreApi::EchoDouble( + double a_double_arg, std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoDouble" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + EncodableValue(a_double_arg), + }); + channel.Send(encoded_api_arguments, [channel_name, + on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, + size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error(FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto& return_value = std::get(list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} + +void FlutterIntegrationCoreApi::EchoString( + const std::string& a_string_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoString" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + EncodableValue(a_string_arg), + }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto& return_value = + std::get(list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} + +void FlutterIntegrationCoreApi::EchoUint8List( + const std::vector& list_arg, + std::function&)>&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoUint8List" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + EncodableValue(list_arg), + }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto& return_value = + std::get>(list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} + +void FlutterIntegrationCoreApi::EchoList( + const EncodableList& list_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoList" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + EncodableValue(list_arg), + }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto& return_value = + std::get(list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} + +void FlutterIntegrationCoreApi::EchoEnumList( + const EncodableList& enum_list_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoEnumList" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + EncodableValue(enum_list_arg), + }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto& return_value = + std::get(list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} + +void FlutterIntegrationCoreApi::EchoClassList( + const EncodableList& class_list_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoClassList" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + EncodableValue(class_list_arg), + }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto& return_value = + std::get(list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} + +void FlutterIntegrationCoreApi::EchoNonNullEnumList( + const EncodableList& enum_list_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoNonNullEnumList" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + EncodableValue(enum_list_arg), + }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto& return_value = + std::get(list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} + +void FlutterIntegrationCoreApi::EchoNonNullClassList( + const EncodableList& class_list_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoNonNullClassList" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + EncodableValue(class_list_arg), + }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto& return_value = + std::get(list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} + +void FlutterIntegrationCoreApi::EchoMap( + const EncodableMap& map_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoMap" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + EncodableValue(map_arg), + }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto& return_value = + std::get(list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} + +void FlutterIntegrationCoreApi::EchoStringMap( + const EncodableMap& string_map_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoStringMap" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + EncodableValue(string_map_arg), + }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto& return_value = + std::get(list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} + +void FlutterIntegrationCoreApi::EchoIntMap( + const EncodableMap& int_map_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoIntMap" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + EncodableValue(int_map_arg), + }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto& return_value = + std::get(list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} + +void FlutterIntegrationCoreApi::EchoEnumMap( + const EncodableMap& enum_map_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoEnumMap" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + EncodableValue(enum_map_arg), + }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto& return_value = + std::get(list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} + +void FlutterIntegrationCoreApi::EchoClassMap( + const EncodableMap& class_map_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoClassMap" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + EncodableValue(class_map_arg), + }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto& return_value = + std::get(list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); } -EncodableValue HostIntegrationCoreApi::WrapError( - std::string_view error_message) { - return EncodableValue( - EncodableList{EncodableValue(std::string(error_message)), - EncodableValue("Error"), EncodableValue()}); +void FlutterIntegrationCoreApi::EchoNonNullStringMap( + const EncodableMap& string_map_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoNonNullStringMap" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + EncodableValue(string_map_arg), + }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto& return_value = + std::get(list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); } -EncodableValue HostIntegrationCoreApi::WrapError(const FlutterError& error) { - return EncodableValue(EncodableList{EncodableValue(error.code()), - EncodableValue(error.message()), - error.details()}); +void FlutterIntegrationCoreApi::EchoNonNullIntMap( + const EncodableMap& int_map_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoNonNullIntMap" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + EncodableValue(int_map_arg), + }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto& return_value = + std::get(list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); } -// Generated class from Pigeon that represents Flutter messages that can be -// called from C++. -FlutterIntegrationCoreApi::FlutterIntegrationCoreApi( - flutter::BinaryMessenger* binary_messenger) - : binary_messenger_(binary_messenger), message_channel_suffix_("") {} - -FlutterIntegrationCoreApi::FlutterIntegrationCoreApi( - flutter::BinaryMessenger* binary_messenger, - const std::string& message_channel_suffix) - : binary_messenger_(binary_messenger), - message_channel_suffix_(message_channel_suffix.length() > 0 - ? std::string(".") + message_channel_suffix - : "") {} - -const flutter::StandardMessageCodec& FlutterIntegrationCoreApi::GetCodec() { - return flutter::StandardMessageCodec::GetInstance( - &PigeonInternalCodecSerializer::GetInstance()); +void FlutterIntegrationCoreApi::EchoNonNullEnumMap( + const EncodableMap& enum_map_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoNonNullEnumMap" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + EncodableValue(enum_map_arg), + }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto& return_value = + std::get(list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); } -void FlutterIntegrationCoreApi::Noop( - std::function&& on_success, +void FlutterIntegrationCoreApi::EchoNonNullClassMap( + const EncodableMap& class_map_arg, + std::function&& on_success, std::function&& on_error) { const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "noop" + + "echoNonNullClassMap" + message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); - EncodableValue encoded_api_arguments = EncodableValue(); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + EncodableValue(class_map_arg), + }); channel.Send( encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)]( @@ -5321,7 +9132,9 @@ void FlutterIntegrationCoreApi::Noop( std::get(list_return_value->at(1)), list_return_value->at(2))); } else { - on_success(); + const auto& return_value = + std::get(list_return_value->at(0)); + on_success(return_value); } } else { on_error(CreateConnectionError(channel_name)); @@ -5329,15 +9142,17 @@ void FlutterIntegrationCoreApi::Noop( }); } -void FlutterIntegrationCoreApi::ThrowError( - std::function&& on_success, +void FlutterIntegrationCoreApi::EchoEnum( + const AnEnum& an_enum_arg, std::function&& on_success, std::function&& on_error) { const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "throwError" + + "echoEnum" + message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); - EncodableValue encoded_api_arguments = EncodableValue(); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + CustomEncodableValue(an_enum_arg), + }); channel.Send( encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)]( @@ -5354,7 +9169,8 @@ void FlutterIntegrationCoreApi::ThrowError( std::get(list_return_value->at(1)), list_return_value->at(2))); } else { - const auto* return_value = &list_return_value->at(0); + const auto& return_value = std::any_cast( + std::get(list_return_value->at(0))); on_success(return_value); } } else { @@ -5363,15 +9179,18 @@ void FlutterIntegrationCoreApi::ThrowError( }); } -void FlutterIntegrationCoreApi::ThrowErrorFromVoid( - std::function&& on_success, +void FlutterIntegrationCoreApi::EchoAnotherEnum( + const AnotherEnum& another_enum_arg, + std::function&& on_success, std::function&& on_error) { const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "throwErrorFromVoid" + + "echoAnotherEnum" + message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); - EncodableValue encoded_api_arguments = EncodableValue(); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + CustomEncodableValue(another_enum_arg), + }); channel.Send( encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)]( @@ -5388,7 +9207,9 @@ void FlutterIntegrationCoreApi::ThrowErrorFromVoid( std::get(list_return_value->at(1)), list_return_value->at(2))); } else { - on_success(); + const auto& return_value = std::any_cast( + std::get(list_return_value->at(0))); + on_success(return_value); } } else { on_error(CreateConnectionError(channel_name)); @@ -5396,17 +9217,52 @@ void FlutterIntegrationCoreApi::ThrowErrorFromVoid( }); } -void FlutterIntegrationCoreApi::EchoAllTypes( - const AllTypes& everything_arg, - std::function&& on_success, +void FlutterIntegrationCoreApi::EchoNullableBool( + const bool* a_bool_arg, std::function&& on_success, std::function&& on_error) { const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoAllTypes" + + "echoNullableBool" + message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - CustomEncodableValue(everything_arg), + a_bool_arg ? EncodableValue(*a_bool_arg) : EncodableValue(), + }); + channel.Send(encoded_api_arguments, [channel_name, + on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, + size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error(FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto* return_value = std::get_if(&list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} + +void FlutterIntegrationCoreApi::EchoNullableInt( + const int64_t* an_int_arg, std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoNullableInt" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + an_int_arg ? EncodableValue(*an_int_arg) : EncodableValue(), }); channel.Send( encoded_api_arguments, [channel_name, on_success = std::move(on_success), @@ -5424,8 +9280,8 @@ void FlutterIntegrationCoreApi::EchoAllTypes( std::get(list_return_value->at(1)), list_return_value->at(2))); } else { - const auto& return_value = std::any_cast( - std::get(list_return_value->at(0))); + const auto* return_value = + std::get_if(&list_return_value->at(0)); on_success(return_value); } } else { @@ -5434,17 +9290,16 @@ void FlutterIntegrationCoreApi::EchoAllTypes( }); } -void FlutterIntegrationCoreApi::EchoAllNullableTypes( - const AllNullableTypes* everything_arg, - std::function&& on_success, +void FlutterIntegrationCoreApi::EchoNullableDouble( + const double* a_double_arg, std::function&& on_success, std::function&& on_error) { const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoAllNullableTypes" + + "echoNullableDouble" + message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - everything_arg ? CustomEncodableValue(*everything_arg) : EncodableValue(), + a_double_arg ? EncodableValue(*a_double_arg) : EncodableValue(), }); channel.Send( encoded_api_arguments, [channel_name, on_success = std::move(on_success), @@ -5463,11 +9318,7 @@ void FlutterIntegrationCoreApi::EchoAllNullableTypes( list_return_value->at(2))); } else { const auto* return_value = - list_return_value->at(0).IsNull() - ? nullptr - : &(std::any_cast( - std::get( - list_return_value->at(0)))); + std::get_if(&list_return_value->at(0)); on_success(return_value); } } else { @@ -5476,23 +9327,17 @@ void FlutterIntegrationCoreApi::EchoAllNullableTypes( }); } -void FlutterIntegrationCoreApi::SendMultipleNullableTypes( - const bool* a_nullable_bool_arg, const int64_t* a_nullable_int_arg, - const std::string* a_nullable_string_arg, - std::function&& on_success, +void FlutterIntegrationCoreApi::EchoNullableString( + const std::string* a_string_arg, + std::function&& on_success, std::function&& on_error) { const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "sendMultipleNullableTypes" + + "echoNullableString" + message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - a_nullable_bool_arg ? EncodableValue(*a_nullable_bool_arg) - : EncodableValue(), - a_nullable_int_arg ? EncodableValue(*a_nullable_int_arg) - : EncodableValue(), - a_nullable_string_arg ? EncodableValue(*a_nullable_string_arg) - : EncodableValue(), + a_string_arg ? EncodableValue(*a_string_arg) : EncodableValue(), }); channel.Send( encoded_api_arguments, [channel_name, on_success = std::move(on_success), @@ -5510,8 +9355,8 @@ void FlutterIntegrationCoreApi::SendMultipleNullableTypes( std::get(list_return_value->at(1)), list_return_value->at(2))); } else { - const auto& return_value = std::any_cast( - std::get(list_return_value->at(0))); + const auto* return_value = + std::get_if(&list_return_value->at(0)); on_success(return_value); } } else { @@ -5520,17 +9365,17 @@ void FlutterIntegrationCoreApi::SendMultipleNullableTypes( }); } -void FlutterIntegrationCoreApi::EchoAllNullableTypesWithoutRecursion( - const AllNullableTypesWithoutRecursion* everything_arg, - std::function&& on_success, +void FlutterIntegrationCoreApi::EchoNullableUint8List( + const std::vector* list_arg, + std::function*)>&& on_success, std::function&& on_error) { const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoAllNullableTypesWithoutRecursion" + + "echoNullableUint8List" + message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - everything_arg ? CustomEncodableValue(*everything_arg) : EncodableValue(), + list_arg ? EncodableValue(*list_arg) : EncodableValue(), }); channel.Send( encoded_api_arguments, [channel_name, on_success = std::move(on_success), @@ -5549,11 +9394,7 @@ void FlutterIntegrationCoreApi::EchoAllNullableTypesWithoutRecursion( list_return_value->at(2))); } else { const auto* return_value = - list_return_value->at(0).IsNull() - ? nullptr - : &(std::any_cast( - std::get( - list_return_value->at(0)))); + std::get_if>(&list_return_value->at(0)); on_success(return_value); } } else { @@ -5562,23 +9403,17 @@ void FlutterIntegrationCoreApi::EchoAllNullableTypesWithoutRecursion( }); } -void FlutterIntegrationCoreApi::SendMultipleNullableTypesWithoutRecursion( - const bool* a_nullable_bool_arg, const int64_t* a_nullable_int_arg, - const std::string* a_nullable_string_arg, - std::function&& on_success, +void FlutterIntegrationCoreApi::EchoNullableList( + const EncodableList* list_arg, + std::function&& on_success, std::function&& on_error) { const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "sendMultipleNullableTypesWithoutRecursion" + + "echoNullableList" + message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - a_nullable_bool_arg ? EncodableValue(*a_nullable_bool_arg) - : EncodableValue(), - a_nullable_int_arg ? EncodableValue(*a_nullable_int_arg) - : EncodableValue(), - a_nullable_string_arg ? EncodableValue(*a_nullable_string_arg) - : EncodableValue(), + list_arg ? EncodableValue(*list_arg) : EncodableValue(), }); channel.Send( encoded_api_arguments, [channel_name, on_success = std::move(on_success), @@ -5596,9 +9431,8 @@ void FlutterIntegrationCoreApi::SendMultipleNullableTypesWithoutRecursion( std::get(list_return_value->at(1)), list_return_value->at(2))); } else { - const auto& return_value = - std::any_cast( - std::get(list_return_value->at(0))); + const auto* return_value = + std::get_if(&list_return_value->at(0)); on_success(return_value); } } else { @@ -5607,16 +9441,17 @@ void FlutterIntegrationCoreApi::SendMultipleNullableTypesWithoutRecursion( }); } -void FlutterIntegrationCoreApi::EchoBool( - bool a_bool_arg, std::function&& on_success, +void FlutterIntegrationCoreApi::EchoNullableEnumList( + const EncodableList* enum_list_arg, + std::function&& on_success, std::function&& on_error) { const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoBool" + + "echoNullableEnumList" + message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - EncodableValue(a_bool_arg), + enum_list_arg ? EncodableValue(*enum_list_arg) : EncodableValue(), }); channel.Send( encoded_api_arguments, [channel_name, on_success = std::move(on_success), @@ -5634,7 +9469,8 @@ void FlutterIntegrationCoreApi::EchoBool( std::get(list_return_value->at(1)), list_return_value->at(2))); } else { - const auto& return_value = std::get(list_return_value->at(0)); + const auto* return_value = + std::get_if(&list_return_value->at(0)); on_success(return_value); } } else { @@ -5643,16 +9479,17 @@ void FlutterIntegrationCoreApi::EchoBool( }); } -void FlutterIntegrationCoreApi::EchoInt( - int64_t an_int_arg, std::function&& on_success, +void FlutterIntegrationCoreApi::EchoNullableClassList( + const EncodableList* class_list_arg, + std::function&& on_success, std::function&& on_error) { const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoInt" + + "echoNullableClassList" + message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - EncodableValue(an_int_arg), + class_list_arg ? EncodableValue(*class_list_arg) : EncodableValue(), }); channel.Send( encoded_api_arguments, [channel_name, on_success = std::move(on_success), @@ -5670,7 +9507,8 @@ void FlutterIntegrationCoreApi::EchoInt( std::get(list_return_value->at(1)), list_return_value->at(2))); } else { - const int64_t return_value = list_return_value->at(0).LongValue(); + const auto* return_value = + std::get_if(&list_return_value->at(0)); on_success(return_value); } } else { @@ -5679,53 +9517,17 @@ void FlutterIntegrationCoreApi::EchoInt( }); } -void FlutterIntegrationCoreApi::EchoDouble( - double a_double_arg, std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoDouble" + - message_channel_suffix_; - BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); - EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - EncodableValue(a_double_arg), - }); - channel.Send(encoded_api_arguments, [channel_name, - on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, - size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error(FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto& return_value = std::get(list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); -} - -void FlutterIntegrationCoreApi::EchoString( - const std::string& a_string_arg, - std::function&& on_success, +void FlutterIntegrationCoreApi::EchoNullableNonNullEnumList( + const EncodableList* enum_list_arg, + std::function&& on_success, std::function&& on_error) { const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoString" + + "echoNullableNonNullEnumList" + message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - EncodableValue(a_string_arg), + enum_list_arg ? EncodableValue(*enum_list_arg) : EncodableValue(), }); channel.Send( encoded_api_arguments, [channel_name, on_success = std::move(on_success), @@ -5743,8 +9545,8 @@ void FlutterIntegrationCoreApi::EchoString( std::get(list_return_value->at(1)), list_return_value->at(2))); } else { - const auto& return_value = - std::get(list_return_value->at(0)); + const auto* return_value = + std::get_if(&list_return_value->at(0)); on_success(return_value); } } else { @@ -5753,17 +9555,17 @@ void FlutterIntegrationCoreApi::EchoString( }); } -void FlutterIntegrationCoreApi::EchoUint8List( - const std::vector& list_arg, - std::function&)>&& on_success, +void FlutterIntegrationCoreApi::EchoNullableNonNullClassList( + const EncodableList* class_list_arg, + std::function&& on_success, std::function&& on_error) { const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoUint8List" + + "echoNullableNonNullClassList" + message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - EncodableValue(list_arg), + class_list_arg ? EncodableValue(*class_list_arg) : EncodableValue(), }); channel.Send( encoded_api_arguments, [channel_name, on_success = std::move(on_success), @@ -5781,8 +9583,8 @@ void FlutterIntegrationCoreApi::EchoUint8List( std::get(list_return_value->at(1)), list_return_value->at(2))); } else { - const auto& return_value = - std::get>(list_return_value->at(0)); + const auto* return_value = + std::get_if(&list_return_value->at(0)); on_success(return_value); } } else { @@ -5791,17 +9593,17 @@ void FlutterIntegrationCoreApi::EchoUint8List( }); } -void FlutterIntegrationCoreApi::EchoList( - const EncodableList& list_arg, - std::function&& on_success, +void FlutterIntegrationCoreApi::EchoNullableMap( + const EncodableMap* map_arg, + std::function&& on_success, std::function&& on_error) { const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoList" + + "echoNullableMap" + message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - EncodableValue(list_arg), + map_arg ? EncodableValue(*map_arg) : EncodableValue(), }); channel.Send( encoded_api_arguments, [channel_name, on_success = std::move(on_success), @@ -5819,8 +9621,8 @@ void FlutterIntegrationCoreApi::EchoList( std::get(list_return_value->at(1)), list_return_value->at(2))); } else { - const auto& return_value = - std::get(list_return_value->at(0)); + const auto* return_value = + std::get_if(&list_return_value->at(0)); on_success(return_value); } } else { @@ -5829,17 +9631,17 @@ void FlutterIntegrationCoreApi::EchoList( }); } -void FlutterIntegrationCoreApi::EchoMap( - const EncodableMap& a_map_arg, - std::function&& on_success, +void FlutterIntegrationCoreApi::EchoNullableStringMap( + const EncodableMap* string_map_arg, + std::function&& on_success, std::function&& on_error) { const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoMap" + + "echoNullableStringMap" + message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - EncodableValue(a_map_arg), + string_map_arg ? EncodableValue(*string_map_arg) : EncodableValue(), }); channel.Send( encoded_api_arguments, [channel_name, on_success = std::move(on_success), @@ -5857,8 +9659,8 @@ void FlutterIntegrationCoreApi::EchoMap( std::get(list_return_value->at(1)), list_return_value->at(2))); } else { - const auto& return_value = - std::get(list_return_value->at(0)); + const auto* return_value = + std::get_if(&list_return_value->at(0)); on_success(return_value); } } else { @@ -5867,16 +9669,17 @@ void FlutterIntegrationCoreApi::EchoMap( }); } -void FlutterIntegrationCoreApi::EchoEnum( - const AnEnum& an_enum_arg, std::function&& on_success, +void FlutterIntegrationCoreApi::EchoNullableIntMap( + const EncodableMap* int_map_arg, + std::function&& on_success, std::function&& on_error) { const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoEnum" + + "echoNullableIntMap" + message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - CustomEncodableValue(an_enum_arg), + int_map_arg ? EncodableValue(*int_map_arg) : EncodableValue(), }); channel.Send( encoded_api_arguments, [channel_name, on_success = std::move(on_success), @@ -5894,8 +9697,8 @@ void FlutterIntegrationCoreApi::EchoEnum( std::get(list_return_value->at(1)), list_return_value->at(2))); } else { - const auto& return_value = std::any_cast( - std::get(list_return_value->at(0))); + const auto* return_value = + std::get_if(&list_return_value->at(0)); on_success(return_value); } } else { @@ -5904,17 +9707,17 @@ void FlutterIntegrationCoreApi::EchoEnum( }); } -void FlutterIntegrationCoreApi::EchoAnotherEnum( - const AnotherEnum& another_enum_arg, - std::function&& on_success, +void FlutterIntegrationCoreApi::EchoNullableEnumMap( + const EncodableMap* enum_map_arg, + std::function&& on_success, std::function&& on_error) { const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoAnotherEnum" + + "echoNullableEnumMap" + message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - CustomEncodableValue(another_enum_arg), + enum_map_arg ? EncodableValue(*enum_map_arg) : EncodableValue(), }); channel.Send( encoded_api_arguments, [channel_name, on_success = std::move(on_success), @@ -5932,8 +9735,8 @@ void FlutterIntegrationCoreApi::EchoAnotherEnum( std::get(list_return_value->at(1)), list_return_value->at(2))); } else { - const auto& return_value = std::any_cast( - std::get(list_return_value->at(0))); + const auto* return_value = + std::get_if(&list_return_value->at(0)); on_success(return_value); } } else { @@ -5942,93 +9745,17 @@ void FlutterIntegrationCoreApi::EchoAnotherEnum( }); } -void FlutterIntegrationCoreApi::EchoNullableBool( - const bool* a_bool_arg, std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoNullableBool" + - message_channel_suffix_; - BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); - EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - a_bool_arg ? EncodableValue(*a_bool_arg) : EncodableValue(), - }); - channel.Send(encoded_api_arguments, [channel_name, - on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, - size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error(FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto* return_value = std::get_if(&list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); -} - -void FlutterIntegrationCoreApi::EchoNullableInt( - const int64_t* an_int_arg, std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoNullableInt" + - message_channel_suffix_; - BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); - EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - an_int_arg ? EncodableValue(*an_int_arg) : EncodableValue(), - }); - channel.Send(encoded_api_arguments, [channel_name, - on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, - size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error(FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const int64_t return_value_value = - list_return_value->at(0).IsNull() - ? 0 - : list_return_value->at(0).LongValue(); - const auto* return_value = - list_return_value->at(0).IsNull() ? nullptr : &return_value_value; - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); -} - -void FlutterIntegrationCoreApi::EchoNullableDouble( - const double* a_double_arg, std::function&& on_success, +void FlutterIntegrationCoreApi::EchoNullableClassMap( + const EncodableMap* class_map_arg, + std::function&& on_success, std::function&& on_error) { const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoNullableDouble" + + "echoNullableClassMap" + message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - a_double_arg ? EncodableValue(*a_double_arg) : EncodableValue(), + class_map_arg ? EncodableValue(*class_map_arg) : EncodableValue(), }); channel.Send( encoded_api_arguments, [channel_name, on_success = std::move(on_success), @@ -6047,7 +9774,7 @@ void FlutterIntegrationCoreApi::EchoNullableDouble( list_return_value->at(2))); } else { const auto* return_value = - std::get_if(&list_return_value->at(0)); + std::get_if(&list_return_value->at(0)); on_success(return_value); } } else { @@ -6056,17 +9783,17 @@ void FlutterIntegrationCoreApi::EchoNullableDouble( }); } -void FlutterIntegrationCoreApi::EchoNullableString( - const std::string* a_string_arg, - std::function&& on_success, +void FlutterIntegrationCoreApi::EchoNullableNonNullStringMap( + const EncodableMap* string_map_arg, + std::function&& on_success, std::function&& on_error) { const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoNullableString" + + "echoNullableNonNullStringMap" + message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - a_string_arg ? EncodableValue(*a_string_arg) : EncodableValue(), + string_map_arg ? EncodableValue(*string_map_arg) : EncodableValue(), }); channel.Send( encoded_api_arguments, [channel_name, on_success = std::move(on_success), @@ -6085,7 +9812,7 @@ void FlutterIntegrationCoreApi::EchoNullableString( list_return_value->at(2))); } else { const auto* return_value = - std::get_if(&list_return_value->at(0)); + std::get_if(&list_return_value->at(0)); on_success(return_value); } } else { @@ -6094,17 +9821,17 @@ void FlutterIntegrationCoreApi::EchoNullableString( }); } -void FlutterIntegrationCoreApi::EchoNullableUint8List( - const std::vector* list_arg, - std::function*)>&& on_success, +void FlutterIntegrationCoreApi::EchoNullableNonNullIntMap( + const EncodableMap* int_map_arg, + std::function&& on_success, std::function&& on_error) { const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoNullableUint8List" + + "echoNullableNonNullIntMap" + message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - list_arg ? EncodableValue(*list_arg) : EncodableValue(), + int_map_arg ? EncodableValue(*int_map_arg) : EncodableValue(), }); channel.Send( encoded_api_arguments, [channel_name, on_success = std::move(on_success), @@ -6123,7 +9850,7 @@ void FlutterIntegrationCoreApi::EchoNullableUint8List( list_return_value->at(2))); } else { const auto* return_value = - std::get_if>(&list_return_value->at(0)); + std::get_if(&list_return_value->at(0)); on_success(return_value); } } else { @@ -6132,17 +9859,17 @@ void FlutterIntegrationCoreApi::EchoNullableUint8List( }); } -void FlutterIntegrationCoreApi::EchoNullableList( - const EncodableList* list_arg, - std::function&& on_success, +void FlutterIntegrationCoreApi::EchoNullableNonNullEnumMap( + const EncodableMap* enum_map_arg, + std::function&& on_success, std::function&& on_error) { const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoNullableList" + + "echoNullableNonNullEnumMap" + message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - list_arg ? EncodableValue(*list_arg) : EncodableValue(), + enum_map_arg ? EncodableValue(*enum_map_arg) : EncodableValue(), }); channel.Send( encoded_api_arguments, [channel_name, on_success = std::move(on_success), @@ -6161,7 +9888,7 @@ void FlutterIntegrationCoreApi::EchoNullableList( list_return_value->at(2))); } else { const auto* return_value = - std::get_if(&list_return_value->at(0)); + std::get_if(&list_return_value->at(0)); on_success(return_value); } } else { @@ -6170,17 +9897,17 @@ void FlutterIntegrationCoreApi::EchoNullableList( }); } -void FlutterIntegrationCoreApi::EchoNullableMap( - const EncodableMap* a_map_arg, +void FlutterIntegrationCoreApi::EchoNullableNonNullClassMap( + const EncodableMap* class_map_arg, std::function&& on_success, std::function&& on_error) { const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoNullableMap" + + "echoNullableNonNullClassMap" + message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - a_map_arg ? EncodableValue(*a_map_arg) : EncodableValue(), + class_map_arg ? EncodableValue(*class_map_arg) : EncodableValue(), }); channel.Send( encoded_api_arguments, [channel_name, on_success = std::move(on_success), diff --git a/packages/pigeon/platform_tests/test_plugin/windows/pigeon/core_tests.gen.h b/packages/pigeon/platform_tests/test_plugin/windows/pigeon/core_tests.gen.h index 53419f806f77..7f19e1a19cba 100644 --- a/packages/pigeon/platform_tests/test_plugin/windows/pigeon/core_tests.gen.h +++ b/packages/pigeon/platform_tests/test_plugin/windows/pigeon/core_tests.gen.h @@ -75,6 +75,32 @@ enum class AnEnum { enum class AnotherEnum { kJustInCase = 0 }; +// Generated class from Pigeon that represents data sent in messages. +class UnusedClass { + public: + // Constructs an object setting all non-nullable fields. + UnusedClass(); + + // Constructs an object setting all fields. + explicit UnusedClass(const flutter::EncodableValue* a_field); + + const flutter::EncodableValue* a_field() const; + void set_a_field(const flutter::EncodableValue* value_arg); + void set_a_field(const flutter::EncodableValue& value_arg); + + private: + static UnusedClass FromEncodableList(const flutter::EncodableList& list); + flutter::EncodableList ToEncodableList() const; + friend class HostIntegrationCoreApi; + friend class FlutterIntegrationCoreApi; + friend class HostTrivialApi; + friend class HostSmallApi; + friend class FlutterSmallApi; + friend class PigeonInternalCodecSerializer; + friend class CoreTestsTest; + std::optional a_field_; +}; + // A class containing all supported types. // // Generated class from Pigeon that represents data sent in messages. @@ -94,7 +120,17 @@ class AllTypes { const flutter::EncodableList& int_list, const flutter::EncodableList& double_list, const flutter::EncodableList& bool_list, - const flutter::EncodableMap& map); + const flutter::EncodableList& enum_list, + const flutter::EncodableList& object_list, + const flutter::EncodableList& list_list, + const flutter::EncodableList& map_list, + const flutter::EncodableMap& map, + const flutter::EncodableMap& string_map, + const flutter::EncodableMap& int_map, + const flutter::EncodableMap& enum_map, + const flutter::EncodableMap& object_map, + const flutter::EncodableMap& list_map, + const flutter::EncodableMap& map_map); bool a_bool() const; void set_a_bool(bool value_arg); @@ -147,9 +183,39 @@ class AllTypes { const flutter::EncodableList& bool_list() const; void set_bool_list(const flutter::EncodableList& value_arg); + const flutter::EncodableList& enum_list() const; + void set_enum_list(const flutter::EncodableList& value_arg); + + const flutter::EncodableList& object_list() const; + void set_object_list(const flutter::EncodableList& value_arg); + + const flutter::EncodableList& list_list() const; + void set_list_list(const flutter::EncodableList& value_arg); + + const flutter::EncodableList& map_list() const; + void set_map_list(const flutter::EncodableList& value_arg); + const flutter::EncodableMap& map() const; void set_map(const flutter::EncodableMap& value_arg); + const flutter::EncodableMap& string_map() const; + void set_string_map(const flutter::EncodableMap& value_arg); + + const flutter::EncodableMap& int_map() const; + void set_int_map(const flutter::EncodableMap& value_arg); + + const flutter::EncodableMap& enum_map() const; + void set_enum_map(const flutter::EncodableMap& value_arg); + + const flutter::EncodableMap& object_map() const; + void set_object_map(const flutter::EncodableMap& value_arg); + + const flutter::EncodableMap& list_map() const; + void set_list_map(const flutter::EncodableMap& value_arg); + + const flutter::EncodableMap& map_map() const; + void set_map_map(const flutter::EncodableMap& value_arg); + private: static AllTypes FromEncodableList(const flutter::EncodableList& list); flutter::EncodableList ToEncodableList() const; @@ -178,7 +244,17 @@ class AllTypes { flutter::EncodableList int_list_; flutter::EncodableList double_list_; flutter::EncodableList bool_list_; + flutter::EncodableList enum_list_; + flutter::EncodableList object_list_; + flutter::EncodableList list_list_; + flutter::EncodableList map_list_; flutter::EncodableMap map_; + flutter::EncodableMap string_map_; + flutter::EncodableMap int_map_; + flutter::EncodableMap enum_map_; + flutter::EncodableMap object_map_; + flutter::EncodableMap list_map_; + flutter::EncodableMap map_map_; }; // A class containing all supported nullable types. @@ -197,9 +273,6 @@ class AllNullableTypes { const std::vector* a_nullable4_byte_array, const std::vector* a_nullable8_byte_array, const std::vector* a_nullable_float_array, - const flutter::EncodableList* nullable_nested_list, - const flutter::EncodableMap* nullable_map_with_annotations, - const flutter::EncodableMap* nullable_map_with_object, const AnEnum* a_nullable_enum, const AnotherEnum* another_nullable_enum, const std::string* a_nullable_string, const flutter::EncodableValue* a_nullable_object, @@ -209,8 +282,18 @@ class AllNullableTypes { const flutter::EncodableList* int_list, const flutter::EncodableList* double_list, const flutter::EncodableList* bool_list, - const flutter::EncodableList* nested_class_list, - const flutter::EncodableMap* map); + const flutter::EncodableList* enum_list, + const flutter::EncodableList* object_list, + const flutter::EncodableList* list_list, + const flutter::EncodableList* map_list, + const flutter::EncodableList* recursive_class_list, + const flutter::EncodableMap* map, const flutter::EncodableMap* string_map, + const flutter::EncodableMap* int_map, + const flutter::EncodableMap* enum_map, + const flutter::EncodableMap* object_map, + const flutter::EncodableMap* list_map, + const flutter::EncodableMap* map_map, + const flutter::EncodableMap* recursive_class_map); ~AllNullableTypes() = default; AllNullableTypes(const AllNullableTypes& other); @@ -249,20 +332,6 @@ class AllNullableTypes { void set_a_nullable_float_array(const std::vector* value_arg); void set_a_nullable_float_array(const std::vector& value_arg); - const flutter::EncodableList* nullable_nested_list() const; - void set_nullable_nested_list(const flutter::EncodableList* value_arg); - void set_nullable_nested_list(const flutter::EncodableList& value_arg); - - const flutter::EncodableMap* nullable_map_with_annotations() const; - void set_nullable_map_with_annotations( - const flutter::EncodableMap* value_arg); - void set_nullable_map_with_annotations( - const flutter::EncodableMap& value_arg); - - const flutter::EncodableMap* nullable_map_with_object() const; - void set_nullable_map_with_object(const flutter::EncodableMap* value_arg); - void set_nullable_map_with_object(const flutter::EncodableMap& value_arg); - const AnEnum* a_nullable_enum() const; void set_a_nullable_enum(const AnEnum* value_arg); void set_a_nullable_enum(const AnEnum& value_arg); @@ -303,14 +372,58 @@ class AllNullableTypes { void set_bool_list(const flutter::EncodableList* value_arg); void set_bool_list(const flutter::EncodableList& value_arg); - const flutter::EncodableList* nested_class_list() const; - void set_nested_class_list(const flutter::EncodableList* value_arg); - void set_nested_class_list(const flutter::EncodableList& value_arg); + const flutter::EncodableList* enum_list() const; + void set_enum_list(const flutter::EncodableList* value_arg); + void set_enum_list(const flutter::EncodableList& value_arg); + + const flutter::EncodableList* object_list() const; + void set_object_list(const flutter::EncodableList* value_arg); + void set_object_list(const flutter::EncodableList& value_arg); + + const flutter::EncodableList* list_list() const; + void set_list_list(const flutter::EncodableList* value_arg); + void set_list_list(const flutter::EncodableList& value_arg); + + const flutter::EncodableList* map_list() const; + void set_map_list(const flutter::EncodableList* value_arg); + void set_map_list(const flutter::EncodableList& value_arg); + + const flutter::EncodableList* recursive_class_list() const; + void set_recursive_class_list(const flutter::EncodableList* value_arg); + void set_recursive_class_list(const flutter::EncodableList& value_arg); const flutter::EncodableMap* map() const; void set_map(const flutter::EncodableMap* value_arg); void set_map(const flutter::EncodableMap& value_arg); + const flutter::EncodableMap* string_map() const; + void set_string_map(const flutter::EncodableMap* value_arg); + void set_string_map(const flutter::EncodableMap& value_arg); + + const flutter::EncodableMap* int_map() const; + void set_int_map(const flutter::EncodableMap* value_arg); + void set_int_map(const flutter::EncodableMap& value_arg); + + const flutter::EncodableMap* enum_map() const; + void set_enum_map(const flutter::EncodableMap* value_arg); + void set_enum_map(const flutter::EncodableMap& value_arg); + + const flutter::EncodableMap* object_map() const; + void set_object_map(const flutter::EncodableMap* value_arg); + void set_object_map(const flutter::EncodableMap& value_arg); + + const flutter::EncodableMap* list_map() const; + void set_list_map(const flutter::EncodableMap* value_arg); + void set_list_map(const flutter::EncodableMap& value_arg); + + const flutter::EncodableMap* map_map() const; + void set_map_map(const flutter::EncodableMap* value_arg); + void set_map_map(const flutter::EncodableMap& value_arg); + + const flutter::EncodableMap* recursive_class_map() const; + void set_recursive_class_map(const flutter::EncodableMap* value_arg); + void set_recursive_class_map(const flutter::EncodableMap& value_arg); + private: static AllNullableTypes FromEncodableList(const flutter::EncodableList& list); flutter::EncodableList ToEncodableList() const; @@ -330,9 +443,6 @@ class AllNullableTypes { std::optional> a_nullable4_byte_array_; std::optional> a_nullable8_byte_array_; std::optional> a_nullable_float_array_; - std::optional nullable_nested_list_; - std::optional nullable_map_with_annotations_; - std::optional nullable_map_with_object_; std::optional a_nullable_enum_; std::optional another_nullable_enum_; std::optional a_nullable_string_; @@ -343,8 +453,19 @@ class AllNullableTypes { std::optional int_list_; std::optional double_list_; std::optional bool_list_; - std::optional nested_class_list_; + std::optional enum_list_; + std::optional object_list_; + std::optional list_list_; + std::optional map_list_; + std::optional recursive_class_list_; std::optional map_; + std::optional string_map_; + std::optional int_map_; + std::optional enum_map_; + std::optional object_map_; + std::optional list_map_; + std::optional map_map_; + std::optional recursive_class_map_; }; // The primary purpose for this class is to ensure coverage of Swift structs @@ -365,9 +486,6 @@ class AllNullableTypesWithoutRecursion { const std::vector* a_nullable4_byte_array, const std::vector* a_nullable8_byte_array, const std::vector* a_nullable_float_array, - const flutter::EncodableList* nullable_nested_list, - const flutter::EncodableMap* nullable_map_with_annotations, - const flutter::EncodableMap* nullable_map_with_object, const AnEnum* a_nullable_enum, const AnotherEnum* another_nullable_enum, const std::string* a_nullable_string, const flutter::EncodableValue* a_nullable_object, @@ -376,7 +494,16 @@ class AllNullableTypesWithoutRecursion { const flutter::EncodableList* int_list, const flutter::EncodableList* double_list, const flutter::EncodableList* bool_list, - const flutter::EncodableMap* map); + const flutter::EncodableList* enum_list, + const flutter::EncodableList* object_list, + const flutter::EncodableList* list_list, + const flutter::EncodableList* map_list, const flutter::EncodableMap* map, + const flutter::EncodableMap* string_map, + const flutter::EncodableMap* int_map, + const flutter::EncodableMap* enum_map, + const flutter::EncodableMap* object_map, + const flutter::EncodableMap* list_map, + const flutter::EncodableMap* map_map); const bool* a_nullable_bool() const; void set_a_nullable_bool(const bool* value_arg); @@ -410,20 +537,6 @@ class AllNullableTypesWithoutRecursion { void set_a_nullable_float_array(const std::vector* value_arg); void set_a_nullable_float_array(const std::vector& value_arg); - const flutter::EncodableList* nullable_nested_list() const; - void set_nullable_nested_list(const flutter::EncodableList* value_arg); - void set_nullable_nested_list(const flutter::EncodableList& value_arg); - - const flutter::EncodableMap* nullable_map_with_annotations() const; - void set_nullable_map_with_annotations( - const flutter::EncodableMap* value_arg); - void set_nullable_map_with_annotations( - const flutter::EncodableMap& value_arg); - - const flutter::EncodableMap* nullable_map_with_object() const; - void set_nullable_map_with_object(const flutter::EncodableMap* value_arg); - void set_nullable_map_with_object(const flutter::EncodableMap& value_arg); - const AnEnum* a_nullable_enum() const; void set_a_nullable_enum(const AnEnum* value_arg); void set_a_nullable_enum(const AnEnum& value_arg); @@ -460,10 +573,50 @@ class AllNullableTypesWithoutRecursion { void set_bool_list(const flutter::EncodableList* value_arg); void set_bool_list(const flutter::EncodableList& value_arg); + const flutter::EncodableList* enum_list() const; + void set_enum_list(const flutter::EncodableList* value_arg); + void set_enum_list(const flutter::EncodableList& value_arg); + + const flutter::EncodableList* object_list() const; + void set_object_list(const flutter::EncodableList* value_arg); + void set_object_list(const flutter::EncodableList& value_arg); + + const flutter::EncodableList* list_list() const; + void set_list_list(const flutter::EncodableList* value_arg); + void set_list_list(const flutter::EncodableList& value_arg); + + const flutter::EncodableList* map_list() const; + void set_map_list(const flutter::EncodableList* value_arg); + void set_map_list(const flutter::EncodableList& value_arg); + const flutter::EncodableMap* map() const; void set_map(const flutter::EncodableMap* value_arg); void set_map(const flutter::EncodableMap& value_arg); + const flutter::EncodableMap* string_map() const; + void set_string_map(const flutter::EncodableMap* value_arg); + void set_string_map(const flutter::EncodableMap& value_arg); + + const flutter::EncodableMap* int_map() const; + void set_int_map(const flutter::EncodableMap* value_arg); + void set_int_map(const flutter::EncodableMap& value_arg); + + const flutter::EncodableMap* enum_map() const; + void set_enum_map(const flutter::EncodableMap* value_arg); + void set_enum_map(const flutter::EncodableMap& value_arg); + + const flutter::EncodableMap* object_map() const; + void set_object_map(const flutter::EncodableMap* value_arg); + void set_object_map(const flutter::EncodableMap& value_arg); + + const flutter::EncodableMap* list_map() const; + void set_list_map(const flutter::EncodableMap* value_arg); + void set_list_map(const flutter::EncodableMap& value_arg); + + const flutter::EncodableMap* map_map() const; + void set_map_map(const flutter::EncodableMap* value_arg); + void set_map_map(const flutter::EncodableMap& value_arg); + private: static AllNullableTypesWithoutRecursion FromEncodableList( const flutter::EncodableList& list); @@ -484,9 +637,6 @@ class AllNullableTypesWithoutRecursion { std::optional> a_nullable4_byte_array_; std::optional> a_nullable8_byte_array_; std::optional> a_nullable_float_array_; - std::optional nullable_nested_list_; - std::optional nullable_map_with_annotations_; - std::optional nullable_map_with_object_; std::optional a_nullable_enum_; std::optional another_nullable_enum_; std::optional a_nullable_string_; @@ -496,7 +646,17 @@ class AllNullableTypesWithoutRecursion { std::optional int_list_; std::optional double_list_; std::optional bool_list_; + std::optional enum_list_; + std::optional object_list_; + std::optional list_list_; + std::optional map_list_; std::optional map_; + std::optional string_map_; + std::optional int_map_; + std::optional enum_map_; + std::optional object_map_; + std::optional list_map_; + std::optional map_map_; }; // A class for testing nested class handling. @@ -509,13 +669,19 @@ class AllNullableTypesWithoutRecursion { class AllClassesWrapper { public: // Constructs an object setting all non-nullable fields. - explicit AllClassesWrapper(const AllNullableTypes& all_nullable_types); + explicit AllClassesWrapper(const AllNullableTypes& all_nullable_types, + const flutter::EncodableList& class_list, + const flutter::EncodableMap& class_map); // Constructs an object setting all fields. explicit AllClassesWrapper(const AllNullableTypes& all_nullable_types, const AllNullableTypesWithoutRecursion* all_nullable_types_without_recursion, - const AllTypes* all_types); + const AllTypes* all_types, + const flutter::EncodableList& class_list, + const flutter::EncodableList* nullable_class_list, + const flutter::EncodableMap& class_map, + const flutter::EncodableMap* nullable_class_map); ~AllClassesWrapper() = default; AllClassesWrapper(const AllClassesWrapper& other); @@ -536,6 +702,20 @@ class AllClassesWrapper { void set_all_types(const AllTypes* value_arg); void set_all_types(const AllTypes& value_arg); + const flutter::EncodableList& class_list() const; + void set_class_list(const flutter::EncodableList& value_arg); + + const flutter::EncodableList* nullable_class_list() const; + void set_nullable_class_list(const flutter::EncodableList* value_arg); + void set_nullable_class_list(const flutter::EncodableList& value_arg); + + const flutter::EncodableMap& class_map() const; + void set_class_map(const flutter::EncodableMap& value_arg); + + const flutter::EncodableMap* nullable_class_map() const; + void set_nullable_class_map(const flutter::EncodableMap* value_arg); + void set_nullable_class_map(const flutter::EncodableMap& value_arg); + private: static AllClassesWrapper FromEncodableList( const flutter::EncodableList& list); @@ -551,6 +731,10 @@ class AllClassesWrapper { std::unique_ptr all_nullable_types_without_recursion_; std::unique_ptr all_types_; + flutter::EncodableList class_list_; + std::optional nullable_class_list_; + flutter::EncodableMap class_map_; + std::optional nullable_class_map_; }; // A data class containing a List, used in unit tests. @@ -636,10 +820,46 @@ class HostIntegrationCoreApi { // Returns the passed list, to test serialization and deserialization. virtual ErrorOr EchoList( const flutter::EncodableList& list) = 0; + // Returns the passed list, to test serialization and deserialization. + virtual ErrorOr EchoEnumList( + const flutter::EncodableList& enum_list) = 0; + // Returns the passed list, to test serialization and deserialization. + virtual ErrorOr EchoClassList( + const flutter::EncodableList& class_list) = 0; + // Returns the passed list, to test serialization and deserialization. + virtual ErrorOr EchoNonNullEnumList( + const flutter::EncodableList& enum_list) = 0; + // Returns the passed list, to test serialization and deserialization. + virtual ErrorOr EchoNonNullClassList( + const flutter::EncodableList& class_list) = 0; // Returns the passed map, to test serialization and deserialization. virtual ErrorOr EchoMap( - const flutter::EncodableMap& a_map) = 0; - // Returns the passed map to test nested class serialization and + const flutter::EncodableMap& map) = 0; + // Returns the passed map, to test serialization and deserialization. + virtual ErrorOr EchoStringMap( + const flutter::EncodableMap& string_map) = 0; + // Returns the passed map, to test serialization and deserialization. + virtual ErrorOr EchoIntMap( + const flutter::EncodableMap& int_map) = 0; + // Returns the passed map, to test serialization and deserialization. + virtual ErrorOr EchoEnumMap( + const flutter::EncodableMap& enum_map) = 0; + // Returns the passed map, to test serialization and deserialization. + virtual ErrorOr EchoClassMap( + const flutter::EncodableMap& class_map) = 0; + // Returns the passed map, to test serialization and deserialization. + virtual ErrorOr EchoNonNullStringMap( + const flutter::EncodableMap& string_map) = 0; + // Returns the passed map, to test serialization and deserialization. + virtual ErrorOr EchoNonNullIntMap( + const flutter::EncodableMap& int_map) = 0; + // Returns the passed map, to test serialization and deserialization. + virtual ErrorOr EchoNonNullEnumMap( + const flutter::EncodableMap& enum_map) = 0; + // Returns the passed map, to test serialization and deserialization. + virtual ErrorOr EchoNonNullClassMap( + const flutter::EncodableMap& class_map) = 0; + // Returns the passed class to test nested class serialization and // deserialization. virtual ErrorOr EchoClassWrapper( const AllClassesWrapper& wrapper) = 0; @@ -700,9 +920,45 @@ class HostIntegrationCoreApi { // Returns the passed list, to test serialization and deserialization. virtual ErrorOr> EchoNullableList( const flutter::EncodableList* a_nullable_list) = 0; + // Returns the passed list, to test serialization and deserialization. + virtual ErrorOr> EchoNullableEnumList( + const flutter::EncodableList* enum_list) = 0; + // Returns the passed list, to test serialization and deserialization. + virtual ErrorOr> EchoNullableClassList( + const flutter::EncodableList* class_list) = 0; + // Returns the passed list, to test serialization and deserialization. + virtual ErrorOr> + EchoNullableNonNullEnumList(const flutter::EncodableList* enum_list) = 0; + // Returns the passed list, to test serialization and deserialization. + virtual ErrorOr> + EchoNullableNonNullClassList(const flutter::EncodableList* class_list) = 0; // Returns the passed map, to test serialization and deserialization. virtual ErrorOr> EchoNullableMap( - const flutter::EncodableMap* a_nullable_map) = 0; + const flutter::EncodableMap* map) = 0; + // Returns the passed map, to test serialization and deserialization. + virtual ErrorOr> EchoNullableStringMap( + const flutter::EncodableMap* string_map) = 0; + // Returns the passed map, to test serialization and deserialization. + virtual ErrorOr> EchoNullableIntMap( + const flutter::EncodableMap* int_map) = 0; + // Returns the passed map, to test serialization and deserialization. + virtual ErrorOr> EchoNullableEnumMap( + const flutter::EncodableMap* enum_map) = 0; + // Returns the passed map, to test serialization and deserialization. + virtual ErrorOr> EchoNullableClassMap( + const flutter::EncodableMap* class_map) = 0; + // Returns the passed map, to test serialization and deserialization. + virtual ErrorOr> + EchoNullableNonNullStringMap(const flutter::EncodableMap* string_map) = 0; + // Returns the passed map, to test serialization and deserialization. + virtual ErrorOr> + EchoNullableNonNullIntMap(const flutter::EncodableMap* int_map) = 0; + // Returns the passed map, to test serialization and deserialization. + virtual ErrorOr> + EchoNullableNonNullEnumMap(const flutter::EncodableMap* enum_map) = 0; + // Returns the passed map, to test serialization and deserialization. + virtual ErrorOr> + EchoNullableNonNullClassMap(const flutter::EncodableMap* class_map) = 0; virtual ErrorOr> EchoNullableEnum( const AnEnum* an_enum) = 0; virtual ErrorOr> EchoAnotherNullableEnum( @@ -743,10 +999,40 @@ class HostIntegrationCoreApi { virtual void EchoAsyncList( const flutter::EncodableList& list, std::function reply)> result) = 0; + // Returns the passed list, to test asynchronous serialization and + // deserialization. + virtual void EchoAsyncEnumList( + const flutter::EncodableList& enum_list, + std::function reply)> result) = 0; + // Returns the passed list, to test asynchronous serialization and + // deserialization. + virtual void EchoAsyncClassList( + const flutter::EncodableList& class_list, + std::function reply)> result) = 0; // Returns the passed map, to test asynchronous serialization and // deserialization. virtual void EchoAsyncMap( - const flutter::EncodableMap& a_map, + const flutter::EncodableMap& map, + std::function reply)> result) = 0; + // Returns the passed map, to test asynchronous serialization and + // deserialization. + virtual void EchoAsyncStringMap( + const flutter::EncodableMap& string_map, + std::function reply)> result) = 0; + // Returns the passed map, to test asynchronous serialization and + // deserialization. + virtual void EchoAsyncIntMap( + const flutter::EncodableMap& int_map, + std::function reply)> result) = 0; + // Returns the passed map, to test asynchronous serialization and + // deserialization. + virtual void EchoAsyncEnumMap( + const flutter::EncodableMap& enum_map, + std::function reply)> result) = 0; + // Returns the passed map, to test asynchronous serialization and + // deserialization. + virtual void EchoAsyncClassMap( + const flutter::EncodableMap& class_map, std::function reply)> result) = 0; // Returns the passed enum, to test asynchronous serialization and // deserialization. @@ -817,10 +1103,46 @@ class HostIntegrationCoreApi { const flutter::EncodableList* list, std::function> reply)> result) = 0; + // Returns the passed list, to test asynchronous serialization and + // deserialization. + virtual void EchoAsyncNullableEnumList( + const flutter::EncodableList* enum_list, + std::function> reply)> + result) = 0; + // Returns the passed list, to test asynchronous serialization and + // deserialization. + virtual void EchoAsyncNullableClassList( + const flutter::EncodableList* class_list, + std::function> reply)> + result) = 0; // Returns the passed map, to test asynchronous serialization and // deserialization. virtual void EchoAsyncNullableMap( - const flutter::EncodableMap* a_map, + const flutter::EncodableMap* map, + std::function> reply)> + result) = 0; + // Returns the passed map, to test asynchronous serialization and + // deserialization. + virtual void EchoAsyncNullableStringMap( + const flutter::EncodableMap* string_map, + std::function> reply)> + result) = 0; + // Returns the passed map, to test asynchronous serialization and + // deserialization. + virtual void EchoAsyncNullableIntMap( + const flutter::EncodableMap* int_map, + std::function> reply)> + result) = 0; + // Returns the passed map, to test asynchronous serialization and + // deserialization. + virtual void EchoAsyncNullableEnumMap( + const flutter::EncodableMap* enum_map, + std::function> reply)> + result) = 0; + // Returns the passed map, to test asynchronous serialization and + // deserialization. + virtual void EchoAsyncNullableClassMap( + const flutter::EncodableMap* class_map, std::function> reply)> result) = 0; // Returns the passed enum, to test asynchronous serialization and @@ -877,8 +1199,44 @@ class HostIntegrationCoreApi { virtual void CallFlutterEchoList( const flutter::EncodableList& list, std::function reply)> result) = 0; + virtual void CallFlutterEchoEnumList( + const flutter::EncodableList& enum_list, + std::function reply)> result) = 0; + virtual void CallFlutterEchoClassList( + const flutter::EncodableList& class_list, + std::function reply)> result) = 0; + virtual void CallFlutterEchoNonNullEnumList( + const flutter::EncodableList& enum_list, + std::function reply)> result) = 0; + virtual void CallFlutterEchoNonNullClassList( + const flutter::EncodableList& class_list, + std::function reply)> result) = 0; virtual void CallFlutterEchoMap( - const flutter::EncodableMap& a_map, + const flutter::EncodableMap& map, + std::function reply)> result) = 0; + virtual void CallFlutterEchoStringMap( + const flutter::EncodableMap& string_map, + std::function reply)> result) = 0; + virtual void CallFlutterEchoIntMap( + const flutter::EncodableMap& int_map, + std::function reply)> result) = 0; + virtual void CallFlutterEchoEnumMap( + const flutter::EncodableMap& enum_map, + std::function reply)> result) = 0; + virtual void CallFlutterEchoClassMap( + const flutter::EncodableMap& class_map, + std::function reply)> result) = 0; + virtual void CallFlutterEchoNonNullStringMap( + const flutter::EncodableMap& string_map, + std::function reply)> result) = 0; + virtual void CallFlutterEchoNonNullIntMap( + const flutter::EncodableMap& int_map, + std::function reply)> result) = 0; + virtual void CallFlutterEchoNonNullEnumMap( + const flutter::EncodableMap& enum_map, + std::function reply)> result) = 0; + virtual void CallFlutterEchoNonNullClassMap( + const flutter::EncodableMap& class_map, std::function reply)> result) = 0; virtual void CallFlutterEchoEnum( const AnEnum& an_enum, @@ -907,8 +1265,56 @@ class HostIntegrationCoreApi { const flutter::EncodableList* list, std::function> reply)> result) = 0; + virtual void CallFlutterEchoNullableEnumList( + const flutter::EncodableList* enum_list, + std::function> reply)> + result) = 0; + virtual void CallFlutterEchoNullableClassList( + const flutter::EncodableList* class_list, + std::function> reply)> + result) = 0; + virtual void CallFlutterEchoNullableNonNullEnumList( + const flutter::EncodableList* enum_list, + std::function> reply)> + result) = 0; + virtual void CallFlutterEchoNullableNonNullClassList( + const flutter::EncodableList* class_list, + std::function> reply)> + result) = 0; virtual void CallFlutterEchoNullableMap( - const flutter::EncodableMap* a_map, + const flutter::EncodableMap* map, + std::function> reply)> + result) = 0; + virtual void CallFlutterEchoNullableStringMap( + const flutter::EncodableMap* string_map, + std::function> reply)> + result) = 0; + virtual void CallFlutterEchoNullableIntMap( + const flutter::EncodableMap* int_map, + std::function> reply)> + result) = 0; + virtual void CallFlutterEchoNullableEnumMap( + const flutter::EncodableMap* enum_map, + std::function> reply)> + result) = 0; + virtual void CallFlutterEchoNullableClassMap( + const flutter::EncodableMap* class_map, + std::function> reply)> + result) = 0; + virtual void CallFlutterEchoNullableNonNullStringMap( + const flutter::EncodableMap* string_map, + std::function> reply)> + result) = 0; + virtual void CallFlutterEchoNullableNonNullIntMap( + const flutter::EncodableMap* int_map, + std::function> reply)> + result) = 0; + virtual void CallFlutterEchoNullableNonNullEnumMap( + const flutter::EncodableMap* enum_map, + std::function> reply)> + result) = 0; + virtual void CallFlutterEchoNullableNonNullClassMap( + const flutter::EncodableMap* class_map, std::function> reply)> result) = 0; virtual void CallFlutterEchoNullableEnum( @@ -1011,10 +1417,70 @@ class FlutterIntegrationCoreApi { void EchoList(const flutter::EncodableList& list, std::function&& on_success, std::function&& on_error); + // Returns the passed list, to test serialization and deserialization. + void EchoEnumList( + const flutter::EncodableList& enum_list, + std::function&& on_success, + std::function&& on_error); + // Returns the passed list, to test serialization and deserialization. + void EchoClassList( + const flutter::EncodableList& class_list, + std::function&& on_success, + std::function&& on_error); + // Returns the passed list, to test serialization and deserialization. + void EchoNonNullEnumList( + const flutter::EncodableList& enum_list, + std::function&& on_success, + std::function&& on_error); + // Returns the passed list, to test serialization and deserialization. + void EchoNonNullClassList( + const flutter::EncodableList& class_list, + std::function&& on_success, + std::function&& on_error); // Returns the passed map, to test serialization and deserialization. - void EchoMap(const flutter::EncodableMap& a_map, + void EchoMap(const flutter::EncodableMap& map, std::function&& on_success, std::function&& on_error); + // Returns the passed map, to test serialization and deserialization. + void EchoStringMap( + const flutter::EncodableMap& string_map, + std::function&& on_success, + std::function&& on_error); + // Returns the passed map, to test serialization and deserialization. + void EchoIntMap( + const flutter::EncodableMap& int_map, + std::function&& on_success, + std::function&& on_error); + // Returns the passed map, to test serialization and deserialization. + void EchoEnumMap( + const flutter::EncodableMap& enum_map, + std::function&& on_success, + std::function&& on_error); + // Returns the passed map, to test serialization and deserialization. + void EchoClassMap( + const flutter::EncodableMap& class_map, + std::function&& on_success, + std::function&& on_error); + // Returns the passed map, to test serialization and deserialization. + void EchoNonNullStringMap( + const flutter::EncodableMap& string_map, + std::function&& on_success, + std::function&& on_error); + // Returns the passed map, to test serialization and deserialization. + void EchoNonNullIntMap( + const flutter::EncodableMap& int_map, + std::function&& on_success, + std::function&& on_error); + // Returns the passed map, to test serialization and deserialization. + void EchoNonNullEnumMap( + const flutter::EncodableMap& enum_map, + std::function&& on_success, + std::function&& on_error); + // Returns the passed map, to test serialization and deserialization. + void EchoNonNullClassMap( + const flutter::EncodableMap& class_map, + std::function&& on_success, + std::function&& on_error); // Returns the passed enum to test serialization and deserialization. void EchoEnum(const AnEnum& an_enum, std::function&& on_success, @@ -1049,9 +1515,69 @@ class FlutterIntegrationCoreApi { const flutter::EncodableList* list, std::function&& on_success, std::function&& on_error); + // Returns the passed list, to test serialization and deserialization. + void EchoNullableEnumList( + const flutter::EncodableList* enum_list, + std::function&& on_success, + std::function&& on_error); + // Returns the passed list, to test serialization and deserialization. + void EchoNullableClassList( + const flutter::EncodableList* class_list, + std::function&& on_success, + std::function&& on_error); + // Returns the passed list, to test serialization and deserialization. + void EchoNullableNonNullEnumList( + const flutter::EncodableList* enum_list, + std::function&& on_success, + std::function&& on_error); + // Returns the passed list, to test serialization and deserialization. + void EchoNullableNonNullClassList( + const flutter::EncodableList* class_list, + std::function&& on_success, + std::function&& on_error); // Returns the passed map, to test serialization and deserialization. void EchoNullableMap( - const flutter::EncodableMap* a_map, + const flutter::EncodableMap* map, + std::function&& on_success, + std::function&& on_error); + // Returns the passed map, to test serialization and deserialization. + void EchoNullableStringMap( + const flutter::EncodableMap* string_map, + std::function&& on_success, + std::function&& on_error); + // Returns the passed map, to test serialization and deserialization. + void EchoNullableIntMap( + const flutter::EncodableMap* int_map, + std::function&& on_success, + std::function&& on_error); + // Returns the passed map, to test serialization and deserialization. + void EchoNullableEnumMap( + const flutter::EncodableMap* enum_map, + std::function&& on_success, + std::function&& on_error); + // Returns the passed map, to test serialization and deserialization. + void EchoNullableClassMap( + const flutter::EncodableMap* class_map, + std::function&& on_success, + std::function&& on_error); + // Returns the passed map, to test serialization and deserialization. + void EchoNullableNonNullStringMap( + const flutter::EncodableMap* string_map, + std::function&& on_success, + std::function&& on_error); + // Returns the passed map, to test serialization and deserialization. + void EchoNullableNonNullIntMap( + const flutter::EncodableMap* int_map, + std::function&& on_success, + std::function&& on_error); + // Returns the passed map, to test serialization and deserialization. + void EchoNullableNonNullEnumMap( + const flutter::EncodableMap* enum_map, + std::function&& on_success, + std::function&& on_error); + // Returns the passed map, to test serialization and deserialization. + void EchoNullableNonNullClassMap( + const flutter::EncodableMap* class_map, std::function&& on_success, std::function&& on_error); // Returns the passed enum to test serialization and deserialization. diff --git a/packages/pigeon/platform_tests/test_plugin/windows/test/null_fields_test.cpp b/packages/pigeon/platform_tests/test_plugin/windows/test/null_fields_test.cpp index da56b4a7576e..8bbbf3edf9f6 100644 --- a/packages/pigeon/platform_tests/test_plugin/windows/test/null_fields_test.cpp +++ b/packages/pigeon/platform_tests/test_plugin/windows/test/null_fields_test.cpp @@ -92,9 +92,10 @@ TEST(NullFields, BuildReplyWithNulls) { } TEST_F(NullFieldsTest, RequestFromListWithValues) { + int64_t one = 1; EncodableList list{ EncodableValue("hello"), - EncodableValue(1), + EncodableValue(one), }; NullFieldsSearchRequest request = RequestFromList(list); @@ -103,9 +104,10 @@ TEST_F(NullFieldsTest, RequestFromListWithValues) { } TEST_F(NullFieldsTest, RequestFromListWithNulls) { + int64_t one = 1; EncodableList list{ EncodableValue(), - EncodableValue(1), + EncodableValue(one), }; NullFieldsSearchRequest request = RequestFromList(list); diff --git a/packages/pigeon/platform_tests/test_plugin/windows/test/nullable_returns_test.cpp b/packages/pigeon/platform_tests/test_plugin/windows/test/nullable_returns_test.cpp index 89c0f3175ae6..6a3bed759b48 100644 --- a/packages/pigeon/platform_tests/test_plugin/windows/test/nullable_returns_test.cpp +++ b/packages/pigeon/platform_tests/test_plugin/windows/test/nullable_returns_test.cpp @@ -68,9 +68,10 @@ TEST(NullableReturns, HostNullableArgNonNull) { NullableArgHostApi::SetUp(&messenger, &api); int64_t result = 0; + int64_t seven = 7; messenger.SendHostMessage( "dev.flutter.pigeon.pigeon_integration_tests.NullableArgHostApi.doit", - EncodableValue(EncodableList({EncodableValue(7)})), + EncodableValue(EncodableList({EncodableValue(seven)})), [&result](const EncodableValue& reply) { result = GetResult(reply).LongValue(); }); diff --git a/packages/pigeon/platform_tests/test_plugin/windows/test_plugin.cpp b/packages/pigeon/platform_tests/test_plugin/windows/test_plugin.cpp index e8f773699286..c6f69c0a8c07 100644 --- a/packages/pigeon/platform_tests/test_plugin/windows/test_plugin.cpp +++ b/packages/pigeon/platform_tests/test_plugin/windows/test_plugin.cpp @@ -141,10 +141,67 @@ ErrorOr TestPlugin::EchoList(const EncodableList& a_list) { return a_list; } +ErrorOr TestPlugin::EchoEnumList( + const EncodableList& enum_list) { + return enum_list; +} + +ErrorOr TestPlugin::EchoClassList( + const EncodableList& class_list) { + return class_list; +} + +ErrorOr TestPlugin::EchoNonNullEnumList( + const EncodableList& enum_list) { + return enum_list; +} + +ErrorOr TestPlugin::EchoNonNullClassList( + const EncodableList& class_list) { + return class_list; +} + ErrorOr TestPlugin::EchoMap(const EncodableMap& a_map) { return a_map; } +ErrorOr TestPlugin::EchoStringMap( + const EncodableMap& string_map) { + return string_map; +} + +ErrorOr TestPlugin::EchoIntMap(const EncodableMap& int_map) { + return int_map; +} + +ErrorOr TestPlugin::EchoEnumMap(const EncodableMap& enum_map) { + return enum_map; +} + +ErrorOr TestPlugin::EchoClassMap(const EncodableMap& class_map) { + return class_map; +} + +ErrorOr TestPlugin::EchoNonNullStringMap( + const EncodableMap& string_map) { + return string_map; +} + +ErrorOr TestPlugin::EchoNonNullIntMap( + const EncodableMap& int_map) { + return int_map; +} + +ErrorOr TestPlugin::EchoNonNullEnumMap( + const EncodableMap& enum_map) { + return enum_map; +} + +ErrorOr TestPlugin::EchoNonNullClassMap( + const EncodableMap& class_map) { + return class_map; +} + ErrorOr TestPlugin::EchoClassWrapper( const AllClassesWrapper& wrapper) { return wrapper; @@ -187,7 +244,9 @@ ErrorOr TestPlugin::CreateNestedNullableString( } else { inner_object.set_a_nullable_string(nullptr); } - AllClassesWrapper wrapper(inner_object); + EncodableList classList; + EncodableMap classMap; + AllClassesWrapper wrapper(inner_object, classList, classMap); return wrapper; } @@ -282,12 +341,108 @@ ErrorOr> TestPlugin::EchoNullableList( return *a_nullable_list; }; +ErrorOr> TestPlugin::EchoNullableEnumList( + const EncodableList* enum_list) { + if (!enum_list) { + return std::nullopt; + } + return *enum_list; +}; + +ErrorOr> TestPlugin::EchoNullableClassList( + const EncodableList* class_list) { + if (!class_list) { + return std::nullopt; + } + return *class_list; +}; + +ErrorOr> TestPlugin::EchoNullableNonNullEnumList( + const EncodableList* enum_list) { + if (!enum_list) { + return std::nullopt; + } + return *enum_list; +}; + +ErrorOr> TestPlugin::EchoNullableNonNullClassList( + const EncodableList* class_list) { + if (!class_list) { + return std::nullopt; + } + return *class_list; +}; + ErrorOr> TestPlugin::EchoNullableMap( - const EncodableMap* a_nullable_map) { - if (!a_nullable_map) { + const EncodableMap* map) { + if (!map) { + return std::nullopt; + } + return *map; +}; + +ErrorOr> TestPlugin::EchoNullableStringMap( + const EncodableMap* string_map) { + if (!string_map) { + return std::nullopt; + } + return *string_map; +}; + +ErrorOr> TestPlugin::EchoNullableIntMap( + const EncodableMap* int_map) { + if (!int_map) { + return std::nullopt; + } + return *int_map; +}; + +ErrorOr> TestPlugin::EchoNullableEnumMap( + const EncodableMap* enum_map) { + if (!enum_map) { return std::nullopt; } - return *a_nullable_map; + return *enum_map; +}; + +ErrorOr> TestPlugin::EchoNullableClassMap( + const EncodableMap* class_map) { + if (!class_map) { + return std::nullopt; + } + return *class_map; +}; + +ErrorOr> TestPlugin::EchoNullableNonNullStringMap( + const EncodableMap* string_map) { + if (!string_map) { + return std::nullopt; + } + return *string_map; +}; + +ErrorOr> TestPlugin::EchoNullableNonNullIntMap( + const EncodableMap* int_map) { + if (!int_map) { + return std::nullopt; + } + return *int_map; +}; + +ErrorOr> TestPlugin::EchoNullableNonNullEnumMap( + const EncodableMap* enum_map) { + if (!enum_map) { + return std::nullopt; + } + return *enum_map; +}; + +ErrorOr> TestPlugin::EchoNullableNonNullClassMap( + const EncodableMap* class_map) { + if (!class_map) { + return std::nullopt; + } + return *class_map; }; ErrorOr> TestPlugin::EchoNullableEnum( @@ -386,10 +541,46 @@ void TestPlugin::EchoAsyncList( result(a_list); } +void TestPlugin::EchoAsyncEnumList( + const EncodableList& enum_list, + std::function reply)> result) { + result(enum_list); +} + +void TestPlugin::EchoAsyncClassList( + const EncodableList& class_list, + std::function reply)> result) { + result(class_list); +} + void TestPlugin::EchoAsyncMap( - const EncodableMap& a_map, + const EncodableMap& map, + std::function reply)> result) { + result(map); +} + +void TestPlugin::EchoAsyncStringMap( + const EncodableMap& string_map, + std::function reply)> result) { + result(string_map); +} + +void TestPlugin::EchoAsyncIntMap( + const EncodableMap& int_map, std::function reply)> result) { - result(a_map); + result(int_map); +} + +void TestPlugin::EchoAsyncEnumMap( + const EncodableMap& enum_map, + std::function reply)> result) { + result(enum_map); +} + +void TestPlugin::EchoAsyncClassMap( + const EncodableMap& class_map, + std::function reply)> result) { + result(class_map); } void TestPlugin::EchoAsyncEnum( @@ -465,10 +656,46 @@ void TestPlugin::EchoAsyncNullableList( result(a_list ? std::optional(*a_list) : std::nullopt); } +void TestPlugin::EchoAsyncNullableEnumList( + const EncodableList* enum_list, + std::function> reply)> result) { + result(enum_list ? std::optional(*enum_list) : std::nullopt); +} + +void TestPlugin::EchoAsyncNullableClassList( + const EncodableList* class_list, + std::function> reply)> result) { + result(class_list ? std::optional(*class_list) : std::nullopt); +} + void TestPlugin::EchoAsyncNullableMap( - const EncodableMap* a_map, + const EncodableMap* map, + std::function> reply)> result) { + result(map ? std::optional(*map) : std::nullopt); +} + +void TestPlugin::EchoAsyncNullableStringMap( + const EncodableMap* string_map, + std::function> reply)> result) { + result(string_map ? std::optional(*string_map) : std::nullopt); +} + +void TestPlugin::EchoAsyncNullableIntMap( + const EncodableMap* int_map, + std::function> reply)> result) { + result(int_map ? std::optional(*int_map) : std::nullopt); +} + +void TestPlugin::EchoAsyncNullableEnumMap( + const EncodableMap* enum_map, + std::function> reply)> result) { + result(enum_map ? std::optional(*enum_map) : std::nullopt); +} + +void TestPlugin::EchoAsyncNullableClassMap( + const EncodableMap* class_map, std::function> reply)> result) { - result(a_map ? std::optional(*a_map) : std::nullopt); + result(class_map ? std::optional(*class_map) : std::nullopt); } void TestPlugin::EchoAsyncNullableEnum( @@ -607,11 +834,107 @@ void TestPlugin::CallFlutterEchoList( [result](const FlutterError& error) { result(error); }); } +void TestPlugin::CallFlutterEchoEnumList( + const EncodableList& enum_list, + std::function reply)> result) { + flutter_api_->EchoEnumList( + enum_list, [result](const EncodableList& echo) { result(echo); }, + [result](const FlutterError& error) { result(error); }); +} + +void TestPlugin::CallFlutterEchoClassList( + const EncodableList& class_list, + std::function reply)> result) { + flutter_api_->EchoClassList( + class_list, [result](const EncodableList& echo) { result(echo); }, + [result](const FlutterError& error) { result(error); }); +} + +void TestPlugin::CallFlutterEchoNonNullEnumList( + const EncodableList& enum_list, + std::function reply)> result) { + flutter_api_->EchoNonNullEnumList( + enum_list, [result](const EncodableList& echo) { result(echo); }, + [result](const FlutterError& error) { result(error); }); +} + +void TestPlugin::CallFlutterEchoNonNullClassList( + const EncodableList& class_list, + std::function reply)> result) { + flutter_api_->EchoNonNullClassList( + class_list, [result](const EncodableList& echo) { result(echo); }, + [result](const FlutterError& error) { result(error); }); +} + void TestPlugin::CallFlutterEchoMap( - const EncodableMap& a_map, + const EncodableMap& map, std::function reply)> result) { flutter_api_->EchoMap( - a_map, [result](const EncodableMap& echo) { result(echo); }, + map, [result](const EncodableMap& echo) { result(echo); }, + [result](const FlutterError& error) { result(error); }); +} + +void TestPlugin::CallFlutterEchoStringMap( + const EncodableMap& string_map, + std::function reply)> result) { + flutter_api_->EchoStringMap( + string_map, [result](const EncodableMap& echo) { result(echo); }, + [result](const FlutterError& error) { result(error); }); +} + +void TestPlugin::CallFlutterEchoIntMap( + const EncodableMap& int_map, + std::function reply)> result) { + flutter_api_->EchoIntMap( + int_map, [result](const EncodableMap& echo) { result(echo); }, + [result](const FlutterError& error) { result(error); }); +} + +void TestPlugin::CallFlutterEchoEnumMap( + const EncodableMap& enum_map, + std::function reply)> result) { + flutter_api_->EchoEnumMap( + enum_map, [result](const EncodableMap& echo) { result(echo); }, + [result](const FlutterError& error) { result(error); }); +} + +void TestPlugin::CallFlutterEchoClassMap( + const EncodableMap& class_map, + std::function reply)> result) { + flutter_api_->EchoClassMap( + class_map, [result](const EncodableMap& echo) { result(echo); }, + [result](const FlutterError& error) { result(error); }); +} + +void TestPlugin::CallFlutterEchoNonNullStringMap( + const EncodableMap& string_map, + std::function reply)> result) { + flutter_api_->EchoNonNullStringMap( + string_map, [result](const EncodableMap& echo) { result(echo); }, + [result](const FlutterError& error) { result(error); }); +} + +void TestPlugin::CallFlutterEchoNonNullIntMap( + const EncodableMap& int_map, + std::function reply)> result) { + flutter_api_->EchoNonNullIntMap( + int_map, [result](const EncodableMap& echo) { result(echo); }, + [result](const FlutterError& error) { result(error); }); +} + +void TestPlugin::CallFlutterEchoNonNullEnumMap( + const EncodableMap& enum_map, + std::function reply)> result) { + flutter_api_->EchoNonNullEnumMap( + enum_map, [result](const EncodableMap& echo) { result(echo); }, + [result](const FlutterError& error) { result(error); }); +} + +void TestPlugin::CallFlutterEchoNonNullClassMap( + const EncodableMap& class_map, + std::function reply)> result) { + flutter_api_->EchoNonNullClassMap( + class_map, [result](const EncodableMap& echo) { result(echo); }, [result](const FlutterError& error) { result(error); }); } @@ -698,11 +1021,143 @@ void TestPlugin::CallFlutterEchoNullableList( [result](const FlutterError& error) { result(error); }); } +void TestPlugin::CallFlutterEchoNullableEnumList( + const EncodableList* enum_list, + std::function> reply)> result) { + flutter_api_->EchoNullableEnumList( + enum_list, + [result](const EncodableList* echo) { + result(echo ? std::optional(*echo) : std::nullopt); + }, + [result](const FlutterError& error) { result(error); }); +} + +void TestPlugin::CallFlutterEchoNullableClassList( + const EncodableList* class_list, + std::function> reply)> result) { + flutter_api_->EchoNullableClassList( + class_list, + [result](const EncodableList* echo) { + result(echo ? std::optional(*echo) : std::nullopt); + }, + [result](const FlutterError& error) { result(error); }); +} + +void TestPlugin::CallFlutterEchoNullableNonNullEnumList( + const EncodableList* enum_list, + std::function> reply)> result) { + flutter_api_->EchoNullableNonNullEnumList( + enum_list, + [result](const EncodableList* echo) { + result(echo ? std::optional(*echo) : std::nullopt); + }, + [result](const FlutterError& error) { result(error); }); +} + +void TestPlugin::CallFlutterEchoNullableNonNullClassList( + const EncodableList* class_list, + std::function> reply)> result) { + flutter_api_->EchoNullableNonNullClassList( + class_list, + [result](const EncodableList* echo) { + result(echo ? std::optional(*echo) : std::nullopt); + }, + [result](const FlutterError& error) { result(error); }); +} + void TestPlugin::CallFlutterEchoNullableMap( - const EncodableMap* a_map, + const EncodableMap* map, std::function> reply)> result) { flutter_api_->EchoNullableMap( - a_map, + map, + [result](const EncodableMap* echo) { + result(echo ? std::optional(*echo) : std::nullopt); + }, + [result](const FlutterError& error) { result(error); }); +} + +void TestPlugin::CallFlutterEchoNullableStringMap( + const EncodableMap* string_map, + std::function> reply)> result) { + flutter_api_->EchoNullableStringMap( + string_map, + [result](const EncodableMap* echo) { + result(echo ? std::optional(*echo) : std::nullopt); + }, + [result](const FlutterError& error) { result(error); }); +} + +void TestPlugin::CallFlutterEchoNullableIntMap( + const EncodableMap* int_map, + std::function> reply)> result) { + flutter_api_->EchoNullableIntMap( + int_map, + [result](const EncodableMap* echo) { + result(echo ? std::optional(*echo) : std::nullopt); + }, + [result](const FlutterError& error) { result(error); }); +} + +void TestPlugin::CallFlutterEchoNullableEnumMap( + const EncodableMap* enum_map, + std::function> reply)> result) { + flutter_api_->EchoNullableEnumMap( + enum_map, + [result](const EncodableMap* echo) { + result(echo ? std::optional(*echo) : std::nullopt); + }, + [result](const FlutterError& error) { result(error); }); +} + +void TestPlugin::CallFlutterEchoNullableClassMap( + const EncodableMap* class_map, + std::function> reply)> result) { + flutter_api_->EchoNullableClassMap( + class_map, + [result](const EncodableMap* echo) { + result(echo ? std::optional(*echo) : std::nullopt); + }, + [result](const FlutterError& error) { result(error); }); +} + +void TestPlugin::CallFlutterEchoNullableNonNullStringMap( + const EncodableMap* string_map, + std::function> reply)> result) { + flutter_api_->EchoNullableNonNullStringMap( + string_map, + [result](const EncodableMap* echo) { + result(echo ? std::optional(*echo) : std::nullopt); + }, + [result](const FlutterError& error) { result(error); }); +} + +void TestPlugin::CallFlutterEchoNullableNonNullIntMap( + const EncodableMap* int_map, + std::function> reply)> result) { + flutter_api_->EchoNullableNonNullIntMap( + int_map, + [result](const EncodableMap* echo) { + result(echo ? std::optional(*echo) : std::nullopt); + }, + [result](const FlutterError& error) { result(error); }); +} + +void TestPlugin::CallFlutterEchoNullableNonNullEnumMap( + const EncodableMap* enum_map, + std::function> reply)> result) { + flutter_api_->EchoNullableNonNullEnumMap( + enum_map, + [result](const EncodableMap* echo) { + result(echo ? std::optional(*echo) : std::nullopt); + }, + [result](const FlutterError& error) { result(error); }); +} + +void TestPlugin::CallFlutterEchoNullableNonNullClassMap( + const EncodableMap* class_map, + std::function> reply)> result) { + flutter_api_->EchoNullableNonNullClassMap( + class_map, [result](const EncodableMap* echo) { result(echo ? std::optional(*echo) : std::nullopt); }, @@ -755,4 +1210,8 @@ void TestPlugin::CallFlutterSmallApiEchoString( [result](const FlutterError& error) { result(error); }); } +core_tests_pigeontest::UnusedClass TestPlugin::TestUnusedClassGenerates() { + return core_tests_pigeontest::UnusedClass(); +} + } // namespace test_plugin diff --git a/packages/pigeon/platform_tests/test_plugin/windows/test_plugin.h b/packages/pigeon/platform_tests/test_plugin/windows/test_plugin.h index deb0ab62cb4f..cabbe665ed58 100644 --- a/packages/pigeon/platform_tests/test_plugin/windows/test_plugin.h +++ b/packages/pigeon/platform_tests/test_plugin/windows/test_plugin.h @@ -81,8 +81,32 @@ class TestPlugin : public flutter::Plugin, const flutter::EncodableValue& an_object) override; core_tests_pigeontest::ErrorOr EchoList( const flutter::EncodableList& a_list) override; + core_tests_pigeontest::ErrorOr EchoEnumList( + const flutter::EncodableList& enum_list) override; + core_tests_pigeontest::ErrorOr EchoClassList( + const flutter::EncodableList& class_list) override; + core_tests_pigeontest::ErrorOr EchoNonNullEnumList( + const flutter::EncodableList& enum_list) override; + core_tests_pigeontest::ErrorOr EchoNonNullClassList( + const flutter::EncodableList& class_list) override; core_tests_pigeontest::ErrorOr EchoMap( - const flutter::EncodableMap& a_map) override; + const flutter::EncodableMap& map) override; + core_tests_pigeontest::ErrorOr EchoStringMap( + const flutter::EncodableMap& string_map) override; + core_tests_pigeontest::ErrorOr EchoIntMap( + const flutter::EncodableMap& int_map) override; + core_tests_pigeontest::ErrorOr EchoEnumMap( + const flutter::EncodableMap& enum_map) override; + core_tests_pigeontest::ErrorOr EchoClassMap( + const flutter::EncodableMap& class_map) override; + core_tests_pigeontest::ErrorOr EchoNonNullStringMap( + const flutter::EncodableMap& string_map) override; + core_tests_pigeontest::ErrorOr EchoNonNullIntMap( + const flutter::EncodableMap& int_map) override; + core_tests_pigeontest::ErrorOr EchoNonNullEnumMap( + const flutter::EncodableMap& enum_map) override; + core_tests_pigeontest::ErrorOr EchoNonNullClassMap( + const flutter::EncodableMap& class_map) override; core_tests_pigeontest::ErrorOr EchoClassWrapper( const core_tests_pigeontest::AllClassesWrapper& wrapper) override; @@ -126,8 +150,34 @@ class TestPlugin : public flutter::Plugin, EchoNullableObject(const flutter::EncodableValue* a_nullable_object) override; core_tests_pigeontest::ErrorOr> EchoNullableList(const flutter::EncodableList* a_nullable_list) override; + core_tests_pigeontest::ErrorOr> + EchoNullableEnumList(const flutter::EncodableList* enum_list) override; + core_tests_pigeontest::ErrorOr> + EchoNullableClassList(const flutter::EncodableList* class_list) override; + core_tests_pigeontest::ErrorOr> + EchoNullableNonNullEnumList(const flutter::EncodableList* enum_list) override; + core_tests_pigeontest::ErrorOr> + EchoNullableNonNullClassList( + const flutter::EncodableList* class_list) override; + core_tests_pigeontest::ErrorOr> + EchoNullableMap(const flutter::EncodableMap* map) override; + core_tests_pigeontest::ErrorOr> + EchoNullableStringMap(const flutter::EncodableMap* string_map) override; + core_tests_pigeontest::ErrorOr> + EchoNullableIntMap(const flutter::EncodableMap* int_map) override; + core_tests_pigeontest::ErrorOr> + EchoNullableEnumMap(const flutter::EncodableMap* enum_map) override; + core_tests_pigeontest::ErrorOr> + EchoNullableClassMap(const flutter::EncodableMap* class_map) override; core_tests_pigeontest::ErrorOr> - EchoNullableMap(const flutter::EncodableMap* a_nullable_map) override; + EchoNullableNonNullStringMap( + const flutter::EncodableMap* string_map) override; + core_tests_pigeontest::ErrorOr> + EchoNullableNonNullIntMap(const flutter::EncodableMap* int_map) override; + core_tests_pigeontest::ErrorOr> + EchoNullableNonNullEnumMap(const flutter::EncodableMap* enum_map) override; + core_tests_pigeontest::ErrorOr> + EchoNullableNonNullClassMap(const flutter::EncodableMap* class_map) override; core_tests_pigeontest::ErrorOr> EchoNullableEnum(const core_tests_pigeontest::AnEnum* an_enum) override; core_tests_pigeontest::ErrorOr< @@ -205,8 +255,38 @@ class TestPlugin : public flutter::Plugin, std::function< void(core_tests_pigeontest::ErrorOr reply)> result) override; + void EchoAsyncEnumList( + const flutter::EncodableList& enum_list, + std::function< + void(core_tests_pigeontest::ErrorOr reply)> + result) override; + void EchoAsyncClassList( + const flutter::EncodableList& class_list, + std::function< + void(core_tests_pigeontest::ErrorOr reply)> + result) override; void EchoAsyncMap( - const flutter::EncodableMap& a_map, + const flutter::EncodableMap& map, + std::function< + void(core_tests_pigeontest::ErrorOr reply)> + result) override; + void EchoAsyncStringMap( + const flutter::EncodableMap& string_map, + std::function< + void(core_tests_pigeontest::ErrorOr reply)> + result) override; + void EchoAsyncIntMap( + const flutter::EncodableMap& int_map, + std::function< + void(core_tests_pigeontest::ErrorOr reply)> + result) override; + void EchoAsyncEnumMap( + const flutter::EncodableMap& enum_map, + std::function< + void(core_tests_pigeontest::ErrorOr reply)> + result) override; + void EchoAsyncClassMap( + const flutter::EncodableMap& class_map, std::function< void(core_tests_pigeontest::ErrorOr reply)> result) override; @@ -259,8 +339,44 @@ class TestPlugin : public flutter::Plugin, core_tests_pigeontest::ErrorOr> reply)> result) override; + void EchoAsyncNullableEnumList( + const flutter::EncodableList* enum_list, + std::function> + reply)> + result) override; + void EchoAsyncNullableClassList( + const flutter::EncodableList* class_list, + std::function> + reply)> + result) override; void EchoAsyncNullableMap( - const flutter::EncodableMap* a_map, + const flutter::EncodableMap* map, + std::function> + reply)> + result) override; + void EchoAsyncNullableStringMap( + const flutter::EncodableMap* string_map, + std::function> + reply)> + result) override; + void EchoAsyncNullableIntMap( + const flutter::EncodableMap* int_map, + std::function> + reply)> + result) override; + void EchoAsyncNullableEnumMap( + const flutter::EncodableMap* enum_map, + std::function> + reply)> + result) override; + void EchoAsyncNullableClassMap( + const flutter::EncodableMap* class_map, std::function> reply)> @@ -350,8 +466,68 @@ class TestPlugin : public flutter::Plugin, std::function< void(core_tests_pigeontest::ErrorOr reply)> result) override; + void CallFlutterEchoEnumList( + const flutter::EncodableList& enum_list, + std::function< + void(core_tests_pigeontest::ErrorOr reply)> + result) override; + void CallFlutterEchoClassList( + const flutter::EncodableList& class_list, + std::function< + void(core_tests_pigeontest::ErrorOr reply)> + result) override; + void CallFlutterEchoNonNullEnumList( + const flutter::EncodableList& enum_list, + std::function< + void(core_tests_pigeontest::ErrorOr reply)> + result) override; + void CallFlutterEchoNonNullClassList( + const flutter::EncodableList& class_list, + std::function< + void(core_tests_pigeontest::ErrorOr reply)> + result) override; void CallFlutterEchoMap( - const flutter::EncodableMap& a_map, + const flutter::EncodableMap& map, + std::function< + void(core_tests_pigeontest::ErrorOr reply)> + result) override; + void CallFlutterEchoStringMap( + const flutter::EncodableMap& string_map, + std::function< + void(core_tests_pigeontest::ErrorOr reply)> + result) override; + void CallFlutterEchoIntMap( + const flutter::EncodableMap& int_map, + std::function< + void(core_tests_pigeontest::ErrorOr reply)> + result) override; + void CallFlutterEchoEnumMap( + const flutter::EncodableMap& enum_map, + std::function< + void(core_tests_pigeontest::ErrorOr reply)> + result) override; + void CallFlutterEchoClassMap( + const flutter::EncodableMap& class_map, + std::function< + void(core_tests_pigeontest::ErrorOr reply)> + result) override; + void CallFlutterEchoNonNullStringMap( + const flutter::EncodableMap& string_map, + std::function< + void(core_tests_pigeontest::ErrorOr reply)> + result) override; + void CallFlutterEchoNonNullIntMap( + const flutter::EncodableMap& int_map, + std::function< + void(core_tests_pigeontest::ErrorOr reply)> + result) override; + void CallFlutterEchoNonNullEnumMap( + const flutter::EncodableMap& enum_map, + std::function< + void(core_tests_pigeontest::ErrorOr reply)> + result) override; + void CallFlutterEchoNonNullClassMap( + const flutter::EncodableMap& class_map, std::function< void(core_tests_pigeontest::ErrorOr reply)> result) override; @@ -398,8 +574,80 @@ class TestPlugin : public flutter::Plugin, core_tests_pigeontest::ErrorOr> reply)> result) override; + void CallFlutterEchoNullableEnumList( + const flutter::EncodableList* enum_list, + std::function> + reply)> + result) override; + void CallFlutterEchoNullableClassList( + const flutter::EncodableList* class_list, + std::function> + reply)> + result) override; + void CallFlutterEchoNullableNonNullEnumList( + const flutter::EncodableList* enum_list, + std::function> + reply)> + result) override; + void CallFlutterEchoNullableNonNullClassList( + const flutter::EncodableList* class_list, + std::function> + reply)> + result) override; void CallFlutterEchoNullableMap( - const flutter::EncodableMap* a_map, + const flutter::EncodableMap* map, + std::function> + reply)> + result) override; + void CallFlutterEchoNullableStringMap( + const flutter::EncodableMap* string_map, + std::function> + reply)> + result) override; + void CallFlutterEchoNullableIntMap( + const flutter::EncodableMap* int_map, + std::function> + reply)> + result) override; + void CallFlutterEchoNullableEnumMap( + const flutter::EncodableMap* enum_map, + std::function> + reply)> + result) override; + void CallFlutterEchoNullableClassMap( + const flutter::EncodableMap* class_map, + std::function> + reply)> + result) override; + void CallFlutterEchoNullableNonNullStringMap( + const flutter::EncodableMap* string_map, + std::function> + reply)> + result) override; + void CallFlutterEchoNullableNonNullIntMap( + const flutter::EncodableMap* int_map, + std::function> + reply)> + result) override; + void CallFlutterEchoNullableNonNullEnumMap( + const flutter::EncodableMap* enum_map, + std::function> + reply)> + result) override; + void CallFlutterEchoNullableNonNullClassMap( + const flutter::EncodableMap* class_map, std::function> reply)> @@ -420,6 +668,7 @@ class TestPlugin : public flutter::Plugin, const std::string& a_string, std::function reply)> result) override; + core_tests_pigeontest::UnusedClass TestUnusedClassGenerates(); private: std::unique_ptr diff --git a/packages/pigeon/pubspec.yaml b/packages/pigeon/pubspec.yaml index 65d27bdb3fb1..cddaae515813 100644 --- a/packages/pigeon/pubspec.yaml +++ b/packages/pigeon/pubspec.yaml @@ -2,7 +2,7 @@ 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: 21.2.0 # This must match the version in lib/generator_tools.dart +version: 22.6.0 # This must match the version in lib/generator_tools.dart environment: sdk: ^3.3.0 @@ -13,8 +13,10 @@ dependencies: code_builder: ^4.10.0 collection: ^1.15.0 dart_style: ^2.3.4 + graphs: ^2.3.1 meta: ^1.9.0 path: ^1.8.0 + pub_semver: ^2.1.4 yaml: ^3.1.1 dev_dependencies: diff --git a/packages/pigeon/test/cpp_generator_test.dart b/packages/pigeon/test/cpp_generator_test.dart index edc074a4789f..65a8f7ed8fdf 100644 --- a/packages/pigeon/test/cpp_generator_test.dart +++ b/packages/pigeon/test/cpp_generator_test.dart @@ -1197,16 +1197,14 @@ void main() { code, contains( 'const auto* a_map_arg = std::get_if(&encodable_a_map_arg);')); - // Ints are complicated since there are two possible pointer types, but - // the parameter always needs an int64_t*. expect( code, contains( - 'const int64_t an_int_arg_value = encodable_an_int_arg.IsNull() ? 0 : encodable_an_int_arg.LongValue();')); + 'const auto* a_bool_arg = std::get_if(&encodable_a_bool_arg);')); expect( code, contains( - 'const auto* an_int_arg = encodable_an_int_arg.IsNull() ? nullptr : &an_int_arg_value;')); + 'const auto* an_int_arg = std::get_if(&encodable_an_int_arg);')); // Custom class types require an extra layer of extraction. expect( code, diff --git a/packages/pigeon/test/dart/proxy_api_test.dart b/packages/pigeon/test/dart/proxy_api_test.dart index 8e7f230f7ed3..fd1d887189e3 100644 --- a/packages/pigeon/test/dart/proxy_api_test.dart +++ b/packages/pigeon/test/dart/proxy_api_test.dart @@ -80,7 +80,7 @@ void main() { final String collapsedCode = _collapseNewlineAndIndentation(code); // Instance Manager - expect(code, contains(r'class PigeonInternalInstanceManager')); + expect(code, contains(r'class PigeonInstanceManager')); expect(code, contains(r'class _PigeonInternalInstanceManagerApi')); // Base Api class @@ -158,13 +158,13 @@ void main() { expect( code, contains( - 'dev.flutter.pigeon.$DEFAULT_PACKAGE_NAME.PigeonInternalInstanceManagerApi.removeStrongReference', + 'dev.flutter.pigeon.$DEFAULT_PACKAGE_NAME.PigeonInternalInstanceManager.removeStrongReference', ), ); expect( collapsedCode, contains( - '(instanceManager ?? PigeonInternalInstanceManager.instance) .remove(arg_identifier!);', + '(instanceManager ?? PigeonInstanceManager.instance) .remove(arg_identifier!);', ), ); @@ -172,7 +172,7 @@ void main() { expect( code, contains( - 'dev.flutter.pigeon.$DEFAULT_PACKAGE_NAME.PigeonInternalInstanceManagerApi.clear', + 'dev.flutter.pigeon.$DEFAULT_PACKAGE_NAME.PigeonInternalInstanceManager.clear', ), ); }); @@ -890,7 +890,7 @@ void main() { collapsedCode, contains( r'static Future doSomething({ BinaryMessenger? pigeon_binaryMessenger, ' - r'PigeonInternalInstanceManager? pigeon_instanceManager, })', + r'PigeonInstanceManager? pigeon_instanceManager, })', ), ); expect( diff --git a/packages/pigeon/test/dart_generator_test.dart b/packages/pigeon/test/dart_generator_test.dart index 93aacafd1cd1..4dca4b416844 100644 --- a/packages/pigeon/test/dart_generator_test.dart +++ b/packages/pigeon/test/dart_generator_test.dart @@ -1771,4 +1771,35 @@ name: foobar final String mainCode = mainCodeSink.toString(); expect(mainCode, contains('List wrapResponse(')); }); + + test('writes custom int codec without custom types', () { + final Root root = Root( + apis: [ + AstHostApi(name: 'Api', methods: [ + Method( + name: 'doit', + location: ApiLocation.host, + returnType: const TypeDeclaration( + baseName: 'int', + isNullable: true, + ), + parameters: []) + ]) + ], + 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('if (value is int) {')); + expect(code, contains('buffer.putUint8(4);')); + expect(code, contains('buffer.putInt64(value);')); + }); } diff --git a/packages/pigeon/test/generator_tools_test.dart b/packages/pigeon/test/generator_tools_test.dart index d7c49e37154f..2ed9239b0a25 100644 --- a/packages/pigeon/test/generator_tools_test.dart +++ b/packages/pigeon/test/generator_tools_test.dart @@ -387,4 +387,81 @@ void main() { expect(() => a.apisOfInterfaces(), throwsArgumentError); }); + + test('findHighestApiRequirement', () { + final TypeDeclaration typeWithoutMinApi = TypeDeclaration( + baseName: 'TypeWithoutMinApi', + isNullable: false, + associatedProxyApi: AstProxyApi( + name: 'TypeWithoutMinApi', + methods: [], + constructors: [], + fields: [], + ), + ); + + final TypeDeclaration typeWithMinApi = TypeDeclaration( + baseName: 'TypeWithMinApi', + isNullable: false, + associatedProxyApi: AstProxyApi( + name: 'TypeWithMinApi', + methods: [], + constructors: [], + fields: [], + ), + ); + + final TypeDeclaration typeWithHighestMinApi = TypeDeclaration( + baseName: 'TypeWithHighestMinApi', + isNullable: false, + associatedProxyApi: AstProxyApi( + name: 'TypeWithHighestMinApi', + methods: [], + constructors: [], + fields: [], + ), + ); + + final ({TypeDeclaration type, int version})? result = + findHighestApiRequirement( + [ + typeWithoutMinApi, + typeWithMinApi, + typeWithHighestMinApi, + ], + onGetApiRequirement: (TypeDeclaration type) { + if (type == typeWithMinApi) { + return 1; + } else if (type == typeWithHighestMinApi) { + return 2; + } + + return null; + }, + onCompare: (int one, int two) => one.compareTo(two), + ); + + expect(result?.type, typeWithHighestMinApi); + expect(result?.version, 2); + }); + + test('Indent.format trims indentation', () { + final StringBuffer buffer = StringBuffer(); + final Indent indent = Indent(buffer); + + indent.format( + ''' + void myMethod() { + + print('hello'); + }''', + ); + + expect(buffer.toString(), ''' +void myMethod() { + + print('hello'); +} +'''); + }); } diff --git a/packages/pigeon/test/java_generator_test.dart b/packages/pigeon/test/java_generator_test.dart index b58fe1ef7391..63a6e8330eab 100644 --- a/packages/pigeon/test/java_generator_test.dart +++ b/packages/pigeon/test/java_generator_test.dart @@ -776,8 +776,10 @@ void main() { ); final String code = sink.toString(); expect(code, contains('public enum Foo')); - expect(code, - contains('return value == null ? null : Foo.values()[(int) value];')); + expect( + code, + contains( + 'return value == null ? null : Foo.values()[((Long) value).intValue()];')); expect( code, contains( @@ -1040,10 +1042,7 @@ void main() { ); final String code = sink.toString(); expect(code, contains('public void doit(@NonNull Result result)')); - expect( - code, - contains( - 'Long output = listReply.get(0) == null ? null : ((Number) listReply.get(0)).longValue();')); + expect(code, contains('Long output = (Long) listReply.get(0);')); }); test('host multiple args', () { @@ -1080,12 +1079,9 @@ void main() { expect(code, contains('Long add(@NonNull Long x, @NonNull Long y)')); expect(code, contains('ArrayList args = (ArrayList) message;')); - expect(code, contains('Number xArg = (Number) args.get(0)')); - expect(code, contains('Number yArg = (Number) args.get(1)')); - expect( - code, - contains( - 'Long output = api.add((xArg == null) ? null : xArg.longValue(), (yArg == null) ? null : yArg.longValue())')); + expect(code, contains('Long xArg = (Long) args.get(0)')); + expect(code, contains('Long yArg = (Long) args.get(1)')); + expect(code, contains('Long output = api.add(xArg, yArg)')); }); test('if host argType is Object not cast', () { diff --git a/packages/pigeon/test/kotlin/proxy_api_test.dart b/packages/pigeon/test/kotlin/proxy_api_test.dart new file mode 100644 index 000000000000..d6ddd35377bf --- /dev/null +++ b/packages/pigeon/test/kotlin/proxy_api_test.dart @@ -0,0 +1,944 @@ +// 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:pigeon/ast.dart'; +import 'package:pigeon/kotlin_generator.dart'; +import 'package:test/test.dart'; + +const String DEFAULT_PACKAGE_NAME = 'test_package'; + +void main() { + group('ProxyApi', () { + test('one api', () { + final Root root = Root( + apis: [ + AstProxyApi( + name: 'Api', + kotlinOptions: const KotlinProxyApiOptions( + fullClassName: 'my.library.Api', + ), + constructors: [ + Constructor( + name: 'name', + parameters: [ + Parameter( + type: const TypeDeclaration( + baseName: 'Input', + isNullable: false, + ), + name: 'input', + ), + ], + ), + ], + fields: [ + ApiField( + name: 'someField', + type: const TypeDeclaration( + baseName: 'int', + isNullable: false, + ), + ) + ], + methods: [ + Method( + name: 'doSomething', + location: ApiLocation.host, + parameters: [ + Parameter( + type: const TypeDeclaration( + baseName: 'Input', + isNullable: false, + ), + name: 'input', + ) + ], + returnType: const TypeDeclaration( + baseName: 'String', + isNullable: false, + ), + ), + Method( + name: 'doSomethingElse', + location: ApiLocation.flutter, + isRequired: false, + parameters: [ + Parameter( + type: const TypeDeclaration( + baseName: 'Input', + isNullable: false, + ), + name: 'input', + ), + ], + returnType: const TypeDeclaration( + baseName: 'String', + isNullable: false, + ), + ), + ], + ) + ], + classes: [], + enums: [], + ); + final StringBuffer sink = StringBuffer(); + const KotlinGenerator generator = KotlinGenerator(); + generator.generate( + const KotlinOptions(fileSpecificClassNameComponent: 'MyFile'), + root, + sink, + dartPackageName: DEFAULT_PACKAGE_NAME, + ); + final String code = sink.toString(); + final String collapsedCode = _collapseNewlineAndIndentation(code); + + // Instance Manager + expect(code, contains(r'class MyFilePigeonInstanceManager')); + expect(code, contains(r'class MyFilePigeonInstanceManagerApi')); + + // API registrar + expect( + code, + contains( + 'abstract class MyFilePigeonProxyApiRegistrar(val binaryMessenger: BinaryMessenger)', + ), + ); + + // Codec + expect( + code, + contains( + 'private class MyFilePigeonProxyApiBaseCodec(val registrar: MyFilePigeonProxyApiRegistrar) : MyFilePigeonCodec()')); + + // Proxy API class + expect( + code, + contains( + r'abstract class PigeonApiApi(open val pigeonRegistrar: MyFilePigeonProxyApiRegistrar)', + ), + ); + + // Constructors + expect( + collapsedCode, + contains( + r'abstract fun name(someField: Long, input: Input)', + ), + ); + expect( + collapsedCode, + contains( + r'fun pigeon_newInstance(pigeon_instanceArg: my.library.Api, callback: (Result) -> Unit)', + ), + ); + + // Field + expect( + code, + contains( + 'abstract fun someField(pigeon_instance: my.library.Api): Long', + ), + ); + + // Dart -> Host method + expect( + collapsedCode, + contains('api.doSomething(pigeon_instanceArg, inputArg)'), + ); + + // Host -> Dart method + expect( + code, + contains( + r'fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiApi?)', + ), + ); + expect( + code, + contains( + 'fun doSomethingElse(pigeon_instanceArg: my.library.Api, inputArg: Input, callback: (Result) -> Unit)', + ), + ); + }); + + group('inheritance', () { + test('extends', () { + final AstProxyApi api2 = AstProxyApi( + name: 'Api2', + constructors: [], + fields: [], + methods: [], + ); + final Root root = Root(apis: [ + AstProxyApi( + name: 'Api', + constructors: [], + fields: [], + methods: [], + superClass: TypeDeclaration( + baseName: api2.name, + isNullable: false, + associatedProxyApi: api2, + ), + ), + api2, + ], classes: [], enums: []); + final StringBuffer sink = StringBuffer(); + const KotlinGenerator generator = KotlinGenerator(); + generator.generate( + const KotlinOptions(), + root, + sink, + dartPackageName: DEFAULT_PACKAGE_NAME, + ); + final String code = sink.toString(); + final String collapsedCode = _collapseNewlineAndIndentation(code); + expect( + collapsedCode, + contains('fun pigeon_getPigeonApiApi2(): PigeonApiApi2'), + ); + }); + + test('implements', () { + final AstProxyApi api2 = AstProxyApi( + name: 'Api2', + constructors: [], + fields: [], + methods: [], + ); + final Root root = Root(apis: [ + AstProxyApi( + name: 'Api', + constructors: [], + fields: [], + methods: [], + interfaces: { + TypeDeclaration( + baseName: api2.name, + isNullable: false, + associatedProxyApi: api2, + ) + }, + ), + api2, + ], classes: [], enums: []); + final StringBuffer sink = StringBuffer(); + const KotlinGenerator generator = KotlinGenerator(); + generator.generate( + const KotlinOptions(), + root, + sink, + dartPackageName: DEFAULT_PACKAGE_NAME, + ); + final String code = sink.toString(); + expect(code, contains('fun pigeon_getPigeonApiApi2(): PigeonApiApi2')); + }); + + test('implements 2 ProxyApis', () { + final AstProxyApi api2 = AstProxyApi( + name: 'Api2', + constructors: [], + fields: [], + methods: [], + ); + final AstProxyApi api3 = AstProxyApi( + name: 'Api3', + constructors: [], + fields: [], + methods: [], + ); + final Root root = Root(apis: [ + AstProxyApi( + name: 'Api', + constructors: [], + fields: [], + methods: [], + interfaces: { + TypeDeclaration( + baseName: api2.name, + isNullable: false, + associatedProxyApi: api2, + ), + TypeDeclaration( + baseName: api3.name, + isNullable: false, + associatedProxyApi: api3, + ), + }, + ), + api2, + api3, + ], classes: [], enums: []); + final StringBuffer sink = StringBuffer(); + const KotlinGenerator generator = KotlinGenerator(); + generator.generate( + const KotlinOptions(), + root, + sink, + dartPackageName: DEFAULT_PACKAGE_NAME, + ); + final String code = sink.toString(); + expect(code, contains('fun pigeon_getPigeonApiApi2(): PigeonApiApi2')); + expect(code, contains('fun pigeon_getPigeonApiApi3(): PigeonApiApi3')); + }); + }); + + group('Constructors', () { + test('empty name and no params constructor', () { + final Root root = Root( + apis: [ + AstProxyApi(name: 'Api', constructors: [ + Constructor( + name: '', + parameters: [], + ) + ], fields: [], methods: []), + ], + classes: [], + enums: [], + ); + final StringBuffer sink = StringBuffer(); + const KotlinGenerator generator = KotlinGenerator(); + generator.generate( + const KotlinOptions(), + root, + sink, + dartPackageName: DEFAULT_PACKAGE_NAME, + ); + final String code = sink.toString(); + final String collapsedCode = _collapseNewlineAndIndentation(code); + expect( + code, + contains( + 'abstract class PigeonApiApi(open val pigeonRegistrar: PigeonProxyApiRegistrar) ', + ), + ); + expect( + collapsedCode, + contains('abstract fun pigeon_defaultConstructor(): Api'), + ); + expect( + collapsedCode, + contains( + r'val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.test_package.Api.pigeon_defaultConstructor"', + ), + ); + expect( + collapsedCode, + contains( + r'api.pigeonRegistrar.instanceManager.addDartCreatedInstance(api.pigeon_defaultConstructor(', + ), + ); + }); + + test('multiple params constructor', () { + final Enum anEnum = Enum( + name: 'AnEnum', + members: [EnumMember(name: 'one')], + ); + final Root root = Root( + apis: [ + AstProxyApi(name: 'Api', constructors: [ + Constructor( + name: 'name', + parameters: [ + Parameter( + type: const TypeDeclaration( + isNullable: false, + baseName: 'int', + ), + name: 'validType', + ), + Parameter( + type: TypeDeclaration( + isNullable: false, + baseName: 'AnEnum', + associatedEnum: anEnum, + ), + name: 'enumType', + ), + Parameter( + type: const TypeDeclaration( + isNullable: false, + baseName: 'Api2', + ), + name: 'proxyApiType', + ), + Parameter( + type: const TypeDeclaration( + isNullable: true, + baseName: 'int', + ), + name: 'nullableValidType', + ), + Parameter( + type: TypeDeclaration( + isNullable: true, + baseName: 'AnEnum', + associatedEnum: anEnum, + ), + name: 'nullableEnumType', + ), + Parameter( + type: const TypeDeclaration( + isNullable: true, + baseName: 'Api2', + ), + name: 'nullableProxyApiType', + ), + ], + ) + ], fields: [], methods: []), + AstProxyApi( + name: 'Api2', + constructors: [], + fields: [], + methods: [], + ), + ], + classes: [], + enums: [anEnum], + ); + final StringBuffer sink = StringBuffer(); + const KotlinGenerator generator = KotlinGenerator(); + generator.generate( + const KotlinOptions(), + root, + sink, + dartPackageName: DEFAULT_PACKAGE_NAME, + ); + final String code = sink.toString(); + final String collapsedCode = _collapseNewlineAndIndentation(code); + expect( + code, + contains( + 'abstract class PigeonApiApi(open val pigeonRegistrar: PigeonProxyApiRegistrar) ', + ), + ); + expect( + collapsedCode, + contains( + 'abstract fun name(validType: Long, enumType: AnEnum, ' + 'proxyApiType: Api2, nullableValidType: Long?, ' + 'nullableEnumType: AnEnum?, nullableProxyApiType: Api2?): Api', + ), + ); + expect( + collapsedCode, + contains( + r'api.pigeonRegistrar.instanceManager.addDartCreatedInstance(api.name(' + r'validTypeArg,enumTypeArg,proxyApiTypeArg,nullableValidTypeArg,' + r'nullableEnumTypeArg,nullableProxyApiTypeArg), pigeon_identifierArg)', + ), + ); + }); + }); + + group('Fields', () { + test('constructor with fields', () { + final Enum anEnum = Enum( + name: 'AnEnum', + members: [EnumMember(name: 'one')], + ); + final Root root = Root( + apis: [ + AstProxyApi( + name: 'Api', + constructors: [ + Constructor( + name: 'name', + parameters: [], + ) + ], + fields: [ + ApiField( + type: const TypeDeclaration( + isNullable: false, + baseName: 'int', + ), + name: 'validType', + ), + ApiField( + type: TypeDeclaration( + isNullable: false, + baseName: 'AnEnum', + associatedEnum: anEnum, + ), + name: 'enumType', + ), + ApiField( + type: const TypeDeclaration( + isNullable: false, + baseName: 'Api2', + ), + name: 'proxyApiType', + ), + ApiField( + type: const TypeDeclaration( + isNullable: true, + baseName: 'int', + ), + name: 'nullableValidType', + ), + ApiField( + type: TypeDeclaration( + isNullable: true, + baseName: 'AnEnum', + associatedEnum: anEnum, + ), + name: 'nullableEnumType', + ), + ApiField( + type: const TypeDeclaration( + isNullable: true, + baseName: 'Api2', + ), + name: 'nullableProxyApiType', + ), + ], + methods: [], + ), + AstProxyApi( + name: 'Api2', + constructors: [], + fields: [], + methods: [], + ), + ], + classes: [], + enums: [anEnum], + ); + final StringBuffer sink = StringBuffer(); + const KotlinGenerator generator = KotlinGenerator(); + generator.generate( + const KotlinOptions(), + root, + sink, + dartPackageName: DEFAULT_PACKAGE_NAME, + ); + final String code = sink.toString(); + final String collapsedCode = _collapseNewlineAndIndentation(code); + expect( + collapsedCode, + contains( + 'abstract fun name(validType: Long, enumType: AnEnum, ' + 'proxyApiType: Api2, nullableValidType: Long?, ' + 'nullableEnumType: AnEnum?, nullableProxyApiType: Api2?): Api', + ), + ); + expect( + collapsedCode, + contains( + r'api.pigeonRegistrar.instanceManager.addDartCreatedInstance(api.name(' + r'validTypeArg,enumTypeArg,proxyApiTypeArg,nullableValidTypeArg,' + r'nullableEnumTypeArg,nullableProxyApiTypeArg), pigeon_identifierArg)', + ), + ); + expect( + collapsedCode, + contains( + 'channel.send(listOf(pigeon_identifierArg, validTypeArg, ' + 'enumTypeArg, proxyApiTypeArg, nullableValidTypeArg, ' + 'nullableEnumTypeArg, nullableProxyApiTypeArg))', + ), + ); + expect( + code, + contains(r'abstract fun validType(pigeon_instance: Api): Long'), + ); + expect( + code, + contains(r'abstract fun enumType(pigeon_instance: Api): AnEnum'), + ); + expect( + code, + contains(r'abstract fun proxyApiType(pigeon_instance: Api): Api2'), + ); + expect( + code, + contains( + r'abstract fun nullableValidType(pigeon_instance: Api): Long?', + ), + ); + expect( + code, + contains( + r'abstract fun nullableEnumType(pigeon_instance: Api): AnEnum?', + ), + ); + expect( + code, + contains( + r'abstract fun nullableProxyApiType(pigeon_instance: Api): Api2?', + ), + ); + }); + + test('attached field', () { + final AstProxyApi api2 = AstProxyApi( + name: 'Api2', + constructors: [], + fields: [], + methods: [], + ); + final Root root = Root( + apis: [ + AstProxyApi( + name: 'Api', + constructors: [], + fields: [ + ApiField( + name: 'aField', + isAttached: true, + type: TypeDeclaration( + baseName: 'Api2', + isNullable: false, + associatedProxyApi: api2, + ), + ), + ], + methods: [], + ), + api2, + ], + classes: [], + enums: [], + ); + final StringBuffer sink = StringBuffer(); + const KotlinGenerator generator = KotlinGenerator(); + generator.generate( + const KotlinOptions(), + root, + sink, + dartPackageName: DEFAULT_PACKAGE_NAME, + ); + final String code = sink.toString(); + expect( + code, + contains(r'abstract fun aField(pigeon_instance: Api): Api2'), + ); + expect( + code, + contains( + r'api.pigeonRegistrar.instanceManager.addDartCreatedInstance(api.aField(pigeon_instanceArg), pigeon_identifierArg)', + ), + ); + }); + + test('static attached field', () { + final AstProxyApi api2 = AstProxyApi( + name: 'Api2', + constructors: [], + fields: [], + methods: [], + ); + final Root root = Root( + apis: [ + AstProxyApi( + name: 'Api', + constructors: [], + fields: [ + ApiField( + name: 'aField', + isStatic: true, + isAttached: true, + type: TypeDeclaration( + baseName: 'Api2', + isNullable: false, + associatedProxyApi: api2, + ), + ), + ], + methods: [], + ), + api2, + ], + classes: [], + enums: [], + ); + final StringBuffer sink = StringBuffer(); + const KotlinGenerator generator = KotlinGenerator(); + generator.generate( + const KotlinOptions(), + root, + sink, + dartPackageName: DEFAULT_PACKAGE_NAME, + ); + final String code = sink.toString(); + expect( + code, + contains(r'abstract fun aField(): Api2'), + ); + expect( + code, + contains( + r'api.pigeonRegistrar.instanceManager.addDartCreatedInstance(api.aField(), pigeon_identifierArg)', + ), + ); + }); + }); + + group('Host methods', () { + test('multiple params method', () { + final Enum anEnum = Enum( + name: 'AnEnum', + members: [EnumMember(name: 'one')], + ); + final Root root = Root( + apis: [ + AstProxyApi( + name: 'Api', + constructors: [], + fields: [], + methods: [ + Method( + name: 'doSomething', + location: ApiLocation.host, + parameters: [ + Parameter( + type: const TypeDeclaration( + isNullable: false, + baseName: 'int', + ), + name: 'validType', + ), + Parameter( + type: TypeDeclaration( + isNullable: false, + baseName: 'AnEnum', + associatedEnum: anEnum, + ), + name: 'enumType', + ), + Parameter( + type: const TypeDeclaration( + isNullable: false, + baseName: 'Api2', + ), + name: 'proxyApiType', + ), + Parameter( + type: const TypeDeclaration( + isNullable: true, + baseName: 'int', + ), + name: 'nullableValidType', + ), + Parameter( + type: TypeDeclaration( + isNullable: true, + baseName: 'AnEnum', + associatedEnum: anEnum, + ), + name: 'nullableEnumType', + ), + Parameter( + type: const TypeDeclaration( + isNullable: true, + baseName: 'Api2', + ), + name: 'nullableProxyApiType', + ), + ], + returnType: const TypeDeclaration.voidDeclaration(), + ), + ], + ), + AstProxyApi( + name: 'Api2', + constructors: [], + fields: [], + methods: [], + ), + ], + classes: [], + enums: [anEnum], + ); + final StringBuffer sink = StringBuffer(); + const KotlinGenerator generator = KotlinGenerator(); + generator.generate( + const KotlinOptions(), + root, + sink, + dartPackageName: DEFAULT_PACKAGE_NAME, + ); + final String code = sink.toString(); + final String collapsedCode = _collapseNewlineAndIndentation(code); + expect( + collapsedCode, + contains( + 'abstract fun doSomething(pigeon_instance: Api, validType: Long, ' + 'enumType: AnEnum, proxyApiType: Api2, nullableValidType: Long?, ' + 'nullableEnumType: AnEnum?, nullableProxyApiType: Api2?)', + ), + ); + expect( + collapsedCode, + contains( + r'api.doSomething(pigeon_instanceArg, validTypeArg, enumTypeArg, ' + r'proxyApiTypeArg, nullableValidTypeArg, nullableEnumTypeArg, ' + r'nullableProxyApiTypeArg)', + ), + ); + }); + + test('static method', () { + final Root root = Root( + apis: [ + AstProxyApi( + name: 'Api', + constructors: [], + fields: [], + methods: [ + Method( + name: 'doSomething', + location: ApiLocation.host, + isStatic: true, + parameters: [], + returnType: const TypeDeclaration.voidDeclaration(), + ), + ], + ), + ], + classes: [], + enums: [], + ); + final StringBuffer sink = StringBuffer(); + const KotlinGenerator generator = KotlinGenerator(); + generator.generate( + const KotlinOptions(), + root, + sink, + dartPackageName: DEFAULT_PACKAGE_NAME, + ); + final String code = sink.toString(); + final String collapsedCode = _collapseNewlineAndIndentation(code); + expect(collapsedCode, contains('abstract fun doSomething()')); + expect(collapsedCode, contains(r'api.doSomething()')); + }); + }); + + group('Flutter methods', () { + test('multiple params flutter method', () { + final Enum anEnum = Enum( + name: 'AnEnum', + members: [EnumMember(name: 'one')], + ); + final Root root = Root(apis: [ + AstProxyApi( + name: 'Api', + constructors: [], + fields: [], + methods: [ + Method( + name: 'doSomething', + location: ApiLocation.flutter, + parameters: [ + Parameter( + type: const TypeDeclaration( + isNullable: false, + baseName: 'int', + ), + name: 'validType', + ), + Parameter( + type: TypeDeclaration( + isNullable: false, + baseName: 'AnEnum', + associatedEnum: anEnum, + ), + name: 'enumType', + ), + Parameter( + type: const TypeDeclaration( + isNullable: false, + baseName: 'Api2', + ), + name: 'proxyApiType', + ), + Parameter( + type: const TypeDeclaration( + isNullable: true, + baseName: 'int', + ), + name: 'nullableValidType', + ), + Parameter( + type: TypeDeclaration( + isNullable: true, + baseName: 'AnEnum', + associatedEnum: anEnum, + ), + name: 'nullableEnumType', + ), + Parameter( + type: const TypeDeclaration( + isNullable: true, + baseName: 'Api2', + ), + name: 'nullableProxyApiType', + ), + ], + returnType: const TypeDeclaration.voidDeclaration(), + ) + ]) + ], classes: [], enums: [ + anEnum + ]); + final StringBuffer sink = StringBuffer(); + const KotlinGenerator generator = KotlinGenerator(); + generator.generate( + const KotlinOptions(), + root, + sink, + dartPackageName: DEFAULT_PACKAGE_NAME, + ); + final String code = sink.toString(); + final String collapsedCode = _collapseNewlineAndIndentation(code); + expect( + collapsedCode, + contains( + 'fun doSomething(pigeon_instanceArg: Api, validTypeArg: Long, ' + 'enumTypeArg: AnEnum, proxyApiTypeArg: Api2, nullableValidTypeArg: Long?, ' + 'nullableEnumTypeArg: AnEnum?, nullableProxyApiTypeArg: Api2?, ' + 'callback: (Result) -> Unit)', + ), + ); + expect( + collapsedCode, + contains( + r'channel.send(listOf(pigeon_instanceArg, validTypeArg, enumTypeArg, ' + r'proxyApiTypeArg, nullableValidTypeArg, nullableEnumTypeArg, ' + r'nullableProxyApiTypeArg))', + ), + ); + }); + }); + }); +} + +/// Replaces a new line and the indentation with a single white space +/// +/// This +/// +/// ```dart +/// void method( +/// int param1, +/// int param2, +/// ) +/// ``` +/// +/// converts to +/// +/// ```dart +/// void method( int param1, int param2, ) +/// ``` +String _collapseNewlineAndIndentation(String string) { + final StringBuffer result = StringBuffer(); + for (final String line in string.split('\n')) { + result.write('${line.trimLeft()} '); + } + return result.toString().trim(); +} diff --git a/packages/pigeon/test/kotlin_generator_test.dart b/packages/pigeon/test/kotlin_generator_test.dart index 6f47e5b06726..549601b8851d 100644 --- a/packages/pigeon/test/kotlin_generator_test.dart +++ b/packages/pigeon/test/kotlin_generator_test.dart @@ -133,7 +133,7 @@ void main() { expect(code, contains('val field1: Foo,')); expect(code, contains('val field2: String')); expect(code, contains('fun fromList(pigeonVar_list: List): Bar')); - expect(code, contains('Foo.ofRaw(it)')); + expect(code, contains('Foo.ofRaw(it.toInt())')); expect(code, contains('val field1 = pigeonVar_list[0] as Foo')); expect(code, contains('val field2 = pigeonVar_list[1] as String\n')); expect(code, contains('fun toList(): List')); @@ -173,7 +173,7 @@ void main() { ); final String code = sink.toString(); expect(code, contains('enum class Foo(val raw: Int) {')); - expect(code, contains('Foo.ofRaw(it)')); + expect(code, contains('Foo.ofRaw(it.toInt())')); }); test('gen one host api', () { @@ -391,10 +391,6 @@ void main() { expect(code, contains('val aInt32List: IntArray')); expect(code, contains('val aInt64List: LongArray')); expect(code, contains('val aFloat64List: DoubleArray')); - expect( - code, - contains( - 'val aInt = pigeonVar_list[1].let { num -> if (num is Int) num.toLong() else num as Long }')); expect(code, contains('val aNullableBool: Boolean? = null')); expect(code, contains('val aNullableInt: Long? = null')); expect(code, contains('val aNullableDouble: Double? = null')); @@ -403,10 +399,6 @@ void main() { expect(code, contains('val aNullableInt32List: IntArray? = null')); expect(code, contains('val aNullableInt64List: LongArray? = null')); expect(code, contains('val aNullableFloat64List: DoubleArray? = null')); - expect( - code, - contains( - 'val aNullableInt = pigeonVar_list[9].let { num -> if (num is Int) num.toLong() else num as Long? }')); }); test('gen one flutter api', () { @@ -1163,14 +1155,6 @@ void main() { final String code = sink.toString(); expect(code, contains('fun add(x: Long, y: Long): Long')); expect(code, contains('val args = message as List')); - expect( - code, - contains( - 'val xArg = args[0].let { num -> if (num is Int) num.toLong() else num as Long }')); - expect( - code, - contains( - 'val yArg = args[1].let { num -> if (num is Int) num.toLong() else num as Long }')); expect(code, contains('listOf(api.add(xArg, yArg))')); expect(code, contains('reply.reply(wrapped)')); }); @@ -1206,11 +1190,6 @@ void main() { ); final String code = sink.toString(); expect(code, contains('val channel = BasicMessageChannel')); - expect( - code, - contains( - 'val output = it[0].let { num -> if (num is Int) num.toLong() else num as Long }'), - ); expect(code, contains('callback(Result.success(output))')); expect( code, @@ -1311,10 +1290,7 @@ void main() { dartPackageName: DEFAULT_PACKAGE_NAME, ); final String code = sink.toString(); - expect( - code, - contains( - 'val fooArg = args[0].let { num -> if (num is Int) num.toLong() else num as Long? }')); + expect(code, contains('val fooArg = args[0]')); }); test('nullable argument flutter', () { diff --git a/packages/pigeon/test/pigeon_lib_test.dart b/packages/pigeon/test/pigeon_lib_test.dart index 8d56fa9d66f9..9e3fa213fc78 100644 --- a/packages/pigeon/test/pigeon_lib_test.dart +++ b/packages/pigeon/test/pigeon_lib_test.dart @@ -161,6 +161,10 @@ class Output1 { String? output; } +class Unused { + String? field; +} + @HostApi() abstract class Api1 { Output1 doit(Input1 input); @@ -169,7 +173,7 @@ abstract class Api1 { final ParseResults parseResult = parseSource(code); expect(parseResult.errors.length, equals(0)); final Root root = parseResult.root; - expect(root.classes.length, equals(2)); + expect(root.classes.length, equals(3)); expect(root.apis.length, equals(1)); expect(root.apis[0].name, equals('Api1')); expect(root.apis[0].methods.length, equals(1)); @@ -181,15 +185,19 @@ abstract class Api1 { Class? input; Class? output; + Class? unused; for (final Class classDefinition in root.classes) { if (classDefinition.name == 'Input1') { input = classDefinition; } else if (classDefinition.name == 'Output1') { output = classDefinition; + } else if (classDefinition.name == 'Unused') { + unused = classDefinition; } } expect(input, isNotNull); expect(output, isNotNull); + expect(unused, isNotNull); expect(input?.fields.length, equals(1)); expect(input?.fields[0].name, equals('input')); @@ -200,6 +208,11 @@ abstract class Api1 { expect(output?.fields[0].name, equals('output')); expect(output?.fields[0].type.baseName, equals('String')); expect(output?.fields[0].type.isNullable, isTrue); + + expect(unused?.fields.length, equals(1)); + expect(unused?.fields[0].name, equals('field')); + expect(unused?.fields[0].type.baseName, equals('String')); + expect(unused?.fields[0].type.isNullable, isTrue); }); test('invalid datatype', () { @@ -731,25 +744,6 @@ abstract class Api { expect(field.type.typeArguments[0].typeArguments[0].baseName, 'int'); }); - test('error nonnull type argument', () { - const String code = ''' -class Foo { - List list; -} - -@HostApi() -abstract class Api { - void doit(Foo foo); -} -'''; - final ParseResults parseResult = parseSource(code); - expect(parseResult.errors.length, equals(1)); - expect(parseResult.errors[0].message, - contains('Generic type parameters must be nullable')); - expect(parseResult.errors[0].message, contains('"list"')); - expect(parseResult.errors[0].lineNumber, 2); - }); - test('enums argument host', () { const String code = ''' enum Foo { diff --git a/packages/pigeon/test/swift/proxy_api_test.dart b/packages/pigeon/test/swift/proxy_api_test.dart new file mode 100644 index 000000000000..18df858f81e9 --- /dev/null +++ b/packages/pigeon/test/swift/proxy_api_test.dart @@ -0,0 +1,974 @@ +// 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:pigeon/ast.dart'; +import 'package:pigeon/swift_generator.dart'; +import 'package:test/test.dart'; + +const String DEFAULT_PACKAGE_NAME = 'test_package'; + +void main() { + group('ProxyApi', () { + test('one api', () { + final Root root = Root( + apis: [ + AstProxyApi( + name: 'Api', + swiftOptions: const SwiftProxyApiOptions( + name: 'MyLibraryApi', import: 'MyLibrary'), + constructors: [ + Constructor( + name: 'name', + parameters: [ + Parameter( + type: const TypeDeclaration( + baseName: 'Input', + isNullable: false, + ), + name: 'input', + ), + ], + ), + ], + fields: [ + ApiField( + name: 'someField', + type: const TypeDeclaration( + baseName: 'int', + isNullable: false, + ), + ) + ], + methods: [ + Method( + name: 'doSomething', + location: ApiLocation.host, + parameters: [ + Parameter( + type: const TypeDeclaration( + baseName: 'Input', + isNullable: false, + ), + name: 'input', + ) + ], + returnType: const TypeDeclaration( + baseName: 'String', + isNullable: false, + ), + ), + Method( + name: 'doSomethingElse', + location: ApiLocation.flutter, + isRequired: false, + parameters: [ + Parameter( + type: const TypeDeclaration( + baseName: 'Input', + isNullable: false, + ), + name: 'input', + ), + ], + returnType: const TypeDeclaration( + baseName: 'String', + isNullable: false, + ), + ), + ], + ) + ], + classes: [], + enums: [], + ); + final StringBuffer sink = StringBuffer(); + const SwiftGenerator generator = SwiftGenerator(); + generator.generate( + const SwiftOptions(fileSpecificClassNameComponent: 'MyFile'), + root, + sink, + dartPackageName: DEFAULT_PACKAGE_NAME, + ); + final String code = sink.toString(); + final String collapsedCode = _collapseNewlineAndIndentation(code); + + // import + expect(code, contains('import MyLibrary')); + + // Instance Manager + expect( + code, + contains( + r'final class MyFilePigeonInstanceManager', + ), + ); + expect( + code, + contains( + r'private class MyFilePigeonInstanceManagerApi', + ), + ); + + // ProxyApi Delegate + expect(code, contains(r'protocol MyFilePigeonProxyApiDelegate')); + expect( + collapsedCode, + contains( + r'func pigeonApiApi(_ registrar: MyFilePigeonProxyApiRegistrar) -> PigeonApiApi'), + ); + + // API registrar + expect( + code, + contains('open class MyFilePigeonProxyApiRegistrar'), + ); + + // ReaderWriter + expect( + code, + contains( + 'private class MyFilePigeonInternalProxyApiCodecReaderWriter: FlutterStandardReaderWriter', + ), + ); + + // Delegate and class + expect(code, contains('protocol PigeonApiDelegateApi')); + expect(code, contains('protocol PigeonApiProtocolApi')); + expect( + code, + contains( + r'class PigeonApiApi: PigeonApiProtocolApi', + ), + ); + + // Constructors + expect( + collapsedCode, + contains( + r'func name(pigeonApi: PigeonApiApi, someField: Int64, input: Input) throws -> MyLibraryApi', + ), + ); + expect( + collapsedCode, + contains( + r'func pigeonNewInstance(pigeonInstance: MyLibraryApi, completion: @escaping (Result) -> Void) ', + ), + ); + + // Field + expect( + code, + contains( + 'func someField(pigeonApi: PigeonApiApi, pigeonInstance: MyLibraryApi) throws -> Int64', + ), + ); + + // Dart -> Host method + expect( + collapsedCode, + contains( + 'func doSomething(pigeonApi: PigeonApiApi, pigeonInstance: MyLibraryApi, input: Input) throws -> String', + ), + ); + + // Host -> Dart method + expect( + code, + contains( + r'static func setUpMessageHandlers(binaryMessenger: FlutterBinaryMessenger, api: PigeonApiApi?)', + ), + ); + expect( + code, + contains( + 'func doSomethingElse(pigeonInstance pigeonInstanceArg: MyLibraryApi, input inputArg: Input, completion: @escaping (Result) -> Void)', + ), + ); + }); + + group('inheritance', () { + test('extends', () { + final AstProxyApi api2 = AstProxyApi( + name: 'Api2', + constructors: [], + fields: [], + methods: [], + ); + final Root root = Root(apis: [ + AstProxyApi( + name: 'Api', + constructors: [], + fields: [], + methods: [], + superClass: TypeDeclaration( + baseName: api2.name, + isNullable: false, + associatedProxyApi: api2, + ), + ), + api2, + ], classes: [], enums: []); + final StringBuffer sink = StringBuffer(); + const SwiftGenerator generator = SwiftGenerator(); + generator.generate( + const SwiftOptions(), + root, + sink, + dartPackageName: DEFAULT_PACKAGE_NAME, + ); + final String code = sink.toString(); + expect( + code, + contains('var pigeonApiApi2: PigeonApiApi2'), + ); + }); + + test('implements', () { + final AstProxyApi api2 = AstProxyApi( + name: 'Api2', + constructors: [], + fields: [], + methods: [], + ); + final Root root = Root(apis: [ + AstProxyApi( + name: 'Api', + constructors: [], + fields: [], + methods: [], + interfaces: { + TypeDeclaration( + baseName: api2.name, + isNullable: false, + associatedProxyApi: api2, + ) + }, + ), + api2, + ], classes: [], enums: []); + final StringBuffer sink = StringBuffer(); + const SwiftGenerator generator = SwiftGenerator(); + generator.generate( + const SwiftOptions(), + root, + sink, + dartPackageName: DEFAULT_PACKAGE_NAME, + ); + final String code = sink.toString(); + expect(code, contains('var pigeonApiApi2: PigeonApiApi2')); + }); + + test('implements 2 ProxyApis', () { + final AstProxyApi api2 = AstProxyApi( + name: 'Api2', + constructors: [], + fields: [], + methods: [], + ); + final AstProxyApi api3 = AstProxyApi( + name: 'Api3', + constructors: [], + fields: [], + methods: [], + ); + final Root root = Root(apis: [ + AstProxyApi( + name: 'Api', + constructors: [], + fields: [], + methods: [], + interfaces: { + TypeDeclaration( + baseName: api2.name, + isNullable: false, + associatedProxyApi: api2, + ), + TypeDeclaration( + baseName: api3.name, + isNullable: false, + associatedProxyApi: api3, + ), + }, + ), + api2, + api3, + ], classes: [], enums: []); + final StringBuffer sink = StringBuffer(); + const SwiftGenerator generator = SwiftGenerator(); + generator.generate( + const SwiftOptions(), + root, + sink, + dartPackageName: DEFAULT_PACKAGE_NAME, + ); + final String code = sink.toString(); + expect(code, contains('var pigeonApiApi2: PigeonApiApi2')); + expect(code, contains('var pigeonApiApi3: PigeonApiApi3')); + }); + }); + + group('Constructors', () { + test('empty name and no params constructor', () { + final Root root = Root( + apis: [ + AstProxyApi(name: 'Api', constructors: [ + Constructor( + name: '', + parameters: [], + ) + ], fields: [], methods: []), + ], + classes: [], + enums: [], + ); + final StringBuffer sink = StringBuffer(); + const SwiftGenerator generator = SwiftGenerator(); + generator.generate( + const SwiftOptions(), + root, + sink, + dartPackageName: DEFAULT_PACKAGE_NAME, + ); + final String code = sink.toString(); + final String collapsedCode = _collapseNewlineAndIndentation(code); + expect( + code, + contains('class PigeonApiApi: PigeonApiProtocolApi '), + ); + expect( + collapsedCode, + contains( + 'func pigeonDefaultConstructor(pigeonApi: PigeonApiApi) throws -> Api'), + ); + expect( + collapsedCode, + contains( + r'let pigeonDefaultConstructorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.test_package.Api.pigeon_defaultConstructor", binaryMessenger: binaryMessenger, codec: codec)', + ), + ); + expect( + collapsedCode, + contains( + r'api.pigeonRegistrar.instanceManager.addDartCreatedInstance(', + ), + ); + }); + + test('multiple params constructor', () { + final Enum anEnum = Enum( + name: 'AnEnum', + members: [EnumMember(name: 'one')], + ); + final Root root = Root( + apis: [ + AstProxyApi(name: 'Api', constructors: [ + Constructor( + name: 'name', + parameters: [ + Parameter( + type: const TypeDeclaration( + isNullable: false, + baseName: 'int', + ), + name: 'validType', + ), + Parameter( + type: TypeDeclaration( + isNullable: false, + baseName: 'AnEnum', + associatedEnum: anEnum, + ), + name: 'enumType', + ), + Parameter( + type: const TypeDeclaration( + isNullable: false, + baseName: 'Api2', + ), + name: 'proxyApiType', + ), + Parameter( + type: const TypeDeclaration( + isNullable: true, + baseName: 'int', + ), + name: 'nullableValidType', + ), + Parameter( + type: TypeDeclaration( + isNullable: true, + baseName: 'AnEnum', + associatedEnum: anEnum, + ), + name: 'nullableEnumType', + ), + Parameter( + type: const TypeDeclaration( + isNullable: true, + baseName: 'Api2', + ), + name: 'nullableProxyApiType', + ), + ], + ) + ], fields: [], methods: []), + AstProxyApi( + name: 'Api2', + constructors: [], + fields: [], + methods: [], + ), + ], + classes: [], + enums: [anEnum], + ); + final StringBuffer sink = StringBuffer(); + const SwiftGenerator generator = SwiftGenerator(); + generator.generate( + const SwiftOptions(), + root, + sink, + dartPackageName: DEFAULT_PACKAGE_NAME, + ); + final String code = sink.toString(); + final String collapsedCode = _collapseNewlineAndIndentation(code); + expect( + code, + contains( + 'class PigeonApiApi: PigeonApiProtocolApi ', + ), + ); + expect( + collapsedCode, + contains( + 'func name(pigeonApi: PigeonApiApi, validType: Int64, enumType: AnEnum, proxyApiType: Api2, nullableValidType: Int64?, nullableEnumType: AnEnum?, nullableProxyApiType: Api2?) throws -> Api', + ), + ); + expect( + collapsedCode, + contains( + r'api.pigeonRegistrar.instanceManager.addDartCreatedInstance( ' + r'try api.pigeonDelegate.name(pigeonApi: api, validType: validTypeArg, enumType: enumTypeArg, proxyApiType: ' + r'proxyApiTypeArg, nullableValidType: nullableValidTypeArg, nullableEnumType: nullableEnumTypeArg, ' + r'nullableProxyApiType: nullableProxyApiTypeArg)', + ), + ); + }); + }); + + group('Fields', () { + test('constructor with fields', () { + final Enum anEnum = Enum( + name: 'AnEnum', + members: [EnumMember(name: 'one')], + ); + final Root root = Root( + apis: [ + AstProxyApi( + name: 'Api', + constructors: [ + Constructor( + name: 'name', + parameters: [], + ) + ], + fields: [ + ApiField( + type: const TypeDeclaration( + isNullable: false, + baseName: 'int', + ), + name: 'validType', + ), + ApiField( + type: TypeDeclaration( + isNullable: false, + baseName: 'AnEnum', + associatedEnum: anEnum, + ), + name: 'enumType', + ), + ApiField( + type: const TypeDeclaration( + isNullable: false, + baseName: 'Api2', + ), + name: 'proxyApiType', + ), + ApiField( + type: const TypeDeclaration( + isNullable: true, + baseName: 'int', + ), + name: 'nullableValidType', + ), + ApiField( + type: TypeDeclaration( + isNullable: true, + baseName: 'AnEnum', + associatedEnum: anEnum, + ), + name: 'nullableEnumType', + ), + ApiField( + type: const TypeDeclaration( + isNullable: true, + baseName: 'Api2', + ), + name: 'nullableProxyApiType', + ), + ], + methods: [], + ), + AstProxyApi( + name: 'Api2', + constructors: [], + fields: [], + methods: [], + ), + ], + classes: [], + enums: [anEnum], + ); + final StringBuffer sink = StringBuffer(); + const SwiftGenerator generator = SwiftGenerator(); + generator.generate( + const SwiftOptions(), + root, + sink, + dartPackageName: DEFAULT_PACKAGE_NAME, + ); + final String code = sink.toString(); + final String collapsedCode = _collapseNewlineAndIndentation(code); + expect( + collapsedCode, + contains( + 'func name(pigeonApi: ' + 'PigeonApiApi, validType: Int64, enumType: AnEnum, proxyApiType: Api2, nullableValidType: Int64?, nullableEnumType: AnEnum?, ' + 'nullableProxyApiType: Api2?) throws -> Api func validType(pigeonApi: PigeonApiApi, pigeonInstance: Api) throws -> Int64 ', + ), + ); + expect( + collapsedCode, + contains( + r'api.pigeonRegistrar.instanceManager.addDartCreatedInstance( try api.pigeonDelegate.name(pigeonApi: api, ' + r'validType: validTypeArg, enumType: enumTypeArg, proxyApiType: proxyApiTypeArg, nullableValidType: nullableValidTypeArg, ' + r'nullableEnumType: nullableEnumTypeArg, nullableProxyApiType: nullableProxyApiTypeArg)', + ), + ); + expect( + collapsedCode, + contains( + 'channel.sendMessage([pigeonIdentifierArg, validTypeArg, enumTypeArg, ' + 'proxyApiTypeArg, nullableValidTypeArg, nullableEnumTypeArg, nullableProxyApiTypeArg] as [Any?])'), + ); + expect( + code, + contains( + r'func validType(pigeonApi: PigeonApiApi, pigeonInstance: Api) throws -> Int64'), + ); + expect( + code, + contains( + r'func enumType(pigeonApi: PigeonApiApi, pigeonInstance: Api) throws -> AnEnum'), + ); + expect( + code, + contains( + r'func proxyApiType(pigeonApi: PigeonApiApi, pigeonInstance: Api) throws -> Api2'), + ); + expect( + code, + contains( + r'func nullableValidType(pigeonApi: PigeonApiApi, pigeonInstance: Api) throws -> Int64?', + ), + ); + expect( + code, + contains( + r'func nullableEnumType(pigeonApi: PigeonApiApi, pigeonInstance: Api) throws -> AnEnum?', + ), + ); + expect( + code, + contains( + r'func nullableProxyApiType(pigeonApi: PigeonApiApi, pigeonInstance: Api) throws -> Api2?', + ), + ); + }); + + test('attached field', () { + final AstProxyApi api2 = AstProxyApi( + name: 'Api2', + constructors: [], + fields: [], + methods: [], + ); + final Root root = Root( + apis: [ + AstProxyApi( + name: 'Api', + constructors: [], + fields: [ + ApiField( + name: 'aField', + isAttached: true, + type: TypeDeclaration( + baseName: 'Api2', + isNullable: false, + associatedProxyApi: api2, + ), + ), + ], + methods: [], + ), + api2, + ], + classes: [], + enums: [], + ); + final StringBuffer sink = StringBuffer(); + const SwiftGenerator generator = SwiftGenerator(); + generator.generate( + const SwiftOptions(), + root, + sink, + dartPackageName: DEFAULT_PACKAGE_NAME, + ); + final String code = sink.toString(); + expect( + code, + contains( + r'func aField(pigeonApi: PigeonApiApi, pigeonInstance: Api) throws -> Api2'), + ); + expect( + code, + contains( + r'api.pigeonRegistrar.instanceManager.addDartCreatedInstance(try api.pigeonDelegate.aField(pigeonApi: api, pigeonInstance: pigeonInstanceArg), withIdentifier: pigeonIdentifierArg)', + ), + ); + }); + + test('static attached field', () { + final AstProxyApi api2 = AstProxyApi( + name: 'Api2', + constructors: [], + fields: [], + methods: [], + ); + final Root root = Root( + apis: [ + AstProxyApi( + name: 'Api', + constructors: [], + fields: [ + ApiField( + name: 'aField', + isStatic: true, + isAttached: true, + type: TypeDeclaration( + baseName: 'Api2', + isNullable: false, + associatedProxyApi: api2, + ), + ), + ], + methods: [], + ), + api2, + ], + classes: [], + enums: [], + ); + final StringBuffer sink = StringBuffer(); + const SwiftGenerator generator = SwiftGenerator(); + generator.generate( + const SwiftOptions(), + root, + sink, + dartPackageName: DEFAULT_PACKAGE_NAME, + ); + final String code = sink.toString(); + expect( + code, + contains(r'func aField(pigeonApi: PigeonApiApi) throws -> Api2'), + ); + expect( + code, + contains( + r'api.pigeonRegistrar.instanceManager.addDartCreatedInstance(try api.pigeonDelegate.aField(pigeonApi: api), withIdentifier: pigeonIdentifierArg)', + ), + ); + }); + }); + + group('Host methods', () { + test('multiple params method', () { + final Enum anEnum = Enum( + name: 'AnEnum', + members: [EnumMember(name: 'one')], + ); + final Root root = Root( + apis: [ + AstProxyApi( + name: 'Api', + constructors: [], + fields: [], + methods: [ + Method( + name: 'doSomething', + location: ApiLocation.host, + parameters: [ + Parameter( + type: const TypeDeclaration( + isNullable: false, + baseName: 'int', + ), + name: 'validType', + ), + Parameter( + type: TypeDeclaration( + isNullable: false, + baseName: 'AnEnum', + associatedEnum: anEnum, + ), + name: 'enumType', + ), + Parameter( + type: const TypeDeclaration( + isNullable: false, + baseName: 'Api2', + ), + name: 'proxyApiType', + ), + Parameter( + type: const TypeDeclaration( + isNullable: true, + baseName: 'int', + ), + name: 'nullableValidType', + ), + Parameter( + type: TypeDeclaration( + isNullable: true, + baseName: 'AnEnum', + associatedEnum: anEnum, + ), + name: 'nullableEnumType', + ), + Parameter( + type: const TypeDeclaration( + isNullable: true, + baseName: 'Api2', + ), + name: 'nullableProxyApiType', + ), + ], + returnType: const TypeDeclaration.voidDeclaration(), + ), + ], + ), + AstProxyApi( + name: 'Api2', + constructors: [], + fields: [], + methods: [], + ), + ], + classes: [], + enums: [anEnum], + ); + final StringBuffer sink = StringBuffer(); + const SwiftGenerator generator = SwiftGenerator(); + generator.generate( + const SwiftOptions(), + root, + sink, + dartPackageName: DEFAULT_PACKAGE_NAME, + ); + final String code = sink.toString(); + final String collapsedCode = _collapseNewlineAndIndentation(code); + expect( + collapsedCode, + contains( + 'func doSomething(pigeonApi: ' + 'PigeonApiApi, pigeonInstance: Api, validType: Int64, enumType: AnEnum, proxyApiType: Api2, nullableValidType: Int64?, ' + 'nullableEnumType: AnEnum?, nullableProxyApiType: Api2?) throws', + ), + ); + expect( + collapsedCode, + contains( + r'try api.pigeonDelegate.doSomething(pigeonApi: ' + r'api, pigeonInstance: pigeonInstanceArg, validType: validTypeArg, enumType: enumTypeArg, proxyApiType: ' + r'proxyApiTypeArg, nullableValidType: nullableValidTypeArg, nullableEnumType: nullableEnumTypeArg, nullableProxyApiType: ' + r'nullableProxyApiTypeArg)', + ), + ); + }); + + test('static method', () { + final Root root = Root( + apis: [ + AstProxyApi( + name: 'Api', + constructors: [], + fields: [], + methods: [ + Method( + name: 'doSomething', + location: ApiLocation.host, + isStatic: true, + parameters: [], + returnType: const TypeDeclaration.voidDeclaration(), + ), + ], + ), + ], + classes: [], + enums: [], + ); + final StringBuffer sink = StringBuffer(); + const SwiftGenerator generator = SwiftGenerator(); + generator.generate( + const SwiftOptions(), + root, + sink, + dartPackageName: DEFAULT_PACKAGE_NAME, + ); + final String code = sink.toString(); + final String collapsedCode = _collapseNewlineAndIndentation(code); + expect( + collapsedCode, + contains('func doSomething(pigeonApi: PigeonApiApi) throws'), + ); + expect( + collapsedCode, + contains(r'try api.pigeonDelegate.doSomething(pigeonApi: api)'), + ); + }); + }); + + group('Flutter methods', () { + test('multiple params flutter method', () { + final Enum anEnum = Enum( + name: 'AnEnum', + members: [EnumMember(name: 'one')], + ); + final Root root = Root(apis: [ + AstProxyApi( + name: 'Api', + constructors: [], + fields: [], + methods: [ + Method( + name: 'doSomething', + location: ApiLocation.flutter, + parameters: [ + Parameter( + type: const TypeDeclaration( + isNullable: false, + baseName: 'int', + ), + name: 'validType', + ), + Parameter( + type: TypeDeclaration( + isNullable: false, + baseName: 'AnEnum', + associatedEnum: anEnum, + ), + name: 'enumType', + ), + Parameter( + type: const TypeDeclaration( + isNullable: false, + baseName: 'Api2', + ), + name: 'proxyApiType', + ), + Parameter( + type: const TypeDeclaration( + isNullable: true, + baseName: 'int', + ), + name: 'nullableValidType', + ), + Parameter( + type: TypeDeclaration( + isNullable: true, + baseName: 'AnEnum', + associatedEnum: anEnum, + ), + name: 'nullableEnumType', + ), + Parameter( + type: const TypeDeclaration( + isNullable: true, + baseName: 'Api2', + ), + name: 'nullableProxyApiType', + ), + ], + returnType: const TypeDeclaration.voidDeclaration(), + ) + ]) + ], classes: [], enums: [ + anEnum + ]); + final StringBuffer sink = StringBuffer(); + const SwiftGenerator generator = SwiftGenerator(); + generator.generate( + const SwiftOptions(), + root, + sink, + dartPackageName: DEFAULT_PACKAGE_NAME, + ); + final String code = sink.toString(); + final String collapsedCode = _collapseNewlineAndIndentation(code); + expect( + collapsedCode, + contains( + 'func doSomething(pigeonInstance pigeonInstanceArg: Api, validType validTypeArg: Int64, enumType ' + 'enumTypeArg: AnEnum, proxyApiType proxyApiTypeArg: Api2, nullableValidType nullableValidTypeArg: Int64?, nullableEnumType ' + 'nullableEnumTypeArg: AnEnum?, nullableProxyApiType nullableProxyApiTypeArg: Api2?, ' + 'completion: @escaping (Result) -> Void)', + ), + ); + expect( + collapsedCode, + contains( + r'channel.sendMessage([pigeonInstanceArg, validTypeArg, ' + r'enumTypeArg, proxyApiTypeArg, nullableValidTypeArg, ' + r'nullableEnumTypeArg, nullableProxyApiTypeArg] as [Any?])', + ), + ); + }); + }); + }); +} + +/// Replaces a new line and the indentation with a single white space +/// +/// This +/// +/// ```dart +/// void method( +/// int param1, +/// int param2, +/// ) +/// ``` +/// +/// converts to +/// +/// ```dart +/// void method( int param1, int param2, ) +/// ``` +String _collapseNewlineAndIndentation(String string) { + final StringBuffer result = StringBuffer(); + for (final String line in string.split('\n')) { + result.write('${line.trimLeft()} '); + } + return result.toString().trim(); +} diff --git a/packages/pigeon/test/swift_generator_test.dart b/packages/pigeon/test/swift_generator_test.dart index b90db1e1f247..b9f7de5d356a 100644 --- a/packages/pigeon/test/swift_generator_test.dart +++ b/packages/pigeon/test/swift_generator_test.dart @@ -122,7 +122,7 @@ void main() { expect( code, contains( - 'let enumResultAsInt: Int? = nilOrValue(self.readValue() as? Int)')); + 'let enumResultAsInt: Int? = nilOrValue(self.readValue() as! Int?)')); expect(code, contains('return Foo(rawValue: enumResultAsInt)')); expect(code, contains('let fooArg = args[0] as! Foo')); expect(code, isNot(contains('if ('))); @@ -535,7 +535,7 @@ void main() { ); final String code = sink.toString(); expect(code, contains('struct Foobar')); - expect(code, contains('var field1: [AnyHashable: Any?]? = nil')); + expect(code, contains('var field1: [AnyHashable?: Any?]? = nil')); expect(code, isNot(contains('if ('))); }); @@ -1006,14 +1006,8 @@ void main() { final String code = sink.toString(); expect(code, contains('func add(x: Int64, y: Int64) throws -> Int64')); expect(code, contains('let args = message as! [Any?]')); - expect( - code, - contains( - 'let xArg = args[0] is Int64 ? args[0] as! Int64 : Int64(args[0] as! Int32)')); - expect( - code, - contains( - 'let yArg = args[1] is Int64 ? args[1] as! Int64 : Int64(args[1] as! Int32)')); + expect(code, contains('let xArg = args[0] as! Int64')); + expect(code, contains('let yArg = args[1] as! Int64')); expect(code, contains('let result = try api.add(x: xArg, y: yArg)')); expect(code, contains('reply(wrapResult(result))')); }); @@ -1049,10 +1043,7 @@ void main() { ); final String code = sink.toString(); expect(code, contains('let channel = FlutterBasicMessageChannel')); - expect( - code, - contains( - 'let result = listResponse[0] is Int64 ? listResponse[0] as! Int64 : Int64(listResponse[0] as! Int32)')); + expect(code, contains('let result = listResponse[0] as! Int64')); expect(code, contains('completion(.success(result))')); expect( code, @@ -1157,10 +1148,7 @@ void main() { dartPackageName: DEFAULT_PACKAGE_NAME, ); final String code = sink.toString(); - expect( - code, - contains( - 'let fooArg: Int64? = isNullish(args[0]) ? nil : (args[0] is Int64? ? args[0] as! Int64? : Int64(args[0] as! Int32))')); + expect(code, contains('let fooArg: Int64? = nilOrValue(args[0])')); }); test('nullable argument flutter', () { diff --git a/packages/pigeon/tool/shared/generation.dart b/packages/pigeon/tool/shared/generation.dart index 6fcb2d0567c8..4cee0d4de568 100644 --- a/packages/pigeon/tool/shared/generation.dart +++ b/packages/pigeon/tool/shared/generation.dart @@ -91,7 +91,8 @@ Future generateTestPigeons( ? 'FlutterError' : '${pascalCaseName}Error'; - final bool swiftErrorUseDefaultErrorName = input == 'core_tests'; + final bool swiftErrorUseDefaultErrorName = + input == 'core_tests' || input == 'background_platform_channels'; final String? swiftErrorClassName = swiftErrorUseDefaultErrorName ? null : '${pascalCaseName}Error'; @@ -117,6 +118,7 @@ Future generateTestPigeons( ? null : '$outputBase/ios/Classes/$pascalCaseName.gen.swift', swiftErrorClassName: swiftErrorClassName, + swiftIncludeErrorClass: input != 'core_tests', // Linux gobjectHeaderOut: skipLanguages.contains(GeneratorLanguage.gobject) ? null @@ -148,6 +150,7 @@ Future generateTestPigeons( ? null : '$outputBase/macos/Classes/$pascalCaseName.gen.swift', swiftErrorClassName: swiftErrorClassName, + swiftIncludeErrorClass: input != 'core_tests', suppressVersion: true, dartPackageName: 'pigeon_integration_tests', injectOverflowTypes: includeOverflow && input == 'core_tests', @@ -194,6 +197,7 @@ Future generateTestPigeons( objcSourceOut: skipLanguages.contains(GeneratorLanguage.objc) ? null : '$alternateOutputBase/macos/Classes/$pascalCaseName.gen.m', + objcPrefix: input == 'core_tests' ? 'FLT' : '', suppressVersion: true, dartPackageName: 'pigeon_integration_tests', injectOverflowTypes: includeOverflow && input == 'core_tests', @@ -211,6 +215,7 @@ Future runPigeon({ String? kotlinPackage, String? kotlinErrorClassName, bool kotlinIncludeErrorClass = true, + bool swiftIncludeErrorClass = true, String? swiftOut, String? swiftErrorClassName, String? cppHeaderOut, @@ -271,6 +276,7 @@ Future runPigeon({ swiftOut: swiftOut, swiftOptions: SwiftOptions( errorClassName: swiftErrorClassName, + includeErrorClass: swiftIncludeErrorClass, ), basePath: basePath, dartPackageName: dartPackageName, diff --git a/packages/plugin_platform_interface/pubspec.yaml b/packages/plugin_platform_interface/pubspec.yaml index ec739acff0e7..2285d41f9173 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.4 + mockito: ^5.4.4 test: ^1.16.0 topics: diff --git a/packages/quick_actions/quick_actions/CHANGELOG.md b/packages/quick_actions/quick_actions/CHANGELOG.md index 45390ea9ad9a..8a2bccc7641e 100644 --- a/packages/quick_actions/quick_actions/CHANGELOG.md +++ b/packages/quick_actions/quick_actions/CHANGELOG.md @@ -1,6 +1,7 @@ -## NEXT +## 1.0.8 * Updates minimum supported SDK version to Flutter 3.19/Dart 3.3. +* Adds reference to `quick_actions_android` README in the Android section of the README. ## 1.0.7 diff --git a/packages/quick_actions/quick_actions/README.md b/packages/quick_actions/quick_actions/README.md index ad9b2a8c3b97..d776be2a3bf7 100644 --- a/packages/quick_actions/quick_actions/README.md +++ b/packages/quick_actions/quick_actions/README.md @@ -52,3 +52,6 @@ If the drawables used as icons are not referenced other than in your Dart code, you may need to [explicitly mark them to be kept](https://developer.android.com/studio/build/shrink-code#keep-resources) to ensure that they will be available for use in release builds. + +For more information on using this package on Android, see the +[`quick_actions_android` README](https://github.com/flutter/packages/blob/main/packages/quick_actions/quick_actions_android/README.md). 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..d951fac2bf31 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-8.7-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/packages/quick_actions/quick_actions/example/android/build.gradle b/packages/quick_actions/quick_actions/example/android/build.gradle index cec92de922cf..0bed8906c094 100644 --- a/packages/quick_actions/quick_actions/example/android/build.gradle +++ b/packages/quick_actions/quick_actions/example/android/build.gradle @@ -5,7 +5,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:7.4.2' + classpath 'com.android.tools.build:gradle:8.5.2' } } 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..3c85cfe057a1 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-8.7-all.zip diff --git a/packages/quick_actions/quick_actions/example/pubspec.yaml b/packages/quick_actions/quick_actions/example/pubspec.yaml index 6197b83d503c..7573f5bbf814 100644 --- a/packages/quick_actions/quick_actions/example/pubspec.yaml +++ b/packages/quick_actions/quick_actions/example/pubspec.yaml @@ -18,7 +18,7 @@ dependencies: path: ../ dev_dependencies: - espresso: ^0.2.0 + espresso: ^0.4.0 flutter_test: sdk: flutter integration_test: diff --git a/packages/quick_actions/quick_actions/pubspec.yaml b/packages/quick_actions/quick_actions/pubspec.yaml index 53a1a6a5e33c..65db456231d6 100644 --- a/packages/quick_actions/quick_actions/pubspec.yaml +++ b/packages/quick_actions/quick_actions/pubspec.yaml @@ -3,7 +3,7 @@ description: Flutter plugin for creating shortcuts on home screen, also known as Quick Actions on iOS and App Shortcuts on Android. repository: https://github.com/flutter/packages/tree/main/packages/quick_actions/quick_actions issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+quick_actions%22 -version: 1.0.7 +version: 1.0.8 environment: sdk: ^3.3.0 @@ -29,7 +29,7 @@ dev_dependencies: sdk: flutter integration_test: sdk: flutter - mockito: 5.4.4 + mockito: ^5.4.4 plugin_platform_interface: ^2.1.7 topics: diff --git a/packages/quick_actions/quick_actions_android/CHANGELOG.md b/packages/quick_actions/quick_actions_android/CHANGELOG.md index 4ac6505b6131..4ea1b250ffbe 100644 --- a/packages/quick_actions/quick_actions_android/CHANGELOG.md +++ b/packages/quick_actions/quick_actions_android/CHANGELOG.md @@ -1,3 +1,17 @@ +## 1.0.18 + +* Updates Java compatibility version to 11. +* Updates minimum supported SDK version to Flutter 3.24/Dart 3.5. + +## 1.0.17 + +* Updates README to include more specific context on how to use launcher activities, including + a full explanation for https://github.com/flutter/flutter/issues/152883. + +## 1.0.16 + +* Updates README to include guidance on using the plugin with a launcher activity. + ## 1.0.15 * Updates lint checks to ignore NewerVersionAvailable. diff --git a/packages/quick_actions/quick_actions_android/README.md b/packages/quick_actions/quick_actions_android/README.md index cb4a8e08826a..a952e3840adf 100644 --- a/packages/quick_actions/quick_actions_android/README.md +++ b/packages/quick_actions/quick_actions_android/README.md @@ -11,6 +11,69 @@ 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. +## Usage with launcher activities + +If you have an activity that launches a `FlutterActivity` (this is +`MainActivity.java`/`MainActivity.kt` by default), then you might need to +modify the launch configuration of that activity to have the back press +behavior and task back stack that you expect. Common use cases of having +such a launcher activity are in an add to app project or if your Flutter +project contains multiple Android activities. + +For example, consider the case where you have two different quick actions +shortcuts for your app and a launcher activity that launches the +`FlutterActivity`. If the launcher activity uses the [`singleTop`][4] launch +mode (as Flutter's default `MainActivity.java`/`MainActivity.kt` do by default) +and the user + +1. Launches your app from the first shortcut +2. Moves your app into the background by exiting the app +3. Re-launches your app from the second shortcut + +then the user will see what the first shortcut launched, not what the second +shortcut was supposed to launch. To fix this, you may set the launch mode of +the launcher activity to `singleInstance` (see [Android documentation][5] for +more information on this mode) in +`your_app/android/app/src/mainAndroidManifest.xml`: + +```xml + +``` + +See [this issue][6] for more context on this exact scenario and its solution. + +Depending on your use case, you may additionally need to set the proper launch +mode `Intent` flags in the `Intent` that launches the `FlutterActivity` to +achieve your expected back press behavior and task back stack. For example, +if `MainActivity.java` is the `FlutterActivity` that your launcher activity +launches: + +```java +public final class LauncherActivity extends Activity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + Intent mainActivityIntent = new Intent(this, MainActivity.class); + mainActivityIntent.putExtras(getIntent()); + + // Add any additional launch mode Intent flags you need: + mainActivityIntent.addFlags(...); + + startActivity(mainActivityIntent); + finish(); + } + + ... +} +``` + +See [Tasks and the back stack][5] for more documentation about the different +launch modes and related `Intent` flags that Android provides. + ## Contributing If you would like to contribute to the plugin, check out our [contribution guide][3]. @@ -18,3 +81,6 @@ If you would like to contribute to the plugin, check out our [contribution guide [1]: https://pub.dev/packages/quick_actions [2]: https://flutter.dev/to/endorsed-federated-plugin [3]: https://github.com/flutter/packages/blob/main/CONTRIBUTING.md +[4]: https://developer.android.com/reference/android/content/Intent?authuser=1#FLAG_ACTIVITY_SINGLE_TOP +[5]: https://developer.android.com/guide/components/activities/tasks-and-back-stack#TaskLaunchModes +[6]: https://github.com/flutter/flutter/issues/152883#issuecomment-2305906933 diff --git a/packages/quick_actions/quick_actions_android/android/build.gradle b/packages/quick_actions/quick_actions_android/android/build.gradle index 985f63590bcf..2fbf82af56c2 100644 --- a/packages/quick_actions/quick_actions_android/android/build.gradle +++ b/packages/quick_actions/quick_actions_android/android/build.gradle @@ -22,10 +22,7 @@ rootProject.allprojects { apply plugin: 'com.android.library' android { - // Conditional for compatibility with AGP <4.2. - if (project.android.hasProperty("namespace")) { - namespace 'io.flutter.plugins.quickactions' - } + namespace 'io.flutter.plugins.quickactions' compileSdk 34 defaultConfig { @@ -44,8 +41,8 @@ android { } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_11 + targetCompatibility JavaVersion.VERSION_11 } testOptions { diff --git a/packages/quick_actions/quick_actions_android/example/android/app/build.gradle b/packages/quick_actions/quick_actions_android/example/android/app/build.gradle index 82f0366b547f..77500a2b47db 100644 --- a/packages/quick_actions/quick_actions_android/example/android/app/build.gradle +++ b/packages/quick_actions/quick_actions_android/example/android/app/build.gradle @@ -34,7 +34,7 @@ android { defaultConfig { applicationId "io.flutter.plugins.quickactionsexample" minSdkVersion 21 - targetSdkVersion 28 + targetSdkVersion 34 versionCode flutterVersionCode.toInteger() versionName flutterVersionName testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 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..d951fac2bf31 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-8.7-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/packages/quick_actions/quick_actions_android/example/android/app/src/main/AndroidManifest.xml b/packages/quick_actions/quick_actions_android/example/android/app/src/main/AndroidManifest.xml index 20969735d866..ff8a4d06bf42 100644 --- a/packages/quick_actions/quick_actions_android/example/android/app/src/main/AndroidManifest.xml +++ b/packages/quick_actions/quick_actions_android/example/android/app/src/main/AndroidManifest.xml @@ -5,6 +5,7 @@ =3.22.0" + sdk: ^3.5.0 + flutter: ">=3.24.0" dependencies: flutter: @@ -18,7 +18,7 @@ dependencies: path: ../ dev_dependencies: - espresso: ^0.2.0 + espresso: ^0.4.0 flutter_test: sdk: flutter integration_test: diff --git a/packages/quick_actions/quick_actions_android/pubspec.yaml b/packages/quick_actions/quick_actions_android/pubspec.yaml index 0ac026ee529b..cf6cb0fbb5ce 100644 --- a/packages/quick_actions/quick_actions_android/pubspec.yaml +++ b/packages/quick_actions/quick_actions_android/pubspec.yaml @@ -2,11 +2,11 @@ name: quick_actions_android description: An implementation for the Android platform of the Flutter `quick_actions` plugin. repository: https://github.com/flutter/packages/tree/main/packages/quick_actions/quick_actions_android issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+in_app_purchase%22 -version: 1.0.15 +version: 1.0.18 environment: - sdk: ^3.4.0 - flutter: ">=3.22.0" + sdk: ^3.5.0 + flutter: ">=3.24.0" flutter: plugin: diff --git a/packages/quick_actions/quick_actions_platform_interface/pubspec.yaml b/packages/quick_actions/quick_actions_platform_interface/pubspec.yaml index 1fde9565b015..c9c05c64702f 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.4 + mockito: ^5.4.4 topics: - quick-actions diff --git a/packages/rfw/example/hello/android/app/build.gradle b/packages/rfw/example/hello/android/app/build.gradle index 100a64244e12..5f291d55b6b2 100644 --- a/packages/rfw/example/hello/android/app/build.gradle +++ b/packages/rfw/example/hello/android/app/build.gradle @@ -30,12 +30,12 @@ android { compileSdk flutter.compileSdkVersion compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_11 + targetCompatibility JavaVersion.VERSION_11 } kotlinOptions { - jvmTarget = '1.8' + jvmTarget = '11' } sourceSets { diff --git a/packages/rfw/example/hello/android/build.gradle b/packages/rfw/example/hello/android/build.gradle index 8a2e9e183dd7..cd70ddd54b1e 100644 --- a/packages/rfw/example/hello/android/build.gradle +++ b/packages/rfw/example/hello/android/build.gradle @@ -6,7 +6,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:7.4.2' + classpath 'com.android.tools.build:gradle:8.1.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } 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..7aeeb11c6ee5 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-8.7-all.zip diff --git a/packages/rfw/example/local/android/app/build.gradle b/packages/rfw/example/local/android/app/build.gradle index 5bbaeffa4b31..0482ab4b404f 100644 --- a/packages/rfw/example/local/android/app/build.gradle +++ b/packages/rfw/example/local/android/app/build.gradle @@ -30,12 +30,12 @@ android { compileSdk flutter.compileSdkVersion compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_11 + targetCompatibility JavaVersion.VERSION_11 } kotlinOptions { - jvmTarget = '1.8' + jvmTarget = '11' } sourceSets { diff --git a/packages/rfw/example/local/android/build.gradle b/packages/rfw/example/local/android/build.gradle index 8a2e9e183dd7..fa0c3b56c2a4 100644 --- a/packages/rfw/example/local/android/build.gradle +++ b/packages/rfw/example/local/android/build.gradle @@ -6,7 +6,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:7.4.2' + classpath 'com.android.tools.build:gradle:8.5.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } 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..7aeeb11c6ee5 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-8.7-all.zip diff --git a/packages/rfw/example/remote/android/app/build.gradle b/packages/rfw/example/remote/android/app/build.gradle index 8ece05d61c0c..c0ae2d992f75 100644 --- a/packages/rfw/example/remote/android/app/build.gradle +++ b/packages/rfw/example/remote/android/app/build.gradle @@ -30,12 +30,12 @@ android { compileSdk flutter.compileSdkVersion compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_11 + targetCompatibility JavaVersion.VERSION_11 } kotlinOptions { - jvmTarget = '1.8' + jvmTarget = '11' } sourceSets { diff --git a/packages/rfw/example/remote/android/build.gradle b/packages/rfw/example/remote/android/build.gradle index 8a2e9e183dd7..31b11cccd4e1 100644 --- a/packages/rfw/example/remote/android/build.gradle +++ b/packages/rfw/example/remote/android/build.gradle @@ -6,7 +6,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:7.4.2' + classpath 'com.android.tools.build:gradle:8.5.2' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } 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..7aeeb11c6ee5 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-8.7-all.zip diff --git a/packages/rfw/lib/src/dart/text.dart b/packages/rfw/lib/src/dart/text.dart index d6bdb1dda13b..2dc82c0283b5 100644 --- a/packages/rfw/lib/src/dart/text.dart +++ b/packages/rfw/lib/src/dart/text.dart @@ -2065,7 +2065,6 @@ Iterable<_Token> _tokenize(String file) sync* { default: // ignored, comment mode = _TokenizerMode.blockComment; - break; } } } diff --git a/packages/rfw/test/argument_decoders_test.dart b/packages/rfw/test/argument_decoders_test.dart index 40ed880aa2ba..7da1e01aae71 100644 --- a/packages/rfw/test/argument_decoders_test.dart +++ b/packages/rfw/test/argument_decoders_test.dart @@ -392,7 +392,7 @@ void main() { expect( (tester.widgetList(find.byType(DecoratedBox)).toList()[0].decoration as BoxDecoration).image.toString(), 'DecorationImage(NetworkImage("x-invalid://", scale: 1.0), ' - 'ColorFilter.mode(Color(0xff8811ff), BlendMode.xor), Alignment.center, scale 1.0, ' + 'ColorFilter.mode(${const Color(0xff8811ff)}, BlendMode.xor), Alignment.center, scale 1.0, ' 'opacity 1.0, FilterQuality.high)', ); diff --git a/packages/rfw/test/material_widgets_test.dart b/packages/rfw/test/material_widgets_test.dart index 0bd9111f6356..648d7249d0fb 100644 --- a/packages/rfw/test/material_widgets_test.dart +++ b/packages/rfw/test/material_widgets_test.dart @@ -9,6 +9,8 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:rfw/formats.dart' show parseLibraryFile; import 'package:rfw/rfw.dart'; +import 'tolerant_comparator.dart' + if (dart.library.js_interop) 'tolerant_comparator_web.dart'; import 'utils.dart'; void main() { @@ -22,6 +24,13 @@ void main() { ..update(materialName, createMaterialWidgets()); } + setUpAll(() { + setUpTolerantComparator( + testPath: 'test/material_widget_test.dart', + precisionTolerance: 0.00002, + ); + }); + testWidgets('Material widgets', (WidgetTester tester) async { final Runtime runtime = setupRuntime(); final DynamicContent data = DynamicContent(); diff --git a/packages/rfw/test/tolerant_comparator.dart b/packages/rfw/test/tolerant_comparator.dart new file mode 100644 index 000000000000..0c8cbee97c3a --- /dev/null +++ b/packages/rfw/test/tolerant_comparator.dart @@ -0,0 +1,56 @@ +// 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'; +import 'package:flutter_test/flutter_test.dart'; + +/// Sets [_TolerantGoldenFileComparator] as the default golden file comparator +/// in tests. +void setUpTolerantComparator( + {required String testPath, required double precisionTolerance}) { + final GoldenFileComparator oldComparator = goldenFileComparator; + final _TolerantGoldenFileComparator newComparator = + _TolerantGoldenFileComparator(Uri.parse(testPath), + precisionTolerance: precisionTolerance); + + goldenFileComparator = newComparator; + + addTearDown(() => goldenFileComparator = oldComparator); +} + +class _TolerantGoldenFileComparator extends LocalFileComparator { + _TolerantGoldenFileComparator( + super.testFile, { + required double precisionTolerance, + }) : assert( + 0 <= precisionTolerance && precisionTolerance <= 1, + 'precisionTolerance must be between 0 and 1', + ), + _precisionTolerance = precisionTolerance; + + /// How much the golden image can differ from the test image. + /// + /// It is expected to be between 0 and 1. Where 0 is no difference (the same image) + /// and 1 is the maximum difference (completely different images). + final double _precisionTolerance; + + @override + Future compare(Uint8List imageBytes, Uri golden) async { + final ComparisonResult result = await GoldenFileComparator.compareLists( + imageBytes, + await getGoldenBytes(golden), + ); + + final bool passed = + result.passed || result.diffPercent <= _precisionTolerance; + if (passed) { + result.dispose(); + return true; + } + + final String error = await generateFailureOutput(result, golden, basedir); + result.dispose(); + throw FlutterError(error); + } +} diff --git a/packages/rfw/test/tolerant_comparator_web.dart b/packages/rfw/test/tolerant_comparator_web.dart new file mode 100644 index 000000000000..7de664968712 --- /dev/null +++ b/packages/rfw/test/tolerant_comparator_web.dart @@ -0,0 +1,6 @@ +// 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. + +void setUpTolerantComparator( + {required String testPath, required double precisionTolerance}) {} diff --git a/packages/shared_preferences/shared_preferences/CHANGELOG.md b/packages/shared_preferences/shared_preferences/CHANGELOG.md index 1485ff0369a2..717cfdcd80d7 100644 --- a/packages/shared_preferences/shared_preferences/CHANGELOG.md +++ b/packages/shared_preferences/shared_preferences/CHANGELOG.md @@ -1,7 +1,7 @@ -## NEXT +## 2.3.2 +* Removes outdated testing information from README. * Updates minimum supported SDK version to Flutter 3.22/Dart 3.4. -* Updates minimum supported SDK version to Flutter 3.19/Dart 3.3. ## 2.3.1 diff --git a/packages/shared_preferences/shared_preferences/README.md b/packages/shared_preferences/shared_preferences/README.md index 3fe18448dd3b..520de19323cc 100644 --- a/packages/shared_preferences/shared_preferences/README.md +++ b/packages/shared_preferences/shared_preferences/README.md @@ -183,18 +183,6 @@ If you have been using `SharedPreferences` with the default prefix but wish to c to a new prefix, you will need to transform your current preferences manually to add the new prefix otherwise the old preferences will be inaccessible. -### Testing - -In tests, you can replace the standard `SharedPreferences` implementation with -a mock implementation with initial values. This implementation is in-memory -only, and will not persist values to the usual preference store. - - -```dart -final Map values = {'counter': 1}; -SharedPreferences.setMockInitialValues(values); -``` - ### Storage location by platform | Platform | SharedPreferences | SharedPreferencesAsync/WithCache | diff --git a/packages/shared_preferences/shared_preferences/example/android/build.gradle b/packages/shared_preferences/shared_preferences/example/android/build.gradle index d13ef556e261..5cf1eb221426 100644 --- a/packages/shared_preferences/shared_preferences/example/android/build.gradle +++ b/packages/shared_preferences/shared_preferences/example/android/build.gradle @@ -6,7 +6,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:7.4.2' + classpath 'com.android.tools.build:gradle:8.5.2' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } 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..7aeeb11c6ee5 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-8.7-all.zip diff --git a/packages/shared_preferences/shared_preferences/example/integration_test/shared_preferences_test.dart b/packages/shared_preferences/shared_preferences/example/integration_test/shared_preferences_test.dart index 07cd53e4d818..504ad899e187 100644 --- a/packages/shared_preferences/shared_preferences/example/integration_test/shared_preferences_test.dart +++ b/packages/shared_preferences/shared_preferences/example/integration_test/shared_preferences_test.dart @@ -218,6 +218,15 @@ void main() { expect(await preferences.getStringList(listKey), testList); }); + testWidgets('getStringList returns mutable list', (WidgetTester _) async { + final SharedPreferencesAsync preferences = await getPreferences(); + + await preferences.setStringList(listKey, testList); + final List? list = await preferences.getStringList(listKey); + list?.add('value'); + expect(list?.length, testList.length + 1); + }); + testWidgets('getAll', (WidgetTester _) async { final SharedPreferencesAsync preferences = await getPreferences(); await Future.wait(>[ diff --git a/packages/shared_preferences/shared_preferences/pubspec.yaml b/packages/shared_preferences/shared_preferences/pubspec.yaml index 091c7548292d..cbe53e8d2bef 100644 --- a/packages/shared_preferences/shared_preferences/pubspec.yaml +++ b/packages/shared_preferences/shared_preferences/pubspec.yaml @@ -3,7 +3,7 @@ description: Flutter plugin for reading and writing simple key-value pairs. Wraps NSUserDefaults on iOS and SharedPreferences on Android. repository: https://github.com/flutter/packages/tree/main/packages/shared_preferences/shared_preferences issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+shared_preferences%22 -version: 2.3.1 +version: 2.3.2 environment: sdk: ^3.4.0 diff --git a/packages/shared_preferences/shared_preferences_android/CHANGELOG.md b/packages/shared_preferences/shared_preferences_android/CHANGELOG.md index e37c4f051d28..8061930e0310 100644 --- a/packages/shared_preferences/shared_preferences_android/CHANGELOG.md +++ b/packages/shared_preferences/shared_preferences_android/CHANGELOG.md @@ -1,3 +1,12 @@ +## 2.3.3 + +* Updates Java compatibility version to 11. +* Updates minimum supported SDK version to Flutter 3.24/Dart 3.5. + +## 2.3.2 + +* Bumps `com.android.tools.build:gradle` from 7.2.2 to 8.5.1. + ## 2.3.1 * Fixes `getStringList` returning immutable list. diff --git a/packages/shared_preferences/shared_preferences_android/android/build.gradle b/packages/shared_preferences/shared_preferences_android/android/build.gradle index 11095a1352f0..05eab6f253fb 100644 --- a/packages/shared_preferences/shared_preferences_android/android/build.gradle +++ b/packages/shared_preferences/shared_preferences_android/android/build.gradle @@ -9,7 +9,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:7.2.2' + classpath 'com.android.tools.build:gradle:8.5.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } @@ -33,19 +33,16 @@ apply plugin: 'com.android.library' apply plugin: 'kotlin-android' android { - // Conditional for compatibility with AGP <4.2. - if (project.android.hasProperty("namespace")) { - namespace 'io.flutter.plugins.sharedpreferences' - } + namespace 'io.flutter.plugins.sharedpreferences' compileSdk 34 compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_11 + targetCompatibility JavaVersion.VERSION_11 } kotlinOptions { - jvmTarget = '1.8' + jvmTarget = '11' } sourceSets { diff --git a/packages/shared_preferences/shared_preferences_android/example/android/app/build.gradle b/packages/shared_preferences/shared_preferences_android/example/android/app/build.gradle index 5e851db693ed..b1b30a992781 100644 --- a/packages/shared_preferences/shared_preferences_android/example/android/app/build.gradle +++ b/packages/shared_preferences/shared_preferences_android/example/android/app/build.gradle @@ -36,7 +36,7 @@ android { defaultConfig { applicationId "io.flutter.plugins.sharedpreferencesexample" minSdkVersion flutter.minSdkVersion - targetSdkVersion 30 + targetSdkVersion 34 versionCode flutterVersionCode.toInteger() versionName flutterVersionName testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" diff --git a/packages/shared_preferences/shared_preferences_android/example/android/app/src/main/AndroidManifest.xml b/packages/shared_preferences/shared_preferences_android/example/android/app/src/main/AndroidManifest.xml index fa56bc45d88c..4288e93f875d 100644 --- a/packages/shared_preferences/shared_preferences_android/example/android/app/src/main/AndroidManifest.xml +++ b/packages/shared_preferences/shared_preferences_android/example/android/app/src/main/AndroidManifest.xml @@ -5,6 +5,7 @@ android:icon="@mipmap/ic_launcher"> =3.22.0" + sdk: ^3.5.0 + flutter: ">=3.24.0" dependencies: flutter: diff --git a/packages/shared_preferences/shared_preferences_android/pubspec.yaml b/packages/shared_preferences/shared_preferences_android/pubspec.yaml index f86a08afdc6d..d874a9b8b676 100644 --- a/packages/shared_preferences/shared_preferences_android/pubspec.yaml +++ b/packages/shared_preferences/shared_preferences_android/pubspec.yaml @@ -2,11 +2,11 @@ name: shared_preferences_android description: Android implementation of the shared_preferences plugin repository: https://github.com/flutter/packages/tree/main/packages/shared_preferences/shared_preferences_android issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+shared_preferences%22 -version: 2.3.1 +version: 2.3.3 environment: - sdk: ^3.4.0 - flutter: ">=3.22.0" + sdk: ^3.5.0 + flutter: ">=3.24.0" flutter: plugin: diff --git a/packages/shared_preferences/shared_preferences_foundation/CHANGELOG.md b/packages/shared_preferences/shared_preferences_foundation/CHANGELOG.md index 4fb4e5381c2d..42722fe4b182 100644 --- a/packages/shared_preferences/shared_preferences_foundation/CHANGELOG.md +++ b/packages/shared_preferences/shared_preferences_foundation/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.5.3 + +* Updates Pigeon for non-nullable collection type support. + ## 2.5.2 * Fixes getting all preferences when suite name is used. diff --git a/packages/shared_preferences/shared_preferences_foundation/darwin/shared_preferences_foundation/Sources/shared_preferences_foundation/SharedPreferencesPlugin.swift b/packages/shared_preferences/shared_preferences_foundation/darwin/shared_preferences_foundation/Sources/shared_preferences_foundation/SharedPreferencesPlugin.swift index 71602ab21e9c..5fdf2e9960f6 100644 --- a/packages/shared_preferences/shared_preferences_foundation/darwin/shared_preferences_foundation/Sources/shared_preferences_foundation/SharedPreferencesPlugin.swift +++ b/packages/shared_preferences/shared_preferences_foundation/darwin/shared_preferences_foundation/Sources/shared_preferences_foundation/SharedPreferencesPlugin.swift @@ -25,7 +25,7 @@ public class LegacySharedPreferencesPlugin: NSObject, FlutterPlugin, LegacyUserD LegacyUserDefaultsApiSetup.setUp(binaryMessenger: messenger, api: instance) } - func getAll(prefix: String, allowList: [String]?) -> [String?: Any?] { + func getAll(prefix: String, allowList: [String]?) -> [String: Any] { return getAllPrefs(prefix: prefix, allowList: allowList) } diff --git a/packages/shared_preferences/shared_preferences_foundation/darwin/shared_preferences_foundation/Sources/shared_preferences_foundation/messages.g.swift b/packages/shared_preferences/shared_preferences_foundation/darwin/shared_preferences_foundation/Sources/shared_preferences_foundation/messages.g.swift index 1c843a6522ca..275de0921d50 100644 --- a/packages/shared_preferences/shared_preferences_foundation/darwin/shared_preferences_foundation/Sources/shared_preferences_foundation/messages.g.swift +++ b/packages/shared_preferences/shared_preferences_foundation/darwin/shared_preferences_foundation/Sources/shared_preferences_foundation/messages.g.swift @@ -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 (v16.0.5), do not edit directly. +// Autogenerated from Pigeon (v22.4.1), do not edit directly. // See also: https://pub.dev/packages/pigeon import Foundation @@ -14,11 +14,36 @@ import Foundation #error("Unsupported platform.") #endif +/// Error class for passing custom error details to Dart side. +final class PigeonError: Error { + let code: String + let message: String? + let details: Any? + + init(code: String, message: String?, details: Any?) { + self.code = code + self.message = message + self.details = details + } + + var localizedDescription: String { + return + "PigeonError(code: \(code), message: \(message ?? ""), details: \(details ?? "")" + } +} + private func wrapResult(_ result: Any?) -> [Any?] { return [result] } private func wrapError(_ error: Any) -> [Any?] { + if let pigeonError = error as? PigeonError { + return [ + pigeonError.code, + pigeonError.message, + pigeonError.details, + ] + } if let flutterError = error as? FlutterError { return [ flutterError.code, @@ -46,8 +71,9 @@ private func nilOrValue(_ value: Any?) -> T? { struct SharedPreferencesPigeonOptions { var suiteName: String? = nil - static func fromList(_ list: [Any?]) -> SharedPreferencesPigeonOptions? { - let suiteName: String? = nilOrValue(list[0]) + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> SharedPreferencesPigeonOptions? { + let suiteName: String? = nilOrValue(pigeonVar_list[0]) return SharedPreferencesPigeonOptions( suiteName: suiteName @@ -59,10 +85,11 @@ struct SharedPreferencesPigeonOptions { ] } } -private class LegacyUserDefaultsApiCodecReader: FlutterStandardReader { + +private class messagesPigeonCodecReader: FlutterStandardReader { override func readValue(ofType type: UInt8) -> Any? { switch type { - case 128: + case 129: return SharedPreferencesPigeonOptions.fromList(self.readValue() as! [Any?]) default: return super.readValue(ofType: type) @@ -70,10 +97,10 @@ private class LegacyUserDefaultsApiCodecReader: FlutterStandardReader { } } -private class LegacyUserDefaultsApiCodecWriter: FlutterStandardWriter { +private class messagesPigeonCodecWriter: FlutterStandardWriter { override func writeValue(_ value: Any) { if let value = value as? SharedPreferencesPigeonOptions { - super.writeByte(128) + super.writeByte(129) super.writeValue(value.toList()) } else { super.writeValue(value) @@ -81,19 +108,18 @@ private class LegacyUserDefaultsApiCodecWriter: FlutterStandardWriter { } } -private class LegacyUserDefaultsApiCodecReaderWriter: FlutterStandardReaderWriter { +private class messagesPigeonCodecReaderWriter: FlutterStandardReaderWriter { override func reader(with data: Data) -> FlutterStandardReader { - return LegacyUserDefaultsApiCodecReader(data: data) + return messagesPigeonCodecReader(data: data) } override func writer(with data: NSMutableData) -> FlutterStandardWriter { - return LegacyUserDefaultsApiCodecWriter(data: data) + return messagesPigeonCodecWriter(data: data) } } -class LegacyUserDefaultsApiCodec: FlutterStandardMessageCodec { - static let shared = LegacyUserDefaultsApiCodec( - readerWriter: LegacyUserDefaultsApiCodecReaderWriter()) +class messagesPigeonCodec: FlutterStandardMessageCodec, @unchecked Sendable { + static let shared = messagesPigeonCodec(readerWriter: messagesPigeonCodecReaderWriter()) } /// Generated protocol from Pigeon that represents a handler of messages from Flutter. @@ -102,18 +128,22 @@ protocol LegacyUserDefaultsApi { func setBool(key: String, value: Bool) throws func setDouble(key: String, value: Double) throws func setValue(key: String, value: Any) throws - func getAll(prefix: String, allowList: [String]?) throws -> [String?: Any?] + func getAll(prefix: String, allowList: [String]?) throws -> [String: Any] func clear(prefix: String, allowList: [String]?) throws -> Bool } /// Generated setup class from Pigeon to handle messages through the `binaryMessenger`. class LegacyUserDefaultsApiSetup { - /// The codec used by LegacyUserDefaultsApi. - static var codec: FlutterStandardMessageCodec { LegacyUserDefaultsApiCodec.shared } + static var codec: FlutterStandardMessageCodec { messagesPigeonCodec.shared } /// Sets up an instance of `LegacyUserDefaultsApi` to handle messages through the `binaryMessenger`. - static func setUp(binaryMessenger: FlutterBinaryMessenger, api: LegacyUserDefaultsApi?) { + static func setUp( + binaryMessenger: FlutterBinaryMessenger, api: LegacyUserDefaultsApi?, + messageChannelSuffix: String = "" + ) { + let channelSuffix = messageChannelSuffix.count > 0 ? ".\(messageChannelSuffix)" : "" let removeChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.shared_preferences_foundation.LegacyUserDefaultsApi.remove", + name: + "dev.flutter.pigeon.shared_preferences_foundation.LegacyUserDefaultsApi.remove\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { removeChannel.setMessageHandler { message, reply in @@ -130,7 +160,8 @@ class LegacyUserDefaultsApiSetup { removeChannel.setMessageHandler(nil) } let setBoolChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.shared_preferences_foundation.LegacyUserDefaultsApi.setBool", + name: + "dev.flutter.pigeon.shared_preferences_foundation.LegacyUserDefaultsApi.setBool\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { setBoolChannel.setMessageHandler { message, reply in @@ -148,7 +179,8 @@ class LegacyUserDefaultsApiSetup { setBoolChannel.setMessageHandler(nil) } let setDoubleChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.shared_preferences_foundation.LegacyUserDefaultsApi.setDouble", + name: + "dev.flutter.pigeon.shared_preferences_foundation.LegacyUserDefaultsApi.setDouble\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { setDoubleChannel.setMessageHandler { message, reply in @@ -166,7 +198,8 @@ class LegacyUserDefaultsApiSetup { setDoubleChannel.setMessageHandler(nil) } let setValueChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.shared_preferences_foundation.LegacyUserDefaultsApi.setValue", + name: + "dev.flutter.pigeon.shared_preferences_foundation.LegacyUserDefaultsApi.setValue\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { setValueChannel.setMessageHandler { message, reply in @@ -184,7 +217,8 @@ class LegacyUserDefaultsApiSetup { setValueChannel.setMessageHandler(nil) } let getAllChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.shared_preferences_foundation.LegacyUserDefaultsApi.getAll", + name: + "dev.flutter.pigeon.shared_preferences_foundation.LegacyUserDefaultsApi.getAll\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { getAllChannel.setMessageHandler { message, reply in @@ -202,7 +236,8 @@ class LegacyUserDefaultsApiSetup { getAllChannel.setMessageHandler(nil) } let clearChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.shared_preferences_foundation.LegacyUserDefaultsApi.clear", + name: + "dev.flutter.pigeon.shared_preferences_foundation.LegacyUserDefaultsApi.clear\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { clearChannel.setMessageHandler { message, reply in @@ -221,42 +256,6 @@ class LegacyUserDefaultsApiSetup { } } } -private class UserDefaultsApiCodecReader: FlutterStandardReader { - override func readValue(ofType type: UInt8) -> Any? { - switch type { - case 128: - return SharedPreferencesPigeonOptions.fromList(self.readValue() as! [Any?]) - default: - return super.readValue(ofType: type) - } - } -} - -private class UserDefaultsApiCodecWriter: FlutterStandardWriter { - override func writeValue(_ value: Any) { - if let value = value as? SharedPreferencesPigeonOptions { - super.writeByte(128) - super.writeValue(value.toList()) - } else { - super.writeValue(value) - } - } -} - -private class UserDefaultsApiCodecReaderWriter: FlutterStandardReaderWriter { - override func reader(with data: Data) -> FlutterStandardReader { - return UserDefaultsApiCodecReader(data: data) - } - - override func writer(with data: NSMutableData) -> FlutterStandardWriter { - return UserDefaultsApiCodecWriter(data: data) - } -} - -class UserDefaultsApiCodec: FlutterStandardMessageCodec { - static let shared = UserDefaultsApiCodec(readerWriter: UserDefaultsApiCodecReaderWriter()) -} - /// Generated protocol from Pigeon that represents a handler of messages from Flutter. protocol UserDefaultsApi { /// Adds property to shared preferences data set of type String. @@ -273,13 +272,16 @@ protocol UserDefaultsApi { /// Generated setup class from Pigeon to handle messages through the `binaryMessenger`. class UserDefaultsApiSetup { - /// The codec used by UserDefaultsApi. - static var codec: FlutterStandardMessageCodec { UserDefaultsApiCodec.shared } + static var codec: FlutterStandardMessageCodec { messagesPigeonCodec.shared } /// Sets up an instance of `UserDefaultsApi` to handle messages through the `binaryMessenger`. - static func setUp(binaryMessenger: FlutterBinaryMessenger, api: UserDefaultsApi?) { + static func setUp( + binaryMessenger: FlutterBinaryMessenger, api: UserDefaultsApi?, + messageChannelSuffix: String = "" + ) { + let channelSuffix = messageChannelSuffix.count > 0 ? ".\(messageChannelSuffix)" : "" /// Adds property to shared preferences data set of type String. let setChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.shared_preferences_foundation.UserDefaultsApi.set", + name: "dev.flutter.pigeon.shared_preferences_foundation.UserDefaultsApi.set\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { setChannel.setMessageHandler { message, reply in @@ -299,7 +301,8 @@ class UserDefaultsApiSetup { } /// Removes all properties from shared preferences data set with matching prefix. let clearChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.shared_preferences_foundation.UserDefaultsApi.clear", + name: + "dev.flutter.pigeon.shared_preferences_foundation.UserDefaultsApi.clear\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { clearChannel.setMessageHandler { message, reply in @@ -318,7 +321,8 @@ class UserDefaultsApiSetup { } /// Gets all properties from shared preferences data set with matching prefix. let getAllChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.shared_preferences_foundation.UserDefaultsApi.getAll", + name: + "dev.flutter.pigeon.shared_preferences_foundation.UserDefaultsApi.getAll\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { getAllChannel.setMessageHandler { message, reply in @@ -337,7 +341,8 @@ class UserDefaultsApiSetup { } /// Gets individual value stored with [key], if any. let getValueChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.shared_preferences_foundation.UserDefaultsApi.getValue", + name: + "dev.flutter.pigeon.shared_preferences_foundation.UserDefaultsApi.getValue\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { getValueChannel.setMessageHandler { message, reply in @@ -356,7 +361,8 @@ class UserDefaultsApiSetup { } /// Gets all properties from shared preferences data set with matching prefix. let getKeysChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.shared_preferences_foundation.UserDefaultsApi.getKeys", + name: + "dev.flutter.pigeon.shared_preferences_foundation.UserDefaultsApi.getKeys\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { getKeysChannel.setMessageHandler { message, reply in diff --git a/packages/shared_preferences/shared_preferences_foundation/lib/src/messages.g.dart b/packages/shared_preferences/shared_preferences_foundation/lib/src/messages.g.dart index 6594deec3bb7..50d77fcdc77a 100644 --- a/packages/shared_preferences/shared_preferences_foundation/lib/src/messages.g.dart +++ b/packages/shared_preferences/shared_preferences_foundation/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 (v16.0.5), do not edit directly. +// Autogenerated from Pigeon (v22.4.1), 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, no_leading_underscores_for_local_identifiers @@ -50,12 +50,15 @@ class SharedPreferencesPigeonOptions { } } -class _LegacyUserDefaultsApiCodec extends StandardMessageCodec { - const _LegacyUserDefaultsApiCodec(); +class _PigeonCodec extends StandardMessageCodec { + const _PigeonCodec(); @override void writeValue(WriteBuffer buffer, Object? value) { - if (value is SharedPreferencesPigeonOptions) { - buffer.putUint8(128); + if (value is int) { + buffer.putUint8(4); + buffer.putInt64(value); + } else if (value is SharedPreferencesPigeonOptions) { + buffer.putUint8(129); writeValue(buffer, value.encode()); } else { super.writeValue(buffer, value); @@ -65,7 +68,7 @@ class _LegacyUserDefaultsApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 129: return SharedPreferencesPigeonOptions.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -77,31 +80,35 @@ class LegacyUserDefaultsApi { /// Constructor for [LegacyUserDefaultsApi]. The [binaryMessenger] named argument is /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. - LegacyUserDefaultsApi({BinaryMessenger? binaryMessenger}) - : __pigeon_binaryMessenger = binaryMessenger; - final BinaryMessenger? __pigeon_binaryMessenger; + LegacyUserDefaultsApi( + {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) + : pigeonVar_binaryMessenger = binaryMessenger, + pigeonVar_messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + final BinaryMessenger? pigeonVar_binaryMessenger; - static const MessageCodec pigeonChannelCodec = - _LegacyUserDefaultsApiCodec(); + static const MessageCodec pigeonChannelCodec = _PigeonCodec(); + + final String pigeonVar_messageChannelSuffix; Future remove(String key) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.shared_preferences_foundation.LegacyUserDefaultsApi.remove'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.shared_preferences_foundation.LegacyUserDefaultsApi.remove$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([key]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([key]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -109,23 +116,23 @@ class LegacyUserDefaultsApi { } Future setBool(String key, bool value) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.shared_preferences_foundation.LegacyUserDefaultsApi.setBool'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.shared_preferences_foundation.LegacyUserDefaultsApi.setBool$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([key, value]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([key, value]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -133,23 +140,23 @@ class LegacyUserDefaultsApi { } Future setDouble(String key, double value) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.shared_preferences_foundation.LegacyUserDefaultsApi.setDouble'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.shared_preferences_foundation.LegacyUserDefaultsApi.setDouble$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([key, value]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([key, value]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -157,109 +164,86 @@ class LegacyUserDefaultsApi { } Future setValue(String key, Object value) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.shared_preferences_foundation.LegacyUserDefaultsApi.setValue'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.shared_preferences_foundation.LegacyUserDefaultsApi.setValue$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([key, value]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([key, value]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; } } - Future> getAll( - String prefix, List? allowList) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.shared_preferences_foundation.LegacyUserDefaultsApi.getAll'; - final BasicMessageChannel __pigeon_channel = + Future> getAll( + String prefix, List? allowList) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.shared_preferences_foundation.LegacyUserDefaultsApi.getAll$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel + final List? pigeonVar_replyList = await pigeonVar_channel .send([prefix, allowList]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as Map?)! - .cast(); + return (pigeonVar_replyList[0] as Map?)! + .cast(); } } - Future clear(String prefix, List? allowList) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.shared_preferences_foundation.LegacyUserDefaultsApi.clear'; - final BasicMessageChannel __pigeon_channel = + Future clear(String prefix, List? allowList) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.shared_preferences_foundation.LegacyUserDefaultsApi.clear$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel + final List? pigeonVar_replyList = await pigeonVar_channel .send([prefix, allowList]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as bool?)!; - } - } -} - -class _UserDefaultsApiCodec extends StandardMessageCodec { - const _UserDefaultsApiCodec(); - @override - void writeValue(WriteBuffer buffer, Object? value) { - if (value is SharedPreferencesPigeonOptions) { - buffer.putUint8(128); - writeValue(buffer, value.encode()); - } else { - super.writeValue(buffer, value); - } - } - - @override - Object? readValueOfType(int type, ReadBuffer buffer) { - switch (type) { - case 128: - return SharedPreferencesPigeonOptions.decode(readValue(buffer)!); - default: - return super.readValueOfType(type, buffer); + return (pigeonVar_replyList[0] as bool?)!; } } } @@ -268,33 +252,37 @@ class UserDefaultsApi { /// Constructor for [UserDefaultsApi]. The [binaryMessenger] named argument is /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. - UserDefaultsApi({BinaryMessenger? binaryMessenger}) - : __pigeon_binaryMessenger = binaryMessenger; - final BinaryMessenger? __pigeon_binaryMessenger; + UserDefaultsApi( + {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) + : pigeonVar_binaryMessenger = binaryMessenger, + pigeonVar_messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + final BinaryMessenger? pigeonVar_binaryMessenger; + + static const MessageCodec pigeonChannelCodec = _PigeonCodec(); - static const MessageCodec pigeonChannelCodec = - _UserDefaultsApiCodec(); + final String pigeonVar_messageChannelSuffix; /// Adds property to shared preferences data set of type String. Future set( String key, Object value, SharedPreferencesPigeonOptions options) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.shared_preferences_foundation.UserDefaultsApi.set'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.shared_preferences_foundation.UserDefaultsApi.set$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel + final List? pigeonVar_replyList = await pigeonVar_channel .send([key, value, options]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -303,24 +291,24 @@ class UserDefaultsApi { /// Removes all properties from shared preferences data set with matching prefix. Future clear( - List? allowList, SharedPreferencesPigeonOptions options) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.shared_preferences_foundation.UserDefaultsApi.clear'; - final BasicMessageChannel __pigeon_channel = + List? allowList, SharedPreferencesPigeonOptions options) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.shared_preferences_foundation.UserDefaultsApi.clear$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel + final List? pigeonVar_replyList = await pigeonVar_channel .send([allowList, options]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -328,91 +316,91 @@ class UserDefaultsApi { } /// Gets all properties from shared preferences data set with matching prefix. - Future> getAll( - List? allowList, SharedPreferencesPigeonOptions options) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.shared_preferences_foundation.UserDefaultsApi.getAll'; - final BasicMessageChannel __pigeon_channel = + Future> getAll( + List? allowList, SharedPreferencesPigeonOptions options) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.shared_preferences_foundation.UserDefaultsApi.getAll$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel + final List? pigeonVar_replyList = await pigeonVar_channel .send([allowList, options]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as Map?)! - .cast(); + return (pigeonVar_replyList[0] as Map?)! + .cast(); } } /// Gets individual value stored with [key], if any. Future getValue( String key, SharedPreferencesPigeonOptions options) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.shared_preferences_foundation.UserDefaultsApi.getValue'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.shared_preferences_foundation.UserDefaultsApi.getValue$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([key, options]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([key, options]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { - return __pigeon_replyList[0]; + return pigeonVar_replyList[0]; } } /// Gets all properties from shared preferences data set with matching prefix. - Future> getKeys( - List? allowList, SharedPreferencesPigeonOptions options) async { - const String __pigeon_channelName = - 'dev.flutter.pigeon.shared_preferences_foundation.UserDefaultsApi.getKeys'; - final BasicMessageChannel __pigeon_channel = + Future> getKeys( + List? allowList, SharedPreferencesPigeonOptions options) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.shared_preferences_foundation.UserDefaultsApi.getKeys$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel + final List? pigeonVar_replyList = await pigeonVar_channel .send([allowList, options]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as List?)!.cast(); + return (pigeonVar_replyList[0] as List?)!.cast(); } } } diff --git a/packages/shared_preferences/shared_preferences_foundation/lib/src/shared_preferences_async_foundation.dart b/packages/shared_preferences/shared_preferences_foundation/lib/src/shared_preferences_async_foundation.dart index df60e88522db..d821f1cb378c 100644 --- a/packages/shared_preferences/shared_preferences_foundation/lib/src/shared_preferences_async_foundation.dart +++ b/packages/shared_preferences/shared_preferences_foundation/lib/src/shared_preferences_async_foundation.dart @@ -47,14 +47,11 @@ base class SharedPreferencesAsyncFoundation SharedPreferencesOptions options, ) async { final PreferencesFilters filter = parameters.filter; - // TODO(tarrinneal): Remove cast once https://github.com/flutter/flutter/issues/97848 - // is fixed. In practice, the values will never be null, and the native implementation assumes that. return (await _convertKnownExceptions>( - () async => (await _api.getKeys( + () async => _api.getKeys( filter.allowList?.toList(), _convertOptionsToPigeonOptions(options), - )) - .cast()))! + )))! .toSet(); } @@ -153,8 +150,8 @@ base class SharedPreferencesAsyncFoundation String key, SharedPreferencesOptions options, ) async { - // TODO(tarrinneal): Remove cast once https://github.com/flutter/flutter/issues/97848 - // is fixed. In practice, the values will never be null, and the native implementation assumes that. + // Since `getValue` is not strongly typed, the array type won't be set + // during deserialization, and needs to be manually cast. return _convertKnownExceptions>(() async => ((await _api.getValue(key, _convertOptionsToPigeonOptions(options))) as List?) @@ -180,14 +177,11 @@ base class SharedPreferencesAsyncFoundation SharedPreferencesOptions options, ) async { final PreferencesFilters filter = parameters.filter; - final Map? data = - await _convertKnownExceptions>( - () async => _api.getAll( - filter.allowList?.toList(), - _convertOptionsToPigeonOptions(options), - )); - - return data!.cast(); + return (await _convertKnownExceptions>( + () async => _api.getAll( + filter.allowList?.toList(), + _convertOptionsToPigeonOptions(options), + )))!; } Future _convertKnownExceptions(Future Function() method) async { diff --git a/packages/shared_preferences/shared_preferences_foundation/lib/src/shared_preferences_foundation.dart b/packages/shared_preferences/shared_preferences_foundation/lib/src/shared_preferences_foundation.dart index b68b6308c74b..3fccb90e73c6 100644 --- a/packages/shared_preferences/shared_preferences_foundation/lib/src/shared_preferences_foundation.dart +++ b/packages/shared_preferences/shared_preferences_foundation/lib/src/shared_preferences_foundation.dart @@ -85,9 +85,7 @@ class SharedPreferencesFoundation extends SharedPreferencesStorePlatform { Future> getAllWithParameters( GetAllParameters parameters) async { final PreferencesFilter filter = parameters.filter; - final Map data = - await _api.getAll(filter.prefix, filter.allowList?.toList()); - return data.cast(); + return _api.getAll(filter.prefix, filter.allowList?.toList()); } @override diff --git a/packages/shared_preferences/shared_preferences_foundation/pigeons/messages.dart b/packages/shared_preferences/shared_preferences_foundation/pigeons/messages.dart index 96430e55662b..d740b1ebd0a2 100644 --- a/packages/shared_preferences/shared_preferences_foundation/pigeons/messages.dart +++ b/packages/shared_preferences/shared_preferences_foundation/pigeons/messages.dart @@ -17,9 +17,7 @@ abstract class LegacyUserDefaultsApi { void setBool(String key, bool value); void setDouble(String key, double value); void setValue(String key, Object value); - // TODO(stuartmorgan): Make these non-nullable once - // https://github.com/flutter/flutter/issues/97848 is fixed. - Map getAll(String prefix, List? allowList); + Map getAll(String prefix, List? allowList); bool clear(String prefix, List? allowList); } diff --git a/packages/shared_preferences/shared_preferences_foundation/pubspec.yaml b/packages/shared_preferences/shared_preferences_foundation/pubspec.yaml index f873bb6d8e70..50b73b1264bb 100644 --- a/packages/shared_preferences/shared_preferences_foundation/pubspec.yaml +++ b/packages/shared_preferences/shared_preferences_foundation/pubspec.yaml @@ -2,7 +2,7 @@ name: shared_preferences_foundation description: iOS and macOS implementation of the shared_preferences plugin. repository: https://github.com/flutter/packages/tree/main/packages/shared_preferences/shared_preferences_foundation issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+shared_preferences%22 -version: 2.5.2 +version: 2.5.3 environment: sdk: ^3.3.0 @@ -29,7 +29,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - pigeon: ^16.0.4 + pigeon: ^22.4.1 topics: - persistence diff --git a/packages/shared_preferences/shared_preferences_foundation/test/shared_preferences_async_foundation_test.dart b/packages/shared_preferences/shared_preferences_foundation/test/shared_preferences_async_foundation_test.dart index 74278d6b344f..584e35100c8b 100644 --- a/packages/shared_preferences/shared_preferences_foundation/test/shared_preferences_async_foundation_test.dart +++ b/packages/shared_preferences/shared_preferences_foundation/test/shared_preferences_async_foundation_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 'package:flutter/src/services/binary_messenger.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:shared_preferences_foundation/shared_preferences_foundation.dart'; import 'package:shared_preferences_foundation/src/messages.g.dart'; @@ -214,7 +215,7 @@ class _FakeSharedPreferencesApi implements UserDefaultsApi { } @override - Future> getAll( + Future> getAll( List? allowList, SharedPreferencesPigeonOptions options) async { final Map filteredItems = {...items}; if (allowList != null) { @@ -224,7 +225,7 @@ class _FakeSharedPreferencesApi implements UserDefaultsApi { } @override - Future> getKeys( + Future> getKeys( List? allowList, SharedPreferencesPigeonOptions options) async { final List filteredItems = items.keys.toList(); if (allowList != null) { @@ -244,4 +245,12 @@ class _FakeSharedPreferencesApi implements UserDefaultsApi { String key, SharedPreferencesPigeonOptions options) async { return items[key]; } + + @override + // ignore: non_constant_identifier_names + BinaryMessenger? get pigeonVar_binaryMessenger => null; + + @override + // ignore: non_constant_identifier_names + String get pigeonVar_messageChannelSuffix => ''; } diff --git a/packages/shared_preferences/shared_preferences_foundation/test/shared_preferences_foundation_test.dart b/packages/shared_preferences/shared_preferences_foundation/test/shared_preferences_foundation_test.dart index f733122e7ad6..3543e69b9bc5 100644 --- a/packages/shared_preferences/shared_preferences_foundation/test/shared_preferences_foundation_test.dart +++ b/packages/shared_preferences/shared_preferences_foundation/test/shared_preferences_foundation_test.dart @@ -14,7 +14,7 @@ class _MockSharedPreferencesApi implements TestUserDefaultsApi { final Map items = {}; @override - Map getAll( + Map getAll( String prefix, List? allowList, ) { @@ -22,11 +22,11 @@ class _MockSharedPreferencesApi implements TestUserDefaultsApi { if (allowList != null) { allowSet = Set.from(allowList); } - return { - for (final String key in items.keys) - if (key.startsWith(prefix) && - (allowSet == null || allowSet.contains(key))) - key: items[key] + return { + for (final MapEntry entry in items.entries) + if (entry.key.startsWith(prefix) && + (allowSet == null || allowSet.contains(entry.key))) + entry.key: entry.value }; } @@ -98,7 +98,7 @@ void main() { setUp(() { api = _MockSharedPreferencesApi(); - TestUserDefaultsApi.setup(api); + TestUserDefaultsApi.setUp(api); }); test('registerWith', () async { diff --git a/packages/shared_preferences/shared_preferences_foundation/test/test_api.g.dart b/packages/shared_preferences/shared_preferences_foundation/test/test_api.g.dart index 25617165035c..ebeabbc6d16f 100644 --- a/packages/shared_preferences/shared_preferences_foundation/test/test_api.g.dart +++ b/packages/shared_preferences/shared_preferences_foundation/test/test_api.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 (v16.0.5), do not edit directly. +// Autogenerated from Pigeon (v22.4.1), 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, unnecessary_import, no_leading_underscores_for_local_identifiers // ignore_for_file: avoid_relative_lib_imports @@ -13,12 +13,15 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:shared_preferences_foundation/src/messages.g.dart'; -class _TestUserDefaultsApiCodec extends StandardMessageCodec { - const _TestUserDefaultsApiCodec(); +class _PigeonCodec extends StandardMessageCodec { + const _PigeonCodec(); @override void writeValue(WriteBuffer buffer, Object? value) { - if (value is SharedPreferencesPigeonOptions) { - buffer.putUint8(128); + if (value is int) { + buffer.putUint8(4); + buffer.putInt64(value); + } else if (value is SharedPreferencesPigeonOptions) { + buffer.putUint8(129); writeValue(buffer, value.encode()); } else { super.writeValue(buffer, value); @@ -28,7 +31,7 @@ class _TestUserDefaultsApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 129: return SharedPreferencesPigeonOptions.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -39,8 +42,7 @@ class _TestUserDefaultsApiCodec extends StandardMessageCodec { abstract class TestUserDefaultsApi { static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; - static const MessageCodec pigeonChannelCodec = - _TestUserDefaultsApiCodec(); + static const MessageCodec pigeonChannelCodec = _PigeonCodec(); void remove(String key); @@ -50,24 +52,30 @@ abstract class TestUserDefaultsApi { void setValue(String key, Object value); - Map getAll(String prefix, List? allowList); + Map getAll(String prefix, List? allowList); - bool clear(String prefix, List? allowList); + bool clear(String prefix, List? allowList); - static void setup(TestUserDefaultsApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setUp( + TestUserDefaultsApi? api, { + BinaryMessenger? binaryMessenger, + String messageChannelSuffix = '', + }) { + messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.shared_preferences_foundation.LegacyUserDefaultsApi.remove', + 'dev.flutter.pigeon.shared_preferences_foundation.LegacyUserDefaultsApi.remove$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.shared_preferences_foundation.LegacyUserDefaultsApi.remove was null.'); @@ -88,17 +96,18 @@ abstract class TestUserDefaultsApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.shared_preferences_foundation.LegacyUserDefaultsApi.setBool', + 'dev.flutter.pigeon.shared_preferences_foundation.LegacyUserDefaultsApi.setBool$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.shared_preferences_foundation.LegacyUserDefaultsApi.setBool was null.'); @@ -122,17 +131,18 @@ abstract class TestUserDefaultsApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.shared_preferences_foundation.LegacyUserDefaultsApi.setDouble', + 'dev.flutter.pigeon.shared_preferences_foundation.LegacyUserDefaultsApi.setDouble$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.shared_preferences_foundation.LegacyUserDefaultsApi.setDouble was null.'); @@ -156,17 +166,18 @@ abstract class TestUserDefaultsApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.shared_preferences_foundation.LegacyUserDefaultsApi.setValue', + 'dev.flutter.pigeon.shared_preferences_foundation.LegacyUserDefaultsApi.setValue$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.shared_preferences_foundation.LegacyUserDefaultsApi.setValue was null.'); @@ -190,17 +201,18 @@ abstract class TestUserDefaultsApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.shared_preferences_foundation.LegacyUserDefaultsApi.getAll', + 'dev.flutter.pigeon.shared_preferences_foundation.LegacyUserDefaultsApi.getAll$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.shared_preferences_foundation.LegacyUserDefaultsApi.getAll was null.'); @@ -208,10 +220,10 @@ abstract class TestUserDefaultsApi { final String? arg_prefix = (args[0] as String?); assert(arg_prefix != null, 'Argument for dev.flutter.pigeon.shared_preferences_foundation.LegacyUserDefaultsApi.getAll was null, expected non-null String.'); - final List? arg_allowList = - (args[1] as List?)?.cast(); + final List? arg_allowList = + (args[1] as List?)?.cast(); try { - final Map output = + final Map output = api.getAll(arg_prefix!, arg_allowList); return [output]; } on PlatformException catch (e) { @@ -224,17 +236,18 @@ abstract class TestUserDefaultsApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.shared_preferences_foundation.LegacyUserDefaultsApi.clear', + 'dev.flutter.pigeon.shared_preferences_foundation.LegacyUserDefaultsApi.clear$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.shared_preferences_foundation.LegacyUserDefaultsApi.clear was null.'); @@ -242,8 +255,8 @@ abstract class TestUserDefaultsApi { final String? arg_prefix = (args[0] as String?); assert(arg_prefix != null, 'Argument for dev.flutter.pigeon.shared_preferences_foundation.LegacyUserDefaultsApi.clear was null, expected non-null String.'); - final List? arg_allowList = - (args[1] as List?)?.cast(); + final List? arg_allowList = + (args[1] as List?)?.cast(); try { final bool output = api.clear(arg_prefix!, arg_allowList); return [output]; @@ -259,66 +272,48 @@ abstract class TestUserDefaultsApi { } } -class _TestSharedPreferencesAsyncApiCodec extends StandardMessageCodec { - const _TestSharedPreferencesAsyncApiCodec(); - @override - void writeValue(WriteBuffer buffer, Object? value) { - if (value is SharedPreferencesPigeonOptions) { - buffer.putUint8(128); - writeValue(buffer, value.encode()); - } else { - super.writeValue(buffer, value); - } - } - - @override - Object? readValueOfType(int type, ReadBuffer buffer) { - switch (type) { - case 128: - return SharedPreferencesPigeonOptions.decode(readValue(buffer)!); - default: - return super.readValueOfType(type, buffer); - } - } -} - abstract class TestSharedPreferencesAsyncApi { static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; - static const MessageCodec pigeonChannelCodec = - _TestSharedPreferencesAsyncApiCodec(); + static const MessageCodec pigeonChannelCodec = _PigeonCodec(); /// Adds property to shared preferences data set of type String. void set(String key, Object value, SharedPreferencesPigeonOptions options); /// Removes all properties from shared preferences data set with matching prefix. - void clear(List? allowList, SharedPreferencesPigeonOptions options); + void clear(List? allowList, SharedPreferencesPigeonOptions options); /// Gets all properties from shared preferences data set with matching prefix. - Map getAll( - List? allowList, SharedPreferencesPigeonOptions options); + Map getAll( + List? allowList, SharedPreferencesPigeonOptions options); /// Gets individual value stored with [key], if any. Object? getValue(String key, SharedPreferencesPigeonOptions options); /// Gets all properties from shared preferences data set with matching prefix. - List getKeys( - List? allowList, SharedPreferencesPigeonOptions options); + List getKeys( + List? allowList, SharedPreferencesPigeonOptions options); - static void setup(TestSharedPreferencesAsyncApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setUp( + TestSharedPreferencesAsyncApi? api, { + BinaryMessenger? binaryMessenger, + String messageChannelSuffix = '', + }) { + messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.shared_preferences_foundation.UserDefaultsApi.set', + 'dev.flutter.pigeon.shared_preferences_foundation.UserDefaultsApi.set$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.shared_preferences_foundation.UserDefaultsApi.set was null.'); @@ -346,23 +341,24 @@ abstract class TestSharedPreferencesAsyncApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.shared_preferences_foundation.UserDefaultsApi.clear', + 'dev.flutter.pigeon.shared_preferences_foundation.UserDefaultsApi.clear$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.shared_preferences_foundation.UserDefaultsApi.clear was null.'); final List args = (message as List?)!; - final List? arg_allowList = - (args[0] as List?)?.cast(); + final List? arg_allowList = + (args[0] as List?)?.cast(); final SharedPreferencesPigeonOptions? arg_options = (args[1] as SharedPreferencesPigeonOptions?); assert(arg_options != null, @@ -380,29 +376,30 @@ abstract class TestSharedPreferencesAsyncApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.shared_preferences_foundation.UserDefaultsApi.getAll', + 'dev.flutter.pigeon.shared_preferences_foundation.UserDefaultsApi.getAll$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.shared_preferences_foundation.UserDefaultsApi.getAll was null.'); final List args = (message as List?)!; - final List? arg_allowList = - (args[0] as List?)?.cast(); + final List? arg_allowList = + (args[0] as List?)?.cast(); final SharedPreferencesPigeonOptions? arg_options = (args[1] as SharedPreferencesPigeonOptions?); assert(arg_options != null, 'Argument for dev.flutter.pigeon.shared_preferences_foundation.UserDefaultsApi.getAll was null, expected non-null SharedPreferencesPigeonOptions.'); try { - final Map output = + final Map output = api.getAll(arg_allowList, arg_options!); return [output]; } on PlatformException catch (e) { @@ -415,17 +412,18 @@ abstract class TestSharedPreferencesAsyncApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.shared_preferences_foundation.UserDefaultsApi.getValue', + 'dev.flutter.pigeon.shared_preferences_foundation.UserDefaultsApi.getValue$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.shared_preferences_foundation.UserDefaultsApi.getValue was null.'); @@ -450,29 +448,30 @@ abstract class TestSharedPreferencesAsyncApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.shared_preferences_foundation.UserDefaultsApi.getKeys', + 'dev.flutter.pigeon.shared_preferences_foundation.UserDefaultsApi.getKeys$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.shared_preferences_foundation.UserDefaultsApi.getKeys was null.'); final List args = (message as List?)!; - final List? arg_allowList = - (args[0] as List?)?.cast(); + final List? arg_allowList = + (args[0] as List?)?.cast(); final SharedPreferencesPigeonOptions? arg_options = (args[1] as SharedPreferencesPigeonOptions?); assert(arg_options != null, 'Argument for dev.flutter.pigeon.shared_preferences_foundation.UserDefaultsApi.getKeys was null, expected non-null SharedPreferencesPigeonOptions.'); try { - final List output = + final List output = api.getKeys(arg_allowList, arg_options!); return [output]; } on PlatformException catch (e) { diff --git a/packages/two_dimensional_scrollables/CHANGELOG.md b/packages/two_dimensional_scrollables/CHANGELOG.md index 0bcac837523c..31ecdfdcdb66 100644 --- a/packages/two_dimensional_scrollables/CHANGELOG.md +++ b/packages/two_dimensional_scrollables/CHANGELOG.md @@ -1,3 +1,11 @@ +## 0.3.3 + +* Fixes an issue where collapsing nodes in the TreeView didn't work correctly. + +## 0.3.2 + +* Fixes a bug where the TreeView would not update correctly when the animation duration is zero. + ## 0.3.1 * Adds generics to the callbacks and builders of TreeView. diff --git a/packages/two_dimensional_scrollables/example/android/app/build.gradle b/packages/two_dimensional_scrollables/example/android/app/build.gradle index 6648ebb4f24c..959671515102 100644 --- a/packages/two_dimensional_scrollables/example/android/app/build.gradle +++ b/packages/two_dimensional_scrollables/example/android/app/build.gradle @@ -31,12 +31,12 @@ android { ndkVersion flutter.ndkVersion compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_11 + targetCompatibility JavaVersion.VERSION_11 } kotlinOptions { - jvmTarget = '1.8' + jvmTarget = '11' } sourceSets { diff --git a/packages/two_dimensional_scrollables/example/android/build.gradle b/packages/two_dimensional_scrollables/example/android/build.gradle index d13ef556e261..5cf1eb221426 100644 --- a/packages/two_dimensional_scrollables/example/android/build.gradle +++ b/packages/two_dimensional_scrollables/example/android/build.gradle @@ -6,7 +6,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:7.4.2' + classpath 'com.android.tools.build:gradle:8.5.2' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } 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..3c85cfe057a1 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-8.7-all.zip diff --git a/packages/two_dimensional_scrollables/example/pubspec.yaml b/packages/two_dimensional_scrollables/example/pubspec.yaml index 864ffc566cff..c7786ae10c6f 100644 --- a/packages/two_dimensional_scrollables/example/pubspec.yaml +++ b/packages/two_dimensional_scrollables/example/pubspec.yaml @@ -16,7 +16,6 @@ dependencies: path: ../ dev_dependencies: - flutter_lints: ^2.0.0 flutter_test: sdk: flutter diff --git a/packages/two_dimensional_scrollables/lib/src/tree_view/tree.dart b/packages/two_dimensional_scrollables/lib/src/tree_view/tree.dart index ba6c4632c408..f9fc6c82e7eb 100644 --- a/packages/two_dimensional_scrollables/lib/src/tree_view/tree.dart +++ b/packages/two_dimensional_scrollables/lib/src/tree_view/tree.dart @@ -886,6 +886,15 @@ class _TreeViewState extends State> if (widget.onNodeToggle != null) { widget.onNodeToggle!(node); } + + // If animation is disabled or duration is zero, skip the animation + // and update the active nodes immediately. This ensures the tree + // is updated correctly when the node's children are no longer active. + if (widget.toggleAnimationStyle?.duration == Duration.zero) { + _unpackActiveNodes(); + return; + } + final AnimationController controller = _currentAnimationForParent[node]?.controller ?? AnimationController( @@ -902,6 +911,12 @@ class _TreeViewState extends State> _currentAnimationForParent[node]!.controller.dispose(); _currentAnimationForParent.remove(node); _updateActiveAnimations(); + // If the node is collapsing, we need to unpack the active + // nodes to remove the ones that were removed from the tree. + // This is only necessary if the node is collapsing. + if (!node._expanded) { + _unpackActiveNodes(); + } case AnimationStatus.forward: case AnimationStatus.reverse: } @@ -940,9 +955,7 @@ class _TreeViewState extends State> controller.forward(); case false: // Collapsing - controller.reverse().then((_) { - _unpackActiveNodes(); - }); + controller.reverse(); } }); } diff --git a/packages/two_dimensional_scrollables/pubspec.yaml b/packages/two_dimensional_scrollables/pubspec.yaml index 45845c7afe09..3cd575a8c76a 100644 --- a/packages/two_dimensional_scrollables/pubspec.yaml +++ b/packages/two_dimensional_scrollables/pubspec.yaml @@ -1,6 +1,6 @@ name: two_dimensional_scrollables description: Widgets that scroll using the two dimensional scrolling foundation. -version: 0.3.1 +version: 0.3.3 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+ @@ -13,7 +13,6 @@ dependencies: sdk: flutter dev_dependencies: - flutter_lints: ^2.0.0 flutter_test: sdk: flutter diff --git a/packages/two_dimensional_scrollables/test/tree_view/tree_test.dart b/packages/two_dimensional_scrollables/test/tree_view/tree_test.dart index a1790879fe9a..5e536402b85a 100644 --- a/packages/two_dimensional_scrollables/test/tree_view/tree_test.dart +++ b/packages/two_dimensional_scrollables/test/tree_view/tree_test.dart @@ -718,6 +718,170 @@ void main() { expect(treeView.treeNodeBuilder, isA>()); expect(treeView.treeRowBuilder, isA>()); }); + + testWidgets( + 'TreeViewNode should expand/collapse correctly when the animation duration is set to zero.', + (WidgetTester tester) async { + // Regression test for https://github.com/flutter/flutter/issues/154292 + final TreeViewController controller = TreeViewController(); + final List> tree = >[ + TreeViewNode('First'), + TreeViewNode( + 'Second', + children: >[ + TreeViewNode( + 'alpha', + children: >[ + TreeViewNode('uno'), + TreeViewNode('dos'), + TreeViewNode('tres'), + ], + ), + TreeViewNode('beta'), + TreeViewNode('kappa'), + ], + ), + TreeViewNode( + 'Third', + expanded: true, + children: >[ + TreeViewNode('gamma'), + TreeViewNode('delta'), + TreeViewNode('epsilon'), + ], + ), + TreeViewNode('Fourth'), + ]; + + await tester.pumpWidget(MaterialApp( + home: TreeView( + tree: tree, + controller: controller, + toggleAnimationStyle: AnimationStyle( + curve: Curves.easeInOut, + duration: Duration.zero, + ), + treeNodeBuilder: ( + BuildContext context, + TreeViewNode node, + AnimationStyle animationStyle, + ) { + final Widget child = GestureDetector( + behavior: HitTestBehavior.translucent, + onTap: () => controller.toggleNode(node), + child: TreeView.defaultTreeNodeBuilder( + context, + node, + animationStyle, + ), + ); + + return child; + }, + ), + )); + + expect(find.text('First'), findsOneWidget); + expect(find.text('Second'), findsOneWidget); + expect(find.text('Third'), findsOneWidget); + expect(find.text('Fourth'), findsOneWidget); + expect(find.text('alpha'), findsNothing); + expect(find.text('beta'), findsNothing); + expect(find.text('kappa'), findsNothing); + expect(find.text('gamma'), findsOneWidget); + expect(find.text('delta'), findsOneWidget); + expect(find.text('epsilon'), findsOneWidget); + expect(find.text('uno'), findsNothing); + expect(find.text('dos'), findsNothing); + expect(find.text('tres'), findsNothing); + + await tester.tap(find.text('Second')); + await tester.pumpAndSettle(); + + expect(find.text('alpha'), findsOneWidget); + + await tester.tap(find.text('alpha')); + await tester.pumpAndSettle(); + + expect(find.text('uno'), findsOneWidget); + expect(find.text('dos'), findsOneWidget); + expect(find.text('tres'), findsOneWidget); + + await tester.tap(find.text('alpha')); + await tester.pumpAndSettle(); + + expect(find.text('uno'), findsNothing); + expect(find.text('dos'), findsNothing); + expect(find.text('tres'), findsNothing); + }); + + testWidgets( + 'TreeViewNode should close all child nodes when collapsed, once the animation is completed', + (WidgetTester tester) async { + final TreeViewController controller = TreeViewController(); + final List> tree = >[ + TreeViewNode( + 'First', + expanded: true, + children: >[ + TreeViewNode( + 'alpha', + expanded: true, + children: >[ + TreeViewNode('uno'), + TreeViewNode('dos'), + TreeViewNode('tres'), + ], + ), + TreeViewNode('beta'), + TreeViewNode('kappa'), + ], + ), + ]; + + await tester.pumpWidget(MaterialApp( + home: TreeView( + tree: tree, + controller: controller, + toggleAnimationStyle: AnimationStyle( + curve: Curves.easeInOut, + duration: const Duration(milliseconds: 200), + ), + treeNodeBuilder: ( + BuildContext context, + TreeViewNode node, + AnimationStyle animationStyle, + ) { + final Widget child = GestureDetector( + behavior: HitTestBehavior.translucent, + onTap: () => controller.toggleNode(node), + child: TreeView.defaultTreeNodeBuilder( + context, + node, + animationStyle, + ), + ); + + return child; + }, + ), + )); + + expect(find.text('alpha'), findsOneWidget); + expect(find.text('uno'), findsOneWidget); + expect(find.text('dos'), findsOneWidget); + expect(find.text('tres'), findsOneWidget); + + // Using runAsync to handle collapse and animations properly. + await tester.runAsync(() async { + await tester.tap(find.text('alpha')); + await tester.pumpAndSettle(); + + expect(find.text('uno'), findsNothing); + expect(find.text('dos'), findsNothing); + expect(find.text('tres'), findsNothing); + }); + }); }); group('TreeViewport', () { diff --git a/packages/url_launcher/url_launcher/CHANGELOG.md b/packages/url_launcher/url_launcher/CHANGELOG.md index a01d7f443ea3..859646fbe7b3 100644 --- a/packages/url_launcher/url_launcher/CHANGELOG.md +++ b/packages/url_launcher/url_launcher/CHANGELOG.md @@ -1,5 +1,6 @@ -## NEXT +## 6.3.1 +* Removes incorrect SMS instructions from README. * Updates minimum supported SDK version to Flutter 3.19/Dart 3.3. ## 6.3.0 diff --git a/packages/url_launcher/url_launcher/README.md b/packages/url_launcher/url_launcher/README.md index 5955540491ee..301c0a068e1d 100644 --- a/packages/url_launcher/url_launcher/README.md +++ b/packages/url_launcher/url_launcher/README.md @@ -170,19 +170,6 @@ String? encodeQueryParameters(Map params) { launchUrl(emailLaunchUri); ``` -Encoding for `sms` is slightly different: - - -```dart -final Uri smsLaunchUri = Uri( - scheme: 'sms', - path: '0118 999 881 999 119 7253', - queryParameters: { - 'body': Uri.encodeComponent('Example Subject & Symbols are allowed!'), - }, -); -``` - ### URLs not handled by `Uri` In rare cases, you may need to launch a URL that the host system considers 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..d951fac2bf31 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-8.7-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/packages/url_launcher/url_launcher/example/android/build.gradle b/packages/url_launcher/url_launcher/example/android/build.gradle index cec92de922cf..0bed8906c094 100644 --- a/packages/url_launcher/url_launcher/example/android/build.gradle +++ b/packages/url_launcher/url_launcher/example/android/build.gradle @@ -5,7 +5,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:7.4.2' + classpath 'com.android.tools.build:gradle:8.5.2' } } 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..c677a74b9e70 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-8.7-all.zip diff --git a/packages/url_launcher/url_launcher/example/lib/encoding.dart b/packages/url_launcher/url_launcher/example/lib/encoding.dart index 0875a8587269..f3bcc57cbda9 100644 --- a/packages/url_launcher/url_launcher/example/lib/encoding.dart +++ b/packages/url_launcher/url_launcher/example/lib/encoding.dart @@ -31,10 +31,6 @@ void main() => runApp( onPressed: _composeMail, child: Text('Compose an email'), ), - ElevatedButton( - onPressed: _composeSms, - child: Text('Compose a SMS'), - ), ], ), ), @@ -54,17 +50,3 @@ void _composeMail() { launchUrl(emailLaunchUri); // #enddocregion encode-query-parameters } - -void _composeSms() { -// #docregion sms - final Uri smsLaunchUri = Uri( - scheme: 'sms', - path: '0118 999 881 999 119 7253', - queryParameters: { - 'body': Uri.encodeComponent('Example Subject & Symbols are allowed!'), - }, - ); -// #enddocregion sms - - launchUrl(smsLaunchUri); -} diff --git a/packages/url_launcher/url_launcher/example/pubspec.yaml b/packages/url_launcher/url_launcher/example/pubspec.yaml index c0276d18daac..a20fb1f84d10 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.4 + mockito: ^5.4.4 plugin_platform_interface: ^2.1.7 flutter: diff --git a/packages/url_launcher/url_launcher/pubspec.yaml b/packages/url_launcher/url_launcher/pubspec.yaml index 7b18a7f5fb78..3b594e883fba 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.3.0 +version: 6.3.1 environment: sdk: ^3.3.0 @@ -41,7 +41,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - mockito: 5.4.4 + mockito: ^5.4.4 plugin_platform_interface: ^2.1.7 test: ^1.16.3 diff --git a/packages/url_launcher/url_launcher_android/CHANGELOG.md b/packages/url_launcher/url_launcher_android/CHANGELOG.md index 49ab0e4991ac..6438d626505e 100644 --- a/packages/url_launcher/url_launcher_android/CHANGELOG.md +++ b/packages/url_launcher/url_launcher_android/CHANGELOG.md @@ -1,3 +1,20 @@ +## 6.3.13 + +* Bumps androidx.annotation:annotation from 1.8.2 to 1.9.0. + +## 6.3.12 + +* Updates Java compatibility version to 11. + +## 6.3.11 + +* Updates Pigeon for non-nullable collection type support. + +## 6.3.10 + +* Removes dependency on org.jetbrains.kotlin:kotlin-bom. +* Updates minimum supported SDK version to Flutter 3.24/Dart 3.5. + ## 6.3.9 * Bumps androidx.annotation:annotation from 1.8.1 to 1.8.2. diff --git a/packages/url_launcher/url_launcher_android/android/build.gradle b/packages/url_launcher/url_launcher_android/android/build.gradle index 296f5eae183b..3e6f706b2560 100644 --- a/packages/url_launcher/url_launcher_android/android/build.gradle +++ b/packages/url_launcher/url_launcher_android/android/build.gradle @@ -25,10 +25,7 @@ android { buildFeatures { buildConfig true } - // Conditional for compatibility with AGP <4.2. - if (project.android.hasProperty("namespace")) { - namespace 'io.flutter.plugins.urllauncher' - } + namespace 'io.flutter.plugins.urllauncher' compileSdk 34 defaultConfig { @@ -37,8 +34,8 @@ android { } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_11 + targetCompatibility JavaVersion.VERSION_11 } lintOptions { @@ -65,14 +62,10 @@ dependencies { // Java language implementation implementation "androidx.core:core:1.13.1" - implementation 'androidx.annotation:annotation:1.8.2' + implementation 'androidx.annotation:annotation:1.9.0' implementation 'androidx.browser:browser:1.8.0' testImplementation 'junit:junit:4.13.2' testImplementation 'org.mockito:mockito-core:5.1.1' testImplementation 'androidx.test:core:1.0.0' testImplementation 'org.robolectric:robolectric:4.10.3' - - // org.jetbrains.kotlin:kotlin-bom artifact purpose is to align kotlin stdlib and related code versions. - // See: https://youtrack.jetbrains.com/issue/KT-55297/kotlin-stdlib-should-declare-constraints-on-kotlin-stdlib-jdk8-and-kotlin-stdlib-jdk7 - implementation(platform("org.jetbrains.kotlin:kotlin-bom:1.8.22")) } diff --git a/packages/url_launcher/url_launcher_android/android/src/main/java/io/flutter/plugins/urllauncher/Messages.java b/packages/url_launcher/url_launcher_android/android/src/main/java/io/flutter/plugins/urllauncher/Messages.java index ff79d6320936..2fa6e4576738 100644 --- a/packages/url_launcher/url_launcher_android/android/src/main/java/io/flutter/plugins/urllauncher/Messages.java +++ b/packages/url_launcher/url_launcher_android/android/src/main/java/io/flutter/plugins/urllauncher/Messages.java @@ -1,11 +1,14 @@ // 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 (v10.1.6), do not edit directly. +// Autogenerated from Pigeon (v22.4.1), do not edit directly. // See also: https://pub.dev/packages/pigeon package io.flutter.plugins.urllauncher; +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; @@ -14,9 +17,12 @@ 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.Map; +import java.util.Objects; /** Generated class from Pigeon. */ @SuppressWarnings({"unused", "unchecked", "CodeBlock2Expr", "RedundantSuppression", "serial"}) @@ -40,7 +46,7 @@ public FlutterError(@NonNull String code, @Nullable String message, @Nullable Ob @NonNull protected static ArrayList wrapError(@NonNull Throwable exception) { - ArrayList errorList = new ArrayList(3); + ArrayList errorList = new ArrayList<>(3); if (exception instanceof FlutterError) { FlutterError error = (FlutterError) exception; errorList.add(error.code); @@ -55,6 +61,10 @@ protected static ArrayList wrapError(@NonNull Throwable exception) { return errorList; } + @Target(METHOD) + @Retention(CLASS) + @interface CanIgnoreReturnValue {} + /** * Configuration options for an in-app WebView. * @@ -103,10 +113,30 @@ public void setHeaders(@NonNull Map setterArg) { /** Constructor is non-public to enforce null safety; use Builder. */ WebViewOptions() {} + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WebViewOptions that = (WebViewOptions) o; + return enableJavaScript.equals(that.enableJavaScript) + && enableDomStorage.equals(that.enableDomStorage) + && headers.equals(that.headers); + } + + @Override + public int hashCode() { + return Objects.hash(enableJavaScript, enableDomStorage, headers); + } + public static final class Builder { private @Nullable Boolean enableJavaScript; + @CanIgnoreReturnValue public @NonNull Builder setEnableJavaScript(@NonNull Boolean setterArg) { this.enableJavaScript = setterArg; return this; @@ -114,6 +144,7 @@ public static final class Builder { private @Nullable Boolean enableDomStorage; + @CanIgnoreReturnValue public @NonNull Builder setEnableDomStorage(@NonNull Boolean setterArg) { this.enableDomStorage = setterArg; return this; @@ -121,6 +152,7 @@ public static final class Builder { private @Nullable Map headers; + @CanIgnoreReturnValue public @NonNull Builder setHeaders(@NonNull Map setterArg) { this.headers = setterArg; return this; @@ -137,27 +169,32 @@ public static final class Builder { @NonNull ArrayList toList() { - ArrayList toListResult = new ArrayList(3); + ArrayList toListResult = new ArrayList<>(3); toListResult.add(enableJavaScript); toListResult.add(enableDomStorage); toListResult.add(headers); return toListResult; } - static @NonNull WebViewOptions fromList(@NonNull ArrayList list) { + static @NonNull WebViewOptions fromList(@NonNull ArrayList pigeonVar_list) { WebViewOptions pigeonResult = new WebViewOptions(); - Object enableJavaScript = list.get(0); + Object enableJavaScript = pigeonVar_list.get(0); pigeonResult.setEnableJavaScript((Boolean) enableJavaScript); - Object enableDomStorage = list.get(1); + Object enableDomStorage = pigeonVar_list.get(1); pigeonResult.setEnableDomStorage((Boolean) enableDomStorage); - Object headers = list.get(2); + Object headers = pigeonVar_list.get(2); pigeonResult.setHeaders((Map) headers); return pigeonResult; } } - /** Generated class from Pigeon that represents data sent in messages. */ + /** + * Configuration options for in-app browser views. + * + *

Generated class from Pigeon that represents data sent in messages. + */ public static final class BrowserOptions { + /** Whether or not to show the webpage title. */ private @NonNull Boolean showTitle; public @NonNull Boolean getShowTitle() { @@ -174,10 +211,28 @@ public void setShowTitle(@NonNull Boolean setterArg) { /** Constructor is non-public to enforce null safety; use Builder. */ BrowserOptions() {} + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BrowserOptions that = (BrowserOptions) o; + return showTitle.equals(that.showTitle); + } + + @Override + public int hashCode() { + return Objects.hash(showTitle); + } + public static final class Builder { private @Nullable Boolean showTitle; + @CanIgnoreReturnValue public @NonNull Builder setShowTitle(@NonNull Boolean setterArg) { this.showTitle = setterArg; return this; @@ -192,31 +247,31 @@ public static final class Builder { @NonNull ArrayList toList() { - ArrayList toListResult = new ArrayList(1); + ArrayList toListResult = new ArrayList<>(1); toListResult.add(showTitle); return toListResult; } - static @NonNull BrowserOptions fromList(@NonNull ArrayList list) { + static @NonNull BrowserOptions fromList(@NonNull ArrayList pigeonVar_list) { BrowserOptions pigeonResult = new BrowserOptions(); - Object showTitle = list.get(0); + Object showTitle = pigeonVar_list.get(0); pigeonResult.setShowTitle((Boolean) showTitle); return pigeonResult; } } - private static class UrlLauncherApiCodec extends StandardMessageCodec { - public static final UrlLauncherApiCodec INSTANCE = new UrlLauncherApiCodec(); + private static class PigeonCodec extends StandardMessageCodec { + public static final PigeonCodec INSTANCE = new PigeonCodec(); - private UrlLauncherApiCodec() {} + private PigeonCodec() {} @Override protected Object readValueOfType(byte type, @NonNull ByteBuffer buffer) { switch (type) { - case (byte) 128: - return BrowserOptions.fromList((ArrayList) readValue(buffer)); case (byte) 129: return WebViewOptions.fromList((ArrayList) readValue(buffer)); + case (byte) 130: + return BrowserOptions.fromList((ArrayList) readValue(buffer)); default: return super.readValueOfType(type, buffer); } @@ -224,12 +279,12 @@ protected Object readValueOfType(byte type, @NonNull ByteBuffer buffer) { @Override protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { - if (value instanceof BrowserOptions) { - stream.write(128); - writeValue(stream, ((BrowserOptions) value).toList()); - } else if (value instanceof WebViewOptions) { + if (value instanceof WebViewOptions) { stream.write(129); writeValue(stream, ((WebViewOptions) value).toList()); + } else if (value instanceof BrowserOptions) { + stream.write(130); + writeValue(stream, ((BrowserOptions) value).toList()); } else { super.writeValue(stream, value); } @@ -244,7 +299,9 @@ public interface UrlLauncherApi { /** Opens the URL externally, returning true if successful. */ @NonNull Boolean launchUrl(@NonNull String url, @NonNull Map headers); - /** Opens the URL in an in-app WebView, returning true if it opens successfully. */ + /** + * Opens the URL in an in-app Custom Tab or WebView, returning true if it opens successfully. + */ @NonNull Boolean openUrlInApp( @NonNull String url, @@ -259,28 +316,36 @@ Boolean openUrlInApp( /** The codec used by UrlLauncherApi. */ static @NonNull MessageCodec getCodec() { - return UrlLauncherApiCodec.INSTANCE; + return PigeonCodec.INSTANCE; } /** Sets up an instance of `UrlLauncherApi` to handle messages through the `binaryMessenger`. */ - static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable UrlLauncherApi api) { + static void setUp(@NonNull BinaryMessenger binaryMessenger, @Nullable UrlLauncherApi api) { + setUp(binaryMessenger, "", api); + } + + static void setUp( + @NonNull BinaryMessenger binaryMessenger, + @NonNull String messageChannelSuffix, + @Nullable UrlLauncherApi api) { + messageChannelSuffix = messageChannelSuffix.isEmpty() ? "" : "." + messageChannelSuffix; { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.url_launcher_android.UrlLauncherApi.canLaunchUrl", + "dev.flutter.pigeon.url_launcher_android.UrlLauncherApi.canLaunchUrl" + + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; String urlArg = (String) args.get(0); try { Boolean output = api.canLaunchUrl(urlArg); wrapped.add(0, output); } catch (Throwable exception) { - ArrayList wrappedError = wrapError(exception); - wrapped = wrappedError; + wrapped = wrapError(exception); } reply.reply(wrapped); }); @@ -292,12 +357,13 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable UrlLaunche BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.url_launcher_android.UrlLauncherApi.launchUrl", + "dev.flutter.pigeon.url_launcher_android.UrlLauncherApi.launchUrl" + + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; String urlArg = (String) args.get(0); Map headersArg = (Map) args.get(1); @@ -305,8 +371,7 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable UrlLaunche Boolean output = api.launchUrl(urlArg, headersArg); wrapped.add(0, output); } catch (Throwable exception) { - ArrayList wrappedError = wrapError(exception); - wrapped = wrappedError; + wrapped = wrapError(exception); } reply.reply(wrapped); }); @@ -318,12 +383,13 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable UrlLaunche BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.url_launcher_android.UrlLauncherApi.openUrlInApp", + "dev.flutter.pigeon.url_launcher_android.UrlLauncherApi.openUrlInApp" + + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; String urlArg = (String) args.get(0); Boolean allowCustomTabArg = (Boolean) args.get(1); @@ -335,8 +401,7 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable UrlLaunche urlArg, allowCustomTabArg, webViewOptionsArg, browserOptionsArg); wrapped.add(0, output); } catch (Throwable exception) { - ArrayList wrappedError = wrapError(exception); - wrapped = wrappedError; + wrapped = wrapError(exception); } reply.reply(wrapped); }); @@ -348,18 +413,18 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable UrlLaunche BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.url_launcher_android.UrlLauncherApi.supportsCustomTabs", + "dev.flutter.pigeon.url_launcher_android.UrlLauncherApi.supportsCustomTabs" + + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); try { Boolean output = api.supportsCustomTabs(); wrapped.add(0, output); } catch (Throwable exception) { - ArrayList wrappedError = wrapError(exception); - wrapped = wrappedError; + wrapped = wrapError(exception); } reply.reply(wrapped); }); @@ -371,18 +436,18 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable UrlLaunche BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.url_launcher_android.UrlLauncherApi.closeWebView", + "dev.flutter.pigeon.url_launcher_android.UrlLauncherApi.closeWebView" + + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); try { api.closeWebView(); wrapped.add(0, null); } catch (Throwable exception) { - ArrayList wrappedError = wrapError(exception); - wrapped = wrappedError; + wrapped = wrapError(exception); } reply.reply(wrapped); }); diff --git a/packages/url_launcher/url_launcher_android/android/src/main/java/io/flutter/plugins/urllauncher/UrlLauncherPlugin.java b/packages/url_launcher/url_launcher_android/android/src/main/java/io/flutter/plugins/urllauncher/UrlLauncherPlugin.java index 34bf08f9f300..727741171591 100644 --- a/packages/url_launcher/url_launcher_android/android/src/main/java/io/flutter/plugins/urllauncher/UrlLauncherPlugin.java +++ b/packages/url_launcher/url_launcher_android/android/src/main/java/io/flutter/plugins/urllauncher/UrlLauncherPlugin.java @@ -23,7 +23,7 @@ public final class UrlLauncherPlugin implements FlutterPlugin, ActivityAware { @Override public void onAttachedToEngine(@NonNull FlutterPluginBinding binding) { urlLauncher = new UrlLauncher(binding.getApplicationContext()); - Messages.UrlLauncherApi.setup(binding.getBinaryMessenger(), urlLauncher); + Messages.UrlLauncherApi.setUp(binding.getBinaryMessenger(), urlLauncher); } @Override @@ -33,7 +33,7 @@ public void onDetachedFromEngine(@NonNull FlutterPluginBinding binding) { return; } - Messages.UrlLauncherApi.setup(binding.getBinaryMessenger(), null); + Messages.UrlLauncherApi.setUp(binding.getBinaryMessenger(), null); urlLauncher = null; } diff --git a/packages/url_launcher/url_launcher_android/example/android/app/build.gradle b/packages/url_launcher/url_launcher_android/example/android/app/build.gradle index 60d78e27eb3d..6d392c2d7e89 100644 --- a/packages/url_launcher/url_launcher_android/example/android/app/build.gradle +++ b/packages/url_launcher/url_launcher_android/example/android/app/build.gradle @@ -32,7 +32,7 @@ android { defaultConfig { applicationId "io.flutter.plugins.urllauncherexample" minSdkVersion flutter.minSdkVersion - targetSdkVersion 30 + targetSdkVersion 34 versionCode flutterVersionCode.toInteger() versionName flutterVersionName testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 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..d951fac2bf31 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-8.7-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/packages/url_launcher/url_launcher_android/example/android/app/src/main/AndroidManifest.xml b/packages/url_launcher/url_launcher_android/example/android/app/src/main/AndroidManifest.xml index 918c29ee2dca..0551b442084a 100644 --- a/packages/url_launcher/url_launcher_android/example/android/app/src/main/AndroidManifest.xml +++ b/packages/url_launcher/url_launcher_android/example/android/app/src/main/AndroidManifest.xml @@ -24,7 +24,8 @@ android:label="url_launcher_example"> diff --git a/packages/url_launcher/url_launcher_android/example/android/build.gradle b/packages/url_launcher/url_launcher_android/example/android/build.gradle index 0c2fe43da28f..9507fa86d992 100644 --- a/packages/url_launcher/url_launcher_android/example/android/build.gradle +++ b/packages/url_launcher/url_launcher_android/example/android/build.gradle @@ -5,7 +5,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:7.4.2' + classpath 'com.android.tools.build:gradle:8.5.1' } } 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..c677a74b9e70 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-8.7-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 256861b72501..daec04ee36be 100644 --- a/packages/url_launcher/url_launcher_android/example/pubspec.yaml +++ b/packages/url_launcher/url_launcher_android/example/pubspec.yaml @@ -3,8 +3,8 @@ description: Demonstrates how to use the url_launcher plugin. publish_to: none environment: - sdk: ^3.4.0 - flutter: ">=3.22.0" + sdk: ^3.5.0 + flutter: ">=3.24.0" dependencies: flutter: @@ -23,7 +23,7 @@ dev_dependencies: sdk: flutter integration_test: sdk: flutter - mockito: 5.4.4 + mockito: ^5.4.4 plugin_platform_interface: ^2.1.7 flutter: diff --git a/packages/url_launcher/url_launcher_android/lib/src/messages.g.dart b/packages/url_launcher/url_launcher_android/lib/src/messages.g.dart index 546f969c8809..af74878f86c1 100644 --- a/packages/url_launcher/url_launcher_android/lib/src/messages.g.dart +++ b/packages/url_launcher/url_launcher_android/lib/src/messages.g.dart @@ -1,9 +1,9 @@ // 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 (v10.1.6), do not edit directly. +// Autogenerated from Pigeon (v22.4.1), 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 +// 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, no_leading_underscores_for_local_identifiers import 'dart:async'; import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List; @@ -11,19 +11,26 @@ import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List; import 'package:flutter/foundation.dart' show ReadBuffer, WriteBuffer; import 'package:flutter/services.dart'; +PlatformException _createConnectionError(String channelName) { + return PlatformException( + code: 'channel-error', + message: 'Unable to establish connection on channel: "$channelName".', + ); +} + /// Configuration options for an in-app WebView. class WebViewOptions { WebViewOptions({ required this.enableJavaScript, required this.enableDomStorage, - required this.headers, + this.headers = const {}, }); bool enableJavaScript; bool enableDomStorage; - Map headers; + Map headers; Object encode() { return [ @@ -38,16 +45,18 @@ class WebViewOptions { return WebViewOptions( enableJavaScript: result[0]! as bool, enableDomStorage: result[1]! as bool, - headers: (result[2] as Map?)!.cast(), + headers: (result[2] as Map?)!.cast(), ); } } +/// Configuration options for in-app browser views. class BrowserOptions { BrowserOptions({ required this.showTitle, }); + /// Whether or not to show the webpage title. bool showTitle; Object encode() { @@ -64,16 +73,19 @@ class BrowserOptions { } } -class _UrlLauncherApiCodec extends StandardMessageCodec { - const _UrlLauncherApiCodec(); +class _PigeonCodec extends StandardMessageCodec { + const _PigeonCodec(); @override void writeValue(WriteBuffer buffer, Object? value) { - if (value is BrowserOptions) { - buffer.putUint8(128); - writeValue(buffer, value.encode()); + if (value is int) { + buffer.putUint8(4); + buffer.putInt64(value); } else if (value is WebViewOptions) { buffer.putUint8(129); writeValue(buffer, value.encode()); + } else if (value is BrowserOptions) { + buffer.putUint8(130); + writeValue(buffer, value.encode()); } else { super.writeValue(buffer, value); } @@ -82,10 +94,10 @@ class _UrlLauncherApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: - return BrowserOptions.decode(readValue(buffer)!); case 129: return WebViewOptions.decode(readValue(buffer)!); + case 130: + return BrowserOptions.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); } @@ -96,153 +108,158 @@ class UrlLauncherApi { /// Constructor for [UrlLauncherApi]. The [binaryMessenger] named argument is /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. - UrlLauncherApi({BinaryMessenger? binaryMessenger}) - : _binaryMessenger = binaryMessenger; - final BinaryMessenger? _binaryMessenger; + UrlLauncherApi( + {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) + : pigeonVar_binaryMessenger = binaryMessenger, + pigeonVar_messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + final BinaryMessenger? pigeonVar_binaryMessenger; - static const MessageCodec codec = _UrlLauncherApiCodec(); + static const MessageCodec pigeonChannelCodec = _PigeonCodec(); + + final String pigeonVar_messageChannelSuffix; /// Returns true if the URL can definitely be launched. - Future canLaunchUrl(String arg_url) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.url_launcher_android.UrlLauncherApi.canLaunchUrl', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_url]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + Future canLaunchUrl(String url) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.url_launcher_android.UrlLauncherApi.canLaunchUrl$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([url]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (replyList[0] == null) { + } else if (pigeonVar_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 (pigeonVar_replyList[0] as bool?)!; } } /// Opens the URL externally, returning true if successful. - Future launchUrl( - String arg_url, Map arg_headers) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.url_launcher_android.UrlLauncherApi.launchUrl', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_url, arg_headers]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + Future launchUrl(String url, Map headers) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.url_launcher_android.UrlLauncherApi.launchUrl$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([url, headers]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (replyList[0] == null) { + } else if (pigeonVar_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 (pigeonVar_replyList[0] as bool?)!; } } - /// Opens the URL in an in-app WebView, returning true if it opens - /// successfully. - Future openUrlInApp( - String arg_url, - bool arg_allowCustomTab, - WebViewOptions arg_webViewOptions, - BrowserOptions arg_browserOptions) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.url_launcher_android.UrlLauncherApi.openUrlInApp', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send([ - arg_url, - arg_allowCustomTab, - arg_webViewOptions, - arg_browserOptions - ]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + /// Opens the URL in an in-app Custom Tab or WebView, returning true if it + /// opens successfully. + Future openUrlInApp(String url, bool allowCustomTab, + WebViewOptions webViewOptions, BrowserOptions browserOptions) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.url_launcher_android.UrlLauncherApi.openUrlInApp$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = await pigeonVar_channel.send( + [url, allowCustomTab, webViewOptions, browserOptions]) + as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (replyList[0] == null) { + } else if (pigeonVar_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 (pigeonVar_replyList[0] as bool?)!; } } Future supportsCustomTabs() async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.url_launcher_android.UrlLauncherApi.supportsCustomTabs', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send(null) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.url_launcher_android.UrlLauncherApi.supportsCustomTabs$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (replyList[0] == null) { + } else if (pigeonVar_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 (pigeonVar_replyList[0] as bool?)!; } } /// Closes the view opened by [openUrlInSafariViewController]. Future closeWebView() async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.url_launcher_android.UrlLauncherApi.closeWebView', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send(null) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.url_launcher_android.UrlLauncherApi.closeWebView$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; diff --git a/packages/url_launcher/url_launcher_android/lib/url_launcher_android.dart b/packages/url_launcher/url_launcher_android/lib/url_launcher_android.dart index 2c6d01c9b311..7a447d5203f3 100644 --- a/packages/url_launcher/url_launcher_android/lib/url_launcher_android.dart +++ b/packages/url_launcher/url_launcher_android/lib/url_launcher_android.dart @@ -89,11 +89,10 @@ class UrlLauncherAndroid extends UrlLauncherPlatform { case PreferredLaunchMode.platformDefault: // Intentionally treat any new values as platformDefault; see comment in // supportsMode. - // ignore: no_default_cases + // ignore: no_default_cases, unreachable_switch_default default: // By default, open web URLs in the application. inApp = url.startsWith('http:') || url.startsWith('https:'); - break; } final bool succeeded; diff --git a/packages/url_launcher/url_launcher_android/pigeons/messages.dart b/packages/url_launcher/url_launcher_android/pigeons/messages.dart index 6f39272c4f7f..f3a3795339d3 100644 --- a/packages/url_launcher/url_launcher_android/pigeons/messages.dart +++ b/packages/url_launcher/url_launcher_android/pigeons/messages.dart @@ -21,10 +21,7 @@ class WebViewOptions { final bool enableJavaScript; final bool enableDomStorage; - // TODO(stuartmorgan): Declare these as non-nullable generics once - // https://github.com/flutter/flutter/issues/97848 is fixed. In practice, - // the values will never be null, and the native implementation assumes that. - final Map headers; + final Map headers; } /// Configuration options for in-app browser views. diff --git a/packages/url_launcher/url_launcher_android/pubspec.yaml b/packages/url_launcher/url_launcher_android/pubspec.yaml index ae2cfbf9e675..6603730ecf1e 100644 --- a/packages/url_launcher/url_launcher_android/pubspec.yaml +++ b/packages/url_launcher/url_launcher_android/pubspec.yaml @@ -2,10 +2,10 @@ name: url_launcher_android description: Android implementation of the url_launcher plugin. repository: https://github.com/flutter/packages/tree/main/packages/url_launcher/url_launcher_android issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+url_launcher%22 -version: 6.3.9 +version: 6.3.13 environment: - sdk: ^3.4.0 - flutter: ">=3.22.0" + sdk: ^3.5.0 + flutter: ">=3.24.0" flutter: plugin: @@ -24,8 +24,8 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - mockito: 5.4.4 - pigeon: ^10.0.0 + mockito: ^5.4.4 + pigeon: ^22.4.1 plugin_platform_interface: ^2.1.7 test: ^1.16.3 diff --git a/packages/url_launcher/url_launcher_android/test/url_launcher_android_test.dart b/packages/url_launcher/url_launcher_android/test/url_launcher_android_test.dart index 7b469246a5c1..63745ec74cb4 100644 --- a/packages/url_launcher/url_launcher_android/test/url_launcher_android_test.dart +++ b/packages/url_launcher/url_launcher_android/test/url_launcher_android_test.dart @@ -429,7 +429,7 @@ class _FakeUrlLauncherApi implements UrlLauncherApi { } @override - Future launchUrl(String url, Map headers) async { + Future launchUrl(String url, Map headers) async { passedWebViewOptions = WebViewOptions( enableJavaScript: false, enableDomStorage: false, @@ -478,4 +478,12 @@ class _FakeUrlLauncherApi implements UrlLauncherApi { return false; } } + + @override + // ignore: non_constant_identifier_names + BinaryMessenger? get pigeonVar_binaryMessenger => null; + + @override + // ignore: non_constant_identifier_names + String get pigeonVar_messageChannelSuffix => ''; } diff --git a/packages/url_launcher/url_launcher_ios/lib/url_launcher_ios.dart b/packages/url_launcher/url_launcher_ios/lib/url_launcher_ios.dart index 24b25acb3896..bb289abc5699 100644 --- a/packages/url_launcher/url_launcher_ios/lib/url_launcher_ios.dart +++ b/packages/url_launcher/url_launcher_ios/lib/url_launcher_ios.dart @@ -82,11 +82,10 @@ class UrlLauncherIOS extends UrlLauncherPlatform { // Intentionally treat any new values as platformDefault; support for any // new mode requires intentional opt-in, otherwise falling back is the // documented behavior. - // ignore: no_default_cases + // ignore: no_default_cases, unreachable_switch_default default: // By default, open web URLs in the application. inApp = url.startsWith('http:') || url.startsWith('https:'); - break; } if (inApp) { @@ -111,7 +110,7 @@ class UrlLauncherIOS extends UrlLauncherPlatform { // Default is a desired behavior here since support for new modes is // always opt-in, and the enum lives in a different package, so silently // adding "false" for new values is the correct behavior. - // ignore: no_default_cases + // ignore: no_default_cases, unreachable_switch_default default: return false; } diff --git a/packages/url_launcher/url_launcher_ios/pubspec.yaml b/packages/url_launcher/url_launcher_ios/pubspec.yaml index af86f925e374..684bd9e4242b 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.4 + mockito: ^5.4.4 pigeon: ^11.0.1 plugin_platform_interface: ^2.1.7 test: ^1.16.3 diff --git a/packages/url_launcher/url_launcher_macos/CHANGELOG.md b/packages/url_launcher/url_launcher_macos/CHANGELOG.md index 81f5a10f7faa..2dcb75263873 100644 --- a/packages/url_launcher/url_launcher_macos/CHANGELOG.md +++ b/packages/url_launcher/url_launcher_macos/CHANGELOG.md @@ -1,5 +1,6 @@ -## NEXT +## 3.2.1 +* Adds privacy manifest. * Updates minimum supported SDK version to Flutter 3.19/Dart 3.3. ## 3.2.0 diff --git a/packages/url_launcher/url_launcher_macos/macos/url_launcher_macos.podspec b/packages/url_launcher/url_launcher_macos/macos/url_launcher_macos.podspec index de18c66e7d0d..a7f88852d2c4 100644 --- a/packages/url_launcher/url_launcher_macos/macos/url_launcher_macos.podspec +++ b/packages/url_launcher/url_launcher_macos/macos/url_launcher_macos.podspec @@ -13,6 +13,7 @@ Pod::Spec.new do |s| s.author = { 'Flutter Team' => 'flutter-dev@googlegroups.com' } s.source = { :http => 'https://github.com/flutter/packages/tree/main/packages/url_launcher/url_launcher_macos' } s.source_files = 'url_launcher_macos/Sources/url_launcher_macos/**/*.swift' + s.resource_bundles = {'url_launcher_macos_privacy' => ['url_launcher_macos/Sources/url_launcher_macos/Resources/PrivacyInfo.xcprivacy']} s.dependency 'FlutterMacOS' s.platform = :osx, '10.14' diff --git a/packages/url_launcher/url_launcher_macos/macos/url_launcher_macos/Sources/url_launcher_macos/Resources/.gitkeep b/packages/url_launcher/url_launcher_macos/macos/url_launcher_macos/Sources/url_launcher_macos/Resources/.gitkeep deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/packages/url_launcher/url_launcher_macos/macos/url_launcher_macos/Sources/url_launcher_macos/Resources/PrivacyInfo.xcprivacy b/packages/url_launcher/url_launcher_macos/macos/url_launcher_macos/Sources/url_launcher_macos/Resources/PrivacyInfo.xcprivacy new file mode 100644 index 000000000000..918d80be4306 --- /dev/null +++ b/packages/url_launcher/url_launcher_macos/macos/url_launcher_macos/Sources/url_launcher_macos/Resources/PrivacyInfo.xcprivacy @@ -0,0 +1,12 @@ + + + + + NSPrivacyTrackingDomains + + NSPrivacyCollectedDataTypes + + NSPrivacyTracking + + + diff --git a/packages/url_launcher/url_launcher_macos/pubspec.yaml b/packages/url_launcher/url_launcher_macos/pubspec.yaml index 1f1d570ce661..d5e29fc0e9d5 100644 --- a/packages/url_launcher/url_launcher_macos/pubspec.yaml +++ b/packages/url_launcher/url_launcher_macos/pubspec.yaml @@ -2,7 +2,7 @@ name: url_launcher_macos description: macOS implementation of the url_launcher plugin. repository: https://github.com/flutter/packages/tree/main/packages/url_launcher/url_launcher_macos issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+url_launcher%22 -version: 3.2.0 +version: 3.2.1 environment: sdk: ^3.3.0 diff --git a/packages/url_launcher/url_launcher_platform_interface/pubspec.yaml b/packages/url_launcher/url_launcher_platform_interface/pubspec.yaml index e8821446f474..b31502a3d6c5 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.4 + mockito: ^5.4.4 topics: - links diff --git a/packages/url_launcher/url_launcher_web/example/pubspec.yaml b/packages/url_launcher/url_launcher_web/example/pubspec.yaml index 7ad4adc04e2b..606f477b4a40 100644 --- a/packages/url_launcher/url_launcher_web/example/pubspec.yaml +++ b/packages/url_launcher/url_launcher_web/example/pubspec.yaml @@ -14,7 +14,7 @@ dev_dependencies: sdk: flutter integration_test: sdk: flutter - mockito: 5.4.4 + mockito: ^5.4.4 url_launcher_platform_interface: ^2.2.0 url_launcher_web: path: ../ diff --git a/packages/url_launcher/url_launcher_windows/CHANGELOG.md b/packages/url_launcher/url_launcher_windows/CHANGELOG.md index 13405529be9b..668ee6eff6ac 100644 --- a/packages/url_launcher/url_launcher_windows/CHANGELOG.md +++ b/packages/url_launcher/url_launcher_windows/CHANGELOG.md @@ -1,6 +1,7 @@ -## NEXT +## 3.1.3 * Updates minimum supported SDK version to Flutter 3.19/Dart 3.3. +* Fixes handling of `file:` URLs that contain UTF-8 encoded paths. ## 3.1.2 diff --git a/packages/url_launcher/url_launcher_windows/pubspec.yaml b/packages/url_launcher/url_launcher_windows/pubspec.yaml index addd5363905c..629e9dc71963 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.2 +version: 3.1.3 environment: sdk: ^3.3.0 diff --git a/packages/url_launcher/url_launcher_windows/windows/CMakeLists.txt b/packages/url_launcher/url_launcher_windows/windows/CMakeLists.txt index da39522c5625..2b07f3a75a0b 100644 --- a/packages/url_launcher/url_launcher_windows/windows/CMakeLists.txt +++ b/packages/url_launcher/url_launcher_windows/windows/CMakeLists.txt @@ -25,7 +25,7 @@ set_target_properties(${PLUGIN_NAME} PROPERTIES CXX_VISIBILITY_PRESET hidden) target_compile_definitions(${PLUGIN_NAME} PRIVATE FLUTTER_PLUGIN_IMPL) target_include_directories(${PLUGIN_NAME} INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/include") -target_link_libraries(${PLUGIN_NAME} PRIVATE flutter flutter_wrapper_plugin) +target_link_libraries(${PLUGIN_NAME} PRIVATE flutter flutter_wrapper_plugin shlwapi.lib) # List of absolute paths to libraries that should be bundled with the plugin set(file_chooser_bundled_libraries @@ -62,7 +62,7 @@ add_executable(${TEST_RUNNER} ) apply_standard_settings(${TEST_RUNNER}) target_include_directories(${TEST_RUNNER} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") -target_link_libraries(${TEST_RUNNER} PRIVATE flutter_wrapper_plugin) +target_link_libraries(${TEST_RUNNER} PRIVATE flutter_wrapper_plugin shlwapi.lib) target_link_libraries(${TEST_RUNNER} PRIVATE gtest_main gmock) # flutter_wrapper_plugin has link dependencies on the Flutter DLL. add_custom_command(TARGET ${TEST_RUNNER} POST_BUILD 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..db46e1a4a983 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 @@ -22,10 +22,12 @@ namespace { using flutter::EncodableMap; using flutter::EncodableValue; +using ::testing::_; using ::testing::DoAll; using ::testing::Pointee; using ::testing::Return; using ::testing::SetArgPointee; +using ::testing::StrEq; class MockSystemApis : public SystemApis { public: @@ -135,5 +137,28 @@ TEST(UrlLauncherPlugin, LaunchReportsError) { EXPECT_TRUE(result.has_error()); } +TEST(UrlLauncherPlugin, LaunchUTF8EncodedFileURLSuccess) { + std::unique_ptr system = std::make_unique(); + + // Return a success value (>32) from launching. + EXPECT_CALL( + *system, + ShellExecuteW( + _, StrEq(L"open"), + // 家の管理/スキャナ"), + StrEq( + L"file:///G:/\x5bb6\x306e\x7ba1\x7406/\x30b9\x30ad\x30e3\x30ca"), + _, _, _)) + .WillOnce(Return(reinterpret_cast(33))); + + UrlLauncherPlugin plugin(std::move(system)); + ErrorOr result = plugin.LaunchUrl( + "file:///G:/%E5%AE%B6%E3%81%AE%E7%AE%A1%E7%90%86/" + "%E3%82%B9%E3%82%AD%E3%83%A3%E3%83%8A"); + + ASSERT_FALSE(result.has_error()); + EXPECT_TRUE(result.value()); +} + } // namespace test } // namespace url_launcher_windows 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..b737b4579b8b 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 @@ -6,6 +6,7 @@ #include #include #include +#include #include #include @@ -98,7 +99,19 @@ ErrorOr UrlLauncherPlugin::CanLaunchUrl(const std::string& url) { } ErrorOr UrlLauncherPlugin::LaunchUrl(const std::string& url) { - std::wstring url_wide = Utf16FromUtf8(url); + std::wstring url_wide; + if (url.find("file:") == 0) { + // ShellExecuteW does not process %-encoded UTF8 strings in file URLs. + DWORD unescaped_len = 0; + std::string unescaped_url = url; + if (FAILED(::UrlUnescapeA(unescaped_url.data(), /*pszUnescaped=*/nullptr, + &unescaped_len, URL_UNESCAPE_INPLACE))) { + return FlutterError("open_error", "Failed to unescape file URL"); + } + url_wide = Utf16FromUtf8(unescaped_url); + } else { + url_wide = Utf16FromUtf8(url); + } int status = static_cast(reinterpret_cast( system_apis_->ShellExecuteW(nullptr, TEXT("open"), url_wide.c_str(), diff --git a/packages/video_player/video_player/CHANGELOG.md b/packages/video_player/video_player/CHANGELOG.md index c41c8f131fdf..5e448be001b3 100644 --- a/packages/video_player/video_player/CHANGELOG.md +++ b/packages/video_player/video_player/CHANGELOG.md @@ -1,6 +1,8 @@ -## NEXT +## 2.9.2 * Updates minimum supported SDK version to Flutter 3.19/Dart 3.3. +* Throws a more descriptive `StateError` in the case where + `VideoPlayerController.initialize` receives more than one `initialized` event. ## 2.9.1 diff --git a/packages/video_player/video_player/example/android/app/build.gradle b/packages/video_player/video_player/example/android/app/build.gradle index 097935b6b0bf..445511215d63 100644 --- a/packages/video_player/video_player/example/android/app/build.gradle +++ b/packages/video_player/video_player/example/android/app/build.gradle @@ -29,8 +29,8 @@ android { compileSdk flutter.compileSdkVersion compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_11 + targetCompatibility JavaVersion.VERSION_11 } defaultConfig { 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..d951fac2bf31 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-8.7-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/packages/video_player/video_player/example/android/build.gradle b/packages/video_player/video_player/example/android/build.gradle index cec92de922cf..0bed8906c094 100644 --- a/packages/video_player/video_player/example/android/build.gradle +++ b/packages/video_player/video_player/example/android/build.gradle @@ -5,7 +5,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:7.4.2' + classpath 'com.android.tools.build:gradle:8.5.2' } } 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..7aeeb11c6ee5 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-8.7-all.zip diff --git a/packages/video_player/video_player/lib/video_player.dart b/packages/video_player/video_player/lib/video_player.dart index c8acd6e969b5..b7ba8340fa66 100644 --- a/packages/video_player/video_player/lib/video_player.dart +++ b/packages/video_player/video_player/lib/video_player.dart @@ -465,6 +465,16 @@ class VideoPlayerController extends ValueNotifier { errorDescription: null, isCompleted: false, ); + assert( + !initializingCompleter.isCompleted, + 'VideoPlayerController already initialized. This is typically a ' + 'sign that an implementation of the VideoPlayerPlatform ' + '(${_videoPlayerPlatform.runtimeType}) has a bug and is sending ' + 'more than one initialized event per instance.', + ); + if (initializingCompleter.isCompleted) { + throw StateError('VideoPlayerController already initialized'); + } initializingCompleter.complete(null); _applyLooping(); _applyVolume(); diff --git a/packages/video_player/video_player/pubspec.yaml b/packages/video_player/video_player/pubspec.yaml index 7ee58c198416..6e8b92684d7c 100644 --- a/packages/video_player/video_player/pubspec.yaml +++ b/packages/video_player/video_player/pubspec.yaml @@ -3,7 +3,7 @@ description: Flutter plugin for displaying inline video with other Flutter widgets on Android, iOS, and web. repository: https://github.com/flutter/packages/tree/main/packages/video_player/video_player issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+video_player%22 -version: 2.9.1 +version: 2.9.2 environment: sdk: ^3.3.0 diff --git a/packages/video_player/video_player_android/CHANGELOG.md b/packages/video_player/video_player_android/CHANGELOG.md index e6815fce6ef1..8951fff9f512 100644 --- a/packages/video_player/video_player_android/CHANGELOG.md +++ b/packages/video_player/video_player_android/CHANGELOG.md @@ -1,3 +1,88 @@ +## 2.7.15 + +* Changes the rotation correction calculation for Android API 29+ to use + the one that is reported by the video's format instead of the unapplied + rotation degrees that Exoplayer does not report on Android API 21+. +* Changes the rotation correction calculation for Android APIs 21-28 to 0 + because the Impeller backend used on those API versions correctly rotates + the video being played automatically. + +## 2.7.14 + +* Removes SSL workaround for API 19, which is no longer supported. + +## 2.7.13 + +* When `AndroidVideoPlayer` attempts to operate on a `textureId` that is not + active (i.e. it was previously disposed or never created), the resulting + platform exception is more informative than a "NullPointerException". + +## 2.7.12 + +* Fixes a [bug](https://github.com/flutter/flutter/issues/156451) where + additional harmless but annoying warnings in the form of native stack traces + would be printed when the app was backgrounded. There may be additional + warnings that are not yet fixed, but this should address the + most common case. + +## 2.7.11 + +* Fixes a [bug](https://github.com/flutter/flutter/issues/156158) where a + harmless but annoying warning in the form of a native stack trace would be + printed when a previously disposed video player received a trim memory event + (i.e. by backgrounding). + +## 2.7.10 + +* Fixes a [bug](https://github.com/flutter/flutter/issues/156158) where + disposing a video player (including implicitly by switching tabs or views + in a running app) would cause native stack traces. + +## 2.7.9 + +* Updates Java compatibility version to 11. + +## 2.7.8 + +* Updates Pigeon for non-nullable collection type support. + +## 2.7.7 + +* Removes the flag to treat warnings as errors in client builds. + +## 2.7.6 + +* Fixes a [bug](https://github.com/flutter/flutter/issues/154602) where + resuming a video player would cause a `Bad state: Future already completed`. + +## 2.7.5 + +* Add a deprecation suppression in advance of a new `SurfaceProducer` API. + +## 2.7.4 + +* Fixes a [bug](https://github.com/flutter/flutter/issues/154559) where + resuming (or using a plugin like `share_plus` that implicitly resumes the + activity where) a video player would cause a `DecoderInitializationException`. + +## 2.7.3 + +* Updates Media3-ExoPlayer to 1.4.1. + +## 2.7.2 + +* Updates minimum supported SDK version to Flutter 3.24/Dart 3.5. + +* Re-adds Impeller support. + +## 2.7.1 + +* Revert Impeller support. + +## 2.7.0 + +* Re-adds [support for Impeller](https://docs.flutter.dev/release/breaking-changes/android-surface-plugins). + ## 2.6.0 * Adds RTSP support. diff --git a/packages/video_player/video_player_android/android/build.gradle b/packages/video_player/video_player_android/android/build.gradle index af5008314a71..92decbdda718 100644 --- a/packages/video_player/video_player_android/android/build.gradle +++ b/packages/video_player/video_player_android/android/build.gradle @@ -1,6 +1,5 @@ group 'io.flutter.plugins.videoplayer' version '1.0-SNAPSHOT' -def args = ["-Xlint:deprecation","-Xlint:unchecked","-Werror"] buildscript { repositories { @@ -20,21 +19,14 @@ rootProject.allprojects { } } -project.getTasks().withType(JavaCompile){ - options.compilerArgs.addAll(args) -} - apply plugin: 'com.android.library' android { - // Conditional for compatibility with AGP <4.2. - if (project.android.hasProperty("namespace")) { - namespace 'io.flutter.plugins.videoplayer' - } + namespace 'io.flutter.plugins.videoplayer' compileSdk 34 defaultConfig { - minSdkVersion 19 + minSdkVersion 21 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } lintOptions { @@ -43,12 +35,12 @@ android { disable 'AndroidGradlePluginVersion', 'InvalidPackage', 'GradleDependency', 'NewerVersionAvailable' } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_11 + targetCompatibility JavaVersion.VERSION_11 } dependencies { - def exoplayer_version = "1.4.0" + def exoplayer_version = "1.4.1" implementation "androidx.media3:media3-exoplayer:${exoplayer_version}" implementation "androidx.media3:media3-exoplayer-hls:${exoplayer_version}" implementation "androidx.media3:media3-exoplayer-dash:${exoplayer_version}" @@ -65,6 +57,11 @@ android { unitTests.includeAndroidResources = true unitTests.returnDefaultValues = true unitTests.all { + // The org.gradle.jvmargs property that may be set in gradle.properties does not impact + // the Java heap size when running the Android unit tests. The following property here + // sets the heap size to a size large enough to run the robolectric tests across + // multiple SDK levels. + jvmArgs "-Xmx1g" testLogging { events "passed", "skipped", "failed", "standardOut", "standardError" outputs.upToDateWhen {false} diff --git a/packages/video_player/video_player_android/android/src/main/java/io/flutter/plugins/videoplayer/CustomSSLSocketFactory.java b/packages/video_player/video_player_android/android/src/main/java/io/flutter/plugins/videoplayer/CustomSSLSocketFactory.java deleted file mode 100644 index 731bb9798f65..000000000000 --- a/packages/video_player/video_player_android/android/src/main/java/io/flutter/plugins/videoplayer/CustomSSLSocketFactory.java +++ /dev/null @@ -1,76 +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. - -package io.flutter.plugins.videoplayer; - -import java.io.IOException; -import java.net.InetAddress; -import java.net.Socket; -import java.security.KeyManagementException; -import java.security.NoSuchAlgorithmException; -import javax.net.ssl.SSLContext; -import javax.net.ssl.SSLSocket; -import javax.net.ssl.SSLSocketFactory; - -// SSLSocketFactory does not have nullability annotations. -@SuppressWarnings("UnknownNullness") -public class CustomSSLSocketFactory extends SSLSocketFactory { - private final SSLSocketFactory sslSocketFactory; - - public CustomSSLSocketFactory() throws KeyManagementException, NoSuchAlgorithmException { - SSLContext context = SSLContext.getInstance("TLS"); - context.init(null, null, null); - sslSocketFactory = context.getSocketFactory(); - } - - @Override - public String[] getDefaultCipherSuites() { - return sslSocketFactory.getDefaultCipherSuites(); - } - - @Override - public String[] getSupportedCipherSuites() { - return sslSocketFactory.getSupportedCipherSuites(); - } - - @Override - public Socket createSocket() throws IOException { - return enableProtocols(sslSocketFactory.createSocket()); - } - - @Override - public Socket createSocket(Socket s, String host, int port, boolean autoClose) - throws IOException { - return enableProtocols(sslSocketFactory.createSocket(s, host, port, autoClose)); - } - - @Override - public Socket createSocket(String host, int port) throws IOException { - return enableProtocols(sslSocketFactory.createSocket(host, port)); - } - - @Override - public Socket createSocket(String host, int port, InetAddress localHost, int localPort) - throws IOException { - return enableProtocols(sslSocketFactory.createSocket(host, port, localHost, localPort)); - } - - @Override - public Socket createSocket(InetAddress host, int port) throws IOException { - return enableProtocols(sslSocketFactory.createSocket(host, port)); - } - - @Override - public Socket createSocket(InetAddress address, int port, InetAddress localAddress, int localPort) - throws IOException { - return enableProtocols(sslSocketFactory.createSocket(address, port, localAddress, localPort)); - } - - private Socket enableProtocols(Socket socket) { - if (socket instanceof SSLSocket) { - ((SSLSocket) socket).setEnabledProtocols(new String[] {"TLSv1.1", "TLSv1.2"}); - } - return socket; - } -} diff --git a/packages/video_player/video_player_android/android/src/main/java/io/flutter/plugins/videoplayer/ExoPlayerEventListener.java b/packages/video_player/video_player_android/android/src/main/java/io/flutter/plugins/videoplayer/ExoPlayerEventListener.java index 0940cc8b3227..df6115fd5846 100644 --- a/packages/video_player/video_player_android/android/src/main/java/io/flutter/plugins/videoplayer/ExoPlayerEventListener.java +++ b/packages/video_player/video_player_android/android/src/main/java/io/flutter/plugins/videoplayer/ExoPlayerEventListener.java @@ -4,21 +4,56 @@ package io.flutter.plugins.videoplayer; +import android.os.Build; import androidx.annotation.NonNull; +import androidx.annotation.OptIn; +import androidx.media3.common.Format; import androidx.media3.common.PlaybackException; import androidx.media3.common.Player; import androidx.media3.common.VideoSize; import androidx.media3.exoplayer.ExoPlayer; +import java.util.Objects; final class ExoPlayerEventListener implements Player.Listener { private final ExoPlayer exoPlayer; private final VideoPlayerCallbacks events; private boolean isBuffering = false; - private boolean isInitialized = false; + private boolean isInitialized; + + private enum RotationDegrees { + ROTATE_0(0), + ROTATE_90(90), + ROTATE_180(180), + ROTATE_270(270); + + private final int degrees; + + RotationDegrees(int degrees) { + this.degrees = degrees; + } + + public static RotationDegrees fromDegrees(int degrees) { + for (RotationDegrees rotationDegrees : RotationDegrees.values()) { + if (rotationDegrees.degrees == degrees) { + return rotationDegrees; + } + } + throw new IllegalArgumentException("Invalid rotation degrees specified: " + degrees); + } + + public int getDegrees() { + return this.degrees; + } + } ExoPlayerEventListener(ExoPlayer exoPlayer, VideoPlayerCallbacks events) { + this(exoPlayer, events, false); + } + + ExoPlayerEventListener(ExoPlayer exoPlayer, VideoPlayerCallbacks events, boolean initialized) { this.exoPlayer = exoPlayer; this.events = events; + this.isInitialized = initialized; } private void setBuffering(boolean buffering) { @@ -44,23 +79,80 @@ private void sendInitialized() { int width = videoSize.width; int height = videoSize.height; if (width != 0 && height != 0) { - int rotationDegrees = videoSize.unappliedRotationDegrees; - // Switch the width/height if video was taken in portrait mode - if (rotationDegrees == 90 || rotationDegrees == 270) { + RotationDegrees reportedRotationCorrection = RotationDegrees.ROTATE_0; + + if (Build.VERSION.SDK_INT <= 21) { + // On API 21 and below, Exoplayer may not internally handle rotation correction + // and reports it through VideoSize.unappliedRotationDegrees. We may apply it to + // fix the case of upside-down playback. + try { + reportedRotationCorrection = + RotationDegrees.fromDegrees(videoSize.unappliedRotationDegrees); + rotationCorrection = + getRotationCorrectionFromUnappliedRotation(reportedRotationCorrection); + } catch (IllegalArgumentException e) { + // Unapplied rotation other than 0, 90, 180, 270 reported by VideoSize. Because this is unexpected, + // we apply no rotation correction. + reportedRotationCorrection = RotationDegrees.ROTATE_0; + rotationCorrection = 0; + } + } + // TODO(camsim99): Replace this with a call to `handlesCropAndRotation` when it is + // available in stable. https://github.com/flutter/flutter/issues/157198 + else if (Build.VERSION.SDK_INT < 29) { + // When the SurfaceTexture backend for Impeller is used, the preview should already + // be correctly rotated. + rotationCorrection = 0; + } else { + // The video's Format also provides a rotation correction that may be used to + // correct the rotation, so we try to use that to correct the video rotation + // when the ImageReader backend for Impeller is used. + rotationCorrection = getRotationCorrectionFromFormat(exoPlayer); + + try { + reportedRotationCorrection = RotationDegrees.fromDegrees(rotationCorrection); + } catch (IllegalArgumentException e) { + // Rotation correction other than 0, 90, 180, 270 reported by Format. Because this is unexpected, + // we apply no rotation correction. + reportedRotationCorrection = RotationDegrees.ROTATE_0; + rotationCorrection = 0; + } + } + + // Switch the width/height if video was taken in portrait mode and a rotation + // correction was detected. + if (reportedRotationCorrection == RotationDegrees.ROTATE_90 + || reportedRotationCorrection == RotationDegrees.ROTATE_270) { width = videoSize.height; height = videoSize.width; } - // Rotating the video with ExoPlayer does not seem to be possible with a Surface, - // so inform the Flutter code that the widget needs to be rotated to prevent - // upside-down playback for videos with rotationDegrees of 180 (other orientations work - // correctly without correction). - if (rotationDegrees == 180) { - rotationCorrection = rotationDegrees; - } } events.onInitialized(width, height, exoPlayer.getDuration(), rotationCorrection); } + private int getRotationCorrectionFromUnappliedRotation(RotationDegrees unappliedRotationDegrees) { + int rotationCorrection = 0; + + // Rotating the video with ExoPlayer does not seem to be possible with a Surface, + // so inform the Flutter code that the widget needs to be rotated to prevent + // upside-down playback for videos with unappliedRotationDegrees of 180 (other orientations + // work correctly without correction). + if (unappliedRotationDegrees == RotationDegrees.ROTATE_180) { + rotationCorrection = unappliedRotationDegrees.getDegrees(); + } + + return rotationCorrection; + } + + @OptIn(markerClass = androidx.media3.common.util.UnstableApi.class) + // A video's Format and its rotation degrees are unstable because they are not guaranteed + // the same implementation across API versions. It is possible that this logic may need + // revisiting should the implementation change across versions of the Exoplayer API. + private int getRotationCorrectionFromFormat(ExoPlayer exoPlayer) { + Format videoFormat = Objects.requireNonNull(exoPlayer.getVideoFormat()); + return videoFormat.rotationDegrees; + } + @Override public void onPlaybackStateChanged(final int playbackState) { switch (playbackState) { diff --git a/packages/video_player/video_player_android/android/src/main/java/io/flutter/plugins/videoplayer/ExoPlayerState.java b/packages/video_player/video_player_android/android/src/main/java/io/flutter/plugins/videoplayer/ExoPlayerState.java new file mode 100644 index 000000000000..cd55b54c1247 --- /dev/null +++ b/packages/video_player/video_player_android/android/src/main/java/io/flutter/plugins/videoplayer/ExoPlayerState.java @@ -0,0 +1,69 @@ +// 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. + +package io.flutter.plugins.videoplayer; + +import androidx.media3.common.PlaybackParameters; +import androidx.media3.exoplayer.ExoPlayer; + +/** + * Internal state representing an {@link ExoPlayer} instance at a snapshot in time. + * + *

During the Android application lifecycle, the underlying {@link android.view.Surface} being + * rendered to by the player can be destroyed when the application is in the background and memory + * is reclaimed. Upon resume, the player will need to be recreated, but start again at the + * previous point (and settings). + */ +final class ExoPlayerState { + /** + * Saves a representation of the current state of the player at the current point in time. + * + *

The inverse of this operation is {@link #restore(ExoPlayer)}. + * + * @param exoPlayer the active player instance. + * @return an opaque object representing the state. + */ + static ExoPlayerState save(ExoPlayer exoPlayer) { + return new ExoPlayerState( + /*position=*/ exoPlayer.getCurrentPosition(), + /*repeatMode=*/ exoPlayer.getRepeatMode(), + /*volume=*/ exoPlayer.getVolume(), + /*playbackParameters=*/ exoPlayer.getPlaybackParameters()); + } + + private ExoPlayerState( + long position, int repeatMode, float volume, PlaybackParameters playbackParameters) { + this.position = position; + this.repeatMode = repeatMode; + this.volume = volume; + this.playbackParameters = playbackParameters; + } + + /** Previous value of {@link ExoPlayer#getCurrentPosition()}. */ + private final long position; + + /** Previous value of {@link ExoPlayer#getRepeatMode()}. */ + private final int repeatMode; + + /** Previous value of {@link ExoPlayer#getVolume()}. */ + private final float volume; + + /** Previous value of {@link ExoPlayer#getPlaybackParameters()}. */ + private final PlaybackParameters playbackParameters; + + /** + * Restores the captured state onto the provided player. + * + *

This will typically be done after creating a new player, setting up a media source, and + * listening to events. + * + * @param exoPlayer the new player instance to reflect the state back to. + */ + void restore(ExoPlayer exoPlayer) { + exoPlayer.seekTo(position); + exoPlayer.setRepeatMode(repeatMode); + exoPlayer.setVolume(volume); + exoPlayer.setPlaybackParameters(playbackParameters); + } +} diff --git a/packages/video_player/video_player_android/android/src/main/java/io/flutter/plugins/videoplayer/Messages.java b/packages/video_player/video_player_android/android/src/main/java/io/flutter/plugins/videoplayer/Messages.java index e0790af8b86d..b37b3b098f28 100644 --- a/packages/video_player/video_player_android/android/src/main/java/io/flutter/plugins/videoplayer/Messages.java +++ b/packages/video_player/video_player_android/android/src/main/java/io/flutter/plugins/videoplayer/Messages.java @@ -1,11 +1,14 @@ // 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 (v9.2.5), do not edit directly. +// Autogenerated from Pigeon (v22.4.2), do not edit directly. // See also: https://pub.dev/packages/pigeon package io.flutter.plugins.videoplayer; +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; @@ -14,9 +17,12 @@ 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.Map; +import java.util.Objects; /** Generated class from Pigeon. */ @SuppressWarnings({"unused", "unchecked", "CodeBlock2Expr", "RedundantSuppression", "serial"}) @@ -40,7 +46,7 @@ public FlutterError(@NonNull String code, @Nullable String message, @Nullable Ob @NonNull protected static ArrayList wrapError(@NonNull Throwable exception) { - ArrayList errorList = new ArrayList(3); + ArrayList errorList = new ArrayList<>(3); if (exception instanceof FlutterError) { FlutterError error = (FlutterError) exception; errorList.add(error.code); @@ -55,6 +61,10 @@ protected static ArrayList wrapError(@NonNull Throwable exception) { return errorList; } + @Target(METHOD) + @Retention(CLASS) + @interface CanIgnoreReturnValue {} + /** Generated class from Pigeon that represents data sent in messages. */ public static final class TextureMessage { private @NonNull Long textureId; @@ -73,10 +83,28 @@ public void setTextureId(@NonNull Long setterArg) { /** Constructor is non-public to enforce null safety; use Builder. */ TextureMessage() {} + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TextureMessage that = (TextureMessage) o; + return textureId.equals(that.textureId); + } + + @Override + public int hashCode() { + return Objects.hash(textureId); + } + public static final class Builder { private @Nullable Long textureId; + @CanIgnoreReturnValue public @NonNull Builder setTextureId(@NonNull Long setterArg) { this.textureId = setterArg; return this; @@ -91,18 +119,15 @@ public static final class Builder { @NonNull ArrayList toList() { - ArrayList toListResult = new ArrayList(1); + ArrayList toListResult = new ArrayList<>(1); toListResult.add(textureId); return toListResult; } - static @NonNull TextureMessage fromList(@NonNull ArrayList list) { + static @NonNull TextureMessage fromList(@NonNull ArrayList pigeonVar_list) { TextureMessage pigeonResult = new TextureMessage(); - Object textureId = list.get(0); - pigeonResult.setTextureId( - (textureId == null) - ? null - : ((textureId instanceof Integer) ? (Integer) textureId : (Long) textureId)); + Object textureId = pigeonVar_list.get(0); + pigeonResult.setTextureId((Long) textureId); return pigeonResult; } } @@ -138,10 +163,28 @@ public void setIsLooping(@NonNull Boolean setterArg) { /** Constructor is non-public to enforce null safety; use Builder. */ LoopingMessage() {} + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LoopingMessage that = (LoopingMessage) o; + return textureId.equals(that.textureId) && isLooping.equals(that.isLooping); + } + + @Override + public int hashCode() { + return Objects.hash(textureId, isLooping); + } + public static final class Builder { private @Nullable Long textureId; + @CanIgnoreReturnValue public @NonNull Builder setTextureId(@NonNull Long setterArg) { this.textureId = setterArg; return this; @@ -149,6 +192,7 @@ public static final class Builder { private @Nullable Boolean isLooping; + @CanIgnoreReturnValue public @NonNull Builder setIsLooping(@NonNull Boolean setterArg) { this.isLooping = setterArg; return this; @@ -164,20 +208,17 @@ public static final class Builder { @NonNull ArrayList toList() { - ArrayList toListResult = new ArrayList(2); + ArrayList toListResult = new ArrayList<>(2); toListResult.add(textureId); toListResult.add(isLooping); return toListResult; } - static @NonNull LoopingMessage fromList(@NonNull ArrayList list) { + static @NonNull LoopingMessage fromList(@NonNull ArrayList pigeonVar_list) { LoopingMessage pigeonResult = new LoopingMessage(); - Object textureId = list.get(0); - pigeonResult.setTextureId( - (textureId == null) - ? null - : ((textureId instanceof Integer) ? (Integer) textureId : (Long) textureId)); - Object isLooping = list.get(1); + Object textureId = pigeonVar_list.get(0); + pigeonResult.setTextureId((Long) textureId); + Object isLooping = pigeonVar_list.get(1); pigeonResult.setIsLooping((Boolean) isLooping); return pigeonResult; } @@ -214,10 +255,28 @@ public void setVolume(@NonNull Double setterArg) { /** Constructor is non-public to enforce null safety; use Builder. */ VolumeMessage() {} + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VolumeMessage that = (VolumeMessage) o; + return textureId.equals(that.textureId) && volume.equals(that.volume); + } + + @Override + public int hashCode() { + return Objects.hash(textureId, volume); + } + public static final class Builder { private @Nullable Long textureId; + @CanIgnoreReturnValue public @NonNull Builder setTextureId(@NonNull Long setterArg) { this.textureId = setterArg; return this; @@ -225,6 +284,7 @@ public static final class Builder { private @Nullable Double volume; + @CanIgnoreReturnValue public @NonNull Builder setVolume(@NonNull Double setterArg) { this.volume = setterArg; return this; @@ -240,20 +300,17 @@ public static final class Builder { @NonNull ArrayList toList() { - ArrayList toListResult = new ArrayList(2); + ArrayList toListResult = new ArrayList<>(2); toListResult.add(textureId); toListResult.add(volume); return toListResult; } - static @NonNull VolumeMessage fromList(@NonNull ArrayList list) { + static @NonNull VolumeMessage fromList(@NonNull ArrayList pigeonVar_list) { VolumeMessage pigeonResult = new VolumeMessage(); - Object textureId = list.get(0); - pigeonResult.setTextureId( - (textureId == null) - ? null - : ((textureId instanceof Integer) ? (Integer) textureId : (Long) textureId)); - Object volume = list.get(1); + Object textureId = pigeonVar_list.get(0); + pigeonResult.setTextureId((Long) textureId); + Object volume = pigeonVar_list.get(1); pigeonResult.setVolume((Double) volume); return pigeonResult; } @@ -290,10 +347,28 @@ public void setSpeed(@NonNull Double setterArg) { /** Constructor is non-public to enforce null safety; use Builder. */ PlaybackSpeedMessage() {} + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlaybackSpeedMessage that = (PlaybackSpeedMessage) o; + return textureId.equals(that.textureId) && speed.equals(that.speed); + } + + @Override + public int hashCode() { + return Objects.hash(textureId, speed); + } + public static final class Builder { private @Nullable Long textureId; + @CanIgnoreReturnValue public @NonNull Builder setTextureId(@NonNull Long setterArg) { this.textureId = setterArg; return this; @@ -301,6 +376,7 @@ public static final class Builder { private @Nullable Double speed; + @CanIgnoreReturnValue public @NonNull Builder setSpeed(@NonNull Double setterArg) { this.speed = setterArg; return this; @@ -316,20 +392,17 @@ public static final class Builder { @NonNull ArrayList toList() { - ArrayList toListResult = new ArrayList(2); + ArrayList toListResult = new ArrayList<>(2); toListResult.add(textureId); toListResult.add(speed); return toListResult; } - static @NonNull PlaybackSpeedMessage fromList(@NonNull ArrayList list) { + static @NonNull PlaybackSpeedMessage fromList(@NonNull ArrayList pigeonVar_list) { PlaybackSpeedMessage pigeonResult = new PlaybackSpeedMessage(); - Object textureId = list.get(0); - pigeonResult.setTextureId( - (textureId == null) - ? null - : ((textureId instanceof Integer) ? (Integer) textureId : (Long) textureId)); - Object speed = list.get(1); + Object textureId = pigeonVar_list.get(0); + pigeonResult.setTextureId((Long) textureId); + Object speed = pigeonVar_list.get(1); pigeonResult.setSpeed((Double) speed); return pigeonResult; } @@ -366,10 +439,28 @@ public void setPosition(@NonNull Long setterArg) { /** Constructor is non-public to enforce null safety; use Builder. */ PositionMessage() {} + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PositionMessage that = (PositionMessage) o; + return textureId.equals(that.textureId) && position.equals(that.position); + } + + @Override + public int hashCode() { + return Objects.hash(textureId, position); + } + public static final class Builder { private @Nullable Long textureId; + @CanIgnoreReturnValue public @NonNull Builder setTextureId(@NonNull Long setterArg) { this.textureId = setterArg; return this; @@ -377,6 +468,7 @@ public static final class Builder { private @Nullable Long position; + @CanIgnoreReturnValue public @NonNull Builder setPosition(@NonNull Long setterArg) { this.position = setterArg; return this; @@ -392,24 +484,18 @@ public static final class Builder { @NonNull ArrayList toList() { - ArrayList toListResult = new ArrayList(2); + ArrayList toListResult = new ArrayList<>(2); toListResult.add(textureId); toListResult.add(position); return toListResult; } - static @NonNull PositionMessage fromList(@NonNull ArrayList list) { + static @NonNull PositionMessage fromList(@NonNull ArrayList pigeonVar_list) { PositionMessage pigeonResult = new PositionMessage(); - Object textureId = list.get(0); - pigeonResult.setTextureId( - (textureId == null) - ? null - : ((textureId instanceof Integer) ? (Integer) textureId : (Long) textureId)); - Object position = list.get(1); - pigeonResult.setPosition( - (position == null) - ? null - : ((position instanceof Integer) ? (Integer) position : (Long) position)); + Object textureId = pigeonVar_list.get(0); + pigeonResult.setTextureId((Long) textureId); + Object position = pigeonVar_list.get(1); + pigeonResult.setPosition((Long) position); return pigeonResult; } } @@ -472,10 +558,32 @@ public void setHttpHeaders(@NonNull Map setterArg) { /** Constructor is non-public to enforce null safety; use Builder. */ CreateMessage() {} + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateMessage that = (CreateMessage) o; + return Objects.equals(asset, that.asset) + && Objects.equals(uri, that.uri) + && Objects.equals(packageName, that.packageName) + && Objects.equals(formatHint, that.formatHint) + && httpHeaders.equals(that.httpHeaders); + } + + @Override + public int hashCode() { + return Objects.hash(asset, uri, packageName, formatHint, httpHeaders); + } + public static final class Builder { private @Nullable String asset; + @CanIgnoreReturnValue public @NonNull Builder setAsset(@Nullable String setterArg) { this.asset = setterArg; return this; @@ -483,6 +591,7 @@ public static final class Builder { private @Nullable String uri; + @CanIgnoreReturnValue public @NonNull Builder setUri(@Nullable String setterArg) { this.uri = setterArg; return this; @@ -490,6 +599,7 @@ public static final class Builder { private @Nullable String packageName; + @CanIgnoreReturnValue public @NonNull Builder setPackageName(@Nullable String setterArg) { this.packageName = setterArg; return this; @@ -497,6 +607,7 @@ public static final class Builder { private @Nullable String formatHint; + @CanIgnoreReturnValue public @NonNull Builder setFormatHint(@Nullable String setterArg) { this.formatHint = setterArg; return this; @@ -504,6 +615,7 @@ public static final class Builder { private @Nullable Map httpHeaders; + @CanIgnoreReturnValue public @NonNull Builder setHttpHeaders(@NonNull Map setterArg) { this.httpHeaders = setterArg; return this; @@ -522,7 +634,7 @@ public static final class Builder { @NonNull ArrayList toList() { - ArrayList toListResult = new ArrayList(5); + ArrayList toListResult = new ArrayList<>(5); toListResult.add(asset); toListResult.add(uri); toListResult.add(packageName); @@ -531,17 +643,17 @@ ArrayList toList() { return toListResult; } - static @NonNull CreateMessage fromList(@NonNull ArrayList list) { + static @NonNull CreateMessage fromList(@NonNull ArrayList pigeonVar_list) { CreateMessage pigeonResult = new CreateMessage(); - Object asset = list.get(0); + Object asset = pigeonVar_list.get(0); pigeonResult.setAsset((String) asset); - Object uri = list.get(1); + Object uri = pigeonVar_list.get(1); pigeonResult.setUri((String) uri); - Object packageName = list.get(2); + Object packageName = pigeonVar_list.get(2); pigeonResult.setPackageName((String) packageName); - Object formatHint = list.get(3); + Object formatHint = pigeonVar_list.get(3); pigeonResult.setFormatHint((String) formatHint); - Object httpHeaders = list.get(4); + Object httpHeaders = pigeonVar_list.get(4); pigeonResult.setHttpHeaders((Map) httpHeaders); return pigeonResult; } @@ -565,10 +677,28 @@ public void setMixWithOthers(@NonNull Boolean setterArg) { /** Constructor is non-public to enforce null safety; use Builder. */ MixWithOthersMessage() {} + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MixWithOthersMessage that = (MixWithOthersMessage) o; + return mixWithOthers.equals(that.mixWithOthers); + } + + @Override + public int hashCode() { + return Objects.hash(mixWithOthers); + } + public static final class Builder { private @Nullable Boolean mixWithOthers; + @CanIgnoreReturnValue public @NonNull Builder setMixWithOthers(@NonNull Boolean setterArg) { this.mixWithOthers = setterArg; return this; @@ -583,41 +713,41 @@ public static final class Builder { @NonNull ArrayList toList() { - ArrayList toListResult = new ArrayList(1); + ArrayList toListResult = new ArrayList<>(1); toListResult.add(mixWithOthers); return toListResult; } - static @NonNull MixWithOthersMessage fromList(@NonNull ArrayList list) { + static @NonNull MixWithOthersMessage fromList(@NonNull ArrayList pigeonVar_list) { MixWithOthersMessage pigeonResult = new MixWithOthersMessage(); - Object mixWithOthers = list.get(0); + Object mixWithOthers = pigeonVar_list.get(0); pigeonResult.setMixWithOthers((Boolean) mixWithOthers); return pigeonResult; } } - private static class AndroidVideoPlayerApiCodec extends StandardMessageCodec { - public static final AndroidVideoPlayerApiCodec INSTANCE = new AndroidVideoPlayerApiCodec(); + private static class PigeonCodec extends StandardMessageCodec { + public static final PigeonCodec INSTANCE = new PigeonCodec(); - private AndroidVideoPlayerApiCodec() {} + private PigeonCodec() {} @Override protected Object readValueOfType(byte type, @NonNull ByteBuffer buffer) { switch (type) { - case (byte) 128: - return CreateMessage.fromList((ArrayList) readValue(buffer)); case (byte) 129: - return LoopingMessage.fromList((ArrayList) readValue(buffer)); + return TextureMessage.fromList((ArrayList) readValue(buffer)); case (byte) 130: - return MixWithOthersMessage.fromList((ArrayList) readValue(buffer)); + return LoopingMessage.fromList((ArrayList) readValue(buffer)); case (byte) 131: - return PlaybackSpeedMessage.fromList((ArrayList) readValue(buffer)); + return VolumeMessage.fromList((ArrayList) readValue(buffer)); case (byte) 132: - return PositionMessage.fromList((ArrayList) readValue(buffer)); + return PlaybackSpeedMessage.fromList((ArrayList) readValue(buffer)); case (byte) 133: - return TextureMessage.fromList((ArrayList) readValue(buffer)); + return PositionMessage.fromList((ArrayList) readValue(buffer)); case (byte) 134: - return VolumeMessage.fromList((ArrayList) readValue(buffer)); + return CreateMessage.fromList((ArrayList) readValue(buffer)); + case (byte) 135: + return MixWithOthersMessage.fromList((ArrayList) readValue(buffer)); default: return super.readValueOfType(type, buffer); } @@ -625,27 +755,27 @@ protected Object readValueOfType(byte type, @NonNull ByteBuffer buffer) { @Override protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { - if (value instanceof CreateMessage) { - stream.write(128); - writeValue(stream, ((CreateMessage) value).toList()); - } else if (value instanceof LoopingMessage) { + if (value instanceof TextureMessage) { stream.write(129); - writeValue(stream, ((LoopingMessage) value).toList()); - } else if (value instanceof MixWithOthersMessage) { + writeValue(stream, ((TextureMessage) value).toList()); + } else if (value instanceof LoopingMessage) { stream.write(130); - writeValue(stream, ((MixWithOthersMessage) value).toList()); - } else if (value instanceof PlaybackSpeedMessage) { + writeValue(stream, ((LoopingMessage) value).toList()); + } else if (value instanceof VolumeMessage) { stream.write(131); + writeValue(stream, ((VolumeMessage) value).toList()); + } else if (value instanceof PlaybackSpeedMessage) { + stream.write(132); writeValue(stream, ((PlaybackSpeedMessage) value).toList()); } else if (value instanceof PositionMessage) { - stream.write(132); - writeValue(stream, ((PositionMessage) value).toList()); - } else if (value instanceof TextureMessage) { stream.write(133); - writeValue(stream, ((TextureMessage) value).toList()); - } else if (value instanceof VolumeMessage) { + writeValue(stream, ((PositionMessage) value).toList()); + } else if (value instanceof CreateMessage) { stream.write(134); - writeValue(stream, ((VolumeMessage) value).toList()); + writeValue(stream, ((CreateMessage) value).toList()); + } else if (value instanceof MixWithOthersMessage) { + stream.write(135); + writeValue(stream, ((MixWithOthersMessage) value).toList()); } else { super.writeValue(stream, value); } @@ -681,28 +811,38 @@ public interface AndroidVideoPlayerApi { /** The codec used by AndroidVideoPlayerApi. */ static @NonNull MessageCodec getCodec() { - return AndroidVideoPlayerApiCodec.INSTANCE; + return PigeonCodec.INSTANCE; } /** * Sets up an instance of `AndroidVideoPlayerApi` to handle messages through the * `binaryMessenger`. */ - static void setup( + static void setUp( @NonNull BinaryMessenger binaryMessenger, @Nullable AndroidVideoPlayerApi api) { + setUp(binaryMessenger, "", api); + } + + static void setUp( + @NonNull BinaryMessenger binaryMessenger, + @NonNull String messageChannelSuffix, + @Nullable AndroidVideoPlayerApi api) { + messageChannelSuffix = messageChannelSuffix.isEmpty() ? "" : "." + messageChannelSuffix; { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.AndroidVideoPlayerApi.initialize", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.video_player_android.AndroidVideoPlayerApi.initialize" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); try { api.initialize(); wrapped.add(0, null); } catch (Throwable exception) { - ArrayList wrappedError = wrapError(exception); - wrapped = wrappedError; + wrapped = wrapError(exception); } reply.reply(wrapped); }); @@ -713,19 +853,21 @@ static void setup( { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.AndroidVideoPlayerApi.create", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.video_player_android.AndroidVideoPlayerApi.create" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; CreateMessage msgArg = (CreateMessage) args.get(0); try { TextureMessage output = api.create(msgArg); wrapped.add(0, output); } catch (Throwable exception) { - ArrayList wrappedError = wrapError(exception); - wrapped = wrappedError; + wrapped = wrapError(exception); } reply.reply(wrapped); }); @@ -736,19 +878,21 @@ static void setup( { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.AndroidVideoPlayerApi.dispose", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.video_player_android.AndroidVideoPlayerApi.dispose" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; TextureMessage msgArg = (TextureMessage) args.get(0); try { api.dispose(msgArg); wrapped.add(0, null); } catch (Throwable exception) { - ArrayList wrappedError = wrapError(exception); - wrapped = wrappedError; + wrapped = wrapError(exception); } reply.reply(wrapped); }); @@ -759,19 +903,21 @@ static void setup( { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.AndroidVideoPlayerApi.setLooping", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.video_player_android.AndroidVideoPlayerApi.setLooping" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; LoopingMessage msgArg = (LoopingMessage) args.get(0); try { api.setLooping(msgArg); wrapped.add(0, null); } catch (Throwable exception) { - ArrayList wrappedError = wrapError(exception); - wrapped = wrappedError; + wrapped = wrapError(exception); } reply.reply(wrapped); }); @@ -782,19 +928,21 @@ static void setup( { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.AndroidVideoPlayerApi.setVolume", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.video_player_android.AndroidVideoPlayerApi.setVolume" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; VolumeMessage msgArg = (VolumeMessage) args.get(0); try { api.setVolume(msgArg); wrapped.add(0, null); } catch (Throwable exception) { - ArrayList wrappedError = wrapError(exception); - wrapped = wrappedError; + wrapped = wrapError(exception); } reply.reply(wrapped); }); @@ -806,20 +954,20 @@ static void setup( BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.AndroidVideoPlayerApi.setPlaybackSpeed", + "dev.flutter.pigeon.video_player_android.AndroidVideoPlayerApi.setPlaybackSpeed" + + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; PlaybackSpeedMessage msgArg = (PlaybackSpeedMessage) args.get(0); try { api.setPlaybackSpeed(msgArg); wrapped.add(0, null); } catch (Throwable exception) { - ArrayList wrappedError = wrapError(exception); - wrapped = wrappedError; + wrapped = wrapError(exception); } reply.reply(wrapped); }); @@ -830,19 +978,21 @@ static void setup( { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.AndroidVideoPlayerApi.play", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.video_player_android.AndroidVideoPlayerApi.play" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; TextureMessage msgArg = (TextureMessage) args.get(0); try { api.play(msgArg); wrapped.add(0, null); } catch (Throwable exception) { - ArrayList wrappedError = wrapError(exception); - wrapped = wrappedError; + wrapped = wrapError(exception); } reply.reply(wrapped); }); @@ -853,19 +1003,21 @@ static void setup( { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.AndroidVideoPlayerApi.position", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.video_player_android.AndroidVideoPlayerApi.position" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; TextureMessage msgArg = (TextureMessage) args.get(0); try { PositionMessage output = api.position(msgArg); wrapped.add(0, output); } catch (Throwable exception) { - ArrayList wrappedError = wrapError(exception); - wrapped = wrappedError; + wrapped = wrapError(exception); } reply.reply(wrapped); }); @@ -876,19 +1028,21 @@ static void setup( { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.AndroidVideoPlayerApi.seekTo", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.video_player_android.AndroidVideoPlayerApi.seekTo" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; PositionMessage msgArg = (PositionMessage) args.get(0); try { api.seekTo(msgArg); wrapped.add(0, null); } catch (Throwable exception) { - ArrayList wrappedError = wrapError(exception); - wrapped = wrappedError; + wrapped = wrapError(exception); } reply.reply(wrapped); }); @@ -899,19 +1053,21 @@ static void setup( { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.AndroidVideoPlayerApi.pause", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.video_player_android.AndroidVideoPlayerApi.pause" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; TextureMessage msgArg = (TextureMessage) args.get(0); try { api.pause(msgArg); wrapped.add(0, null); } catch (Throwable exception) { - ArrayList wrappedError = wrapError(exception); - wrapped = wrappedError; + wrapped = wrapError(exception); } reply.reply(wrapped); }); @@ -923,20 +1079,20 @@ static void setup( BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, - "dev.flutter.pigeon.AndroidVideoPlayerApi.setMixWithOthers", + "dev.flutter.pigeon.video_player_android.AndroidVideoPlayerApi.setMixWithOthers" + + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { - ArrayList wrapped = new ArrayList(); + ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; MixWithOthersMessage msgArg = (MixWithOthersMessage) args.get(0); try { api.setMixWithOthers(msgArg); wrapped.add(0, null); } catch (Throwable exception) { - ArrayList wrappedError = wrapError(exception); - wrapped = wrappedError; + wrapped = wrapError(exception); } reply.reply(wrapped); }); diff --git a/packages/video_player/video_player_android/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayer.java b/packages/video_player/video_player_android/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayer.java index ab20b30f42d0..c481df2d7796 100644 --- a/packages/video_player/video_player_android/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayer.java +++ b/packages/video_player/video_player_android/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayer.java @@ -8,8 +8,9 @@ import static androidx.media3.common.Player.REPEAT_MODE_OFF; import android.content.Context; -import android.view.Surface; import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.annotation.RestrictTo; import androidx.annotation.VisibleForTesting; import androidx.media3.common.AudioAttributes; import androidx.media3.common.C; @@ -18,60 +19,102 @@ import androidx.media3.exoplayer.ExoPlayer; import io.flutter.view.TextureRegistry; -final class VideoPlayer { - private ExoPlayer exoPlayer; - private Surface surface; - private final TextureRegistry.SurfaceTextureEntry textureEntry; - private final VideoPlayerCallbacks videoPlayerEvents; - private final VideoPlayerOptions options; +final class VideoPlayer implements TextureRegistry.SurfaceProducer.Callback { + @NonNull private final ExoPlayerProvider exoPlayerProvider; + @NonNull private final MediaItem mediaItem; + @NonNull private final TextureRegistry.SurfaceProducer surfaceProducer; + @NonNull private final VideoPlayerCallbacks videoPlayerEvents; + @NonNull private final VideoPlayerOptions options; + @NonNull private ExoPlayer exoPlayer; + @Nullable private ExoPlayerState savedStateDuring; /** * Creates a video player. * * @param context application context. * @param events event callbacks. - * @param textureEntry texture to render to. + * @param surfaceProducer produces a texture to render to. * @param asset asset to play. * @param options options for playback. * @return a video player instance. */ @NonNull static VideoPlayer create( - Context context, - VideoPlayerCallbacks events, - TextureRegistry.SurfaceTextureEntry textureEntry, - VideoAsset asset, - VideoPlayerOptions options) { - ExoPlayer.Builder builder = - new ExoPlayer.Builder(context).setMediaSourceFactory(asset.getMediaSourceFactory(context)); - return new VideoPlayer(builder, events, textureEntry, asset.getMediaItem(), options); + @NonNull Context context, + @NonNull VideoPlayerCallbacks events, + @NonNull TextureRegistry.SurfaceProducer surfaceProducer, + @NonNull VideoAsset asset, + @NonNull VideoPlayerOptions options) { + return new VideoPlayer( + () -> { + ExoPlayer.Builder builder = + new ExoPlayer.Builder(context) + .setMediaSourceFactory(asset.getMediaSourceFactory(context)); + return builder.build(); + }, + events, + surfaceProducer, + asset.getMediaItem(), + options); + } + + /** A closure-compatible signature since {@link java.util.function.Supplier} is API level 24. */ + interface ExoPlayerProvider { + /** + * Returns a new {@link ExoPlayer}. + * + * @return new instance. + */ + ExoPlayer get(); } @VisibleForTesting VideoPlayer( - ExoPlayer.Builder builder, - VideoPlayerCallbacks events, - TextureRegistry.SurfaceTextureEntry textureEntry, - MediaItem mediaItem, - VideoPlayerOptions options) { + @NonNull ExoPlayerProvider exoPlayerProvider, + @NonNull VideoPlayerCallbacks events, + @NonNull TextureRegistry.SurfaceProducer surfaceProducer, + @NonNull MediaItem mediaItem, + @NonNull VideoPlayerOptions options) { + this.exoPlayerProvider = exoPlayerProvider; this.videoPlayerEvents = events; - this.textureEntry = textureEntry; + this.surfaceProducer = surfaceProducer; + this.mediaItem = mediaItem; this.options = options; + this.exoPlayer = createVideoPlayer(); + surfaceProducer.setCallback(this); + } - ExoPlayer exoPlayer = builder.build(); - exoPlayer.setMediaItem(mediaItem); - exoPlayer.prepare(); + @RestrictTo(RestrictTo.Scope.LIBRARY) + // TODO(matanlurey): https://github.com/flutter/flutter/issues/155131. + @SuppressWarnings({"deprecation", "removal"}) + public void onSurfaceCreated() { + if (savedStateDuring != null) { + exoPlayer = createVideoPlayer(); + savedStateDuring.restore(exoPlayer); + savedStateDuring = null; + } + } - setUpVideoPlayer(exoPlayer); + @RestrictTo(RestrictTo.Scope.LIBRARY) + public void onSurfaceDestroyed() { + // Intentionally do not call pause/stop here, because the surface has already been released + // at this point (see https://github.com/flutter/flutter/issues/156451). + savedStateDuring = ExoPlayerState.save(exoPlayer); + exoPlayer.release(); } - private void setUpVideoPlayer(ExoPlayer exoPlayer) { - this.exoPlayer = exoPlayer; + private ExoPlayer createVideoPlayer() { + ExoPlayer exoPlayer = exoPlayerProvider.get(); + exoPlayer.setMediaItem(mediaItem); + exoPlayer.prepare(); - surface = new Surface(textureEntry.surfaceTexture()); - exoPlayer.setVideoSurface(surface); + exoPlayer.setVideoSurface(surfaceProducer.getSurface()); + + boolean wasInitialized = savedStateDuring != null; + exoPlayer.addListener(new ExoPlayerEventListener(exoPlayer, videoPlayerEvents, wasInitialized)); setAudioAttributes(exoPlayer, options.mixWithOthers); - exoPlayer.addListener(new ExoPlayerEventListener(exoPlayer, videoPlayerEvents)); + + return exoPlayer; } void sendBufferingUpdate() { @@ -85,11 +128,11 @@ private static void setAudioAttributes(ExoPlayer exoPlayer, boolean isMixMode) { } void play() { - exoPlayer.setPlayWhenReady(true); + exoPlayer.play(); } void pause() { - exoPlayer.setPlayWhenReady(false); + exoPlayer.pause(); } void setLooping(boolean value) { @@ -118,12 +161,11 @@ long getPosition() { } void dispose() { - textureEntry.release(); - if (surface != null) { - surface.release(); - } - if (exoPlayer != null) { - exoPlayer.release(); - } + exoPlayer.release(); + surfaceProducer.release(); + + // TODO(matanlurey): Remove when embedder no longer calls-back once released. + // https://github.com/flutter/flutter/issues/156434. + surfaceProducer.setCallback(null); } } diff --git a/packages/video_player/video_player_android/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayerPlugin.java b/packages/video_player/video_player_android/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayerPlugin.java index af13c5395512..d1911d8cc378 100644 --- a/packages/video_player/video_player_android/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayerPlugin.java +++ b/packages/video_player/video_player_android/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayerPlugin.java @@ -5,7 +5,6 @@ package io.flutter.plugins.videoplayer; import android.content.Context; -import android.os.Build; import android.util.LongSparseArray; import androidx.annotation.NonNull; import io.flutter.FlutterInjector; @@ -22,10 +21,6 @@ import io.flutter.plugins.videoplayer.Messages.TextureMessage; import io.flutter.plugins.videoplayer.Messages.VolumeMessage; import io.flutter.view.TextureRegistry; -import java.security.KeyManagementException; -import java.security.NoSuchAlgorithmException; -import java.util.Map; -import javax.net.ssl.HttpsURLConnection; /** Android platform implementation of the VideoPlayerPlugin. */ public class VideoPlayerPlugin implements FlutterPlugin, AndroidVideoPlayerApi { @@ -39,19 +34,6 @@ public VideoPlayerPlugin() {} @Override public void onAttachedToEngine(@NonNull FlutterPluginBinding binding) { - if (android.os.Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) { - try { - HttpsURLConnection.setDefaultSSLSocketFactory(new CustomSSLSocketFactory()); - } catch (KeyManagementException | NoSuchAlgorithmException e) { - Log.w( - TAG, - "Failed to enable TLSv1.1 and TLSv1.2 Protocols for API level 19 and below.\n" - + "For more information about Socket Security, please consult the following link:\n" - + "https://developer.android.com/reference/javax/net/ssl/SSLSocket", - e); - } - } - final FlutterInjector injector = FlutterInjector.instance(); this.flutterState = new FlutterState( @@ -94,8 +76,7 @@ public void initialize() { } public @NonNull TextureMessage create(@NonNull CreateMessage arg) { - TextureRegistry.SurfaceTextureEntry handle = - flutterState.textureRegistry.createSurfaceTexture(); + TextureRegistry.SurfaceProducer handle = flutterState.textureRegistry.createSurfaceProducer(); EventChannel eventChannel = new EventChannel( flutterState.binaryMessenger, "flutter.io/videoPlayer/videoEvents" + handle.id()); @@ -113,7 +94,6 @@ public void initialize() { } else if (arg.getUri().startsWith("rtsp://")) { videoAsset = VideoAsset.fromRtspUrl(arg.getUri()); } else { - Map httpHeaders = arg.getHttpHeaders(); VideoAsset.StreamingFormat streamingFormat = VideoAsset.StreamingFormat.UNKNOWN; String formatHint = arg.getFormatHint(); if (formatHint != null) { @@ -143,34 +123,50 @@ public void initialize() { return new TextureMessage.Builder().setTextureId(handle.id()).build(); } + @NonNull + private VideoPlayer getPlayer(long textureId) { + VideoPlayer player = videoPlayers.get(textureId); + + // Avoid a very ugly un-debuggable NPE that results in returning a null player. + if (player == null) { + String message = "No player found with textureId <" + textureId + ">"; + if (videoPlayers.size() == 0) { + message += " and no active players created by the plugin."; + } + throw new IllegalStateException(message); + } + + return player; + } + public void dispose(@NonNull TextureMessage arg) { - VideoPlayer player = videoPlayers.get(arg.getTextureId()); + VideoPlayer player = getPlayer(arg.getTextureId()); player.dispose(); videoPlayers.remove(arg.getTextureId()); } public void setLooping(@NonNull LoopingMessage arg) { - VideoPlayer player = videoPlayers.get(arg.getTextureId()); + VideoPlayer player = getPlayer(arg.getTextureId()); player.setLooping(arg.getIsLooping()); } public void setVolume(@NonNull VolumeMessage arg) { - VideoPlayer player = videoPlayers.get(arg.getTextureId()); + VideoPlayer player = getPlayer(arg.getTextureId()); player.setVolume(arg.getVolume()); } public void setPlaybackSpeed(@NonNull PlaybackSpeedMessage arg) { - VideoPlayer player = videoPlayers.get(arg.getTextureId()); + VideoPlayer player = getPlayer(arg.getTextureId()); player.setPlaybackSpeed(arg.getSpeed()); } public void play(@NonNull TextureMessage arg) { - VideoPlayer player = videoPlayers.get(arg.getTextureId()); + VideoPlayer player = getPlayer(arg.getTextureId()); player.play(); } public @NonNull PositionMessage position(@NonNull TextureMessage arg) { - VideoPlayer player = videoPlayers.get(arg.getTextureId()); + VideoPlayer player = getPlayer(arg.getTextureId()); PositionMessage result = new PositionMessage.Builder() .setPosition(player.getPosition()) @@ -181,12 +177,12 @@ public void play(@NonNull TextureMessage arg) { } public void seekTo(@NonNull PositionMessage arg) { - VideoPlayer player = videoPlayers.get(arg.getTextureId()); + VideoPlayer player = getPlayer(arg.getTextureId()); player.seekTo(arg.getPosition().intValue()); } public void pause(@NonNull TextureMessage arg) { - VideoPlayer player = videoPlayers.get(arg.getTextureId()); + VideoPlayer player = getPlayer(arg.getTextureId()); player.pause(); } @@ -224,11 +220,11 @@ private static final class FlutterState { } void startListening(VideoPlayerPlugin methodCallHandler, BinaryMessenger messenger) { - AndroidVideoPlayerApi.setup(messenger, methodCallHandler); + AndroidVideoPlayerApi.setUp(messenger, methodCallHandler); } void stopListening(BinaryMessenger messenger) { - AndroidVideoPlayerApi.setup(messenger, null); + AndroidVideoPlayerApi.setUp(messenger, null); } } } diff --git a/packages/video_player/video_player_android/android/src/test/java/io/flutter/plugins/videoplayer/ExoPlayerEventListenerTests.java b/packages/video_player/video_player_android/android/src/test/java/io/flutter/plugins/videoplayer/ExoPlayerEventListenerTest.java similarity index 64% rename from packages/video_player/video_player_android/android/src/test/java/io/flutter/plugins/videoplayer/ExoPlayerEventListenerTests.java rename to packages/video_player/video_player_android/android/src/test/java/io/flutter/plugins/videoplayer/ExoPlayerEventListenerTest.java index 1d00d31b8ee5..65dfb311c31c 100644 --- a/packages/video_player/video_player_android/android/src/test/java/io/flutter/plugins/videoplayer/ExoPlayerEventListenerTests.java +++ b/packages/video_player/video_player_android/android/src/test/java/io/flutter/plugins/videoplayer/ExoPlayerEventListenerTest.java @@ -12,6 +12,7 @@ import static org.mockito.Mockito.verifyNoMoreInteractions; import static org.mockito.Mockito.when; +import androidx.media3.common.Format; import androidx.media3.common.PlaybackException; import androidx.media3.common.Player; import androidx.media3.common.VideoSize; @@ -24,6 +25,7 @@ import org.mockito.junit.MockitoJUnit; import org.mockito.junit.MockitoRule; import org.robolectric.RobolectricTestRunner; +import org.robolectric.annotation.Config; /** * Unit tests for {@link ExoPlayerEventListener}. @@ -33,7 +35,7 @@ * ({@link VideoPlayerCallbacks} and/or interface with the player instance as expected. */ @RunWith(RobolectricTestRunner.class) -public final class ExoPlayerEventListenerTests { +public final class ExoPlayerEventListenerTest { @Mock private ExoPlayer mockExoPlayer; @Mock private VideoPlayerCallbacks mockCallbacks; private ExoPlayerEventListener eventListener; @@ -46,7 +48,8 @@ public void setUp() { } @Test - public void onPlaybackStateChangedReadySendInitialized() { + @Config(maxSdk = 28) + public void onPlaybackStateChangedReadySendInitialized_belowAndroid29() { VideoSize size = new VideoSize(800, 400, 0, 0); when(mockExoPlayer.getVideoSize()).thenReturn(size); when(mockExoPlayer.getDuration()).thenReturn(10L); @@ -56,7 +59,25 @@ public void onPlaybackStateChangedReadySendInitialized() { } @Test - public void onPlaybackStateChangedReadyInPortraitMode90DegreesSwapWidthAndHeight() { + @Config(minSdk = 29) + public void + onPlaybackStateChangedReadySendInitializedWithRotationCorrectionAndWidthAndHeightSwap_aboveAndroid29() { + VideoSize size = new VideoSize(800, 400, 0, 0); + int rotationCorrection = 90; + Format videoFormat = new Format.Builder().setRotationDegrees(rotationCorrection).build(); + + when(mockExoPlayer.getVideoSize()).thenReturn(size); + when(mockExoPlayer.getDuration()).thenReturn(10L); + when(mockExoPlayer.getVideoFormat()).thenReturn(videoFormat); + + eventListener.onPlaybackStateChanged(Player.STATE_READY); + verify(mockCallbacks).onInitialized(400, 800, 10L, rotationCorrection); + } + + @Test + @Config(maxSdk = 21) + public void + onPlaybackStateChangedReadyInPortraitMode90DegreesSwapWidthAndHeight_belowAndroid21() { VideoSize size = new VideoSize(800, 400, 90, 0); when(mockExoPlayer.getVideoSize()).thenReturn(size); when(mockExoPlayer.getDuration()).thenReturn(10L); @@ -66,7 +87,38 @@ public void onPlaybackStateChangedReadyInPortraitMode90DegreesSwapWidthAndHeight } @Test - public void onPlaybackStateChangedReadyInPortraitMode270DegreesSwapWidthAndHeight() { + @Config(minSdk = 22, maxSdk = 28) + public void + onPlaybackStateChangedReadyInPortraitMode90DegreesDoesNotSwapWidthAndHeight_aboveAndroid21belowAndroid29() { + VideoSize size = new VideoSize(800, 400, 90, 0); + + when(mockExoPlayer.getVideoSize()).thenReturn(size); + when(mockExoPlayer.getDuration()).thenReturn(10L); + + eventListener.onPlaybackStateChanged(Player.STATE_READY); + verify(mockCallbacks).onInitialized(800, 400, 10L, 0); + } + + @Test + @Config(minSdk = 29) + public void + onPlaybackStateChangedReadyInPortraitMode90DegreesSwapWidthAndHeight_aboveAndroid29() { + VideoSize size = new VideoSize(800, 400, 0, 0); + int rotationCorrection = 90; + Format videoFormat = new Format.Builder().setRotationDegrees(rotationCorrection).build(); + + when(mockExoPlayer.getVideoSize()).thenReturn(size); + when(mockExoPlayer.getDuration()).thenReturn(10L); + when(mockExoPlayer.getVideoFormat()).thenReturn(videoFormat); + + eventListener.onPlaybackStateChanged(Player.STATE_READY); + verify(mockCallbacks).onInitialized(400, 800, 10L, 90); + } + + @Test + @Config(maxSdk = 21) + public void + onPlaybackStateChangedReadyInPortraitMode270DegreesSwapWidthAndHeight_belowAndroid21() { VideoSize size = new VideoSize(800, 400, 270, 0); when(mockExoPlayer.getVideoSize()).thenReturn(size); when(mockExoPlayer.getDuration()).thenReturn(10L); @@ -76,7 +128,36 @@ public void onPlaybackStateChangedReadyInPortraitMode270DegreesSwapWidthAndHeigh } @Test - public void onPlaybackStateChangedReadyFlipped180DegreesInformEventHandler() { + @Config(minSdk = 22, maxSdk = 28) + public void + onPlaybackStateChangedReadyInPortraitMode270DegreesDoesNotSwapWidthAndHeight_aboveAndroid21belowAndroid29() { + VideoSize size = new VideoSize(800, 400, 270, 0); + when(mockExoPlayer.getVideoSize()).thenReturn(size); + when(mockExoPlayer.getDuration()).thenReturn(10L); + + eventListener.onPlaybackStateChanged(Player.STATE_READY); + verify(mockCallbacks).onInitialized(800, 400, 10L, 0); + } + + @Test + @Config(minSdk = 29) + public void + onPlaybackStateChangedReadyInPortraitMode270DegreesSwapWidthAndHeight_aboveAndroid29() { + VideoSize size = new VideoSize(800, 400, 0, 0); + int rotationCorrection = 270; + Format videoFormat = new Format.Builder().setRotationDegrees(rotationCorrection).build(); + + when(mockExoPlayer.getVideoSize()).thenReturn(size); + when(mockExoPlayer.getDuration()).thenReturn(10L); + when(mockExoPlayer.getVideoFormat()).thenReturn(videoFormat); + + eventListener.onPlaybackStateChanged(Player.STATE_READY); + verify(mockCallbacks).onInitialized(400, 800, 10L, 270); + } + + @Test + @Config(maxSdk = 21) + public void onPlaybackStateChangedReadyFlipped180DegreesInformEventHandler_belowAndroid21() { VideoSize size = new VideoSize(800, 400, 180, 0); when(mockExoPlayer.getVideoSize()).thenReturn(size); when(mockExoPlayer.getDuration()).thenReturn(10L); diff --git a/packages/video_player/video_player_android/android/src/test/java/io/flutter/plugins/videoplayer/VideoPlayerTest.java b/packages/video_player/video_player_android/android/src/test/java/io/flutter/plugins/videoplayer/VideoPlayerTest.java index a30166c0aa51..4912803ce1d4 100644 --- a/packages/video_player/video_player_android/android/src/test/java/io/flutter/plugins/videoplayer/VideoPlayerTest.java +++ b/packages/video_player/video_player_android/android/src/test/java/io/flutter/plugins/videoplayer/VideoPlayerTest.java @@ -8,11 +8,12 @@ import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.*; -import android.graphics.SurfaceTexture; +import android.view.Surface; import androidx.media3.common.AudioAttributes; import androidx.media3.common.C; import androidx.media3.common.PlaybackParameters; import androidx.media3.common.Player; +import androidx.media3.common.VideoSize; import androidx.media3.exoplayer.ExoPlayer; import io.flutter.view.TextureRegistry; import org.junit.Before; @@ -21,6 +22,7 @@ import org.junit.runner.RunWith; import org.mockito.ArgumentCaptor; import org.mockito.Captor; +import org.mockito.InOrder; import org.mockito.Mock; import org.mockito.junit.MockitoJUnit; import org.mockito.junit.MockitoRule; @@ -44,18 +46,18 @@ public final class VideoPlayerTest { private FakeVideoAsset fakeVideoAsset; @Mock private VideoPlayerCallbacks mockEvents; - @Mock private TextureRegistry.SurfaceTextureEntry mockTexture; - @Mock private ExoPlayer.Builder mockBuilder; + @Mock private TextureRegistry.SurfaceProducer mockProducer; @Mock private ExoPlayer mockExoPlayer; @Captor private ArgumentCaptor attributesCaptor; + @Captor private ArgumentCaptor callbackCaptor; + @Captor private ArgumentCaptor listenerCaptor; @Rule public MockitoRule initRule = MockitoJUnit.rule(); @Before public void setUp() { fakeVideoAsset = new FakeVideoAsset(FAKE_ASSET_URL); - when(mockBuilder.build()).thenReturn(mockExoPlayer); - when(mockTexture.surfaceTexture()).thenReturn(mock(SurfaceTexture.class)); + when(mockProducer.getSurface()).thenReturn(mock(Surface.class)); } private VideoPlayer createVideoPlayer() { @@ -64,7 +66,7 @@ private VideoPlayer createVideoPlayer() { private VideoPlayer createVideoPlayer(VideoPlayerOptions options) { return new VideoPlayer( - mockBuilder, mockEvents, mockTexture, fakeVideoAsset.getMediaItem(), options); + () -> mockExoPlayer, mockEvents, mockProducer, fakeVideoAsset.getMediaItem(), options); } @Test @@ -73,7 +75,7 @@ public void loadsAndPreparesProvidedMediaEnablesAudioFocusByDefault() { verify(mockExoPlayer).setMediaItem(fakeVideoAsset.getMediaItem()); verify(mockExoPlayer).prepare(); - verify(mockTexture).surfaceTexture(); + verify(mockProducer).getSurface(); verify(mockExoPlayer).setVideoSurface(any()); verify(mockExoPlayer).setAudioAttributes(attributesCaptor.capture(), eq(true)); @@ -100,10 +102,10 @@ public void playsAndPausesProvidedMedia() { VideoPlayer videoPlayer = createVideoPlayer(); videoPlayer.play(); - verify(mockExoPlayer).setPlayWhenReady(true); + verify(mockExoPlayer).play(); videoPlayer.pause(); - verify(mockExoPlayer).setPlayWhenReady(false); + verify(mockExoPlayer).pause(); videoPlayer.dispose(); } @@ -170,11 +172,141 @@ public void seekAndGetPosition() { } @Test - public void disposeReleasesTextureAndPlayer() { + public void onSurfaceProducerDestroyedAndRecreatedReleasesAndThenRecreatesAndResumesPlayer() { VideoPlayer videoPlayer = createVideoPlayer(); - videoPlayer.dispose(); - verify(mockTexture).release(); + verify(mockProducer).setCallback(callbackCaptor.capture()); + verify(mockExoPlayer, never()).release(); + + when(mockExoPlayer.getCurrentPosition()).thenReturn(10L); + when(mockExoPlayer.getRepeatMode()).thenReturn(Player.REPEAT_MODE_ALL); + when(mockExoPlayer.getVolume()).thenReturn(0.5f); + when(mockExoPlayer.getPlaybackParameters()).thenReturn(new PlaybackParameters(2.5f)); + + TextureRegistry.SurfaceProducer.Callback producerLifecycle = callbackCaptor.getValue(); + producerLifecycle.onSurfaceDestroyed(); + verify(mockExoPlayer).release(); + + // Create a new mock exo player so that we get a new instance. + mockExoPlayer = mock(ExoPlayer.class); + simulateSurfaceCreation(producerLifecycle); + + verify(mockExoPlayer).seekTo(10L); + verify(mockExoPlayer).setRepeatMode(Player.REPEAT_MODE_ALL); + verify(mockExoPlayer).setVolume(0.5f); + verify(mockExoPlayer).setPlaybackParameters(new PlaybackParameters(2.5f)); + + videoPlayer.dispose(); + } + + @Test + public void onSurfaceProducerDestroyedDoesNotStopOrPauseVideo() { + VideoPlayer videoPlayer = createVideoPlayer(); + + verify(mockProducer).setCallback(callbackCaptor.capture()); + TextureRegistry.SurfaceProducer.Callback producerLifecycle = callbackCaptor.getValue(); + producerLifecycle.onSurfaceDestroyed(); + + verify(mockExoPlayer, never()).stop(); + verify(mockExoPlayer, never()).pause(); + verify(mockExoPlayer, never()).setPlayWhenReady(anyBoolean()); + + videoPlayer.dispose(); + } + + @Test + public void onDisposeSurfaceProducerCallbackIsDisconnected() { + // Regression test for https://github.com/flutter/flutter/issues/156158. + VideoPlayer videoPlayer = createVideoPlayer(); + verify(mockProducer).setCallback(any()); + + videoPlayer.dispose(); + verify(mockProducer).setCallback(null); + } + + @Test + public void onInitializedCalledWhenVideoPlayerInitiallyCreated() { + VideoPlayer videoPlayer = createVideoPlayer(); + + // Pretend we have a video, and capture the registered event listener. + when(mockExoPlayer.getVideoSize()).thenReturn(new VideoSize(300, 200)); + verify(mockExoPlayer).addListener(listenerCaptor.capture()); + Player.Listener listener = listenerCaptor.getValue(); + + // Trigger an event that would trigger onInitialized. + listener.onPlaybackStateChanged(Player.STATE_READY); + verify(mockEvents).onInitialized(anyInt(), anyInt(), anyLong(), anyInt()); + + videoPlayer.dispose(); + } + + @Test + public void onSurfaceCreatedDoesNotSendInitializeEventAgain() { + // The VideoPlayer contract assumes that the event "initialized" is sent exactly once + // (duplicate events cause an error to be thrown at the shared Dart layer). This test verifies + // that the onInitialized event is sent exactly once per player. + // + // Regression test for https://github.com/flutter/flutter/issues/154602. + VideoPlayer videoPlayer = createVideoPlayer(); + when(mockExoPlayer.getVideoSize()).thenReturn(new VideoSize(300, 200)); + + // Capture the lifecycle events so we can simulate onSurfaceCreated/Destroyed. + verify(mockProducer).setCallback(callbackCaptor.capture()); + TextureRegistry.SurfaceProducer.Callback producerLifecycle = callbackCaptor.getValue(); + + // Trigger destroyed/created. + producerLifecycle.onSurfaceDestroyed(); + simulateSurfaceCreation(producerLifecycle); + + // Initial listener, and the new one from the resume. + verify(mockExoPlayer, times(2)).addListener(listenerCaptor.capture()); + Player.Listener listener = listenerCaptor.getValue(); + + // Now trigger that same event, which would happen in the case of a background/resume. + listener.onPlaybackStateChanged(Player.STATE_READY); + + // Was not called because it was a result of a background/resume. + verify(mockEvents, never()).onInitialized(anyInt(), anyInt(), anyLong(), anyInt()); + + videoPlayer.dispose(); + } + + @Test + public void onSurfaceCreatedWithoutDestroyDoesNotRecreate() { + // Initially create the video player, which creates the initial surface. + VideoPlayer videoPlayer = createVideoPlayer(); + verify(mockProducer).getSurface(); + + // Capture the lifecycle events so we can simulate onSurfaceCreated/Destroyed. + verify(mockProducer).setCallback(callbackCaptor.capture()); + TextureRegistry.SurfaceProducer.Callback producerLifecycle = callbackCaptor.getValue(); + + // Calling onSurfaceCreated does not do anything, since the surface was never destroyed. + simulateSurfaceCreation(producerLifecycle); + verifyNoMoreInteractions(mockProducer); + + videoPlayer.dispose(); + } + + @Test + public void disposeReleasesExoPlayerBeforeTexture() { + VideoPlayer videoPlayer = createVideoPlayer(); + + videoPlayer.dispose(); + + // Regression test for https://github.com/flutter/flutter/issues/156158. + // The player must be destroyed before the surface it is writing to. + InOrder inOrder = inOrder(mockExoPlayer, mockProducer); + inOrder.verify(mockExoPlayer).release(); + inOrder.verify(mockProducer).release(); + } + + // TODO(matanlurey): Replace with inline calls to onSurfaceAvailable once + // available on stable; see https://github.com/flutter/flutter/issues/155131. + // This separate method only exists to scope the suppression. + @SuppressWarnings({"deprecation", "removal"}) + void simulateSurfaceCreation(TextureRegistry.SurfaceProducer.Callback producerLifecycle) { + producerLifecycle.onSurfaceCreated(); } } diff --git a/packages/video_player/video_player_android/example/android/app/build.gradle b/packages/video_player/video_player_android/example/android/app/build.gradle index 697bde16c079..09fef69716d4 100644 --- a/packages/video_player/video_player_android/example/android/app/build.gradle +++ b/packages/video_player/video_player_android/example/android/app/build.gradle @@ -29,14 +29,14 @@ android { compileSdk flutter.compileSdkVersion compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_11 + targetCompatibility JavaVersion.VERSION_11 } defaultConfig { applicationId "io.flutter.plugins.videoplayerexample" minSdkVersion 21 - targetSdkVersion 29 + targetSdkVersion 34 versionCode flutterVersionCode.toInteger() versionName flutterVersionName testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 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..d951fac2bf31 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-8.7-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/packages/video_player/video_player_android/example/android/app/src/main/AndroidManifest.xml b/packages/video_player/video_player_android/example/android/app/src/main/AndroidManifest.xml index a2574c90d7d9..dd84f58c348e 100644 --- a/packages/video_player/video_player_android/example/android/app/src/main/AndroidManifest.xml +++ b/packages/video_player/video_player_android/example/android/app/src/main/AndroidManifest.xml @@ -7,7 +7,8 @@ android:networkSecurityConfig="@xml/network_security_config"> diff --git a/packages/video_player/video_player_android/example/android/build.gradle b/packages/video_player/video_player_android/example/android/build.gradle index d82420470065..658815b35e23 100644 --- a/packages/video_player/video_player_android/example/android/build.gradle +++ b/packages/video_player/video_player_android/example/android/build.gradle @@ -5,7 +5,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:7.4.2' + classpath 'com.android.tools.build:gradle:8.5.1' } } 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..7aeeb11c6ee5 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-8.7-all.zip diff --git a/packages/video_player/video_player_android/example/integration_test/video_player_test.dart b/packages/video_player/video_player_android/example/integration_test/video_player_test.dart index b1abb5aed21d..f347214b9e79 100644 --- a/packages/video_player/video_player_android/example/integration_test/video_player_test.dart +++ b/packages/video_player/video_player_android/example/integration_test/video_player_test.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. -import 'dart:async'; import 'dart:io'; import 'dart:typed_data'; @@ -11,16 +10,9 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:integration_test/integration_test.dart'; import 'package:path_provider/path_provider.dart'; import 'package:video_player_android/video_player_android.dart'; -// TODO(stuartmorgan): Remove the use of MiniController in tests, as that is -// testing test code; tests should instead be written directly against the -// platform interface. (These tests were copied from the app-facing package -// during federation and minimally modified, which is why they currently use the -// controller.) -import 'package:video_player_example/mini_controller.dart'; import 'package:video_player_platform_interface/video_player_platform_interface.dart'; const Duration _playDuration = Duration(seconds: 1); - const String _videoAssetKey = 'assets/Butterfly-209.mp4'; // Returns the URL to load an asset from this example app as a network source. @@ -38,132 +30,140 @@ String getUrlForAssetAsNetworkSource(String assetKey) { void main() { IntegrationTestWidgetsFlutterBinding.ensureInitialized(); + late AndroidVideoPlayer player; + + setUp(() async { + player = AndroidVideoPlayer(); + await player.init(); + }); - late MiniController controller; - tearDown(() async => controller.dispose()); + testWidgets('registers expected implementation', (_) async { + AndroidVideoPlayer.registerWith(); + expect(VideoPlayerPlatform.instance, isA()); + }); + + testWidgets('initializes at the start', (_) async { + final int textureId = (await player.create(DataSource( + sourceType: DataSourceType.asset, + asset: _videoAssetKey, + )))!; - group('asset videos', () { - setUp(() { - controller = MiniController.asset(_videoAssetKey); - }); + expect( + await _getDuration(player, textureId), + const Duration(seconds: 7, milliseconds: 540), + ); - testWidgets('registers expected implementation', - (WidgetTester tester) async { - AndroidVideoPlayer.registerWith(); - expect(VideoPlayerPlatform.instance, isA()); - }); + await player.dispose(textureId); + }); - testWidgets('can be initialized', (WidgetTester tester) async { - await controller.initialize(); + testWidgets('can be played', (WidgetTester tester) async { + final int textureId = (await player.create(DataSource( + sourceType: DataSourceType.asset, + asset: _videoAssetKey, + )))!; - expect(controller.value.isInitialized, true); - expect(await controller.position, Duration.zero); - expect(controller.value.duration, - const Duration(seconds: 7, milliseconds: 540)); - }); + await player.play(textureId); + await tester.pumpAndSettle(_playDuration); - testWidgets('can be played', (WidgetTester tester) async { - await controller.initialize(); + expect(await player.getPosition(textureId), greaterThan(Duration.zero)); + await player.dispose(textureId); + }); - await controller.play(); - await tester.pumpAndSettle(_playDuration); + testWidgets('can seek', (WidgetTester tester) async { + final int textureId = (await player.create(DataSource( + sourceType: DataSourceType.asset, + asset: _videoAssetKey, + )))!; - expect(await controller.position, greaterThan(Duration.zero)); - }); + await player.seekTo(textureId, const Duration(seconds: 3)); + await tester.pumpAndSettle(_playDuration); - testWidgets('can seek', (WidgetTester tester) async { - await controller.initialize(); + expect( + await player.getPosition(textureId), + greaterThanOrEqualTo(const Duration(seconds: 3)), + ); + await player.dispose(textureId); + }); - await controller.seekTo(const Duration(seconds: 3)); + testWidgets('can pause', (WidgetTester tester) async { + final int textureId = (await player.create(DataSource( + sourceType: DataSourceType.asset, + asset: _videoAssetKey, + )))!; - expect(await controller.position, const Duration(seconds: 3)); - }); + await player.play(textureId); + await tester.pumpAndSettle(_playDuration); - testWidgets('can be paused', (WidgetTester tester) async { - await controller.initialize(); + await player.pause(textureId); + await tester.pumpAndSettle(_playDuration); + final Duration pausedDuration = await player.getPosition(textureId); + await tester.pumpAndSettle(_playDuration); - // Play for a second, then pause, and then wait a second. - await controller.play(); - await tester.pumpAndSettle(_playDuration); - await controller.pause(); - await tester.pumpAndSettle(_playDuration); - final Duration pausedPosition = (await controller.position)!; - await tester.pumpAndSettle(_playDuration); + expect(await player.getPosition(textureId), pausedDuration); + await player.dispose(textureId); + }); - // Verify that we stopped playing after the pause. - expect(await controller.position, pausedPosition); - }); + testWidgets('can play a video from a file', (WidgetTester tester) async { + final Directory directory = await getTemporaryDirectory(); + final File file = File('${directory.path}/video.mp4'); + await file.writeAsBytes( + Uint8List.fromList( + (await rootBundle.load(_videoAssetKey)).buffer.asUint8List(), + ), + ); + + final int textureId = (await player.create(DataSource( + sourceType: DataSourceType.file, + uri: file.path, + )))!; + + await player.play(textureId); + await tester.pumpAndSettle(_playDuration); + + expect(await player.getPosition(textureId), greaterThan(Duration.zero)); + await directory.delete(recursive: true); + await player.dispose(textureId); }); - group('file-based videos', () { - setUp(() async { - // Load the data from the asset. - final String tempDir = (await getTemporaryDirectory()).path; - final ByteData bytes = await rootBundle.load(_videoAssetKey); + testWidgets('can play a video from network', (WidgetTester tester) async { + final int textureId = (await player.create(DataSource( + sourceType: DataSourceType.network, + uri: getUrlForAssetAsNetworkSource(_videoAssetKey), + )))!; - // Write it to a file to use as a source. - final String filename = _videoAssetKey.split('/').last; - final File file = File('$tempDir/$filename'); - await file.writeAsBytes(bytes.buffer.asInt8List()); + await player.play(textureId); + await player.seekTo(textureId, const Duration(seconds: 5)); + await tester.pumpAndSettle(_playDuration); + await player.pause(textureId); - controller = MiniController.file(file); - }); + expect(await player.getPosition(textureId), greaterThan(Duration.zero)); - testWidgets('test video player using static file() method as constructor', - (WidgetTester tester) async { - await controller.initialize(); + final DurationRange range = await _getBufferingRange(player, textureId); + expect(range.start, Duration.zero); + expect(range.end, greaterThan(Duration.zero)); - await controller.play(); - await tester.pumpAndSettle(_playDuration); + await player.dispose(textureId); + }); +} - expect(await controller.position, greaterThan(Duration.zero)); - }); +Future _getDuration( + AndroidVideoPlayer player, + int textureId, +) { + return player.videoEventsFor(textureId).firstWhere((VideoEvent event) { + return event.eventType == VideoEventType.initialized; + }).then((VideoEvent event) { + return event.duration!; }); +} - group('network videos', () { - setUp(() { - final String videoUrl = getUrlForAssetAsNetworkSource(_videoAssetKey); - controller = MiniController.network(videoUrl); - }); - - testWidgets('reports buffering status', (WidgetTester tester) async { - await controller.initialize(); - - final Completer started = Completer(); - final Completer ended = Completer(); - controller.addListener(() { - if (!started.isCompleted && controller.value.isBuffering) { - started.complete(); - } - if (started.isCompleted && - !controller.value.isBuffering && - !ended.isCompleted) { - ended.complete(); - } - }); - - await controller.play(); - await controller.seekTo(const Duration(seconds: 5)); - await tester.pumpAndSettle(_playDuration); - await controller.pause(); - - expect(await controller.position, greaterThan(Duration.zero)); - - await expectLater(started.future, completes); - await expectLater(ended.future, completes); - }); - - testWidgets('live stream duration != 0', (WidgetTester tester) async { - final MiniController livestreamController = MiniController.network( - 'https://flutter.github.io/assets-for-api-docs/assets/videos/hls/bee.m3u8', - ); - await livestreamController.initialize(); - - expect(livestreamController.value.isInitialized, true); - // Live streams should have either a positive duration or C.TIME_UNSET if the duration is unknown - // See https://exoplayer.dev/doc/reference/com/google/android/exoplayer2/Player.html#getDuration-- - expect(livestreamController.value.duration, - (Duration duration) => duration != Duration.zero); - }); +Future _getBufferingRange( + AndroidVideoPlayer player, + int textureId, +) { + return player.videoEventsFor(textureId).firstWhere((VideoEvent event) { + return event.eventType == VideoEventType.bufferingUpdate; + }).then((VideoEvent event) { + return event.buffered!.first; }); } diff --git a/packages/video_player/video_player_android/example/pubspec.yaml b/packages/video_player/video_player_android/example/pubspec.yaml index a6c57dc8d8bb..01ce43d2c534 100644 --- a/packages/video_player/video_player_android/example/pubspec.yaml +++ b/packages/video_player/video_player_android/example/pubspec.yaml @@ -3,8 +3,8 @@ description: Demonstrates how to use the video_player plugin. publish_to: none environment: - sdk: ^3.4.0 - flutter: ">=3.22.0" + sdk: ^3.5.0 + flutter: ">=3.24.0" dependencies: flutter: diff --git a/packages/video_player/video_player_android/lib/src/messages.g.dart b/packages/video_player/video_player_android/lib/src/messages.g.dart index 47ed6a295c83..9cff05e9e9dc 100644 --- a/packages/video_player/video_player_android/lib/src/messages.g.dart +++ b/packages/video_player/video_player_android/lib/src/messages.g.dart @@ -1,9 +1,9 @@ // 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 (v9.2.5), do not edit directly. +// Autogenerated from Pigeon (v22.4.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 +// 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, no_leading_underscores_for_local_identifiers import 'dart:async'; import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List; @@ -11,6 +11,24 @@ import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List; import 'package:flutter/foundation.dart' show ReadBuffer, WriteBuffer; import 'package:flutter/services.dart'; +PlatformException _createConnectionError(String channelName) { + return PlatformException( + code: 'channel-error', + message: 'Unable to establish connection on channel: "$channelName".', + ); +} + +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 TextureMessage { TextureMessage({ required this.textureId, @@ -153,7 +171,7 @@ class CreateMessage { String? formatHint; - Map httpHeaders; + Map httpHeaders; Object encode() { return [ @@ -173,7 +191,7 @@ class CreateMessage { packageName: result[2] as String?, formatHint: result[3] as String?, httpHeaders: - (result[4] as Map?)!.cast(), + (result[4] as Map?)!.cast(), ); } } @@ -199,31 +217,34 @@ class MixWithOthersMessage { } } -class _AndroidVideoPlayerApiCodec extends StandardMessageCodec { - const _AndroidVideoPlayerApiCodec(); +class _PigeonCodec extends StandardMessageCodec { + const _PigeonCodec(); @override void writeValue(WriteBuffer buffer, Object? value) { - if (value is CreateMessage) { - buffer.putUint8(128); - writeValue(buffer, value.encode()); - } else if (value is LoopingMessage) { + if (value is int) { + buffer.putUint8(4); + buffer.putInt64(value); + } else if (value is TextureMessage) { buffer.putUint8(129); writeValue(buffer, value.encode()); - } else if (value is MixWithOthersMessage) { + } else if (value is LoopingMessage) { buffer.putUint8(130); writeValue(buffer, value.encode()); - } else if (value is PlaybackSpeedMessage) { + } else if (value is VolumeMessage) { buffer.putUint8(131); writeValue(buffer, value.encode()); - } else if (value is PositionMessage) { + } else if (value is PlaybackSpeedMessage) { buffer.putUint8(132); writeValue(buffer, value.encode()); - } else if (value is TextureMessage) { + } else if (value is PositionMessage) { buffer.putUint8(133); writeValue(buffer, value.encode()); - } else if (value is VolumeMessage) { + } else if (value is CreateMessage) { buffer.putUint8(134); writeValue(buffer, value.encode()); + } else if (value is MixWithOthersMessage) { + buffer.putUint8(135); + writeValue(buffer, value.encode()); } else { super.writeValue(buffer, value); } @@ -232,20 +253,20 @@ class _AndroidVideoPlayerApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: - return CreateMessage.decode(readValue(buffer)!); case 129: - return LoopingMessage.decode(readValue(buffer)!); + return TextureMessage.decode(readValue(buffer)!); case 130: - return MixWithOthersMessage.decode(readValue(buffer)!); + return LoopingMessage.decode(readValue(buffer)!); case 131: - return PlaybackSpeedMessage.decode(readValue(buffer)!); + return VolumeMessage.decode(readValue(buffer)!); case 132: - return PositionMessage.decode(readValue(buffer)!); + return PlaybackSpeedMessage.decode(readValue(buffer)!); case 133: - return TextureMessage.decode(readValue(buffer)!); + return PositionMessage.decode(readValue(buffer)!); case 134: - return VolumeMessage.decode(readValue(buffer)!); + return CreateMessage.decode(readValue(buffer)!); + case 135: + return MixWithOthersMessage.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); } @@ -256,257 +277,285 @@ class AndroidVideoPlayerApi { /// Constructor for [AndroidVideoPlayerApi]. The [binaryMessenger] named argument is /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. - AndroidVideoPlayerApi({BinaryMessenger? binaryMessenger}) - : _binaryMessenger = binaryMessenger; - final BinaryMessenger? _binaryMessenger; + AndroidVideoPlayerApi( + {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) + : pigeonVar_binaryMessenger = binaryMessenger, + pigeonVar_messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + final BinaryMessenger? pigeonVar_binaryMessenger; - static const MessageCodec codec = _AndroidVideoPlayerApiCodec(); + static const MessageCodec pigeonChannelCodec = _PigeonCodec(); + + final String pigeonVar_messageChannelSuffix; Future initialize() async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.AndroidVideoPlayerApi.initialize', codec, - binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send(null) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.video_player_android.AndroidVideoPlayerApi.initialize$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; } } - Future create(CreateMessage arg_msg) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.AndroidVideoPlayerApi.create', codec, - binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_msg]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + Future create(CreateMessage msg) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.video_player_android.AndroidVideoPlayerApi.create$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([msg]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (replyList[0] as TextureMessage?)!; + return (pigeonVar_replyList[0] as TextureMessage?)!; } } - Future dispose(TextureMessage arg_msg) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.AndroidVideoPlayerApi.dispose', codec, - binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_msg]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + Future dispose(TextureMessage msg) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.video_player_android.AndroidVideoPlayerApi.dispose$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([msg]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; } } - Future setLooping(LoopingMessage arg_msg) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.AndroidVideoPlayerApi.setLooping', codec, - binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_msg]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + Future setLooping(LoopingMessage msg) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.video_player_android.AndroidVideoPlayerApi.setLooping$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([msg]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; } } - Future setVolume(VolumeMessage arg_msg) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.AndroidVideoPlayerApi.setVolume', codec, - binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_msg]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + Future setVolume(VolumeMessage msg) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.video_player_android.AndroidVideoPlayerApi.setVolume$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([msg]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; } } - Future setPlaybackSpeed(PlaybackSpeedMessage arg_msg) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.AndroidVideoPlayerApi.setPlaybackSpeed', codec, - binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_msg]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + Future setPlaybackSpeed(PlaybackSpeedMessage msg) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.video_player_android.AndroidVideoPlayerApi.setPlaybackSpeed$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([msg]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; } } - Future play(TextureMessage arg_msg) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.AndroidVideoPlayerApi.play', codec, - binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_msg]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + Future play(TextureMessage msg) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.video_player_android.AndroidVideoPlayerApi.play$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([msg]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; } } - Future position(TextureMessage arg_msg) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.AndroidVideoPlayerApi.position', codec, - binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_msg]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + Future position(TextureMessage msg) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.video_player_android.AndroidVideoPlayerApi.position$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([msg]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (replyList[0] as PositionMessage?)!; + return (pigeonVar_replyList[0] as PositionMessage?)!; } } - Future seekTo(PositionMessage arg_msg) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.AndroidVideoPlayerApi.seekTo', codec, - binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_msg]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + Future seekTo(PositionMessage msg) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.video_player_android.AndroidVideoPlayerApi.seekTo$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([msg]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; } } - Future pause(TextureMessage arg_msg) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.AndroidVideoPlayerApi.pause', codec, - binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_msg]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + Future pause(TextureMessage msg) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.video_player_android.AndroidVideoPlayerApi.pause$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([msg]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; } } - Future setMixWithOthers(MixWithOthersMessage arg_msg) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.AndroidVideoPlayerApi.setMixWithOthers', codec, - binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_msg]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + Future setMixWithOthers(MixWithOthersMessage msg) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.video_player_android.AndroidVideoPlayerApi.setMixWithOthers$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([msg]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; diff --git a/packages/video_player/video_player_android/pigeons/messages.dart b/packages/video_player/video_player_android/pigeons/messages.dart index 90c9fbb61ea0..8538f52cedcf 100644 --- a/packages/video_player/video_player_android/pigeons/messages.dart +++ b/packages/video_player/video_player_android/pigeons/messages.dart @@ -48,7 +48,7 @@ class CreateMessage { String? uri; String? packageName; String? formatHint; - Map httpHeaders; + Map httpHeaders; } class MixWithOthersMessage { diff --git a/packages/video_player/video_player_android/pubspec.yaml b/packages/video_player/video_player_android/pubspec.yaml index ed629fa91f88..eaaec350813e 100644 --- a/packages/video_player/video_player_android/pubspec.yaml +++ b/packages/video_player/video_player_android/pubspec.yaml @@ -2,11 +2,11 @@ name: video_player_android description: Android implementation of the video_player plugin. repository: https://github.com/flutter/packages/tree/main/packages/video_player/video_player_android issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+video_player%22 -version: 2.6.0 +version: 2.7.15 environment: - sdk: ^3.4.0 - flutter: ">=3.22.0" + sdk: ^3.5.0 + flutter: ">=3.24.0" flutter: plugin: @@ -25,7 +25,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - pigeon: ^9.2.5 + pigeon: ^22.4.2 topics: - video diff --git a/packages/video_player/video_player_android/test/android_video_player_test.dart b/packages/video_player/video_player_android/test/android_video_player_test.dart index 4ea1d4821001..dc9544781cf6 100644 --- a/packages/video_player/video_player_android/test/android_video_player_test.dart +++ b/packages/video_player/video_player_android/test/android_video_player_test.dart @@ -102,7 +102,7 @@ void main() { setUp(() { log = _ApiLogger(); - TestHostVideoPlayerApi.setup(log); + TestHostVideoPlayerApi.setUp(log); }); test('init', () async { diff --git a/packages/video_player/video_player_android/test/test_api.g.dart b/packages/video_player/video_player_android/test/test_api.g.dart index bb68e71c2fb8..6dadde6b37e4 100644 --- a/packages/video_player/video_player_android/test/test_api.g.dart +++ b/packages/video_player/video_player_android/test/test_api.g.dart @@ -1,9 +1,9 @@ // 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 (v9.2.5), do not edit directly. +// Autogenerated from Pigeon (v22.4.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, unnecessary_import +// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, unnecessary_import, no_leading_underscores_for_local_identifiers // ignore_for_file: avoid_relative_lib_imports import 'dart:async'; import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List; @@ -13,31 +13,34 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:video_player_android/src/messages.g.dart'; -class _TestHostVideoPlayerApiCodec extends StandardMessageCodec { - const _TestHostVideoPlayerApiCodec(); +class _PigeonCodec extends StandardMessageCodec { + const _PigeonCodec(); @override void writeValue(WriteBuffer buffer, Object? value) { - if (value is CreateMessage) { - buffer.putUint8(128); - writeValue(buffer, value.encode()); - } else if (value is LoopingMessage) { + if (value is int) { + buffer.putUint8(4); + buffer.putInt64(value); + } else if (value is TextureMessage) { buffer.putUint8(129); writeValue(buffer, value.encode()); - } else if (value is MixWithOthersMessage) { + } else if (value is LoopingMessage) { buffer.putUint8(130); writeValue(buffer, value.encode()); - } else if (value is PlaybackSpeedMessage) { + } else if (value is VolumeMessage) { buffer.putUint8(131); writeValue(buffer, value.encode()); - } else if (value is PositionMessage) { + } else if (value is PlaybackSpeedMessage) { buffer.putUint8(132); writeValue(buffer, value.encode()); - } else if (value is TextureMessage) { + } else if (value is PositionMessage) { buffer.putUint8(133); writeValue(buffer, value.encode()); - } else if (value is VolumeMessage) { + } else if (value is CreateMessage) { buffer.putUint8(134); writeValue(buffer, value.encode()); + } else if (value is MixWithOthersMessage) { + buffer.putUint8(135); + writeValue(buffer, value.encode()); } else { super.writeValue(buffer, value); } @@ -46,20 +49,20 @@ class _TestHostVideoPlayerApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: - return CreateMessage.decode(readValue(buffer)!); case 129: - return LoopingMessage.decode(readValue(buffer)!); + return TextureMessage.decode(readValue(buffer)!); case 130: - return MixWithOthersMessage.decode(readValue(buffer)!); + return LoopingMessage.decode(readValue(buffer)!); case 131: - return PlaybackSpeedMessage.decode(readValue(buffer)!); + return VolumeMessage.decode(readValue(buffer)!); case 132: - return PositionMessage.decode(readValue(buffer)!); + return PlaybackSpeedMessage.decode(readValue(buffer)!); case 133: - return TextureMessage.decode(readValue(buffer)!); + return PositionMessage.decode(readValue(buffer)!); case 134: - return VolumeMessage.decode(readValue(buffer)!); + return CreateMessage.decode(readValue(buffer)!); + case 135: + return MixWithOthersMessage.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); } @@ -69,7 +72,7 @@ class _TestHostVideoPlayerApiCodec extends StandardMessageCodec { abstract class TestHostVideoPlayerApi { static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; - static const MessageCodec codec = _TestHostVideoPlayerApiCodec(); + static const MessageCodec pigeonChannelCodec = _PigeonCodec(); void initialize(); @@ -93,244 +96,358 @@ abstract class TestHostVideoPlayerApi { void setMixWithOthers(MixWithOthersMessage msg); - static void setup(TestHostVideoPlayerApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setUp( + TestHostVideoPlayerApi? api, { + BinaryMessenger? binaryMessenger, + String messageChannelSuffix = '', + }) { + messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.AndroidVideoPlayerApi.initialize', codec, + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.video_player_android.AndroidVideoPlayerApi.initialize$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { - // ignore message - api.initialize(); - return []; + try { + api.initialize(); + return wrapResponse(empty: true); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } }); } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.AndroidVideoPlayerApi.create', codec, + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.video_player_android.AndroidVideoPlayerApi.create$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.AndroidVideoPlayerApi.create was null.'); + 'Argument for dev.flutter.pigeon.video_player_android.AndroidVideoPlayerApi.create was null.'); final List args = (message as List?)!; final CreateMessage? arg_msg = (args[0] as CreateMessage?); assert(arg_msg != null, - 'Argument for dev.flutter.pigeon.AndroidVideoPlayerApi.create was null, expected non-null CreateMessage.'); - final TextureMessage output = api.create(arg_msg!); - return [output]; + 'Argument for dev.flutter.pigeon.video_player_android.AndroidVideoPlayerApi.create was null, expected non-null CreateMessage.'); + try { + final TextureMessage output = api.create(arg_msg!); + return [output]; + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } }); } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.AndroidVideoPlayerApi.dispose', codec, + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.video_player_android.AndroidVideoPlayerApi.dispose$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.AndroidVideoPlayerApi.dispose was null.'); + 'Argument for dev.flutter.pigeon.video_player_android.AndroidVideoPlayerApi.dispose was null.'); final List args = (message as List?)!; final TextureMessage? arg_msg = (args[0] as TextureMessage?); assert(arg_msg != null, - 'Argument for dev.flutter.pigeon.AndroidVideoPlayerApi.dispose was null, expected non-null TextureMessage.'); - api.dispose(arg_msg!); - return []; + 'Argument for dev.flutter.pigeon.video_player_android.AndroidVideoPlayerApi.dispose was null, expected non-null TextureMessage.'); + try { + api.dispose(arg_msg!); + return wrapResponse(empty: true); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } }); } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.AndroidVideoPlayerApi.setLooping', codec, + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.video_player_android.AndroidVideoPlayerApi.setLooping$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.AndroidVideoPlayerApi.setLooping was null.'); + 'Argument for dev.flutter.pigeon.video_player_android.AndroidVideoPlayerApi.setLooping was null.'); final List args = (message as List?)!; final LoopingMessage? arg_msg = (args[0] as LoopingMessage?); assert(arg_msg != null, - 'Argument for dev.flutter.pigeon.AndroidVideoPlayerApi.setLooping was null, expected non-null LoopingMessage.'); - api.setLooping(arg_msg!); - return []; + 'Argument for dev.flutter.pigeon.video_player_android.AndroidVideoPlayerApi.setLooping was null, expected non-null LoopingMessage.'); + try { + api.setLooping(arg_msg!); + return wrapResponse(empty: true); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } }); } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.AndroidVideoPlayerApi.setVolume', codec, + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.video_player_android.AndroidVideoPlayerApi.setVolume$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.AndroidVideoPlayerApi.setVolume was null.'); + 'Argument for dev.flutter.pigeon.video_player_android.AndroidVideoPlayerApi.setVolume was null.'); final List args = (message as List?)!; final VolumeMessage? arg_msg = (args[0] as VolumeMessage?); assert(arg_msg != null, - 'Argument for dev.flutter.pigeon.AndroidVideoPlayerApi.setVolume was null, expected non-null VolumeMessage.'); - api.setVolume(arg_msg!); - return []; + 'Argument for dev.flutter.pigeon.video_player_android.AndroidVideoPlayerApi.setVolume was null, expected non-null VolumeMessage.'); + try { + api.setVolume(arg_msg!); + return wrapResponse(empty: true); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } }); } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.AndroidVideoPlayerApi.setPlaybackSpeed', codec, + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.video_player_android.AndroidVideoPlayerApi.setPlaybackSpeed$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.AndroidVideoPlayerApi.setPlaybackSpeed was null.'); + 'Argument for dev.flutter.pigeon.video_player_android.AndroidVideoPlayerApi.setPlaybackSpeed was null.'); final List args = (message as List?)!; final PlaybackSpeedMessage? arg_msg = (args[0] as PlaybackSpeedMessage?); assert(arg_msg != null, - 'Argument for dev.flutter.pigeon.AndroidVideoPlayerApi.setPlaybackSpeed was null, expected non-null PlaybackSpeedMessage.'); - api.setPlaybackSpeed(arg_msg!); - return []; + 'Argument for dev.flutter.pigeon.video_player_android.AndroidVideoPlayerApi.setPlaybackSpeed was null, expected non-null PlaybackSpeedMessage.'); + try { + api.setPlaybackSpeed(arg_msg!); + return wrapResponse(empty: true); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } }); } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.AndroidVideoPlayerApi.play', codec, + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.video_player_android.AndroidVideoPlayerApi.play$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.AndroidVideoPlayerApi.play was null.'); + 'Argument for dev.flutter.pigeon.video_player_android.AndroidVideoPlayerApi.play was null.'); final List args = (message as List?)!; final TextureMessage? arg_msg = (args[0] as TextureMessage?); assert(arg_msg != null, - 'Argument for dev.flutter.pigeon.AndroidVideoPlayerApi.play was null, expected non-null TextureMessage.'); - api.play(arg_msg!); - return []; + 'Argument for dev.flutter.pigeon.video_player_android.AndroidVideoPlayerApi.play was null, expected non-null TextureMessage.'); + try { + api.play(arg_msg!); + return wrapResponse(empty: true); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } }); } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.AndroidVideoPlayerApi.position', codec, + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.video_player_android.AndroidVideoPlayerApi.position$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.AndroidVideoPlayerApi.position was null.'); + 'Argument for dev.flutter.pigeon.video_player_android.AndroidVideoPlayerApi.position was null.'); final List args = (message as List?)!; final TextureMessage? arg_msg = (args[0] as TextureMessage?); assert(arg_msg != null, - 'Argument for dev.flutter.pigeon.AndroidVideoPlayerApi.position was null, expected non-null TextureMessage.'); - final PositionMessage output = api.position(arg_msg!); - return [output]; + 'Argument for dev.flutter.pigeon.video_player_android.AndroidVideoPlayerApi.position was null, expected non-null TextureMessage.'); + try { + final PositionMessage output = api.position(arg_msg!); + return [output]; + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } }); } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.AndroidVideoPlayerApi.seekTo', codec, + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.video_player_android.AndroidVideoPlayerApi.seekTo$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.AndroidVideoPlayerApi.seekTo was null.'); + 'Argument for dev.flutter.pigeon.video_player_android.AndroidVideoPlayerApi.seekTo was null.'); final List args = (message as List?)!; final PositionMessage? arg_msg = (args[0] as PositionMessage?); assert(arg_msg != null, - 'Argument for dev.flutter.pigeon.AndroidVideoPlayerApi.seekTo was null, expected non-null PositionMessage.'); - api.seekTo(arg_msg!); - return []; + 'Argument for dev.flutter.pigeon.video_player_android.AndroidVideoPlayerApi.seekTo was null, expected non-null PositionMessage.'); + try { + api.seekTo(arg_msg!); + return wrapResponse(empty: true); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } }); } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.AndroidVideoPlayerApi.pause', codec, + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.video_player_android.AndroidVideoPlayerApi.pause$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.AndroidVideoPlayerApi.pause was null.'); + 'Argument for dev.flutter.pigeon.video_player_android.AndroidVideoPlayerApi.pause was null.'); final List args = (message as List?)!; final TextureMessage? arg_msg = (args[0] as TextureMessage?); assert(arg_msg != null, - 'Argument for dev.flutter.pigeon.AndroidVideoPlayerApi.pause was null, expected non-null TextureMessage.'); - api.pause(arg_msg!); - return []; + 'Argument for dev.flutter.pigeon.video_player_android.AndroidVideoPlayerApi.pause was null, expected non-null TextureMessage.'); + try { + api.pause(arg_msg!); + return wrapResponse(empty: true); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } }); } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.AndroidVideoPlayerApi.setMixWithOthers', codec, + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.video_player_android.AndroidVideoPlayerApi.setMixWithOthers$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.AndroidVideoPlayerApi.setMixWithOthers was null.'); + 'Argument for dev.flutter.pigeon.video_player_android.AndroidVideoPlayerApi.setMixWithOthers was null.'); final List args = (message as List?)!; final MixWithOthersMessage? arg_msg = (args[0] as MixWithOthersMessage?); assert(arg_msg != null, - 'Argument for dev.flutter.pigeon.AndroidVideoPlayerApi.setMixWithOthers was null, expected non-null MixWithOthersMessage.'); - api.setMixWithOthers(arg_msg!); - return []; + 'Argument for dev.flutter.pigeon.video_player_android.AndroidVideoPlayerApi.setMixWithOthers was null, expected non-null MixWithOthersMessage.'); + try { + api.setMixWithOthers(arg_msg!); + return wrapResponse(empty: true); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } }); } } diff --git a/packages/video_player/video_player_avfoundation/CHANGELOG.md b/packages/video_player/video_player_avfoundation/CHANGELOG.md index e51f69fd6138..84579777521a 100644 --- a/packages/video_player/video_player_avfoundation/CHANGELOG.md +++ b/packages/video_player/video_player_avfoundation/CHANGELOG.md @@ -1,5 +1,6 @@ -## NEXT +## 2.6.2 +* Updates Pigeon for non-nullable collection type support. * Updates minimum supported SDK version to Flutter 3.19/Dart 3.3. ## 2.6.1 diff --git a/packages/video_player/video_player_avfoundation/darwin/video_player_avfoundation/Sources/video_player_avfoundation/include/video_player_avfoundation/messages.g.h b/packages/video_player/video_player_avfoundation/darwin/video_player_avfoundation/Sources/video_player_avfoundation/include/video_player_avfoundation/messages.g.h index 368c4893c662..afb118f14cd0 100644 --- a/packages/video_player/video_player_avfoundation/darwin/video_player_avfoundation/Sources/video_player_avfoundation/include/video_player_avfoundation/messages.g.h +++ b/packages/video_player/video_player_avfoundation/darwin/video_player_avfoundation/Sources/video_player_avfoundation/include/video_player_avfoundation/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 (v18.0.0), do not edit directly. +// Autogenerated from Pigeon (v22.4.2), do not edit directly. // See also: https://pub.dev/packages/pigeon #import @@ -30,8 +30,8 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, copy) NSDictionary *httpHeaders; @end -/// The codec used by FVPAVFoundationVideoPlayerApi. -NSObject *FVPAVFoundationVideoPlayerApiGetCodec(void); +/// The codec used by all APIs. +NSObject *FVPGetMessagesCodec(void); @protocol FVPAVFoundationVideoPlayerApi - (void)initialize:(FlutterError *_Nullable *_Nonnull)error; diff --git a/packages/video_player/video_player_avfoundation/darwin/video_player_avfoundation/Sources/video_player_avfoundation/messages.g.m b/packages/video_player/video_player_avfoundation/darwin/video_player_avfoundation/Sources/video_player_avfoundation/messages.g.m index 1e2354d88289..9749b125a9ee 100644 --- a/packages/video_player/video_player_avfoundation/darwin/video_player_avfoundation/Sources/video_player_avfoundation/messages.g.m +++ b/packages/video_player/video_player_avfoundation/darwin/video_player_avfoundation/Sources/video_player_avfoundation/messages.g.m @@ -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 (v18.0.0), do not edit directly. +// Autogenerated from Pigeon (v22.4.2), do not edit directly. // See also: https://pub.dev/packages/pigeon #import "./include/video_player_avfoundation/messages.g.h" @@ -16,7 +16,7 @@ #error File requires ARC to be enabled. #endif -static NSArray *wrapResult(id result, FlutterError *error) { +static NSArray *wrapResult(id result, FlutterError *error) { if (error) { return @[ error.code ?: [NSNull null], error.message ?: [NSNull null], error.details ?: [NSNull null] @@ -25,15 +25,15 @@ return @[ result ?: [NSNull null] ]; } -static id GetNullableObjectAtIndex(NSArray *array, NSInteger key) { +static id GetNullableObjectAtIndex(NSArray *array, NSInteger key) { id result = array[key]; return (result == [NSNull null]) ? nil : result; } @interface FVPCreationOptions () -+ (FVPCreationOptions *)fromList:(NSArray *)list; -+ (nullable FVPCreationOptions *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; ++ (FVPCreationOptions *)fromList:(NSArray *)list; ++ (nullable FVPCreationOptions *)nullableFromList:(NSArray *)list; +- (NSArray *)toList; @end @implementation FVPCreationOptions @@ -50,7 +50,7 @@ + (instancetype)makeWithAsset:(nullable NSString *)asset pigeonResult.httpHeaders = httpHeaders; return pigeonResult; } -+ (FVPCreationOptions *)fromList:(NSArray *)list { ++ (FVPCreationOptions *)fromList:(NSArray *)list { FVPCreationOptions *pigeonResult = [[FVPCreationOptions alloc] init]; pigeonResult.asset = GetNullableObjectAtIndex(list, 0); pigeonResult.uri = GetNullableObjectAtIndex(list, 1); @@ -59,10 +59,10 @@ + (FVPCreationOptions *)fromList:(NSArray *)list { pigeonResult.httpHeaders = GetNullableObjectAtIndex(list, 4); return pigeonResult; } -+ (nullable FVPCreationOptions *)nullableFromList:(NSArray *)list { ++ (nullable FVPCreationOptions *)nullableFromList:(NSArray *)list { return (list) ? [FVPCreationOptions fromList:list] : nil; } -- (NSArray *)toList { +- (NSArray *)toList { return @[ self.asset ?: [NSNull null], self.uri ?: [NSNull null], @@ -73,12 +73,12 @@ - (NSArray *)toList { } @end -@interface FVPAVFoundationVideoPlayerApiCodecReader : FlutterStandardReader +@interface FVPMessagesPigeonCodecReader : FlutterStandardReader @end -@implementation FVPAVFoundationVideoPlayerApiCodecReader +@implementation FVPMessagesPigeonCodecReader - (nullable id)readValueOfType:(UInt8)type { switch (type) { - case 128: + case 129: return [FVPCreationOptions fromList:[self readValue]]; default: return [super readValueOfType:type]; @@ -86,12 +86,12 @@ - (nullable id)readValueOfType:(UInt8)type { } @end -@interface FVPAVFoundationVideoPlayerApiCodecWriter : FlutterStandardWriter +@interface FVPMessagesPigeonCodecWriter : FlutterStandardWriter @end -@implementation FVPAVFoundationVideoPlayerApiCodecWriter +@implementation FVPMessagesPigeonCodecWriter - (void)writeValue:(id)value { if ([value isKindOfClass:[FVPCreationOptions class]]) { - [self writeByte:128]; + [self writeByte:129]; [self writeValue:[value toList]]; } else { [super writeValue:value]; @@ -99,28 +99,27 @@ - (void)writeValue:(id)value { } @end -@interface FVPAVFoundationVideoPlayerApiCodecReaderWriter : FlutterStandardReaderWriter +@interface FVPMessagesPigeonCodecReaderWriter : FlutterStandardReaderWriter @end -@implementation FVPAVFoundationVideoPlayerApiCodecReaderWriter +@implementation FVPMessagesPigeonCodecReaderWriter - (FlutterStandardWriter *)writerWithData:(NSMutableData *)data { - return [[FVPAVFoundationVideoPlayerApiCodecWriter alloc] initWithData:data]; + return [[FVPMessagesPigeonCodecWriter alloc] initWithData:data]; } - (FlutterStandardReader *)readerWithData:(NSData *)data { - return [[FVPAVFoundationVideoPlayerApiCodecReader alloc] initWithData:data]; + return [[FVPMessagesPigeonCodecReader alloc] initWithData:data]; } @end -NSObject *FVPAVFoundationVideoPlayerApiGetCodec(void) { +NSObject *FVPGetMessagesCodec(void) { static FlutterStandardMessageCodec *sSharedObject = nil; static dispatch_once_t sPred = 0; dispatch_once(&sPred, ^{ - FVPAVFoundationVideoPlayerApiCodecReaderWriter *readerWriter = - [[FVPAVFoundationVideoPlayerApiCodecReaderWriter alloc] init]; + FVPMessagesPigeonCodecReaderWriter *readerWriter = + [[FVPMessagesPigeonCodecReaderWriter alloc] init]; sSharedObject = [FlutterStandardMessageCodec codecWithReaderWriter:readerWriter]; }); return sSharedObject; } - void SetUpFVPAVFoundationVideoPlayerApi(id binaryMessenger, NSObject *api) { SetUpFVPAVFoundationVideoPlayerApiWithSuffix(binaryMessenger, api, @""); @@ -139,7 +138,7 @@ void SetUpFVPAVFoundationVideoPlayerApiWithSuffix(id bin @"AVFoundationVideoPlayerApi.initialize", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FVPAVFoundationVideoPlayerApiGetCodec()]; + codec:FVPGetMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(initialize:)], @"FVPAVFoundationVideoPlayerApi api (%@) doesn't respond to @selector(initialize:)", @@ -160,14 +159,14 @@ void SetUpFVPAVFoundationVideoPlayerApiWithSuffix(id bin @"AVFoundationVideoPlayerApi.create", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FVPAVFoundationVideoPlayerApiGetCodec()]; + codec:FVPGetMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(createWithOptions:error:)], @"FVPAVFoundationVideoPlayerApi api (%@) doesn't respond to " @"@selector(createWithOptions:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; FVPCreationOptions *arg_creationOptions = GetNullableObjectAtIndex(args, 0); FlutterError *error; NSNumber *output = [api createWithOptions:arg_creationOptions error:&error]; @@ -184,14 +183,14 @@ void SetUpFVPAVFoundationVideoPlayerApiWithSuffix(id bin @"AVFoundationVideoPlayerApi.dispose", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FVPAVFoundationVideoPlayerApiGetCodec()]; + codec:FVPGetMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(disposePlayer:error:)], @"FVPAVFoundationVideoPlayerApi api (%@) doesn't respond to " @"@selector(disposePlayer:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; NSInteger arg_textureId = [GetNullableObjectAtIndex(args, 0) integerValue]; FlutterError *error; [api disposePlayer:arg_textureId error:&error]; @@ -208,14 +207,14 @@ void SetUpFVPAVFoundationVideoPlayerApiWithSuffix(id bin @"AVFoundationVideoPlayerApi.setLooping", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FVPAVFoundationVideoPlayerApiGetCodec()]; + codec:FVPGetMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(setLooping:forPlayer:error:)], @"FVPAVFoundationVideoPlayerApi api (%@) doesn't respond to " @"@selector(setLooping:forPlayer:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; BOOL arg_isLooping = [GetNullableObjectAtIndex(args, 0) boolValue]; NSInteger arg_textureId = [GetNullableObjectAtIndex(args, 1) integerValue]; FlutterError *error; @@ -233,14 +232,14 @@ void SetUpFVPAVFoundationVideoPlayerApiWithSuffix(id bin @"AVFoundationVideoPlayerApi.setVolume", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FVPAVFoundationVideoPlayerApiGetCodec()]; + codec:FVPGetMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(setVolume:forPlayer:error:)], @"FVPAVFoundationVideoPlayerApi api (%@) doesn't respond to " @"@selector(setVolume:forPlayer:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; double arg_volume = [GetNullableObjectAtIndex(args, 0) doubleValue]; NSInteger arg_textureId = [GetNullableObjectAtIndex(args, 1) integerValue]; FlutterError *error; @@ -258,14 +257,14 @@ void SetUpFVPAVFoundationVideoPlayerApiWithSuffix(id bin @"AVFoundationVideoPlayerApi.setPlaybackSpeed", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FVPAVFoundationVideoPlayerApiGetCodec()]; + codec:FVPGetMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(setPlaybackSpeed:forPlayer:error:)], @"FVPAVFoundationVideoPlayerApi api (%@) doesn't respond to " @"@selector(setPlaybackSpeed:forPlayer:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; double arg_speed = [GetNullableObjectAtIndex(args, 0) doubleValue]; NSInteger arg_textureId = [GetNullableObjectAtIndex(args, 1) integerValue]; FlutterError *error; @@ -283,14 +282,14 @@ void SetUpFVPAVFoundationVideoPlayerApiWithSuffix(id bin @"AVFoundationVideoPlayerApi.play", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FVPAVFoundationVideoPlayerApiGetCodec()]; + codec:FVPGetMessagesCodec()]; if (api) { NSCAssert( [api respondsToSelector:@selector(playPlayer:error:)], @"FVPAVFoundationVideoPlayerApi api (%@) doesn't respond to @selector(playPlayer:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; NSInteger arg_textureId = [GetNullableObjectAtIndex(args, 0) integerValue]; FlutterError *error; [api playPlayer:arg_textureId error:&error]; @@ -307,14 +306,14 @@ void SetUpFVPAVFoundationVideoPlayerApiWithSuffix(id bin @"AVFoundationVideoPlayerApi.getPosition", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FVPAVFoundationVideoPlayerApiGetCodec()]; + codec:FVPGetMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(positionForPlayer:error:)], @"FVPAVFoundationVideoPlayerApi api (%@) doesn't respond to " @"@selector(positionForPlayer:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; NSInteger arg_textureId = [GetNullableObjectAtIndex(args, 0) integerValue]; FlutterError *error; NSNumber *output = [api positionForPlayer:arg_textureId error:&error]; @@ -331,14 +330,14 @@ void SetUpFVPAVFoundationVideoPlayerApiWithSuffix(id bin @"AVFoundationVideoPlayerApi.seekTo", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FVPAVFoundationVideoPlayerApiGetCodec()]; + codec:FVPGetMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(seekTo:forPlayer:completion:)], @"FVPAVFoundationVideoPlayerApi api (%@) doesn't respond to " @"@selector(seekTo:forPlayer:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; NSInteger arg_position = [GetNullableObjectAtIndex(args, 0) integerValue]; NSInteger arg_textureId = [GetNullableObjectAtIndex(args, 1) integerValue]; [api seekTo:arg_position @@ -358,14 +357,14 @@ void SetUpFVPAVFoundationVideoPlayerApiWithSuffix(id bin @"AVFoundationVideoPlayerApi.pause", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FVPAVFoundationVideoPlayerApiGetCodec()]; + codec:FVPGetMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(pausePlayer:error:)], @"FVPAVFoundationVideoPlayerApi api (%@) doesn't respond to " @"@selector(pausePlayer:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; NSInteger arg_textureId = [GetNullableObjectAtIndex(args, 0) integerValue]; FlutterError *error; [api pausePlayer:arg_textureId error:&error]; @@ -382,14 +381,14 @@ void SetUpFVPAVFoundationVideoPlayerApiWithSuffix(id bin @"AVFoundationVideoPlayerApi.setMixWithOthers", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FVPAVFoundationVideoPlayerApiGetCodec()]; + codec:FVPGetMessagesCodec()]; if (api) { NSCAssert([api respondsToSelector:@selector(setMixWithOthers:error:)], @"FVPAVFoundationVideoPlayerApi api (%@) doesn't respond to " @"@selector(setMixWithOthers:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; + NSArray *args = message; BOOL arg_mixWithOthers = [GetNullableObjectAtIndex(args, 0) boolValue]; FlutterError *error; [api setMixWithOthers:arg_mixWithOthers error:&error]; diff --git a/packages/video_player/video_player_avfoundation/lib/src/messages.g.dart b/packages/video_player/video_player_avfoundation/lib/src/messages.g.dart index f14e30cd5b6e..ea4a93fdaba1 100644 --- a/packages/video_player/video_player_avfoundation/lib/src/messages.g.dart +++ b/packages/video_player/video_player_avfoundation/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 (v18.0.0), do not edit directly. +// Autogenerated from Pigeon (v22.4.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, no_leading_underscores_for_local_identifiers @@ -46,7 +46,7 @@ class CreationOptions { String? formatHint; - Map httpHeaders; + Map httpHeaders; Object encode() { return [ @@ -66,17 +66,20 @@ class CreationOptions { packageName: result[2] as String?, formatHint: result[3] as String?, httpHeaders: - (result[4] as Map?)!.cast(), + (result[4] as Map?)!.cast(), ); } } -class _AVFoundationVideoPlayerApiCodec extends StandardMessageCodec { - const _AVFoundationVideoPlayerApiCodec(); +class _PigeonCodec extends StandardMessageCodec { + const _PigeonCodec(); @override void writeValue(WriteBuffer buffer, Object? value) { - if (value is CreationOptions) { - buffer.putUint8(128); + if (value is int) { + buffer.putUint8(4); + buffer.putInt64(value); + } else if (value is CreationOptions) { + buffer.putUint8(129); writeValue(buffer, value.encode()); } else { super.writeValue(buffer, value); @@ -86,7 +89,7 @@ class _AVFoundationVideoPlayerApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 129: return CreationOptions.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -100,34 +103,33 @@ class AVFoundationVideoPlayerApi { /// BinaryMessenger will be used which routes to the host platform. AVFoundationVideoPlayerApi( {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) - : __pigeon_binaryMessenger = binaryMessenger, - __pigeon_messageChannelSuffix = + : pigeonVar_binaryMessenger = binaryMessenger, + pigeonVar_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; - final BinaryMessenger? __pigeon_binaryMessenger; + final BinaryMessenger? pigeonVar_binaryMessenger; - static const MessageCodec pigeonChannelCodec = - _AVFoundationVideoPlayerApiCodec(); + static const MessageCodec pigeonChannelCodec = _PigeonCodec(); - final String __pigeon_messageChannelSuffix; + final String pigeonVar_messageChannelSuffix; Future initialize() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.video_player_avfoundation.AVFoundationVideoPlayerApi.initialize$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.video_player_avfoundation.AVFoundationVideoPlayerApi.initialize$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -135,52 +137,52 @@ class AVFoundationVideoPlayerApi { } Future create(CreationOptions creationOptions) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.video_player_avfoundation.AVFoundationVideoPlayerApi.create$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.video_player_avfoundation.AVFoundationVideoPlayerApi.create$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel + final List? pigeonVar_replyList = await pigeonVar_channel .send([creationOptions]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as int?)!; + return (pigeonVar_replyList[0] as int?)!; } } Future dispose(int textureId) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.video_player_avfoundation.AVFoundationVideoPlayerApi.dispose$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.video_player_avfoundation.AVFoundationVideoPlayerApi.dispose$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([textureId]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([textureId]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -188,23 +190,23 @@ class AVFoundationVideoPlayerApi { } Future setLooping(bool isLooping, int textureId) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.video_player_avfoundation.AVFoundationVideoPlayerApi.setLooping$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.video_player_avfoundation.AVFoundationVideoPlayerApi.setLooping$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel + final List? pigeonVar_replyList = await pigeonVar_channel .send([isLooping, textureId]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -212,23 +214,23 @@ class AVFoundationVideoPlayerApi { } Future setVolume(double volume, int textureId) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.video_player_avfoundation.AVFoundationVideoPlayerApi.setVolume$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.video_player_avfoundation.AVFoundationVideoPlayerApi.setVolume$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel + final List? pigeonVar_replyList = await pigeonVar_channel .send([volume, textureId]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -236,23 +238,23 @@ class AVFoundationVideoPlayerApi { } Future setPlaybackSpeed(double speed, int textureId) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.video_player_avfoundation.AVFoundationVideoPlayerApi.setPlaybackSpeed$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.video_player_avfoundation.AVFoundationVideoPlayerApi.setPlaybackSpeed$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel + final List? pigeonVar_replyList = await pigeonVar_channel .send([speed, textureId]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -260,23 +262,23 @@ class AVFoundationVideoPlayerApi { } Future play(int textureId) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.video_player_avfoundation.AVFoundationVideoPlayerApi.play$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.video_player_avfoundation.AVFoundationVideoPlayerApi.play$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([textureId]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([textureId]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -284,52 +286,52 @@ class AVFoundationVideoPlayerApi { } Future getPosition(int textureId) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.video_player_avfoundation.AVFoundationVideoPlayerApi.getPosition$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.video_player_avfoundation.AVFoundationVideoPlayerApi.getPosition$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([textureId]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([textureId]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as int?)!; + return (pigeonVar_replyList[0] as int?)!; } } Future seekTo(int position, int textureId) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.video_player_avfoundation.AVFoundationVideoPlayerApi.seekTo$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.video_player_avfoundation.AVFoundationVideoPlayerApi.seekTo$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel + final List? pigeonVar_replyList = await pigeonVar_channel .send([position, textureId]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -337,23 +339,23 @@ class AVFoundationVideoPlayerApi { } Future pause(int textureId) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.video_player_avfoundation.AVFoundationVideoPlayerApi.pause$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.video_player_avfoundation.AVFoundationVideoPlayerApi.pause$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([textureId]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([textureId]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -361,23 +363,23 @@ class AVFoundationVideoPlayerApi { } Future setMixWithOthers(bool mixWithOthers) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.video_player_avfoundation.AVFoundationVideoPlayerApi.setMixWithOthers$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = + final String pigeonVar_channelName = + 'dev.flutter.pigeon.video_player_avfoundation.AVFoundationVideoPlayerApi.setMixWithOthers$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( - __pigeon_channelName, + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([mixWithOthers]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = await pigeonVar_channel + .send([mixWithOthers]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; diff --git a/packages/video_player/video_player_avfoundation/pigeons/messages.dart b/packages/video_player/video_player_avfoundation/pigeons/messages.dart index 8dbda80bd550..7a2d2957be16 100644 --- a/packages/video_player/video_player_avfoundation/pigeons/messages.dart +++ b/packages/video_player/video_player_avfoundation/pigeons/messages.dart @@ -23,12 +23,7 @@ class CreationOptions { String? uri; String? packageName; String? formatHint; - Map httpHeaders; -} - -class MixWithOthersMessage { - MixWithOthersMessage(this.mixWithOthers); - bool mixWithOthers; + Map httpHeaders; } @HostApi(dartHostTestHandler: 'TestHostVideoPlayerApi') diff --git a/packages/video_player/video_player_avfoundation/pubspec.yaml b/packages/video_player/video_player_avfoundation/pubspec.yaml index dad297f40207..d309c02258d1 100644 --- a/packages/video_player/video_player_avfoundation/pubspec.yaml +++ b/packages/video_player/video_player_avfoundation/pubspec.yaml @@ -2,7 +2,7 @@ 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.6.1 +version: 2.6.2 environment: sdk: ^3.3.0 @@ -29,7 +29,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - pigeon: ^18.0.0 + pigeon: ^22.4.2 topics: - video diff --git a/packages/video_player/video_player_avfoundation/test/test_api.g.dart b/packages/video_player/video_player_avfoundation/test/test_api.g.dart index 180e3037c664..6dbbb53d233e 100644 --- a/packages/video_player/video_player_avfoundation/test/test_api.g.dart +++ b/packages/video_player/video_player_avfoundation/test/test_api.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 (v18.0.0), do not edit directly. +// Autogenerated from Pigeon (v22.4.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, unnecessary_import, no_leading_underscores_for_local_identifiers // ignore_for_file: avoid_relative_lib_imports @@ -13,12 +13,15 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:video_player_avfoundation/src/messages.g.dart'; -class _TestHostVideoPlayerApiCodec extends StandardMessageCodec { - const _TestHostVideoPlayerApiCodec(); +class _PigeonCodec extends StandardMessageCodec { + const _PigeonCodec(); @override void writeValue(WriteBuffer buffer, Object? value) { - if (value is CreationOptions) { - buffer.putUint8(128); + if (value is int) { + buffer.putUint8(4); + buffer.putInt64(value); + } else if (value is CreationOptions) { + buffer.putUint8(129); writeValue(buffer, value.encode()); } else { super.writeValue(buffer, value); @@ -28,7 +31,7 @@ class _TestHostVideoPlayerApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 129: return CreationOptions.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -39,8 +42,7 @@ class _TestHostVideoPlayerApiCodec extends StandardMessageCodec { abstract class TestHostVideoPlayerApi { static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; - static const MessageCodec pigeonChannelCodec = - _TestHostVideoPlayerApiCodec(); + static const MessageCodec pigeonChannelCodec = _PigeonCodec(); void initialize(); @@ -72,17 +74,18 @@ abstract class TestHostVideoPlayerApi { messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.video_player_avfoundation.AVFoundationVideoPlayerApi.initialize$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { try { api.initialize(); @@ -97,17 +100,18 @@ abstract class TestHostVideoPlayerApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.video_player_avfoundation.AVFoundationVideoPlayerApi.create$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.video_player_avfoundation.AVFoundationVideoPlayerApi.create was null.'); @@ -129,17 +133,18 @@ abstract class TestHostVideoPlayerApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.video_player_avfoundation.AVFoundationVideoPlayerApi.dispose$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.video_player_avfoundation.AVFoundationVideoPlayerApi.dispose was null.'); @@ -160,17 +165,18 @@ abstract class TestHostVideoPlayerApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.video_player_avfoundation.AVFoundationVideoPlayerApi.setLooping$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.video_player_avfoundation.AVFoundationVideoPlayerApi.setLooping was null.'); @@ -194,17 +200,18 @@ abstract class TestHostVideoPlayerApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.video_player_avfoundation.AVFoundationVideoPlayerApi.setVolume$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.video_player_avfoundation.AVFoundationVideoPlayerApi.setVolume was null.'); @@ -228,17 +235,18 @@ abstract class TestHostVideoPlayerApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.video_player_avfoundation.AVFoundationVideoPlayerApi.setPlaybackSpeed$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.video_player_avfoundation.AVFoundationVideoPlayerApi.setPlaybackSpeed was null.'); @@ -262,17 +270,18 @@ abstract class TestHostVideoPlayerApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.video_player_avfoundation.AVFoundationVideoPlayerApi.play$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.video_player_avfoundation.AVFoundationVideoPlayerApi.play was null.'); @@ -293,17 +302,18 @@ abstract class TestHostVideoPlayerApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.video_player_avfoundation.AVFoundationVideoPlayerApi.getPosition$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.video_player_avfoundation.AVFoundationVideoPlayerApi.getPosition was null.'); @@ -324,17 +334,18 @@ abstract class TestHostVideoPlayerApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.video_player_avfoundation.AVFoundationVideoPlayerApi.seekTo$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.video_player_avfoundation.AVFoundationVideoPlayerApi.seekTo was null.'); @@ -358,17 +369,18 @@ abstract class TestHostVideoPlayerApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.video_player_avfoundation.AVFoundationVideoPlayerApi.pause$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.video_player_avfoundation.AVFoundationVideoPlayerApi.pause was null.'); @@ -389,17 +401,18 @@ abstract class TestHostVideoPlayerApi { } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< Object?>( 'dev.flutter.pigeon.video_player_avfoundation.AVFoundationVideoPlayerApi.setMixWithOthers$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + .setMockDecodedMessageHandler(pigeonVar_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, + .setMockDecodedMessageHandler(pigeonVar_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.video_player_avfoundation.AVFoundationVideoPlayerApi.setMixWithOthers was null.'); diff --git a/packages/video_player/video_player_platform_interface/CHANGELOG.md b/packages/video_player/video_player_platform_interface/CHANGELOG.md index 03f53195175e..471cde8298d4 100644 --- a/packages/video_player/video_player_platform_interface/CHANGELOG.md +++ b/packages/video_player/video_player_platform_interface/CHANGELOG.md @@ -1,6 +1,7 @@ -## NEXT +## 6.2.3 * Updates minimum supported SDK version to Flutter 3.19/Dart 3.3. +* Clarified that `VideoEventType.initialized` cannot be sent more than once. ## 6.2.2 diff --git a/packages/video_player/video_player_platform_interface/lib/video_player_platform_interface.dart b/packages/video_player/video_player_platform_interface/lib/video_player_platform_interface.dart index 46b992f58c61..d169c5f16d45 100644 --- a/packages/video_player/video_player_platform_interface/lib/video_player_platform_interface.dart +++ b/packages/video_player/video_player_platform_interface/lib/video_player_platform_interface.dart @@ -278,6 +278,8 @@ class VideoEvent { /// completed or to communicate buffering events or play state changed. enum VideoEventType { /// The video has been initialized. + /// + /// A maximum of one event of this type may be emitted per instance. initialized, /// The playback has ended. diff --git a/packages/video_player/video_player_platform_interface/pubspec.yaml b/packages/video_player/video_player_platform_interface/pubspec.yaml index 89a8f55702d9..7ed49e9e2d3d 100644 --- a/packages/video_player/video_player_platform_interface/pubspec.yaml +++ b/packages/video_player/video_player_platform_interface/pubspec.yaml @@ -4,7 +4,7 @@ repository: https://github.com/flutter/packages/tree/main/packages/video_player/ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+video_player%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: 6.2.2 +version: 6.2.3 environment: sdk: ^3.3.0 diff --git a/packages/web_benchmarks/.gitignore b/packages/web_benchmarks/.gitignore new file mode 100644 index 000000000000..333c1e910a3e --- /dev/null +++ b/packages/web_benchmarks/.gitignore @@ -0,0 +1 @@ +logs/ diff --git a/packages/web_benchmarks/CHANGELOG.md b/packages/web_benchmarks/CHANGELOG.md index 615bf8241158..0096da891242 100644 --- a/packages/web_benchmarks/CHANGELOG.md +++ b/packages/web_benchmarks/CHANGELOG.md @@ -1,6 +1,23 @@ -## NEXT +## 3.1.0 + +* Add `flutter_frame.total_time`, `flutter_frame.build_time`, and `flutter_frame.raster_time` +metrics to benchmark results. These values are derived from the Flutter `FrameTiming` API. +* Expose a new library `metrics.dart` that contains definitions for the benchmark metrics. +* Add p50, p90, and p95 metrics for benchmark scores. + +## 3.0.0 + +* **Breaking change:** removed the `initialPage` parameter from the `serveWebBenchmark` +method and `runBenchmarks` method. Replaced this parameter with `benchmarkPath`, which +allows for passing the combined value of the URL path segments, fragment, and query parameters. +* Restructure the `testing/test_app` to make the example benchmarks easier to follow. + +## 2.0.2 * Updates minimum supported SDK version to Flutter 3.19/Dart 3.3. +* Updates benchmark server to serve the app as `crossOriginIsolated`. This +allows us access to high precision timers and allows wasm benchmarks to run +properly as well. ## 2.0.1 diff --git a/packages/web_benchmarks/README.md b/packages/web_benchmarks/README.md index ce98a22b194a..9b63bf815d4f 100644 --- a/packages/web_benchmarks/README.md +++ b/packages/web_benchmarks/README.md @@ -5,14 +5,14 @@ benchmarks in Chrome. # Writing a benchmark -An example benchmark can be found in [testing/web_benchmark_test.dart][1]. +An example benchmark can be found in [testing/test_app/benchmark/web_benchmark_test.dart][1]. A web benchmark is made of two parts: a client and a server. The client is code that runs in the browser together with the benchmark code. The server serves the 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 +[1]: https://github.com/flutter/packages/blob/master/packages/web_benchmarks/testing/test_app/benchmark/web_benchmarks_test.dart # Analyzing benchmark results diff --git a/packages/web_benchmarks/lib/client.dart b/packages/web_benchmarks/lib/client.dart index 9bdd65b04149..fc427473e0dd 100644 --- a/packages/web_benchmarks/lib/client.dart +++ b/packages/web_benchmarks/lib/client.dart @@ -10,8 +10,10 @@ import 'dart:math' as math; import 'package:web/web.dart'; import 'src/common.dart'; +import 'src/computations.dart'; import 'src/recorder.dart'; +export 'src/computations.dart'; export 'src/recorder.dart'; /// Signature for a function that creates a [Recorder]. @@ -41,9 +43,12 @@ extension on HTMLElement { /// /// When used without a server, prompts the user to select a benchmark to /// run next. +/// +/// [benchmarkPath] specifies the path for the URL that will be loaded in Chrome +/// when reloading the window for subsequent benchmark runs. Future runBenchmarks( Map benchmarks, { - String initialPage = defaultInitialPage, + String benchmarkPath = defaultInitialPath, }) async { // Set local benchmarks. _benchmarks = benchmarks; @@ -60,14 +65,15 @@ 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(); + // Create a new URI with the parsed value of [benchmarkPath] to ensure the + // benchmark app is reloaded with the proper configuration. + final String newUri = Uri.parse(benchmarkPath) + .replace( + scheme: currentUri.scheme, + host: currentUri.host, + port: currentUri.port, + ) + .toString(); // Reloading the window will trigger the next benchmark to run. await _client.printToConsole( diff --git a/packages/web_benchmarks/lib/metrics.dart b/packages/web_benchmarks/lib/metrics.dart new file mode 100644 index 000000000000..cfc5d9fcc294 --- /dev/null +++ b/packages/web_benchmarks/lib/metrics.dart @@ -0,0 +1,5 @@ +// 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/metrics.dart'; diff --git a/packages/web_benchmarks/lib/server.dart b/packages/web_benchmarks/lib/server.dart index 514b111d95ff..8a52c9717c80 100644 --- a/packages/web_benchmarks/lib/server.dart +++ b/packages/web_benchmarks/lib/server.dart @@ -32,8 +32,6 @@ const int defaultChromeDebugPort = 10000; /// can be different (and typically is) from the production entry point of the /// app. /// -/// If [useCanvasKit] is true, builds the app in CanvasKit mode. -/// /// [benchmarkServerPort] is the port this benchmark server serves the app on. /// By default uses [defaultBenchmarkServerPort]. /// @@ -42,6 +40,16 @@ const int defaultChromeDebugPort = 10000; /// /// If [headless] is true, runs Chrome without UI. In particular, this is /// useful in environments (e.g. CI) that doesn't have a display. +/// +/// If [treeShakeIcons] is false, '--no-tree-shake-icons' will be passed as a +/// build argument when building the benchmark app. +/// +/// [compilationOptions] specify the compiler and renderer to use for the +/// benchmark app. This can either use dart2wasm & skwasm or +/// dart2js & canvaskit. +/// +/// [benchmarkPath] specifies the path for the URL that will be loaded upon +/// opening the benchmark app in Chrome. Future serveWebBenchmark({ required io.Directory benchmarkAppDirectory, required String entryPoint, @@ -49,8 +57,8 @@ Future serveWebBenchmark({ int chromeDebugPort = defaultChromeDebugPort, bool headless = true, bool treeShakeIcons = true, - String initialPage = defaultInitialPage, CompilationOptions compilationOptions = const CompilationOptions.js(), + String benchmarkPath = defaultInitialPath, }) async { // Reduce logging level. Otherwise, package:webkit_inspection_protocol is way too spammy. Logger.root.level = Level.INFO; @@ -59,10 +67,10 @@ Future serveWebBenchmark({ benchmarkAppDirectory: benchmarkAppDirectory, entryPoint: entryPoint, benchmarkServerPort: benchmarkServerPort, + benchmarkPath: benchmarkPath, chromeDebugPort: chromeDebugPort, headless: headless, compilationOptions: compilationOptions, treeShakeIcons: treeShakeIcons, - initialPage: initialPage, ).run(); } diff --git a/packages/web_benchmarks/lib/src/common.dart b/packages/web_benchmarks/lib/src/common.dart index 5c7c7259796a..a32f65c77da7 100644 --- a/packages/web_benchmarks/lib/src/common.dart +++ b/packages/web_benchmarks/lib/src/common.dart @@ -15,6 +15,6 @@ const int kMeasuredSampleCount = 100; /// 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'; +/// The default initial path for the URL that will be loaded upon opening the +/// benchmark app or reloading it in Chrome. +const String defaultInitialPath = 'index.html'; diff --git a/packages/web_benchmarks/lib/src/computations.dart b/packages/web_benchmarks/lib/src/computations.dart new file mode 100644 index 000000000000..99ffcfbc38da --- /dev/null +++ b/packages/web_benchmarks/lib/src/computations.dart @@ -0,0 +1,351 @@ +// 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:math' as math; + +import 'package:collection/collection.dart'; +import 'package:meta/meta.dart'; + +import 'common.dart'; +import 'metrics.dart'; + +/// Series of time recordings indexed in time order. +/// +/// It can calculate [average], [standardDeviation] and [noise]. If the amount +/// of data collected is higher than [_kMeasuredSampleCount], then these +/// calculations will only apply to the latest [_kMeasuredSampleCount] data +/// points. +class Timeseries { + /// Creates an empty timeseries. + /// + /// [name], [isReported], and [useCustomWarmUp] must not be null. + Timeseries(this.name, this.isReported, {this.useCustomWarmUp = false}) + : _warmUpFrameCount = useCustomWarmUp ? 0 : null; + + /// The label of this timeseries used for debugging and result inspection. + final String name; + + /// Whether this timeseries is reported to the benchmark dashboard. + /// + /// If `true` a new benchmark card is created for the timeseries and is + /// visible on the dashboard. + /// + /// If `false` the data is stored but it does not show up on the dashboard. + /// Use unreported metrics for metrics that are useful for manual inspection + /// but that are too fine-grained to be useful for tracking on the dashboard. + final bool isReported; + + /// Whether to delimit warm-up frames in a custom way. + final bool useCustomWarmUp; + + /// The number of frames ignored as warm-up frames, used only + /// when [useCustomWarmUp] is true. + int? _warmUpFrameCount; + + /// The number of frames ignored as warm-up frames. + int get warmUpFrameCount => + useCustomWarmUp ? _warmUpFrameCount! : count - kMeasuredSampleCount; + + /// List of all the values that have been recorded. + /// + /// This list has no limit. + final List _allValues = []; + + /// The total amount of data collected, including ones that were dropped + /// because of the sample size limit. + int get count => _allValues.length; + + /// Extracts useful statistics out of this timeseries. + /// + /// See [TimeseriesStats] for more details. + TimeseriesStats computeStats() { + final int finalWarmUpFrameCount = warmUpFrameCount; + + assert(finalWarmUpFrameCount >= 0 && finalWarmUpFrameCount < count); + + // The first few values we simply discard and never look at. They're from the warm-up phase. + final List warmUpValues = + _allValues.sublist(0, finalWarmUpFrameCount); + + // Values we analyze. + final List candidateValues = + _allValues.sublist(finalWarmUpFrameCount); + + // The average that includes outliers. + final double dirtyAverage = _computeAverage(name, candidateValues); + + // The standard deviation that includes outliers. + final double dirtyStandardDeviation = + _computeStandardDeviationForPopulation(name, candidateValues); + + // Any value that's higher than this is considered an outlier. + final double outlierCutOff = dirtyAverage + dirtyStandardDeviation; + + // Candidates with outliers removed. + final Iterable cleanValues = + candidateValues.where((double value) => value <= outlierCutOff); + + // Outlier candidates. + final Iterable outliers = + candidateValues.where((double value) => value > outlierCutOff); + + // Final statistics. + final double cleanAverage = _computeAverage(name, cleanValues); + final double standardDeviation = + _computeStandardDeviationForPopulation(name, cleanValues); + final double noise = + cleanAverage > 0.0 ? standardDeviation / cleanAverage : 0.0; + + // Compute outlier average. If there are no outliers the outlier average is + // the same as clean value average. In other words, in a perfect benchmark + // with no noise the difference between average and outlier average is zero, + // which the best possible outcome. Noise produces a positive difference + // between the two. + final double outlierAverage = + outliers.isNotEmpty ? _computeAverage(name, outliers) : cleanAverage; + + // Compute percentile values (e.g. p50, p90, p95). + final Map percentiles = computePercentiles( + name, + PercentileMetricComputation.percentilesAsDoubles, + candidateValues, + ); + + final List annotatedValues = [ + for (final double warmUpValue in warmUpValues) + AnnotatedSample( + magnitude: warmUpValue, + isOutlier: warmUpValue > outlierCutOff, + isWarmUpValue: true, + ), + for (final double candidate in candidateValues) + AnnotatedSample( + magnitude: candidate, + isOutlier: candidate > outlierCutOff, + isWarmUpValue: false, + ), + ]; + + return TimeseriesStats( + name: name, + average: cleanAverage, + outlierCutOff: outlierCutOff, + outlierAverage: outlierAverage, + standardDeviation: standardDeviation, + noise: noise, + percentiles: percentiles, + cleanSampleCount: cleanValues.length, + outlierSampleCount: outliers.length, + samples: annotatedValues, + ); + } + + /// Adds a value to this timeseries. + void add(double value, {required bool isWarmUpValue}) { + if (value < 0.0) { + throw StateError( + 'Timeseries $name: negative metric values are not supported. Got: $value', + ); + } + _allValues.add(value); + if (useCustomWarmUp && isWarmUpValue) { + _warmUpFrameCount = warmUpFrameCount + 1; + } + } +} + +/// Various statistics about a [Timeseries]. +/// +/// See the docs on the individual fields for more details. +@sealed +class TimeseriesStats { + /// Creates statistics for a time series. + const TimeseriesStats({ + required this.name, + required this.average, + required this.outlierCutOff, + required this.outlierAverage, + required this.standardDeviation, + required this.noise, + required this.percentiles, + required this.cleanSampleCount, + required this.outlierSampleCount, + required this.samples, + }); + + /// The label used to refer to the corresponding timeseries. + final String name; + + /// The average value of the measured samples without outliers. + final double average; + + /// The standard deviation in the measured samples without outliers. + final double standardDeviation; + + /// The noise as a multiple of the [average] value taken from clean samples. + /// + /// This value can be multiplied by 100.0 to get noise as a percentage of + /// the average. + /// + /// If [average] is zero, treats the result as perfect score, returns zero. + final double noise; + + /// The percentile values (p50, p90, p95, etc.) for the measured samples with + /// outliers. + /// + /// This [Map] is from percentile targets (e.g. 0.50 for p50, 0.90 for p90, + /// etc.) to the computed value for the [samples]. + final Map percentiles; + + /// The maximum value a sample can have without being considered an outlier. + /// + /// See [Timeseries.computeStats] for details on how this value is computed. + final double outlierCutOff; + + /// The average of outlier samples. + /// + /// This value can be used to judge how badly we jank, when we jank. + /// + /// Another useful metrics is the difference between [outlierAverage] and + /// [average]. The smaller the value the more predictable is the performance + /// of the corresponding benchmark. + final double outlierAverage; + + /// The number of measured samples after outlier are removed. + final int cleanSampleCount; + + /// The number of outliers. + final int outlierSampleCount; + + /// All collected samples, annotated with statistical information. + /// + /// See [AnnotatedSample] for more details. + final List samples; + + /// Outlier average divided by clean average. + /// + /// This is a measure of performance consistency. The higher this number the + /// worse is jank when it happens. Smaller is better, with 1.0 being the + /// perfect score. If [average] is zero, this value defaults to 1.0. + double get outlierRatio => average > 0.0 + ? outlierAverage / average + : 1.0; // this can only happen in perfect benchmark that reports only zeros + + @override + String toString() { + final StringBuffer buffer = StringBuffer(); + buffer.writeln( + '$name: (samples: $cleanSampleCount clean/$outlierSampleCount ' + 'outliers/${cleanSampleCount + outlierSampleCount} ' + 'measured/${samples.length} total)', + ); + buffer.writeln(' | average: $average μs'); + buffer.writeln(' | outlier average: $outlierAverage μs'); + buffer.writeln(' | outlier/clean ratio: ${outlierRatio}x'); + buffer.writeln(' | noise: ${_ratioToPercent(noise)}'); + for (final PercentileMetricComputation metric + in PercentileMetricComputation.values) { + buffer.writeln(' | ${metric.name}: ${metric.percentile} μs'); + } + return buffer.toString(); + } +} + +/// Annotates a single measurement with statistical information. +@sealed +class AnnotatedSample { + /// Creates an annotated measurement sample. + const AnnotatedSample({ + required this.magnitude, + required this.isOutlier, + required this.isWarmUpValue, + }); + + /// The non-negative raw result of the measurement. + final double magnitude; + + /// Whether this sample was considered an outlier. + final bool isOutlier; + + /// Whether this sample was taken during the warm-up phase. + /// + /// If this value is `true`, this sample does not participate in + /// statistical computations. However, the sample would still be + /// shown in the visualization of results so that the benchmark + /// can be inspected manually to make sure there's a predictable + /// warm-up regression slope. + final bool isWarmUpValue; +} + +/// Computes the arithmetic mean (or average) of given [values]. +double _computeAverage(String label, Iterable values) { + if (values.isEmpty) { + throw StateError( + '$label: attempted to compute an average of an empty value list.'); + } + + final double sum = values.reduce((double a, double b) => a + b); + return sum / values.length; +} + +/// Computes population standard deviation. +/// +/// Unlike sample standard deviation, which divides by N - 1, this divides by N. +/// +/// See also: +/// +/// * https://en.wikipedia.org/wiki/Standard_deviation +double _computeStandardDeviationForPopulation( + String label, Iterable population) { + if (population.isEmpty) { + throw StateError( + '$label: attempted to compute the standard deviation of empty population.'); + } + final double mean = _computeAverage(label, population); + final double sumOfSquaredDeltas = population.fold( + 0.0, + (double previous, double value) => previous += math.pow(value - mean, 2), + ); + return math.sqrt(sumOfSquaredDeltas / population.length); +} + +String _ratioToPercent(double value) { + return '${(value * 100).toStringAsFixed(2)}%'; +} + +/// Computes the percentile threshold in [values] for the given [percentiles]. +/// +/// Each value in [percentiles] should be between 0.0 and 1.0. +/// +/// Returns a [Map] of percentile values to the computed value from [values]. +Map computePercentiles( + String label, + List percentiles, + Iterable values, +) { + if (values.isEmpty) { + throw StateError( + '$label: attempted to compute a percentile of an empty value list.', + ); + } + for (final double percentile in percentiles) { + if (percentile < 0.0 || percentile > 1.0) { + throw StateError( + '$label: attempted to compute a percentile for an invalid ' + 'value: $percentile', + ); + } + } + + final List sorted = + values.sorted((double a, double b) => a.compareTo(b)); + final Map computed = {}; + for (final double percentile in percentiles) { + final int percentileIndex = + (sorted.length * percentile).round().clamp(0, sorted.length - 1); + computed[percentile] = sorted[percentileIndex]; + } + + return computed; +} diff --git a/packages/web_benchmarks/lib/src/metrics.dart b/packages/web_benchmarks/lib/src/metrics.dart new file mode 100644 index 000000000000..5145d73baffb --- /dev/null +++ b/packages/web_benchmarks/lib/src/metrics.dart @@ -0,0 +1,151 @@ +// 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 names for the metrics collected by the benchmark recorder. +enum BenchmarkMetric { + /// The name for the benchmark metric that includes frame-related computations + /// prior to submitting layer and picture operations to the underlying + /// renderer, such as HTML and CanvasKit. + /// + /// During this phase we compute transforms, clips, and other information + /// needed for rendering. + prerollFrame('preroll_frame'), + + /// The name for the benchmark metric that includes submitting layer and + /// picture information to the renderer. + applyFrame('apply_frame'), + + /// The name for the benchmark metric that measures the time spent in + /// [PlatformDispatcher]'s onDrawFrame callback. + drawFrame('draw_frame'), + + /// The name for the benchmark metric that tracks the timespan between vsync + /// start and raster finish for a Flutter frame. + /// + /// This value corresponds to [FrameTiming.totalSpan] from the Flutter Engine. + flutterFrameTotalTime('flutter_frame.total_time'), + + /// The name for the benchmark metric that tracks the duration to build the + /// Flutter frame on the Dart UI thread. + /// + /// This value corresponds to [FrameTiming.buildDuration] from the Flutter + /// Engine. + flutterFrameBuildTime('flutter_frame.build_time'), + + /// The name for the benchmark metric that tracks the duration to rasterize + /// the Flutter frame on the Dart raster thread. + /// + /// This value corresponds to [FrameTiming.rasterDuration] from the Flutter + /// Engine. + flutterFrameRasterTime('flutter_frame.raster_time'); + + const BenchmarkMetric(this.label); + + /// The metric name used in the recorded benchmark data. + final String label; +} + +/// The name for the benchmark metric that records the 'averageTotalUIFrameTime' +/// from the Blink trace summary. +const String totalUiFrameAverage = 'totalUiFrame.average'; + +/// Describes the values computed for each [BenchmarkMetric]. +sealed class BenchmarkMetricComputation { + const BenchmarkMetricComputation(this.name); + + /// The name of each metric computation. + final String name; + + /// The name for the computed value tracking the average value of the measured + /// samples without outliers. + static const NamedMetricComputation average = + NamedMetricComputation._('average'); + + /// The name for the computed value tracking the average of outlier samples. + static const NamedMetricComputation outlierAverage = + NamedMetricComputation._('outlierAverage'); + + /// The name for the computed value tracking the outlier average divided by + /// the clean average. + static const NamedMetricComputation outlierRatio = + NamedMetricComputation._('outlierRatio'); + + /// The name for the computed value tracking the noise as a multiple of the + /// [average] value takes from clean samples. + static const NamedMetricComputation noise = NamedMetricComputation._('noise'); + + /// The name for the computed value tracking the 50th percentile value from + /// the samples with outliers. + static const PercentileMetricComputation p50 = + PercentileMetricComputation._('p50', 0.5); + + /// The name for the computed value tracking the 90th percentile value from + /// the samples with outliers. + static const PercentileMetricComputation p90 = + PercentileMetricComputation._('p90', 0.9); + + /// The name for the computed value tracking the 95th percentile value from + /// the samples with outliers. + static const PercentileMetricComputation p95 = + PercentileMetricComputation._('p95', 0.95); + + /// All of the computed vales for each [BenchmarkMetric]. + static const List values = + [ + average, + outlierAverage, + outlierRatio, + noise, + p50, + p90, + p95, + ]; +} + +/// A [BenchmarkMetricComputation] with a descriptive name. +final class NamedMetricComputation extends BenchmarkMetricComputation { + const NamedMetricComputation._(super.name); +} + +/// A [BenchmarkMetricComputation] describing a percentile (p50, p90, etc.). +final class PercentileMetricComputation extends BenchmarkMetricComputation { + const PercentileMetricComputation._(super.name, this.percentile) + : assert(percentile >= 0.0 && percentile <= 1.0); + + /// The percentile value as a double. + /// + /// This value must be between 0.0 and 1.0. + final double percentile; + + /// The percentile [BenchmarkMetricComputation]s computed for each benchmark + /// metric. + static const List values = + [ + BenchmarkMetricComputation.p50, + BenchmarkMetricComputation.p90, + BenchmarkMetricComputation.p95, + ]; + + /// The percentile values as doubles computed for each benchmark metric. + static List percentilesAsDoubles = PercentileMetricComputation.values + .map((PercentileMetricComputation value) => value.percentile) + .toList(); +} + +/// The list of expected benchmark metrics for the current compilation mode, as +/// determined by the value of [useWasm]. +List expectedBenchmarkMetrics({required bool useWasm}) { + return [ + // The skwasm renderer doesn't have preroll or apply frame steps in its + // rendering. + if (!useWasm) ...[ + BenchmarkMetric.prerollFrame, + BenchmarkMetric.applyFrame, + ], + BenchmarkMetric.drawFrame, + BenchmarkMetric.flutterFrameTotalTime, + BenchmarkMetric.flutterFrameBuildTime, + BenchmarkMetric.flutterFrameRasterTime, + ]; +} diff --git a/packages/web_benchmarks/lib/src/recorder.dart b/packages/web_benchmarks/lib/src/recorder.dart index 1dab0db5bf9a..92a710dbc8bd 100644 --- a/packages/web_benchmarks/lib/src/recorder.dart +++ b/packages/web_benchmarks/lib/src/recorder.dart @@ -4,7 +4,6 @@ import 'dart:async'; import 'dart:js_interop'; -import 'dart:math' as math; import 'dart:ui'; import 'dart:ui_web' as ui_web; @@ -18,6 +17,8 @@ import 'package:meta/meta.dart'; import 'package:web/web.dart' as html; import 'common.dart'; +import 'computations.dart'; +import 'metrics.dart'; /// The number of samples from warm-up iterations. /// @@ -27,16 +28,6 @@ const int _kWarmUpSampleCount = 200; /// The total number of samples collected by a benchmark. const int kTotalSampleCount = _kWarmUpSampleCount + kMeasuredSampleCount; -/// A benchmark metric that includes frame-related computations prior to -/// submitting layer and picture operations to the underlying renderer, such as -/// HTML and CanvasKit. During this phase we compute transforms, clips, and -/// other information needed for rendering. -const String kProfilePrerollFrame = 'preroll_frame'; - -/// A benchmark metric that includes submitting layer and picture information -/// to the renderer. -const String kProfileApplyFrame = 'apply_frame'; - /// Measures the amount of time [action] takes. Duration timeAction(VoidCallback action) { final Stopwatch stopwatch = Stopwatch()..start(); @@ -250,7 +241,7 @@ abstract class SceneBuilderRecorder extends Recorder { PlatformDispatcher.instance.onDrawFrame = () { final FlutterView? view = PlatformDispatcher.instance.implicitView; try { - _profile.record('drawFrameDuration', () { + _profile.record(BenchmarkMetric.drawFrame.label, () { final SceneBuilder sceneBuilder = SceneBuilder(); onDrawFrame(sceneBuilder); _profile.record('sceneBuildDuration', () { @@ -390,8 +381,11 @@ abstract class WidgetRecorder extends Recorder implements FrameRecorder { @mustCallSuper void frameDidDraw() { endMeasureFrame(); - profile.addDataPoint('drawFrameDuration', _drawFrameStopwatch.elapsed, - reported: true); + profile.addDataPoint( + BenchmarkMetric.drawFrame.label, + _drawFrameStopwatch.elapsed, + reported: true, + ); if (shouldContinue()) { PlatformDispatcher.instance.scheduleFrame(); @@ -417,29 +411,54 @@ abstract class WidgetRecorder extends Recorder implements FrameRecorder { _RecordingWidgetsBinding.ensureInitialized(); final Widget widget = createWidget(); - registerEngineBenchmarkValueListener(kProfilePrerollFrame, (num value) { + registerEngineBenchmarkValueListener(BenchmarkMetric.prerollFrame.label, + (num value) { localProfile.addDataPoint( - kProfilePrerollFrame, + BenchmarkMetric.prerollFrame.label, Duration(microseconds: value.toInt()), reported: false, ); }); - registerEngineBenchmarkValueListener(kProfileApplyFrame, (num value) { + registerEngineBenchmarkValueListener(BenchmarkMetric.applyFrame.label, + (num value) { localProfile.addDataPoint( - kProfileApplyFrame, + BenchmarkMetric.applyFrame.label, Duration(microseconds: value.toInt()), reported: false, ); }); + late void Function(List frameTimings) frameTimingsCallback; + binding.addTimingsCallback( + frameTimingsCallback = (List frameTimings) { + for (final FrameTiming frameTiming in frameTimings) { + localProfile.addDataPoint( + BenchmarkMetric.flutterFrameTotalTime.label, + frameTiming.totalSpan, + reported: false, + ); + localProfile.addDataPoint( + BenchmarkMetric.flutterFrameBuildTime.label, + frameTiming.buildDuration, + reported: false, + ); + localProfile.addDataPoint( + BenchmarkMetric.flutterFrameRasterTime.label, + frameTiming.rasterDuration, + reported: false, + ); + } + }); + binding._beginRecording(this, widget); try { await _runCompleter.future; return localProfile; } finally { - stopListeningToEngineBenchmarkValues(kProfilePrerollFrame); - stopListeningToEngineBenchmarkValues(kProfileApplyFrame); + stopListeningToEngineBenchmarkValues(BenchmarkMetric.prerollFrame.label); + stopListeningToEngineBenchmarkValues(BenchmarkMetric.applyFrame.label); + binding.removeTimingsCallback(frameTimingsCallback); } } } @@ -508,8 +527,11 @@ abstract class WidgetBuildRecorder extends Recorder implements FrameRecorder { // Only record frames that show the widget. if (showWidget) { endMeasureFrame(); - profile.addDataPoint('drawFrameDuration', _drawFrameStopwatch.elapsed, - reported: true); + profile.addDataPoint( + BenchmarkMetric.drawFrame.label, + _drawFrameStopwatch.elapsed, + reported: true, + ); } if (shouldContinue()) { @@ -575,254 +597,6 @@ class _WidgetBuildRecorderHostState extends State<_WidgetBuildRecorderHost> { } } -/// Series of time recordings indexed in time order. -/// -/// It can calculate [average], [standardDeviation] and [noise]. If the amount -/// of data collected is higher than [_kMeasuredSampleCount], then these -/// calculations will only apply to the latest [_kMeasuredSampleCount] data -/// points. -class Timeseries { - /// Creates an empty timeseries. - /// - /// [name], [isReported], and [useCustomWarmUp] must not be null. - Timeseries(this.name, this.isReported, {this.useCustomWarmUp = false}) - : _warmUpFrameCount = useCustomWarmUp ? 0 : null; - - /// The label of this timeseries used for debugging and result inspection. - final String name; - - /// Whether this timeseries is reported to the benchmark dashboard. - /// - /// If `true` a new benchmark card is created for the timeseries and is - /// visible on the dashboard. - /// - /// If `false` the data is stored but it does not show up on the dashboard. - /// Use unreported metrics for metrics that are useful for manual inspection - /// but that are too fine-grained to be useful for tracking on the dashboard. - final bool isReported; - - /// Whether to delimit warm-up frames in a custom way. - final bool useCustomWarmUp; - - /// The number of frames ignored as warm-up frames, used only - /// when [useCustomWarmUp] is true. - int? _warmUpFrameCount; - - /// The number of frames ignored as warm-up frames. - int get warmUpFrameCount => - useCustomWarmUp ? _warmUpFrameCount! : count - kMeasuredSampleCount; - - /// List of all the values that have been recorded. - /// - /// This list has no limit. - final List _allValues = []; - - /// The total amount of data collected, including ones that were dropped - /// because of the sample size limit. - int get count => _allValues.length; - - /// Extracts useful statistics out of this timeseries. - /// - /// See [TimeseriesStats] for more details. - TimeseriesStats computeStats() { - final int finalWarmUpFrameCount = warmUpFrameCount; - - assert(finalWarmUpFrameCount >= 0 && finalWarmUpFrameCount < count); - - // The first few values we simply discard and never look at. They're from the warm-up phase. - final List warmUpValues = - _allValues.sublist(0, finalWarmUpFrameCount); - - // Values we analyze. - final List candidateValues = - _allValues.sublist(finalWarmUpFrameCount); - - // The average that includes outliers. - final double dirtyAverage = _computeAverage(name, candidateValues); - - // The standard deviation that includes outliers. - final double dirtyStandardDeviation = - _computeStandardDeviationForPopulation(name, candidateValues); - - // Any value that's higher than this is considered an outlier. - final double outlierCutOff = dirtyAverage + dirtyStandardDeviation; - - // Candidates with outliers removed. - final Iterable cleanValues = - candidateValues.where((double value) => value <= outlierCutOff); - - // Outlier candidates. - final Iterable outliers = - candidateValues.where((double value) => value > outlierCutOff); - - // Final statistics. - final double cleanAverage = _computeAverage(name, cleanValues); - final double standardDeviation = - _computeStandardDeviationForPopulation(name, cleanValues); - final double noise = - cleanAverage > 0.0 ? standardDeviation / cleanAverage : 0.0; - - // Compute outlier average. If there are no outliers the outlier average is - // the same as clean value average. In other words, in a perfect benchmark - // with no noise the difference between average and outlier average is zero, - // which the best possible outcome. Noise produces a positive difference - // between the two. - final double outlierAverage = - outliers.isNotEmpty ? _computeAverage(name, outliers) : cleanAverage; - - final List annotatedValues = [ - for (final double warmUpValue in warmUpValues) - AnnotatedSample( - magnitude: warmUpValue, - isOutlier: warmUpValue > outlierCutOff, - isWarmUpValue: true, - ), - for (final double candidate in candidateValues) - AnnotatedSample( - magnitude: candidate, - isOutlier: candidate > outlierCutOff, - isWarmUpValue: false, - ), - ]; - - return TimeseriesStats( - name: name, - average: cleanAverage, - outlierCutOff: outlierCutOff, - outlierAverage: outlierAverage, - standardDeviation: standardDeviation, - noise: noise, - cleanSampleCount: cleanValues.length, - outlierSampleCount: outliers.length, - samples: annotatedValues, - ); - } - - /// Adds a value to this timeseries. - void add(double value, {required bool isWarmUpValue}) { - if (value < 0.0) { - throw StateError( - 'Timeseries $name: negative metric values are not supported. Got: $value', - ); - } - _allValues.add(value); - if (useCustomWarmUp && isWarmUpValue) { - _warmUpFrameCount = warmUpFrameCount + 1; - } - } -} - -/// Various statistics about a [Timeseries]. -/// -/// See the docs on the individual fields for more details. -@sealed -class TimeseriesStats { - /// Creates statistics for a time series. - const TimeseriesStats({ - required this.name, - required this.average, - required this.outlierCutOff, - required this.outlierAverage, - required this.standardDeviation, - required this.noise, - required this.cleanSampleCount, - required this.outlierSampleCount, - required this.samples, - }); - - /// The label used to refer to the corresponding timeseries. - final String name; - - /// The average value of the measured samples without outliers. - final double average; - - /// The standard deviation in the measured samples without outliers. - final double standardDeviation; - - /// The noise as a multiple of the [average] value takes from clean samples. - /// - /// This value can be multiplied by 100.0 to get noise as a percentage of - /// the average. - /// - /// If [average] is zero, treats the result as perfect score, returns zero. - final double noise; - - /// The maximum value a sample can have without being considered an outlier. - /// - /// See [Timeseries.computeStats] for details on how this value is computed. - final double outlierCutOff; - - /// The average of outlier samples. - /// - /// This value can be used to judge how badly we jank, when we jank. - /// - /// Another useful metrics is the difference between [outlierAverage] and - /// [average]. The smaller the value the more predictable is the performance - /// of the corresponding benchmark. - final double outlierAverage; - - /// The number of measured samples after outlier are removed. - final int cleanSampleCount; - - /// The number of outliers. - final int outlierSampleCount; - - /// All collected samples, annotated with statistical information. - /// - /// See [AnnotatedSample] for more details. - final List samples; - - /// Outlier average divided by clean average. - /// - /// This is a measure of performance consistency. The higher this number the - /// worse is jank when it happens. Smaller is better, with 1.0 being the - /// perfect score. If [average] is zero, this value defaults to 1.0. - double get outlierRatio => average > 0.0 - ? outlierAverage / average - : 1.0; // this can only happen in perfect benchmark that reports only zeros - - @override - String toString() { - final StringBuffer buffer = StringBuffer(); - buffer.writeln( - '$name: (samples: $cleanSampleCount clean/$outlierSampleCount ' - 'outliers/${cleanSampleCount + outlierSampleCount} ' - 'measured/${samples.length} total)', - ); - buffer.writeln(' | average: $average μs'); - buffer.writeln(' | outlier average: $outlierAverage μs'); - buffer.writeln(' | outlier/clean ratio: ${outlierRatio}x'); - buffer.writeln(' | noise: ${_ratioToPercent(noise)}'); - return buffer.toString(); - } -} - -/// Annotates a single measurement with statistical information. -@sealed -class AnnotatedSample { - /// Creates an annotated measurement sample. - const AnnotatedSample({ - required this.magnitude, - required this.isOutlier, - required this.isWarmUpValue, - }); - - /// The non-negative raw result of the measurement. - final double magnitude; - - /// Whether this sample was considered an outlier. - final bool isOutlier; - - /// Whether this sample was taken during the warm-up phase. - /// - /// If this value is `true`, this sample does not participate in - /// statistical computations. However, the sample would still be - /// shown in the visualization of results so that the benchmark - /// can be inspected manually to make sure there's a predictable - /// warm-up regression slope. - final bool isWarmUpValue; -} - /// Base class for a profile collected from running a benchmark. class Profile { /// Creates an empty profile. @@ -920,18 +694,24 @@ class Profile { final Timeseries timeseries = scoreData[key]!; if (timeseries.isReported) { - scoreKeys.add('$key.average'); + scoreKeys.add('$key.${BenchmarkMetricComputation.average.name}'); // Report `outlierRatio` rather than `outlierAverage`, because // the absolute value of outliers is less interesting than the // ratio. - scoreKeys.add('$key.outlierRatio'); + scoreKeys.add('$key.${BenchmarkMetricComputation.outlierRatio.name}'); } final TimeseriesStats stats = timeseries.computeStats(); - json['$key.average'] = stats.average; - json['$key.outlierAverage'] = stats.outlierAverage; - json['$key.outlierRatio'] = stats.outlierRatio; - json['$key.noise'] = stats.noise; + json['$key.${BenchmarkMetricComputation.average.name}'] = stats.average; + json['$key.${BenchmarkMetricComputation.outlierAverage.name}'] = + stats.outlierAverage; + json['$key.${BenchmarkMetricComputation.outlierRatio.name}'] = + stats.outlierRatio; + json['$key.${BenchmarkMetricComputation.noise.name}'] = stats.noise; + for (final PercentileMetricComputation metric + in PercentileMetricComputation.values) { + json['$key.${metric.name}'] = stats.percentiles[metric.percentile]; + } } json.addAll(extraData); @@ -963,42 +743,6 @@ class Profile { } } -/// Computes the arithmetic mean (or average) of given [values]. -double _computeAverage(String label, Iterable values) { - if (values.isEmpty) { - throw StateError( - '$label: attempted to compute an average of an empty value list.'); - } - - final double sum = values.reduce((double a, double b) => a + b); - return sum / values.length; -} - -/// Computes population standard deviation. -/// -/// Unlike sample standard deviation, which divides by N - 1, this divides by N. -/// -/// See also: -/// -/// * https://en.wikipedia.org/wiki/Standard_deviation -double _computeStandardDeviationForPopulation( - String label, Iterable population) { - if (population.isEmpty) { - throw StateError( - '$label: attempted to compute the standard deviation of empty population.'); - } - final double mean = _computeAverage(label, population); - final double sumOfSquaredDeltas = population.fold( - 0.0, - (double previous, double value) => previous += math.pow(value - mean, 2), - ); - return math.sqrt(sumOfSquaredDeltas / population.length); -} - -String _ratioToPercent(double value) { - return '${(value * 100).toStringAsFixed(2)}%'; -} - /// Implemented by recorders that use [_RecordingWidgetsBinding] to receive /// frame life-cycle calls. abstract class FrameRecorder { diff --git a/packages/web_benchmarks/lib/src/runner.dart b/packages/web_benchmarks/lib/src/runner.dart index 87e924194e93..4e52a88f61ab 100644 --- a/packages/web_benchmarks/lib/src/runner.dart +++ b/packages/web_benchmarks/lib/src/runner.dart @@ -19,6 +19,7 @@ import 'benchmark_result.dart'; import 'browser.dart'; import 'common.dart'; import 'compilation_options.dart'; +import 'metrics.dart'; /// The default port number used by the local benchmark server. const int defaultBenchmarkServerPort = 9999; @@ -39,8 +40,6 @@ class BenchmarkServer { /// can be different (and typically is) from the production entry point of the /// app. /// - /// If [useCanvasKit] is true, builds the app in CanvasKit mode. - /// /// [benchmarkServerPort] is the port this benchmark server serves the app on. /// /// [chromeDebugPort] is the port Chrome uses for DevTool Protocol used to @@ -48,6 +47,16 @@ class BenchmarkServer { /// /// If [headless] is true, runs Chrome without UI. In particular, this is /// useful in environments (e.g. CI) that doesn't have a display. + /// + /// If [treeShakeIcons] is false, '--no-tree-shake-icons' will be passed as a + /// build argument when building the benchmark app. + /// + /// [compilationOptions] specify the compiler and renderer to use for the + /// benchmark app. This can either use dart2wasm & skwasm or + /// dart2js & canvaskit. + /// + /// [benchmarkPath] specifies the path for the URL that will be loaded upon + /// opening the benchmark app in Chrome. BenchmarkServer({ required this.benchmarkAppDirectory, required this.entryPoint, @@ -56,7 +65,7 @@ class BenchmarkServer { required this.headless, required this.treeShakeIcons, this.compilationOptions = const CompilationOptions.js(), - this.initialPage = defaultInitialPage, + this.benchmarkPath = defaultInitialPath, }); final ProcessManager _processManager = const LocalProcessManager(); @@ -92,13 +101,25 @@ 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 initial path for the URL that will be loaded upon opening the + /// benchmark app in Chrome. /// - /// The default value is [defaultInitialPage]. - final String initialPage; + /// This path should contain the path segments, fragment, and/or query + /// parameters that are required for the benchmark. This value will be parsed + /// by `Uri.parse` and combined with the benchmark URI scheme ('http'), host + /// ('localhost'), and port [benchmarkServerPort] to create the URL for + /// loading in Chrome. See [_benchmarkAppUrl]. + /// + /// The default value is [defaultInitialPath]. + final String benchmarkPath; - String get _benchmarkAppUrl => - 'http://localhost:$benchmarkServerPort/$initialPage'; + String get _benchmarkAppUrl => Uri.parse(benchmarkPath) + .replace( + scheme: 'http', + host: 'localhost', + port: benchmarkServerPort, + ) + .toString(); /// Builds and serves the benchmark app, and collects benchmark results. Future run() async { @@ -160,10 +181,27 @@ class BenchmarkServer { Cascade cascade = Cascade(); // Serves the static files built for the app (html, js, images, fonts, etc) - cascade = cascade.add(createStaticHandler( + final Handler buildFolderHandler = createStaticHandler( path.join(benchmarkAppDirectory.path, 'build', 'web'), defaultDocument: 'index.html', - )); + ); + + // We want our page to be crossOriginIsolated. This will allow us to run the + // skwasm renderer, which uses a SharedArrayBuffer, which requires the page + // to be crossOriginIsolated. But also, even in the non-skwasm case, running + // in crossOriginIsolated gives us access to more accurate timers which are + // useful for capturing good benchmarking data. + // See https://developer.mozilla.org/en-US/docs/Web/API/Performance_API/High_precision_timing#reduced_precision + cascade = cascade.add((Request request) async { + final Response response = await buildFolderHandler(request); + if (response.mimeType == 'text/html') { + return response.change(headers: { + 'Cross-Origin-Opener-Policy': 'same-origin', + 'Cross-Origin-Embedder-Policy': 'require-corp', + }); + } + return response; + }); // Serves the benchmark server API used by the benchmark app to coordinate // the running of benchmarks. @@ -187,11 +225,11 @@ class BenchmarkServer { if (latestPerformanceTrace != null) { final BlinkTraceSummary? traceSummary = BlinkTraceSummary.fromJson(latestPerformanceTrace!); - profile['totalUiFrame.average'] = + profile[totalUiFrameAverage] = traceSummary?.averageTotalUIFrameTime.inMicroseconds; profile['scoreKeys'] ??= []; // using dynamic for consistency with JSON - (profile['scoreKeys'] as List).add('totalUiFrame.average'); + (profile['scoreKeys'] as List).add(totalUiFrameAverage); latestPerformanceTrace = null; } collectedProfiles.add(profile); @@ -256,9 +294,20 @@ class BenchmarkServer { } }); - // If all previous handlers returned HTTP 404, this is the last handler - // that simply warns about the unrecognized path. - cascade = cascade.add((Request request) { + // If all previous handlers returned HTTP 404, this handler either serves + // the static handler at the default document (for GET requests only) or + // warns about the unrecognized path. + cascade = cascade.add((Request request) async { + if (request.method == 'GET') { + final Uri newRequestUri = request.requestedUri.replace(path: '/'); + final Request newRequest = Request( + request.method, + newRequestUri, + headers: request.headers, + ); + return await buildFolderHandler(newRequest); + } + io.stderr.writeln('Unrecognized URL path: ${request.requestedUri.path}'); return Response.notFound('Not found: ${request.requestedUri.path}'); }); diff --git a/packages/web_benchmarks/pubspec.yaml b/packages/web_benchmarks/pubspec.yaml index 02d71a4b0b49..1ee5ad4aebb1 100644 --- a/packages/web_benchmarks/pubspec.yaml +++ b/packages/web_benchmarks/pubspec.yaml @@ -2,7 +2,7 @@ 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: 2.0.1 +version: 3.1.0 environment: sdk: ^3.3.0 diff --git a/packages/web_benchmarks/test/src/analysis_test.dart b/packages/web_benchmarks/test/src/analysis_test.dart index 852cb4c64083..c584f58085c8 100644 --- a/packages/web_benchmarks/test/src/analysis_test.dart +++ b/packages/web_benchmarks/test/src/analysis_test.dart @@ -2,10 +2,6 @@ // 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'; diff --git a/packages/web_benchmarks/test/src/computations_test.dart b/packages/web_benchmarks/test/src/computations_test.dart new file mode 100644 index 000000000000..94fe44079431 --- /dev/null +++ b/packages/web_benchmarks/test/src/computations_test.dart @@ -0,0 +1,24 @@ +// 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/src/computations.dart'; + +void main() { + group('computations', () { + test('computePercentiles', () { + final Map computed = computePercentiles( + 'test', + [0.0, 0.5, 0.9, 0.95, 1.0], + List.generate(100, (int i) => i.toDouble()), + ); + expect(computed.length, 5); + expect(computed[0.0], 0.0); + expect(computed[0.5], 50.0); + expect(computed[0.9], 90.0); + expect(computed[0.95], 95.0); + expect(computed[1.0], 99.0); + }); + }); +} diff --git a/packages/web_benchmarks/testing/test_app/.gitignore b/packages/web_benchmarks/testing/test_app/.gitignore index 9f6b8e534c28..79c113f9b501 100644 --- a/packages/web_benchmarks/testing/test_app/.gitignore +++ b/packages/web_benchmarks/testing/test_app/.gitignore @@ -5,9 +5,12 @@ *.swp .DS_Store .atom/ +.build/ .buildlog/ .history .svn/ +.swiftpm/ +migrate_working_dir/ # IntelliJ related *.iml @@ -26,7 +29,6 @@ .dart_tool/ .flutter-plugins .flutter-plugins-dependencies -.packages .pub-cache/ .pub/ /build/ @@ -36,3 +38,8 @@ 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/web_benchmarks/testing/test_app/.metadata b/packages/web_benchmarks/testing/test_app/.metadata index 5e875f26787c..7dd91c1357be 100644 --- a/packages/web_benchmarks/testing/test_app/.metadata +++ b/packages/web_benchmarks/testing/test_app/.metadata @@ -4,7 +4,27 @@ # This file should be version controlled and should not be manually edited. version: - revision: d26268bb9e6d713a73d6148da7fa75936d442741 - channel: master + revision: "0cd170798c6462aec738d4c749ce3a5fff1c80cf" + channel: "master" project_type: app + +# Tracks metadata for the flutter migrate command +migration: + platforms: + - platform: root + create_revision: 0cd170798c6462aec738d4c749ce3a5fff1c80cf + base_revision: 0cd170798c6462aec738d4c749ce3a5fff1c80cf + - platform: web + create_revision: 0cd170798c6462aec738d4c749ce3a5fff1c80cf + base_revision: 0cd170798c6462aec738d4c749ce3a5fff1c80cf + + # 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/web_benchmarks/testing/test_app/analysis_options.yaml b/packages/web_benchmarks/testing/test_app/analysis_options.yaml index 2597fd117946..ab086918a291 100644 --- a/packages/web_benchmarks/testing/test_app/analysis_options.yaml +++ b/packages/web_benchmarks/testing/test_app/analysis_options.yaml @@ -3,5 +3,4 @@ include: ../../../../analysis_options.yaml linter: rules: # This is test code. Do not enforce docs. - package_api_docs: false public_member_api_docs: false diff --git a/packages/web_benchmarks/testing/test_app/benchmark/test_infra/automator.dart b/packages/web_benchmarks/testing/test_app/benchmark/test_infra/automator.dart new file mode 100644 index 000000000000..9484a544144c --- /dev/null +++ b/packages/web_benchmarks/testing/test_app/benchmark/test_infra/automator.dart @@ -0,0 +1,146 @@ +// 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:async'; + +import 'package:flutter/foundation.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:test_app/home_page.dart' show aboutPageKey, textKey; +import 'package:test_app/main.dart'; +import 'package:web/web.dart'; +import 'package:web_benchmarks/client.dart'; + +import 'common.dart'; + +/// A class that automates the test web app. +class Automator { + Automator({ + required this.benchmark, + required this.stopWarmingUpCallback, + required this.profile, + }); + + /// The current benchmark. + final BenchmarkName benchmark; + + /// A function to call when warm-up is finished. + /// + /// This function is intended to ask `Recorder` to mark the warm-up phase + /// as over. + final void Function() stopWarmingUpCallback; + + /// The profile collected for the running benchmark + final Profile profile; + + /// Whether the automation has ended. + bool finished = false; + + /// A widget controller for automation. + late LiveWidgetController controller; + + Widget createWidget() { + Future.delayed(const Duration(milliseconds: 400), automate); + return const MyApp(); + } + + Future automate() async { + await warmUp(); + + switch (benchmark) { + case BenchmarkName.appNavigate: + await _handleAppNavigate(); + case BenchmarkName.appScroll: + await _handleAppScroll(); + case BenchmarkName.appTap: + await _handleAppTap(); + case BenchmarkName.simpleCompilationCheck: + _handleSimpleCompilationCheck(); + case BenchmarkName.simpleBenchmarkPathCheck: + _handleSimpleBenchmarkPathCheck(); + } + + // At the end of the test, mark as finished. + finished = true; + } + + /// Warm up the animation. + Future warmUp() async { + // Let animation stop. + await animationStops(); + + // Set controller. + controller = LiveWidgetController(WidgetsBinding.instance); + + await controller.pumpAndSettle(); + + // When warm-up finishes, inform the recorder. + stopWarmingUpCallback(); + } + + Future _handleAppNavigate() async { + for (int i = 0; i < 10; ++i) { + print('Testing round $i...'); + await controller.tap(find.byKey(aboutPageKey)); + await animationStops(); + await controller.tap(find.byType(BackButton)); + await animationStops(); + } + } + + Future _handleAppScroll() async { + final ScrollableState scrollable = + Scrollable.of(find.byKey(textKey).evaluate().single); + await scrollable.position.animateTo( + 30000, + curve: Curves.linear, + duration: const Duration(seconds: 20), + ); + } + + Future _handleAppTap() async { + for (int i = 0; i < 10; ++i) { + print('Testing round $i...'); + await controller.tap(find.byIcon(Icons.add)); + await animationStops(); + } + } + + void _handleSimpleCompilationCheck() { + // Record whether we are in wasm mode or not. Ideally, we'd have a more + // first-class way to add metadata like this, but this will work for us to + // pass information about the environment back to the server for the + // purposes of our own tests. + profile.extraData['isWasm'] = kIsWasm ? 1 : 0; + } + + void _handleSimpleBenchmarkPathCheck() { + // Record whether the URL contains the expected path so we can verify the + // behavior of setting the `benchmarkPath` on the benchmark server. + final bool containsExpectedPath = + window.location.toString().contains(testBenchmarkPath); + profile.extraData['expectedUrl'] = containsExpectedPath ? 1 : 0; + } +} + +const Duration _animationCheckingInterval = Duration(milliseconds: 50); + +Future animationStops() async { + if (!WidgetsBinding.instance.hasScheduledFrame) { + return; + } + + final Completer stopped = Completer(); + + Timer.periodic(_animationCheckingInterval, (Timer timer) { + if (!WidgetsBinding.instance.hasScheduledFrame) { + stopped.complete(); + timer.cancel(); + } + }); + + await stopped.future; +} diff --git a/packages/web_benchmarks/testing/test_app/benchmark/test_infra/client/app_client.dart b/packages/web_benchmarks/testing/test_app/benchmark/test_infra/client/app_client.dart new file mode 100644 index 000000000000..2887ba9b7c20 --- /dev/null +++ b/packages/web_benchmarks/testing/test_app/benchmark/test_infra/client/app_client.dart @@ -0,0 +1,21 @@ +// 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:web_benchmarks/client.dart'; + +import '../common.dart'; +import '../recorder.dart'; + +Future main() async { + await runBenchmarks( + { + BenchmarkName.appNavigate.name: () => + TestAppRecorder(benchmark: BenchmarkName.appNavigate), + BenchmarkName.appScroll.name: () => + TestAppRecorder(benchmark: BenchmarkName.appScroll), + BenchmarkName.appTap.name: () => + TestAppRecorder(benchmark: BenchmarkName.appTap), + }, + ); +} diff --git a/packages/web_benchmarks/testing/test_app/benchmark/test_infra/client/simple_benchmark_path_client.dart b/packages/web_benchmarks/testing/test_app/benchmark/test_infra/client/simple_benchmark_path_client.dart new file mode 100644 index 000000000000..f8f54492c3e8 --- /dev/null +++ b/packages/web_benchmarks/testing/test_app/benchmark/test_infra/client/simple_benchmark_path_client.dart @@ -0,0 +1,19 @@ +// 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:web_benchmarks/client.dart'; + +import '../common.dart'; +import '../recorder.dart'; + +Future main() async { + await runBenchmarks( + { + BenchmarkName.simpleBenchmarkPathCheck.name: () => TestAppRecorder( + benchmark: BenchmarkName.simpleBenchmarkPathCheck, + ), + }, + benchmarkPath: testBenchmarkPath, + ); +} diff --git a/packages/web_benchmarks/testing/test_app/benchmark/test_infra/client/simple_compilation_client.dart b/packages/web_benchmarks/testing/test_app/benchmark/test_infra/client/simple_compilation_client.dart new file mode 100644 index 000000000000..301ca2111e71 --- /dev/null +++ b/packages/web_benchmarks/testing/test_app/benchmark/test_infra/client/simple_compilation_client.dart @@ -0,0 +1,18 @@ +// 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:web_benchmarks/client.dart'; + +import '../common.dart'; +import '../recorder.dart'; + +Future main() async { + await runBenchmarks( + { + BenchmarkName.simpleCompilationCheck.name: () => TestAppRecorder( + benchmark: BenchmarkName.simpleCompilationCheck, + ), + }, + ); +} diff --git a/packages/web_benchmarks/testing/test_app/benchmark/test_infra/common.dart b/packages/web_benchmarks/testing/test_app/benchmark/test_infra/common.dart new file mode 100644 index 000000000000..8045852f64d5 --- /dev/null +++ b/packages/web_benchmarks/testing/test_app/benchmark/test_infra/common.dart @@ -0,0 +1,15 @@ +// 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 benchmark path to load in the URL when loading or reloading the +/// benchmark app in Chrome. +const String testBenchmarkPath = 'about'; + +enum BenchmarkName { + appNavigate, + appScroll, + appTap, + simpleBenchmarkPathCheck, + simpleCompilationCheck; +} diff --git a/packages/web_benchmarks/testing/test_app/benchmark/test_infra/recorder.dart b/packages/web_benchmarks/testing/test_app/benchmark/test_infra/recorder.dart new file mode 100644 index 000000000000..8b0abd0d125d --- /dev/null +++ b/packages/web_benchmarks/testing/test_app/benchmark/test_infra/recorder.dart @@ -0,0 +1,38 @@ +// 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:web_benchmarks/client.dart'; + +import 'automator.dart'; +import 'common.dart'; + +/// A recorder that measures frame building durations for the test app. +class TestAppRecorder extends WidgetRecorder { + TestAppRecorder({required this.benchmark}) + : super(name: benchmark.name, useCustomWarmUp: true); + + /// The name of the benchmark to be run. + /// + /// See `common.dart` for the list of the names of all benchmarks. + final BenchmarkName benchmark; + + Automator? _automator; + bool get _finished => _automator?.finished ?? false; + + /// Whether we should continue recording. + @override + bool shouldContinue() => !_finished || profile.shouldContinue(); + + /// Creates the [Automator] widget. + @override + Widget createWidget() { + _automator = Automator( + benchmark: benchmark, + stopWarmingUpCallback: profile.stopWarmingUp, + profile: profile, + ); + return _automator!.createWidget(); + } +} diff --git a/packages/web_benchmarks/testing/test_app/benchmark/web_benchmarks_test.dart b/packages/web_benchmarks/testing/test_app/benchmark/web_benchmarks_test.dart new file mode 100644 index 000000000000..6a2990846478 --- /dev/null +++ b/packages/web_benchmarks/testing/test_app/benchmark/web_benchmarks_test.dart @@ -0,0 +1,123 @@ +// 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:convert' show JsonEncoder; +import 'dart:io'; + +import 'package:test/test.dart'; + +import 'package:web_benchmarks/metrics.dart'; +import 'package:web_benchmarks/server.dart'; +import 'package:web_benchmarks/src/common.dart'; + +import 'test_infra/common.dart'; + +Future main() async { + test( + 'Can run a web benchmark', + () async { + await _runBenchmarks( + benchmarkNames: [ + BenchmarkName.appNavigate.name, + BenchmarkName.appScroll.name, + BenchmarkName.appTap.name, + ], + entryPoint: 'benchmark/test_infra/client/app_client.dart', + ); + }, + timeout: Timeout.none, + ); + + test( + 'Can run a web benchmark with an alternate benchmarkPath', + () async { + final BenchmarkResults results = await _runBenchmarks( + benchmarkNames: [BenchmarkName.simpleBenchmarkPathCheck.name], + entryPoint: + 'benchmark/test_infra/client/simple_benchmark_path_client.dart', + benchmarkPath: testBenchmarkPath, + ); + + final List? scores = + results.scores[BenchmarkName.simpleBenchmarkPathCheck.name]; + expect(scores, isNotNull); + + // The runner puts an `expectedUrl` metric in the results so that we can + // verify the initial page value that should be passed on initial load + // and on reloads. + final BenchmarkScore expectedUrlScore = scores! + .firstWhere((BenchmarkScore score) => score.metric == 'expectedUrl'); + expect(expectedUrlScore.value, 1); + }, + timeout: Timeout.none, + ); + + test( + 'Can run a web benchmark with wasm', + () async { + final BenchmarkResults results = await _runBenchmarks( + benchmarkNames: [BenchmarkName.simpleCompilationCheck.name], + entryPoint: + 'benchmark/test_infra/client/simple_compilation_client.dart', + compilationOptions: const CompilationOptions.wasm(), + ); + + // The runner puts an `isWasm` metric in the results so that we can verify + // we are running with the correct compiler and renderer. + final List? scores = + results.scores[BenchmarkName.simpleCompilationCheck.name]; + expect(scores, isNotNull); + + final BenchmarkScore isWasmScore = scores! + .firstWhere((BenchmarkScore score) => score.metric == 'isWasm'); + expect(isWasmScore.value, 1); + }, + timeout: Timeout.none, + ); +} + +Future _runBenchmarks({ + required List benchmarkNames, + required String entryPoint, + String benchmarkPath = defaultInitialPath, + CompilationOptions compilationOptions = const CompilationOptions.js(), +}) async { + final BenchmarkResults taskResult = await serveWebBenchmark( + benchmarkAppDirectory: Directory('testing/test_app'), + entryPoint: entryPoint, + treeShakeIcons: false, + benchmarkPath: benchmarkPath, + compilationOptions: compilationOptions, + ); + + final List expectedMetrics = + expectedBenchmarkMetrics(useWasm: compilationOptions.useWasm) + .map((BenchmarkMetric metric) => metric.label) + .toList(); + + for (final String benchmarkName in benchmarkNames) { + for (final String metricName in expectedMetrics) { + for (final BenchmarkMetricComputation computation + in BenchmarkMetricComputation.values) { + expect( + taskResult.scores[benchmarkName]!.where((BenchmarkScore score) => + score.metric == '$metricName.${computation.name}'), + hasLength(1), + reason: 'Expected to find a metric named ' + '$metricName.${computation.name}'); + } + } + expect( + taskResult.scores[benchmarkName]! + .where((BenchmarkScore score) => score.metric == totalUiFrameAverage), + hasLength(1), + ); + } + + expect( + const JsonEncoder.withIndent(' ').convert(taskResult.toJson()), + isA(), + ); + return taskResult; +} diff --git a/packages/web_benchmarks/testing/test_app/lib/about_page.dart b/packages/web_benchmarks/testing/test_app/lib/about_page.dart index 4147c33f8f13..23f85320eaf7 100644 --- a/packages/web_benchmarks/testing/test_app/lib/about_page.dart +++ b/packages/web_benchmarks/testing/test_app/lib/about_page.dart @@ -3,8 +3,7 @@ // found in the LICENSE file. import 'package:flutter/material.dart'; - -const ValueKey backKey = ValueKey('backKey'); +import 'package:go_router/go_router.dart'; class AboutPage extends StatelessWidget { const AboutPage({super.key}); @@ -14,8 +13,7 @@ class AboutPage extends StatelessWidget { return Scaffold( appBar: AppBar( leading: BackButton( - key: backKey, - onPressed: () => Navigator.of(context).pop(), + onPressed: () => context.canPop() ? context.pop() : context.go('/'), ), ), body: Center( diff --git a/packages/web_benchmarks/testing/test_app/lib/benchmarks/runner.dart b/packages/web_benchmarks/testing/test_app/lib/benchmarks/runner.dart deleted file mode 100644 index 9a870dfca2e8..000000000000 --- a/packages/web_benchmarks/testing/test_app/lib/benchmarks/runner.dart +++ /dev/null @@ -1,101 +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:flutter/material.dart'; -import 'package:flutter_test/flutter_test.dart'; -import 'package:web_benchmarks/client.dart'; - -import '../about_page.dart' show backKey; -import '../home_page.dart' show aboutPageKey, textKey; -import '../main.dart'; - -/// A recorder that measures frame building durations. -abstract class AppRecorder extends WidgetRecorder { - AppRecorder({required this.benchmarkName}) : super(name: benchmarkName); - - final String benchmarkName; // ignore: unreachable_from_main - - Future automate(); - - @override - Widget createWidget() { - Future.delayed(const Duration(milliseconds: 400), automate); - return const MyApp(); - } - - Future animationStops() async { - while (WidgetsBinding.instance.hasScheduledFrame) { - await Future.delayed(const Duration(milliseconds: 200)); - } - } -} - -class ScrollRecorder extends AppRecorder { - ScrollRecorder() : super(benchmarkName: 'scroll'); - - @override - Future automate() async { - final ScrollableState scrollable = - Scrollable.of(find.byKey(textKey).evaluate().single); - await scrollable.position.animateTo( - 30000, - curve: Curves.linear, - duration: const Duration(seconds: 20), - ); - } -} - -class PageRecorder extends AppRecorder { - PageRecorder() : super(benchmarkName: 'page'); - - bool _completed = false; - - @override - bool shouldContinue() => profile.shouldContinue() || !_completed; - - @override - Future automate() async { - final LiveWidgetController controller = - LiveWidgetController(WidgetsBinding.instance); - for (int i = 0; i < 10; ++i) { - print('Testing round $i...'); - await controller.tap(find.byKey(aboutPageKey)); - await animationStops(); - await controller.tap(find.byKey(backKey)); - await animationStops(); - } - _completed = true; - } -} - -class TapRecorder extends AppRecorder { - TapRecorder() : super(benchmarkName: 'tap'); - - bool _completed = false; - - @override - bool shouldContinue() => profile.shouldContinue() || !_completed; - - @override - Future automate() async { - final LiveWidgetController controller = - LiveWidgetController(WidgetsBinding.instance); - for (int i = 0; i < 10; ++i) { - print('Testing round $i...'); - await controller.tap(find.byIcon(Icons.add)); - await animationStops(); - } - _completed = true; - } -} - -Future main() async { - await runBenchmarks({ - 'scroll': () => ScrollRecorder(), - 'page': () => PageRecorder(), - 'tap': () => TapRecorder(), - }); -} 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/test_app/lib/home_page.dart b/packages/web_benchmarks/testing/test_app/lib/home_page.dart index dee8c9d0eebd..c0f7a131aec3 100644 --- a/packages/web_benchmarks/testing/test_app/lib/home_page.dart +++ b/packages/web_benchmarks/testing/test_app/lib/home_page.dart @@ -3,6 +3,7 @@ // found in the LICENSE file. import 'package:flutter/material.dart'; +import 'package:go_router/go_router.dart'; const ValueKey textKey = ValueKey('textKey'); const ValueKey aboutPageKey = ValueKey('aboutPageKey'); @@ -33,8 +34,8 @@ class _HomePageState extends State { actions: [ IconButton( key: aboutPageKey, - icon: const Icon(Icons.alternate_email), - onPressed: () => Navigator.of(context).pushNamed('about'), + icon: const Icon(Icons.help_outline), + onPressed: () => context.go('/about'), ), ], ), diff --git a/packages/web_benchmarks/testing/test_app/lib/icon_page.dart b/packages/web_benchmarks/testing/test_app/lib/icon_page.dart deleted file mode 100644 index fd0da430ee0f..000000000000 --- a/packages/web_benchmarks/testing/test_app/lib/icon_page.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'; - -class IconGeneratorPage extends StatefulWidget { - const IconGeneratorPage({super.key}); - - static int defaultIconCodePoint = int.parse('0xf03f'); - - @override - State createState() => _IconGeneratorPageState(); -} - -class _IconGeneratorPageState extends State { - int iconCodePoint = IconGeneratorPage.defaultIconCodePoint; - - @override - Widget build(BuildContext context) { - return Column( - children: [ - TextField( - onSubmitted: (String value) { - final int codePointAsInt = - int.tryParse(value) ?? IconGeneratorPage.defaultIconCodePoint; - setState(() { - iconCodePoint = codePointAsInt; - }); - }, - ), - const SizedBox(height: 24.0), - Icon(generateIcon(iconCodePoint)), - ], - ); - } - - // Unless '--no-tree-shake-icons' is passed to the flutter build command, - // the presence of this method will trigger an exception due to the use of - // non-constant invocations of [IconData]. - IconData generateIcon(int materialIconCodePoint) => IconData( - materialIconCodePoint, - fontFamily: 'MaterialIcons', - ); -} diff --git a/packages/web_benchmarks/testing/test_app/lib/main.dart b/packages/web_benchmarks/testing/test_app/lib/main.dart index e07fc56ec2ab..172abba32888 100644 --- a/packages/web_benchmarks/testing/test_app/lib/main.dart +++ b/packages/web_benchmarks/testing/test_app/lib/main.dart @@ -3,32 +3,44 @@ // found in the LICENSE file. import 'package:flutter/material.dart'; +import 'package:flutter_web_plugins/url_strategy.dart'; +import 'package:go_router/go_router.dart'; import 'about_page.dart'; import 'home_page.dart'; -import 'icon_page.dart'; void main() { + usePathUrlStrategy(); runApp(const MyApp()); } +final GoRouter _router = GoRouter( + routes: [ + GoRoute( + path: '/', + builder: (_, __) => const HomePage(title: 'Flutter Demo Home Page'), + ), + GoRoute( + path: '/about', + builder: (_, __) => const AboutPage(), + ), + ], +); + class MyApp extends StatelessWidget { const MyApp({super.key}); @override Widget build(BuildContext context) { - return MaterialApp( + return MaterialApp.router( title: 'Flutter Demo', theme: ThemeData( primarySwatch: Colors.blue, visualDensity: VisualDensity.adaptivePlatformDensity, ), - initialRoute: 'home', - routes: { - 'home': (_) => const HomePage(title: 'Flutter Demo Home Page'), - 'about': (_) => const AboutPage(), - 'icon_generator': (_) => const IconGeneratorPage(), - }, + routerConfig: _router, + // This blocks the About page button. + debugShowCheckedModeBanner: false, ); } } diff --git a/packages/web_benchmarks/testing/test_app/pubspec.yaml b/packages/web_benchmarks/testing/test_app/pubspec.yaml index e298d6defa4d..902f1e0ba9cb 100644 --- a/packages/web_benchmarks/testing/test_app/pubspec.yaml +++ b/packages/web_benchmarks/testing/test_app/pubspec.yaml @@ -11,8 +11,16 @@ environment: dependencies: flutter: sdk: flutter + flutter_web_plugins: + sdk: flutter + go_router: ^14.2.7 + +dev_dependencies: + flutter_lints: ^4.0.0 flutter_test: sdk: flutter + test: ^1.19.5 + web: ">=0.5.1 <2.0.0" web_benchmarks: path: ../../ diff --git a/packages/web_benchmarks/testing/test_app/web/icons/Icon-maskable-192.png b/packages/web_benchmarks/testing/test_app/web/icons/Icon-maskable-192.png new file mode 100644 index 000000000000..eb9b4d76e525 Binary files /dev/null and b/packages/web_benchmarks/testing/test_app/web/icons/Icon-maskable-192.png differ diff --git a/packages/web_benchmarks/testing/test_app/web/icons/Icon-maskable-512.png b/packages/web_benchmarks/testing/test_app/web/icons/Icon-maskable-512.png new file mode 100644 index 000000000000..d69c56691fbd Binary files /dev/null and b/packages/web_benchmarks/testing/test_app/web/icons/Icon-maskable-512.png differ diff --git a/packages/web_benchmarks/testing/test_app/web/index.html b/packages/web_benchmarks/testing/test_app/web/index.html index 5b2c184c9a83..cc7ef836e2f3 100644 --- a/packages/web_benchmarks/testing/test_app/web/index.html +++ b/packages/web_benchmarks/testing/test_app/web/index.html @@ -4,12 +4,27 @@ found in the LICENSE file. --> + + + - + @@ -21,6 +36,6 @@ - + diff --git a/packages/web_benchmarks/testing/test_app/web/manifest.json b/packages/web_benchmarks/testing/test_app/web/manifest.json index 13a236907762..8242090a0aa6 100644 --- a/packages/web_benchmarks/testing/test_app/web/manifest.json +++ b/packages/web_benchmarks/testing/test_app/web/manifest.json @@ -18,6 +18,18 @@ "src": "icons/Icon-512.png", "sizes": "512x512", "type": "image/png" + }, + { + "src": "icons/Icon-maskable-192.png", + "sizes": "192x192", + "type": "image/png", + "purpose": "maskable" + }, + { + "src": "icons/Icon-maskable-512.png", + "sizes": "512x512", + "type": "image/png", + "purpose": "maskable" } ] } diff --git a/packages/web_benchmarks/testing/web_benchmarks_test.dart b/packages/web_benchmarks/testing/web_benchmarks_test.dart deleted file mode 100644 index 547ddee4f7fc..000000000000 --- a/packages/web_benchmarks/testing/web_benchmarks_test.dart +++ /dev/null @@ -1,86 +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:convert' show JsonEncoder; -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'], - entryPoint: 'lib/benchmarks/runner.dart', - ); - }, 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.wasm(), - ); - }, - timeout: Timeout.none, - ); -} - -Future _runBenchmarks({ - required List benchmarkNames, - required String entryPoint, - String initialPage = defaultInitialPage, - CompilationOptions compilationOptions = const CompilationOptions.js(), -}) 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', - ]) { - 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( - const JsonEncoder.withIndent(' ').convert(taskResult.toJson()), - isA(), - ); -} diff --git a/packages/webview_flutter/webview_flutter/CHANGELOG.md b/packages/webview_flutter/webview_flutter/CHANGELOG.md index e7dc4d8ba2bc..f52c4cbce1ce 100644 --- a/packages/webview_flutter/webview_flutter/CHANGELOG.md +++ b/packages/webview_flutter/webview_flutter/CHANGELOG.md @@ -1,6 +1,11 @@ -## NEXT +## 4.10.0 -* Updates minimum supported SDK version to Flutter 3.19/Dart 3.3. +* Updates minimum supported `webview_flutter_android` from 3.16.0 to 4.0.0. + +## 4.9.0 + +* Adds endorsed macOS support. +* Updates minimum supported SDK version to Flutter 3.24/Dart 3.5. ## 4.8.0 diff --git a/packages/webview_flutter/webview_flutter/README.md b/packages/webview_flutter/webview_flutter/README.md index 81a33821c065..fbd6d50e2fd7 100644 --- a/packages/webview_flutter/webview_flutter/README.md +++ b/packages/webview_flutter/webview_flutter/README.md @@ -9,9 +9,9 @@ A Flutter plugin that provides a WebView widget. On iOS the WebView widget is backed by a [WKWebView](https://developer.apple.com/documentation/webkit/wkwebview). On Android the WebView widget is backed by a [WebView](https://developer.android.com/reference/android/webkit/WebView). -| | Android | iOS | -|-------------|----------------|-------| -| **Support** | SDK 19+ or 20+ | 12.0+ | +| | Android | iOS | macOS | +|-------------|---------|-------|--------| +| **Support** | SDK 21+ | 12.0+ | 10.14+ | ## Usage @@ -23,7 +23,6 @@ You can now display a WebView by: ```dart controller = WebViewController() ..setJavaScriptMode(JavaScriptMode.unrestricted) - ..setBackgroundColor(const Color(0x00000000)) ..setNavigationDelegate( NavigationDelegate( onProgress: (int progress) { @@ -86,7 +85,7 @@ To access platform-specific features, start by adding the platform implementatio app or package: * **Android**: [webview_flutter_android](https://pub.dev/packages/webview_flutter_android/install) -* **iOS**: [webview_flutter_wkwebview](https://pub.dev/packages/webview_flutter_wkwebview/install) +* **iOS/macOS**: [webview_flutter_wkwebview](https://pub.dev/packages/webview_flutter_wkwebview/install) Next, add the imports of the implementation packages to your app or package: @@ -94,7 +93,7 @@ Next, add the imports of the implementation packages to your app or package: ```dart // Import for Android features. import 'package:webview_flutter_android/webview_flutter_android.dart'; -// Import for iOS features. +// Import for iOS/macOS features. import 'package:webview_flutter_wkwebview/webview_flutter_wkwebview.dart'; ``` @@ -109,7 +108,7 @@ additional functionality provided by the platform and is followed by an example. 2. Call methods on a platform implementation of a class by using the `platform` field (e.g. `WebViewController.platform`, `WebViewWidget.platform`, etc.). -Below is an example of setting additional iOS and Android parameters on the `WebViewController`. +Below is an example of setting additional iOS/macOS and Android parameters on the `WebViewController`. ```dart @@ -137,7 +136,7 @@ See https://pub.dev/documentation/webview_flutter_android/latest/webview_flutter for more details on Android features. See https://pub.dev/documentation/webview_flutter_wkwebview/latest/webview_flutter_wkwebview/webview_flutter_wkwebview-library.html -for more details on iOS features. +for more details on iOS/macOS features. ### Enable Material Components for Android diff --git a/packages/webview_flutter/webview_flutter/example/android/app/gradle/wrapper/gradle-wrapper.properties b/packages/webview_flutter/webview_flutter/example/android/app/gradle/wrapper/gradle-wrapper.properties index 609ab8e6c8b5..d951fac2bf31 100644 --- a/packages/webview_flutter/webview_flutter/example/android/app/gradle/wrapper/gradle-wrapper.properties +++ b/packages/webview_flutter/webview_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-8.7-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/packages/webview_flutter/webview_flutter/example/android/build.gradle b/packages/webview_flutter/webview_flutter/example/android/build.gradle index cec92de922cf..0bed8906c094 100644 --- a/packages/webview_flutter/webview_flutter/example/android/build.gradle +++ b/packages/webview_flutter/webview_flutter/example/android/build.gradle @@ -5,7 +5,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:7.4.2' + classpath 'com.android.tools.build:gradle:8.5.2' } } diff --git a/packages/webview_flutter/webview_flutter/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/webview_flutter/webview_flutter/example/android/gradle/wrapper/gradle-wrapper.properties index aeaff6f869f3..7aeeb11c6ee5 100644 --- a/packages/webview_flutter/webview_flutter/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/packages/webview_flutter/webview_flutter/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-8.7-all.zip 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 8460a602ab02..e9d38e420f44 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 @@ -449,7 +449,10 @@ Future main() async { await controller.runJavaScriptReturningResult('isPaused();') as bool; expect(isPaused, true); }); - }); + }, + // OGG playback is not supported on macOS, so the test data would need + // to be changed to support macOS. + skip: Platform.isMacOS); testWidgets('getTitle', (WidgetTester tester) async { const String getTitleTest = ''' @@ -563,7 +566,10 @@ Future main() async { expect(recordedPosition?.x, X_SCROLL * 2); expect(recordedPosition?.y, Y_SCROLL * 2); }); - }); + }, + // Scroll position is currently not implemented for macOS. + // Flakes on iOS: https://github.com/flutter/flutter/issues/154826 + skip: Platform.isMacOS || Platform.isIOS); group('NavigationDelegate', () { const String blankPage = ''; @@ -578,7 +584,7 @@ Future main() async { await controller.setNavigationDelegate(NavigationDelegate( onPageFinished: (_) => pageLoaded.complete(), onNavigationRequest: (NavigationRequest navigationRequest) { - return (navigationRequest.url.contains('youtube.com')) + return navigationRequest.url.contains('youtube.com') ? NavigationDecision.prevent : NavigationDecision.navigate; }, @@ -648,7 +654,7 @@ Future main() async { await controller.setNavigationDelegate(NavigationDelegate( onPageFinished: (_) => pageLoaded.complete(), onNavigationRequest: (NavigationRequest navigationRequest) { - return (navigationRequest.url.contains('youtube.com')) + return navigationRequest.url.contains('youtube.com') ? NavigationDecision.prevent : NavigationDecision.navigate; })); @@ -943,7 +949,7 @@ Future main() async { 'localStorage.getItem("myCat");', ) as String; } catch (exception) { - if (defaultTargetPlatform == TargetPlatform.iOS && + if (_isWKWebView() && exception is ArgumentError && (exception.message as String).contains( 'Result of JavaScript execution returned a `null` value.')) { @@ -955,24 +961,29 @@ Future main() async { ); } -// JavaScript `null` evaluate to different string values on Android and iOS. +// JavaScript `null` evaluate to different string values per platform. // This utility method returns the string boolean value of the current platform. String _webViewNull() { - if (defaultTargetPlatform == TargetPlatform.iOS) { + if (_isWKWebView()) { return ''; } return 'null'; } -// JavaScript String evaluate to different string values on Android and iOS. +// JavaScript String evaluates to different strings depending on the platform. // This utility method returns the string boolean value of the current platform. String _webViewString(String value) { - if (defaultTargetPlatform == TargetPlatform.iOS) { + if (_isWKWebView()) { return value; } return '"$value"'; } +bool _isWKWebView() { + return defaultTargetPlatform == TargetPlatform.iOS || + defaultTargetPlatform == TargetPlatform.macOS; +} + class ResizableWebView extends StatefulWidget { const ResizableWebView({ super.key, diff --git a/packages/webview_flutter/webview_flutter/example/integration_test/webview_flutter_test_legacy.dart b/packages/webview_flutter/webview_flutter/example/integration_test/webview_flutter_test_legacy.dart index fb037cffd36c..076c103bc2f8 100644 --- a/packages/webview_flutter/webview_flutter/example/integration_test/webview_flutter_test_legacy.dart +++ b/packages/webview_flutter/webview_flutter/example/integration_test/webview_flutter_test_legacy.dart @@ -873,7 +873,7 @@ Future main() async { }, javascriptMode: JavascriptMode.unrestricted, navigationDelegate: (NavigationRequest request) { - return (request.url.contains('youtube.com')) + return request.url.contains('youtube.com') ? NavigationDecision.prevent : NavigationDecision.navigate; }, @@ -1003,7 +1003,7 @@ Future main() async { }, javascriptMode: JavascriptMode.unrestricted, navigationDelegate: (NavigationRequest request) { - return (request.url.contains('youtube.com')) + return request.url.contains('youtube.com') ? NavigationDecision.prevent : NavigationDecision.navigate; }, diff --git a/packages/webview_flutter/webview_flutter/example/lib/main.dart b/packages/webview_flutter/webview_flutter/example/lib/main.dart index d24ec11424f4..c73749d0622c 100644 --- a/packages/webview_flutter/webview_flutter/example/lib/main.dart +++ b/packages/webview_flutter/webview_flutter/example/lib/main.dart @@ -7,15 +7,15 @@ import 'dart:async'; import 'dart:convert'; import 'dart:io'; -import 'dart:typed_data'; +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:path_provider/path_provider.dart'; import 'package:webview_flutter/webview_flutter.dart'; // #docregion platform_imports // Import for Android features. import 'package:webview_flutter_android/webview_flutter_android.dart'; -// Import for iOS features. +// Import for iOS/macOS features. import 'package:webview_flutter_wkwebview/webview_flutter_wkwebview.dart'; // #enddocregion platform_imports @@ -141,7 +141,6 @@ class _WebViewExampleState extends State { controller ..setJavaScriptMode(JavaScriptMode.unrestricted) - ..setBackgroundColor(const Color(0x00000000)) ..setNavigationDelegate( NavigationDelegate( onProgress: (int progress) { @@ -191,6 +190,11 @@ Page resource error: ) ..loadRequest(Uri.parse('https://flutter.dev')); + // setBackgroundColor is not currently supported on macOS. + if (kIsWeb || !Platform.isMacOS) { + controller.setBackgroundColor(const Color(0x80000000)); + } + // #docregion platform_features if (controller.platform is AndroidWebViewController) { AndroidWebViewController.enableDebugging(true); diff --git a/packages/webview_flutter/webview_flutter/example/lib/simple_example.dart b/packages/webview_flutter/webview_flutter/example/lib/simple_example.dart index 06a7bd31dd8c..9bfe41f3dd59 100644 --- a/packages/webview_flutter/webview_flutter/example/lib/simple_example.dart +++ b/packages/webview_flutter/webview_flutter/example/lib/simple_example.dart @@ -26,7 +26,6 @@ class _WebViewExampleState extends State { // #docregion webview_controller controller = WebViewController() ..setJavaScriptMode(JavaScriptMode.unrestricted) - ..setBackgroundColor(const Color(0x00000000)) ..setNavigationDelegate( NavigationDelegate( onProgress: (int progress) { diff --git a/packages/webview_flutter/webview_flutter/example/macos/.gitignore b/packages/webview_flutter/webview_flutter/example/macos/.gitignore new file mode 100644 index 000000000000..746adbb6b9e1 --- /dev/null +++ b/packages/webview_flutter/webview_flutter/example/macos/.gitignore @@ -0,0 +1,7 @@ +# Flutter-related +**/Flutter/ephemeral/ +**/Pods/ + +# Xcode-related +**/dgph +**/xcuserdata/ diff --git a/packages/webview_flutter/webview_flutter/example/macos/Flutter/Flutter-Debug.xcconfig b/packages/webview_flutter/webview_flutter/example/macos/Flutter/Flutter-Debug.xcconfig new file mode 100644 index 000000000000..4b81f9b2d200 --- /dev/null +++ b/packages/webview_flutter/webview_flutter/example/macos/Flutter/Flutter-Debug.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" +#include "ephemeral/Flutter-Generated.xcconfig" diff --git a/packages/webview_flutter/webview_flutter/example/macos/Flutter/Flutter-Release.xcconfig b/packages/webview_flutter/webview_flutter/example/macos/Flutter/Flutter-Release.xcconfig new file mode 100644 index 000000000000..5caa9d1579e4 --- /dev/null +++ b/packages/webview_flutter/webview_flutter/example/macos/Flutter/Flutter-Release.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" +#include "ephemeral/Flutter-Generated.xcconfig" diff --git a/packages/webview_flutter/webview_flutter/example/macos/Podfile b/packages/webview_flutter/webview_flutter/example/macos/Podfile new file mode 100644 index 000000000000..049abe295427 --- /dev/null +++ b/packages/webview_flutter/webview_flutter/example/macos/Podfile @@ -0,0 +1,40 @@ +platform :osx, '10.14' + +# 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/webview_flutter/webview_flutter/example/macos/Runner.xcodeproj/project.pbxproj b/packages/webview_flutter/webview_flutter/example/macos/Runner.xcodeproj/project.pbxproj new file mode 100644 index 000000000000..0c6904fdef97 --- /dev/null +++ b/packages/webview_flutter/webview_flutter/example/macos/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,650 @@ +// !$*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 */ + 2EB4149157BBD3A430F11F07 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8F0018C81FCBA5B69ABBF5D1 /* Pods_Runner.framework */; }; + 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 */; }; +/* 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 */ + 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 /* webview_flutter_example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = webview_flutter_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 = ""; }; + 5F8C8F28798E2C13759B0247 /* 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 = ""; }; + 667DA8CACF6C1923CDF6309D /* 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 = ""; }; + 7AF549A34A225DB69555B81E /* 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 = ""; }; + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; }; + 8F0018C81FCBA5B69ABBF5D1 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 9161E5D15A39CAD8BDCA3648 /* 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 = ""; }; + 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; }; + EA616C3C53C91DA835A1F62D /* 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 = ""; }; + F3B4A758F2F46A632FB5B88A /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + F927ED1AFD55FE3E39FF121E /* 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 = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 33CC10EA2044A3C60003C045 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 2EB4149157BBD3A430F11F07 /* 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 */, + 394ADD5AAA21B9C50952CBB6 /* Pods */, + ); + sourceTree = ""; + }; + 33CC10EE2044A3C60003C045 /* Products */ = { + isa = PBXGroup; + children = ( + 33CC10ED2044A3C60003C045 /* webview_flutter_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 = ""; + }; + 394ADD5AAA21B9C50952CBB6 /* Pods */ = { + isa = PBXGroup; + children = ( + 7AF549A34A225DB69555B81E /* Pods-Runner.debug.xcconfig */, + 9161E5D15A39CAD8BDCA3648 /* Pods-Runner.release.xcconfig */, + EA616C3C53C91DA835A1F62D /* Pods-Runner.profile.xcconfig */, + F927ED1AFD55FE3E39FF121E /* Pods-RunnerTests.debug.xcconfig */, + 5F8C8F28798E2C13759B0247 /* Pods-RunnerTests.release.xcconfig */, + 667DA8CACF6C1923CDF6309D /* Pods-RunnerTests.profile.xcconfig */, + ); + path = Pods; + sourceTree = ""; + }; + D73912EC22F37F3D000D13A0 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 8F0018C81FCBA5B69ABBF5D1 /* Pods_Runner.framework */, + F3B4A758F2F46A632FB5B88A /* 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 = ( + 25920929D4636EAA1B54D439 /* [CP] Check Pods Manifest.lock */, + 33CC10E92044A3C60003C045 /* Sources */, + 33CC10EA2044A3C60003C045 /* Frameworks */, + 33CC10EB2044A3C60003C045 /* Resources */, + 33CC110E2044A8840003C045 /* Bundle Framework */, + 3399D490228B24CF009A79C7 /* ShellScript */, + DE10F152618904A081E20590 /* [CP] Embed Pods Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + 33CC11202044C79F0003C045 /* PBXTargetDependency */, + ); + name = Runner; + productName = Runner; + productReference = 33CC10ED2044A3C60003C045 /* webview_flutter_example.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 33CC10E52044A3C60003C045 /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = YES; + LastSwiftUpdateCheck = 0920; + LastUpgradeCheck = 1510; + 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 */ + 25920929D4636EAA1B54D439 /* [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; + }; + 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"; + }; + DE10F152618904A081E20590 /* [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 */ + 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; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + 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; + DEAD_CODE_STRIPPING = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + 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.14; + 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; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + 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; + DEAD_CODE_STRIPPING = YES; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + 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.14; + 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; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + 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; + DEAD_CODE_STRIPPING = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + 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.14; + 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/webview_flutter/webview_flutter/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/packages/webview_flutter/webview_flutter/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 000000000000..18d981003d68 --- /dev/null +++ b/packages/webview_flutter/webview_flutter/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/packages/webview_flutter/webview_flutter/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/packages/webview_flutter/webview_flutter/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme new file mode 100644 index 000000000000..ebf28f20f4b2 --- /dev/null +++ b/packages/webview_flutter/webview_flutter/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/webview_flutter/webview_flutter/example/macos/Runner.xcworkspace/contents.xcworkspacedata b/packages/webview_flutter/webview_flutter/example/macos/Runner.xcworkspace/contents.xcworkspacedata new file mode 100644 index 000000000000..21a3cc14c74e --- /dev/null +++ b/packages/webview_flutter/webview_flutter/example/macos/Runner.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/packages/webview_flutter/webview_flutter/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/packages/webview_flutter/webview_flutter/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 000000000000..18d981003d68 --- /dev/null +++ b/packages/webview_flutter/webview_flutter/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/packages/webview_flutter/webview_flutter/example/macos/Runner/AppDelegate.swift b/packages/webview_flutter/webview_flutter/example/macos/Runner/AppDelegate.swift new file mode 100644 index 000000000000..689c0ecd5254 --- /dev/null +++ b/packages/webview_flutter/webview_flutter/example/macos/Runner/AppDelegate.swift @@ -0,0 +1,13 @@ +// 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 + +@main +class AppDelegate: FlutterAppDelegate { + override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { + return true + } +} diff --git a/packages/webview_flutter/webview_flutter/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/packages/webview_flutter/webview_flutter/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 000000000000..a2ec33f19f11 --- /dev/null +++ b/packages/webview_flutter/webview_flutter/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,68 @@ +{ + "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/webview_flutter/webview_flutter/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png b/packages/webview_flutter/webview_flutter/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png new file mode 100644 index 000000000000..82b6f9d9a33e Binary files /dev/null and b/packages/webview_flutter/webview_flutter/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png differ diff --git a/packages/webview_flutter/webview_flutter/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png b/packages/webview_flutter/webview_flutter/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png new file mode 100644 index 000000000000..13b35eba55c6 Binary files /dev/null and b/packages/webview_flutter/webview_flutter/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png differ diff --git a/packages/webview_flutter/webview_flutter/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png b/packages/webview_flutter/webview_flutter/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png new file mode 100644 index 000000000000..0a3f5fa40fb3 Binary files /dev/null and b/packages/webview_flutter/webview_flutter/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png differ diff --git a/packages/webview_flutter/webview_flutter/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png b/packages/webview_flutter/webview_flutter/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png new file mode 100644 index 000000000000..bdb57226d5f2 Binary files /dev/null and b/packages/webview_flutter/webview_flutter/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png differ diff --git a/packages/webview_flutter/webview_flutter/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png b/packages/webview_flutter/webview_flutter/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png new file mode 100644 index 000000000000..f083318e09ca Binary files /dev/null and b/packages/webview_flutter/webview_flutter/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png differ diff --git a/packages/webview_flutter/webview_flutter/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png b/packages/webview_flutter/webview_flutter/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png new file mode 100644 index 000000000000..326c0e72c9d8 Binary files /dev/null and b/packages/webview_flutter/webview_flutter/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png differ diff --git a/packages/webview_flutter/webview_flutter/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png b/packages/webview_flutter/webview_flutter/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png new file mode 100644 index 000000000000..2f1632cfddf3 Binary files /dev/null and b/packages/webview_flutter/webview_flutter/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png differ diff --git a/packages/webview_flutter/webview_flutter/example/macos/Runner/Base.lproj/MainMenu.xib b/packages/webview_flutter/webview_flutter/example/macos/Runner/Base.lproj/MainMenu.xib new file mode 100644 index 000000000000..80e867a4e06b --- /dev/null +++ b/packages/webview_flutter/webview_flutter/example/macos/Runner/Base.lproj/MainMenu.xib @@ -0,0 +1,343 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/webview_flutter/webview_flutter/example/macos/Runner/Configs/AppInfo.xcconfig b/packages/webview_flutter/webview_flutter/example/macos/Runner/Configs/AppInfo.xcconfig new file mode 100644 index 000000000000..aaf1573085ce --- /dev/null +++ b/packages/webview_flutter/webview_flutter/example/macos/Runner/Configs/AppInfo.xcconfig @@ -0,0 +1,14 @@ +// 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 = webview_flutter_example + +// The application's bundle identifier +PRODUCT_BUNDLE_IDENTIFIER = dev.flutter.plugins.webview_flutter_example + +// The copyright displayed in application information +PRODUCT_COPYRIGHT = Copyright © 2024 dev.flutter.plugins. All rights reserved. diff --git a/packages/webview_flutter/webview_flutter/example/macos/Runner/Configs/Debug.xcconfig b/packages/webview_flutter/webview_flutter/example/macos/Runner/Configs/Debug.xcconfig new file mode 100644 index 000000000000..36b0fd9464f4 --- /dev/null +++ b/packages/webview_flutter/webview_flutter/example/macos/Runner/Configs/Debug.xcconfig @@ -0,0 +1,2 @@ +#include "../../Flutter/Flutter-Debug.xcconfig" +#include "Warnings.xcconfig" diff --git a/packages/webview_flutter/webview_flutter/example/macos/Runner/Configs/Release.xcconfig b/packages/webview_flutter/webview_flutter/example/macos/Runner/Configs/Release.xcconfig new file mode 100644 index 000000000000..dff4f49561c8 --- /dev/null +++ b/packages/webview_flutter/webview_flutter/example/macos/Runner/Configs/Release.xcconfig @@ -0,0 +1,2 @@ +#include "../../Flutter/Flutter-Release.xcconfig" +#include "Warnings.xcconfig" diff --git a/packages/webview_flutter/webview_flutter/example/macos/Runner/Configs/Warnings.xcconfig b/packages/webview_flutter/webview_flutter/example/macos/Runner/Configs/Warnings.xcconfig new file mode 100644 index 000000000000..42bcbf4780b1 --- /dev/null +++ b/packages/webview_flutter/webview_flutter/example/macos/Runner/Configs/Warnings.xcconfig @@ -0,0 +1,13 @@ +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/webview_flutter/webview_flutter/example/macos/Runner/DebugProfile.entitlements b/packages/webview_flutter/webview_flutter/example/macos/Runner/DebugProfile.entitlements new file mode 100644 index 000000000000..08c3ab17cc26 --- /dev/null +++ b/packages/webview_flutter/webview_flutter/example/macos/Runner/DebugProfile.entitlements @@ -0,0 +1,14 @@ + + + + + com.apple.security.app-sandbox + + com.apple.security.cs.allow-jit + + com.apple.security.network.server + + com.apple.security.network.client + + + diff --git a/packages/webview_flutter/webview_flutter/example/macos/Runner/Info.plist b/packages/webview_flutter/webview_flutter/example/macos/Runner/Info.plist new file mode 100644 index 000000000000..4789daa6a443 --- /dev/null +++ b/packages/webview_flutter/webview_flutter/example/macos/Runner/Info.plist @@ -0,0 +1,32 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIconFile + + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + LSMinimumSystemVersion + $(MACOSX_DEPLOYMENT_TARGET) + NSHumanReadableCopyright + $(PRODUCT_COPYRIGHT) + NSMainNibFile + MainMenu + NSPrincipalClass + NSApplication + + diff --git a/packages/webview_flutter/webview_flutter/example/macos/Runner/MainFlutterWindow.swift b/packages/webview_flutter/webview_flutter/example/macos/Runner/MainFlutterWindow.swift new file mode 100644 index 000000000000..f21908966e95 --- /dev/null +++ b/packages/webview_flutter/webview_flutter/example/macos/Runner/MainFlutterWindow.swift @@ -0,0 +1,19 @@ +// 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/webview_flutter/webview_flutter/example/macos/Runner/Release.entitlements b/packages/webview_flutter/webview_flutter/example/macos/Runner/Release.entitlements new file mode 100644 index 000000000000..ee95ab7e582d --- /dev/null +++ b/packages/webview_flutter/webview_flutter/example/macos/Runner/Release.entitlements @@ -0,0 +1,10 @@ + + + + + com.apple.security.app-sandbox + + com.apple.security.network.client + + + diff --git a/packages/webview_flutter/webview_flutter/example/pubspec.yaml b/packages/webview_flutter/webview_flutter/example/pubspec.yaml index a152e52db63d..1eb34f957ea0 100644 --- a/packages/webview_flutter/webview_flutter/example/pubspec.yaml +++ b/packages/webview_flutter/webview_flutter/example/pubspec.yaml @@ -17,12 +17,12 @@ 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.16.0 + webview_flutter_android: ^4.0.0 webview_flutter_wkwebview: ^3.13.0 dev_dependencies: build_runner: ^2.1.5 - espresso: ^0.2.0 + espresso: ^0.4.0 flutter_test: sdk: flutter integration_test: diff --git a/packages/webview_flutter/webview_flutter/pubspec.yaml b/packages/webview_flutter/webview_flutter/pubspec.yaml index 01ae9008e346..837800d7feef 100644 --- a/packages/webview_flutter/webview_flutter/pubspec.yaml +++ b/packages/webview_flutter/webview_flutter/pubspec.yaml @@ -1,12 +1,12 @@ name: webview_flutter -description: A Flutter plugin that provides a WebView widget on Android and iOS. +description: A Flutter plugin that provides a WebView widget backed by the system webview. 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.8.0 +version: 4.10.0 environment: - sdk: ^3.3.0 - flutter: ">=3.19.0" + sdk: ^3.5.0 + flutter: ">=3.24.0" flutter: plugin: @@ -15,19 +15,21 @@ flutter: default_package: webview_flutter_android ios: default_package: webview_flutter_wkwebview + macos: + default_package: webview_flutter_wkwebview dependencies: flutter: sdk: flutter - webview_flutter_android: ^3.16.0 + webview_flutter_android: ^4.0.0 webview_flutter_platform_interface: ^2.10.0 - webview_flutter_wkwebview: ^3.13.0 + webview_flutter_wkwebview: ^3.15.0 dev_dependencies: build_runner: ^2.1.5 flutter_test: sdk: flutter - mockito: 5.4.4 + mockito: ^5.4.4 plugin_platform_interface: ^2.1.7 topics: diff --git a/packages/webview_flutter/webview_flutter_android/CHANGELOG.md b/packages/webview_flutter/webview_flutter_android/CHANGELOG.md index d6d238f7ec17..a7683435ce2b 100644 --- a/packages/webview_flutter/webview_flutter_android/CHANGELOG.md +++ b/packages/webview_flutter/webview_flutter_android/CHANGELOG.md @@ -1,3 +1,21 @@ +## 4.0.0 + +* Bumps androidx.webkit:webkit from 1.12.0 to 1.12.1. +* **Breaking Change** Bumps Android `minSdkVersion` from 19 to 21. + +## 3.16.9 + +* Updates Java compatibility version to 11. +* Updates minimum supported SDK version to Flutter 3.24/Dart 3.5. + +## 3.16.8 + +* Bumps androidx.webkit:webkit from 1.11.0 to 1.12.0. + +## 3.16.7 + +* Bumps androidx.annotation:annotation from 1.8.1 to 1.8.2. + ## 3.16.6 * Bumps androidx.annotation:annotation from 1.7.1 to 1.8.1. diff --git a/packages/webview_flutter/webview_flutter_android/android/build.gradle b/packages/webview_flutter/webview_flutter_android/android/build.gradle index 2cae9b4610b9..7e5bcc82d8fe 100644 --- a/packages/webview_flutter/webview_flutter_android/android/build.gradle +++ b/packages/webview_flutter/webview_flutter_android/android/build.gradle @@ -22,14 +22,11 @@ rootProject.allprojects { apply plugin: 'com.android.library' android { - // Conditional for compatibility with AGP <4.2. - if (project.android.hasProperty("namespace")) { - namespace 'io.flutter.plugins.webviewflutter' - } + namespace 'io.flutter.plugins.webviewflutter' compileSdk 34 defaultConfig { - minSdkVersion 19 + minSdkVersion 21 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } @@ -40,16 +37,16 @@ android { } dependencies { - implementation 'androidx.annotation:annotation:1.8.1' - implementation 'androidx.webkit:webkit:1.11.0' + implementation 'androidx.annotation:annotation:1.8.2' + implementation 'androidx.webkit:webkit:1.12.1' testImplementation 'junit:junit:4.13.2' testImplementation 'org.mockito:mockito-inline:5.1.0' testImplementation 'androidx.test:core:1.3.0' } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_11 + targetCompatibility JavaVersion.VERSION_11 } testOptions { diff --git a/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/FileChooserParamsFlutterApiImpl.java b/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/FileChooserParamsFlutterApiImpl.java index 5ad5923d5f2c..d0f5b9c4d64a 100644 --- a/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/FileChooserParamsFlutterApiImpl.java +++ b/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/FileChooserParamsFlutterApiImpl.java @@ -4,10 +4,8 @@ package io.flutter.plugins.webviewflutter; -import android.os.Build; import android.webkit.WebChromeClient; import androidx.annotation.NonNull; -import androidx.annotation.RequiresApi; import io.flutter.plugin.common.BinaryMessenger; import java.util.Arrays; @@ -17,7 +15,6 @@ *

Passes arguments of callbacks methods from a {@link * android.webkit.WebChromeClient.FileChooserParams} to Dart. */ -@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) public class FileChooserParamsFlutterApiImpl extends GeneratedAndroidWebView.FileChooserParamsFlutterApi { private final InstanceManager instanceManager; diff --git a/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/PermissionRequestHostApiImpl.java b/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/PermissionRequestHostApiImpl.java index e4faf449adc8..2a7e6ccb58a0 100644 --- a/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/PermissionRequestHostApiImpl.java +++ b/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/PermissionRequestHostApiImpl.java @@ -4,10 +4,8 @@ package io.flutter.plugins.webviewflutter; -import android.os.Build; import android.webkit.PermissionRequest; import androidx.annotation.NonNull; -import androidx.annotation.RequiresApi; import io.flutter.plugin.common.BinaryMessenger; import io.flutter.plugins.webviewflutter.GeneratedAndroidWebView.PermissionRequestHostApi; import java.util.List; @@ -19,7 +17,6 @@ *

This class may handle instantiating and adding native object instances that are attached to a * Dart instance or handle method calls on the associated native class or an instance of the class. */ -@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) public class PermissionRequestHostApiImpl implements PermissionRequestHostApi { // To ease adding additional methods, this value is added prematurely. @SuppressWarnings({"unused", "FieldCanBeLocal"}) diff --git a/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/WebChromeClientFlutterApiImpl.java b/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/WebChromeClientFlutterApiImpl.java index d5601670630c..45a1c98adae1 100644 --- a/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/WebChromeClientFlutterApiImpl.java +++ b/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/WebChromeClientFlutterApiImpl.java @@ -4,7 +4,6 @@ package io.flutter.plugins.webviewflutter; -import android.os.Build; import android.view.View; import android.webkit.ConsoleMessage; import android.webkit.GeolocationPermissions; @@ -12,7 +11,6 @@ import android.webkit.WebChromeClient; import android.webkit.WebView; import androidx.annotation.NonNull; -import androidx.annotation.RequiresApi; import io.flutter.plugin.common.BinaryMessenger; import io.flutter.plugins.webviewflutter.GeneratedAndroidWebView.WebChromeClientFlutterApi; import java.util.List; @@ -75,7 +73,6 @@ public void onProgressChanged( } /** Passes arguments from {@link WebChromeClient#onShowFileChooser} to Dart. */ - @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) public void onShowFileChooser( @NonNull WebChromeClient webChromeClient, @NonNull WebView webView, @@ -123,7 +120,6 @@ public void onGeolocationPermissionsHidePrompt( * Sends a message to Dart to call `WebChromeClient.onPermissionRequest` on the Dart object * representing `instance`. */ - @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) public void onPermissionRequest( @NonNull WebChromeClient instance, @NonNull PermissionRequest request, diff --git a/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/WebChromeClientHostApiImpl.java b/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/WebChromeClientHostApiImpl.java index 3f230b7b794f..2edb012c5350 100644 --- a/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/WebChromeClientHostApiImpl.java +++ b/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/WebChromeClientHostApiImpl.java @@ -83,7 +83,6 @@ public void onGeolocationPermissionsHidePrompt() { flutterApi.onGeolocationPermissionsHidePrompt(this, reply -> {}); } - @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) @SuppressWarnings("LambdaLast") @Override public boolean onShowFileChooser( @@ -109,7 +108,6 @@ public boolean onShowFileChooser( return currentReturnValueForOnShowFileChooser; } - @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) @Override public void onPermissionRequest(@NonNull PermissionRequest request) { flutterApi.onPermissionRequest(this, request, reply -> {}); diff --git a/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/WebViewClientFlutterApiImpl.java b/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/WebViewClientFlutterApiImpl.java index 0bd280d705b2..b94238bcb4b5 100644 --- a/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/WebViewClientFlutterApiImpl.java +++ b/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/WebViewClientFlutterApiImpl.java @@ -51,7 +51,6 @@ static GeneratedAndroidWebView.WebResourceErrorData createWebResourceErrorData( .build(); } - @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) static GeneratedAndroidWebView.WebResourceRequestData createWebResourceRequestData( WebResourceRequest request) { final GeneratedAndroidWebView.WebResourceRequestData.Builder requestData = @@ -71,7 +70,6 @@ static GeneratedAndroidWebView.WebResourceRequestData createWebResourceRequestDa return requestData.build(); } - @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) static GeneratedAndroidWebView.WebResourceResponseData createWebResourceResponseData( WebResourceResponse response) { final GeneratedAndroidWebView.WebResourceResponseData.Builder responseData = @@ -122,7 +120,6 @@ public void onPageFinished( } /** Passes arguments from {@link WebViewClient#onReceivedHttpError} to Dart. */ - @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) public void onReceivedHttpError( @NonNull WebViewClient webViewClient, @NonNull WebView webView, @@ -167,7 +164,6 @@ public void onReceivedRequestError( * Passes arguments from {@link androidx.webkit.WebViewClientCompat#onReceivedError(WebView, * WebResourceRequest, WebResourceError)} to Dart. */ - @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) public void onReceivedRequestError( @NonNull WebViewClient webViewClient, @NonNull WebView webView, @@ -214,7 +210,6 @@ public void onReceivedError( * Passes arguments from {@link WebViewClient#shouldOverrideUrlLoading(WebView, * WebResourceRequest)} to Dart. */ - @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) public void requestLoading( @NonNull WebViewClient webViewClient, @NonNull WebView webView, diff --git a/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/WebViewClientHostApiImpl.java b/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/WebViewClientHostApiImpl.java index fdc448279982..a71b5efbcc4f 100644 --- a/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/WebViewClientHostApiImpl.java +++ b/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/WebViewClientHostApiImpl.java @@ -4,8 +4,6 @@ package io.flutter.plugins.webviewflutter; -import android.annotation.SuppressLint; -import android.annotation.TargetApi; import android.graphics.Bitmap; import android.os.Build; import android.view.KeyEvent; @@ -152,7 +150,6 @@ public void onPageFinished(@NonNull WebView view, @NonNull String url) { flutterApi.onPageFinished(this, view, url, reply -> {}); } - @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) @Override public void onReceivedHttpError( @NonNull WebView view, @@ -161,10 +158,6 @@ public void onReceivedHttpError( flutterApi.onReceivedHttpError(this, view, request, response, reply -> {}); } - // This method is only called when the WebViewFeature.RECEIVE_WEB_RESOURCE_ERROR feature is - // enabled. The deprecated method is called when a device doesn't support this. - @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) - @SuppressLint("RequiresFeature") @Override public void onReceivedError( @NonNull WebView view, @@ -185,7 +178,6 @@ public void onReceivedError( this, view, (long) errorCode, description, failingUrl, reply -> {}); } - @TargetApi(Build.VERSION_CODES.LOLLIPOP) @Override public boolean shouldOverrideUrlLoading( @NonNull WebView view, @NonNull WebResourceRequest request) { diff --git a/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/WebViewFlutterPlugin.java b/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/WebViewFlutterPlugin.java index 3c73a4e4c31b..80c574badf81 100644 --- a/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/WebViewFlutterPlugin.java +++ b/packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/WebViewFlutterPlugin.java @@ -5,7 +5,6 @@ package io.flutter.plugins.webviewflutter; import android.content.Context; -import android.os.Build; import android.os.Handler; import androidx.annotation.NonNull; import androidx.annotation.Nullable; @@ -109,11 +108,8 @@ private void setUp( WebStorageHostApi.setup( binaryMessenger, new WebStorageHostApiImpl(instanceManager, new WebStorageHostApiImpl.WebStorageCreator())); - - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { - PermissionRequestHostApi.setup( - binaryMessenger, new PermissionRequestHostApiImpl(binaryMessenger, instanceManager)); - } + PermissionRequestHostApi.setup( + binaryMessenger, new PermissionRequestHostApiImpl(binaryMessenger, instanceManager)); GeolocationPermissionsCallbackHostApi.setup( binaryMessenger, new GeolocationPermissionsCallbackHostApiImpl(binaryMessenger, instanceManager)); diff --git a/packages/webview_flutter/webview_flutter_android/example/android/app/build.gradle b/packages/webview_flutter/webview_flutter_android/example/android/app/build.gradle index 095cb635c40c..c2cc2d985656 100644 --- a/packages/webview_flutter/webview_flutter_android/example/android/app/build.gradle +++ b/packages/webview_flutter/webview_flutter_android/example/android/app/build.gradle @@ -33,7 +33,7 @@ android { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "io.flutter.plugins.webviewflutterandroidexample" minSdkVersion 21 - targetSdkVersion 28 + targetSdkVersion 34 versionCode flutterVersionCode.toInteger() versionName flutterVersionName testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 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..d951fac2bf31 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-8.7-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/packages/webview_flutter/webview_flutter_android/example/android/app/src/main/AndroidManifest.xml b/packages/webview_flutter/webview_flutter_android/example/android/app/src/main/AndroidManifest.xml index 8a28579c3795..e61c40369fdf 100644 --- a/packages/webview_flutter/webview_flutter_android/example/android/app/src/main/AndroidManifest.xml +++ b/packages/webview_flutter/webview_flutter_android/example/android/app/src/main/AndroidManifest.xml @@ -1,7 +1,10 @@ - + @@ -10,7 +13,8 @@ android:value="2" /> main() async { await delegate.setOnPageFinished((_) => pageLoaded.complete()); await delegate .setOnNavigationRequest((NavigationRequest navigationRequest) { - return (navigationRequest.url.contains('youtube.com')) + return navigationRequest.url.contains('youtube.com') ? NavigationDecision.prevent : NavigationDecision.navigate; }); @@ -1059,7 +1059,7 @@ Future main() async { await delegate.setOnPageFinished((_) => pageLoaded.complete()); await delegate .setOnNavigationRequest((NavigationRequest navigationRequest) { - return (navigationRequest.url.contains('youtube.com')) + return navigationRequest.url.contains('youtube.com') ? NavigationDecision.prevent : NavigationDecision.navigate; }); diff --git a/packages/webview_flutter/webview_flutter_android/example/integration_test/webview_flutter_test_legacy.dart b/packages/webview_flutter/webview_flutter_android/example/integration_test/webview_flutter_test_legacy.dart index 2e7f3d0b8dd7..51f71d7801b8 100644 --- a/packages/webview_flutter/webview_flutter_android/example/integration_test/webview_flutter_test_legacy.dart +++ b/packages/webview_flutter/webview_flutter_android/example/integration_test/webview_flutter_test_legacy.dart @@ -1126,7 +1126,7 @@ Future main() async { }, javascriptMode: JavascriptMode.unrestricted, navigationDelegate: (NavigationRequest request) { - return (request.url.contains('youtube.com')) + return request.url.contains('youtube.com') ? NavigationDecision.prevent : NavigationDecision.navigate; }, @@ -1251,7 +1251,7 @@ Future main() async { }, javascriptMode: JavascriptMode.unrestricted, navigationDelegate: (NavigationRequest request) { - return (request.url.contains('youtube.com')) + return request.url.contains('youtube.com') ? NavigationDecision.prevent : NavigationDecision.navigate; }, diff --git a/packages/webview_flutter/webview_flutter_android/example/pubspec.yaml b/packages/webview_flutter/webview_flutter_android/example/pubspec.yaml index a79d03efb4c4..c22d7dc70220 100644 --- a/packages/webview_flutter/webview_flutter_android/example/pubspec.yaml +++ b/packages/webview_flutter/webview_flutter_android/example/pubspec.yaml @@ -3,8 +3,8 @@ description: Demonstrates how to use the webview_flutter_android plugin. publish_to: none environment: - sdk: ^3.4.0 - flutter: ">=3.22.0" + sdk: ^3.5.0 + flutter: ">=3.24.0" dependencies: flutter: @@ -20,7 +20,7 @@ dependencies: webview_flutter_platform_interface: ^2.10.0 dev_dependencies: - espresso: ^0.2.0 + espresso: ^0.4.0 flutter_test: sdk: flutter integration_test: diff --git a/packages/webview_flutter/webview_flutter_android/pubspec.yaml b/packages/webview_flutter/webview_flutter_android/pubspec.yaml index 38ae692b6663..031ca80375d1 100644 --- a/packages/webview_flutter/webview_flutter_android/pubspec.yaml +++ b/packages/webview_flutter/webview_flutter_android/pubspec.yaml @@ -2,11 +2,11 @@ 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.16.6 +version: 4.0.0 environment: - sdk: ^3.4.0 - flutter: ">=3.22.0" + sdk: ^3.5.0 + flutter: ">=3.24.0" flutter: plugin: @@ -26,7 +26,7 @@ dev_dependencies: build_runner: ^2.1.4 flutter_test: sdk: flutter - mockito: 5.4.4 + mockito: ^5.4.4 pigeon: ^11.0.0 topics: diff --git a/packages/webview_flutter/webview_flutter_platform_interface/pubspec.yaml b/packages/webview_flutter/webview_flutter_platform_interface/pubspec.yaml index 6510fa6fb00b..c7cb7f96eba1 100644 --- a/packages/webview_flutter/webview_flutter_platform_interface/pubspec.yaml +++ b/packages/webview_flutter/webview_flutter_platform_interface/pubspec.yaml @@ -20,7 +20,7 @@ dev_dependencies: build_runner: ^2.1.8 flutter_test: sdk: flutter - mockito: 5.4.4 + mockito: ^5.4.4 topics: - html diff --git a/packages/webview_flutter/webview_flutter_web/pubspec.yaml b/packages/webview_flutter/webview_flutter_web/pubspec.yaml index 98d4ff6ffb28..dccc235789b0 100644 --- a/packages/webview_flutter/webview_flutter_web/pubspec.yaml +++ b/packages/webview_flutter/webview_flutter_web/pubspec.yaml @@ -28,7 +28,7 @@ dev_dependencies: build_runner: ^2.1.5 flutter_test: sdk: flutter - mockito: 5.4.4 + mockito: ^5.4.4 topics: - html diff --git a/packages/webview_flutter/webview_flutter_wkwebview/CHANGELOG.md b/packages/webview_flutter/webview_flutter_wkwebview/CHANGELOG.md index dc31c2d32a92..3091a1b5a3e9 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/CHANGELOG.md +++ b/packages/webview_flutter/webview_flutter_wkwebview/CHANGELOG.md @@ -1,6 +1,10 @@ -## NEXT +## 3.16.0 -* Updates minimum supported SDK version to Flutter 3.19/Dart 3.3. +* Supports NTLM for authentication. + +## 3.15.0 + +* Adds macOS support. ## 3.14.0 @@ -92,7 +96,7 @@ * Introduces `NSError.toString` for better diagnostics. -## 3.6.2 +## 3.6.2 * Fixes unawaited_futures violations. diff --git a/packages/webview_flutter/webview_flutter_wkwebview/example/ios/RunnerTests/FWFDataConvertersTests.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFDataConvertersTests.m similarity index 95% rename from packages/webview_flutter/webview_flutter_wkwebview/example/ios/RunnerTests/FWFDataConvertersTests.m rename to packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFDataConvertersTests.m index a4ff58a47ea5..642c138d14ba 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/example/ios/RunnerTests/FWFDataConvertersTests.m +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFDataConvertersTests.m @@ -2,10 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -@import Flutter; @import XCTest; @import webview_flutter_wkwebview; +#if TARGET_OS_OSX +@import FlutterMacOS; +#else +@import Flutter; +#endif + #import @interface FWFDataConvertersTests : XCTestCase @@ -61,8 +66,8 @@ - (void)testFWFWKNavigationActionDataFromNavigationAction { OCMStub([mockNavigationAction navigationType]).andReturn(WKNavigationTypeReload); - NSURLRequest *request = - [NSURLRequest requestWithURL:[NSURL URLWithString:@"https://www.flutter.dev/"]]; + NSURL *testURL = [NSURL URLWithString:@"https://www.flutter.dev/"]; + NSURLRequest *request = [NSURLRequest requestWithURL:testURL]; OCMStub([mockNavigationAction request]).andReturn(request); WKFrameInfo *mockFrameInfo = OCMClassMock([WKFrameInfo class]); @@ -76,8 +81,8 @@ - (void)testFWFWKNavigationActionDataFromNavigationAction { } - (void)testFWFNSUrlRequestDataFromNSURLRequest { - NSMutableURLRequest *request = - [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://www.flutter.dev/"]]; + NSURL *testURL = [NSURL URLWithString:@"https://www.flutter.dev/"]; + NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:testURL]; request.HTTPMethod = @"POST"; request.HTTPBody = [@"aString" dataUsingEncoding:NSUTF8StringEncoding]; request.allHTTPHeaderFields = @{@"a" : @"field"}; @@ -137,7 +142,7 @@ - (void)testFWFWKSecurityOriginDataFromWKSecurityOrigin { XCTAssertEqualObjects(data.protocol, @"protocol"); } -- (void)testFWFWKPermissionDecisionFromData API_AVAILABLE(ios(15.0)) { +- (void)testFWFWKPermissionDecisionFromData API_AVAILABLE(ios(15.0), macos(12)) { XCTAssertEqual(FWFNativeWKPermissionDecisionFromData( [FWFWKPermissionDecisionData makeWithValue:FWFWKPermissionDecisionDeny]), WKPermissionDecisionDeny); @@ -149,7 +154,7 @@ - (void)testFWFWKPermissionDecisionFromData API_AVAILABLE(ios(15.0)) { WKPermissionDecisionPrompt); } -- (void)testFWFWKMediaCaptureTypeDataFromWKMediaCaptureType API_AVAILABLE(ios(15.0)) { +- (void)testFWFWKMediaCaptureTypeDataFromWKMediaCaptureType API_AVAILABLE(ios(15.0), macos(12)) { XCTAssertEqual( FWFWKMediaCaptureTypeDataFromNativeWKMediaCaptureType(WKMediaCaptureTypeCamera).value, FWFWKMediaCaptureTypeCamera); diff --git a/packages/webview_flutter/webview_flutter_wkwebview/example/ios/RunnerTests/FWFErrorTests.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFErrorTests.m similarity index 100% rename from packages/webview_flutter/webview_flutter_wkwebview/example/ios/RunnerTests/FWFErrorTests.m rename to packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFErrorTests.m diff --git a/packages/webview_flutter/webview_flutter_wkwebview/example/ios/RunnerTests/FWFHTTPCookieStoreHostApiTests.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFHTTPCookieStoreHostApiTests.m similarity index 90% rename from packages/webview_flutter/webview_flutter_wkwebview/example/ios/RunnerTests/FWFHTTPCookieStoreHostApiTests.m rename to packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFHTTPCookieStoreHostApiTests.m index 478e4fedef01..eb1e6f250ff8 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/example/ios/RunnerTests/FWFHTTPCookieStoreHostApiTests.m +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFHTTPCookieStoreHostApiTests.m @@ -2,10 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -@import Flutter; @import XCTest; @import webview_flutter_wkwebview; +#if TARGET_OS_OSX +@import FlutterMacOS; +#else +@import Flutter; +#endif + #import @interface FWFHTTPCookieStoreHostApiTests : XCTestCase @@ -47,9 +52,8 @@ - (void)testSetCookie { completion:^(FlutterError *error) { blockError = error; }]; - OCMVerify([mockHttpCookieStore - setCookie:[NSHTTPCookie cookieWithProperties:@{NSHTTPCookieName : @"hello"}] - completionHandler:OCMOCK_ANY]); + NSHTTPCookie *cookie = [NSHTTPCookie cookieWithProperties:@{NSHTTPCookieName : @"hello"}]; + OCMVerify([mockHttpCookieStore setCookie:cookie completionHandler:OCMOCK_ANY]); XCTAssertNil(blockError); } @end diff --git a/packages/webview_flutter/webview_flutter_wkwebview/example/ios/RunnerTests/FWFInstanceManagerTests.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFInstanceManagerTests.m similarity index 99% rename from packages/webview_flutter/webview_flutter_wkwebview/example/ios/RunnerTests/FWFInstanceManagerTests.m rename to packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFInstanceManagerTests.m index 24769e182f29..710dcb791b2a 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/example/ios/RunnerTests/FWFInstanceManagerTests.m +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFInstanceManagerTests.m @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#import +@import XCTest; @import webview_flutter_wkwebview; #if __has_include() diff --git a/packages/webview_flutter/webview_flutter_wkwebview/example/ios/RunnerTests/FWFNavigationDelegateHostApiTests.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFNavigationDelegateHostApiTests.m similarity index 97% rename from packages/webview_flutter/webview_flutter_wkwebview/example/ios/RunnerTests/FWFNavigationDelegateHostApiTests.m rename to packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFNavigationDelegateHostApiTests.m index 829d27643bfb..4bd8337070b4 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/example/ios/RunnerTests/FWFNavigationDelegateHostApiTests.m +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFNavigationDelegateHostApiTests.m @@ -2,10 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -@import Flutter; @import XCTest; @import webview_flutter_wkwebview; +#if TARGET_OS_OSX +@import FlutterMacOS; +#else +@import Flutter; +#endif + #import @interface FWFNavigationDelegateHostApiTests : XCTestCase @@ -117,8 +122,8 @@ - (void)testDecidePolicyForNavigationAction { [instanceManager addDartCreatedInstance:mockWebView withIdentifier:1]; WKNavigationAction *mockNavigationAction = OCMClassMock([WKNavigationAction class]); - OCMStub([mockNavigationAction request]) - .andReturn([NSURLRequest requestWithURL:[NSURL URLWithString:@"https://www.flutter.dev"]]); + NSURL *testURL = [NSURL URLWithString:@"https://www.flutter.dev"]; + OCMStub([mockNavigationAction request]).andReturn([NSURLRequest requestWithURL:testURL]); WKFrameInfo *mockFrameInfo = OCMClassMock([WKFrameInfo class]); OCMStub([mockFrameInfo isMainFrame]).andReturn(YES); @@ -258,10 +263,10 @@ - (void)testDidReceiveAuthenticationChallenge { NSURLCredential *__block callbackCredential; [mockDelegate webView:mockWebView didReceiveAuthenticationChallenge:mockChallenge - completionHandler:^(NSURLSessionAuthChallengeDisposition disposition, - NSURLCredential *credential) { - callbackDisposition = disposition; - callbackCredential = credential; + completionHandler:^(NSURLSessionAuthChallengeDisposition dispositionArg, + NSURLCredential *credentialArg) { + callbackDisposition = dispositionArg; + callbackCredential = credentialArg; }]; XCTAssertEqual(callbackDisposition, NSURLSessionAuthChallengeCancelAuthenticationChallenge); diff --git a/packages/webview_flutter/webview_flutter_wkwebview/example/ios/RunnerTests/FWFObjectHostApiTests.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFObjectHostApiTests.m similarity index 92% rename from packages/webview_flutter/webview_flutter_wkwebview/example/ios/RunnerTests/FWFObjectHostApiTests.m rename to packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFObjectHostApiTests.m index 8c0b90850a82..4b4f576ffeef 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/example/ios/RunnerTests/FWFObjectHostApiTests.m +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFObjectHostApiTests.m @@ -2,10 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -@import Flutter; @import XCTest; @import webview_flutter_wkwebview; +#if TARGET_OS_OSX +@import FlutterMacOS; +#else +@import Flutter; +#endif + #import @interface FWFObjectHostApiTests : XCTestCase @@ -139,8 +144,10 @@ - (void)testObserveValueForKeyPath { return value[0].value == FWFNSKeyValueChangeKeyEnumOldValue; }] changeValues:[OCMArg checkWithBlock:^BOOL(id value) { - FWFObjectOrIdentifier *object = (FWFObjectOrIdentifier *)value[0]; - return !object.isIdentifier && [@"key" isEqual:object.value]; + FWFObjectOrIdentifier *changeObject = + (FWFObjectOrIdentifier *)value[0]; + return !changeObject.isIdentifier && + [@"key" isEqual:changeObject.value]; }] completion:OCMOCK_ANY]); } @@ -173,8 +180,10 @@ - (void)testObserveValueForKeyPathWithIdentifier { return value[0].value == FWFNSKeyValueChangeKeyEnumOldValue; }] changeValues:[OCMArg checkWithBlock:^BOOL(id value) { - FWFObjectOrIdentifier *object = (FWFObjectOrIdentifier *)value[0]; - return object.isIdentifier && [@(2) isEqual:object.value]; + FWFObjectOrIdentifier *changeObject = + (FWFObjectOrIdentifier *)value[0]; + return changeObject.isIdentifier && + [@(2) isEqual:changeObject.value]; }] completion:OCMOCK_ANY]); } diff --git a/packages/webview_flutter/webview_flutter_wkwebview/example/ios/RunnerTests/FWFPreferencesHostApiTests.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFPreferencesHostApiTests.m similarity index 96% rename from packages/webview_flutter/webview_flutter_wkwebview/example/ios/RunnerTests/FWFPreferencesHostApiTests.m rename to packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFPreferencesHostApiTests.m index dcbe75bf58fb..f0f919619788 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/example/ios/RunnerTests/FWFPreferencesHostApiTests.m +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFPreferencesHostApiTests.m @@ -2,10 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -@import Flutter; @import XCTest; @import webview_flutter_wkwebview; +#if TARGET_OS_OSX +@import FlutterMacOS; +#else +@import Flutter; +#endif + #import @interface FWFPreferencesHostApiTests : XCTestCase diff --git a/packages/webview_flutter/webview_flutter_wkwebview/example/ios/RunnerTests/FWFScriptMessageHandlerHostApiTests.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFScriptMessageHandlerHostApiTests.m similarity index 98% rename from packages/webview_flutter/webview_flutter_wkwebview/example/ios/RunnerTests/FWFScriptMessageHandlerHostApiTests.m rename to packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFScriptMessageHandlerHostApiTests.m index fb9958726286..30064b5dfaa0 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/example/ios/RunnerTests/FWFScriptMessageHandlerHostApiTests.m +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFScriptMessageHandlerHostApiTests.m @@ -2,10 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -@import Flutter; @import XCTest; @import webview_flutter_wkwebview; +#if TARGET_OS_OSX +@import FlutterMacOS; +#else +@import Flutter; +#endif + #import @interface FWFScriptMessageHandlerHostApiTests : XCTestCase diff --git a/packages/webview_flutter/webview_flutter_wkwebview/example/ios/RunnerTests/FWFScrollViewDelegateHostApiTests.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFScrollViewDelegateHostApiTests.m similarity index 96% rename from packages/webview_flutter/webview_flutter_wkwebview/example/ios/RunnerTests/FWFScrollViewDelegateHostApiTests.m rename to packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFScrollViewDelegateHostApiTests.m index 02e89aa6cec1..21a6f4e70201 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/example/ios/RunnerTests/FWFScrollViewDelegateHostApiTests.m +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFScrollViewDelegateHostApiTests.m @@ -2,6 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "TargetConditionals.h" + +// The scroll view delegate does not exist on macOS. +#if !TARGET_OS_OSX + @import Flutter; @import XCTest; @import webview_flutter_wkwebview; @@ -80,3 +85,5 @@ - (void)testOnScrollViewDidScrollForDelegateWithIdentifier { completion:OCMOCK_ANY]); } @end + +#endif // !TARGET_OS_OSX diff --git a/packages/webview_flutter/webview_flutter_wkwebview/example/ios/RunnerTests/FWFScrollViewHostApiTests.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFScrollViewHostApiTests.m similarity index 96% rename from packages/webview_flutter/webview_flutter_wkwebview/example/ios/RunnerTests/FWFScrollViewHostApiTests.m rename to packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFScrollViewHostApiTests.m index 306fc8f9dfc4..17512ce4b5c6 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/example/ios/RunnerTests/FWFScrollViewHostApiTests.m +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFScrollViewHostApiTests.m @@ -2,6 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#import "TargetConditionals.h" + +// Scroll view APIs do not existing on macOS. +#if !TARGET_OS_OSX + @import Flutter; @import XCTest; @import webview_flutter_wkwebview; @@ -79,3 +84,5 @@ - (void)testSetDelegateForScrollView { XCTAssertNil(error); } @end + +#endif // !TARGET_OS_OSX diff --git a/packages/webview_flutter/webview_flutter_wkwebview/example/ios/RunnerTests/FWFUIDelegateHostApiTests.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFUIDelegateHostApiTests.m similarity index 96% rename from packages/webview_flutter/webview_flutter_wkwebview/example/ios/RunnerTests/FWFUIDelegateHostApiTests.m rename to packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFUIDelegateHostApiTests.m index 1c9b5f6b8a69..792d65da669e 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/example/ios/RunnerTests/FWFUIDelegateHostApiTests.m +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFUIDelegateHostApiTests.m @@ -2,13 +2,18 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -@import Flutter; @import XCTest; @import webview_flutter_wkwebview; #if __has_include() @import webview_flutter_wkwebview.Test; #endif +#if TARGET_OS_OSX +@import FlutterMacOS; +#else +@import Flutter; +#endif + #import @interface FWFUIDelegateHostApiTests : XCTestCase @@ -77,8 +82,8 @@ - (void)testOnCreateWebViewForDelegateWithIdentifier { .ignoringNonObjectArgs(); WKNavigationAction *mockNavigationAction = OCMClassMock([WKNavigationAction class]); - OCMStub([mockNavigationAction request]) - .andReturn([NSURLRequest requestWithURL:[NSURL URLWithString:@"https://www.flutter.dev"]]); + NSURL *testURL = [NSURL URLWithString:@"https://www.flutter.dev"]; + OCMStub([mockNavigationAction request]).andReturn([NSURLRequest requestWithURL:testURL]); WKFrameInfo *mockFrameInfo = OCMClassMock([WKFrameInfo class]); OCMStub([mockFrameInfo isMainFrame]).andReturn(YES); @@ -100,7 +105,7 @@ - (void)testOnCreateWebViewForDelegateWithIdentifier { completion:OCMOCK_ANY]); } -- (void)testRequestMediaCapturePermissionForOrigin API_AVAILABLE(ios(15.0)) { +- (void)testRequestMediaCapturePermissionForOrigin API_AVAILABLE(ios(15.0), macos(12)) { FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; FWFUIDelegate *mockDelegate = [self mockDelegateWithManager:instanceManager identifier:0]; diff --git a/packages/webview_flutter/webview_flutter_wkwebview/example/ios/RunnerTests/FWFUIViewHostApiTests.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFUIViewHostApiTests.m similarity index 95% rename from packages/webview_flutter/webview_flutter_wkwebview/example/ios/RunnerTests/FWFUIViewHostApiTests.m rename to packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFUIViewHostApiTests.m index d15937b1fe9c..4c2ceecfaa9e 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/example/ios/RunnerTests/FWFUIViewHostApiTests.m +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFUIViewHostApiTests.m @@ -2,6 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#import "TargetConditionals.h" + +#if !TARGET_OS_OSX + @import Flutter; @import XCTest; @import webview_flutter_wkwebview; @@ -47,3 +51,5 @@ - (void)testSetOpaque { } @end + +#endif // !TARGET_OS_OSX diff --git a/packages/webview_flutter/webview_flutter_wkwebview/example/ios/RunnerTests/FWFURLAuthenticationChallengeHostApiTests.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFURLAuthenticationChallengeHostApiTests.m similarity index 97% rename from packages/webview_flutter/webview_flutter_wkwebview/example/ios/RunnerTests/FWFURLAuthenticationChallengeHostApiTests.m rename to packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFURLAuthenticationChallengeHostApiTests.m index fc0edf9f4027..ff6fb663cf84 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/example/ios/RunnerTests/FWFURLAuthenticationChallengeHostApiTests.m +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFURLAuthenticationChallengeHostApiTests.m @@ -2,10 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -@import Flutter; @import XCTest; @import webview_flutter_wkwebview; +#if TARGET_OS_OSX +@import FlutterMacOS; +#else +@import Flutter; +#endif + #import @interface FWFURLAuthenticationChallengeHostApiTests : XCTestCase diff --git a/packages/webview_flutter/webview_flutter_wkwebview/example/ios/RunnerTests/FWFURLCredentialHostApiTests.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFURLCredentialHostApiTests.m similarity index 95% rename from packages/webview_flutter/webview_flutter_wkwebview/example/ios/RunnerTests/FWFURLCredentialHostApiTests.m rename to packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFURLCredentialHostApiTests.m index 7f3aa3426dad..bcc9f59e506c 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/example/ios/RunnerTests/FWFURLCredentialHostApiTests.m +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFURLCredentialHostApiTests.m @@ -2,10 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -@import Flutter; @import XCTest; @import webview_flutter_wkwebview; +#if TARGET_OS_OSX +@import FlutterMacOS; +#else +@import Flutter; +#endif + #import @interface FWFURLCredentialHostApiTests : XCTestCase diff --git a/packages/webview_flutter/webview_flutter_wkwebview/example/ios/RunnerTests/FWFURLProtectionSpaceHostApiTests.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFURLProtectionSpaceHostApiTests.m similarity index 97% rename from packages/webview_flutter/webview_flutter_wkwebview/example/ios/RunnerTests/FWFURLProtectionSpaceHostApiTests.m rename to packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFURLProtectionSpaceHostApiTests.m index c5a6cdf36cf1..be5738e919eb 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/example/ios/RunnerTests/FWFURLProtectionSpaceHostApiTests.m +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFURLProtectionSpaceHostApiTests.m @@ -2,10 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -@import Flutter; @import XCTest; @import webview_flutter_wkwebview; +#if TARGET_OS_OSX +@import FlutterMacOS; +#else +@import Flutter; +#endif + #import @interface FWFURLProtectionSpaceHostApiTests : XCTestCase diff --git a/packages/webview_flutter/webview_flutter_wkwebview/example/ios/RunnerTests/FWFURLTests.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFURLTests.m similarity index 96% rename from packages/webview_flutter/webview_flutter_wkwebview/example/ios/RunnerTests/FWFURLTests.m rename to packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFURLTests.m index 7e8d2ad0f129..a2e88197ca84 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/example/ios/RunnerTests/FWFURLTests.m +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFURLTests.m @@ -2,10 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -@import Flutter; @import XCTest; @import webview_flutter_wkwebview; +#if TARGET_OS_OSX +@import FlutterMacOS; +#else +@import Flutter; +#endif + #import @interface FWFURLTests : XCTestCase diff --git a/packages/webview_flutter/webview_flutter_wkwebview/example/ios/RunnerTests/FWFUserContentControllerHostApiTests.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFUserContentControllerHostApiTests.m similarity index 98% rename from packages/webview_flutter/webview_flutter_wkwebview/example/ios/RunnerTests/FWFUserContentControllerHostApiTests.m rename to packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFUserContentControllerHostApiTests.m index 38da70fd62a3..82ca3261d1a4 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/example/ios/RunnerTests/FWFUserContentControllerHostApiTests.m +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFUserContentControllerHostApiTests.m @@ -2,10 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -@import Flutter; @import XCTest; @import webview_flutter_wkwebview; +#if TARGET_OS_OSX +@import FlutterMacOS; +#else +@import Flutter; +#endif + #import @interface FWFUserContentControllerHostApiTests : XCTestCase @@ -66,7 +71,7 @@ - (void)testRemoveScriptMessageHandler { XCTAssertNil(error); } -- (void)testRemoveAllScriptMessageHandlers API_AVAILABLE(ios(14.0)) { +- (void)testRemoveAllScriptMessageHandlers API_AVAILABLE(ios(14.0), macos(11)) { WKUserContentController *mockUserContentController = OCMClassMock([WKUserContentController class]); diff --git a/packages/webview_flutter/webview_flutter_wkwebview/example/ios/RunnerTests/FWFWebViewConfigurationHostApiTests.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFWebViewConfigurationHostApiTests.m similarity index 96% rename from packages/webview_flutter/webview_flutter_wkwebview/example/ios/RunnerTests/FWFWebViewConfigurationHostApiTests.m rename to packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFWebViewConfigurationHostApiTests.m index 5670468c0439..585f4cd047c6 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/example/ios/RunnerTests/FWFWebViewConfigurationHostApiTests.m +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFWebViewConfigurationHostApiTests.m @@ -2,10 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -@import Flutter; @import XCTest; @import webview_flutter_wkwebview; +#if TARGET_OS_OSX +@import FlutterMacOS; +#else +@import Flutter; +#endif + #import @interface FWFWebViewConfigurationHostApiTests : XCTestCase @@ -56,11 +61,14 @@ - (void)testSetAllowsInlineMediaPlayback { FlutterError *error; [hostAPI setAllowsInlineMediaPlaybackForConfigurationWithIdentifier:0 isAllowed:NO error:&error]; + // setAllowsInlineMediaPlayback does not existing on macOS; the call above should no-op for macOS. +#if !TARGET_OS_OSX OCMVerify([mockWebViewConfiguration setAllowsInlineMediaPlayback:NO]); +#endif XCTAssertNil(error); } -- (void)testSetLimitsNavigationsToAppBoundDomains API_AVAILABLE(ios(14.0)) { +- (void)testSetLimitsNavigationsToAppBoundDomains API_AVAILABLE(ios(14.0), macos(11)) { WKWebViewConfiguration *mockWebViewConfiguration = OCMClassMock([WKWebViewConfiguration class]); FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; diff --git a/packages/webview_flutter/webview_flutter_wkwebview/example/ios/RunnerTests/FWFWebViewFlutterWKWebViewExternalAPITests.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFWebViewFlutterWKWebViewExternalAPITests.m similarity index 91% rename from packages/webview_flutter/webview_flutter_wkwebview/example/ios/RunnerTests/FWFWebViewFlutterWKWebViewExternalAPITests.m rename to packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFWebViewFlutterWKWebViewExternalAPITests.m index 1452edeaa647..d4137c1997be 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/example/ios/RunnerTests/FWFWebViewFlutterWKWebViewExternalAPITests.m +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFWebViewFlutterWKWebViewExternalAPITests.m @@ -2,8 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +@import XCTest; + +#if TARGET_OS_OSX +@import FlutterMacOS; +#else +@import Flutter; +#endif + #import -#import @import webview_flutter_wkwebview; diff --git a/packages/webview_flutter/webview_flutter_wkwebview/example/ios/RunnerTests/FWFWebViewHostApiTests.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFWebViewHostApiTests.m similarity index 97% rename from packages/webview_flutter/webview_flutter_wkwebview/example/ios/RunnerTests/FWFWebViewHostApiTests.m rename to packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFWebViewHostApiTests.m index 568e5fe1ed1c..49d5a20dd57c 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/example/ios/RunnerTests/FWFWebViewHostApiTests.m +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFWebViewHostApiTests.m @@ -2,13 +2,21 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -@import Flutter; @import XCTest; @import webview_flutter_wkwebview; +#if TARGET_OS_OSX +@import FlutterMacOS; +#else +@import Flutter; +#endif + #import +// Only used in !OSX test code, and causes unused function error if not ifdef'd out. +#if !TARGET_OS_OSX static bool feq(CGFloat a, CGFloat b) { return fabs(b - a) < FLT_EPSILON; } +#endif @interface FWFWebViewHostApiTests : XCTestCase @end @@ -78,8 +86,8 @@ - (void)testLoadRequestWithInvalidUrl { XCTAssertEqualObjects(error.message, @"Failed instantiating an NSURLRequest."); XCTAssertEqualObjects(error.details, @"URL was: '%invalidUrl%'"); } else { - NSMutableURLRequest *request = - [NSMutableURLRequest requestWithURL:[NSURL URLWithString:badURLString]]; + NSURL *badURL = [NSURL URLWithString:badURLString]; + NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:badURL]; OCMVerify([mockWebView loadRequest:request]); } } @@ -252,9 +260,9 @@ - (void)testLoadFlutterAsset { [hostAPI loadAssetForWebViewWithIdentifier:0 assetKey:@"assets/index.html" error:&error]; XCTAssertNil(error); - OCMVerify([mockWebView - loadFileURL:[NSURL URLWithString:@"webview_flutter/myFolder/assets/index.html"] - allowingReadAccessToURL:[NSURL URLWithString:@"webview_flutter/myFolder/assets/"]]); + NSURL *fileURL = [NSURL URLWithString:@"webview_flutter/myFolder/assets/index.html"]; + NSURL *directoryURL = [NSURL URLWithString:@"webview_flutter/myFolder/assets/"]; + OCMVerify([mockWebView loadFileURL:fileURL allowingReadAccessToURL:directoryURL]); } - (void)testCanGoForward { @@ -418,6 +426,8 @@ - (void)testEvaluateJavaScriptReturnsNSErrorData { XCTAssertEqualObjects(errorData.userInfo, @{NSLocalizedDescriptionKey : @"description"}); } +// Content inset APIs don't exist on macOS. +#if !TARGET_OS_OSX - (void)testWebViewContentInsetBehaviorShouldBeNever { FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; FWFWebViewHostApiImpl *hostAPI = [[FWFWebViewHostApiImpl alloc] @@ -471,6 +481,7 @@ - (void)testContentInsetsSumAlwaysZeroAfterSetFrame { XCTAssertTrue(feq(webView.scrollView.contentInset.bottom, -insetToAdjust.bottom)); XCTAssertTrue(CGRectEqualToRect(webView.frame, CGRectMake(0, 0, 300, 100))); } +#endif // !TARGET_OS_OSX - (void)testSetInspectable API_AVAILABLE(ios(16.4), macos(13.3)) { FWFWebView *mockWebView = OCMClassMock([FWFWebView class]); diff --git a/packages/webview_flutter/webview_flutter_wkwebview/example/ios/RunnerTests/FWFWebsiteDataStoreHostApiTests.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFWebsiteDataStoreHostApiTests.m similarity index 98% rename from packages/webview_flutter/webview_flutter_wkwebview/example/ios/RunnerTests/FWFWebsiteDataStoreHostApiTests.m rename to packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFWebsiteDataStoreHostApiTests.m index 880c81e59e95..bab732b88de2 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/example/ios/RunnerTests/FWFWebsiteDataStoreHostApiTests.m +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/Tests/FWFWebsiteDataStoreHostApiTests.m @@ -2,10 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -@import Flutter; @import XCTest; @import webview_flutter_wkwebview; +#if TARGET_OS_OSX +@import FlutterMacOS; +#else +@import Flutter; +#endif + #import @interface FWFWebsiteDataStoreHostApiTests : XCTestCase diff --git a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview.podspec b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview.podspec similarity index 90% rename from packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview.podspec rename to packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview.podspec index 1cd04956a2b2..af606661b6b5 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview.podspec +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview.podspec @@ -17,9 +17,10 @@ Downloaded by pub (not CocoaPods). s.source_files = 'webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/**/*.{h,m}' s.public_header_files = 'webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/**/*.h' s.module_map = 'webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/FlutterWebView.modulemap' - s.dependency 'Flutter' - - s.platform = :ios, '12.0' + s.ios.dependency 'Flutter' + s.osx.dependency 'FlutterMacOS' + s.ios.deployment_target = '12.0' + s.osx.deployment_target = '10.14' s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' } s.resource_bundles = {'webview_flutter_wkwebview_privacy' => ['webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/Resources/PrivacyInfo.xcprivacy']} end diff --git a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Package.swift b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Package.swift similarity index 95% rename from packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Package.swift rename to packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Package.swift index 34c2e9d1e89d..127814584215 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Package.swift +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Package.swift @@ -9,7 +9,8 @@ import PackageDescription let package = Package( name: "webview_flutter_wkwebview", platforms: [ - .iOS("12.0") + .iOS("12.0"), + .macOS("10.14"), ], products: [ .library(name: "webview-flutter-wkwebview", targets: ["webview_flutter_wkwebview"]) diff --git a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FLTWebViewFlutterPlugin.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FLTWebViewFlutterPlugin.m similarity index 93% rename from packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FLTWebViewFlutterPlugin.m rename to packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FLTWebViewFlutterPlugin.m index 15f53f7b123c..ffa5da84c408 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FLTWebViewFlutterPlugin.m +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FLTWebViewFlutterPlugin.m @@ -36,10 +36,16 @@ - (instancetype)initWithManager:(FWFInstanceManager *)manager { return self; } +#pragma mark FlutterPlatformViewFactory + - (NSObject *)createArgsCodec { return [FlutterStandardMessageCodec sharedInstance]; } +// The FlutterPlatformViewFactory protocol is slightly different on iOS and +// macOS. +#if TARGET_OS_IOS + - (NSObject *)createWithFrame:(CGRect)frame viewIdentifier:(int64_t)viewId arguments:(id _Nullable)args { @@ -50,6 +56,17 @@ - (instancetype)initWithManager:(FWFInstanceManager *)manager { return webView; } +#else + +- (nonnull NSView *)createWithViewIdentifier:(int64_t)viewId arguments:(nullable id)args { + NSNumber *identifier = (NSNumber *)args; + FWFWebView *webView = + (FWFWebView *)[self.instanceManager instanceForIdentifier:identifier.longValue]; + return webView; +} + +#endif + @end @implementation FLTWebViewFlutterPlugin @@ -88,8 +105,10 @@ + (void)registerWithRegistrar:(NSObject *)registrar { SetUpFWFWKUIDelegateHostApi(registrar.messenger, [[FWFUIDelegateHostApiImpl alloc] initWithBinaryMessenger:registrar.messenger instanceManager:instanceManager]); +#if TARGET_OS_IOS SetUpFWFUIViewHostApi(registrar.messenger, [[FWFUIViewHostApiImpl alloc] initWithInstanceManager:instanceManager]); +#endif SetUpFWFWKUserContentControllerHostApi( registrar.messenger, [[FWFUserContentControllerHostApiImpl alloc] initWithInstanceManager:instanceManager]); @@ -106,10 +125,12 @@ + (void)registerWithRegistrar:(NSObject *)registrar { SetUpFWFNSUrlHostApi(registrar.messenger, [[FWFURLHostApiImpl alloc] initWithBinaryMessenger:registrar.messenger instanceManager:instanceManager]); +#if TARGET_OS_IOS SetUpFWFUIScrollViewDelegateHostApi( registrar.messenger, [[FWFScrollViewDelegateHostApiImpl alloc] initWithBinaryMessenger:registrar.messenger instanceManager:instanceManager]); +#endif SetUpFWFNSUrlCredentialHostApi( registrar.messenger, [[FWFURLCredentialHostApiImpl alloc] initWithBinaryMessenger:registrar.messenger diff --git a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFDataConverters.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFDataConverters.m similarity index 99% rename from packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFDataConverters.m rename to packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFDataConverters.m index a91c833918ef..ba752f3a8e33 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFDataConverters.m +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFDataConverters.m @@ -4,7 +4,11 @@ #import "./include/webview_flutter_wkwebview/FWFDataConverters.h" +#if TARGET_OS_OSX +#import +#else #import +#endif NSURLRequest *_Nullable FWFNativeNSURLRequestFromRequestData(FWFNSUrlRequestData *data) { NSURL *url = [NSURL URLWithString:data.url]; @@ -83,7 +87,7 @@ NSHTTPCookiePropertyKey _Nullable FWFNativeNSHTTPCookiePropertyKeyFromEnumData( case FWFNSHttpCookiePropertyKeyEnumPort: return NSHTTPCookiePort; case FWFNSHttpCookiePropertyKeyEnumSameSitePolicy: - if (@available(iOS 13.0, *)) { + if (@available(iOS 13.0, macOS 10.15, *)) { return NSHTTPCookieSameSitePolicy; } else { return nil; diff --git a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFGeneratedWebKitApis.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFGeneratedWebKitApis.m similarity index 73% rename from packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFGeneratedWebKitApis.m rename to packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFGeneratedWebKitApis.m index 5888d87785d8..0ceb9214ddec 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFGeneratedWebKitApis.m +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFGeneratedWebKitApis.m @@ -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 (v18.0.0), do not edit directly. // See also: https://pub.dev/packages/pigeon #import "./include/webview_flutter_wkwebview/FWFGeneratedWebKitApis.h" @@ -16,6 +16,29 @@ #error File requires ARC to be enabled. #endif +static NSArray *wrapResult(id result, FlutterError *error) { + if (error) { + return @[ + error.code ?: [NSNull null], error.message ?: [NSNull null], error.details ?: [NSNull null] + ]; + } + return @[ result ?: [NSNull null] ]; +} + +static FlutterError *createConnectionError(NSString *channelName) { + return [FlutterError + errorWithCode:@"channel-error" + message:[NSString stringWithFormat:@"%@/%@/%@", + @"Unable to establish connection on channel: '", + channelName, @"'."] + details:@""]; +} + +static id GetNullableObjectAtIndex(NSArray *array, NSInteger key) { + id result = array[key]; + return (result == [NSNull null]) ? nil : result; +} + /// Mirror of NSKeyValueObservingOptions. /// /// See @@ -202,19 +225,6 @@ - (instancetype)initWithValue:(FWFNSUrlCredentialPersistence)value { } @end -static NSArray *wrapResult(id result, FlutterError *error) { - if (error) { - return @[ - error.code ?: [NSNull null], error.message ?: [NSNull null], error.details ?: [NSNull null] - ]; - } - return @[ result ?: [NSNull null] ]; -} -static id GetNullableObjectAtIndex(NSArray *array, NSInteger key) { - id result = array[key]; - return (result == [NSNull null]) ? nil : result; -} - @interface FWFNSKeyValueObservingOptionsEnumData () + (FWFNSKeyValueObservingOptionsEnumData *)fromList:(NSArray *)list; + (nullable FWFNSKeyValueObservingOptionsEnumData *)nullableFromList:(NSArray *)list; @@ -910,10 +920,22 @@ - (FlutterStandardReader *)readerWithData:(NSData *)data { void SetUpFWFWKWebsiteDataStoreHostApi(id binaryMessenger, NSObject *api) { + SetUpFWFWKWebsiteDataStoreHostApiWithSuffix(binaryMessenger, api, @""); +} + +void SetUpFWFWKWebsiteDataStoreHostApiWithSuffix(id binaryMessenger, + NSObject *api, + NSString *messageChannelSuffix) { + messageChannelSuffix = messageChannelSuffix.length > 0 + ? [NSString stringWithFormat:@".%@", messageChannelSuffix] + : @""; { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.webview_flutter_wkwebview.WKWebsiteDataStoreHostApi." - @"createFromWebViewConfiguration" + initWithName:[NSString stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.webview_flutter_wkwebview." + @"WKWebsiteDataStoreHostApi.createFromWebViewConfiguration", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FWFWKWebsiteDataStoreHostApiGetCodec()]; if (api) { @@ -939,8 +961,11 @@ void SetUpFWFWKWebsiteDataStoreHostApi(id binaryMessenge } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.webview_flutter_wkwebview.WKWebsiteDataStoreHostApi." - @"createDefaultDataStore" + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.webview_flutter_wkwebview." + @"WKWebsiteDataStoreHostApi.createDefaultDataStore", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FWFWKWebsiteDataStoreHostApiGetCodec()]; if (api) { @@ -961,8 +986,10 @@ void SetUpFWFWKWebsiteDataStoreHostApi(id binaryMessenge } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.webview_flutter_wkwebview.WKWebsiteDataStoreHostApi." - @"removeDataOfTypes" + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.webview_flutter_wkwebview." + @"WKWebsiteDataStoreHostApi.removeDataOfTypes", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FWFWKWebsiteDataStoreHostApiGetCodec()]; if (api) { @@ -999,10 +1026,21 @@ void SetUpFWFWKWebsiteDataStoreHostApi(id binaryMessenge void SetUpFWFUIViewHostApi(id binaryMessenger, NSObject *api) { + SetUpFWFUIViewHostApiWithSuffix(binaryMessenger, api, @""); +} + +void SetUpFWFUIViewHostApiWithSuffix(id binaryMessenger, + NSObject *api, + NSString *messageChannelSuffix) { + messageChannelSuffix = messageChannelSuffix.length > 0 + ? [NSString stringWithFormat:@".%@", messageChannelSuffix] + : @""; { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - @"dev.flutter.pigeon.webview_flutter_wkwebview.UIViewHostApi.setBackgroundColor" + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.webview_flutter_wkwebview." + @"UIViewHostApi.setBackgroundColor", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FWFUIViewHostApiGetCodec()]; if (api) { @@ -1025,7 +1063,10 @@ void SetUpFWFUIViewHostApi(id binaryMessenger, } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.webview_flutter_wkwebview.UIViewHostApi.setOpaque" + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.webview_flutter_wkwebview." + @"UIViewHostApi.setOpaque", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FWFUIViewHostApiGetCodec()]; if (api) { @@ -1054,10 +1095,21 @@ void SetUpFWFUIViewHostApi(id binaryMessenger, void SetUpFWFUIScrollViewHostApi(id binaryMessenger, NSObject *api) { + SetUpFWFUIScrollViewHostApiWithSuffix(binaryMessenger, api, @""); +} + +void SetUpFWFUIScrollViewHostApiWithSuffix(id binaryMessenger, + NSObject *api, + NSString *messageChannelSuffix) { + messageChannelSuffix = messageChannelSuffix.length > 0 + ? [NSString stringWithFormat:@".%@", messageChannelSuffix] + : @""; { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - @"dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewHostApi.createFromWebView" + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.webview_flutter_wkwebview." + @"UIScrollViewHostApi.createFromWebView", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FWFUIScrollViewHostApiGetCodec()]; if (api) { @@ -1082,8 +1134,10 @@ void SetUpFWFUIScrollViewHostApi(id binaryMessenger, } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - @"dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewHostApi.getContentOffset" + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.webview_flutter_wkwebview." + @"UIScrollViewHostApi.getContentOffset", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FWFUIScrollViewHostApiGetCodec()]; if (api) { @@ -1105,7 +1159,10 @@ void SetUpFWFUIScrollViewHostApi(id binaryMessenger, } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewHostApi.scrollBy" + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.webview_flutter_wkwebview." + @"UIScrollViewHostApi.scrollBy", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FWFUIScrollViewHostApiGetCodec()]; if (api) { @@ -1128,8 +1185,10 @@ void SetUpFWFUIScrollViewHostApi(id binaryMessenger, } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - @"dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewHostApi.setContentOffset" + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.webview_flutter_wkwebview." + @"UIScrollViewHostApi.setContentOffset", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FWFUIScrollViewHostApiGetCodec()]; if (api) { @@ -1156,8 +1215,10 @@ void SetUpFWFUIScrollViewHostApi(id binaryMessenger, } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - @"dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewHostApi.setDelegate" + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.webview_flutter_wkwebview." + @"UIScrollViewHostApi.setDelegate", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FWFUIScrollViewHostApiGetCodec()]; if (api) { @@ -1232,10 +1293,21 @@ - (FlutterStandardReader *)readerWithData:(NSData *)data { void SetUpFWFWKWebViewConfigurationHostApi(id binaryMessenger, NSObject *api) { + SetUpFWFWKWebViewConfigurationHostApiWithSuffix(binaryMessenger, api, @""); +} + +void SetUpFWFWKWebViewConfigurationHostApiWithSuffix( + id binaryMessenger, NSObject *api, + NSString *messageChannelSuffix) { + messageChannelSuffix = messageChannelSuffix.length > 0 + ? [NSString stringWithFormat:@".%@", messageChannelSuffix] + : @""; { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - @"dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfigurationHostApi.create" + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.webview_flutter_wkwebview." + @"WKWebViewConfigurationHostApi.create", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FWFWKWebViewConfigurationHostApiGetCodec()]; if (api) { @@ -1256,8 +1328,11 @@ void SetUpFWFWKWebViewConfigurationHostApi(id binaryMess } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.webview_flutter_wkwebview." - @"WKWebViewConfigurationHostApi.createFromWebView" + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.webview_flutter_wkwebview." + @"WKWebViewConfigurationHostApi.createFromWebView", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FWFWKWebViewConfigurationHostApiGetCodec()]; if (api) { @@ -1282,8 +1357,11 @@ void SetUpFWFWKWebViewConfigurationHostApi(id binaryMess } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.webview_flutter_wkwebview." - @"WKWebViewConfigurationHostApi.setAllowsInlineMediaPlayback" + initWithName:[NSString stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.webview_flutter_wkwebview." + @"WKWebViewConfigurationHostApi.setAllowsInlineMediaPlayback", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FWFWKWebViewConfigurationHostApiGetCodec()]; if (api) { @@ -1309,8 +1387,11 @@ void SetUpFWFWKWebViewConfigurationHostApi(id binaryMess } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.webview_flutter_wkwebview." - @"WKWebViewConfigurationHostApi.setLimitsNavigationsToAppBoundDomains" + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.webview_flutter_wkwebview." + @"WKWebViewConfigurationHostApi." + @"setLimitsNavigationsToAppBoundDomains", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FWFWKWebViewConfigurationHostApiGetCodec()]; if (api) { @@ -1337,8 +1418,11 @@ void SetUpFWFWKWebViewConfigurationHostApi(id binaryMess } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.webview_flutter_wkwebview." - @"WKWebViewConfigurationHostApi.setMediaTypesRequiringUserActionForPlayback" + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.webview_flutter_wkwebview." + @"WKWebViewConfigurationHostApi." + @"setMediaTypesRequiringUserActionForPlayback", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FWFWKWebViewConfigurationHostApiGetCodec()]; if (api) { @@ -1372,41 +1456,50 @@ void SetUpFWFWKWebViewConfigurationHostApi(id binaryMess @interface FWFWKWebViewConfigurationFlutterApi () @property(nonatomic, strong) NSObject *binaryMessenger; +@property(nonatomic, strong) NSString *messageChannelSuffix; @end @implementation FWFWKWebViewConfigurationFlutterApi - (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger { - self = [super init]; + return [self initWithBinaryMessenger:binaryMessenger messageChannelSuffix:@""]; +} +- (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger + messageChannelSuffix:(nullable NSString *)messageChannelSuffix { + self = [self init]; if (self) { _binaryMessenger = binaryMessenger; + _messageChannelSuffix = [messageChannelSuffix length] == 0 + ? @"" + : [NSString stringWithFormat:@".%@", messageChannelSuffix]; } return self; } - (void)createWithIdentifier:(NSInteger)arg_identifier completion:(void (^)(FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfigurationFlutterApi.create", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName: - @"dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfigurationFlutterApi.create" + messageChannelWithName:channelName binaryMessenger:self.binaryMessenger codec:FWFWKWebViewConfigurationFlutterApiGetCodec()]; - [channel - sendMessage:@[ @(arg_identifier) ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion([FlutterError errorWithCode:@"channel-error" - message:@"Unable to establish connection on channel." - details:@""]); - } - }]; + [channel sendMessage:@[ @(arg_identifier) ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion([FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + completion(nil); + } + } else { + completion(createConnectionError(channelName)); + } + }]; } @end @@ -1465,10 +1558,23 @@ - (FlutterStandardReader *)readerWithData:(NSData *)data { void SetUpFWFWKUserContentControllerHostApi(id binaryMessenger, NSObject *api) { + SetUpFWFWKUserContentControllerHostApiWithSuffix(binaryMessenger, api, @""); +} + +void SetUpFWFWKUserContentControllerHostApiWithSuffix( + id binaryMessenger, NSObject *api, + NSString *messageChannelSuffix) { + messageChannelSuffix = messageChannelSuffix.length > 0 + ? [NSString stringWithFormat:@".%@", messageChannelSuffix] + : @""; { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.webview_flutter_wkwebview." - @"WKUserContentControllerHostApi.createFromWebViewConfiguration" + initWithName:[NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.webview_flutter_wkwebview." + @"WKUserContentControllerHostApi.createFromWebViewConfiguration", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FWFWKUserContentControllerHostApiGetCodec()]; if (api) { @@ -1494,8 +1600,11 @@ void SetUpFWFWKUserContentControllerHostApi(id binaryMes } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.webview_flutter_wkwebview." - @"WKUserContentControllerHostApi.addScriptMessageHandler" + initWithName: + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.webview_flutter_wkwebview." + @"WKUserContentControllerHostApi.addScriptMessageHandler", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FWFWKUserContentControllerHostApiGetCodec()]; if (api) { @@ -1524,8 +1633,11 @@ void SetUpFWFWKUserContentControllerHostApi(id binaryMes } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.webview_flutter_wkwebview." - @"WKUserContentControllerHostApi.removeScriptMessageHandler" + initWithName:[NSString stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.webview_flutter_wkwebview." + @"WKUserContentControllerHostApi.removeScriptMessageHandler", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FWFWKUserContentControllerHostApiGetCodec()]; if (api) { @@ -1550,8 +1662,12 @@ void SetUpFWFWKUserContentControllerHostApi(id binaryMes } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.webview_flutter_wkwebview." - @"WKUserContentControllerHostApi.removeAllScriptMessageHandlers" + initWithName:[NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.webview_flutter_wkwebview." + @"WKUserContentControllerHostApi.removeAllScriptMessageHandlers", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FWFWKUserContentControllerHostApiGetCodec()]; if (api) { @@ -1573,8 +1689,10 @@ void SetUpFWFWKUserContentControllerHostApi(id binaryMes } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.webview_flutter_wkwebview." - @"WKUserContentControllerHostApi.addUserScript" + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.webview_flutter_wkwebview." + @"WKUserContentControllerHostApi.addUserScript", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FWFWKUserContentControllerHostApiGetCodec()]; if (api) { @@ -1599,8 +1717,11 @@ void SetUpFWFWKUserContentControllerHostApi(id binaryMes } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.webview_flutter_wkwebview." - @"WKUserContentControllerHostApi.removeAllUserScripts" + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.webview_flutter_wkwebview." + @"WKUserContentControllerHostApi.removeAllUserScripts", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FWFWKUserContentControllerHostApiGetCodec()]; if (api) { @@ -1629,10 +1750,22 @@ void SetUpFWFWKUserContentControllerHostApi(id binaryMes void SetUpFWFWKPreferencesHostApi(id binaryMessenger, NSObject *api) { + SetUpFWFWKPreferencesHostApiWithSuffix(binaryMessenger, api, @""); +} + +void SetUpFWFWKPreferencesHostApiWithSuffix(id binaryMessenger, + NSObject *api, + NSString *messageChannelSuffix) { + messageChannelSuffix = messageChannelSuffix.length > 0 + ? [NSString stringWithFormat:@".%@", messageChannelSuffix] + : @""; { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.webview_flutter_wkwebview.WKPreferencesHostApi." - @"createFromWebViewConfiguration" + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.webview_flutter_wkwebview." + @"WKPreferencesHostApi.createFromWebViewConfiguration", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FWFWKPreferencesHostApiGetCodec()]; if (api) { @@ -1658,8 +1791,10 @@ void SetUpFWFWKPreferencesHostApi(id binaryMessenger, } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.webview_flutter_wkwebview.WKPreferencesHostApi." - @"setJavaScriptEnabled" + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.webview_flutter_wkwebview." + @"WKPreferencesHostApi.setJavaScriptEnabled", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FWFWKPreferencesHostApiGetCodec()]; if (api) { @@ -1691,10 +1826,21 @@ void SetUpFWFWKPreferencesHostApi(id binaryMessenger, void SetUpFWFWKScriptMessageHandlerHostApi(id binaryMessenger, NSObject *api) { + SetUpFWFWKScriptMessageHandlerHostApiWithSuffix(binaryMessenger, api, @""); +} + +void SetUpFWFWKScriptMessageHandlerHostApiWithSuffix( + id binaryMessenger, NSObject *api, + NSString *messageChannelSuffix) { + messageChannelSuffix = messageChannelSuffix.length > 0 + ? [NSString stringWithFormat:@".%@", messageChannelSuffix] + : @""; { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - @"dev.flutter.pigeon.webview_flutter_wkwebview.WKScriptMessageHandlerHostApi.create" + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.webview_flutter_wkwebview." + @"WKScriptMessageHandlerHostApi.create", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FWFWKScriptMessageHandlerHostApiGetCodec()]; if (api) { @@ -1764,14 +1910,22 @@ - (FlutterStandardReader *)readerWithData:(NSData *)data { @interface FWFWKScriptMessageHandlerFlutterApi () @property(nonatomic, strong) NSObject *binaryMessenger; +@property(nonatomic, strong) NSString *messageChannelSuffix; @end @implementation FWFWKScriptMessageHandlerFlutterApi - (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger { - self = [super init]; + return [self initWithBinaryMessenger:binaryMessenger messageChannelSuffix:@""]; +} +- (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger + messageChannelSuffix:(nullable NSString *)messageChannelSuffix { + self = [self init]; if (self) { _binaryMessenger = binaryMessenger; + _messageChannelSuffix = [messageChannelSuffix length] == 0 + ? @"" + : [NSString stringWithFormat:@".%@", messageChannelSuffix]; } return self; } @@ -1780,30 +1934,31 @@ - (instancetype)initWithBinaryMessenger:(NSObject *)bina userContentControllerIdentifier:(NSInteger)arg_userContentControllerIdentifier message:(FWFWKScriptMessageData *)arg_message completion:(void (^)(FlutterError *_Nullable))completion { + NSString *channelName = + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.webview_flutter_wkwebview." + @"WKScriptMessageHandlerFlutterApi.didReceiveScriptMessage", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName:@"dev.flutter.pigeon.webview_flutter_wkwebview." - @"WKScriptMessageHandlerFlutterApi.didReceiveScriptMessage" + messageChannelWithName:channelName binaryMessenger:self.binaryMessenger codec:FWFWKScriptMessageHandlerFlutterApiGetCodec()]; - [channel - sendMessage:@[ - @(arg_identifier), @(arg_userContentControllerIdentifier), arg_message ?: [NSNull null] - ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion([FlutterError errorWithCode:@"channel-error" - message:@"Unable to establish connection on channel." - details:@""]); - } - }]; + [channel sendMessage:@[ + @(arg_identifier), @(arg_userContentControllerIdentifier), arg_message ?: [NSNull null] + ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion([FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + completion(nil); + } + } else { + completion(createConnectionError(channelName)); + } + }]; } @end @@ -1815,10 +1970,21 @@ - (instancetype)initWithBinaryMessenger:(NSObject *)bina void SetUpFWFWKNavigationDelegateHostApi(id binaryMessenger, NSObject *api) { + SetUpFWFWKNavigationDelegateHostApiWithSuffix(binaryMessenger, api, @""); +} + +void SetUpFWFWKNavigationDelegateHostApiWithSuffix(id binaryMessenger, + NSObject *api, + NSString *messageChannelSuffix) { + messageChannelSuffix = messageChannelSuffix.length > 0 + ? [NSString stringWithFormat:@".%@", messageChannelSuffix] + : @""; { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - @"dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegateHostApi.create" + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.webview_flutter_wkwebview." + @"WKNavigationDelegateHostApi.create", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FWFWKNavigationDelegateHostApiGetCodec()]; if (api) { @@ -1923,14 +2089,22 @@ - (FlutterStandardReader *)readerWithData:(NSData *)data { @interface FWFWKNavigationDelegateFlutterApi () @property(nonatomic, strong) NSObject *binaryMessenger; +@property(nonatomic, strong) NSString *messageChannelSuffix; @end @implementation FWFWKNavigationDelegateFlutterApi - (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger { - self = [super init]; + return [self initWithBinaryMessenger:binaryMessenger messageChannelSuffix:@""]; +} +- (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger + messageChannelSuffix:(nullable NSString *)messageChannelSuffix { + self = [self init]; if (self) { _binaryMessenger = binaryMessenger; + _messageChannelSuffix = [messageChannelSuffix length] == 0 + ? @"" + : [NSString stringWithFormat:@".%@", messageChannelSuffix]; } return self; } @@ -1938,56 +2112,58 @@ - (void)didFinishNavigationForDelegateWithIdentifier:(NSInteger)arg_identifier webViewIdentifier:(NSInteger)arg_webViewIdentifier URL:(nullable NSString *)arg_url completion:(void (^)(FlutterError *_Nullable))completion { + NSString *channelName = + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.webview_flutter_wkwebview." + @"WKNavigationDelegateFlutterApi.didFinishNavigation", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName:@"dev.flutter.pigeon.webview_flutter_wkwebview." - @"WKNavigationDelegateFlutterApi.didFinishNavigation" + messageChannelWithName:channelName binaryMessenger:self.binaryMessenger codec:FWFWKNavigationDelegateFlutterApiGetCodec()]; - [channel - sendMessage:@[ @(arg_identifier), @(arg_webViewIdentifier), arg_url ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion([FlutterError errorWithCode:@"channel-error" - message:@"Unable to establish connection on channel." - details:@""]); - } - }]; + [channel sendMessage:@[ @(arg_identifier), @(arg_webViewIdentifier), arg_url ?: [NSNull null] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion([FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + completion(nil); + } + } else { + completion(createConnectionError(channelName)); + } + }]; } - (void)didStartProvisionalNavigationForDelegateWithIdentifier:(NSInteger)arg_identifier webViewIdentifier:(NSInteger)arg_webViewIdentifier URL:(nullable NSString *)arg_url completion:(void (^)(FlutterError *_Nullable)) completion { + NSString *channelName = + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.webview_flutter_wkwebview." + @"WKNavigationDelegateFlutterApi.didStartProvisionalNavigation", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName:@"dev.flutter.pigeon.webview_flutter_wkwebview." - @"WKNavigationDelegateFlutterApi.didStartProvisionalNavigation" + messageChannelWithName:channelName binaryMessenger:self.binaryMessenger codec:FWFWKNavigationDelegateFlutterApiGetCodec()]; - [channel - sendMessage:@[ @(arg_identifier), @(arg_webViewIdentifier), arg_url ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion([FlutterError errorWithCode:@"channel-error" - message:@"Unable to establish connection on channel." - details:@""]); - } - }]; + [channel sendMessage:@[ @(arg_identifier), @(arg_webViewIdentifier), arg_url ?: [NSNull null] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion([FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + completion(nil); + } + } else { + completion(createConnectionError(channelName)); + } + }]; } - (void)decidePolicyForNavigationActionForDelegateWithIdentifier:(NSInteger)arg_identifier webViewIdentifier:(NSInteger)arg_webViewIdentifier @@ -1998,9 +2174,13 @@ - (void)decidePolicyForNavigationActionForDelegateWithIdentifier:(NSInteger)arg_ FWFWKNavigationActionPolicyEnumData *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.webview_flutter_wkwebview." + @"WKNavigationDelegateFlutterApi.decidePolicyForNavigationAction", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName:@"dev.flutter.pigeon.webview_flutter_wkwebview." - @"WKNavigationDelegateFlutterApi.decidePolicyForNavigationAction" + messageChannelWithName:channelName binaryMessenger:self.binaryMessenger codec:FWFWKNavigationDelegateFlutterApiGetCodec()]; [channel sendMessage:@[ @@ -2018,10 +2198,7 @@ - (void)decidePolicyForNavigationActionForDelegateWithIdentifier:(NSInteger)arg_ completion(output, nil); } } else { - completion(nil, [FlutterError - errorWithCode:@"channel-error" - message:@"Unable to establish connection on channel." - details:@""]); + completion(nil, createConnectionError(channelName)); } }]; } @@ -2035,9 +2212,13 @@ - (void)decidePolicyForNavigationResponseForDelegateWithIdentifier:(NSInteger)ar *_Nullable, FlutterError *_Nullable)) completion { + NSString *channelName = [NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.webview_flutter_wkwebview." + @"WKNavigationDelegateFlutterApi.decidePolicyForNavigationResponse", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName:@"dev.flutter.pigeon.webview_flutter_wkwebview." - @"WKNavigationDelegateFlutterApi.decidePolicyForNavigationResponse" + messageChannelWithName:channelName binaryMessenger:self.binaryMessenger codec:FWFWKNavigationDelegateFlutterApiGetCodec()]; [channel sendMessage:@[ @@ -2058,10 +2239,7 @@ - (void)decidePolicyForNavigationResponseForDelegateWithIdentifier:(NSInteger)ar completion(output, nil); } } else { - completion(nil, [FlutterError - errorWithCode:@"channel-error" - message:@"Unable to establish connection on channel." - details:@""]); + completion(nil, createConnectionError(channelName)); } }]; } @@ -2069,56 +2247,58 @@ - (void)didFailNavigationForDelegateWithIdentifier:(NSInteger)arg_identifier webViewIdentifier:(NSInteger)arg_webViewIdentifier error:(FWFNSErrorData *)arg_error completion:(void (^)(FlutterError *_Nullable))completion { + NSString *channelName = + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.webview_flutter_wkwebview." + @"WKNavigationDelegateFlutterApi.didFailNavigation", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName:@"dev.flutter.pigeon.webview_flutter_wkwebview." - @"WKNavigationDelegateFlutterApi.didFailNavigation" + messageChannelWithName:channelName binaryMessenger:self.binaryMessenger codec:FWFWKNavigationDelegateFlutterApiGetCodec()]; - [channel - sendMessage:@[ @(arg_identifier), @(arg_webViewIdentifier), arg_error ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion([FlutterError errorWithCode:@"channel-error" - message:@"Unable to establish connection on channel." - details:@""]); - } - }]; + [channel sendMessage:@[ @(arg_identifier), @(arg_webViewIdentifier), arg_error ?: [NSNull null] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion([FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + completion(nil); + } + } else { + completion(createConnectionError(channelName)); + } + }]; } - (void)didFailProvisionalNavigationForDelegateWithIdentifier:(NSInteger)arg_identifier webViewIdentifier:(NSInteger)arg_webViewIdentifier error:(FWFNSErrorData *)arg_error completion:(void (^)(FlutterError *_Nullable)) completion { + NSString *channelName = + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.webview_flutter_wkwebview." + @"WKNavigationDelegateFlutterApi.didFailProvisionalNavigation", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName:@"dev.flutter.pigeon.webview_flutter_wkwebview." - @"WKNavigationDelegateFlutterApi.didFailProvisionalNavigation" + messageChannelWithName:channelName binaryMessenger:self.binaryMessenger codec:FWFWKNavigationDelegateFlutterApiGetCodec()]; - [channel - sendMessage:@[ @(arg_identifier), @(arg_webViewIdentifier), arg_error ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion([FlutterError errorWithCode:@"channel-error" - message:@"Unable to establish connection on channel." - details:@""]); - } - }]; + [channel sendMessage:@[ @(arg_identifier), @(arg_webViewIdentifier), arg_error ?: [NSNull null] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion([FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + completion(nil); + } + } else { + completion(createConnectionError(channelName)); + } + }]; } - (void)webViewWebContentProcessDidTerminateForDelegateWithIdentifier:(NSInteger)arg_identifier webViewIdentifier: @@ -2126,28 +2306,29 @@ - (void)webViewWebContentProcessDidTerminateForDelegateWithIdentifier:(NSInteger completion: (void (^)(FlutterError *_Nullable)) completion { + NSString *channelName = [NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.webview_flutter_wkwebview." + @"WKNavigationDelegateFlutterApi.webViewWebContentProcessDidTerminate", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName:@"dev.flutter.pigeon.webview_flutter_wkwebview." - @"WKNavigationDelegateFlutterApi.webViewWebContentProcessDidTerminate" + messageChannelWithName:channelName binaryMessenger:self.binaryMessenger codec:FWFWKNavigationDelegateFlutterApiGetCodec()]; - [channel - sendMessage:@[ @(arg_identifier), @(arg_webViewIdentifier) ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion([FlutterError errorWithCode:@"channel-error" - message:@"Unable to establish connection on channel." - details:@""]); - } - }]; + [channel sendMessage:@[ @(arg_identifier), @(arg_webViewIdentifier) ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion([FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + completion(nil); + } + } else { + completion(createConnectionError(channelName)); + } + }]; } - (void) didReceiveAuthenticationChallengeForDelegateWithIdentifier:(NSInteger)arg_identifier @@ -2158,9 +2339,13 @@ - (void)webViewWebContentProcessDidTerminateForDelegateWithIdentifier:(NSInteger *_Nullable, FlutterError *_Nullable)) completion { + NSString *channelName = [NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.webview_flutter_wkwebview." + @"WKNavigationDelegateFlutterApi.didReceiveAuthenticationChallenge", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName:@"dev.flutter.pigeon.webview_flutter_wkwebview." - @"WKNavigationDelegateFlutterApi.didReceiveAuthenticationChallenge" + messageChannelWithName:channelName binaryMessenger:self.binaryMessenger codec:FWFWKNavigationDelegateFlutterApiGetCodec()]; [channel sendMessage:@[ @(arg_identifier), @(arg_webViewIdentifier), @(arg_challengeIdentifier) ] @@ -2176,10 +2361,7 @@ - (void)webViewWebContentProcessDidTerminateForDelegateWithIdentifier:(NSInteger completion(output, nil); } } else { - completion(nil, [FlutterError - errorWithCode:@"channel-error" - message:@"Unable to establish connection on channel." - details:@""]); + completion(nil, createConnectionError(channelName)); } }]; } @@ -2235,9 +2417,21 @@ - (FlutterStandardReader *)readerWithData:(NSData *)data { void SetUpFWFNSObjectHostApi(id binaryMessenger, NSObject *api) { + SetUpFWFNSObjectHostApiWithSuffix(binaryMessenger, api, @""); +} + +void SetUpFWFNSObjectHostApiWithSuffix(id binaryMessenger, + NSObject *api, + NSString *messageChannelSuffix) { + messageChannelSuffix = messageChannelSuffix.length > 0 + ? [NSString stringWithFormat:@".%@", messageChannelSuffix] + : @""; { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.webview_flutter_wkwebview.NSObjectHostApi.dispose" + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.webview_flutter_wkwebview." + @"NSObjectHostApi.dispose", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FWFNSObjectHostApiGetCodec()]; if (api) { @@ -2258,7 +2452,10 @@ void SetUpFWFNSObjectHostApi(id binaryMessenger, } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.webview_flutter_wkwebview.NSObjectHostApi.addObserver" + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.webview_flutter_wkwebview." + @"NSObjectHostApi.addObserver", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FWFNSObjectHostApiGetCodec()]; if (api) { @@ -2290,8 +2487,10 @@ void SetUpFWFNSObjectHostApi(id binaryMessenger, } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - @"dev.flutter.pigeon.webview_flutter_wkwebview.NSObjectHostApi.removeObserver" + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.webview_flutter_wkwebview." + @"NSObjectHostApi.removeObserver", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FWFNSObjectHostApiGetCodec()]; if (api) { @@ -2373,14 +2572,22 @@ - (FlutterStandardReader *)readerWithData:(NSData *)data { @interface FWFNSObjectFlutterApi () @property(nonatomic, strong) NSObject *binaryMessenger; +@property(nonatomic, strong) NSString *messageChannelSuffix; @end @implementation FWFNSObjectFlutterApi - (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger { - self = [super init]; + return [self initWithBinaryMessenger:binaryMessenger messageChannelSuffix:@""]; +} +- (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger + messageChannelSuffix:(nullable NSString *)messageChannelSuffix { + self = [self init]; if (self) { _binaryMessenger = binaryMessenger; + _messageChannelSuffix = [messageChannelSuffix length] == 0 + ? @"" + : [NSString stringWithFormat:@".%@", messageChannelSuffix]; } return self; } @@ -2391,56 +2598,56 @@ - (void)observeValueForObjectWithIdentifier:(NSInteger)arg_identifier (NSArray *)arg_changeKeys changeValues:(NSArray *)arg_changeValues completion:(void (^)(FlutterError *_Nullable))completion { - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName: - @"dev.flutter.pigeon.webview_flutter_wkwebview.NSObjectFlutterApi.observeValue" - binaryMessenger:self.binaryMessenger - codec:FWFNSObjectFlutterApiGetCodec()]; - [channel - sendMessage:@[ - @(arg_identifier), arg_keyPath ?: [NSNull null], @(arg_objectIdentifier), - arg_changeKeys ?: [NSNull null], arg_changeValues ?: [NSNull null] - ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion([FlutterError errorWithCode:@"channel-error" - message:@"Unable to establish connection on channel." - details:@""]); - } - }]; + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", @"dev.flutter.pigeon.webview_flutter_wkwebview.NSObjectFlutterApi.observeValue", + _messageChannelSuffix]; + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FWFNSObjectFlutterApiGetCodec()]; + [channel sendMessage:@[ + @(arg_identifier), arg_keyPath ?: [NSNull null], @(arg_objectIdentifier), + arg_changeKeys ?: [NSNull null], arg_changeValues ?: [NSNull null] + ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion([FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + completion(nil); + } + } else { + completion(createConnectionError(channelName)); + } + }]; } - (void)disposeObjectWithIdentifier:(NSInteger)arg_identifier completion:(void (^)(FlutterError *_Nullable))completion { - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName: - @"dev.flutter.pigeon.webview_flutter_wkwebview.NSObjectFlutterApi.dispose" - binaryMessenger:self.binaryMessenger - codec:FWFNSObjectFlutterApiGetCodec()]; - [channel - sendMessage:@[ @(arg_identifier) ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion([FlutterError errorWithCode:@"channel-error" - message:@"Unable to establish connection on channel." - details:@""]); - } - }]; + NSString *channelName = [NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.webview_flutter_wkwebview.NSObjectFlutterApi.dispose", + _messageChannelSuffix]; + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FWFNSObjectFlutterApiGetCodec()]; + [channel sendMessage:@[ @(arg_identifier) ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion([FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + completion(nil); + } + } else { + completion(createConnectionError(channelName)); + } + }]; } @end @@ -2594,9 +2801,21 @@ - (FlutterStandardReader *)readerWithData:(NSData *)data { void SetUpFWFWKWebViewHostApi(id binaryMessenger, NSObject *api) { + SetUpFWFWKWebViewHostApiWithSuffix(binaryMessenger, api, @""); +} + +void SetUpFWFWKWebViewHostApiWithSuffix(id binaryMessenger, + NSObject *api, + NSString *messageChannelSuffix) { + messageChannelSuffix = messageChannelSuffix.length > 0 + ? [NSString stringWithFormat:@".%@", messageChannelSuffix] + : @""; { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.create" + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.webview_flutter_wkwebview." + @"WKWebViewHostApi.create", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FWFWKWebViewHostApiGetCodec()]; if (api) { @@ -2621,8 +2840,10 @@ void SetUpFWFWKWebViewHostApi(id binaryMessenger, } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - @"dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.setUIDelegate" + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.webview_flutter_wkwebview." + @"WKWebViewHostApi.setUIDelegate", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FWFWKWebViewHostApiGetCodec()]; if (api) { @@ -2647,8 +2868,10 @@ void SetUpFWFWKWebViewHostApi(id binaryMessenger, } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi." - @"setNavigationDelegate" + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.webview_flutter_wkwebview." + @"WKWebViewHostApi.setNavigationDelegate", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FWFWKWebViewHostApiGetCodec()]; if (api) { @@ -2674,7 +2897,10 @@ void SetUpFWFWKWebViewHostApi(id binaryMessenger, } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.getUrl" + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.webview_flutter_wkwebview." + @"WKWebViewHostApi.getUrl", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FWFWKWebViewHostApiGetCodec()]; if (api) { @@ -2695,8 +2921,10 @@ void SetUpFWFWKWebViewHostApi(id binaryMessenger, } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - @"dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.getEstimatedProgress" + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.webview_flutter_wkwebview." + @"WKWebViewHostApi.getEstimatedProgress", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FWFWKWebViewHostApiGetCodec()]; if (api) { @@ -2719,7 +2947,10 @@ void SetUpFWFWKWebViewHostApi(id binaryMessenger, } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.loadRequest" + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.webview_flutter_wkwebview." + @"WKWebViewHostApi.loadRequest", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FWFWKWebViewHostApiGetCodec()]; if (api) { @@ -2742,8 +2973,10 @@ void SetUpFWFWKWebViewHostApi(id binaryMessenger, } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - @"dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.loadHtmlString" + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.webview_flutter_wkwebview." + @"WKWebViewHostApi.loadHtmlString", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FWFWKWebViewHostApiGetCodec()]; if (api) { @@ -2770,7 +3003,10 @@ void SetUpFWFWKWebViewHostApi(id binaryMessenger, } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.loadFileUrl" + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.webview_flutter_wkwebview." + @"WKWebViewHostApi.loadFileUrl", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FWFWKWebViewHostApiGetCodec()]; if (api) { @@ -2797,8 +3033,10 @@ void SetUpFWFWKWebViewHostApi(id binaryMessenger, } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - @"dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.loadFlutterAsset" + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.webview_flutter_wkwebview." + @"WKWebViewHostApi.loadFlutterAsset", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FWFWKWebViewHostApiGetCodec()]; if (api) { @@ -2821,7 +3059,10 @@ void SetUpFWFWKWebViewHostApi(id binaryMessenger, } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.canGoBack" + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.webview_flutter_wkwebview." + @"WKWebViewHostApi.canGoBack", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FWFWKWebViewHostApiGetCodec()]; if (api) { @@ -2842,8 +3083,10 @@ void SetUpFWFWKWebViewHostApi(id binaryMessenger, } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - @"dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.canGoForward" + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.webview_flutter_wkwebview." + @"WKWebViewHostApi.canGoForward", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FWFWKWebViewHostApiGetCodec()]; if (api) { @@ -2864,7 +3107,10 @@ void SetUpFWFWKWebViewHostApi(id binaryMessenger, } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.goBack" + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.webview_flutter_wkwebview." + @"WKWebViewHostApi.goBack", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FWFWKWebViewHostApiGetCodec()]; if (api) { @@ -2885,7 +3131,10 @@ void SetUpFWFWKWebViewHostApi(id binaryMessenger, } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.goForward" + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.webview_flutter_wkwebview." + @"WKWebViewHostApi.goForward", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FWFWKWebViewHostApiGetCodec()]; if (api) { @@ -2906,7 +3155,10 @@ void SetUpFWFWKWebViewHostApi(id binaryMessenger, } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.reload" + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.webview_flutter_wkwebview." + @"WKWebViewHostApi.reload", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FWFWKWebViewHostApiGetCodec()]; if (api) { @@ -2927,7 +3179,10 @@ void SetUpFWFWKWebViewHostApi(id binaryMessenger, } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.getTitle" + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.webview_flutter_wkwebview." + @"WKWebViewHostApi.getTitle", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FWFWKWebViewHostApiGetCodec()]; if (api) { @@ -2948,8 +3203,11 @@ void SetUpFWFWKWebViewHostApi(id binaryMessenger, } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi." - @"setAllowsBackForwardNavigationGestures" + initWithName:[NSString stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.webview_flutter_wkwebview." + @"WKWebViewHostApi.setAllowsBackForwardNavigationGestures", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FWFWKWebViewHostApiGetCodec()]; if (api) { @@ -2974,8 +3232,10 @@ void SetUpFWFWKWebViewHostApi(id binaryMessenger, } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - @"dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.setCustomUserAgent" + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.webview_flutter_wkwebview." + @"WKWebViewHostApi.setCustomUserAgent", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FWFWKWebViewHostApiGetCodec()]; if (api) { @@ -3000,8 +3260,10 @@ void SetUpFWFWKWebViewHostApi(id binaryMessenger, } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - @"dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.evaluateJavaScript" + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.webview_flutter_wkwebview." + @"WKWebViewHostApi.evaluateJavaScript", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FWFWKWebViewHostApiGetCodec()]; if (api) { @@ -3028,8 +3290,10 @@ void SetUpFWFWKWebViewHostApi(id binaryMessenger, } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - @"dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.setInspectable" + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.webview_flutter_wkwebview." + @"WKWebViewHostApi.setInspectable", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FWFWKWebViewHostApiGetCodec()]; if (api) { @@ -3054,8 +3318,10 @@ void SetUpFWFWKWebViewHostApi(id binaryMessenger, } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - @"dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.getCustomUserAgent" + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.webview_flutter_wkwebview." + @"WKWebViewHostApi.getCustomUserAgent", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FWFWKWebViewHostApiGetCodec()]; if (api) { @@ -3084,9 +3350,21 @@ void SetUpFWFWKWebViewHostApi(id binaryMessenger, void SetUpFWFWKUIDelegateHostApi(id binaryMessenger, NSObject *api) { + SetUpFWFWKUIDelegateHostApiWithSuffix(binaryMessenger, api, @""); +} + +void SetUpFWFWKUIDelegateHostApiWithSuffix(id binaryMessenger, + NSObject *api, + NSString *messageChannelSuffix) { + messageChannelSuffix = messageChannelSuffix.length > 0 + ? [NSString stringWithFormat:@".%@", messageChannelSuffix] + : @""; { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegateHostApi.create" + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.webview_flutter_wkwebview." + @"WKUIDelegateHostApi.create", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FWFWKUIDelegateHostApiGetCodec()]; if (api) { @@ -3181,14 +3459,22 @@ - (FlutterStandardReader *)readerWithData:(NSData *)data { @interface FWFWKUIDelegateFlutterApi () @property(nonatomic, strong) NSObject *binaryMessenger; +@property(nonatomic, strong) NSString *messageChannelSuffix; @end @implementation FWFWKUIDelegateFlutterApi - (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger { - self = [super init]; + return [self initWithBinaryMessenger:binaryMessenger messageChannelSuffix:@""]; +} +- (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger + messageChannelSuffix:(nullable NSString *)messageChannelSuffix { + self = [self init]; if (self) { _binaryMessenger = binaryMessenger; + _messageChannelSuffix = [messageChannelSuffix length] == 0 + ? @"" + : [NSString stringWithFormat:@".%@", messageChannelSuffix]; } return self; } @@ -3197,31 +3483,32 @@ - (void)onCreateWebViewForDelegateWithIdentifier:(NSInteger)arg_identifier configurationIdentifier:(NSInteger)arg_configurationIdentifier navigationAction:(FWFWKNavigationActionData *)arg_navigationAction completion:(void (^)(FlutterError *_Nullable))completion { - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName: - @"dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegateFlutterApi.onCreateWebView" - binaryMessenger:self.binaryMessenger - codec:FWFWKUIDelegateFlutterApiGetCodec()]; - [channel - sendMessage:@[ - @(arg_identifier), @(arg_webViewIdentifier), @(arg_configurationIdentifier), - arg_navigationAction ?: [NSNull null] - ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion([FlutterError errorWithCode:@"channel-error" - message:@"Unable to establish connection on channel." - details:@""]); - } - }]; + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegateFlutterApi.onCreateWebView", + _messageChannelSuffix]; + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FWFWKUIDelegateFlutterApiGetCodec()]; + [channel sendMessage:@[ + @(arg_identifier), @(arg_webViewIdentifier), @(arg_configurationIdentifier), + arg_navigationAction ?: [NSNull null] + ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion([FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + completion(nil); + } + } else { + completion(createConnectionError(channelName)); + } + }]; } - (void)requestMediaCapturePermissionForDelegateWithIdentifier:(NSInteger)arg_identifier webViewIdentifier:(NSInteger)arg_webViewIdentifier @@ -3232,44 +3519,49 @@ - (void)requestMediaCapturePermissionForDelegateWithIdentifier:(NSInteger)arg_id (void (^)( FWFWKPermissionDecisionData *_Nullable, FlutterError *_Nullable))completion { - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName:@"dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegateFlutterApi." - @"requestMediaCapturePermission" - binaryMessenger:self.binaryMessenger - codec:FWFWKUIDelegateFlutterApiGetCodec()]; - [channel - sendMessage:@[ - @(arg_identifier), @(arg_webViewIdentifier), arg_origin ?: [NSNull null], - arg_frame ?: [NSNull null], arg_type ?: [NSNull null] - ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - FWFWKPermissionDecisionData *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, - [FlutterError errorWithCode:@"channel-error" - message:@"Unable to establish connection on channel." - details:@""]); - } - }]; + NSString *channelName = + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.webview_flutter_wkwebview." + @"WKUIDelegateFlutterApi.requestMediaCapturePermission", + _messageChannelSuffix]; + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FWFWKUIDelegateFlutterApiGetCodec()]; + [channel sendMessage:@[ + @(arg_identifier), @(arg_webViewIdentifier), arg_origin ?: [NSNull null], + arg_frame ?: [NSNull null], arg_type ?: [NSNull null] + ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + FWFWKPermissionDecisionData *output = + reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; } - (void)runJavaScriptAlertPanelForDelegateWithIdentifier:(NSInteger)arg_identifier message:(NSString *)arg_message frame:(FWFWKFrameInfoData *)arg_frame completion: (void (^)(FlutterError *_Nullable))completion { - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName:@"dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegateFlutterApi." - @"runJavaScriptAlertPanel" - binaryMessenger:self.binaryMessenger - codec:FWFWKUIDelegateFlutterApiGetCodec()]; + NSString *channelName = + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.webview_flutter_wkwebview." + @"WKUIDelegateFlutterApi.runJavaScriptAlertPanel", + _messageChannelSuffix]; + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FWFWKUIDelegateFlutterApiGetCodec()]; [channel sendMessage:@[ @(arg_identifier), arg_message ?: [NSNull null], arg_frame ?: [NSNull null] ] reply:^(NSArray *reply) { @@ -3282,9 +3574,7 @@ - (void)runJavaScriptAlertPanelForDelegateWithIdentifier:(NSInteger)arg_identifi completion(nil); } } else { - completion([FlutterError errorWithCode:@"channel-error" - message:@"Unable to establish connection on channel." - details:@""]); + completion(createConnectionError(channelName)); } }]; } @@ -3294,11 +3584,15 @@ - (void)runJavaScriptConfirmPanelForDelegateWithIdentifier:(NSInteger)arg_identi completion: (void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName:@"dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegateFlutterApi." - @"runJavaScriptConfirmPanel" - binaryMessenger:self.binaryMessenger - codec:FWFWKUIDelegateFlutterApiGetCodec()]; + NSString *channelName = + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.webview_flutter_wkwebview." + @"WKUIDelegateFlutterApi.runJavaScriptConfirmPanel", + _messageChannelSuffix]; + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FWFWKUIDelegateFlutterApiGetCodec()]; [channel sendMessage:@[ @(arg_identifier), arg_message ?: [NSNull null], arg_frame ?: [NSNull null] ] reply:^(NSArray *reply) { @@ -3312,10 +3606,7 @@ - (void)runJavaScriptConfirmPanelForDelegateWithIdentifier:(NSInteger)arg_identi completion(output, nil); } } else { - completion(nil, - [FlutterError errorWithCode:@"channel-error" - message:@"Unable to establish connection on channel." - details:@""]); + completion(nil, createConnectionError(channelName)); } }]; } @@ -3326,11 +3617,15 @@ - (void)runJavaScriptTextInputPanelForDelegateWithIdentifier:(NSInteger)arg_iden completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable)) completion { - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName:@"dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegateFlutterApi." - @"runJavaScriptTextInputPanel" - binaryMessenger:self.binaryMessenger - codec:FWFWKUIDelegateFlutterApiGetCodec()]; + NSString *channelName = + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.webview_flutter_wkwebview." + @"WKUIDelegateFlutterApi.runJavaScriptTextInputPanel", + _messageChannelSuffix]; + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FWFWKUIDelegateFlutterApiGetCodec()]; [channel sendMessage:@[ @(arg_identifier), arg_prompt ?: [NSNull null], arg_defaultText ?: [NSNull null], arg_frame ?: [NSNull null] @@ -3346,10 +3641,7 @@ - (void)runJavaScriptTextInputPanelForDelegateWithIdentifier:(NSInteger)arg_iden completion(output, nil); } } else { - completion(nil, [FlutterError - errorWithCode:@"channel-error" - message:@"Unable to establish connection on channel." - details:@""]); + completion(nil, createConnectionError(channelName)); } }]; } @@ -3410,10 +3702,22 @@ - (FlutterStandardReader *)readerWithData:(NSData *)data { void SetUpFWFWKHttpCookieStoreHostApi(id binaryMessenger, NSObject *api) { + SetUpFWFWKHttpCookieStoreHostApiWithSuffix(binaryMessenger, api, @""); +} + +void SetUpFWFWKHttpCookieStoreHostApiWithSuffix(id binaryMessenger, + NSObject *api, + NSString *messageChannelSuffix) { + messageChannelSuffix = messageChannelSuffix.length > 0 + ? [NSString stringWithFormat:@".%@", messageChannelSuffix] + : @""; { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.webview_flutter_wkwebview.WKHttpCookieStoreHostApi." - @"createFromWebsiteDataStore" + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.webview_flutter_wkwebview." + @"WKHttpCookieStoreHostApi.createFromWebsiteDataStore", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FWFWKHttpCookieStoreHostApiGetCodec()]; if (api) { @@ -3438,8 +3742,10 @@ void SetUpFWFWKHttpCookieStoreHostApi(id binaryMessenger } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - @"dev.flutter.pigeon.webview_flutter_wkwebview.WKHttpCookieStoreHostApi.setCookie" + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.webview_flutter_wkwebview." + @"WKHttpCookieStoreHostApi.setCookie", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FWFWKHttpCookieStoreHostApiGetCodec()]; if (api) { @@ -3471,10 +3777,21 @@ void SetUpFWFWKHttpCookieStoreHostApi(id binaryMessenger void SetUpFWFNSUrlHostApi(id binaryMessenger, NSObject *api) { + SetUpFWFNSUrlHostApiWithSuffix(binaryMessenger, api, @""); +} + +void SetUpFWFNSUrlHostApiWithSuffix(id binaryMessenger, + NSObject *api, + NSString *messageChannelSuffix) { + messageChannelSuffix = messageChannelSuffix.length > 0 + ? [NSString stringWithFormat:@".%@", messageChannelSuffix] + : @""; { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - @"dev.flutter.pigeon.webview_flutter_wkwebview.NSUrlHostApi.getAbsoluteString" + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.webview_flutter_wkwebview." + @"NSUrlHostApi.getAbsoluteString", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FWFNSUrlHostApiGetCodec()]; if (api) { @@ -3502,40 +3819,49 @@ void SetUpFWFNSUrlHostApi(id binaryMessenger, @interface FWFNSUrlFlutterApi () @property(nonatomic, strong) NSObject *binaryMessenger; +@property(nonatomic, strong) NSString *messageChannelSuffix; @end @implementation FWFNSUrlFlutterApi - (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger { - self = [super init]; + return [self initWithBinaryMessenger:binaryMessenger messageChannelSuffix:@""]; +} +- (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger + messageChannelSuffix:(nullable NSString *)messageChannelSuffix { + self = [self init]; if (self) { _binaryMessenger = binaryMessenger; + _messageChannelSuffix = [messageChannelSuffix length] == 0 + ? @"" + : [NSString stringWithFormat:@".%@", messageChannelSuffix]; } return self; } - (void)createWithIdentifier:(NSInteger)arg_identifier completion:(void (^)(FlutterError *_Nullable))completion { - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName:@"dev.flutter.pigeon.webview_flutter_wkwebview.NSUrlFlutterApi.create" - binaryMessenger:self.binaryMessenger - codec:FWFNSUrlFlutterApiGetCodec()]; - [channel - sendMessage:@[ @(arg_identifier) ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion([FlutterError errorWithCode:@"channel-error" - message:@"Unable to establish connection on channel." - details:@""]); - } - }]; + NSString *channelName = [NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.webview_flutter_wkwebview.NSUrlFlutterApi.create", + _messageChannelSuffix]; + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FWFNSUrlFlutterApiGetCodec()]; + [channel sendMessage:@[ @(arg_identifier) ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion([FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + completion(nil); + } + } else { + completion(createConnectionError(channelName)); + } + }]; } @end @@ -3547,10 +3873,21 @@ - (void)createWithIdentifier:(NSInteger)arg_identifier void SetUpFWFUIScrollViewDelegateHostApi(id binaryMessenger, NSObject *api) { + SetUpFWFUIScrollViewDelegateHostApiWithSuffix(binaryMessenger, api, @""); +} + +void SetUpFWFUIScrollViewDelegateHostApiWithSuffix(id binaryMessenger, + NSObject *api, + NSString *messageChannelSuffix) { + messageChannelSuffix = messageChannelSuffix.length > 0 + ? [NSString stringWithFormat:@".%@", messageChannelSuffix] + : @""; { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - @"dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewDelegateHostApi.create" + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.webview_flutter_wkwebview." + @"UIScrollViewDelegateHostApi.create", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FWFUIScrollViewDelegateHostApiGetCodec()]; if (api) { @@ -3578,14 +3915,22 @@ void SetUpFWFUIScrollViewDelegateHostApi(id binaryMessen @interface FWFUIScrollViewDelegateFlutterApi () @property(nonatomic, strong) NSObject *binaryMessenger; +@property(nonatomic, strong) NSString *messageChannelSuffix; @end @implementation FWFUIScrollViewDelegateFlutterApi - (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger { - self = [super init]; + return [self initWithBinaryMessenger:binaryMessenger messageChannelSuffix:@""]; +} +- (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger + messageChannelSuffix:(nullable NSString *)messageChannelSuffix { + self = [self init]; if (self) { _binaryMessenger = binaryMessenger; + _messageChannelSuffix = [messageChannelSuffix length] == 0 + ? @"" + : [NSString stringWithFormat:@".%@", messageChannelSuffix]; } return self; } @@ -3594,28 +3939,29 @@ - (void)scrollViewDidScrollWithIdentifier:(NSInteger)arg_identifier x:(double)arg_x y:(double)arg_y completion:(void (^)(FlutterError *_Nullable))completion { + NSString *channelName = + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.webview_flutter_wkwebview." + @"UIScrollViewDelegateFlutterApi.scrollViewDidScroll", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName:@"dev.flutter.pigeon.webview_flutter_wkwebview." - @"UIScrollViewDelegateFlutterApi.scrollViewDidScroll" + messageChannelWithName:channelName binaryMessenger:self.binaryMessenger codec:FWFUIScrollViewDelegateFlutterApiGetCodec()]; - [channel - sendMessage:@[ @(arg_identifier), @(arg_uiScrollViewIdentifier), @(arg_x), @(arg_y) ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion([FlutterError errorWithCode:@"channel-error" - message:@"Unable to establish connection on channel." - details:@""]); - } - }]; + [channel sendMessage:@[ @(arg_identifier), @(arg_uiScrollViewIdentifier), @(arg_x), @(arg_y) ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion([FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + completion(nil); + } + } else { + completion(createConnectionError(channelName)); + } + }]; } @end @@ -3627,11 +3973,22 @@ - (void)scrollViewDidScrollWithIdentifier:(NSInteger)arg_identifier void SetUpFWFNSUrlCredentialHostApi(id binaryMessenger, NSObject *api) { + SetUpFWFNSUrlCredentialHostApiWithSuffix(binaryMessenger, api, @""); +} + +void SetUpFWFNSUrlCredentialHostApiWithSuffix(id binaryMessenger, + NSObject *api, + NSString *messageChannelSuffix) { + messageChannelSuffix = messageChannelSuffix.length > 0 + ? [NSString stringWithFormat:@".%@", messageChannelSuffix] + : @""; /// Create a new native instance and add it to the `InstanceManager`. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - @"dev.flutter.pigeon.webview_flutter_wkwebview.NSUrlCredentialHostApi.createWithUser" + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.webview_flutter_wkwebview." + @"NSUrlCredentialHostApi.createWithUser", + messageChannelSuffix] binaryMessenger:binaryMessenger codec:FWFNSUrlCredentialHostApiGetCodec()]; if (api) { @@ -3668,14 +4025,22 @@ void SetUpFWFNSUrlCredentialHostApi(id binaryMessenger, @interface FWFNSUrlProtectionSpaceFlutterApi () @property(nonatomic, strong) NSObject *binaryMessenger; +@property(nonatomic, strong) NSString *messageChannelSuffix; @end @implementation FWFNSUrlProtectionSpaceFlutterApi - (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger { - self = [super init]; + return [self initWithBinaryMessenger:binaryMessenger messageChannelSuffix:@""]; +} +- (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger + messageChannelSuffix:(nullable NSString *)messageChannelSuffix { + self = [self init]; if (self) { _binaryMessenger = binaryMessenger; + _messageChannelSuffix = [messageChannelSuffix length] == 0 + ? @"" + : [NSString stringWithFormat:@".%@", messageChannelSuffix]; } return self; } @@ -3684,31 +4049,32 @@ - (void)createWithIdentifier:(NSInteger)arg_identifier realm:(nullable NSString *)arg_realm authenticationMethod:(nullable NSString *)arg_authenticationMethod completion:(void (^)(FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.webview_flutter_wkwebview.NSUrlProtectionSpaceFlutterApi.create", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName: - @"dev.flutter.pigeon.webview_flutter_wkwebview.NSUrlProtectionSpaceFlutterApi.create" + messageChannelWithName:channelName binaryMessenger:self.binaryMessenger codec:FWFNSUrlProtectionSpaceFlutterApiGetCodec()]; - [channel - sendMessage:@[ - @(arg_identifier), arg_host ?: [NSNull null], arg_realm ?: [NSNull null], - arg_authenticationMethod ?: [NSNull null] - ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion([FlutterError errorWithCode:@"channel-error" - message:@"Unable to establish connection on channel." - details:@""]); - } - }]; + [channel sendMessage:@[ + @(arg_identifier), arg_host ?: [NSNull null], arg_realm ?: [NSNull null], + arg_authenticationMethod ?: [NSNull null] + ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion([FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + completion(nil); + } + } else { + completion(createConnectionError(channelName)); + } + }]; } @end @@ -3720,41 +4086,50 @@ - (void)createWithIdentifier:(NSInteger)arg_identifier @interface FWFNSUrlAuthenticationChallengeFlutterApi () @property(nonatomic, strong) NSObject *binaryMessenger; +@property(nonatomic, strong) NSString *messageChannelSuffix; @end @implementation FWFNSUrlAuthenticationChallengeFlutterApi - (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger { - self = [super init]; + return [self initWithBinaryMessenger:binaryMessenger messageChannelSuffix:@""]; +} +- (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger + messageChannelSuffix:(nullable NSString *)messageChannelSuffix { + self = [self init]; if (self) { _binaryMessenger = binaryMessenger; + _messageChannelSuffix = [messageChannelSuffix length] == 0 + ? @"" + : [NSString stringWithFormat:@".%@", messageChannelSuffix]; } return self; } - (void)createWithIdentifier:(NSInteger)arg_identifier protectionSpaceIdentifier:(NSInteger)arg_protectionSpaceIdentifier completion:(void (^)(FlutterError *_Nullable))completion { + NSString *channelName = + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.webview_flutter_wkwebview." + @"NSUrlAuthenticationChallengeFlutterApi.create", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName:@"dev.flutter.pigeon.webview_flutter_wkwebview." - @"NSUrlAuthenticationChallengeFlutterApi.create" + messageChannelWithName:channelName binaryMessenger:self.binaryMessenger codec:FWFNSUrlAuthenticationChallengeFlutterApiGetCodec()]; - [channel - sendMessage:@[ @(arg_identifier), @(arg_protectionSpaceIdentifier) ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion([FlutterError errorWithCode:@"channel-error" - message:@"Unable to establish connection on channel." - details:@""]); - } - }]; + [channel sendMessage:@[ @(arg_identifier), @(arg_protectionSpaceIdentifier) ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion([FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + completion(nil); + } + } else { + completion(createConnectionError(channelName)); + } + }]; } @end diff --git a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFHTTPCookieStoreHostApi.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFHTTPCookieStoreHostApi.m similarity index 100% rename from packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFHTTPCookieStoreHostApi.m rename to packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFHTTPCookieStoreHostApi.m diff --git a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFInstanceManager.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFInstanceManager.m similarity index 96% rename from packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFInstanceManager.m rename to packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFInstanceManager.m index 030f8eab7638..26182be6391a 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFInstanceManager.m +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFInstanceManager.m @@ -140,17 +140,17 @@ - (long)identifierWithStrongReferenceForInstance:(nonnull NSObject *)instance { NSNumber *__block identifierNumber = nil; dispatch_sync(_lockQueue, ^{ identifierNumber = [self.identifiers objectForKey:instance]; - if (identifierNumber) { + if (identifierNumber != nil) { [self.strongInstances setObject:instance forKey:identifierNumber]; } }); - return identifierNumber ? identifierNumber.longValue : NSNotFound; + return identifierNumber != nil ? identifierNumber.longValue : NSNotFound; } - (BOOL)containsInstance:(nonnull NSObject *)instance { BOOL __block containsInstance; dispatch_sync(_lockQueue, ^{ - containsInstance = [self.identifiers objectForKey:instance]; + containsInstance = [self.identifiers objectForKey:instance] != nil; }); return containsInstance; } diff --git a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFNavigationDelegateHostApi.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFNavigationDelegateHostApi.m similarity index 99% rename from packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFNavigationDelegateHostApi.m rename to packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFNavigationDelegateHostApi.m index 27743a515f0b..d862de226207 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFNavigationDelegateHostApi.m +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFNavigationDelegateHostApi.m @@ -276,7 +276,7 @@ - (void)webView:(WKWebView *)webView response.disposition); NSURLCredential *credential = - response.credentialIdentifier + response.credentialIdentifier != nil ? (NSURLCredential *)[self.navigationDelegateAPI .instanceManager instanceForIdentifier: diff --git a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFObjectHostApi.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFObjectHostApi.m similarity index 100% rename from packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFObjectHostApi.m rename to packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFObjectHostApi.m diff --git a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFPreferencesHostApi.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFPreferencesHostApi.m similarity index 90% rename from packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFPreferencesHostApi.m rename to packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFPreferencesHostApi.m index fb578a1f65e7..b2b442b3ffac 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFPreferencesHostApi.m +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFPreferencesHostApi.m @@ -39,6 +39,10 @@ - (void)createFromWebViewConfigurationWithIdentifier:(NSInteger)identifier - (void)setJavaScriptEnabledForPreferencesWithIdentifier:(NSInteger)identifier isEnabled:(BOOL)enabled error:(FlutterError *_Nullable *_Nonnull)error { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + // TODO(stuartmorgan): Replace with new API. See https://github.com/flutter/flutter/issues/125901 [[self preferencesForIdentifier:identifier] setJavaScriptEnabled:enabled]; +#pragma clang diagnostic pop } @end diff --git a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFScriptMessageHandlerHostApi.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFScriptMessageHandlerHostApi.m similarity index 100% rename from packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFScriptMessageHandlerHostApi.m rename to packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFScriptMessageHandlerHostApi.m diff --git a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFScrollViewDelegateHostApi.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFScrollViewDelegateHostApi.m similarity index 95% rename from packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFScrollViewDelegateHostApi.m rename to packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFScrollViewDelegateHostApi.m index 99275334a555..ec5e55587dc3 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFScrollViewDelegateHostApi.m +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFScrollViewDelegateHostApi.m @@ -2,6 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +// Using directory structure to remove platform-specific files doesn't work +// well with umbrella headers and module maps, so just no-op the file for +// other platforms instead. +#if TARGET_OS_IOS + #import "./include/webview_flutter_wkwebview/FWFScrollViewDelegateHostApi.h" #import "./include/webview_flutter_wkwebview/FWFWebViewHostApi.h" @@ -88,3 +93,5 @@ - (void)createWithIdentifier:(NSInteger)identifier error:(FlutterError *_Nullabl [self.instanceManager addDartCreatedInstance:uiScrollViewDelegate withIdentifier:identifier]; } @end + +#endif diff --git a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFScrollViewHostApi.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFScrollViewHostApi.m similarity index 89% rename from packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFScrollViewHostApi.m rename to packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFScrollViewHostApi.m index 8d541235b012..b57ba2a539a4 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFScrollViewHostApi.m +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFScrollViewHostApi.m @@ -24,47 +24,65 @@ - (instancetype)initWithInstanceManager:(FWFInstanceManager *)instanceManager { return self; } +#if TARGET_OS_IOS - (UIScrollView *)scrollViewForIdentifier:(NSInteger)identifier { return (UIScrollView *)[self.instanceManager instanceForIdentifier:identifier]; } +#endif - (void)createFromWebViewWithIdentifier:(NSInteger)identifier webViewIdentifier:(NSInteger)webViewIdentifier error:(FlutterError *_Nullable __autoreleasing *_Nonnull)error { +#if TARGET_OS_IOS WKWebView *webView = (WKWebView *)[self.instanceManager instanceForIdentifier:webViewIdentifier]; [self.instanceManager addDartCreatedInstance:webView.scrollView withIdentifier:identifier]; +#else + *error = [FlutterError errorWithCode:@"UnavailableApi" + message:@"scrollView is unavailable on macOS" + details:nil]; +#endif } - (NSArray *) contentOffsetForScrollViewWithIdentifier:(NSInteger)identifier error:(FlutterError *_Nullable *_Nonnull)error { +#if TARGET_OS_IOS CGPoint point = [[self scrollViewForIdentifier:identifier] contentOffset]; return @[ @(point.x), @(point.y) ]; +#else + return @[ @(0), @(0) ]; +#endif } - (void)scrollByForScrollViewWithIdentifier:(NSInteger)identifier x:(double)x y:(double)y error:(FlutterError *_Nullable *_Nonnull)error { +#if TARGET_OS_IOS UIScrollView *scrollView = [self scrollViewForIdentifier:identifier]; CGPoint contentOffset = scrollView.contentOffset; [scrollView setContentOffset:CGPointMake(contentOffset.x + x, contentOffset.y + y)]; +#endif } - (void)setContentOffsetForScrollViewWithIdentifier:(NSInteger)identifier toX:(double)x y:(double)y error:(FlutterError *_Nullable *_Nonnull)error { +#if TARGET_OS_IOS [[self scrollViewForIdentifier:identifier] setContentOffset:CGPointMake(x, y)]; +#endif } - (void)setDelegateForScrollViewWithIdentifier:(NSInteger)identifier uiScrollViewDelegateIdentifier:(nullable NSNumber *)uiScrollViewDelegateIdentifier error:(FlutterError *_Nullable *_Nonnull)error { +#if TARGET_OS_IOS [[self scrollViewForIdentifier:identifier] setDelegate:uiScrollViewDelegateIdentifier ? (FWFScrollViewDelegate *)[self.instanceManager instanceForIdentifier:uiScrollViewDelegateIdentifier.longValue] : nil]; +#endif } @end diff --git a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFUIDelegateHostApi.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFUIDelegateHostApi.m similarity index 99% rename from packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFUIDelegateHostApi.m rename to packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFUIDelegateHostApi.m index 95dc46546d96..e38635a3d218 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFUIDelegateHostApi.m +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFUIDelegateHostApi.m @@ -64,7 +64,7 @@ - (void)requestMediaCapturePermissionForDelegateWithIdentifier:(FWFUIDelegate *) type:(WKMediaCaptureType)type completion: (void (^)(WKPermissionDecision))completion - API_AVAILABLE(ios(15.0)) { + API_AVAILABLE(ios(15.0), macos(12)) { [self requestMediaCapturePermissionForDelegateWithIdentifier:[self identifierForDelegate:instance] webViewIdentifier: @@ -177,7 +177,7 @@ - (void)webView:(WKWebView *)webView initiatedByFrame:(WKFrameInfo *)frame type:(WKMediaCaptureType)type decisionHandler:(void (^)(WKPermissionDecision))decisionHandler - API_AVAILABLE(ios(15.0)) { + API_AVAILABLE(ios(15.0), macos(12)) { [self.UIDelegateAPI requestMediaCapturePermissionForDelegateWithIdentifier:self webView:webView diff --git a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFUIViewHostApi.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFUIViewHostApi.m similarity index 89% rename from packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFUIViewHostApi.m rename to packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFUIViewHostApi.m index 5cdfefecb5d2..0a2c0dcc36f8 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFUIViewHostApi.m +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFUIViewHostApi.m @@ -2,6 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +// Using directory structure to remove platform-specific files doesn't work +// well with umbrella headers and module maps, so just no-op the file for +// other platforms instead. +#if TARGET_OS_IOS + #import "./include/webview_flutter_wkwebview/FWFUIViewHostApi.h" @interface FWFUIViewHostApiImpl () @@ -42,3 +47,5 @@ - (void)setOpaqueForViewWithIdentifier:(NSInteger)identifier [[self viewForIdentifier:identifier] setOpaque:opaque]; } @end + +#endif diff --git a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFURLAuthenticationChallengeHostApi.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFURLAuthenticationChallengeHostApi.m similarity index 100% rename from packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFURLAuthenticationChallengeHostApi.m rename to packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFURLAuthenticationChallengeHostApi.m diff --git a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFURLCredentialHostApi.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFURLCredentialHostApi.m similarity index 100% rename from packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFURLCredentialHostApi.m rename to packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFURLCredentialHostApi.m diff --git a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFURLHostApi.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFURLHostApi.m similarity index 100% rename from packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFURLHostApi.m rename to packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFURLHostApi.m diff --git a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFURLProtectionSpaceHostApi.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFURLProtectionSpaceHostApi.m similarity index 100% rename from packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFURLProtectionSpaceHostApi.m rename to packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFURLProtectionSpaceHostApi.m diff --git a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFUserContentControllerHostApi.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFUserContentControllerHostApi.m similarity index 98% rename from packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFUserContentControllerHostApi.m rename to packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFUserContentControllerHostApi.m index 7e262b17ffb4..1cd80344e7f3 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFUserContentControllerHostApi.m +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFUserContentControllerHostApi.m @@ -55,12 +55,12 @@ - (void)removeAllScriptMessageHandlersForControllerWithIdentifier:(NSInteger)ide error: (FlutterError *_Nullable *_Nonnull) error { - if (@available(iOS 14.0, *)) { + if (@available(iOS 14.0, macOS 11, *)) { [[self userContentControllerForIdentifier:identifier] removeAllScriptMessageHandlers]; } else { *error = [FlutterError errorWithCode:@"FWFUnsupportedVersionError" - message:@"removeAllScriptMessageHandlers is only supported on versions 14+." + message:@"removeAllScriptMessageHandlers is only supported on iOS 14+ and macOS 11+." details:nil]; } } diff --git a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFWebViewConfigurationHostApi.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFWebViewConfigurationHostApi.m similarity index 92% rename from packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFWebViewConfigurationHostApi.m rename to packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFWebViewConfigurationHostApi.m index ee5d2d32a8c6..d97bf9bfe6ed 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFWebViewConfigurationHostApi.m +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFWebViewConfigurationHostApi.m @@ -95,21 +95,25 @@ - (void)setAllowsInlineMediaPlaybackForConfigurationWithIdentifier:(NSInteger)id error: (FlutterError *_Nullable *_Nonnull) error { +#if TARGET_OS_IOS [[self webViewConfigurationForIdentifier:identifier] setAllowsInlineMediaPlayback:allow]; +#endif + // No-op, rather than error out, on macOS, since it's not a meaningful option on macOS and it's + // easier for clients if it's just ignored. } - (void)setLimitsNavigationsToAppBoundDomainsForConfigurationWithIdentifier:(NSInteger)identifier isLimited:(BOOL)limit error:(FlutterError *_Nullable *_Nonnull)error { - if (@available(iOS 14, *)) { + if (@available(iOS 14, macOS 11, *)) { [[self webViewConfigurationForIdentifier:identifier] setLimitsNavigationsToAppBoundDomains:limit]; } else { - *error = [FlutterError - errorWithCode:@"FWFUnsupportedVersionError" - message:@"setLimitsNavigationsToAppBoundDomains is only supported on versions 14+." - details:nil]; + *error = [FlutterError errorWithCode:@"FWFUnsupportedVersionError" + message:@"setLimitsNavigationsToAppBoundDomains is only supported " + @"on iOS 14+ and macOS 11+." + details:nil]; } } diff --git a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFWebViewFlutterWKWebViewExternalAPI.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFWebViewFlutterWKWebViewExternalAPI.m similarity index 100% rename from packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFWebViewFlutterWKWebViewExternalAPI.m rename to packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFWebViewFlutterWKWebViewExternalAPI.m diff --git a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFWebViewHostApi.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFWebViewHostApi.m similarity index 99% rename from packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFWebViewHostApi.m rename to packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFWebViewHostApi.m index ee8f5131c882..2a937435c91f 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFWebViewHostApi.m +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFWebViewHostApi.m @@ -21,16 +21,19 @@ - (instancetype)initWithFrame:(CGRect)frame _objectApi = [[FWFObjectFlutterApiImpl alloc] initWithBinaryMessenger:binaryMessenger instanceManager:instanceManager]; +#if TARGET_OS_IOS self.scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever; if (@available(iOS 13.0, *)) { self.scrollView.automaticallyAdjustsScrollIndicatorInsets = NO; } +#endif } return self; } - (void)setFrame:(CGRect)frame { [super setFrame:frame]; +#if TARGET_OS_IOS // Prevents the contentInsets from being adjusted by iOS and gives control to Flutter. self.scrollView.contentInset = UIEdgeInsetsZero; @@ -42,6 +45,7 @@ - (void)setFrame:(CGRect)frame { UIEdgeInsets insetToAdjust = self.scrollView.adjustedContentInset; self.scrollView.contentInset = UIEdgeInsetsMake(-insetToAdjust.top, -insetToAdjust.left, -insetToAdjust.bottom, -insetToAdjust.right); +#endif } - (void)observeValueForKeyPath:(NSString *)keyPath @@ -57,9 +61,13 @@ - (void)observeValueForKeyPath:(NSString *)keyPath }]; } +#pragma mark FlutterPlatformView + +#if TARGET_OS_IOS - (nonnull UIView *)view { return self; } +#endif @end @interface FWFWebViewHostApiImpl () diff --git a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFWebsiteDataStoreHostApi.m b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFWebsiteDataStoreHostApi.m similarity index 100% rename from packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFWebsiteDataStoreHostApi.m rename to packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFWebsiteDataStoreHostApi.m diff --git a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/Resources/PrivacyInfo.xcprivacy b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/Resources/PrivacyInfo.xcprivacy similarity index 100% rename from packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/Resources/PrivacyInfo.xcprivacy rename to packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/Resources/PrivacyInfo.xcprivacy diff --git a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/FlutterWebView.modulemap b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/FlutterWebView.modulemap similarity index 100% rename from packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/FlutterWebView.modulemap rename to packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/FlutterWebView.modulemap diff --git a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview-umbrella.h b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview-umbrella.h similarity index 100% rename from packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview-umbrella.h rename to packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview-umbrella.h diff --git a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FLTWebViewFlutterPlugin.h b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FLTWebViewFlutterPlugin.h similarity index 82% rename from packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FLTWebViewFlutterPlugin.h rename to packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FLTWebViewFlutterPlugin.h index a1c035e40185..e57f238d9aab 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FLTWebViewFlutterPlugin.h +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FLTWebViewFlutterPlugin.h @@ -2,9 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#import #import +#if TARGET_OS_OSX +#import +#else +#import +#endif + NS_ASSUME_NONNULL_BEGIN @interface FLTWebViewFlutterPlugin : NSObject diff --git a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFDataConverters.h b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFDataConverters.h similarity index 99% rename from packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFDataConverters.h rename to packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFDataConverters.h index f97de9c8c19e..b007ff901b98 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFDataConverters.h +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFDataConverters.h @@ -175,7 +175,7 @@ extern FWFWKSecurityOriginData *FWFWKSecurityOriginDataFromNativeWKSecurityOrigi /// @param data The data object containing information to create a WKPermissionDecision. /// /// @return A WKPermissionDecision or -1 if data could not be converted. -API_AVAILABLE(ios(15.0)) +API_AVAILABLE(ios(15.0), macos(12)) extern WKPermissionDecision FWFNativeWKPermissionDecisionFromData( FWFWKPermissionDecisionData *data); @@ -184,7 +184,7 @@ extern WKPermissionDecision FWFNativeWKPermissionDecisionFromData( /// @param type The data object containing information to create a FWFWKMediaCaptureTypeData. /// /// @return A FWFWKMediaCaptureTypeData or nil if data could not be converted. -API_AVAILABLE(ios(15.0)) +API_AVAILABLE(ios(15.0), macos(12)) extern FWFWKMediaCaptureTypeData *FWFWKMediaCaptureTypeDataFromNativeWKMediaCaptureType( WKMediaCaptureType type); diff --git a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFGeneratedWebKitApis.h b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFGeneratedWebKitApis.h similarity index 92% rename from packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFGeneratedWebKitApis.h rename to packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFGeneratedWebKitApis.h index 984cfc93cc33..dd5fdf97bbcf 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFGeneratedWebKitApis.h +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFGeneratedWebKitApis.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 (v18.0.0), do not edit directly. // See also: https://pub.dev/packages/pigeon #import @@ -601,6 +601,10 @@ extern void SetUpFWFWKWebsiteDataStoreHostApi( id binaryMessenger, NSObject *_Nullable api); +extern void SetUpFWFWKWebsiteDataStoreHostApiWithSuffix( + id binaryMessenger, + NSObject *_Nullable api, NSString *messageChannelSuffix); + /// The codec used by FWFUIViewHostApi. NSObject *FWFUIViewHostApiGetCodec(void); @@ -619,6 +623,10 @@ NSObject *FWFUIViewHostApiGetCodec(void); extern void SetUpFWFUIViewHostApi(id binaryMessenger, NSObject *_Nullable api); +extern void SetUpFWFUIViewHostApiWithSuffix(id binaryMessenger, + NSObject *_Nullable api, + NSString *messageChannelSuffix); + /// The codec used by FWFUIScrollViewHostApi. NSObject *FWFUIScrollViewHostApiGetCodec(void); @@ -649,6 +657,10 @@ NSObject *FWFUIScrollViewHostApiGetCodec(void); extern void SetUpFWFUIScrollViewHostApi(id binaryMessenger, NSObject *_Nullable api); +extern void SetUpFWFUIScrollViewHostApiWithSuffix(id binaryMessenger, + NSObject *_Nullable api, + NSString *messageChannelSuffix); + /// The codec used by FWFWKWebViewConfigurationHostApi. NSObject *FWFWKWebViewConfigurationHostApiGetCodec(void); @@ -684,6 +696,10 @@ extern void SetUpFWFWKWebViewConfigurationHostApi( id binaryMessenger, NSObject *_Nullable api); +extern void SetUpFWFWKWebViewConfigurationHostApiWithSuffix( + id binaryMessenger, + NSObject *_Nullable api, NSString *messageChannelSuffix); + /// The codec used by FWFWKWebViewConfigurationFlutterApi. NSObject *FWFWKWebViewConfigurationFlutterApiGetCodec(void); @@ -692,6 +708,8 @@ NSObject *FWFWKWebViewConfigurationFlutterApiGetCodec(void) /// See https://developer.apple.com/documentation/webkit/wkwebviewconfiguration?language=objc. @interface FWFWKWebViewConfigurationFlutterApi : NSObject - (instancetype)initWithBinaryMessenger:(id)binaryMessenger; +- (instancetype)initWithBinaryMessenger:(id)binaryMessenger + messageChannelSuffix:(nullable NSString *)messageChannelSuffix; - (void)createWithIdentifier:(NSInteger)identifier completion:(void (^)(FlutterError *_Nullable))completion; @end @@ -729,6 +747,10 @@ extern void SetUpFWFWKUserContentControllerHostApi( id binaryMessenger, NSObject *_Nullable api); +extern void SetUpFWFWKUserContentControllerHostApiWithSuffix( + id binaryMessenger, + NSObject *_Nullable api, NSString *messageChannelSuffix); + /// The codec used by FWFWKPreferencesHostApi. NSObject *FWFWKPreferencesHostApiGetCodec(void); @@ -747,6 +769,10 @@ NSObject *FWFWKPreferencesHostApiGetCodec(void); extern void SetUpFWFWKPreferencesHostApi(id binaryMessenger, NSObject *_Nullable api); +extern void SetUpFWFWKPreferencesHostApiWithSuffix(id binaryMessenger, + NSObject *_Nullable api, + NSString *messageChannelSuffix); + /// The codec used by FWFWKScriptMessageHandlerHostApi. NSObject *FWFWKScriptMessageHandlerHostApiGetCodec(void); @@ -761,6 +787,10 @@ extern void SetUpFWFWKScriptMessageHandlerHostApi( id binaryMessenger, NSObject *_Nullable api); +extern void SetUpFWFWKScriptMessageHandlerHostApiWithSuffix( + id binaryMessenger, + NSObject *_Nullable api, NSString *messageChannelSuffix); + /// The codec used by FWFWKScriptMessageHandlerFlutterApi. NSObject *FWFWKScriptMessageHandlerFlutterApiGetCodec(void); @@ -769,6 +799,8 @@ NSObject *FWFWKScriptMessageHandlerFlutterApiGetCodec(void) /// See https://developer.apple.com/documentation/webkit/wkscriptmessagehandler?language=objc. @interface FWFWKScriptMessageHandlerFlutterApi : NSObject - (instancetype)initWithBinaryMessenger:(id)binaryMessenger; +- (instancetype)initWithBinaryMessenger:(id)binaryMessenger + messageChannelSuffix:(nullable NSString *)messageChannelSuffix; - (void)didReceiveScriptMessageForHandlerWithIdentifier:(NSInteger)identifier userContentControllerIdentifier:(NSInteger)userContentControllerIdentifier message:(FWFWKScriptMessageData *)message @@ -790,6 +822,10 @@ extern void SetUpFWFWKNavigationDelegateHostApi( id binaryMessenger, NSObject *_Nullable api); +extern void SetUpFWFWKNavigationDelegateHostApiWithSuffix( + id binaryMessenger, + NSObject *_Nullable api, NSString *messageChannelSuffix); + /// The codec used by FWFWKNavigationDelegateFlutterApi. NSObject *FWFWKNavigationDelegateFlutterApiGetCodec(void); @@ -798,6 +834,8 @@ NSObject *FWFWKNavigationDelegateFlutterApiGetCodec(void); /// See https://developer.apple.com/documentation/webkit/wknavigationdelegate?language=objc. @interface FWFWKNavigationDelegateFlutterApi : NSObject - (instancetype)initWithBinaryMessenger:(id)binaryMessenger; +- (instancetype)initWithBinaryMessenger:(id)binaryMessenger + messageChannelSuffix:(nullable NSString *)messageChannelSuffix; - (void)didFinishNavigationForDelegateWithIdentifier:(NSInteger)identifier webViewIdentifier:(NSInteger)webViewIdentifier URL:(nullable NSString *)url @@ -873,6 +911,10 @@ NSObject *FWFNSObjectHostApiGetCodec(void); extern void SetUpFWFNSObjectHostApi(id binaryMessenger, NSObject *_Nullable api); +extern void SetUpFWFNSObjectHostApiWithSuffix(id binaryMessenger, + NSObject *_Nullable api, + NSString *messageChannelSuffix); + /// The codec used by FWFNSObjectFlutterApi. NSObject *FWFNSObjectFlutterApiGetCodec(void); @@ -881,6 +923,8 @@ NSObject *FWFNSObjectFlutterApiGetCodec(void); /// See https://developer.apple.com/documentation/objectivec/nsobject. @interface FWFNSObjectFlutterApi : NSObject - (instancetype)initWithBinaryMessenger:(id)binaryMessenger; +- (instancetype)initWithBinaryMessenger:(id)binaryMessenger + messageChannelSuffix:(nullable NSString *)messageChannelSuffix; - (void)observeValueForObjectWithIdentifier:(NSInteger)identifier keyPath:(NSString *)keyPath objectIdentifier:(NSInteger)objectIdentifier @@ -964,6 +1008,10 @@ NSObject *FWFWKWebViewHostApiGetCodec(void); extern void SetUpFWFWKWebViewHostApi(id binaryMessenger, NSObject *_Nullable api); +extern void SetUpFWFWKWebViewHostApiWithSuffix(id binaryMessenger, + NSObject *_Nullable api, + NSString *messageChannelSuffix); + /// The codec used by FWFWKUIDelegateHostApi. NSObject *FWFWKUIDelegateHostApiGetCodec(void); @@ -977,6 +1025,10 @@ NSObject *FWFWKUIDelegateHostApiGetCodec(void); extern void SetUpFWFWKUIDelegateHostApi(id binaryMessenger, NSObject *_Nullable api); +extern void SetUpFWFWKUIDelegateHostApiWithSuffix(id binaryMessenger, + NSObject *_Nullable api, + NSString *messageChannelSuffix); + /// The codec used by FWFWKUIDelegateFlutterApi. NSObject *FWFWKUIDelegateFlutterApiGetCodec(void); @@ -985,6 +1037,8 @@ NSObject *FWFWKUIDelegateFlutterApiGetCodec(void); /// See https://developer.apple.com/documentation/webkit/wkuidelegate?language=objc. @interface FWFWKUIDelegateFlutterApi : NSObject - (instancetype)initWithBinaryMessenger:(id)binaryMessenger; +- (instancetype)initWithBinaryMessenger:(id)binaryMessenger + messageChannelSuffix:(nullable NSString *)messageChannelSuffix; - (void)onCreateWebViewForDelegateWithIdentifier:(NSInteger)identifier webViewIdentifier:(NSInteger)webViewIdentifier configurationIdentifier:(NSInteger)configurationIdentifier @@ -1041,6 +1095,10 @@ NSObject *FWFWKHttpCookieStoreHostApiGetCodec(void); extern void SetUpFWFWKHttpCookieStoreHostApi(id binaryMessenger, NSObject *_Nullable api); +extern void SetUpFWFWKHttpCookieStoreHostApiWithSuffix( + id binaryMessenger, + NSObject *_Nullable api, NSString *messageChannelSuffix); + /// The codec used by FWFNSUrlHostApi. NSObject *FWFNSUrlHostApiGetCodec(void); @@ -1060,6 +1118,10 @@ NSObject *FWFNSUrlHostApiGetCodec(void); extern void SetUpFWFNSUrlHostApi(id binaryMessenger, NSObject *_Nullable api); +extern void SetUpFWFNSUrlHostApiWithSuffix(id binaryMessenger, + NSObject *_Nullable api, + NSString *messageChannelSuffix); + /// The codec used by FWFNSUrlFlutterApi. NSObject *FWFNSUrlFlutterApiGetCodec(void); @@ -1072,6 +1134,8 @@ NSObject *FWFNSUrlFlutterApiGetCodec(void); /// See https://developer.apple.com/documentation/foundation/nsurl?language=objc. @interface FWFNSUrlFlutterApi : NSObject - (instancetype)initWithBinaryMessenger:(id)binaryMessenger; +- (instancetype)initWithBinaryMessenger:(id)binaryMessenger + messageChannelSuffix:(nullable NSString *)messageChannelSuffix; - (void)createWithIdentifier:(NSInteger)identifier completion:(void (^)(FlutterError *_Nullable))completion; @end @@ -1094,6 +1158,10 @@ extern void SetUpFWFUIScrollViewDelegateHostApi( id binaryMessenger, NSObject *_Nullable api); +extern void SetUpFWFUIScrollViewDelegateHostApiWithSuffix( + id binaryMessenger, + NSObject *_Nullable api, NSString *messageChannelSuffix); + /// The codec used by FWFUIScrollViewDelegateFlutterApi. NSObject *FWFUIScrollViewDelegateFlutterApiGetCodec(void); @@ -1102,6 +1170,8 @@ NSObject *FWFUIScrollViewDelegateFlutterApiGetCodec(void); /// See https://developer.apple.com/documentation/uikit/uiscrollviewdelegate?language=objc. @interface FWFUIScrollViewDelegateFlutterApi : NSObject - (instancetype)initWithBinaryMessenger:(id)binaryMessenger; +- (instancetype)initWithBinaryMessenger:(id)binaryMessenger + messageChannelSuffix:(nullable NSString *)messageChannelSuffix; - (void)scrollViewDidScrollWithIdentifier:(NSInteger)identifier UIScrollViewIdentifier:(NSInteger)uiScrollViewIdentifier x:(double)x @@ -1131,6 +1201,10 @@ NSObject *FWFNSUrlCredentialHostApiGetCodec(void); extern void SetUpFWFNSUrlCredentialHostApi(id binaryMessenger, NSObject *_Nullable api); +extern void SetUpFWFNSUrlCredentialHostApiWithSuffix( + id binaryMessenger, NSObject *_Nullable api, + NSString *messageChannelSuffix); + /// The codec used by FWFNSUrlProtectionSpaceFlutterApi. NSObject *FWFNSUrlProtectionSpaceFlutterApiGetCodec(void); @@ -1143,6 +1217,8 @@ NSObject *FWFNSUrlProtectionSpaceFlutterApiGetCodec(void); /// See https://developer.apple.com/documentation/foundation/nsurlprotectionspace?language=objc. @interface FWFNSUrlProtectionSpaceFlutterApi : NSObject - (instancetype)initWithBinaryMessenger:(id)binaryMessenger; +- (instancetype)initWithBinaryMessenger:(id)binaryMessenger + messageChannelSuffix:(nullable NSString *)messageChannelSuffix; /// Create a new Dart instance and add it to the `InstanceManager`. - (void)createWithIdentifier:(NSInteger)identifier host:(nullable NSString *)host @@ -1164,6 +1240,8 @@ NSObject *FWFNSUrlAuthenticationChallengeFlutterApiGetCodec /// https://developer.apple.com/documentation/foundation/nsurlauthenticationchallenge?language=objc. @interface FWFNSUrlAuthenticationChallengeFlutterApi : NSObject - (instancetype)initWithBinaryMessenger:(id)binaryMessenger; +- (instancetype)initWithBinaryMessenger:(id)binaryMessenger + messageChannelSuffix:(nullable NSString *)messageChannelSuffix; /// Create a new Dart instance and add it to the `InstanceManager`. - (void)createWithIdentifier:(NSInteger)identifier protectionSpaceIdentifier:(NSInteger)protectionSpaceIdentifier diff --git a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFHTTPCookieStoreHostApi.h b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFHTTPCookieStoreHostApi.h similarity index 90% rename from packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFHTTPCookieStoreHostApi.h rename to packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFHTTPCookieStoreHostApi.h index f1994b7705b5..bb2adfb19367 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFHTTPCookieStoreHostApi.h +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFHTTPCookieStoreHostApi.h @@ -2,9 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#import #import +#if TARGET_OS_OSX +#import +#else +#import +#endif + #import "FWFGeneratedWebKitApis.h" #import "FWFInstanceManager.h" diff --git a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFInstanceManager.h b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFInstanceManager.h similarity index 100% rename from packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFInstanceManager.h rename to packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFInstanceManager.h diff --git a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFInstanceManager_Test.h b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFInstanceManager_Test.h similarity index 100% rename from packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFInstanceManager_Test.h rename to packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFInstanceManager_Test.h diff --git a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFNavigationDelegateHostApi.h b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFNavigationDelegateHostApi.h similarity index 95% rename from packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFNavigationDelegateHostApi.h rename to packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFNavigationDelegateHostApi.h index fb4e076095d9..db1edee310e9 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFNavigationDelegateHostApi.h +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFNavigationDelegateHostApi.h @@ -2,10 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#import #import #import +#if TARGET_OS_OSX +#import +#else +#import +#endif + #import "FWFGeneratedWebKitApis.h" #import "FWFInstanceManager.h" #import "FWFObjectHostApi.h" diff --git a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFObjectHostApi.h b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFObjectHostApi.h similarity index 95% rename from packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFObjectHostApi.h rename to packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFObjectHostApi.h index 08080eb5bb8c..8bdc7f6a0c00 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFObjectHostApi.h +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFObjectHostApi.h @@ -2,7 +2,11 @@ // 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 "FWFGeneratedWebKitApis.h" #import "FWFInstanceManager.h" diff --git a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFPreferencesHostApi.h b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFPreferencesHostApi.h similarity index 90% rename from packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFPreferencesHostApi.h rename to packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFPreferencesHostApi.h index 136dccaec8cb..de2b6dd63d52 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFPreferencesHostApi.h +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFPreferencesHostApi.h @@ -2,7 +2,11 @@ // 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 #import "FWFGeneratedWebKitApis.h" diff --git a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFScriptMessageHandlerHostApi.h b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFScriptMessageHandlerHostApi.h similarity index 95% rename from packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFScriptMessageHandlerHostApi.h rename to packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFScriptMessageHandlerHostApi.h index 91e6aa01392f..2e79e40edc5d 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFScriptMessageHandlerHostApi.h +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFScriptMessageHandlerHostApi.h @@ -2,9 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#import #import +#if TARGET_OS_OSX +#import +#else +#import +#endif + #import "FWFGeneratedWebKitApis.h" #import "FWFInstanceManager.h" #import "FWFObjectHostApi.h" diff --git a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFScrollViewDelegateHostApi.h b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFScrollViewDelegateHostApi.h similarity index 88% rename from packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFScrollViewDelegateHostApi.h rename to packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFScrollViewDelegateHostApi.h index ec2237c6a0dd..5608f79114cc 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFScrollViewDelegateHostApi.h +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFScrollViewDelegateHostApi.h @@ -2,6 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +// Using directory structure to remove platform-specific files doesn't work +// well with umbrella headers and module maps, so just no-op the file for +// other platforms instead. +#if TARGET_OS_IOS + #import #import #import "FWFObjectHostApi.h" @@ -38,3 +43,5 @@ NS_ASSUME_NONNULL_BEGIN @end NS_ASSUME_NONNULL_END + +#endif diff --git a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFScrollViewHostApi.h b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFScrollViewHostApi.h similarity index 89% rename from packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFScrollViewHostApi.h rename to packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFScrollViewHostApi.h index 7d87e4d561f9..5c65e129c85c 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFScrollViewHostApi.h +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFScrollViewHostApi.h @@ -2,9 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#import #import +#if TARGET_OS_OSX +#import +#else +#import +#endif + #import "FWFGeneratedWebKitApis.h" #import "FWFInstanceManager.h" diff --git a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFUIDelegateHostApi.h b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFUIDelegateHostApi.h similarity index 95% rename from packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFUIDelegateHostApi.h rename to packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFUIDelegateHostApi.h index fd685c7b4b97..f5b52a52acf6 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFUIDelegateHostApi.h +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFUIDelegateHostApi.h @@ -2,9 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#import #import +#if TARGET_OS_OSX +#import +#else +#import +#endif + #import "FWFGeneratedWebKitApis.h" #import "FWFInstanceManager.h" #import "FWFObjectHostApi.h" diff --git a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFUIViewHostApi.h b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFUIViewHostApi.h similarity index 73% rename from packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFUIViewHostApi.h rename to packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFUIViewHostApi.h index f63119738a82..cecd2ec6d3a0 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFUIViewHostApi.h +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFUIViewHostApi.h @@ -2,6 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +// Using directory structure to remove platform-specific files doesn't work +// well with umbrella headers and module maps, so just no-op the file for +// other platforms instead. +#if TARGET_OS_IOS + #import #import "FWFGeneratedWebKitApis.h" @@ -17,3 +22,5 @@ NS_ASSUME_NONNULL_BEGIN @end NS_ASSUME_NONNULL_END + +#endif diff --git a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFURLAuthenticationChallengeHostApi.h b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFURLAuthenticationChallengeHostApi.h similarity index 94% rename from packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFURLAuthenticationChallengeHostApi.h rename to packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFURLAuthenticationChallengeHostApi.h index 2a16ff486b6d..4bc572072b2e 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFURLAuthenticationChallengeHostApi.h +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFURLAuthenticationChallengeHostApi.h @@ -2,11 +2,16 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#import #import #import "FWFGeneratedWebKitApis.h" #import "FWFInstanceManager.h" +#if TARGET_OS_OSX +#import +#else +#import +#endif + NS_ASSUME_NONNULL_BEGIN /// Flutter API implementation for `NSURLAuthenticationChallenge`. diff --git a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFURLCredentialHostApi.h b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFURLCredentialHostApi.h similarity index 92% rename from packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFURLCredentialHostApi.h rename to packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFURLCredentialHostApi.h index 3c119e552e09..3f731bdcc62b 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFURLCredentialHostApi.h +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFURLCredentialHostApi.h @@ -2,12 +2,17 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#import #import #import "FWFDataConverters.h" #import "FWFGeneratedWebKitApis.h" #import "FWFInstanceManager.h" +#if TARGET_OS_OSX +#import +#else +#import +#endif + NS_ASSUME_NONNULL_BEGIN /// Host API implementation for `NSURLCredential`. diff --git a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFURLHostApi.h b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFURLHostApi.h similarity index 95% rename from packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFURLHostApi.h rename to packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFURLHostApi.h index 919dcc5b3cf2..9238f89590b4 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFURLHostApi.h +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFURLHostApi.h @@ -2,8 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#import #import + +#if TARGET_OS_OSX +#import +#else +#import +#endif + #import "FWFGeneratedWebKitApis.h" #import "FWFInstanceManager.h" diff --git a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFURLProtectionSpaceHostApi.h b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFURLProtectionSpaceHostApi.h similarity index 94% rename from packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFURLProtectionSpaceHostApi.h rename to packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFURLProtectionSpaceHostApi.h index a4f7c537f1b5..f87e09c573ee 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFURLProtectionSpaceHostApi.h +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFURLProtectionSpaceHostApi.h @@ -2,11 +2,16 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#import #import #import "FWFGeneratedWebKitApis.h" #import "FWFInstanceManager.h" +#if TARGET_OS_OSX +#import +#else +#import +#endif + NS_ASSUME_NONNULL_BEGIN /// Flutter API implementation for `NSURLProtectionSpace`. diff --git a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFUserContentControllerHostApi.h b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFUserContentControllerHostApi.h similarity index 90% rename from packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFUserContentControllerHostApi.h rename to packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFUserContentControllerHostApi.h index 8ca3b69b6a39..0905d3c7543a 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFUserContentControllerHostApi.h +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFUserContentControllerHostApi.h @@ -2,9 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#import #import +#if TARGET_OS_OSX +#import +#else +#import +#endif + #import "FWFGeneratedWebKitApis.h" #import "FWFInstanceManager.h" diff --git a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFWebViewConfigurationHostApi.h b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFWebViewConfigurationHostApi.h similarity index 96% rename from packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFWebViewConfigurationHostApi.h rename to packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFWebViewConfigurationHostApi.h index c11ce1f29567..a5dd32a153b2 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFWebViewConfigurationHostApi.h +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFWebViewConfigurationHostApi.h @@ -2,9 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#import #import +#if TARGET_OS_OSX +#import +#else +#import +#endif + #import "FWFGeneratedWebKitApis.h" #import "FWFInstanceManager.h" #import "FWFObjectHostApi.h" diff --git a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFWebViewFlutterWKWebViewExternalAPI.h b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFWebViewFlutterWKWebViewExternalAPI.h similarity index 95% rename from packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFWebViewFlutterWKWebViewExternalAPI.h rename to packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFWebViewFlutterWKWebViewExternalAPI.h index b316f333cdde..e4e6ff3a1dea 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFWebViewFlutterWKWebViewExternalAPI.h +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFWebViewFlutterWKWebViewExternalAPI.h @@ -2,10 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#import #import #import +#if TARGET_OS_OSX +#import +#else +#import +#endif + NS_ASSUME_NONNULL_BEGIN /// App and package facing native API provided by the `webview_flutter_wkwebview` plugin. diff --git a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFWebViewHostApi.h b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFWebViewHostApi.h similarity index 85% rename from packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFWebViewHostApi.h rename to packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFWebViewHostApi.h index 037ea11f8494..2f9f28bea6c2 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFWebViewHostApi.h +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFWebViewHostApi.h @@ -2,9 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#import #import +#if TARGET_OS_OSX +#import +#else +#import +#endif + #import "FWFGeneratedWebKitApis.h" #import "FWFInstanceManager.h" #import "FWFObjectHostApi.h" @@ -19,7 +24,12 @@ NS_ASSUME_NONNULL_BEGIN @end /// Implementation of WKWebView that can be used as a FlutterPlatformView. -@interface FWFWebView : WKWebView +@interface FWFWebView : WKWebView +// The macOS platform view API doesn't have a FlutterPlatformView abstraction, +// and uses NSView directly. +#if TARGET_OS_IOS + +#endif @property(readonly, nonnull, nonatomic) FWFObjectFlutterApiImpl *objectApi; - (instancetype)initWithFrame:(CGRect)frame diff --git a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFWebsiteDataStoreHostApi.h b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFWebsiteDataStoreHostApi.h similarity index 90% rename from packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFWebsiteDataStoreHostApi.h rename to packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFWebsiteDataStoreHostApi.h index 256c3f9d41f6..a5969e5215bb 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFWebsiteDataStoreHostApi.h +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFWebsiteDataStoreHostApi.h @@ -2,9 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#import #import +#if TARGET_OS_OSX +#import +#else +#import +#endif + #import "FWFGeneratedWebKitApis.h" #import "FWFInstanceManager.h" diff --git a/packages/webview_flutter/webview_flutter_wkwebview/example/integration_test/legacy/webview_flutter_test.dart b/packages/webview_flutter/webview_flutter_wkwebview/example/integration_test/legacy/webview_flutter_test.dart index d2d3ea8f6b2e..10d6514582bf 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/example/integration_test/legacy/webview_flutter_test.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/example/integration_test/legacy/webview_flutter_test.dart @@ -22,6 +22,10 @@ import 'package:webview_flutter_wkwebview_example/legacy/navigation_decision.dar import 'package:webview_flutter_wkwebview_example/legacy/navigation_request.dart'; import 'package:webview_flutter_wkwebview_example/legacy/web_view.dart'; +// TODO(bparrishMines): Remove once https://github.com/flutter/flutter/issues/154676 +// is fixed. +const bool skipOnIosFor154676 = true; + Future main() async { IntegrationTestWidgetsFlutterBinding.ensureInitialized(); @@ -537,7 +541,7 @@ Future main() async { final String fullScreen = await controller.runJavascriptReturningResult('isFullScreen();'); expect(fullScreen, _webviewBool(false)); - }); + }, skip: Platform.isMacOS || skipOnIosFor154676); testWidgets( 'Video plays full screen when allowsInlineMediaPlayback is false', @@ -587,8 +591,10 @@ Future main() async { final String fullScreen = await controller.runJavascriptReturningResult('isFullScreen();'); expect(fullScreen, _webviewBool(true)); - }); - }); + }, skip: Platform.isMacOS || skipOnIosFor154676); + }, + // allowsInlineMediaPlayback has no effect on macOS. + skip: Platform.isMacOS); group('Audio playback policy', () { late String audioTestBase64; @@ -755,7 +761,10 @@ Future main() async { isPaused = await controller.runJavascriptReturningResult('isPaused();'); expect(isPaused, _webviewBool(false)); }); - }); + }, + // OGG playback is not supported on macOS, so the test data would need + // to be changed to support macOS. + skip: Platform.isMacOS); testWidgets('getTitle', (WidgetTester tester) async { const String getTitleTest = ''' @@ -882,7 +891,10 @@ Future main() async { expect(scrollPosX, X_SCROLL * 2); expect(scrollPosY, Y_SCROLL * 2); }); - }); + }, + // Scroll position is currently not implemented for macOS. + // Flakes on iOS: https://github.com/flutter/flutter/issues/154826 + skip: Platform.isMacOS || Platform.isIOS); group('NavigationDelegate', () { const String blankPage = ''; @@ -905,7 +917,7 @@ Future main() async { }, javascriptMode: JavascriptMode.unrestricted, navigationDelegate: (NavigationRequest request) { - return (request.url.contains('youtube.com')) + return request.url.contains('youtube.com') ? NavigationDecision.prevent : NavigationDecision.navigate; }, @@ -1035,7 +1047,7 @@ Future main() async { }, javascriptMode: JavascriptMode.unrestricted, navigationDelegate: (NavigationRequest request) { - return (request.url.contains('youtube.com')) + return request.url.contains('youtube.com') ? NavigationDecision.prevent : NavigationDecision.navigate; }, diff --git a/packages/webview_flutter/webview_flutter_wkwebview/example/integration_test/webview_flutter_test.dart b/packages/webview_flutter/webview_flutter_wkwebview/example/integration_test/webview_flutter_test.dart index 4a179696b791..84bb246580f0 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/example/integration_test/webview_flutter_test.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/example/integration_test/webview_flutter_test.dart @@ -554,7 +554,9 @@ Future main() async { final bool fullScreen = await controller .runJavaScriptReturningResult('isFullScreen();') as bool; expect(fullScreen, true); - }); + }, + // allowsInlineMediaPlayback has no effect on macOS. + skip: Platform.isMacOS); }); group('Audio playback policy', () { @@ -657,7 +659,10 @@ Future main() async { await controller.runJavaScriptReturningResult('isPaused();') as bool; expect(isPaused, true); }); - }); + }, + // OGG playback is not supported on macOS, so the test data would need + // to be changed to support macOS. + skip: Platform.isMacOS); testWidgets('getTitle', (WidgetTester tester) async { const String getTitleTest = ''' @@ -801,7 +806,10 @@ Future main() async { expect(recordedPosition?.x, X_SCROLL * 2); expect(recordedPosition?.y, Y_SCROLL * 2); }); - }); + }, + // Scroll position is currently not implemented for macOS. + // Flakes on iOS: https://github.com/flutter/flutter/issues/154826 + skip: Platform.isMacOS || Platform.isIOS); group('NavigationDelegate', () { const String blankPage = ''; @@ -821,7 +829,7 @@ Future main() async { unawaited(delegate.setOnPageFinished((_) => pageLoaded.complete())); unawaited( delegate.setOnNavigationRequest((NavigationRequest navigationRequest) { - return (navigationRequest.url.contains('youtube.com')) + return navigationRequest.url.contains('youtube.com') ? NavigationDecision.prevent : NavigationDecision.navigate; }), @@ -1078,7 +1086,7 @@ Future main() async { unawaited(delegate.setOnPageFinished((_) => pageLoaded.complete())); unawaited(delegate .setOnNavigationRequest((NavigationRequest navigationRequest) { - return (navigationRequest.url.contains('youtube.com')) + return navigationRequest.url.contains('youtube.com') ? NavigationDecision.prevent : NavigationDecision.navigate; })); diff --git a/packages/webview_flutter/webview_flutter_wkwebview/example/ios/Runner.xcodeproj/project.pbxproj b/packages/webview_flutter/webview_flutter_wkwebview/example/ios/Runner.xcodeproj/project.pbxproj index e73c47014f90..e1dd7698669f 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/example/ios/Runner.xcodeproj/project.pbxproj +++ b/packages/webview_flutter/webview_flutter_wkwebview/example/ios/Runner.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 54; + objectVersion = 60; objects = { /* Begin PBXBuildFile section */ @@ -72,7 +72,7 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 1096EF432A6BD9DB000CBDF7 /* FWFScrollViewDelegateHostApiTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FWFScrollViewDelegateHostApiTests.m; sourceTree = ""; }; + 1096EF432A6BD9DB000CBDF7 /* FWFScrollViewDelegateHostApiTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = FWFScrollViewDelegateHostApiTests.m; path = ../../darwin/Tests/FWFScrollViewDelegateHostApiTests.m; sourceTree = SOURCE_ROOT; }; 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 = ""; }; 17781D9462A1AEA7C99F8E45 /* libPods-RunnerTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RunnerTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -85,26 +85,26 @@ 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 = ""; }; - 8F4FF948299ADC2D000A6586 /* FWFWebViewFlutterWKWebViewExternalAPITests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FWFWebViewFlutterWKWebViewExternalAPITests.m; sourceTree = ""; }; - 8F4FF94A29AC223F000A6586 /* FWFURLTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FWFURLTests.m; sourceTree = ""; }; - 8F562F8F2A56C02D00C2BED6 /* FWFURLCredentialHostApiTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FWFURLCredentialHostApiTests.m; sourceTree = ""; }; - 8F562F912A56C04F00C2BED6 /* FWFURLProtectionSpaceHostApiTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FWFURLProtectionSpaceHostApiTests.m; sourceTree = ""; }; - 8F562F932A56C07B00C2BED6 /* FWFURLAuthenticationChallengeHostApiTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FWFURLAuthenticationChallengeHostApiTests.m; sourceTree = ""; }; - 8F78EAA92A02CB9100C2E520 /* FWFErrorTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FWFErrorTests.m; sourceTree = ""; }; - 8FA6A87828062CD000A4B183 /* FWFInstanceManagerTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FWFInstanceManagerTests.m; sourceTree = ""; }; - 8FB79B5228134C3100C101D3 /* FWFWebViewHostApiTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FWFWebViewHostApiTests.m; sourceTree = ""; }; - 8FB79B54281B24F600C101D3 /* FWFDataConvertersTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FWFDataConvertersTests.m; sourceTree = ""; }; - 8FB79B662820453400C101D3 /* FWFHTTPCookieStoreHostApiTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FWFHTTPCookieStoreHostApiTests.m; sourceTree = ""; }; - 8FB79B6828204E8700C101D3 /* FWFPreferencesHostApiTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FWFPreferencesHostApiTests.m; sourceTree = ""; }; - 8FB79B6A28204EE500C101D3 /* FWFWebsiteDataStoreHostApiTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FWFWebsiteDataStoreHostApiTests.m; sourceTree = ""; }; - 8FB79B6C2820533B00C101D3 /* FWFWebViewConfigurationHostApiTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FWFWebViewConfigurationHostApiTests.m; sourceTree = ""; }; - 8FB79B72282096B500C101D3 /* FWFScriptMessageHandlerHostApiTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FWFScriptMessageHandlerHostApiTests.m; sourceTree = ""; }; - 8FB79B7828209D1300C101D3 /* FWFUserContentControllerHostApiTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FWFUserContentControllerHostApiTests.m; sourceTree = ""; }; - 8FB79B822820A39300C101D3 /* FWFNavigationDelegateHostApiTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FWFNavigationDelegateHostApiTests.m; sourceTree = ""; }; - 8FB79B842820A3A400C101D3 /* FWFUIDelegateHostApiTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FWFUIDelegateHostApiTests.m; sourceTree = ""; }; - 8FB79B8E2820BAB300C101D3 /* FWFScrollViewHostApiTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FWFScrollViewHostApiTests.m; sourceTree = ""; }; - 8FB79B902820BAC700C101D3 /* FWFUIViewHostApiTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FWFUIViewHostApiTests.m; sourceTree = ""; }; - 8FB79B962821985200C101D3 /* FWFObjectHostApiTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FWFObjectHostApiTests.m; sourceTree = ""; }; + 8F4FF948299ADC2D000A6586 /* FWFWebViewFlutterWKWebViewExternalAPITests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FWFWebViewFlutterWKWebViewExternalAPITests.m; path = ../../darwin/Tests/FWFWebViewFlutterWKWebViewExternalAPITests.m; sourceTree = SOURCE_ROOT; }; + 8F4FF94A29AC223F000A6586 /* FWFURLTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = FWFURLTests.m; path = ../../darwin/Tests/FWFURLTests.m; sourceTree = SOURCE_ROOT; }; + 8F562F8F2A56C02D00C2BED6 /* FWFURLCredentialHostApiTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = FWFURLCredentialHostApiTests.m; path = ../../darwin/Tests/FWFURLCredentialHostApiTests.m; sourceTree = SOURCE_ROOT; }; + 8F562F912A56C04F00C2BED6 /* FWFURLProtectionSpaceHostApiTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = FWFURLProtectionSpaceHostApiTests.m; path = ../../darwin/Tests/FWFURLProtectionSpaceHostApiTests.m; sourceTree = SOURCE_ROOT; }; + 8F562F932A56C07B00C2BED6 /* FWFURLAuthenticationChallengeHostApiTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = FWFURLAuthenticationChallengeHostApiTests.m; path = ../../darwin/Tests/FWFURLAuthenticationChallengeHostApiTests.m; sourceTree = SOURCE_ROOT; }; + 8F78EAA92A02CB9100C2E520 /* FWFErrorTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = FWFErrorTests.m; path = ../../darwin/Tests/FWFErrorTests.m; sourceTree = SOURCE_ROOT; }; + 8FA6A87828062CD000A4B183 /* FWFInstanceManagerTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = FWFInstanceManagerTests.m; path = ../../darwin/Tests/FWFInstanceManagerTests.m; sourceTree = SOURCE_ROOT; }; + 8FB79B5228134C3100C101D3 /* FWFWebViewHostApiTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = FWFWebViewHostApiTests.m; path = ../../darwin/Tests/FWFWebViewHostApiTests.m; sourceTree = SOURCE_ROOT; }; + 8FB79B54281B24F600C101D3 /* FWFDataConvertersTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = FWFDataConvertersTests.m; path = ../../darwin/Tests/FWFDataConvertersTests.m; sourceTree = SOURCE_ROOT; }; + 8FB79B662820453400C101D3 /* FWFHTTPCookieStoreHostApiTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = FWFHTTPCookieStoreHostApiTests.m; path = ../../darwin/Tests/FWFHTTPCookieStoreHostApiTests.m; sourceTree = SOURCE_ROOT; }; + 8FB79B6828204E8700C101D3 /* FWFPreferencesHostApiTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = FWFPreferencesHostApiTests.m; path = ../../darwin/Tests/FWFPreferencesHostApiTests.m; sourceTree = SOURCE_ROOT; }; + 8FB79B6A28204EE500C101D3 /* FWFWebsiteDataStoreHostApiTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = FWFWebsiteDataStoreHostApiTests.m; path = ../../darwin/Tests/FWFWebsiteDataStoreHostApiTests.m; sourceTree = SOURCE_ROOT; }; + 8FB79B6C2820533B00C101D3 /* FWFWebViewConfigurationHostApiTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = FWFWebViewConfigurationHostApiTests.m; path = ../../darwin/Tests/FWFWebViewConfigurationHostApiTests.m; sourceTree = SOURCE_ROOT; }; + 8FB79B72282096B500C101D3 /* FWFScriptMessageHandlerHostApiTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = FWFScriptMessageHandlerHostApiTests.m; path = ../../darwin/Tests/FWFScriptMessageHandlerHostApiTests.m; sourceTree = SOURCE_ROOT; }; + 8FB79B7828209D1300C101D3 /* FWFUserContentControllerHostApiTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = FWFUserContentControllerHostApiTests.m; path = ../../darwin/Tests/FWFUserContentControllerHostApiTests.m; sourceTree = SOURCE_ROOT; }; + 8FB79B822820A39300C101D3 /* FWFNavigationDelegateHostApiTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = FWFNavigationDelegateHostApiTests.m; path = ../../darwin/Tests/FWFNavigationDelegateHostApiTests.m; sourceTree = SOURCE_ROOT; }; + 8FB79B842820A3A400C101D3 /* FWFUIDelegateHostApiTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = FWFUIDelegateHostApiTests.m; path = ../../darwin/Tests/FWFUIDelegateHostApiTests.m; sourceTree = SOURCE_ROOT; }; + 8FB79B8E2820BAB300C101D3 /* FWFScrollViewHostApiTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = FWFScrollViewHostApiTests.m; path = ../../darwin/Tests/FWFScrollViewHostApiTests.m; sourceTree = SOURCE_ROOT; }; + 8FB79B902820BAC700C101D3 /* FWFUIViewHostApiTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = FWFUIViewHostApiTests.m; path = ../../darwin/Tests/FWFUIViewHostApiTests.m; sourceTree = SOURCE_ROOT; }; + 8FB79B962821985200C101D3 /* FWFObjectHostApiTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = FWFObjectHostApiTests.m; path = ../../darwin/Tests/FWFObjectHostApiTests.m; sourceTree = SOURCE_ROOT; }; 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; }; @@ -429,10 +429,12 @@ ); inputPaths = ( "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh", + "${PODS_CONFIGURATION_BUILD_DIR}/path_provider_foundation/path_provider_foundation_privacy.bundle", "${PODS_CONFIGURATION_BUILD_DIR}/webview_flutter_wkwebview/webview_flutter_wkwebview_privacy.bundle", ); name = "[CP] Copy Pods Resources"; outputPaths = ( + "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/path_provider_foundation_privacy.bundle", "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/webview_flutter_wkwebview_privacy.bundle", ); runOnlyForDeploymentPostprocessing = 0; diff --git a/packages/webview_flutter/webview_flutter_wkwebview/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/packages/webview_flutter/webview_flutter_wkwebview/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index eb87ae849c45..65b8955c3c62 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/packages/webview_flutter/webview_flutter_wkwebview/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -5,6 +5,24 @@ + + + + + + + + + + - - - - - - -

Click the following button to see the effect

-
+ alert(inputString); + } + + + + +

Click the following button to see the effect

+ - - -
- - + + + + + '''; class WebViewExample extends StatefulWidget { @@ -160,7 +160,6 @@ class _WebViewExampleState extends State { WebKitWebViewControllerCreationParams(allowsInlineMediaPlayback: true), ) ..setJavaScriptMode(JavaScriptMode.unrestricted) - ..setBackgroundColor(const Color(0x80000000)) ..setPlatformNavigationDelegate( PlatformNavigationDelegate( const PlatformNavigationDelegateCreationParams(), @@ -220,12 +219,19 @@ Page resource error: ) ..loadRequest(LoadRequestParams( uri: Uri.parse('https://flutter.dev'), - )) - ..setOnScrollPositionChange((ScrollPositionChange scrollPositionChange) { + )); + + // setBackgroundColor and setOnScrollPositionChange are not supported on + // macOS. + if (Platform.isIOS) { + _controller.setBackgroundColor(const Color(0x80000000)); + _controller.setOnScrollPositionChange( + (ScrollPositionChange scrollPositionChange) { debugPrint( 'Scroll position change to x = ${scrollPositionChange.x}, y = ${scrollPositionChange.y}', ); }); + } } @override diff --git a/packages/webview_flutter/webview_flutter_wkwebview/example/macos/.gitignore b/packages/webview_flutter/webview_flutter_wkwebview/example/macos/.gitignore new file mode 100644 index 000000000000..746adbb6b9e1 --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/example/macos/.gitignore @@ -0,0 +1,7 @@ +# Flutter-related +**/Flutter/ephemeral/ +**/Pods/ + +# Xcode-related +**/dgph +**/xcuserdata/ diff --git a/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Flutter/Flutter-Debug.xcconfig b/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Flutter/Flutter-Debug.xcconfig new file mode 100644 index 000000000000..4b81f9b2d200 --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Flutter/Flutter-Debug.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" +#include "ephemeral/Flutter-Generated.xcconfig" diff --git a/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Flutter/Flutter-Release.xcconfig b/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Flutter/Flutter-Release.xcconfig new file mode 100644 index 000000000000..5caa9d1579e4 --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Flutter/Flutter-Release.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" +#include "ephemeral/Flutter-Generated.xcconfig" diff --git a/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Podfile b/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Podfile new file mode 100644 index 000000000000..c795730db8ed --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Podfile @@ -0,0 +1,43 @@ +platform :osx, '10.14' + +# 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 +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_macos_build_settings(target) + end +end diff --git a/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Runner.xcodeproj/project.pbxproj b/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Runner.xcodeproj/project.pbxproj new file mode 100644 index 000000000000..264cd2e6145f --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,902 @@ +// !$*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 */; }; + 337257E82C626C94005E6518 /* OCMock in Frameworks */ = {isa = PBXBuildFile; productRef = 337257E72C626C94005E6518 /* OCMock */; }; + 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 */; }; + 33CF716F2C090A5900FB3AA4 /* FWFURLProtectionSpaceHostApiTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 33CF715A2C090A5800FB3AA4 /* FWFURLProtectionSpaceHostApiTests.m */; }; + 33CF71702C090A5900FB3AA4 /* FWFUIDelegateHostApiTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 33CF715B2C090A5800FB3AA4 /* FWFUIDelegateHostApiTests.m */; }; + 33CF71712C090A5900FB3AA4 /* FWFErrorTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 33CF715C2C090A5800FB3AA4 /* FWFErrorTests.m */; }; + 33CF71722C090A5900FB3AA4 /* FWFUIViewHostApiTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 33CF715D2C090A5800FB3AA4 /* FWFUIViewHostApiTests.m */; }; + 33CF71732C090A5900FB3AA4 /* FWFDataConvertersTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 33CF715E2C090A5800FB3AA4 /* FWFDataConvertersTests.m */; }; + 33CF71742C090A5900FB3AA4 /* FWFURLCredentialHostApiTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 33CF715F2C090A5800FB3AA4 /* FWFURLCredentialHostApiTests.m */; }; + 33CF71752C090A5900FB3AA4 /* FWFWebViewFlutterWKWebViewExternalAPITests.m in Sources */ = {isa = PBXBuildFile; fileRef = 33CF71602C090A5800FB3AA4 /* FWFWebViewFlutterWKWebViewExternalAPITests.m */; }; + 33CF71762C090A5900FB3AA4 /* FWFPreferencesHostApiTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 33CF71612C090A5800FB3AA4 /* FWFPreferencesHostApiTests.m */; }; + 33CF71772C090A5900FB3AA4 /* FWFWebViewHostApiTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 33CF71622C090A5800FB3AA4 /* FWFWebViewHostApiTests.m */; }; + 33CF71782C090A5900FB3AA4 /* FWFScrollViewHostApiTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 33CF71632C090A5800FB3AA4 /* FWFScrollViewHostApiTests.m */; }; + 33CF71792C090A5900FB3AA4 /* FWFInstanceManagerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 33CF71642C090A5800FB3AA4 /* FWFInstanceManagerTests.m */; }; + 33CF717A2C090A5900FB3AA4 /* FWFScrollViewDelegateHostApiTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 33CF71652C090A5800FB3AA4 /* FWFScrollViewDelegateHostApiTests.m */; }; + 33CF717B2C090A5900FB3AA4 /* FWFUserContentControllerHostApiTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 33CF71662C090A5800FB3AA4 /* FWFUserContentControllerHostApiTests.m */; }; + 33CF717C2C090A5900FB3AA4 /* FWFScriptMessageHandlerHostApiTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 33CF71672C090A5800FB3AA4 /* FWFScriptMessageHandlerHostApiTests.m */; }; + 33CF717D2C090A5900FB3AA4 /* FWFURLAuthenticationChallengeHostApiTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 33CF71682C090A5800FB3AA4 /* FWFURLAuthenticationChallengeHostApiTests.m */; }; + 33CF717E2C090A5900FB3AA4 /* FWFURLTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 33CF71692C090A5800FB3AA4 /* FWFURLTests.m */; }; + 33CF717F2C090A5900FB3AA4 /* FWFWebViewConfigurationHostApiTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 33CF716A2C090A5900FB3AA4 /* FWFWebViewConfigurationHostApiTests.m */; }; + 33CF71802C090A5900FB3AA4 /* FWFWebsiteDataStoreHostApiTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 33CF716B2C090A5900FB3AA4 /* FWFWebsiteDataStoreHostApiTests.m */; }; + 33CF71812C090A5900FB3AA4 /* FWFHTTPCookieStoreHostApiTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 33CF716C2C090A5900FB3AA4 /* FWFHTTPCookieStoreHostApiTests.m */; }; + 33CF71822C090A5900FB3AA4 /* FWFNavigationDelegateHostApiTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 33CF716D2C090A5900FB3AA4 /* FWFNavigationDelegateHostApiTests.m */; }; + 33CF71832C090A5900FB3AA4 /* FWFObjectHostApiTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 33CF716E2C090A5900FB3AA4 /* FWFObjectHostApiTests.m */; }; + 696987BFFD9F58717569B4E4 /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2F0D686780FFBF662B127EB3 /* Pods_RunnerTests.framework */; }; + 94A776FC184B2E22F5BB8688 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4396B0510D22FC1052724D77 /* Pods_Runner.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 */ + 293218A8CB10C8BE4DB72BF6 /* 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 = ""; }; + 2BB8CCF4A3B17FE9A00CF6B7 /* 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 = ""; }; + 2F0D686780FFBF662B127EB3 /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 331C80D5294CF71000263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; 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 = ""; }; + 33CF715A2C090A5800FB3AA4 /* FWFURLProtectionSpaceHostApiTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FWFURLProtectionSpaceHostApiTests.m; path = ../../darwin/Tests/FWFURLProtectionSpaceHostApiTests.m; sourceTree = SOURCE_ROOT; }; + 33CF715B2C090A5800FB3AA4 /* FWFUIDelegateHostApiTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FWFUIDelegateHostApiTests.m; path = ../../darwin/Tests/FWFUIDelegateHostApiTests.m; sourceTree = SOURCE_ROOT; }; + 33CF715C2C090A5800FB3AA4 /* FWFErrorTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FWFErrorTests.m; path = ../../darwin/Tests/FWFErrorTests.m; sourceTree = SOURCE_ROOT; }; + 33CF715D2C090A5800FB3AA4 /* FWFUIViewHostApiTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FWFUIViewHostApiTests.m; path = ../../darwin/Tests/FWFUIViewHostApiTests.m; sourceTree = SOURCE_ROOT; }; + 33CF715E2C090A5800FB3AA4 /* FWFDataConvertersTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FWFDataConvertersTests.m; path = ../../darwin/Tests/FWFDataConvertersTests.m; sourceTree = SOURCE_ROOT; }; + 33CF715F2C090A5800FB3AA4 /* FWFURLCredentialHostApiTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FWFURLCredentialHostApiTests.m; path = ../../darwin/Tests/FWFURLCredentialHostApiTests.m; sourceTree = SOURCE_ROOT; }; + 33CF71602C090A5800FB3AA4 /* FWFWebViewFlutterWKWebViewExternalAPITests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FWFWebViewFlutterWKWebViewExternalAPITests.m; path = ../../darwin/Tests/FWFWebViewFlutterWKWebViewExternalAPITests.m; sourceTree = SOURCE_ROOT; }; + 33CF71612C090A5800FB3AA4 /* FWFPreferencesHostApiTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FWFPreferencesHostApiTests.m; path = ../../darwin/Tests/FWFPreferencesHostApiTests.m; sourceTree = SOURCE_ROOT; }; + 33CF71622C090A5800FB3AA4 /* FWFWebViewHostApiTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FWFWebViewHostApiTests.m; path = ../../darwin/Tests/FWFWebViewHostApiTests.m; sourceTree = SOURCE_ROOT; }; + 33CF71632C090A5800FB3AA4 /* FWFScrollViewHostApiTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FWFScrollViewHostApiTests.m; path = ../../darwin/Tests/FWFScrollViewHostApiTests.m; sourceTree = SOURCE_ROOT; }; + 33CF71642C090A5800FB3AA4 /* FWFInstanceManagerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FWFInstanceManagerTests.m; path = ../../darwin/Tests/FWFInstanceManagerTests.m; sourceTree = SOURCE_ROOT; }; + 33CF71652C090A5800FB3AA4 /* FWFScrollViewDelegateHostApiTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FWFScrollViewDelegateHostApiTests.m; path = ../../darwin/Tests/FWFScrollViewDelegateHostApiTests.m; sourceTree = SOURCE_ROOT; }; + 33CF71662C090A5800FB3AA4 /* FWFUserContentControllerHostApiTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FWFUserContentControllerHostApiTests.m; path = ../../darwin/Tests/FWFUserContentControllerHostApiTests.m; sourceTree = SOURCE_ROOT; }; + 33CF71672C090A5800FB3AA4 /* FWFScriptMessageHandlerHostApiTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FWFScriptMessageHandlerHostApiTests.m; path = ../../darwin/Tests/FWFScriptMessageHandlerHostApiTests.m; sourceTree = SOURCE_ROOT; }; + 33CF71682C090A5800FB3AA4 /* FWFURLAuthenticationChallengeHostApiTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FWFURLAuthenticationChallengeHostApiTests.m; path = ../../darwin/Tests/FWFURLAuthenticationChallengeHostApiTests.m; sourceTree = SOURCE_ROOT; }; + 33CF71692C090A5800FB3AA4 /* FWFURLTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FWFURLTests.m; path = ../../darwin/Tests/FWFURLTests.m; sourceTree = SOURCE_ROOT; }; + 33CF716A2C090A5900FB3AA4 /* FWFWebViewConfigurationHostApiTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FWFWebViewConfigurationHostApiTests.m; path = ../../darwin/Tests/FWFWebViewConfigurationHostApiTests.m; sourceTree = SOURCE_ROOT; }; + 33CF716B2C090A5900FB3AA4 /* FWFWebsiteDataStoreHostApiTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FWFWebsiteDataStoreHostApiTests.m; path = ../../darwin/Tests/FWFWebsiteDataStoreHostApiTests.m; sourceTree = SOURCE_ROOT; }; + 33CF716C2C090A5900FB3AA4 /* FWFHTTPCookieStoreHostApiTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FWFHTTPCookieStoreHostApiTests.m; path = ../../darwin/Tests/FWFHTTPCookieStoreHostApiTests.m; sourceTree = SOURCE_ROOT; }; + 33CF716D2C090A5900FB3AA4 /* FWFNavigationDelegateHostApiTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FWFNavigationDelegateHostApiTests.m; path = ../../darwin/Tests/FWFNavigationDelegateHostApiTests.m; sourceTree = SOURCE_ROOT; }; + 33CF716E2C090A5900FB3AA4 /* FWFObjectHostApiTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FWFObjectHostApiTests.m; path = ../../darwin/Tests/FWFObjectHostApiTests.m; sourceTree = SOURCE_ROOT; }; + 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 = ""; }; + 4396B0510D22FC1052724D77 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 7A8789C38AC8A7893DF1757D /* 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 = ""; }; + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; }; + 8E3B7819B86A3E8D5B2787F8 /* 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 = ""; }; + 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; }; + B29CEB47BBE7D438B12895F3 /* 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 = ""; }; + BB0A609D94A71B55CFCFC007 /* 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 = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 331C80D2294CF70F00263BE5 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 337257E82C626C94005E6518 /* OCMock in Frameworks */, + 696987BFFD9F58717569B4E4 /* Pods_RunnerTests.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 33CC10EA2044A3C60003C045 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 94A776FC184B2E22F5BB8688 /* Pods_Runner.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 331C80D6294CF71000263BE5 /* RunnerTests */ = { + isa = PBXGroup; + children = ( + 33CF715E2C090A5800FB3AA4 /* FWFDataConvertersTests.m */, + 33CF715C2C090A5800FB3AA4 /* FWFErrorTests.m */, + 33CF716C2C090A5900FB3AA4 /* FWFHTTPCookieStoreHostApiTests.m */, + 33CF71642C090A5800FB3AA4 /* FWFInstanceManagerTests.m */, + 33CF716D2C090A5900FB3AA4 /* FWFNavigationDelegateHostApiTests.m */, + 33CF716E2C090A5900FB3AA4 /* FWFObjectHostApiTests.m */, + 33CF71612C090A5800FB3AA4 /* FWFPreferencesHostApiTests.m */, + 33CF71672C090A5800FB3AA4 /* FWFScriptMessageHandlerHostApiTests.m */, + 33CF71652C090A5800FB3AA4 /* FWFScrollViewDelegateHostApiTests.m */, + 33CF71632C090A5800FB3AA4 /* FWFScrollViewHostApiTests.m */, + 33CF715B2C090A5800FB3AA4 /* FWFUIDelegateHostApiTests.m */, + 33CF715D2C090A5800FB3AA4 /* FWFUIViewHostApiTests.m */, + 33CF71682C090A5800FB3AA4 /* FWFURLAuthenticationChallengeHostApiTests.m */, + 33CF715F2C090A5800FB3AA4 /* FWFURLCredentialHostApiTests.m */, + 33CF715A2C090A5800FB3AA4 /* FWFURLProtectionSpaceHostApiTests.m */, + 33CF71692C090A5800FB3AA4 /* FWFURLTests.m */, + 33CF71662C090A5800FB3AA4 /* FWFUserContentControllerHostApiTests.m */, + 33CF716B2C090A5900FB3AA4 /* FWFWebsiteDataStoreHostApiTests.m */, + 33CF716A2C090A5900FB3AA4 /* FWFWebViewConfigurationHostApiTests.m */, + 33CF71602C090A5800FB3AA4 /* FWFWebViewFlutterWKWebViewExternalAPITests.m */, + 33CF71622C090A5800FB3AA4 /* FWFWebViewHostApiTests.m */, + ); + path = RunnerTests; + 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 */, + 331C80D6294CF71000263BE5 /* RunnerTests */, + 33CC10EE2044A3C60003C045 /* Products */, + D73912EC22F37F3D000D13A0 /* Frameworks */, + 57E0600E4AC0FCC05F33A596 /* Pods */, + ); + sourceTree = ""; + }; + 33CC10EE2044A3C60003C045 /* Products */ = { + isa = PBXGroup; + children = ( + 33CC10ED2044A3C60003C045 /* 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 = ""; + }; + 57E0600E4AC0FCC05F33A596 /* Pods */ = { + isa = PBXGroup; + children = ( + 7A8789C38AC8A7893DF1757D /* Pods-Runner.debug.xcconfig */, + 293218A8CB10C8BE4DB72BF6 /* Pods-Runner.release.xcconfig */, + 2BB8CCF4A3B17FE9A00CF6B7 /* Pods-Runner.profile.xcconfig */, + BB0A609D94A71B55CFCFC007 /* Pods-RunnerTests.debug.xcconfig */, + 8E3B7819B86A3E8D5B2787F8 /* Pods-RunnerTests.release.xcconfig */, + B29CEB47BBE7D438B12895F3 /* Pods-RunnerTests.profile.xcconfig */, + ); + path = Pods; + sourceTree = ""; + }; + D73912EC22F37F3D000D13A0 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 4396B0510D22FC1052724D77 /* Pods_Runner.framework */, + 2F0D686780FFBF662B127EB3 /* 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 = ( + 5B369AB3CC6C4456A15F9A02 /* [CP] Check Pods Manifest.lock */, + 331C80D1294CF70F00263BE5 /* Sources */, + 331C80D2294CF70F00263BE5 /* Frameworks */, + 331C80D3294CF70F00263BE5 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 331C80DA294CF71000263BE5 /* PBXTargetDependency */, + ); + name = RunnerTests; + packageProductDependencies = ( + 337257E72C626C94005E6518 /* OCMock */, + ); + 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 = ( + 52BDF375441D3D4ACF9978EC /* [CP] Check Pods Manifest.lock */, + 33CC10E92044A3C60003C045 /* Sources */, + 33CC10EA2044A3C60003C045 /* Frameworks */, + 33CC10EB2044A3C60003C045 /* Resources */, + 33CC110E2044A8840003C045 /* Bundle Framework */, + 3399D490228B24CF009A79C7 /* ShellScript */, + AE091060DB78993007C49A9B /* [CP] Embed Pods Frameworks */, + ); + 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 = 1510; + ORGANIZATIONNAME = ""; + TargetAttributes = { + 331C80D4294CF70F00263BE5 = { + CreatedOnToolsVersion = 14.0; + LastSwiftMigration = 1510; + 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; + packageReferences = ( + 337257E62C626C94005E6518 /* XCRemoteSwiftPackageReference "ocmock" */, + ); + 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 = ( + ); + 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"; + }; + 52BDF375441D3D4ACF9978EC /* [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; + }; + 5B369AB3CC6C4456A15F9A02 /* [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; + }; + AE091060DB78993007C49A9B /* [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 */ + 331C80D1294CF70F00263BE5 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 33CF71822C090A5900FB3AA4 /* FWFNavigationDelegateHostApiTests.m in Sources */, + 33CF71832C090A5900FB3AA4 /* FWFObjectHostApiTests.m in Sources */, + 33CF71762C090A5900FB3AA4 /* FWFPreferencesHostApiTests.m in Sources */, + 33CF717E2C090A5900FB3AA4 /* FWFURLTests.m in Sources */, + 33CF71702C090A5900FB3AA4 /* FWFUIDelegateHostApiTests.m in Sources */, + 33CF717C2C090A5900FB3AA4 /* FWFScriptMessageHandlerHostApiTests.m in Sources */, + 33CF716F2C090A5900FB3AA4 /* FWFURLProtectionSpaceHostApiTests.m in Sources */, + 33CF717A2C090A5900FB3AA4 /* FWFScrollViewDelegateHostApiTests.m in Sources */, + 33CF71782C090A5900FB3AA4 /* FWFScrollViewHostApiTests.m in Sources */, + 33CF71712C090A5900FB3AA4 /* FWFErrorTests.m in Sources */, + 33CF71812C090A5900FB3AA4 /* FWFHTTPCookieStoreHostApiTests.m in Sources */, + 33CF717F2C090A5900FB3AA4 /* FWFWebViewConfigurationHostApiTests.m in Sources */, + 33CF717B2C090A5900FB3AA4 /* FWFUserContentControllerHostApiTests.m in Sources */, + 33CF71802C090A5900FB3AA4 /* FWFWebsiteDataStoreHostApiTests.m in Sources */, + 33CF71752C090A5900FB3AA4 /* FWFWebViewFlutterWKWebViewExternalAPITests.m in Sources */, + 33CF717D2C090A5900FB3AA4 /* FWFURLAuthenticationChallengeHostApiTests.m in Sources */, + 33CF71772C090A5900FB3AA4 /* FWFWebViewHostApiTests.m in Sources */, + 33CF71742C090A5900FB3AA4 /* FWFURLCredentialHostApiTests.m in Sources */, + 33CF71732C090A5900FB3AA4 /* FWFDataConvertersTests.m in Sources */, + 33CF71792C090A5900FB3AA4 /* FWFInstanceManagerTests.m in Sources */, + 33CF71722C090A5900FB3AA4 /* FWFUIViewHostApiTests.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 = BB0A609D94A71B55CFCFC007 /* Pods-RunnerTests.debug.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = dev.flutter.plugins.example.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/example.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/example"; + }; + name = Debug; + }; + 331C80DC294CF71000263BE5 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 8E3B7819B86A3E8D5B2787F8 /* Pods-RunnerTests.release.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = dev.flutter.plugins.example.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/example.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/example"; + }; + name = Release; + }; + 331C80DD294CF71000263BE5 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = B29CEB47BBE7D438B12895F3 /* Pods-RunnerTests.profile.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = dev.flutter.plugins.example.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/example.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/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.14; + 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.14; + 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.14; + 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 */ + +/* Begin XCRemoteSwiftPackageReference section */ + 337257E62C626C94005E6518 /* XCRemoteSwiftPackageReference "ocmock" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/erikdoe/ocmock"; + requirement = { + kind = revision; + revision = fe1661a3efed11831a6452f4b1a0c5e6ddc08c3d; + }; + }; +/* End XCRemoteSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + 337257E72C626C94005E6518 /* OCMock */ = { + isa = XCSwiftPackageProductDependency; + package = 337257E62C626C94005E6518 /* XCRemoteSwiftPackageReference "ocmock" */; + productName = OCMock; + }; +/* End XCSwiftPackageProductDependency section */ + }; + rootObject = 33CC10E52044A3C60003C045 /* Project object */; +} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 000000000000..18d981003d68 --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme new file mode 100644 index 000000000000..be6977d7622f --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Runner.xcworkspace/contents.xcworkspacedata b/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Runner.xcworkspace/contents.xcworkspacedata new file mode 100644 index 000000000000..21a3cc14c74e --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Runner.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 000000000000..18d981003d68 --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Runner/AppDelegate.swift b/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Runner/AppDelegate.swift new file mode 100644 index 000000000000..689c0ecd5254 --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Runner/AppDelegate.swift @@ -0,0 +1,13 @@ +// 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 + +@main +class AppDelegate: FlutterAppDelegate { + override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { + return true + } +} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 000000000000..a2ec33f19f11 --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,68 @@ +{ + "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/webview_flutter/webview_flutter_wkwebview/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png b/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png new file mode 100644 index 000000000000..82b6f9d9a33e Binary files /dev/null and b/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png differ diff --git a/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png b/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png new file mode 100644 index 000000000000..13b35eba55c6 Binary files /dev/null and b/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png differ diff --git a/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png b/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png new file mode 100644 index 000000000000..0a3f5fa40fb3 Binary files /dev/null and b/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png differ diff --git a/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png b/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png new file mode 100644 index 000000000000..bdb57226d5f2 Binary files /dev/null and b/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png differ diff --git a/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png b/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png new file mode 100644 index 000000000000..f083318e09ca Binary files /dev/null and b/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png differ diff --git a/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png b/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png new file mode 100644 index 000000000000..326c0e72c9d8 Binary files /dev/null and b/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png differ diff --git a/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png b/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png new file mode 100644 index 000000000000..2f1632cfddf3 Binary files /dev/null and b/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png differ diff --git a/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Runner/Base.lproj/MainMenu.xib b/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Runner/Base.lproj/MainMenu.xib new file mode 100644 index 000000000000..80e867a4e06b --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Runner/Base.lproj/MainMenu.xib @@ -0,0 +1,343 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Runner/Configs/AppInfo.xcconfig b/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Runner/Configs/AppInfo.xcconfig new file mode 100644 index 000000000000..e957f60d65b7 --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Runner/Configs/AppInfo.xcconfig @@ -0,0 +1,14 @@ +// 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/webview_flutter/webview_flutter_wkwebview/example/macos/Runner/Configs/Debug.xcconfig b/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Runner/Configs/Debug.xcconfig new file mode 100644 index 000000000000..36b0fd9464f4 --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Runner/Configs/Debug.xcconfig @@ -0,0 +1,2 @@ +#include "../../Flutter/Flutter-Debug.xcconfig" +#include "Warnings.xcconfig" diff --git a/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Runner/Configs/Release.xcconfig b/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Runner/Configs/Release.xcconfig new file mode 100644 index 000000000000..dff4f49561c8 --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Runner/Configs/Release.xcconfig @@ -0,0 +1,2 @@ +#include "../../Flutter/Flutter-Release.xcconfig" +#include "Warnings.xcconfig" diff --git a/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Runner/Configs/Warnings.xcconfig b/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Runner/Configs/Warnings.xcconfig new file mode 100644 index 000000000000..42bcbf4780b1 --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Runner/Configs/Warnings.xcconfig @@ -0,0 +1,13 @@ +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/webview_flutter/webview_flutter_wkwebview/example/macos/Runner/DebugProfile.entitlements b/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Runner/DebugProfile.entitlements new file mode 100644 index 000000000000..08c3ab17cc26 --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Runner/DebugProfile.entitlements @@ -0,0 +1,14 @@ + + + + + com.apple.security.app-sandbox + + com.apple.security.cs.allow-jit + + com.apple.security.network.server + + com.apple.security.network.client + + + diff --git a/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Runner/Info.plist b/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Runner/Info.plist new file mode 100644 index 000000000000..4789daa6a443 --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Runner/Info.plist @@ -0,0 +1,32 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIconFile + + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + LSMinimumSystemVersion + $(MACOSX_DEPLOYMENT_TARGET) + NSHumanReadableCopyright + $(PRODUCT_COPYRIGHT) + NSMainNibFile + MainMenu + NSPrincipalClass + NSApplication + + diff --git a/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Runner/MainFlutterWindow.swift b/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Runner/MainFlutterWindow.swift new file mode 100644 index 000000000000..f21908966e95 --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Runner/MainFlutterWindow.swift @@ -0,0 +1,19 @@ +// 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/webview_flutter/webview_flutter_wkwebview/example/macos/Runner/Release.entitlements b/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Runner/Release.entitlements new file mode 100644 index 000000000000..ee95ab7e582d --- /dev/null +++ b/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Runner/Release.entitlements @@ -0,0 +1,10 @@ + + + + + com.apple.security.app-sandbox + + com.apple.security.network.client + + + diff --git a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/common/web_kit.g.dart b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/common/web_kit.g.dart index 65f55dbbe3ff..bd0ac2c02945 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/common/web_kit.g.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/common/web_kit.g.dart @@ -1,9 +1,9 @@ // 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 (v18.0.0), 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 +// 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, no_leading_underscores_for_local_identifiers import 'dart:async'; import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List; @@ -11,6 +11,13 @@ import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List; import 'package:flutter/foundation.dart' show ReadBuffer, WriteBuffer; import 'package:flutter/services.dart'; +PlatformException _createConnectionError(String channelName) { + return PlatformException( + code: 'channel-error', + message: 'Unable to establish connection on channel: "$channelName".', + ); +} + List wrapResponse( {Object? result, PlatformException? error, bool empty = false}) { if (empty) { @@ -859,54 +866,61 @@ class WKWebsiteDataStoreHostApi { /// Constructor for [WKWebsiteDataStoreHostApi]. The [binaryMessenger] named argument is /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. - WKWebsiteDataStoreHostApi({BinaryMessenger? binaryMessenger}) - : _binaryMessenger = binaryMessenger; - final BinaryMessenger? _binaryMessenger; + WKWebsiteDataStoreHostApi( + {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) + : __pigeon_binaryMessenger = binaryMessenger, + __pigeon_messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + final BinaryMessenger? __pigeon_binaryMessenger; + + static const MessageCodec pigeonChannelCodec = + _WKWebsiteDataStoreHostApiCodec(); - static const MessageCodec codec = _WKWebsiteDataStoreHostApiCodec(); + final String __pigeon_messageChannelSuffix; Future createFromWebViewConfiguration( - int arg_identifier, int arg_configurationIdentifier) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebsiteDataStoreHostApi.createFromWebViewConfiguration', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = await channel - .send([arg_identifier, arg_configurationIdentifier]) - as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + int identifier, int configurationIdentifier) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebsiteDataStoreHostApi.createFromWebViewConfiguration$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( + __pigeon_channelName, + pigeonChannelCodec, + binaryMessenger: __pigeon_binaryMessenger, + ); + final List? __pigeon_replyList = await __pigeon_channel + .send([identifier, configurationIdentifier]) as List?; + if (__pigeon_replyList == null) { + throw _createConnectionError(__pigeon_channelName); + } else if (__pigeon_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: __pigeon_replyList[0]! as String, + message: __pigeon_replyList[1] as String?, + details: __pigeon_replyList[2], ); } else { return; } } - Future createDefaultDataStore(int arg_identifier) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebsiteDataStoreHostApi.createDefaultDataStore', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + Future createDefaultDataStore(int identifier) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebsiteDataStoreHostApi.createDefaultDataStore$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( + __pigeon_channelName, + pigeonChannelCodec, + binaryMessenger: __pigeon_binaryMessenger, + ); + final List? __pigeon_replyList = + await __pigeon_channel.send([identifier]) as List?; + if (__pigeon_replyList == null) { + throw _createConnectionError(__pigeon_channelName); + } else if (__pigeon_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: __pigeon_replyList[0]! as String, + message: __pigeon_replyList[1] as String?, + details: __pigeon_replyList[2], ); } else { return; @@ -914,36 +928,38 @@ class WKWebsiteDataStoreHostApi { } Future removeDataOfTypes( - int arg_identifier, - List arg_dataTypes, - double arg_modificationTimeInSecondsSinceEpoch) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebsiteDataStoreHostApi.removeDataOfTypes', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send([ - arg_identifier, - arg_dataTypes, - arg_modificationTimeInSecondsSinceEpoch + int identifier, + List dataTypes, + double modificationTimeInSecondsSinceEpoch) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebsiteDataStoreHostApi.removeDataOfTypes$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( + __pigeon_channelName, + pigeonChannelCodec, + binaryMessenger: __pigeon_binaryMessenger, + ); + final List? __pigeon_replyList = await __pigeon_channel + .send([ + identifier, + dataTypes, + modificationTimeInSecondsSinceEpoch ]) as List?; - if (replyList == null) { + if (__pigeon_replyList == null) { + throw _createConnectionError(__pigeon_channelName); + } else if (__pigeon_replyList.length > 1) { throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', + code: __pigeon_replyList[0]! as String, + message: __pigeon_replyList[1] as String?, + details: __pigeon_replyList[2], ); - } else if (replyList.length > 1) { - throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], - ); - } else if (replyList[0] == null) { + } else if (__pigeon_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 (__pigeon_replyList[0] as bool?)!; } } } @@ -955,52 +971,60 @@ class UIViewHostApi { /// Constructor for [UIViewHostApi]. The [binaryMessenger] named argument is /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. - UIViewHostApi({BinaryMessenger? binaryMessenger}) - : _binaryMessenger = binaryMessenger; - final BinaryMessenger? _binaryMessenger; - - static const MessageCodec codec = StandardMessageCodec(); - - Future setBackgroundColor(int arg_identifier, int? arg_value) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.UIViewHostApi.setBackgroundColor', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = await channel - .send([arg_identifier, arg_value]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + UIViewHostApi( + {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) + : __pigeon_binaryMessenger = binaryMessenger, + __pigeon_messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + final BinaryMessenger? __pigeon_binaryMessenger; + + static const MessageCodec pigeonChannelCodec = + StandardMessageCodec(); + + final String __pigeon_messageChannelSuffix; + + Future setBackgroundColor(int identifier, int? value) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.UIViewHostApi.setBackgroundColor$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( + __pigeon_channelName, + pigeonChannelCodec, + binaryMessenger: __pigeon_binaryMessenger, + ); + final List? __pigeon_replyList = await __pigeon_channel + .send([identifier, value]) as List?; + if (__pigeon_replyList == null) { + throw _createConnectionError(__pigeon_channelName); + } else if (__pigeon_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: __pigeon_replyList[0]! as String, + message: __pigeon_replyList[1] as String?, + details: __pigeon_replyList[2], ); } else { return; } } - Future setOpaque(int arg_identifier, bool arg_opaque) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.UIViewHostApi.setOpaque', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = await channel - .send([arg_identifier, arg_opaque]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + Future setOpaque(int identifier, bool opaque) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.UIViewHostApi.setOpaque$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( + __pigeon_channelName, + pigeonChannelCodec, + binaryMessenger: __pigeon_binaryMessenger, + ); + final List? __pigeon_replyList = await __pigeon_channel + .send([identifier, opaque]) as List?; + if (__pigeon_replyList == null) { + throw _createConnectionError(__pigeon_channelName); + } else if (__pigeon_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: __pigeon_replyList[0]! as String, + message: __pigeon_replyList[1] as String?, + details: __pigeon_replyList[2], ); } else { return; @@ -1015,106 +1039,113 @@ class UIScrollViewHostApi { /// Constructor for [UIScrollViewHostApi]. The [binaryMessenger] named argument is /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. - UIScrollViewHostApi({BinaryMessenger? binaryMessenger}) - : _binaryMessenger = binaryMessenger; - final BinaryMessenger? _binaryMessenger; - - static const MessageCodec codec = StandardMessageCodec(); - - Future createFromWebView( - int arg_identifier, int arg_webViewIdentifier) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewHostApi.createFromWebView', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_webViewIdentifier]) - as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + UIScrollViewHostApi( + {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) + : __pigeon_binaryMessenger = binaryMessenger, + __pigeon_messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + final BinaryMessenger? __pigeon_binaryMessenger; + + static const MessageCodec pigeonChannelCodec = + StandardMessageCodec(); + + final String __pigeon_messageChannelSuffix; + + Future createFromWebView(int identifier, int webViewIdentifier) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewHostApi.createFromWebView$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( + __pigeon_channelName, + pigeonChannelCodec, + binaryMessenger: __pigeon_binaryMessenger, + ); + final List? __pigeon_replyList = await __pigeon_channel + .send([identifier, webViewIdentifier]) as List?; + if (__pigeon_replyList == null) { + throw _createConnectionError(__pigeon_channelName); + } else if (__pigeon_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: __pigeon_replyList[0]! as String, + message: __pigeon_replyList[1] as String?, + details: __pigeon_replyList[2], ); } else { return; } } - Future> getContentOffset(int arg_identifier) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewHostApi.getContentOffset', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + Future> getContentOffset(int identifier) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewHostApi.getContentOffset$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( + __pigeon_channelName, + pigeonChannelCodec, + binaryMessenger: __pigeon_binaryMessenger, + ); + final List? __pigeon_replyList = + await __pigeon_channel.send([identifier]) as List?; + if (__pigeon_replyList == null) { + throw _createConnectionError(__pigeon_channelName); + } else if (__pigeon_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: __pigeon_replyList[0]! as String, + message: __pigeon_replyList[1] as String?, + details: __pigeon_replyList[2], ); - } else if (replyList[0] == null) { + } else if (__pigeon_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (replyList[0] as List?)!.cast(); + return (__pigeon_replyList[0] as List?)!.cast(); } } - Future scrollBy(int arg_identifier, double arg_x, double arg_y) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewHostApi.scrollBy', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = await channel - .send([arg_identifier, arg_x, arg_y]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + Future scrollBy(int identifier, double x, double y) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewHostApi.scrollBy$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( + __pigeon_channelName, + pigeonChannelCodec, + binaryMessenger: __pigeon_binaryMessenger, + ); + final List? __pigeon_replyList = await __pigeon_channel + .send([identifier, x, y]) as List?; + if (__pigeon_replyList == null) { + throw _createConnectionError(__pigeon_channelName); + } else if (__pigeon_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: __pigeon_replyList[0]! as String, + message: __pigeon_replyList[1] as String?, + details: __pigeon_replyList[2], ); } else { return; } } - Future setContentOffset( - int arg_identifier, double arg_x, double arg_y) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewHostApi.setContentOffset', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = await channel - .send([arg_identifier, arg_x, arg_y]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + Future setContentOffset(int identifier, double x, double y) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewHostApi.setContentOffset$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( + __pigeon_channelName, + pigeonChannelCodec, + binaryMessenger: __pigeon_binaryMessenger, + ); + final List? __pigeon_replyList = await __pigeon_channel + .send([identifier, x, y]) as List?; + if (__pigeon_replyList == null) { + throw _createConnectionError(__pigeon_channelName); + } else if (__pigeon_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: __pigeon_replyList[0]! as String, + message: __pigeon_replyList[1] as String?, + details: __pigeon_replyList[2], ); } else { return; @@ -1122,24 +1153,25 @@ class UIScrollViewHostApi { } Future setDelegate( - int arg_identifier, int? arg_uiScrollViewDelegateIdentifier) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewHostApi.setDelegate', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = await channel - .send([arg_identifier, arg_uiScrollViewDelegateIdentifier]) + int identifier, int? uiScrollViewDelegateIdentifier) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewHostApi.setDelegate$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( + __pigeon_channelName, + pigeonChannelCodec, + binaryMessenger: __pigeon_binaryMessenger, + ); + final List? __pigeon_replyList = await __pigeon_channel + .send([identifier, uiScrollViewDelegateIdentifier]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + if (__pigeon_replyList == null) { + throw _createConnectionError(__pigeon_channelName); + } else if (__pigeon_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: __pigeon_replyList[0]! as String, + message: __pigeon_replyList[1] as String?, + details: __pigeon_replyList[2], ); } else { return; @@ -1177,79 +1209,84 @@ class WKWebViewConfigurationHostApi { /// Constructor for [WKWebViewConfigurationHostApi]. The [binaryMessenger] named argument is /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. - WKWebViewConfigurationHostApi({BinaryMessenger? binaryMessenger}) - : _binaryMessenger = binaryMessenger; - final BinaryMessenger? _binaryMessenger; - - static const MessageCodec codec = + WKWebViewConfigurationHostApi( + {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) + : __pigeon_binaryMessenger = binaryMessenger, + __pigeon_messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + final BinaryMessenger? __pigeon_binaryMessenger; + + static const MessageCodec pigeonChannelCodec = _WKWebViewConfigurationHostApiCodec(); - Future create(int arg_identifier) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfigurationHostApi.create', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + final String __pigeon_messageChannelSuffix; + + Future create(int identifier) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfigurationHostApi.create$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( + __pigeon_channelName, + pigeonChannelCodec, + binaryMessenger: __pigeon_binaryMessenger, + ); + final List? __pigeon_replyList = + await __pigeon_channel.send([identifier]) as List?; + if (__pigeon_replyList == null) { + throw _createConnectionError(__pigeon_channelName); + } else if (__pigeon_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: __pigeon_replyList[0]! as String, + message: __pigeon_replyList[1] as String?, + details: __pigeon_replyList[2], ); } else { return; } } - Future createFromWebView( - int arg_identifier, int arg_webViewIdentifier) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfigurationHostApi.createFromWebView', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_webViewIdentifier]) - as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + Future createFromWebView(int identifier, int webViewIdentifier) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfigurationHostApi.createFromWebView$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( + __pigeon_channelName, + pigeonChannelCodec, + binaryMessenger: __pigeon_binaryMessenger, + ); + final List? __pigeon_replyList = await __pigeon_channel + .send([identifier, webViewIdentifier]) as List?; + if (__pigeon_replyList == null) { + throw _createConnectionError(__pigeon_channelName); + } else if (__pigeon_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: __pigeon_replyList[0]! as String, + message: __pigeon_replyList[1] as String?, + details: __pigeon_replyList[2], ); } else { return; } } - Future setAllowsInlineMediaPlayback( - int arg_identifier, bool arg_allow) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfigurationHostApi.setAllowsInlineMediaPlayback', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = await channel - .send([arg_identifier, arg_allow]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + Future setAllowsInlineMediaPlayback(int identifier, bool allow) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfigurationHostApi.setAllowsInlineMediaPlayback$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( + __pigeon_channelName, + pigeonChannelCodec, + binaryMessenger: __pigeon_binaryMessenger, + ); + final List? __pigeon_replyList = await __pigeon_channel + .send([identifier, allow]) as List?; + if (__pigeon_replyList == null) { + throw _createConnectionError(__pigeon_channelName); + } else if (__pigeon_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: __pigeon_replyList[0]! as String, + message: __pigeon_replyList[1] as String?, + details: __pigeon_replyList[2], ); } else { return; @@ -1257,47 +1294,49 @@ class WKWebViewConfigurationHostApi { } Future setLimitsNavigationsToAppBoundDomains( - int arg_identifier, bool arg_limit) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfigurationHostApi.setLimitsNavigationsToAppBoundDomains', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = await channel - .send([arg_identifier, arg_limit]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + int identifier, bool limit) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfigurationHostApi.setLimitsNavigationsToAppBoundDomains$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( + __pigeon_channelName, + pigeonChannelCodec, + binaryMessenger: __pigeon_binaryMessenger, + ); + final List? __pigeon_replyList = await __pigeon_channel + .send([identifier, limit]) as List?; + if (__pigeon_replyList == null) { + throw _createConnectionError(__pigeon_channelName); + } else if (__pigeon_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: __pigeon_replyList[0]! as String, + message: __pigeon_replyList[1] as String?, + details: __pigeon_replyList[2], ); } else { return; } } - Future setMediaTypesRequiringUserActionForPlayback(int arg_identifier, - List arg_types) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfigurationHostApi.setMediaTypesRequiringUserActionForPlayback', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = await channel - .send([arg_identifier, arg_types]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + Future setMediaTypesRequiringUserActionForPlayback( + int identifier, List types) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfigurationHostApi.setMediaTypesRequiringUserActionForPlayback$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( + __pigeon_channelName, + pigeonChannelCodec, + binaryMessenger: __pigeon_binaryMessenger, + ); + final List? __pigeon_replyList = await __pigeon_channel + .send([identifier, types]) as List?; + if (__pigeon_replyList == null) { + throw _createConnectionError(__pigeon_channelName); + } else if (__pigeon_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: __pigeon_replyList[0]! as String, + message: __pigeon_replyList[1] as String?, + details: __pigeon_replyList[2], ); } else { return; @@ -1309,21 +1348,28 @@ class WKWebViewConfigurationHostApi { /// /// See https://developer.apple.com/documentation/webkit/wkwebviewconfiguration?language=objc. abstract class WKWebViewConfigurationFlutterApi { - static const MessageCodec codec = StandardMessageCodec(); + static const MessageCodec pigeonChannelCodec = + StandardMessageCodec(); void create(int identifier); - static void setup(WKWebViewConfigurationFlutterApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setUp( + WKWebViewConfigurationFlutterApi? api, { + BinaryMessenger? binaryMessenger, + String messageChannelSuffix = '', + }) { + messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfigurationFlutterApi.create', - codec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfigurationFlutterApi.create$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - channel.setMessageHandler(null); + __pigeon_channel.setMessageHandler(null); } else { - channel.setMessageHandler((Object? message) async { + __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfigurationFlutterApi.create was null.'); final List args = (message as List?)!; @@ -1380,32 +1426,37 @@ class WKUserContentControllerHostApi { /// Constructor for [WKUserContentControllerHostApi]. The [binaryMessenger] named argument is /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. - WKUserContentControllerHostApi({BinaryMessenger? binaryMessenger}) - : _binaryMessenger = binaryMessenger; - final BinaryMessenger? _binaryMessenger; - - static const MessageCodec codec = + WKUserContentControllerHostApi( + {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) + : __pigeon_binaryMessenger = binaryMessenger, + __pigeon_messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + final BinaryMessenger? __pigeon_binaryMessenger; + + static const MessageCodec pigeonChannelCodec = _WKUserContentControllerHostApiCodec(); + final String __pigeon_messageChannelSuffix; + Future createFromWebViewConfiguration( - int arg_identifier, int arg_configurationIdentifier) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentControllerHostApi.createFromWebViewConfiguration', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = await channel - .send([arg_identifier, arg_configurationIdentifier]) - as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + int identifier, int configurationIdentifier) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentControllerHostApi.createFromWebViewConfiguration$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( + __pigeon_channelName, + pigeonChannelCodec, + binaryMessenger: __pigeon_binaryMessenger, + ); + final List? __pigeon_replyList = await __pigeon_channel + .send([identifier, configurationIdentifier]) as List?; + if (__pigeon_replyList == null) { + throw _createConnectionError(__pigeon_channelName); + } else if (__pigeon_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: __pigeon_replyList[0]! as String, + message: __pigeon_replyList[1] as String?, + details: __pigeon_replyList[2], ); } else { return; @@ -1413,71 +1464,72 @@ class WKUserContentControllerHostApi { } Future addScriptMessageHandler( - int arg_identifier, int arg_handlerIdentifier, String arg_name) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentControllerHostApi.addScriptMessageHandler', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = await channel - .send([arg_identifier, arg_handlerIdentifier, arg_name]) - as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + int identifier, int handlerIdentifier, String name) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentControllerHostApi.addScriptMessageHandler$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( + __pigeon_channelName, + pigeonChannelCodec, + binaryMessenger: __pigeon_binaryMessenger, + ); + final List? __pigeon_replyList = await __pigeon_channel + .send([identifier, handlerIdentifier, name]) as List?; + if (__pigeon_replyList == null) { + throw _createConnectionError(__pigeon_channelName); + } else if (__pigeon_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: __pigeon_replyList[0]! as String, + message: __pigeon_replyList[1] as String?, + details: __pigeon_replyList[2], ); } else { return; } } - Future removeScriptMessageHandler( - int arg_identifier, String arg_name) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentControllerHostApi.removeScriptMessageHandler', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = await channel - .send([arg_identifier, arg_name]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + Future removeScriptMessageHandler(int identifier, String name) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentControllerHostApi.removeScriptMessageHandler$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( + __pigeon_channelName, + pigeonChannelCodec, + binaryMessenger: __pigeon_binaryMessenger, + ); + final List? __pigeon_replyList = await __pigeon_channel + .send([identifier, name]) as List?; + if (__pigeon_replyList == null) { + throw _createConnectionError(__pigeon_channelName); + } else if (__pigeon_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: __pigeon_replyList[0]! as String, + message: __pigeon_replyList[1] as String?, + details: __pigeon_replyList[2], ); } else { return; } } - Future removeAllScriptMessageHandlers(int arg_identifier) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentControllerHostApi.removeAllScriptMessageHandlers', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + Future removeAllScriptMessageHandlers(int identifier) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentControllerHostApi.removeAllScriptMessageHandlers$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( + __pigeon_channelName, + pigeonChannelCodec, + binaryMessenger: __pigeon_binaryMessenger, + ); + final List? __pigeon_replyList = + await __pigeon_channel.send([identifier]) as List?; + if (__pigeon_replyList == null) { + throw _createConnectionError(__pigeon_channelName); + } else if (__pigeon_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: __pigeon_replyList[0]! as String, + message: __pigeon_replyList[1] as String?, + details: __pigeon_replyList[2], ); } else { return; @@ -1485,46 +1537,48 @@ class WKUserContentControllerHostApi { } Future addUserScript( - int arg_identifier, WKUserScriptData arg_userScript) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentControllerHostApi.addUserScript', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = await channel - .send([arg_identifier, arg_userScript]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + int identifier, WKUserScriptData userScript) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentControllerHostApi.addUserScript$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( + __pigeon_channelName, + pigeonChannelCodec, + binaryMessenger: __pigeon_binaryMessenger, + ); + final List? __pigeon_replyList = await __pigeon_channel + .send([identifier, userScript]) as List?; + if (__pigeon_replyList == null) { + throw _createConnectionError(__pigeon_channelName); + } else if (__pigeon_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: __pigeon_replyList[0]! as String, + message: __pigeon_replyList[1] as String?, + details: __pigeon_replyList[2], ); } else { return; } } - Future removeAllUserScripts(int arg_identifier) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentControllerHostApi.removeAllUserScripts', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + Future removeAllUserScripts(int identifier) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentControllerHostApi.removeAllUserScripts$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( + __pigeon_channelName, + pigeonChannelCodec, + binaryMessenger: __pigeon_binaryMessenger, + ); + final List? __pigeon_replyList = + await __pigeon_channel.send([identifier]) as List?; + if (__pigeon_replyList == null) { + throw _createConnectionError(__pigeon_channelName); + } else if (__pigeon_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: __pigeon_replyList[0]! as String, + message: __pigeon_replyList[1] as String?, + details: __pigeon_replyList[2], ); } else { return; @@ -1539,55 +1593,61 @@ class WKPreferencesHostApi { /// Constructor for [WKPreferencesHostApi]. The [binaryMessenger] named argument is /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. - WKPreferencesHostApi({BinaryMessenger? binaryMessenger}) - : _binaryMessenger = binaryMessenger; - final BinaryMessenger? _binaryMessenger; + WKPreferencesHostApi( + {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) + : __pigeon_binaryMessenger = binaryMessenger, + __pigeon_messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + final BinaryMessenger? __pigeon_binaryMessenger; + + static const MessageCodec pigeonChannelCodec = + StandardMessageCodec(); - static const MessageCodec codec = StandardMessageCodec(); + final String __pigeon_messageChannelSuffix; Future createFromWebViewConfiguration( - int arg_identifier, int arg_configurationIdentifier) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKPreferencesHostApi.createFromWebViewConfiguration', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = await channel - .send([arg_identifier, arg_configurationIdentifier]) - as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + int identifier, int configurationIdentifier) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKPreferencesHostApi.createFromWebViewConfiguration$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( + __pigeon_channelName, + pigeonChannelCodec, + binaryMessenger: __pigeon_binaryMessenger, + ); + final List? __pigeon_replyList = await __pigeon_channel + .send([identifier, configurationIdentifier]) as List?; + if (__pigeon_replyList == null) { + throw _createConnectionError(__pigeon_channelName); + } else if (__pigeon_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: __pigeon_replyList[0]! as String, + message: __pigeon_replyList[1] as String?, + details: __pigeon_replyList[2], ); } else { return; } } - Future setJavaScriptEnabled( - int arg_identifier, bool arg_enabled) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKPreferencesHostApi.setJavaScriptEnabled', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = await channel - .send([arg_identifier, arg_enabled]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + Future setJavaScriptEnabled(int identifier, bool enabled) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKPreferencesHostApi.setJavaScriptEnabled$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( + __pigeon_channelName, + pigeonChannelCodec, + binaryMessenger: __pigeon_binaryMessenger, + ); + final List? __pigeon_replyList = await __pigeon_channel + .send([identifier, enabled]) as List?; + if (__pigeon_replyList == null) { + throw _createConnectionError(__pigeon_channelName); + } else if (__pigeon_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: __pigeon_replyList[0]! as String, + message: __pigeon_replyList[1] as String?, + details: __pigeon_replyList[2], ); } else { return; @@ -1602,29 +1662,36 @@ class WKScriptMessageHandlerHostApi { /// Constructor for [WKScriptMessageHandlerHostApi]. The [binaryMessenger] named argument is /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. - WKScriptMessageHandlerHostApi({BinaryMessenger? binaryMessenger}) - : _binaryMessenger = binaryMessenger; - final BinaryMessenger? _binaryMessenger; - - static const MessageCodec codec = StandardMessageCodec(); - - Future create(int arg_identifier) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKScriptMessageHandlerHostApi.create', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + WKScriptMessageHandlerHostApi( + {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) + : __pigeon_binaryMessenger = binaryMessenger, + __pigeon_messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + final BinaryMessenger? __pigeon_binaryMessenger; + + static const MessageCodec pigeonChannelCodec = + StandardMessageCodec(); + + final String __pigeon_messageChannelSuffix; + + Future create(int identifier) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKScriptMessageHandlerHostApi.create$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( + __pigeon_channelName, + pigeonChannelCodec, + binaryMessenger: __pigeon_binaryMessenger, + ); + final List? __pigeon_replyList = + await __pigeon_channel.send([identifier]) as List?; + if (__pigeon_replyList == null) { + throw _createConnectionError(__pigeon_channelName); + } else if (__pigeon_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: __pigeon_replyList[0]! as String, + message: __pigeon_replyList[1] as String?, + details: __pigeon_replyList[2], ); } else { return; @@ -1659,23 +1726,29 @@ class _WKScriptMessageHandlerFlutterApiCodec extends StandardMessageCodec { /// /// See https://developer.apple.com/documentation/webkit/wkscriptmessagehandler?language=objc. abstract class WKScriptMessageHandlerFlutterApi { - static const MessageCodec codec = + static const MessageCodec pigeonChannelCodec = _WKScriptMessageHandlerFlutterApiCodec(); void didReceiveScriptMessage(int identifier, int userContentControllerIdentifier, WKScriptMessageData message); - static void setup(WKScriptMessageHandlerFlutterApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setUp( + WKScriptMessageHandlerFlutterApi? api, { + BinaryMessenger? binaryMessenger, + String messageChannelSuffix = '', + }) { + messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKScriptMessageHandlerFlutterApi.didReceiveScriptMessage', - codec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKScriptMessageHandlerFlutterApi.didReceiveScriptMessage$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - channel.setMessageHandler(null); + __pigeon_channel.setMessageHandler(null); } else { - channel.setMessageHandler((Object? message) async { + __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKScriptMessageHandlerFlutterApi.didReceiveScriptMessage was null.'); final List args = (message as List?)!; @@ -1712,29 +1785,36 @@ class WKNavigationDelegateHostApi { /// Constructor for [WKNavigationDelegateHostApi]. The [binaryMessenger] named argument is /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. - WKNavigationDelegateHostApi({BinaryMessenger? binaryMessenger}) - : _binaryMessenger = binaryMessenger; - final BinaryMessenger? _binaryMessenger; - - static const MessageCodec codec = StandardMessageCodec(); - - Future create(int arg_identifier) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegateHostApi.create', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + WKNavigationDelegateHostApi( + {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) + : __pigeon_binaryMessenger = binaryMessenger, + __pigeon_messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + final BinaryMessenger? __pigeon_binaryMessenger; + + static const MessageCodec pigeonChannelCodec = + StandardMessageCodec(); + + final String __pigeon_messageChannelSuffix; + + Future create(int identifier) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegateHostApi.create$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( + __pigeon_channelName, + pigeonChannelCodec, + binaryMessenger: __pigeon_binaryMessenger, + ); + final List? __pigeon_replyList = + await __pigeon_channel.send([identifier]) as List?; + if (__pigeon_replyList == null) { + throw _createConnectionError(__pigeon_channelName); + } else if (__pigeon_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: __pigeon_replyList[0]! as String, + message: __pigeon_replyList[1] as String?, + details: __pigeon_replyList[2], ); } else { return; @@ -1804,7 +1884,7 @@ class _WKNavigationDelegateFlutterApiCodec extends StandardMessageCodec { /// /// See https://developer.apple.com/documentation/webkit/wknavigationdelegate?language=objc. abstract class WKNavigationDelegateFlutterApi { - static const MessageCodec codec = + static const MessageCodec pigeonChannelCodec = _WKNavigationDelegateFlutterApiCodec(); void didFinishNavigation(int identifier, int webViewIdentifier, String? url); @@ -1834,17 +1914,23 @@ abstract class WKNavigationDelegateFlutterApi { Future didReceiveAuthenticationChallenge( int identifier, int webViewIdentifier, int challengeIdentifier); - static void setup(WKNavigationDelegateFlutterApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setUp( + WKNavigationDelegateFlutterApi? api, { + BinaryMessenger? binaryMessenger, + String messageChannelSuffix = '', + }) { + messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegateFlutterApi.didFinishNavigation', - codec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegateFlutterApi.didFinishNavigation$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - channel.setMessageHandler(null); + __pigeon_channel.setMessageHandler(null); } else { - channel.setMessageHandler((Object? message) async { + __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegateFlutterApi.didFinishNavigation was null.'); final List args = (message as List?)!; @@ -1869,14 +1955,15 @@ abstract class WKNavigationDelegateFlutterApi { } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegateFlutterApi.didStartProvisionalNavigation', - codec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegateFlutterApi.didStartProvisionalNavigation$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - channel.setMessageHandler(null); + __pigeon_channel.setMessageHandler(null); } else { - channel.setMessageHandler((Object? message) async { + __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegateFlutterApi.didStartProvisionalNavigation was null.'); final List args = (message as List?)!; @@ -1901,14 +1988,15 @@ abstract class WKNavigationDelegateFlutterApi { } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegateFlutterApi.decidePolicyForNavigationAction', - codec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegateFlutterApi.decidePolicyForNavigationAction$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - channel.setMessageHandler(null); + __pigeon_channel.setMessageHandler(null); } else { - channel.setMessageHandler((Object? message) async { + __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegateFlutterApi.decidePolicyForNavigationAction was null.'); final List args = (message as List?)!; @@ -1937,14 +2025,15 @@ abstract class WKNavigationDelegateFlutterApi { } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegateFlutterApi.decidePolicyForNavigationResponse', - codec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegateFlutterApi.decidePolicyForNavigationResponse$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - channel.setMessageHandler(null); + __pigeon_channel.setMessageHandler(null); } else { - channel.setMessageHandler((Object? message) async { + __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegateFlutterApi.decidePolicyForNavigationResponse was null.'); final List args = (message as List?)!; @@ -1973,14 +2062,15 @@ abstract class WKNavigationDelegateFlutterApi { } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegateFlutterApi.didFailNavigation', - codec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegateFlutterApi.didFailNavigation$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - channel.setMessageHandler(null); + __pigeon_channel.setMessageHandler(null); } else { - channel.setMessageHandler((Object? message) async { + __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegateFlutterApi.didFailNavigation was null.'); final List args = (message as List?)!; @@ -2007,14 +2097,15 @@ abstract class WKNavigationDelegateFlutterApi { } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegateFlutterApi.didFailProvisionalNavigation', - codec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegateFlutterApi.didFailProvisionalNavigation$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - channel.setMessageHandler(null); + __pigeon_channel.setMessageHandler(null); } else { - channel.setMessageHandler((Object? message) async { + __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegateFlutterApi.didFailProvisionalNavigation was null.'); final List args = (message as List?)!; @@ -2041,14 +2132,15 @@ abstract class WKNavigationDelegateFlutterApi { } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegateFlutterApi.webViewWebContentProcessDidTerminate', - codec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegateFlutterApi.webViewWebContentProcessDidTerminate$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - channel.setMessageHandler(null); + __pigeon_channel.setMessageHandler(null); } else { - channel.setMessageHandler((Object? message) async { + __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegateFlutterApi.webViewWebContentProcessDidTerminate was null.'); final List args = (message as List?)!; @@ -2072,14 +2164,15 @@ abstract class WKNavigationDelegateFlutterApi { } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegateFlutterApi.didReceiveAuthenticationChallenge', - codec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegateFlutterApi.didReceiveAuthenticationChallenge$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - channel.setMessageHandler(null); + __pigeon_channel.setMessageHandler(null); } else { - channel.setMessageHandler((Object? message) async { + __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegateFlutterApi.didReceiveAuthenticationChallenge was null.'); final List args = (message as List?)!; @@ -2139,85 +2232,88 @@ class NSObjectHostApi { /// Constructor for [NSObjectHostApi]. The [binaryMessenger] named argument is /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. - NSObjectHostApi({BinaryMessenger? binaryMessenger}) - : _binaryMessenger = binaryMessenger; - final BinaryMessenger? _binaryMessenger; - - static const MessageCodec codec = _NSObjectHostApiCodec(); - - Future dispose(int arg_identifier) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.NSObjectHostApi.dispose', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + NSObjectHostApi( + {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) + : __pigeon_binaryMessenger = binaryMessenger, + __pigeon_messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + final BinaryMessenger? __pigeon_binaryMessenger; + + static const MessageCodec pigeonChannelCodec = + _NSObjectHostApiCodec(); + + final String __pigeon_messageChannelSuffix; + + Future dispose(int identifier) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.NSObjectHostApi.dispose$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( + __pigeon_channelName, + pigeonChannelCodec, + binaryMessenger: __pigeon_binaryMessenger, + ); + final List? __pigeon_replyList = + await __pigeon_channel.send([identifier]) as List?; + if (__pigeon_replyList == null) { + throw _createConnectionError(__pigeon_channelName); + } else if (__pigeon_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: __pigeon_replyList[0]! as String, + message: __pigeon_replyList[1] as String?, + details: __pigeon_replyList[2], ); } else { return; } } - Future addObserver( - int arg_identifier, - int arg_observerIdentifier, - String arg_keyPath, - List arg_options) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.NSObjectHostApi.addObserver', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send([ - arg_identifier, - arg_observerIdentifier, - arg_keyPath, - arg_options - ]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + Future addObserver(int identifier, int observerIdentifier, + String keyPath, List options) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.NSObjectHostApi.addObserver$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( + __pigeon_channelName, + pigeonChannelCodec, + binaryMessenger: __pigeon_binaryMessenger, + ); + final List? __pigeon_replyList = await __pigeon_channel + .send([identifier, observerIdentifier, keyPath, options]) + as List?; + if (__pigeon_replyList == null) { + throw _createConnectionError(__pigeon_channelName); + } else if (__pigeon_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: __pigeon_replyList[0]! as String, + message: __pigeon_replyList[1] as String?, + details: __pigeon_replyList[2], ); } else { return; } } - Future removeObserver(int arg_identifier, int arg_observerIdentifier, - String arg_keyPath) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.NSObjectHostApi.removeObserver', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send( - [arg_identifier, arg_observerIdentifier, arg_keyPath]) + Future removeObserver( + int identifier, int observerIdentifier, String keyPath) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.NSObjectHostApi.removeObserver$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( + __pigeon_channelName, + pigeonChannelCodec, + binaryMessenger: __pigeon_binaryMessenger, + ); + final List? __pigeon_replyList = await __pigeon_channel + .send([identifier, observerIdentifier, keyPath]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + if (__pigeon_replyList == null) { + throw _createConnectionError(__pigeon_channelName); + } else if (__pigeon_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: __pigeon_replyList[0]! as String, + message: __pigeon_replyList[1] as String?, + details: __pigeon_replyList[2], ); } else { return; @@ -2257,7 +2353,8 @@ class _NSObjectFlutterApiCodec extends StandardMessageCodec { /// /// See https://developer.apple.com/documentation/objectivec/nsobject. abstract class NSObjectFlutterApi { - static const MessageCodec codec = _NSObjectFlutterApiCodec(); + static const MessageCodec pigeonChannelCodec = + _NSObjectFlutterApiCodec(); void observeValue( int identifier, @@ -2268,17 +2365,23 @@ abstract class NSObjectFlutterApi { void dispose(int identifier); - static void setup(NSObjectFlutterApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setUp( + NSObjectFlutterApi? api, { + BinaryMessenger? binaryMessenger, + String messageChannelSuffix = '', + }) { + messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.NSObjectFlutterApi.observeValue', - codec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_wkwebview.NSObjectFlutterApi.observeValue$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - channel.setMessageHandler(null); + __pigeon_channel.setMessageHandler(null); } else { - channel.setMessageHandler((Object? message) async { + __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.NSObjectFlutterApi.observeValue was null.'); final List args = (message as List?)!; @@ -2313,14 +2416,15 @@ abstract class NSObjectFlutterApi { } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.NSObjectFlutterApi.dispose', - codec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_wkwebview.NSObjectFlutterApi.dispose$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - channel.setMessageHandler(null); + __pigeon_channel.setMessageHandler(null); } else { - channel.setMessageHandler((Object? message) async { + __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.NSObjectFlutterApi.dispose was null.'); final List args = (message as List?)!; @@ -2472,56 +2576,60 @@ class WKWebViewHostApi { /// Constructor for [WKWebViewHostApi]. The [binaryMessenger] named argument is /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. - WKWebViewHostApi({BinaryMessenger? binaryMessenger}) - : _binaryMessenger = binaryMessenger; - final BinaryMessenger? _binaryMessenger; - - static const MessageCodec codec = _WKWebViewHostApiCodec(); - - Future create( - int arg_identifier, int arg_configurationIdentifier) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.create', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = await channel - .send([arg_identifier, arg_configurationIdentifier]) - as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + WKWebViewHostApi( + {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) + : __pigeon_binaryMessenger = binaryMessenger, + __pigeon_messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + final BinaryMessenger? __pigeon_binaryMessenger; + + static const MessageCodec pigeonChannelCodec = + _WKWebViewHostApiCodec(); + + final String __pigeon_messageChannelSuffix; + + Future create(int identifier, int configurationIdentifier) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.create$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( + __pigeon_channelName, + pigeonChannelCodec, + binaryMessenger: __pigeon_binaryMessenger, + ); + final List? __pigeon_replyList = await __pigeon_channel + .send([identifier, configurationIdentifier]) as List?; + if (__pigeon_replyList == null) { + throw _createConnectionError(__pigeon_channelName); + } else if (__pigeon_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: __pigeon_replyList[0]! as String, + message: __pigeon_replyList[1] as String?, + details: __pigeon_replyList[2], ); } else { return; } } - Future setUIDelegate( - int arg_identifier, int? arg_uiDelegateIdentifier) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.setUIDelegate', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_uiDelegateIdentifier]) - as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + Future setUIDelegate(int identifier, int? uiDelegateIdentifier) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.setUIDelegate$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( + __pigeon_channelName, + pigeonChannelCodec, + binaryMessenger: __pigeon_binaryMessenger, + ); + final List? __pigeon_replyList = await __pigeon_channel + .send([identifier, uiDelegateIdentifier]) as List?; + if (__pigeon_replyList == null) { + throw _createConnectionError(__pigeon_channelName); + } else if (__pigeon_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: __pigeon_replyList[0]! as String, + message: __pigeon_replyList[1] as String?, + details: __pigeon_replyList[2], ); } else { return; @@ -2529,99 +2637,102 @@ class WKWebViewHostApi { } Future setNavigationDelegate( - int arg_identifier, int? arg_navigationDelegateIdentifier) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.setNavigationDelegate', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = await channel - .send([arg_identifier, arg_navigationDelegateIdentifier]) + int identifier, int? navigationDelegateIdentifier) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.setNavigationDelegate$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( + __pigeon_channelName, + pigeonChannelCodec, + binaryMessenger: __pigeon_binaryMessenger, + ); + final List? __pigeon_replyList = await __pigeon_channel + .send([identifier, navigationDelegateIdentifier]) as List?; - if (replyList == null) { + if (__pigeon_replyList == null) { + throw _createConnectionError(__pigeon_channelName); + } else if (__pigeon_replyList.length > 1) { throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { - throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: __pigeon_replyList[0]! as String, + message: __pigeon_replyList[1] as String?, + details: __pigeon_replyList[2], ); } else { return; } } - Future getUrl(int arg_identifier) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.getUrl', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + Future getUrl(int identifier) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.getUrl$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( + __pigeon_channelName, + pigeonChannelCodec, + binaryMessenger: __pigeon_binaryMessenger, + ); + final List? __pigeon_replyList = + await __pigeon_channel.send([identifier]) as List?; + if (__pigeon_replyList == null) { + throw _createConnectionError(__pigeon_channelName); + } else if (__pigeon_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: __pigeon_replyList[0]! as String, + message: __pigeon_replyList[1] as String?, + details: __pigeon_replyList[2], ); } else { - return (replyList[0] as String?); + return (__pigeon_replyList[0] as String?); } } - Future getEstimatedProgress(int arg_identifier) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.getEstimatedProgress', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + Future getEstimatedProgress(int identifier) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.getEstimatedProgress$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( + __pigeon_channelName, + pigeonChannelCodec, + binaryMessenger: __pigeon_binaryMessenger, + ); + final List? __pigeon_replyList = + await __pigeon_channel.send([identifier]) as List?; + if (__pigeon_replyList == null) { + throw _createConnectionError(__pigeon_channelName); + } else if (__pigeon_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: __pigeon_replyList[0]! as String, + message: __pigeon_replyList[1] as String?, + details: __pigeon_replyList[2], ); - } else if (replyList[0] == null) { + } else if (__pigeon_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (replyList[0] as double?)!; + return (__pigeon_replyList[0] as double?)!; } } - Future loadRequest( - int arg_identifier, NSUrlRequestData arg_request) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.loadRequest', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = await channel - .send([arg_identifier, arg_request]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + Future loadRequest(int identifier, NSUrlRequestData request) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.loadRequest$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( + __pigeon_channelName, + pigeonChannelCodec, + binaryMessenger: __pigeon_binaryMessenger, + ); + final List? __pigeon_replyList = await __pigeon_channel + .send([identifier, request]) as List?; + if (__pigeon_replyList == null) { + throw _createConnectionError(__pigeon_channelName); + } else if (__pigeon_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: __pigeon_replyList[0]! as String, + message: __pigeon_replyList[1] as String?, + details: __pigeon_replyList[2], ); } else { return; @@ -2629,24 +2740,24 @@ class WKWebViewHostApi { } Future loadHtmlString( - int arg_identifier, String arg_string, String? arg_baseUrl) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.loadHtmlString', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_string, arg_baseUrl]) - as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + int identifier, String string, String? baseUrl) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.loadHtmlString$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( + __pigeon_channelName, + pigeonChannelCodec, + binaryMessenger: __pigeon_binaryMessenger, + ); + final List? __pigeon_replyList = await __pigeon_channel + .send([identifier, string, baseUrl]) as List?; + if (__pigeon_replyList == null) { + throw _createConnectionError(__pigeon_channelName); + } else if (__pigeon_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: __pigeon_replyList[0]! as String, + message: __pigeon_replyList[1] as String?, + details: __pigeon_replyList[2], ); } else { return; @@ -2654,243 +2765,251 @@ class WKWebViewHostApi { } Future loadFileUrl( - int arg_identifier, String arg_url, String arg_readAccessUrl) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.loadFileUrl', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = await channel - .send([arg_identifier, arg_url, arg_readAccessUrl]) - as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + int identifier, String url, String readAccessUrl) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.loadFileUrl$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( + __pigeon_channelName, + pigeonChannelCodec, + binaryMessenger: __pigeon_binaryMessenger, + ); + final List? __pigeon_replyList = await __pigeon_channel + .send([identifier, url, readAccessUrl]) as List?; + if (__pigeon_replyList == null) { + throw _createConnectionError(__pigeon_channelName); + } else if (__pigeon_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: __pigeon_replyList[0]! as String, + message: __pigeon_replyList[1] as String?, + details: __pigeon_replyList[2], ); } else { return; } } - Future loadFlutterAsset(int arg_identifier, String arg_key) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.loadFlutterAsset', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = await channel - .send([arg_identifier, arg_key]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + Future loadFlutterAsset(int identifier, String key) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.loadFlutterAsset$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( + __pigeon_channelName, + pigeonChannelCodec, + binaryMessenger: __pigeon_binaryMessenger, + ); + final List? __pigeon_replyList = await __pigeon_channel + .send([identifier, key]) as List?; + if (__pigeon_replyList == null) { + throw _createConnectionError(__pigeon_channelName); + } else if (__pigeon_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: __pigeon_replyList[0]! as String, + message: __pigeon_replyList[1] as String?, + details: __pigeon_replyList[2], ); } else { return; } } - Future canGoBack(int arg_identifier) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.canGoBack', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + Future canGoBack(int identifier) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.canGoBack$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( + __pigeon_channelName, + pigeonChannelCodec, + binaryMessenger: __pigeon_binaryMessenger, + ); + final List? __pigeon_replyList = + await __pigeon_channel.send([identifier]) as List?; + if (__pigeon_replyList == null) { + throw _createConnectionError(__pigeon_channelName); + } else if (__pigeon_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: __pigeon_replyList[0]! as String, + message: __pigeon_replyList[1] as String?, + details: __pigeon_replyList[2], ); - } else if (replyList[0] == null) { + } else if (__pigeon_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 (__pigeon_replyList[0] as bool?)!; } } - Future canGoForward(int arg_identifier) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.canGoForward', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + Future canGoForward(int identifier) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.canGoForward$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( + __pigeon_channelName, + pigeonChannelCodec, + binaryMessenger: __pigeon_binaryMessenger, + ); + final List? __pigeon_replyList = + await __pigeon_channel.send([identifier]) as List?; + if (__pigeon_replyList == null) { + throw _createConnectionError(__pigeon_channelName); + } else if (__pigeon_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: __pigeon_replyList[0]! as String, + message: __pigeon_replyList[1] as String?, + details: __pigeon_replyList[2], ); - } else if (replyList[0] == null) { + } else if (__pigeon_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 (__pigeon_replyList[0] as bool?)!; } } - Future goBack(int arg_identifier) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.goBack', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + Future goBack(int identifier) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.goBack$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( + __pigeon_channelName, + pigeonChannelCodec, + binaryMessenger: __pigeon_binaryMessenger, + ); + final List? __pigeon_replyList = + await __pigeon_channel.send([identifier]) as List?; + if (__pigeon_replyList == null) { + throw _createConnectionError(__pigeon_channelName); + } else if (__pigeon_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: __pigeon_replyList[0]! as String, + message: __pigeon_replyList[1] as String?, + details: __pigeon_replyList[2], ); } else { return; } } - Future goForward(int arg_identifier) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.goForward', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + Future goForward(int identifier) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.goForward$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( + __pigeon_channelName, + pigeonChannelCodec, + binaryMessenger: __pigeon_binaryMessenger, + ); + final List? __pigeon_replyList = + await __pigeon_channel.send([identifier]) as List?; + if (__pigeon_replyList == null) { + throw _createConnectionError(__pigeon_channelName); + } else if (__pigeon_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: __pigeon_replyList[0]! as String, + message: __pigeon_replyList[1] as String?, + details: __pigeon_replyList[2], ); } else { return; } } - Future reload(int arg_identifier) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.reload', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + Future reload(int identifier) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.reload$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( + __pigeon_channelName, + pigeonChannelCodec, + binaryMessenger: __pigeon_binaryMessenger, + ); + final List? __pigeon_replyList = + await __pigeon_channel.send([identifier]) as List?; + if (__pigeon_replyList == null) { + throw _createConnectionError(__pigeon_channelName); + } else if (__pigeon_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: __pigeon_replyList[0]! as String, + message: __pigeon_replyList[1] as String?, + details: __pigeon_replyList[2], ); } else { return; } } - Future getTitle(int arg_identifier) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.getTitle', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + Future getTitle(int identifier) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.getTitle$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( + __pigeon_channelName, + pigeonChannelCodec, + binaryMessenger: __pigeon_binaryMessenger, + ); + final List? __pigeon_replyList = + await __pigeon_channel.send([identifier]) as List?; + if (__pigeon_replyList == null) { + throw _createConnectionError(__pigeon_channelName); + } else if (__pigeon_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: __pigeon_replyList[0]! as String, + message: __pigeon_replyList[1] as String?, + details: __pigeon_replyList[2], ); } else { - return (replyList[0] as String?); + return (__pigeon_replyList[0] as String?); } } Future setAllowsBackForwardNavigationGestures( - int arg_identifier, bool arg_allow) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.setAllowsBackForwardNavigationGestures', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = await channel - .send([arg_identifier, arg_allow]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + int identifier, bool allow) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.setAllowsBackForwardNavigationGestures$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( + __pigeon_channelName, + pigeonChannelCodec, + binaryMessenger: __pigeon_binaryMessenger, + ); + final List? __pigeon_replyList = await __pigeon_channel + .send([identifier, allow]) as List?; + if (__pigeon_replyList == null) { + throw _createConnectionError(__pigeon_channelName); + } else if (__pigeon_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: __pigeon_replyList[0]! as String, + message: __pigeon_replyList[1] as String?, + details: __pigeon_replyList[2], ); } else { return; } } - Future setCustomUserAgent( - int arg_identifier, String? arg_userAgent) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.setCustomUserAgent', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = await channel - .send([arg_identifier, arg_userAgent]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + Future setCustomUserAgent(int identifier, String? userAgent) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.setCustomUserAgent$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( + __pigeon_channelName, + pigeonChannelCodec, + binaryMessenger: __pigeon_binaryMessenger, + ); + final List? __pigeon_replyList = await __pigeon_channel + .send([identifier, userAgent]) as List?; + if (__pigeon_replyList == null) { + throw _createConnectionError(__pigeon_channelName); + } else if (__pigeon_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: __pigeon_replyList[0]! as String, + message: __pigeon_replyList[1] as String?, + details: __pigeon_replyList[2], ); } else { return; @@ -2898,73 +3017,75 @@ class WKWebViewHostApi { } Future evaluateJavaScript( - int arg_identifier, String arg_javaScriptString) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.evaluateJavaScript', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_javaScriptString]) - as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + int identifier, String javaScriptString) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.evaluateJavaScript$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( + __pigeon_channelName, + pigeonChannelCodec, + binaryMessenger: __pigeon_binaryMessenger, + ); + final List? __pigeon_replyList = await __pigeon_channel + .send([identifier, javaScriptString]) as List?; + if (__pigeon_replyList == null) { + throw _createConnectionError(__pigeon_channelName); + } else if (__pigeon_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: __pigeon_replyList[0]! as String, + message: __pigeon_replyList[1] as String?, + details: __pigeon_replyList[2], ); } else { - return replyList[0]; + return __pigeon_replyList[0]; } } - Future setInspectable(int arg_identifier, bool arg_inspectable) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.setInspectable', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = await channel - .send([arg_identifier, arg_inspectable]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + Future setInspectable(int identifier, bool inspectable) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.setInspectable$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( + __pigeon_channelName, + pigeonChannelCodec, + binaryMessenger: __pigeon_binaryMessenger, + ); + final List? __pigeon_replyList = await __pigeon_channel + .send([identifier, inspectable]) as List?; + if (__pigeon_replyList == null) { + throw _createConnectionError(__pigeon_channelName); + } else if (__pigeon_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: __pigeon_replyList[0]! as String, + message: __pigeon_replyList[1] as String?, + details: __pigeon_replyList[2], ); } else { return; } } - Future getCustomUserAgent(int arg_identifier) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.getCustomUserAgent', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + Future getCustomUserAgent(int identifier) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.getCustomUserAgent$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( + __pigeon_channelName, + pigeonChannelCodec, + binaryMessenger: __pigeon_binaryMessenger, + ); + final List? __pigeon_replyList = + await __pigeon_channel.send([identifier]) as List?; + if (__pigeon_replyList == null) { + throw _createConnectionError(__pigeon_channelName); + } else if (__pigeon_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: __pigeon_replyList[0]! as String, + message: __pigeon_replyList[1] as String?, + details: __pigeon_replyList[2], ); } else { - return (replyList[0] as String?); + return (__pigeon_replyList[0] as String?); } } } @@ -2976,29 +3097,36 @@ class WKUIDelegateHostApi { /// Constructor for [WKUIDelegateHostApi]. The [binaryMessenger] named argument is /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. - WKUIDelegateHostApi({BinaryMessenger? binaryMessenger}) - : _binaryMessenger = binaryMessenger; - final BinaryMessenger? _binaryMessenger; - - static const MessageCodec codec = StandardMessageCodec(); - - Future create(int arg_identifier) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegateHostApi.create', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + WKUIDelegateHostApi( + {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) + : __pigeon_binaryMessenger = binaryMessenger, + __pigeon_messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + final BinaryMessenger? __pigeon_binaryMessenger; + + static const MessageCodec pigeonChannelCodec = + StandardMessageCodec(); + + final String __pigeon_messageChannelSuffix; + + Future create(int identifier) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegateHostApi.create$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( + __pigeon_channelName, + pigeonChannelCodec, + binaryMessenger: __pigeon_binaryMessenger, + ); + final List? __pigeon_replyList = + await __pigeon_channel.send([identifier]) as List?; + if (__pigeon_replyList == null) { + throw _createConnectionError(__pigeon_channelName); + } else if (__pigeon_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: __pigeon_replyList[0]! as String, + message: __pigeon_replyList[1] as String?, + details: __pigeon_replyList[2], ); } else { return; @@ -3058,7 +3186,8 @@ class _WKUIDelegateFlutterApiCodec extends StandardMessageCodec { /// /// See https://developer.apple.com/documentation/webkit/wkuidelegate?language=objc. abstract class WKUIDelegateFlutterApi { - static const MessageCodec codec = _WKUIDelegateFlutterApiCodec(); + static const MessageCodec pigeonChannelCodec = + _WKUIDelegateFlutterApiCodec(); void onCreateWebView(int identifier, int webViewIdentifier, int configurationIdentifier, WKNavigationActionData navigationAction); @@ -3083,17 +3212,23 @@ abstract class WKUIDelegateFlutterApi { Future runJavaScriptTextInputPanel( int identifier, String prompt, String defaultText, WKFrameInfoData frame); - static void setup(WKUIDelegateFlutterApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setUp( + WKUIDelegateFlutterApi? api, { + BinaryMessenger? binaryMessenger, + String messageChannelSuffix = '', + }) { + messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegateFlutterApi.onCreateWebView', - codec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegateFlutterApi.onCreateWebView$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - channel.setMessageHandler(null); + __pigeon_channel.setMessageHandler(null); } else { - channel.setMessageHandler((Object? message) async { + __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegateFlutterApi.onCreateWebView was null.'); final List args = (message as List?)!; @@ -3124,14 +3259,15 @@ abstract class WKUIDelegateFlutterApi { } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegateFlutterApi.requestMediaCapturePermission', - codec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegateFlutterApi.requestMediaCapturePermission$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - channel.setMessageHandler(null); + __pigeon_channel.setMessageHandler(null); } else { - channel.setMessageHandler((Object? message) async { + __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegateFlutterApi.requestMediaCapturePermission was null.'); final List args = (message as List?)!; @@ -3167,14 +3303,15 @@ abstract class WKUIDelegateFlutterApi { } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegateFlutterApi.runJavaScriptAlertPanel', - codec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegateFlutterApi.runJavaScriptAlertPanel$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - channel.setMessageHandler(null); + __pigeon_channel.setMessageHandler(null); } else { - channel.setMessageHandler((Object? message) async { + __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegateFlutterApi.runJavaScriptAlertPanel was null.'); final List args = (message as List?)!; @@ -3201,14 +3338,15 @@ abstract class WKUIDelegateFlutterApi { } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegateFlutterApi.runJavaScriptConfirmPanel', - codec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegateFlutterApi.runJavaScriptConfirmPanel$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - channel.setMessageHandler(null); + __pigeon_channel.setMessageHandler(null); } else { - channel.setMessageHandler((Object? message) async { + __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegateFlutterApi.runJavaScriptConfirmPanel was null.'); final List args = (message as List?)!; @@ -3235,14 +3373,15 @@ abstract class WKUIDelegateFlutterApi { } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegateFlutterApi.runJavaScriptTextInputPanel', - codec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegateFlutterApi.runJavaScriptTextInputPanel$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - channel.setMessageHandler(null); + __pigeon_channel.setMessageHandler(null); } else { - channel.setMessageHandler((Object? message) async { + __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegateFlutterApi.runJavaScriptTextInputPanel was null.'); final List args = (message as List?)!; @@ -3309,55 +3448,62 @@ class WKHttpCookieStoreHostApi { /// Constructor for [WKHttpCookieStoreHostApi]. The [binaryMessenger] named argument is /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. - WKHttpCookieStoreHostApi({BinaryMessenger? binaryMessenger}) - : _binaryMessenger = binaryMessenger; - final BinaryMessenger? _binaryMessenger; + WKHttpCookieStoreHostApi( + {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) + : __pigeon_binaryMessenger = binaryMessenger, + __pigeon_messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + final BinaryMessenger? __pigeon_binaryMessenger; - static const MessageCodec codec = _WKHttpCookieStoreHostApiCodec(); + static const MessageCodec pigeonChannelCodec = + _WKHttpCookieStoreHostApiCodec(); + + final String __pigeon_messageChannelSuffix; Future createFromWebsiteDataStore( - int arg_identifier, int arg_websiteDataStoreIdentifier) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKHttpCookieStoreHostApi.createFromWebsiteDataStore', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = await channel - .send([arg_identifier, arg_websiteDataStoreIdentifier]) + int identifier, int websiteDataStoreIdentifier) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKHttpCookieStoreHostApi.createFromWebsiteDataStore$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( + __pigeon_channelName, + pigeonChannelCodec, + binaryMessenger: __pigeon_binaryMessenger, + ); + final List? __pigeon_replyList = await __pigeon_channel + .send([identifier, websiteDataStoreIdentifier]) as List?; - if (replyList == null) { + if (__pigeon_replyList == null) { + throw _createConnectionError(__pigeon_channelName); + } else if (__pigeon_replyList.length > 1) { throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { - throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: __pigeon_replyList[0]! as String, + message: __pigeon_replyList[1] as String?, + details: __pigeon_replyList[2], ); } else { return; } } - Future setCookie( - int arg_identifier, NSHttpCookieData arg_cookie) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKHttpCookieStoreHostApi.setCookie', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = await channel - .send([arg_identifier, arg_cookie]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + Future setCookie(int identifier, NSHttpCookieData cookie) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKHttpCookieStoreHostApi.setCookie$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( + __pigeon_channelName, + pigeonChannelCodec, + binaryMessenger: __pigeon_binaryMessenger, + ); + final List? __pigeon_replyList = await __pigeon_channel + .send([identifier, cookie]) as List?; + if (__pigeon_replyList == null) { + throw _createConnectionError(__pigeon_channelName); + } else if (__pigeon_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: __pigeon_replyList[0]! as String, + message: __pigeon_replyList[1] as String?, + details: __pigeon_replyList[2], ); } else { return; @@ -3376,32 +3522,39 @@ class NSUrlHostApi { /// Constructor for [NSUrlHostApi]. The [binaryMessenger] named argument is /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. - NSUrlHostApi({BinaryMessenger? binaryMessenger}) - : _binaryMessenger = binaryMessenger; - final BinaryMessenger? _binaryMessenger; - - static const MessageCodec codec = StandardMessageCodec(); - - Future getAbsoluteString(int arg_identifier) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.NSUrlHostApi.getAbsoluteString', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + NSUrlHostApi( + {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) + : __pigeon_binaryMessenger = binaryMessenger, + __pigeon_messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + final BinaryMessenger? __pigeon_binaryMessenger; + + static const MessageCodec pigeonChannelCodec = + StandardMessageCodec(); + + final String __pigeon_messageChannelSuffix; + + Future getAbsoluteString(int identifier) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.NSUrlHostApi.getAbsoluteString$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( + __pigeon_channelName, + pigeonChannelCodec, + binaryMessenger: __pigeon_binaryMessenger, + ); + final List? __pigeon_replyList = + await __pigeon_channel.send([identifier]) as List?; + if (__pigeon_replyList == null) { + throw _createConnectionError(__pigeon_channelName); + } else if (__pigeon_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: __pigeon_replyList[0]! as String, + message: __pigeon_replyList[1] as String?, + details: __pigeon_replyList[2], ); } else { - return (replyList[0] as String?); + return (__pigeon_replyList[0] as String?); } } } @@ -3414,20 +3567,28 @@ class NSUrlHostApi { /// /// See https://developer.apple.com/documentation/foundation/nsurl?language=objc. abstract class NSUrlFlutterApi { - static const MessageCodec codec = StandardMessageCodec(); + static const MessageCodec pigeonChannelCodec = + StandardMessageCodec(); void create(int identifier); - static void setup(NSUrlFlutterApi? api, {BinaryMessenger? binaryMessenger}) { + static void setUp( + NSUrlFlutterApi? api, { + BinaryMessenger? binaryMessenger, + String messageChannelSuffix = '', + }) { + messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.NSUrlFlutterApi.create', - codec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_wkwebview.NSUrlFlutterApi.create$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - channel.setMessageHandler(null); + __pigeon_channel.setMessageHandler(null); } else { - channel.setMessageHandler((Object? message) async { + __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.NSUrlFlutterApi.create was null.'); final List args = (message as List?)!; @@ -3460,29 +3621,36 @@ class UIScrollViewDelegateHostApi { /// Constructor for [UIScrollViewDelegateHostApi]. The [binaryMessenger] named argument is /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. - UIScrollViewDelegateHostApi({BinaryMessenger? binaryMessenger}) - : _binaryMessenger = binaryMessenger; - final BinaryMessenger? _binaryMessenger; - - static const MessageCodec codec = StandardMessageCodec(); - - Future create(int arg_identifier) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewDelegateHostApi.create', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + UIScrollViewDelegateHostApi( + {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) + : __pigeon_binaryMessenger = binaryMessenger, + __pigeon_messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + final BinaryMessenger? __pigeon_binaryMessenger; + + static const MessageCodec pigeonChannelCodec = + StandardMessageCodec(); + + final String __pigeon_messageChannelSuffix; + + Future create(int identifier) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewDelegateHostApi.create$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( + __pigeon_channelName, + pigeonChannelCodec, + binaryMessenger: __pigeon_binaryMessenger, + ); + final List? __pigeon_replyList = + await __pigeon_channel.send([identifier]) as List?; + if (__pigeon_replyList == null) { + throw _createConnectionError(__pigeon_channelName); + } else if (__pigeon_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: __pigeon_replyList[0]! as String, + message: __pigeon_replyList[1] as String?, + details: __pigeon_replyList[2], ); } else { return; @@ -3494,22 +3662,29 @@ class UIScrollViewDelegateHostApi { /// /// See https://developer.apple.com/documentation/uikit/uiscrollviewdelegate?language=objc. abstract class UIScrollViewDelegateFlutterApi { - static const MessageCodec codec = StandardMessageCodec(); + static const MessageCodec pigeonChannelCodec = + StandardMessageCodec(); void scrollViewDidScroll( int identifier, int uiScrollViewIdentifier, double x, double y); - static void setup(UIScrollViewDelegateFlutterApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setUp( + UIScrollViewDelegateFlutterApi? api, { + BinaryMessenger? binaryMessenger, + String messageChannelSuffix = '', + }) { + messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewDelegateFlutterApi.scrollViewDidScroll', - codec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewDelegateFlutterApi.scrollViewDidScroll$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - channel.setMessageHandler(null); + __pigeon_channel.setMessageHandler(null); } else { - channel.setMessageHandler((Object? message) async { + __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewDelegateFlutterApi.scrollViewDidScroll was null.'); final List args = (message as List?)!; @@ -3552,35 +3727,39 @@ class NSUrlCredentialHostApi { /// Constructor for [NSUrlCredentialHostApi]. The [binaryMessenger] named argument is /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. - NSUrlCredentialHostApi({BinaryMessenger? binaryMessenger}) - : _binaryMessenger = binaryMessenger; - final BinaryMessenger? _binaryMessenger; + NSUrlCredentialHostApi( + {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) + : __pigeon_binaryMessenger = binaryMessenger, + __pigeon_messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + final BinaryMessenger? __pigeon_binaryMessenger; + + static const MessageCodec pigeonChannelCodec = + StandardMessageCodec(); - static const MessageCodec codec = StandardMessageCodec(); + final String __pigeon_messageChannelSuffix; /// Create a new native instance and add it to the `InstanceManager`. - Future createWithUser(int arg_identifier, String arg_user, - String arg_password, NSUrlCredentialPersistence arg_persistence) async { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.NSUrlCredentialHostApi.createWithUser', - codec, - binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send([ - arg_identifier, - arg_user, - arg_password, - arg_persistence.index - ]) as List?; - if (replyList == null) { - throw PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel.', - ); - } else if (replyList.length > 1) { + Future createWithUser(int identifier, String user, String password, + NSUrlCredentialPersistence persistence) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.webview_flutter_wkwebview.NSUrlCredentialHostApi.createWithUser$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( + __pigeon_channelName, + pigeonChannelCodec, + binaryMessenger: __pigeon_binaryMessenger, + ); + final List? __pigeon_replyList = await __pigeon_channel + .send([identifier, user, password, persistence.index]) + as List?; + if (__pigeon_replyList == null) { + throw _createConnectionError(__pigeon_channelName); + } else if (__pigeon_replyList.length > 1) { throw PlatformException( - code: replyList[0]! as String, - message: replyList[1] as String?, - details: replyList[2], + code: __pigeon_replyList[0]! as String, + message: __pigeon_replyList[1] as String?, + details: __pigeon_replyList[2], ); } else { return; @@ -3596,23 +3775,30 @@ class NSUrlCredentialHostApi { /// /// See https://developer.apple.com/documentation/foundation/nsurlprotectionspace?language=objc. abstract class NSUrlProtectionSpaceFlutterApi { - static const MessageCodec codec = StandardMessageCodec(); + static const MessageCodec pigeonChannelCodec = + StandardMessageCodec(); /// Create a new Dart instance and add it to the `InstanceManager`. void create(int identifier, String? host, String? realm, String? authenticationMethod); - static void setup(NSUrlProtectionSpaceFlutterApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setUp( + NSUrlProtectionSpaceFlutterApi? api, { + BinaryMessenger? binaryMessenger, + String messageChannelSuffix = '', + }) { + messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.NSUrlProtectionSpaceFlutterApi.create', - codec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_wkwebview.NSUrlProtectionSpaceFlutterApi.create$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - channel.setMessageHandler(null); + __pigeon_channel.setMessageHandler(null); } else { - channel.setMessageHandler((Object? message) async { + __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.NSUrlProtectionSpaceFlutterApi.create was null.'); final List args = (message as List?)!; @@ -3646,22 +3832,29 @@ abstract class NSUrlProtectionSpaceFlutterApi { /// /// See https://developer.apple.com/documentation/foundation/nsurlauthenticationchallenge?language=objc. abstract class NSUrlAuthenticationChallengeFlutterApi { - static const MessageCodec codec = StandardMessageCodec(); + static const MessageCodec pigeonChannelCodec = + StandardMessageCodec(); /// Create a new Dart instance and add it to the `InstanceManager`. void create(int identifier, int protectionSpaceIdentifier); - static void setup(NSUrlAuthenticationChallengeFlutterApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setUp( + NSUrlAuthenticationChallengeFlutterApi? api, { + BinaryMessenger? binaryMessenger, + String messageChannelSuffix = '', + }) { + messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.NSUrlAuthenticationChallengeFlutterApi.create', - codec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_wkwebview.NSUrlAuthenticationChallengeFlutterApi.create$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - channel.setMessageHandler(null); + __pigeon_channel.setMessageHandler(null); } else { - channel.setMessageHandler((Object? message) async { + __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.NSUrlAuthenticationChallengeFlutterApi.create was null.'); final List args = (message as List?)!; diff --git a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/foundation/foundation.dart b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/foundation/foundation.dart index 1dabbd0c24a5..2df5c9efc6cd 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/foundation/foundation.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/foundation/foundation.dart @@ -505,6 +505,9 @@ class NSUrlAuthenticationMethod { /// Use HTTP digest authentication for this protection space. static const String httpDigest = 'NSURLAuthenticationMethodHTTPDigest'; + + /// Use NTLM authentication for this protection space. + static const String httpNtlm = 'NSURLAuthenticationMethodNTLM'; } /// A challenge from a server requiring authentication from the client. diff --git a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/foundation/foundation_api_impls.dart b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/foundation/foundation_api_impls.dart index fd8dc58a6ccd..293ce29bbbec 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/foundation/foundation_api_impls.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/foundation/foundation_api_impls.dart @@ -100,16 +100,16 @@ class FoundationFlutterApis { /// Ensures all the Flutter APIs have been set up to receive calls from native code. void ensureSetUp() { if (!_hasBeenSetUp) { - NSObjectFlutterApi.setup( + NSObjectFlutterApi.setUp( object, binaryMessenger: _binaryMessenger, ); - NSUrlFlutterApi.setup(url, binaryMessenger: _binaryMessenger); - NSUrlProtectionSpaceFlutterApi.setup( + NSUrlFlutterApi.setUp(url, binaryMessenger: _binaryMessenger); + NSUrlProtectionSpaceFlutterApi.setUp( urlProtectionSpace, binaryMessenger: _binaryMessenger, ); - NSUrlAuthenticationChallengeFlutterApi.setup( + NSUrlAuthenticationChallengeFlutterApi.setUp( urlAuthenticationChallenge, binaryMessenger: _binaryMessenger, ); diff --git a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/legacy/web_kit_webview_widget.dart b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/legacy/web_kit_webview_widget.dart index 6c984ec50bc8..7a3795096dec 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/legacy/web_kit_webview_widget.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/legacy/web_kit_webview_widget.dart @@ -3,6 +3,7 @@ // found in the LICENSE file. import 'dart:async'; +import 'dart:io'; import 'dart:math'; import 'package:flutter/material.dart'; @@ -229,9 +230,16 @@ class WebKitWebViewPlatformController extends WebViewPlatformController { } if (params.backgroundColor != null) { - unawaited(webView.setOpaque(false)); - unawaited(webView.setBackgroundColor(Colors.transparent)); - unawaited(webView.scrollView.setBackgroundColor(params.backgroundColor)); + final WKWebView webView = this.webView; + if (webView is WKWebViewIOS) { + unawaited(webView.setOpaque(false)); + unawaited(webView.setBackgroundColor(Colors.transparent)); + unawaited( + webView.scrollView.setBackgroundColor(params.backgroundColor)); + } else { + // TODO(stuartmorgan): Investigate doing this via JS instead. + throw UnimplementedError('Background color is yet supported on macOS'); + } } if (params.initialUrl != null) { @@ -377,31 +385,51 @@ class WebKitWebViewPlatformController extends WebViewPlatformController { Future currentUrl() => webView.getUrl(); @override - Future scrollTo(int x, int y) { - return webView.scrollView.setContentOffset(Point( - x.toDouble(), - y.toDouble(), - )); + Future scrollTo(int x, int y) async { + final WKWebView webView = this.webView; + if (webView is WKWebViewIOS) { + return webView.scrollView.setContentOffset(Point( + x.toDouble(), + y.toDouble(), + )); + } else { + throw UnimplementedError('scrollTo is not supported on macOS'); + } } @override Future scrollBy(int x, int y) async { - await webView.scrollView.scrollBy(Point( - x.toDouble(), - y.toDouble(), - )); + final WKWebView webView = this.webView; + if (webView is WKWebViewIOS) { + await webView.scrollView.scrollBy(Point( + x.toDouble(), + y.toDouble(), + )); + } else { + throw UnimplementedError('scrollBy is not supported on macOS'); + } } @override Future getScrollX() async { - final Point offset = await webView.scrollView.getContentOffset(); - return offset.x.toInt(); + final WKWebView webView = this.webView; + if (webView is WKWebViewIOS) { + final Point offset = await webView.scrollView.getContentOffset(); + return offset.x.toInt(); + } else { + throw UnimplementedError('getScrollX is not supported on macOS'); + } } @override Future getScrollY() async { - final Point offset = await webView.scrollView.getContentOffset(); - return offset.y.toInt(); + final WKWebView webView = this.webView; + if (webView is WKWebViewIOS) { + final Point offset = await webView.scrollView.getContentOffset(); + return offset.y.toInt(); + } else { + throw UnimplementedError('getScrollY is not supported on macOS'); + } } @override @@ -640,7 +668,11 @@ class WebKitWebViewPlatformController extends WebViewPlatformController { @visibleForTesting class WebViewWidgetProxy { /// Constructs a [WebViewWidgetProxy]. - const WebViewWidgetProxy(); + const WebViewWidgetProxy({@visibleForTesting this.overriddenIsMacOS}); + + /// If set, replaces [Platform] checks when picking implementation classes. + @visibleForTesting + final bool? overriddenIsMacOS; /// Constructs a [WKWebView]. WKWebView createWebView( @@ -651,7 +683,11 @@ class WebViewWidgetProxy { Map change, )? observeValue, }) { - return WKWebView(configuration, observeValue: observeValue); + if (overriddenIsMacOS ?? Platform.isMacOS) { + return WKWebViewMacOS(configuration, observeValue: observeValue); + } else { + return WKWebViewIOS(configuration, observeValue: observeValue); + } } /// Constructs a [WKScriptMessageHandler]. diff --git a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/ui_kit/ui_kit.dart b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/ui_kit/ui_kit.dart index b3f5ebe79f6e..fe5a0a3343b1 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/ui_kit/ui_kit.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/ui_kit/ui_kit.dart @@ -18,7 +18,7 @@ import 'ui_kit_api_impls.dart'; /// /// Wraps [UIScrollView](https://developer.apple.com/documentation/uikit/uiscrollview?language=objc). @immutable -class UIScrollView extends UIView { +class UIScrollView extends UIViewBase { /// Constructs a [UIScrollView] that is owned by [webView]. factory UIScrollView.fromWebView( WKWebView webView, { @@ -94,17 +94,36 @@ class UIScrollView extends UIView { } } +/// Methods that anything implementing a class that inherits from UIView on the +/// native side must implement. +/// +/// Classes without a multiple inheritence problem should extend UIViewBase +/// instead of implementing this directly. +abstract class UIView implements NSObject { + /// The view’s background color. + /// + /// The default value is null, which results in a transparent background color. + /// + /// Sets [UIView.backgroundColor](https://developer.apple.com/documentation/uikit/uiview/1622591-backgroundcolor?language=objc). + Future setBackgroundColor(Color? color); + + /// Determines whether the view is opaque. + /// + /// Sets [UIView.opaque](https://developer.apple.com/documentation/uikit/uiview?language=objc). + Future setOpaque(bool opaque); +} + /// Manages the content for a rectangular area on the screen. /// /// Wraps [UIView](https://developer.apple.com/documentation/uikit/uiview?language=objc). @immutable -class UIView extends NSObject { +class UIViewBase extends NSObject implements UIView { /// Constructs a [UIView] without creating the associated /// Objective-C object. /// /// This should only be used by subclasses created by this library or to /// create copies. - UIView.detached({ + UIViewBase.detached({ super.observeValue, super.binaryMessenger, super.instanceManager, @@ -116,25 +135,19 @@ class UIView extends NSObject { final UIViewHostApiImpl _viewApi; - /// The view’s background color. - /// - /// The default value is null, which results in a transparent background color. - /// - /// Sets [UIView.backgroundColor](https://developer.apple.com/documentation/uikit/uiview/1622591-backgroundcolor?language=objc). + @override Future setBackgroundColor(Color? color) { return _viewApi.setBackgroundColorForInstances(this, color); } - /// Determines whether the view is opaque. - /// - /// Sets [UIView.opaque](https://developer.apple.com/documentation/uikit/uiview?language=objc). + @override Future setOpaque(bool opaque) { return _viewApi.setOpaqueForInstances(this, opaque); } @override UIView copy() { - return UIView.detached( + return UIViewBase.detached( observeValue: observeValue, binaryMessenger: _viewApi.binaryMessenger, instanceManager: _viewApi.instanceManager, diff --git a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/web_kit/web_kit.dart b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/web_kit/web_kit.dart index 11065ad0805f..d5dcf0fff309 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/web_kit/web_kit.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/web_kit/web_kit.dart @@ -8,6 +8,7 @@ import 'package:flutter/services.dart'; import '../common/instance_manager.dart'; import '../foundation/foundation.dart'; import '../ui_kit/ui_kit.dart'; +import '../ui_kit/ui_kit_api_impls.dart' show UIViewHostApiImpl; import 'web_kit_api_impls.dart'; export 'web_kit_api_impls.dart' @@ -1009,8 +1010,12 @@ class WKNavigationDelegate extends NSObject { /// Object that displays interactive web content, such as for an in-app browser. /// /// Wraps [WKWebView](https://developer.apple.com/documentation/webkit/wkwebview?language=objc). +/// +/// This is abstract, since iOS and macOS WKWebViews have different +/// implementation details; the concrete implementations are [WKWebViewIOS] and +/// [WKWebViewMacOS]. @immutable -class WKWebView extends UIView { +abstract class WKWebView extends NSObject { /// Constructs a [WKWebView]. /// /// [configuration] contains the configuration details for the web view. This @@ -1068,13 +1073,6 @@ class WKWebView extends UIView { instanceManager: _webViewApi.instanceManager, ); - /// The scrollable view associated with the web view. - late final UIScrollView scrollView = UIScrollView.fromWebView( - this, - binaryMessenger: _webViewApi.binaryMessenger, - instanceManager: _webViewApi.instanceManager, - ); - /// Used to integrate custom user interface elements into web view interactions. /// /// Sets [WKWebView.UIDelegate](https://developer.apple.com/documentation/webkit/wkwebview/1415009-uidelegate?language=objc). @@ -1163,6 +1161,13 @@ class WKWebView extends UIView { return _webViewApi.getTitleForInstances(this); } + /// The custom user agent string. + /// + /// Represents [WKWebView.customUserAgent](https://developer.apple.com/documentation/webkit/wkwebview/1414950-customuseragent?language=objc). + Future getCustomUserAgent() { + return _webViewApi.getCustomUserAgentForInstances(this); + } + /// Indicates whether horizontal swipe gestures trigger page navigation. /// /// The default value is false. @@ -1212,17 +1217,89 @@ class WKWebView extends UIView { inspectable, ); } +} - /// The custom user agent string. - /// - /// Represents [WKWebView.customUserAgent](https://developer.apple.com/documentation/webkit/wkwebview/1414950-customuseragent?language=objc). - Future getCustomUserAgent() { - return _webViewApi.getCustomUserAgentForInstances(this); +/// The iOS version of a WKWebView. +class WKWebViewIOS extends WKWebView implements UIView { + /// Constructs a new iOS WKWebView; see [WKWebView] for details. + WKWebViewIOS( + super.configuration, { + super.observeValue, + super.binaryMessenger, + super.instanceManager, + }) : _viewApi = UIViewHostApiImpl( + binaryMessenger: binaryMessenger, + instanceManager: instanceManager, + ), + super(); + + /// See [WKWebView.detached]. + WKWebViewIOS.detached({ + super.observeValue, + super.binaryMessenger, + super.instanceManager, + }) : _viewApi = UIViewHostApiImpl( + binaryMessenger: binaryMessenger, + instanceManager: instanceManager, + ), + super.detached(); + + /// The scrollable view associated with the web view. + late final UIScrollView scrollView = UIScrollView.fromWebView( + this, + binaryMessenger: _webViewApi.binaryMessenger, + instanceManager: _webViewApi.instanceManager, + ); + + @override + WKWebView copy() { + return WKWebViewIOS.detached( + observeValue: observeValue, + binaryMessenger: _webViewApi.binaryMessenger, + instanceManager: _webViewApi.instanceManager, + ); } + final UIViewHostApiImpl _viewApi; + + // UIView implementations. This is duplicated from the UIViewBase class since + // WKWebView can't inherit from UIView, so this is a workaround to multiple + // inheritance limitations. This is a way of dealing with the lack of + // preprocessor in Dart, which is how the native side has different base + // classes. If the amount of code here grows, this could become a mixin used + // by both UIViewBase and this class (at the cost of exposing the view API + // object, or adjusting files to allow it to stay private). + @override + Future setBackgroundColor(Color? color) { + return _viewApi.setBackgroundColorForInstances(this, color); + } + + @override + Future setOpaque(bool opaque) { + return _viewApi.setOpaqueForInstances(this, opaque); + } +} + +/// The macOS version of a WKWebView. +class WKWebViewMacOS extends WKWebView { + /// Constructs a new macOS WKWebView; see [WKWebView] for details. + WKWebViewMacOS( + super.configuration, { + super.observeValue, + super.binaryMessenger, + super.instanceManager, + }) : super(); + + /// See [WKWebView.detached]. + WKWebViewMacOS.detached({ + super.observeValue, + super.binaryMessenger, + super.instanceManager, + }) : super.detached(); + @override WKWebView copy() { - return WKWebView.detached( + return WKWebViewMacOS.detached( observeValue: observeValue, binaryMessenger: _webViewApi.binaryMessenger, instanceManager: _webViewApi.instanceManager, diff --git a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/web_kit/web_kit_api_impls.dart b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/web_kit/web_kit_api_impls.dart index bdcc19eafd6b..1caa1ccc5b09 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/web_kit/web_kit_api_impls.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/web_kit/web_kit_api_impls.dart @@ -301,23 +301,23 @@ class WebKitFlutterApis { /// Ensures all the Flutter APIs have been set up to receive calls from native code. void ensureSetUp() { if (!_hasBeenSetUp) { - WKNavigationDelegateFlutterApi.setup( + WKNavigationDelegateFlutterApi.setUp( navigationDelegate, binaryMessenger: _binaryMessenger, ); - WKScriptMessageHandlerFlutterApi.setup( + WKScriptMessageHandlerFlutterApi.setUp( scriptMessageHandler, binaryMessenger: _binaryMessenger, ); - WKUIDelegateFlutterApi.setup( + WKUIDelegateFlutterApi.setUp( uiDelegate, binaryMessenger: _binaryMessenger, ); - WKWebViewConfigurationFlutterApi.setup( + WKWebViewConfigurationFlutterApi.setUp( webViewConfiguration, binaryMessenger: _binaryMessenger, ); - UIScrollViewDelegateFlutterApi.setup(uiScrollViewDelegate, + UIScrollViewDelegateFlutterApi.setUp(uiScrollViewDelegate, binaryMessenger: _binaryMessenger); _hasBeenSetUp = true; } diff --git a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/webkit_proxy.dart b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/webkit_proxy.dart index ffd9b845eab6..82277babadee 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/webkit_proxy.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/webkit_proxy.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'; + import 'common/instance_manager.dart'; import 'foundation/foundation.dart'; import 'ui_kit/ui_kit.dart'; @@ -12,6 +14,24 @@ import 'web_kit/web_kit.dart'; WKWebsiteDataStore _defaultWebsiteDataStore() => WKWebsiteDataStore.defaultDataStore; +// This convenience method was added because Dart doesn't support constant +// function literals: https://github.com/dart-lang/language/issues/1048. +WKWebView _platformWebViewConstructor( + WKWebViewConfiguration configuration, { + void Function( + String keyPath, + NSObject object, + Map change, + )? observeValue, + InstanceManager? instanceManager, +}) { + return Platform.isIOS + ? WKWebViewIOS(configuration, + observeValue: observeValue, instanceManager: instanceManager) + : WKWebViewMacOS(configuration, + observeValue: observeValue, instanceManager: instanceManager); +} + /// Handles constructing objects and calling static methods for the WebKit /// native library. /// @@ -24,7 +44,7 @@ WKWebsiteDataStore _defaultWebsiteDataStore() => class WebKitProxy { /// Constructs a [WebKitProxy]. const WebKitProxy({ - this.createWebView = WKWebView.new, + this.createWebView = _platformWebViewConstructor, this.createWebViewConfiguration = WKWebViewConfiguration.new, this.createScriptMessageHandler = WKScriptMessageHandler.new, this.defaultWebsiteDataStore = _defaultWebsiteDataStore, diff --git a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/webkit_webview_controller.dart b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/webkit_webview_controller.dart index c152f3262599..a1f149ecdd10 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/lib/src/webkit_webview_controller.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/lib/src/webkit_webview_controller.dart @@ -4,6 +4,7 @@ import 'dart:async'; import 'dart:convert'; +import 'dart:io'; import 'dart:math'; import 'package:flutter/material.dart'; @@ -490,24 +491,42 @@ class WebKitWebViewController extends PlatformWebViewController { @override Future scrollTo(int x, int y) { - return _webView.scrollView.setContentOffset(Point( - x.toDouble(), - y.toDouble(), - )); + final WKWebView webView = _webView; + if (webView is WKWebViewIOS) { + return webView.scrollView.setContentOffset(Point( + x.toDouble(), + y.toDouble(), + )); + } else { + // TODO(stuartmorgan): Investigate doing this via JS instead. + throw UnimplementedError('scrollTo is not implemented on macOS'); + } } @override Future scrollBy(int x, int y) { - return _webView.scrollView.scrollBy(Point( - x.toDouble(), - y.toDouble(), - )); + final WKWebView webView = _webView; + if (webView is WKWebViewIOS) { + return webView.scrollView.scrollBy(Point( + x.toDouble(), + y.toDouble(), + )); + } else { + // TODO(stuartmorgan): Investigate doing this via JS instead. + throw UnimplementedError('scrollBy is not implemented on macOS'); + } } @override Future getScrollPosition() async { - final Point offset = await _webView.scrollView.getContentOffset(); - return Offset(offset.x, offset.y); + final WKWebView webView = _webView; + if (webView is WKWebViewIOS) { + final Point offset = await webView.scrollView.getContentOffset(); + return Offset(offset.x, offset.y); + } else { + // TODO(stuartmorgan): Investigate doing this via JS instead. + throw UnimplementedError('scrollTo is not implemented on macOS'); + } } /// Whether horizontal swipe gestures trigger page navigation. @@ -517,12 +536,19 @@ class WebKitWebViewController extends PlatformWebViewController { @override Future setBackgroundColor(Color color) { - return Future.wait(>[ - _webView.setOpaque(false), - _webView.setBackgroundColor(Colors.transparent), - // This method must be called last. - _webView.scrollView.setBackgroundColor(color), - ]); + final WKWebView webView = _webView; + if (webView is WKWebViewIOS) { + return Future.wait(>[ + webView.setOpaque(false), + webView.setBackgroundColor(Colors.transparent), + // This method must be called last. + webView.scrollView.setBackgroundColor(color), + ]); + } else { + // TODO(stuartmorgan): Implement background color support. + throw UnimplementedError( + 'Background color is not yet supported on macOS.'); + } } @override @@ -614,7 +640,6 @@ class WebKitWebViewController extends PlatformWebViewController { case 'log': default: level = JavaScriptLogLevel.log; - break; } _onConsoleMessageCallback!( @@ -744,23 +769,30 @@ window.addEventListener("error", function(e) { Future setOnScrollPositionChange( void Function(ScrollPositionChange scrollPositionChange)? onScrollPositionChange) async { - _onScrollPositionChangeCallback = onScrollPositionChange; - - if (onScrollPositionChange != null) { - final WeakReference weakThis = - WeakReference(this); - _uiScrollViewDelegate = - _webKitParams.webKitProxy.createUIScrollViewDelegate( - scrollViewDidScroll: (UIScrollView uiScrollView, double x, double y) { - weakThis.target?._onScrollPositionChangeCallback?.call( - ScrollPositionChange(x, y), - ); - }, - ); - return _webView.scrollView.setDelegate(_uiScrollViewDelegate); + final WKWebView webView = _webView; + if (webView is WKWebViewIOS) { + _onScrollPositionChangeCallback = onScrollPositionChange; + + if (onScrollPositionChange != null) { + final WeakReference weakThis = + WeakReference(this); + _uiScrollViewDelegate = + _webKitParams.webKitProxy.createUIScrollViewDelegate( + scrollViewDidScroll: (UIScrollView uiScrollView, double x, double y) { + weakThis.target?._onScrollPositionChangeCallback?.call( + ScrollPositionChange(x, y), + ); + }, + ); + return webView.scrollView.setDelegate(_uiScrollViewDelegate); + } else { + _uiScrollViewDelegate = null; + return webView.scrollView.setDelegate(null); + } } else { - _uiScrollViewDelegate = null; - return _webView.scrollView.setDelegate(null); + // TODO(stuartmorgan): Investigate doing this via JS instead. + throw UnimplementedError( + 'setOnScrollPositionChange is not implemented on macOS'); } } @@ -917,20 +949,34 @@ class WebKitWebViewWidget extends PlatformWebViewWidget { @override Widget build(BuildContext context) { - return UiKitView( - // Setting a default key using `params` ensures the `UIKitView` recreates - // the PlatformView when changes are made. - key: _webKitParams.key ?? - ValueKey( - params as WebKitWebViewWidgetCreationParams), - viewType: 'plugins.flutter.io/webview', - onPlatformViewCreated: (_) {}, - layoutDirection: params.layoutDirection, - gestureRecognizers: params.gestureRecognizers, - creationParams: _webKitParams._instanceManager.getIdentifier( - (params.controller as WebKitWebViewController)._webView), - creationParamsCodec: const StandardMessageCodec(), - ); + // Setting a default key using `params` ensures the `UIKitView` recreates + // the PlatformView when changes are made. + final Key key = _webKitParams.key ?? + ValueKey( + params as WebKitWebViewWidgetCreationParams); + if (Platform.isMacOS) { + return AppKitView( + key: key, + viewType: 'plugins.flutter.io/webview', + onPlatformViewCreated: (_) {}, + layoutDirection: params.layoutDirection, + gestureRecognizers: params.gestureRecognizers, + creationParams: _webKitParams._instanceManager.getIdentifier( + (params.controller as WebKitWebViewController)._webView), + creationParamsCodec: const StandardMessageCodec(), + ); + } else { + return UiKitView( + key: key, + viewType: 'plugins.flutter.io/webview', + onPlatformViewCreated: (_) {}, + layoutDirection: params.layoutDirection, + gestureRecognizers: params.gestureRecognizers, + creationParams: _webKitParams._instanceManager.getIdentifier( + (params.controller as WebKitWebViewController)._webView), + creationParamsCodec: const StandardMessageCodec(), + ); + } } } @@ -1101,7 +1147,9 @@ class WebKitNavigationDelegate extends PlatformNavigationDelegate { ) completionHandler, ) { if (challenge.protectionSpace.authenticationMethod == - NSUrlAuthenticationMethod.httpBasic) { + NSUrlAuthenticationMethod.httpBasic || + challenge.protectionSpace.authenticationMethod == + NSUrlAuthenticationMethod.httpNtlm) { final void Function(HttpAuthRequest)? callback = weakThis.target?._onHttpAuthRequest; final String? host = challenge.protectionSpace.host; diff --git a/packages/webview_flutter/webview_flutter_wkwebview/pigeons/web_kit.dart b/packages/webview_flutter/webview_flutter_wkwebview/pigeons/web_kit.dart index 591460aa1e45..a7d2fbd488d2 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/pigeons/web_kit.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/pigeons/web_kit.dart @@ -9,9 +9,9 @@ import 'package:pigeon/pigeon.dart'; dartOut: 'lib/src/common/web_kit.g.dart', dartTestOut: 'test/src/common/test_web_kit.g.dart', objcHeaderOut: - 'ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFGeneratedWebKitApis.h', + 'darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/include/webview_flutter_wkwebview/FWFGeneratedWebKitApis.h', objcSourceOut: - 'ios/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFGeneratedWebKitApis.m', + 'darwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/FWFGeneratedWebKitApis.m', objcOptions: ObjcOptions( headerIncludePath: './include/webview_flutter_wkwebview/FWFGeneratedWebKitApis.h', diff --git a/packages/webview_flutter/webview_flutter_wkwebview/pubspec.yaml b/packages/webview_flutter/webview_flutter_wkwebview/pubspec.yaml index baa0a0f654a9..573c90f04ca3 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/pubspec.yaml +++ b/packages/webview_flutter/webview_flutter_wkwebview/pubspec.yaml @@ -2,11 +2,11 @@ name: webview_flutter_wkwebview description: A Flutter plugin that provides a WebView widget based on Apple's WKWebView control. repository: https://github.com/flutter/packages/tree/main/packages/webview_flutter/webview_flutter_wkwebview issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+webview%22 -version: 3.14.0 +version: 3.16.0 environment: - sdk: ^3.3.0 - flutter: ">=3.19.0" + sdk: ^3.5.0 + flutter: ">=3.24.0" flutter: plugin: @@ -15,6 +15,11 @@ flutter: ios: pluginClass: FLTWebViewFlutterPlugin dartPluginClass: WebKitWebViewPlatform + sharedDarwinSource: true + macos: + pluginClass: FLTWebViewFlutterPlugin + dartPluginClass: WebKitWebViewPlatform + sharedDarwinSource: true dependencies: flutter: @@ -26,8 +31,8 @@ dev_dependencies: build_runner: ^2.1.5 flutter_test: sdk: flutter - mockito: 5.4.4 - pigeon: ^13.0.0 + mockito: ^5.4.4 + pigeon: ^18.0.0 topics: - html 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 eb58b7eb11e2..fe13a87048e5 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 @@ -63,6 +63,7 @@ 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( @@ -77,6 +78,7 @@ class MockWKHttpCookieStore extends _i1.Mock implements _i2.WKHttpCookieStore { ), ), ) as _i2.WKHttpCookieStore); + @override _i3.Future addObserver( _i4.NSObject? observer, { @@ -95,6 +97,7 @@ 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, { @@ -129,6 +132,7 @@ class MockWKWebsiteDataStore extends _i1.Mock Invocation.getter(#httpCookieStore), ), ) as _i2.WKHttpCookieStore); + @override _i3.Future removeDataOfTypes( Set<_i2.WKWebsiteDataType>? dataTypes, @@ -144,6 +148,7 @@ class MockWKWebsiteDataStore extends _i1.Mock ), returnValue: _i3.Future.value(false), ) as _i3.Future); + @override _i2.WKWebsiteDataStore copy() => (super.noSuchMethod( Invocation.method( @@ -158,6 +163,7 @@ class MockWKWebsiteDataStore extends _i1.Mock ), ), ) as _i2.WKWebsiteDataStore); + @override _i3.Future addObserver( _i4.NSObject? observer, { @@ -176,6 +182,7 @@ 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.dart b/packages/webview_flutter/webview_flutter_wkwebview/test/legacy/web_kit_webview_widget_test.dart index b5488a0e3931..ac2f19804ffd 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/test/legacy/web_kit_webview_widget_test.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/test/legacy/web_kit_webview_widget_test.dart @@ -23,7 +23,8 @@ import 'web_kit_webview_widget_test.mocks.dart'; WKNavigationDelegate, WKPreferences, WKScriptMessageHandler, - WKWebView, + WKWebViewIOS, + WKWebViewMacOS, WKWebViewConfiguration, WKWebsiteDataStore, WKUIDelegate, @@ -38,7 +39,7 @@ void main() { group('WebKitWebViewWidget', () { _WebViewMocks configureMocks() { final _WebViewMocks mocks = _WebViewMocks( - webView: MockWKWebView(), + webView: MockWKWebViewIOS(), webViewWidgetProxy: MockWebViewWidgetProxy(), userContentController: MockWKUserContentController(), preferences: MockWKPreferences(), @@ -1375,7 +1376,7 @@ class _WebViewMocks { required this.javascriptChannelRegistry, }); - final MockWKWebView webView; + final MockWKWebViewIOS webView; final MockWebViewWidgetProxy webViewWidgetProxy; final MockWKUserContentController userContentController; final MockWKPreferences preferences; 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 a33d5ac58302..0c8876b9df03 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 @@ -174,6 +174,7 @@ class MockUIScrollView extends _i1.Mock implements _i3.UIScrollView { ), )), ) as _i5.Future<_i2.Point>); + @override _i5.Future scrollBy(_i2.Point? offset) => (super.noSuchMethod( Invocation.method( @@ -183,6 +184,7 @@ 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( @@ -193,6 +195,7 @@ class MockUIScrollView extends _i1.Mock implements _i3.UIScrollView { returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); + @override _i5.Future setDelegate(_i3.UIScrollViewDelegate? delegate) => (super.noSuchMethod( @@ -203,6 +206,7 @@ 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( @@ -217,6 +221,7 @@ class MockUIScrollView extends _i1.Mock implements _i3.UIScrollView { ), ), ) as _i3.UIScrollView); + @override _i5.Future setBackgroundColor(_i6.Color? color) => (super.noSuchMethod( Invocation.method( @@ -226,6 +231,7 @@ 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( @@ -235,6 +241,7 @@ 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, { @@ -253,6 +260,7 @@ 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, { @@ -293,6 +301,7 @@ class MockWKNavigationDelegate extends _i1.Mock ), ), ) as _i4.WKNavigationDelegate); + @override _i5.Future addObserver( _i7.NSObject? observer, { @@ -311,6 +320,7 @@ class MockWKNavigationDelegate extends _i1.Mock returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); + @override _i5.Future removeObserver( _i7.NSObject? observer, { @@ -345,6 +355,7 @@ 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,6 +370,7 @@ class MockWKPreferences extends _i1.Mock implements _i4.WKPreferences { ), ), ) as _i4.WKPreferences); + @override _i5.Future addObserver( _i7.NSObject? observer, { @@ -377,6 +389,7 @@ 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, { @@ -417,6 +430,7 @@ class MockWKScriptMessageHandler extends _i1.Mock _i4.WKUserContentController, _i4.WKScriptMessage, )); + @override _i4.WKScriptMessageHandler copy() => (super.noSuchMethod( Invocation.method( @@ -431,6 +445,7 @@ class MockWKScriptMessageHandler extends _i1.Mock ), ), ) as _i4.WKScriptMessageHandler); + @override _i5.Future addObserver( _i7.NSObject? observer, { @@ -449,6 +464,7 @@ class MockWKScriptMessageHandler extends _i1.Mock returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); + @override _i5.Future removeObserver( _i7.NSObject? observer, { @@ -465,15 +481,23 @@ class MockWKScriptMessageHandler extends _i1.Mock ) as _i5.Future); } -/// A class which mocks [WKWebView]. +/// A class which mocks [WKWebViewIOS]. /// /// See the documentation for Mockito's code generation for more information. -// ignore: must_be_immutable -class MockWKWebView extends _i1.Mock implements _i4.WKWebView { - MockWKWebView() { +class MockWKWebViewIOS extends _i1.Mock implements _i4.WKWebViewIOS { + MockWKWebViewIOS() { _i1.throwOnMissingStub(this); } + @override + _i3.UIScrollView get scrollView => (super.noSuchMethod( + Invocation.getter(#scrollView), + returnValue: _FakeUIScrollView_1( + this, + Invocation.getter(#scrollView), + ), + ) as _i3.UIScrollView); + @override _i4.WKWebViewConfiguration get configuration => (super.noSuchMethod( Invocation.getter(#configuration), @@ -482,14 +506,42 @@ class MockWKWebView extends _i1.Mock implements _i4.WKWebView { Invocation.getter(#configuration), ), ) as _i4.WKWebViewConfiguration); + @override - _i3.UIScrollView get scrollView => (super.noSuchMethod( - Invocation.getter(#scrollView), - returnValue: _FakeUIScrollView_1( + _i4.WKWebView copy() => (super.noSuchMethod( + Invocation.method( + #copy, + [], + ), + returnValue: _FakeWKWebView_6( this, - Invocation.getter(#scrollView), + Invocation.method( + #copy, + [], + ), ), - ) as _i3.UIScrollView); + ) as _i4.WKWebView); + + @override + _i5.Future setBackgroundColor(_i6.Color? color) => (super.noSuchMethod( + Invocation.method( + #setBackgroundColor, + [color], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + + @override + _i5.Future setOpaque(bool? opaque) => (super.noSuchMethod( + Invocation.method( + #setOpaque, + [opaque], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + @override _i5.Future setUIDelegate(_i4.WKUIDelegate? delegate) => (super.noSuchMethod( @@ -500,6 +552,7 @@ 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( @@ -510,6 +563,7 @@ 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( @@ -518,6 +572,7 @@ class MockWKWebView extends _i1.Mock implements _i4.WKWebView { ), returnValue: _i5.Future.value(), ) as _i5.Future); + @override _i5.Future getEstimatedProgress() => (super.noSuchMethod( Invocation.method( @@ -526,6 +581,7 @@ 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( @@ -536,6 +592,7 @@ 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, { @@ -550,6 +607,7 @@ 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, { @@ -564,6 +622,7 @@ 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( @@ -573,6 +632,7 @@ 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( @@ -581,6 +641,7 @@ class MockWKWebView extends _i1.Mock implements _i4.WKWebView { ), returnValue: _i5.Future.value(false), ) as _i5.Future); + @override _i5.Future canGoForward() => (super.noSuchMethod( Invocation.method( @@ -589,6 +650,7 @@ class MockWKWebView extends _i1.Mock implements _i4.WKWebView { ), returnValue: _i5.Future.value(false), ) as _i5.Future); + @override _i5.Future goBack() => (super.noSuchMethod( Invocation.method( @@ -598,6 +660,7 @@ 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( @@ -607,6 +670,7 @@ 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( @@ -616,6 +680,7 @@ 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( @@ -624,6 +689,16 @@ class MockWKWebView extends _i1.Mock implements _i4.WKWebView { ), returnValue: _i5.Future.value(), ) as _i5.Future); + + @override + _i5.Future getCustomUserAgent() => (super.noSuchMethod( + Invocation.method( + #getCustomUserAgent, + [], + ), + returnValue: _i5.Future.value(), + ) as _i5.Future); + @override _i5.Future setAllowsBackForwardNavigationGestures(bool? allow) => (super.noSuchMethod( @@ -634,6 +709,7 @@ 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( @@ -643,6 +719,7 @@ 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( @@ -652,6 +729,7 @@ 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( @@ -661,14 +739,59 @@ 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( + _i5.Future addObserver( + _i7.NSObject? observer, { + required String? keyPath, + required Set<_i7.NSKeyValueObservingOptions>? options, + }) => + (super.noSuchMethod( Invocation.method( - #getCustomUserAgent, - [], + #addObserver, + [observer], + { + #keyPath: keyPath, + #options: options, + }, ), - returnValue: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + + @override + _i5.Future removeObserver( + _i7.NSObject? observer, { + required String? keyPath, + }) => + (super.noSuchMethod( + Invocation.method( + #removeObserver, + [observer], + {#keyPath: keyPath}, + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); +} + +/// A class which mocks [WKWebViewMacOS]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockWKWebViewMacOS extends _i1.Mock implements _i4.WKWebViewMacOS { + MockWKWebViewMacOS() { + _i1.throwOnMissingStub(this); + } + + @override + _i4.WKWebViewConfiguration get configuration => (super.noSuchMethod( + Invocation.getter(#configuration), + returnValue: _FakeWKWebViewConfiguration_5( + this, + Invocation.getter(#configuration), + ), + ) as _i4.WKWebViewConfiguration); + @override _i4.WKWebView copy() => (super.noSuchMethod( Invocation.method( @@ -683,24 +806,205 @@ class MockWKWebView extends _i1.Mock implements _i4.WKWebView { ), ), ) as _i4.WKWebView); + @override - _i5.Future setBackgroundColor(_i6.Color? color) => (super.noSuchMethod( + _i5.Future setUIDelegate(_i4.WKUIDelegate? delegate) => + (super.noSuchMethod( Invocation.method( - #setBackgroundColor, - [color], + #setUIDelegate, + [delegate], ), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); + @override - _i5.Future setOpaque(bool? opaque) => (super.noSuchMethod( + _i5.Future setNavigationDelegate(_i4.WKNavigationDelegate? delegate) => + (super.noSuchMethod( Invocation.method( - #setOpaque, - [opaque], + #setNavigationDelegate, + [delegate], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + + @override + _i5.Future getUrl() => (super.noSuchMethod( + Invocation.method( + #getUrl, + [], + ), + returnValue: _i5.Future.value(), + ) as _i5.Future); + + @override + _i5.Future getEstimatedProgress() => (super.noSuchMethod( + Invocation.method( + #getEstimatedProgress, + [], + ), + returnValue: _i5.Future.value(0.0), + ) as _i5.Future); + + @override + _i5.Future loadRequest(_i7.NSUrlRequest? request) => + (super.noSuchMethod( + Invocation.method( + #loadRequest, + [request], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + + @override + _i5.Future loadHtmlString( + String? string, { + String? baseUrl, + }) => + (super.noSuchMethod( + Invocation.method( + #loadHtmlString, + [string], + {#baseUrl: baseUrl}, + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + + @override + _i5.Future loadFileUrl( + String? url, { + required String? readAccessUrl, + }) => + (super.noSuchMethod( + Invocation.method( + #loadFileUrl, + [url], + {#readAccessUrl: readAccessUrl}, + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + + @override + _i5.Future loadFlutterAsset(String? key) => (super.noSuchMethod( + Invocation.method( + #loadFlutterAsset, + [key], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + + @override + _i5.Future canGoBack() => (super.noSuchMethod( + Invocation.method( + #canGoBack, + [], + ), + returnValue: _i5.Future.value(false), + ) as _i5.Future); + + @override + _i5.Future canGoForward() => (super.noSuchMethod( + Invocation.method( + #canGoForward, + [], + ), + returnValue: _i5.Future.value(false), + ) as _i5.Future); + + @override + _i5.Future goBack() => (super.noSuchMethod( + Invocation.method( + #goBack, + [], ), returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); + + @override + _i5.Future goForward() => (super.noSuchMethod( + Invocation.method( + #goForward, + [], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + + @override + _i5.Future reload() => (super.noSuchMethod( + Invocation.method( + #reload, + [], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + + @override + _i5.Future getTitle() => (super.noSuchMethod( + Invocation.method( + #getTitle, + [], + ), + returnValue: _i5.Future.value(), + ) as _i5.Future); + + @override + _i5.Future getCustomUserAgent() => (super.noSuchMethod( + Invocation.method( + #getCustomUserAgent, + [], + ), + returnValue: _i5.Future.value(), + ) as _i5.Future); + + @override + _i5.Future setAllowsBackForwardNavigationGestures(bool? allow) => + (super.noSuchMethod( + Invocation.method( + #setAllowsBackForwardNavigationGestures, + [allow], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + + @override + _i5.Future setCustomUserAgent(String? userAgent) => (super.noSuchMethod( + Invocation.method( + #setCustomUserAgent, + [userAgent], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + + @override + _i5.Future evaluateJavaScript(String? javaScriptString) => + (super.noSuchMethod( + Invocation.method( + #evaluateJavaScript, + [javaScriptString], + ), + returnValue: _i5.Future.value(), + ) as _i5.Future); + + @override + _i5.Future setInspectable(bool? inspectable) => (super.noSuchMethod( + Invocation.method( + #setInspectable, + [inspectable], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + @override _i5.Future addObserver( _i7.NSObject? observer, { @@ -719,6 +1023,7 @@ 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, { @@ -753,6 +1058,7 @@ class MockWKWebViewConfiguration extends _i1.Mock Invocation.getter(#userContentController), ), ) as _i4.WKUserContentController); + @override _i4.WKPreferences get preferences => (super.noSuchMethod( Invocation.getter(#preferences), @@ -761,6 +1067,7 @@ class MockWKWebViewConfiguration extends _i1.Mock Invocation.getter(#preferences), ), ) as _i4.WKPreferences); + @override _i4.WKWebsiteDataStore get websiteDataStore => (super.noSuchMethod( Invocation.getter(#websiteDataStore), @@ -769,6 +1076,7 @@ class MockWKWebViewConfiguration extends _i1.Mock Invocation.getter(#websiteDataStore), ), ) as _i4.WKWebsiteDataStore); + @override _i5.Future setAllowsInlineMediaPlayback(bool? allow) => (super.noSuchMethod( @@ -779,6 +1087,7 @@ class MockWKWebViewConfiguration extends _i1.Mock returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); + @override _i5.Future setLimitsNavigationsToAppBoundDomains(bool? limit) => (super.noSuchMethod( @@ -789,6 +1098,7 @@ class MockWKWebViewConfiguration extends _i1.Mock returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); + @override _i5.Future setMediaTypesRequiringUserActionForPlayback( Set<_i4.WKAudiovisualMediaType>? types) => @@ -800,6 +1110,7 @@ class MockWKWebViewConfiguration extends _i1.Mock returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); + @override _i4.WKWebViewConfiguration copy() => (super.noSuchMethod( Invocation.method( @@ -814,6 +1125,7 @@ class MockWKWebViewConfiguration extends _i1.Mock ), ), ) as _i4.WKWebViewConfiguration); + @override _i5.Future addObserver( _i7.NSObject? observer, { @@ -832,6 +1144,7 @@ class MockWKWebViewConfiguration extends _i1.Mock returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); + @override _i5.Future removeObserver( _i7.NSObject? observer, { @@ -866,6 +1179,7 @@ class MockWKWebsiteDataStore extends _i1.Mock Invocation.getter(#httpCookieStore), ), ) as _i4.WKHttpCookieStore); + @override _i5.Future removeDataOfTypes( Set<_i4.WKWebsiteDataType>? dataTypes, @@ -881,6 +1195,7 @@ class MockWKWebsiteDataStore extends _i1.Mock ), returnValue: _i5.Future.value(false), ) as _i5.Future); + @override _i4.WKWebsiteDataStore copy() => (super.noSuchMethod( Invocation.method( @@ -895,6 +1210,7 @@ class MockWKWebsiteDataStore extends _i1.Mock ), ), ) as _i4.WKWebsiteDataStore); + @override _i5.Future addObserver( _i7.NSObject? observer, { @@ -913,6 +1229,7 @@ class MockWKWebsiteDataStore extends _i1.Mock returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); + @override _i5.Future removeObserver( _i7.NSObject? observer, { @@ -952,6 +1269,7 @@ class MockWKUIDelegate extends _i1.Mock implements _i4.WKUIDelegate { ), ), ) as _i4.WKUIDelegate); + @override _i5.Future addObserver( _i7.NSObject? observer, { @@ -970,6 +1288,7 @@ 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, { @@ -1012,6 +1331,7 @@ class MockWKUserContentController extends _i1.Mock returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); + @override _i5.Future removeScriptMessageHandler(String? name) => (super.noSuchMethod( @@ -1022,6 +1342,7 @@ class MockWKUserContentController extends _i1.Mock returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); + @override _i5.Future removeAllScriptMessageHandlers() => (super.noSuchMethod( Invocation.method( @@ -1031,6 +1352,7 @@ 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( @@ -1041,6 +1363,7 @@ class MockWKUserContentController extends _i1.Mock returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); + @override _i5.Future removeAllUserScripts() => (super.noSuchMethod( Invocation.method( @@ -1050,6 +1373,7 @@ class MockWKUserContentController extends _i1.Mock returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); + @override _i4.WKUserContentController copy() => (super.noSuchMethod( Invocation.method( @@ -1064,6 +1388,7 @@ class MockWKUserContentController extends _i1.Mock ), ), ) as _i4.WKUserContentController); + @override _i5.Future addObserver( _i7.NSObject? observer, { @@ -1082,6 +1407,7 @@ class MockWKUserContentController extends _i1.Mock returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); + @override _i5.Future removeObserver( _i7.NSObject? observer, { @@ -1112,6 +1438,7 @@ class MockJavascriptChannelRegistry extends _i1.Mock Invocation.getter(#channels), returnValue: {}, ) as Map); + @override void onJavascriptChannelMessage( String? channel, @@ -1127,6 +1454,7 @@ class MockJavascriptChannelRegistry extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void updateJavascriptChannelsFromSet(Set<_i9.JavascriptChannel>? channels) => super.noSuchMethod( @@ -1163,6 +1491,7 @@ class MockWebViewPlatformCallbacksHandler extends _i1.Mock ), returnValue: _i5.Future.value(false), ) as _i5.FutureOr); + @override void onPageStarted(String? url) => super.noSuchMethod( Invocation.method( @@ -1171,6 +1500,7 @@ class MockWebViewPlatformCallbacksHandler extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void onPageFinished(String? url) => super.noSuchMethod( Invocation.method( @@ -1179,6 +1509,7 @@ class MockWebViewPlatformCallbacksHandler extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void onProgress(int? progress) => super.noSuchMethod( Invocation.method( @@ -1187,6 +1518,7 @@ class MockWebViewPlatformCallbacksHandler extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void onWebResourceError(_i10.WebResourceError? error) => super.noSuchMethod( Invocation.method( @@ -1230,6 +1562,7 @@ class MockWebViewWidgetProxy extends _i1.Mock ), ), ) as _i4.WKWebView); + @override _i4.WKScriptMessageHandler createScriptMessageHandler( {required void Function( @@ -1251,6 +1584,7 @@ class MockWebViewWidgetProxy extends _i1.Mock ), ), ) as _i4.WKScriptMessageHandler); + @override _i4.WKUIDelegate createUIDelgate( {void Function( @@ -1273,6 +1607,7 @@ 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/common/test_web_kit.g.dart b/packages/webview_flutter/webview_flutter_wkwebview/test/src/common/test_web_kit.g.dart index 982b50810e6e..0a9e645fecd0 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/test/src/common/test_web_kit.g.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/test/src/common/test_web_kit.g.dart @@ -1,9 +1,9 @@ // 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 (v18.0.0), 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, unnecessary_import +// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, unnecessary_import, no_leading_underscores_for_local_identifiers // ignore_for_file: avoid_relative_lib_imports import 'dart:async'; import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List; @@ -42,7 +42,7 @@ class _TestWKWebsiteDataStoreHostApiCodec extends StandardMessageCodec { abstract class TestWKWebsiteDataStoreHostApi { static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; - static const MessageCodec codec = + static const MessageCodec pigeonChannelCodec = _TestWKWebsiteDataStoreHostApiCodec(); void createFromWebViewConfiguration( @@ -55,19 +55,25 @@ abstract class TestWKWebsiteDataStoreHostApi { List dataTypes, double modificationTimeInSecondsSinceEpoch); - static void setup(TestWKWebsiteDataStoreHostApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setUp( + TestWKWebsiteDataStoreHostApi? api, { + BinaryMessenger? binaryMessenger, + String messageChannelSuffix = '', + }) { + messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebsiteDataStoreHostApi.createFromWebViewConfiguration', - codec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebsiteDataStoreHostApi.createFromWebViewConfiguration$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebsiteDataStoreHostApi.createFromWebViewConfiguration was null.'); @@ -92,16 +98,17 @@ abstract class TestWKWebsiteDataStoreHostApi { } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebsiteDataStoreHostApi.createDefaultDataStore', - codec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebsiteDataStoreHostApi.createDefaultDataStore$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebsiteDataStoreHostApi.createDefaultDataStore was null.'); @@ -122,16 +129,17 @@ abstract class TestWKWebsiteDataStoreHostApi { } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebsiteDataStoreHostApi.removeDataOfTypes', - codec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebsiteDataStoreHostApi.removeDataOfTypes$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebsiteDataStoreHostApi.removeDataOfTypes was null.'); @@ -169,25 +177,32 @@ abstract class TestWKWebsiteDataStoreHostApi { abstract class TestUIViewHostApi { static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; - static const MessageCodec codec = StandardMessageCodec(); + static const MessageCodec pigeonChannelCodec = + StandardMessageCodec(); void setBackgroundColor(int identifier, int? value); void setOpaque(int identifier, bool opaque); - static void setup(TestUIViewHostApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setUp( + TestUIViewHostApi? api, { + BinaryMessenger? binaryMessenger, + String messageChannelSuffix = '', + }) { + messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.UIViewHostApi.setBackgroundColor', - codec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_wkwebview.UIViewHostApi.setBackgroundColor$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.UIViewHostApi.setBackgroundColor was null.'); @@ -209,16 +224,17 @@ abstract class TestUIViewHostApi { } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.UIViewHostApi.setOpaque', - codec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_wkwebview.UIViewHostApi.setOpaque$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.UIViewHostApi.setOpaque was null.'); @@ -250,7 +266,8 @@ abstract class TestUIViewHostApi { abstract class TestUIScrollViewHostApi { static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; - static const MessageCodec codec = StandardMessageCodec(); + static const MessageCodec pigeonChannelCodec = + StandardMessageCodec(); void createFromWebView(int identifier, int webViewIdentifier); @@ -262,19 +279,25 @@ abstract class TestUIScrollViewHostApi { void setDelegate(int identifier, int? uiScrollViewDelegateIdentifier); - static void setup(TestUIScrollViewHostApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setUp( + TestUIScrollViewHostApi? api, { + BinaryMessenger? binaryMessenger, + String messageChannelSuffix = '', + }) { + messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewHostApi.createFromWebView', - codec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewHostApi.createFromWebView$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewHostApi.createFromWebView was null.'); @@ -298,16 +321,17 @@ abstract class TestUIScrollViewHostApi { } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewHostApi.getContentOffset', - codec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewHostApi.getContentOffset$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewHostApi.getContentOffset was null.'); @@ -328,16 +352,17 @@ abstract class TestUIScrollViewHostApi { } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewHostApi.scrollBy', - codec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewHostApi.scrollBy$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewHostApi.scrollBy was null.'); @@ -364,16 +389,17 @@ abstract class TestUIScrollViewHostApi { } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewHostApi.setContentOffset', - codec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewHostApi.setContentOffset$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewHostApi.setContentOffset was null.'); @@ -400,16 +426,17 @@ abstract class TestUIScrollViewHostApi { } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewHostApi.setDelegate', - codec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewHostApi.setDelegate$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewHostApi.setDelegate was null.'); @@ -463,7 +490,7 @@ class _TestWKWebViewConfigurationHostApiCodec extends StandardMessageCodec { abstract class TestWKWebViewConfigurationHostApi { static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; - static const MessageCodec codec = + static const MessageCodec pigeonChannelCodec = _TestWKWebViewConfigurationHostApiCodec(); void create(int identifier); @@ -477,19 +504,25 @@ abstract class TestWKWebViewConfigurationHostApi { void setMediaTypesRequiringUserActionForPlayback( int identifier, List types); - static void setup(TestWKWebViewConfigurationHostApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setUp( + TestWKWebViewConfigurationHostApi? api, { + BinaryMessenger? binaryMessenger, + String messageChannelSuffix = '', + }) { + messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfigurationHostApi.create', - codec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfigurationHostApi.create$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfigurationHostApi.create was null.'); @@ -510,16 +543,17 @@ abstract class TestWKWebViewConfigurationHostApi { } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfigurationHostApi.createFromWebView', - codec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfigurationHostApi.createFromWebView$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfigurationHostApi.createFromWebView was null.'); @@ -543,16 +577,17 @@ abstract class TestWKWebViewConfigurationHostApi { } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfigurationHostApi.setAllowsInlineMediaPlayback', - codec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfigurationHostApi.setAllowsInlineMediaPlayback$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfigurationHostApi.setAllowsInlineMediaPlayback was null.'); @@ -576,16 +611,17 @@ abstract class TestWKWebViewConfigurationHostApi { } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfigurationHostApi.setLimitsNavigationsToAppBoundDomains', - codec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfigurationHostApi.setLimitsNavigationsToAppBoundDomains$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfigurationHostApi.setLimitsNavigationsToAppBoundDomains was null.'); @@ -610,16 +646,17 @@ abstract class TestWKWebViewConfigurationHostApi { } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfigurationHostApi.setMediaTypesRequiringUserActionForPlayback', - codec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfigurationHostApi.setMediaTypesRequiringUserActionForPlayback$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewConfigurationHostApi.setMediaTypesRequiringUserActionForPlayback was null.'); @@ -682,7 +719,7 @@ class _TestWKUserContentControllerHostApiCodec extends StandardMessageCodec { abstract class TestWKUserContentControllerHostApi { static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; - static const MessageCodec codec = + static const MessageCodec pigeonChannelCodec = _TestWKUserContentControllerHostApiCodec(); void createFromWebViewConfiguration( @@ -699,19 +736,25 @@ abstract class TestWKUserContentControllerHostApi { void removeAllUserScripts(int identifier); - static void setup(TestWKUserContentControllerHostApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setUp( + TestWKUserContentControllerHostApi? api, { + BinaryMessenger? binaryMessenger, + String messageChannelSuffix = '', + }) { + messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentControllerHostApi.createFromWebViewConfiguration', - codec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentControllerHostApi.createFromWebViewConfiguration$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentControllerHostApi.createFromWebViewConfiguration was null.'); @@ -736,16 +779,17 @@ abstract class TestWKUserContentControllerHostApi { } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentControllerHostApi.addScriptMessageHandler', - codec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentControllerHostApi.addScriptMessageHandler$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentControllerHostApi.addScriptMessageHandler was null.'); @@ -773,16 +817,17 @@ abstract class TestWKUserContentControllerHostApi { } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentControllerHostApi.removeScriptMessageHandler', - codec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentControllerHostApi.removeScriptMessageHandler$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentControllerHostApi.removeScriptMessageHandler was null.'); @@ -806,16 +851,17 @@ abstract class TestWKUserContentControllerHostApi { } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentControllerHostApi.removeAllScriptMessageHandlers', - codec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentControllerHostApi.removeAllScriptMessageHandlers$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentControllerHostApi.removeAllScriptMessageHandlers was null.'); @@ -836,16 +882,17 @@ abstract class TestWKUserContentControllerHostApi { } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentControllerHostApi.addUserScript', - codec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentControllerHostApi.addUserScript$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentControllerHostApi.addUserScript was null.'); @@ -870,16 +917,17 @@ abstract class TestWKUserContentControllerHostApi { } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentControllerHostApi.removeAllUserScripts', - codec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentControllerHostApi.removeAllUserScripts$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUserContentControllerHostApi.removeAllUserScripts was null.'); @@ -908,26 +956,33 @@ abstract class TestWKUserContentControllerHostApi { abstract class TestWKPreferencesHostApi { static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; - static const MessageCodec codec = StandardMessageCodec(); + static const MessageCodec pigeonChannelCodec = + StandardMessageCodec(); void createFromWebViewConfiguration( int identifier, int configurationIdentifier); void setJavaScriptEnabled(int identifier, bool enabled); - static void setup(TestWKPreferencesHostApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setUp( + TestWKPreferencesHostApi? api, { + BinaryMessenger? binaryMessenger, + String messageChannelSuffix = '', + }) { + messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKPreferencesHostApi.createFromWebViewConfiguration', - codec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKPreferencesHostApi.createFromWebViewConfiguration$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKPreferencesHostApi.createFromWebViewConfiguration was null.'); @@ -952,16 +1007,17 @@ abstract class TestWKPreferencesHostApi { } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKPreferencesHostApi.setJavaScriptEnabled', - codec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKPreferencesHostApi.setJavaScriptEnabled$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKPreferencesHostApi.setJavaScriptEnabled was null.'); @@ -993,23 +1049,30 @@ abstract class TestWKPreferencesHostApi { abstract class TestWKScriptMessageHandlerHostApi { static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; - static const MessageCodec codec = StandardMessageCodec(); + static const MessageCodec pigeonChannelCodec = + StandardMessageCodec(); void create(int identifier); - static void setup(TestWKScriptMessageHandlerHostApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setUp( + TestWKScriptMessageHandlerHostApi? api, { + BinaryMessenger? binaryMessenger, + String messageChannelSuffix = '', + }) { + messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKScriptMessageHandlerHostApi.create', - codec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKScriptMessageHandlerHostApi.create$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKScriptMessageHandlerHostApi.create was null.'); @@ -1038,23 +1101,30 @@ abstract class TestWKScriptMessageHandlerHostApi { abstract class TestWKNavigationDelegateHostApi { static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; - static const MessageCodec codec = StandardMessageCodec(); + static const MessageCodec pigeonChannelCodec = + StandardMessageCodec(); void create(int identifier); - static void setup(TestWKNavigationDelegateHostApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setUp( + TestWKNavigationDelegateHostApi? api, { + BinaryMessenger? binaryMessenger, + String messageChannelSuffix = '', + }) { + messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegateHostApi.create', - codec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegateHostApi.create$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegateHostApi.create was null.'); @@ -1106,7 +1176,8 @@ class _TestNSObjectHostApiCodec extends StandardMessageCodec { abstract class TestNSObjectHostApi { static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; - static const MessageCodec codec = _TestNSObjectHostApiCodec(); + static const MessageCodec pigeonChannelCodec = + _TestNSObjectHostApiCodec(); void dispose(int identifier); @@ -1115,19 +1186,25 @@ abstract class TestNSObjectHostApi { void removeObserver(int identifier, int observerIdentifier, String keyPath); - static void setup(TestNSObjectHostApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setUp( + TestNSObjectHostApi? api, { + BinaryMessenger? binaryMessenger, + String messageChannelSuffix = '', + }) { + messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.NSObjectHostApi.dispose', - codec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_wkwebview.NSObjectHostApi.dispose$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.NSObjectHostApi.dispose was null.'); @@ -1148,16 +1225,17 @@ abstract class TestNSObjectHostApi { } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.NSObjectHostApi.addObserver', - codec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_wkwebview.NSObjectHostApi.addObserver$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.NSObjectHostApi.addObserver was null.'); @@ -1190,16 +1268,17 @@ abstract class TestNSObjectHostApi { } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.NSObjectHostApi.removeObserver', - codec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_wkwebview.NSObjectHostApi.removeObserver$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.NSObjectHostApi.removeObserver was null.'); @@ -1358,7 +1437,8 @@ class _TestWKWebViewHostApiCodec extends StandardMessageCodec { abstract class TestWKWebViewHostApi { static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; - static const MessageCodec codec = _TestWKWebViewHostApiCodec(); + static const MessageCodec pigeonChannelCodec = + _TestWKWebViewHostApiCodec(); void create(int identifier, int configurationIdentifier); @@ -1400,19 +1480,25 @@ abstract class TestWKWebViewHostApi { String? getCustomUserAgent(int identifier); - static void setup(TestWKWebViewHostApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setUp( + TestWKWebViewHostApi? api, { + BinaryMessenger? binaryMessenger, + String messageChannelSuffix = '', + }) { + messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.create', - codec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.create$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.create was null.'); @@ -1436,16 +1522,17 @@ abstract class TestWKWebViewHostApi { } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.setUIDelegate', - codec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.setUIDelegate$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.setUIDelegate was null.'); @@ -1467,16 +1554,17 @@ abstract class TestWKWebViewHostApi { } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.setNavigationDelegate', - codec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.setNavigationDelegate$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.setNavigationDelegate was null.'); @@ -1499,16 +1587,17 @@ abstract class TestWKWebViewHostApi { } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.getUrl', - codec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.getUrl$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.getUrl was null.'); @@ -1529,16 +1618,17 @@ abstract class TestWKWebViewHostApi { } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.getEstimatedProgress', - codec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.getEstimatedProgress$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.getEstimatedProgress was null.'); @@ -1559,16 +1649,17 @@ abstract class TestWKWebViewHostApi { } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.loadRequest', - codec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.loadRequest$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.loadRequest was null.'); @@ -1592,16 +1683,17 @@ abstract class TestWKWebViewHostApi { } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.loadHtmlString', - codec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.loadHtmlString$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.loadHtmlString was null.'); @@ -1626,16 +1718,17 @@ abstract class TestWKWebViewHostApi { } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.loadFileUrl', - codec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.loadFileUrl$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.loadFileUrl was null.'); @@ -1662,16 +1755,17 @@ abstract class TestWKWebViewHostApi { } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.loadFlutterAsset', - codec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.loadFlutterAsset$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.loadFlutterAsset was null.'); @@ -1695,16 +1789,17 @@ abstract class TestWKWebViewHostApi { } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.canGoBack', - codec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.canGoBack$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.canGoBack was null.'); @@ -1725,16 +1820,17 @@ abstract class TestWKWebViewHostApi { } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.canGoForward', - codec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.canGoForward$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.canGoForward was null.'); @@ -1755,16 +1851,17 @@ abstract class TestWKWebViewHostApi { } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.goBack', - codec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.goBack$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.goBack was null.'); @@ -1785,16 +1882,17 @@ abstract class TestWKWebViewHostApi { } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.goForward', - codec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.goForward$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.goForward was null.'); @@ -1815,16 +1913,17 @@ abstract class TestWKWebViewHostApi { } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.reload', - codec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.reload$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.reload was null.'); @@ -1845,16 +1944,17 @@ abstract class TestWKWebViewHostApi { } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.getTitle', - codec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.getTitle$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.getTitle was null.'); @@ -1875,16 +1975,17 @@ abstract class TestWKWebViewHostApi { } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.setAllowsBackForwardNavigationGestures', - codec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.setAllowsBackForwardNavigationGestures$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.setAllowsBackForwardNavigationGestures was null.'); @@ -1909,16 +2010,17 @@ abstract class TestWKWebViewHostApi { } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.setCustomUserAgent', - codec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.setCustomUserAgent$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.setCustomUserAgent was null.'); @@ -1940,16 +2042,17 @@ abstract class TestWKWebViewHostApi { } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.evaluateJavaScript', - codec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.evaluateJavaScript$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.evaluateJavaScript was null.'); @@ -1974,16 +2077,17 @@ abstract class TestWKWebViewHostApi { } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.setInspectable', - codec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.setInspectable$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.setInspectable was null.'); @@ -2007,16 +2111,17 @@ abstract class TestWKWebViewHostApi { } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.getCustomUserAgent', - codec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.getCustomUserAgent$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKWebViewHostApi.getCustomUserAgent was null.'); @@ -2045,23 +2150,30 @@ abstract class TestWKWebViewHostApi { abstract class TestWKUIDelegateHostApi { static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; - static const MessageCodec codec = StandardMessageCodec(); + static const MessageCodec pigeonChannelCodec = + StandardMessageCodec(); void create(int identifier); - static void setup(TestWKUIDelegateHostApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setUp( + TestWKUIDelegateHostApi? api, { + BinaryMessenger? binaryMessenger, + String messageChannelSuffix = '', + }) { + messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegateHostApi.create', - codec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegateHostApi.create$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegateHostApi.create was null.'); @@ -2118,7 +2230,7 @@ class _TestWKHttpCookieStoreHostApiCodec extends StandardMessageCodec { abstract class TestWKHttpCookieStoreHostApi { static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; - static const MessageCodec codec = + static const MessageCodec pigeonChannelCodec = _TestWKHttpCookieStoreHostApiCodec(); void createFromWebsiteDataStore( @@ -2126,19 +2238,25 @@ abstract class TestWKHttpCookieStoreHostApi { Future setCookie(int identifier, NSHttpCookieData cookie); - static void setup(TestWKHttpCookieStoreHostApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setUp( + TestWKHttpCookieStoreHostApi? api, { + BinaryMessenger? binaryMessenger, + String messageChannelSuffix = '', + }) { + messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKHttpCookieStoreHostApi.createFromWebsiteDataStore', - codec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKHttpCookieStoreHostApi.createFromWebsiteDataStore$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKHttpCookieStoreHostApi.createFromWebsiteDataStore was null.'); @@ -2163,16 +2281,17 @@ abstract class TestWKHttpCookieStoreHostApi { } } { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.WKHttpCookieStoreHostApi.setCookie', - codec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_wkwebview.WKHttpCookieStoreHostApi.setCookie$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.WKHttpCookieStoreHostApi.setCookie was null.'); @@ -2208,22 +2327,30 @@ abstract class TestWKHttpCookieStoreHostApi { abstract class TestNSUrlHostApi { static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; - static const MessageCodec codec = StandardMessageCodec(); + static const MessageCodec pigeonChannelCodec = + StandardMessageCodec(); String? getAbsoluteString(int identifier); - static void setup(TestNSUrlHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setUp( + TestNSUrlHostApi? api, { + BinaryMessenger? binaryMessenger, + String messageChannelSuffix = '', + }) { + messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.NSUrlHostApi.getAbsoluteString', - codec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_wkwebview.NSUrlHostApi.getAbsoluteString$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.NSUrlHostApi.getAbsoluteString was null.'); @@ -2256,23 +2383,30 @@ abstract class TestNSUrlHostApi { abstract class TestUIScrollViewDelegateHostApi { static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; - static const MessageCodec codec = StandardMessageCodec(); + static const MessageCodec pigeonChannelCodec = + StandardMessageCodec(); void create(int identifier); - static void setup(TestUIScrollViewDelegateHostApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setUp( + TestUIScrollViewDelegateHostApi? api, { + BinaryMessenger? binaryMessenger, + String messageChannelSuffix = '', + }) { + messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewDelegateHostApi.create', - codec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewDelegateHostApi.create$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.UIScrollViewDelegateHostApi.create was null.'); @@ -2305,25 +2439,32 @@ abstract class TestUIScrollViewDelegateHostApi { abstract class TestNSUrlCredentialHostApi { static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; - static const MessageCodec codec = StandardMessageCodec(); + static const MessageCodec pigeonChannelCodec = + StandardMessageCodec(); /// Create a new native instance and add it to the `InstanceManager`. void createWithUser(int identifier, String user, String password, NSUrlCredentialPersistence persistence); - static void setup(TestNSUrlCredentialHostApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setUp( + TestNSUrlCredentialHostApi? api, { + BinaryMessenger? binaryMessenger, + String messageChannelSuffix = '', + }) { + messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.webview_flutter_wkwebview.NSUrlCredentialHostApi.createWithUser', - codec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.webview_flutter_wkwebview.NSUrlCredentialHostApi.createWithUser$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, + .setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, 'Argument for dev.flutter.pigeon.webview_flutter_wkwebview.NSUrlCredentialHostApi.createWithUser was null.'); diff --git a/packages/webview_flutter/webview_flutter_wkwebview/test/src/foundation/foundation_test.dart b/packages/webview_flutter/webview_flutter_wkwebview/test/src/foundation/foundation_test.dart index 345c6fad6776..5eb821fdfcbc 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/test/src/foundation/foundation_test.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/test/src/foundation/foundation_test.dart @@ -37,14 +37,14 @@ void main() { setUp(() { mockPlatformHostApi = MockTestNSObjectHostApi(); - TestNSObjectHostApi.setup(mockPlatformHostApi); + TestNSObjectHostApi.setUp(mockPlatformHostApi); object = NSObject.detached(instanceManager: instanceManager); instanceManager.addDartCreatedInstance(object); }); tearDown(() { - TestNSObjectHostApi.setup(null); + TestNSObjectHostApi.setUp(null); }); test('addObserver', () async { @@ -222,11 +222,11 @@ void main() { group('NSUrl', () { // Ensure the test host api is removed after each test run. - tearDown(() => TestNSUrlHostApi.setup(null)); + tearDown(() => TestNSUrlHostApi.setUp(null)); test('getAbsoluteString', () async { final MockTestNSUrlHostApi mockApi = MockTestNSUrlHostApi(); - TestNSUrlHostApi.setup(mockApi); + TestNSUrlHostApi.setUp(mockApi); final NSUrl url = NSUrl.detached(instanceManager: instanceManager); instanceManager.addHostCreatedInstance(url, 0); @@ -249,13 +249,13 @@ void main() { group('NSUrlCredential', () { tearDown(() { - TestNSUrlCredentialHostApi.setup(null); + TestNSUrlCredentialHostApi.setUp(null); }); test('HostApi createWithUser', () { final MockTestNSUrlCredentialHostApi mockApi = MockTestNSUrlCredentialHostApi(); - TestNSUrlCredentialHostApi.setup(mockApi); + TestNSUrlCredentialHostApi.setUp(mockApi); final InstanceManager instanceManager = InstanceManager( onWeakReferenceRemoved: (_) {}, 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 a34a190ac497..df4e12e6082f 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 @@ -38,6 +38,7 @@ class MockTestNSObjectHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void addObserver( int? identifier, @@ -57,6 +58,7 @@ 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.dart b/packages/webview_flutter/webview_flutter_wkwebview/test/src/ui_kit/ui_kit_test.dart index 576d0404693f..c6458b9d9335 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/test/src/ui_kit/ui_kit_test.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/test/src/ui_kit/ui_kit_test.dart @@ -42,13 +42,13 @@ void main() { setUp(() { mockPlatformHostApi = MockTestUIScrollViewHostApi(); - TestUIScrollViewHostApi.setup(mockPlatformHostApi); + TestUIScrollViewHostApi.setUp(mockPlatformHostApi); - TestWKWebViewConfigurationHostApi.setup( + TestWKWebViewConfigurationHostApi.setUp( MockTestWKWebViewConfigurationHostApi(), ); - TestWKWebViewHostApi.setup(MockTestWKWebViewHostApi()); - final WKWebView webView = WKWebView( + TestWKWebViewHostApi.setUp(MockTestWKWebViewHostApi()); + final WKWebView webView = WKWebViewIOS( WKWebViewConfiguration(instanceManager: instanceManager), instanceManager: instanceManager, ); @@ -61,9 +61,9 @@ void main() { }); tearDown(() { - TestUIScrollViewHostApi.setup(null); - TestWKWebViewConfigurationHostApi.setup(null); - TestWKWebViewHostApi.setup(null); + TestUIScrollViewHostApi.setUp(null); + TestWKWebViewConfigurationHostApi.setUp(null); + TestWKWebViewHostApi.setUp(null); }); test('getContentOffset', () async { @@ -105,12 +105,12 @@ void main() { group('UIScrollViewDelegate', () { // Ensure the test host api is removed after each test run. - tearDown(() => TestUIScrollViewDelegateHostApi.setup(null)); + tearDown(() => TestUIScrollViewDelegateHostApi.setUp(null)); test('Host API create', () { final MockTestUIScrollViewDelegateHostApi mockApi = MockTestUIScrollViewDelegateHostApi(); - TestUIScrollViewDelegateHostApi.setup(mockApi); + TestUIScrollViewDelegateHostApi.setUp(mockApi); UIScrollViewDelegate(instanceManager: instanceManager); verify(mockApi.create(0)); @@ -150,14 +150,14 @@ void main() { setUp(() { mockPlatformHostApi = MockTestUIViewHostApi(); - TestUIViewHostApi.setup(mockPlatformHostApi); + TestUIViewHostApi.setUp(mockPlatformHostApi); - view = UIView.detached(instanceManager: instanceManager); + view = UIViewBase.detached(instanceManager: instanceManager); viewInstanceId = instanceManager.addDartCreatedInstance(view); }); tearDown(() { - TestUIViewHostApi.setup(null); + TestUIViewHostApi.setUp(null); }); test('setBackgroundColor', () async { 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 54e91efb6a66..66bbc7275e69 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 @@ -40,6 +40,7 @@ class MockTestWKWebViewConfigurationHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void createFromWebView( int? identifier, @@ -55,6 +56,7 @@ class MockTestWKWebViewConfigurationHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void setAllowsInlineMediaPlayback( int? identifier, @@ -70,6 +72,7 @@ class MockTestWKWebViewConfigurationHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void setLimitsNavigationsToAppBoundDomains( int? identifier, @@ -85,6 +88,7 @@ class MockTestWKWebViewConfigurationHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void setMediaTypesRequiringUserActionForPlayback( int? identifier, @@ -126,6 +130,7 @@ class MockTestWKWebViewHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void setUIDelegate( int? identifier, @@ -141,6 +146,7 @@ class MockTestWKWebViewHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void setNavigationDelegate( int? identifier, @@ -156,11 +162,13 @@ 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( @@ -169,6 +177,7 @@ class MockTestWKWebViewHostApi extends _i1.Mock ), returnValue: 0.0, ) as double); + @override void loadRequest( int? identifier, @@ -184,6 +193,7 @@ class MockTestWKWebViewHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void loadHtmlString( int? identifier, @@ -201,6 +211,7 @@ class MockTestWKWebViewHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void loadFileUrl( int? identifier, @@ -218,6 +229,7 @@ class MockTestWKWebViewHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void loadFlutterAsset( int? identifier, @@ -233,6 +245,7 @@ class MockTestWKWebViewHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); + @override bool canGoBack(int? identifier) => (super.noSuchMethod( Invocation.method( @@ -241,6 +254,7 @@ class MockTestWKWebViewHostApi extends _i1.Mock ), returnValue: false, ) as bool); + @override bool canGoForward(int? identifier) => (super.noSuchMethod( Invocation.method( @@ -249,6 +263,7 @@ class MockTestWKWebViewHostApi extends _i1.Mock ), returnValue: false, ) as bool); + @override void goBack(int? identifier) => super.noSuchMethod( Invocation.method( @@ -257,6 +272,7 @@ class MockTestWKWebViewHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void goForward(int? identifier) => super.noSuchMethod( Invocation.method( @@ -265,6 +281,7 @@ class MockTestWKWebViewHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void reload(int? identifier) => super.noSuchMethod( Invocation.method( @@ -273,11 +290,13 @@ 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, @@ -293,6 +312,7 @@ class MockTestWKWebViewHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void setCustomUserAgent( int? identifier, @@ -308,6 +328,7 @@ class MockTestWKWebViewHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); + @override _i4.Future evaluateJavaScript( int? identifier, @@ -323,6 +344,7 @@ class MockTestWKWebViewHostApi extends _i1.Mock ), returnValue: _i4.Future.value(), ) as _i4.Future); + @override void setInspectable( int? identifier, @@ -338,6 +360,7 @@ class MockTestWKWebViewHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); + @override String? getCustomUserAgent(int? identifier) => (super.noSuchMethod(Invocation.method( @@ -370,6 +393,7 @@ class MockTestUIScrollViewHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); + @override List getContentOffset(int? identifier) => (super.noSuchMethod( Invocation.method( @@ -378,6 +402,7 @@ class MockTestUIScrollViewHostApi extends _i1.Mock ), returnValue: [], ) as List); + @override void scrollBy( int? identifier, @@ -395,6 +420,7 @@ class MockTestUIScrollViewHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void setContentOffset( int? identifier, @@ -412,6 +438,7 @@ class MockTestUIScrollViewHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void setDelegate( int? identifier, @@ -471,6 +498,7 @@ 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.dart b/packages/webview_flutter/webview_flutter_wkwebview/test/src/web_kit/web_kit_test.dart index d838bf996146..2f89e32e181d 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/test/src/web_kit/web_kit_test.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/test/src/web_kit/web_kit_test.dart @@ -50,9 +50,9 @@ void main() { setUp(() { mockPlatformHostApi = MockTestWKWebsiteDataStoreHostApi(); - TestWKWebsiteDataStoreHostApi.setup(mockPlatformHostApi); + TestWKWebsiteDataStoreHostApi.setUp(mockPlatformHostApi); - TestWKWebViewConfigurationHostApi.setup( + TestWKWebViewConfigurationHostApi.setUp( MockTestWKWebViewConfigurationHostApi(), ); webViewConfiguration = WKWebViewConfiguration( @@ -66,8 +66,8 @@ void main() { }); tearDown(() { - TestWKWebsiteDataStoreHostApi.setup(null); - TestWKWebViewConfigurationHostApi.setup(null); + TestWKWebsiteDataStoreHostApi.setUp(null); + TestWKWebViewConfigurationHostApi.setUp(null); }); test('WKWebViewConfigurationFlutterApi.create', () { @@ -139,12 +139,12 @@ void main() { setUp(() { mockPlatformHostApi = MockTestWKHttpCookieStoreHostApi(); - TestWKHttpCookieStoreHostApi.setup(mockPlatformHostApi); + TestWKHttpCookieStoreHostApi.setUp(mockPlatformHostApi); - TestWKWebViewConfigurationHostApi.setup( + TestWKWebViewConfigurationHostApi.setUp( MockTestWKWebViewConfigurationHostApi(), ); - TestWKWebsiteDataStoreHostApi.setup( + TestWKWebsiteDataStoreHostApi.setUp( MockTestWKWebsiteDataStoreHostApi(), ); @@ -160,9 +160,9 @@ void main() { }); tearDown(() { - TestWKHttpCookieStoreHostApi.setup(null); - TestWKWebsiteDataStoreHostApi.setup(null); - TestWKWebViewConfigurationHostApi.setup(null); + TestWKHttpCookieStoreHostApi.setUp(null); + TestWKWebsiteDataStoreHostApi.setUp(null); + TestWKWebViewConfigurationHostApi.setUp(null); }); test('createFromWebsiteDataStore', () { @@ -200,7 +200,7 @@ void main() { setUp(() async { mockPlatformHostApi = MockTestWKScriptMessageHandlerHostApi(); - TestWKScriptMessageHandlerHostApi.setup(mockPlatformHostApi); + TestWKScriptMessageHandlerHostApi.setUp(mockPlatformHostApi); scriptMessageHandler = WKScriptMessageHandler( didReceiveScriptMessage: (_, __) {}, @@ -209,7 +209,7 @@ void main() { }); tearDown(() { - TestWKScriptMessageHandlerHostApi.setup(null); + TestWKScriptMessageHandlerHostApi.setUp(null); }); test('create', () async { @@ -264,9 +264,9 @@ void main() { setUp(() { mockPlatformHostApi = MockTestWKPreferencesHostApi(); - TestWKPreferencesHostApi.setup(mockPlatformHostApi); + TestWKPreferencesHostApi.setUp(mockPlatformHostApi); - TestWKWebViewConfigurationHostApi.setup( + TestWKWebViewConfigurationHostApi.setUp( MockTestWKWebViewConfigurationHostApi(), ); webViewConfiguration = WKWebViewConfiguration( @@ -280,8 +280,8 @@ void main() { }); tearDown(() { - TestWKPreferencesHostApi.setup(null); - TestWKWebViewConfigurationHostApi.setup(null); + TestWKPreferencesHostApi.setUp(null); + TestWKWebViewConfigurationHostApi.setUp(null); }); test('createFromWebViewConfiguration', () async { @@ -309,9 +309,9 @@ void main() { setUp(() { mockPlatformHostApi = MockTestWKUserContentControllerHostApi(); - TestWKUserContentControllerHostApi.setup(mockPlatformHostApi); + TestWKUserContentControllerHostApi.setUp(mockPlatformHostApi); - TestWKWebViewConfigurationHostApi.setup( + TestWKWebViewConfigurationHostApi.setUp( MockTestWKWebViewConfigurationHostApi(), ); webViewConfiguration = WKWebViewConfiguration( @@ -326,8 +326,8 @@ void main() { }); tearDown(() { - TestWKUserContentControllerHostApi.setup(null); - TestWKWebViewConfigurationHostApi.setup(null); + TestWKUserContentControllerHostApi.setUp(null); + TestWKWebViewConfigurationHostApi.setUp(null); }); test('createFromWebViewConfiguration', () async { @@ -338,7 +338,7 @@ void main() { }); test('addScriptMessageHandler', () async { - TestWKScriptMessageHandlerHostApi.setup( + TestWKScriptMessageHandlerHostApi.setUp( MockTestWKScriptMessageHandlerHostApi(), ); final WKScriptMessageHandler handler = WKScriptMessageHandler( @@ -397,7 +397,7 @@ void main() { setUp(() async { mockPlatformHostApi = MockTestWKWebViewConfigurationHostApi(); - TestWKWebViewConfigurationHostApi.setup(mockPlatformHostApi); + TestWKWebViewConfigurationHostApi.setUp(mockPlatformHostApi); webViewConfiguration = WKWebViewConfiguration( instanceManager: instanceManager, @@ -405,7 +405,7 @@ void main() { }); tearDown(() { - TestWKWebViewConfigurationHostApi.setup(null); + TestWKWebViewConfigurationHostApi.setUp(null); }); test('create', () async { @@ -417,8 +417,8 @@ void main() { }); test('createFromWebView', () async { - TestWKWebViewHostApi.setup(MockTestWKWebViewHostApi()); - final WKWebView webView = WKWebView( + TestWKWebViewHostApi.setUp(MockTestWKWebViewHostApi()); + final WKWebView webView = WKWebViewIOS( webViewConfiguration, instanceManager: instanceManager, ); @@ -479,13 +479,13 @@ void main() { setUp(() async { mockPlatformHostApi = MockTestWKNavigationDelegateHostApi(); - TestWKNavigationDelegateHostApi.setup(mockPlatformHostApi); + TestWKNavigationDelegateHostApi.setUp(mockPlatformHostApi); - TestWKWebViewConfigurationHostApi.setup( + TestWKWebViewConfigurationHostApi.setUp( MockTestWKWebViewConfigurationHostApi(), ); - TestWKWebViewHostApi.setup(MockTestWKWebViewHostApi()); - webView = WKWebView( + TestWKWebViewHostApi.setUp(MockTestWKWebViewHostApi()); + webView = WKWebViewIOS( WKWebViewConfiguration(instanceManager: instanceManager), instanceManager: instanceManager, ); @@ -496,9 +496,9 @@ void main() { }); tearDown(() { - TestWKNavigationDelegateHostApi.setup(null); - TestWKWebViewConfigurationHostApi.setup(null); - TestWKWebViewHostApi.setup(null); + TestWKNavigationDelegateHostApi.setUp(null); + TestWKWebViewConfigurationHostApi.setUp(null); + TestWKWebViewHostApi.setUp(null); }); test('create', () async { @@ -785,15 +785,15 @@ void main() { setUp(() { mockPlatformHostApi = MockTestWKWebViewHostApi(); - TestWKWebViewHostApi.setup(mockPlatformHostApi); + TestWKWebViewHostApi.setUp(mockPlatformHostApi); - TestWKWebViewConfigurationHostApi.setup( + TestWKWebViewConfigurationHostApi.setUp( MockTestWKWebViewConfigurationHostApi()); webViewConfiguration = WKWebViewConfiguration( instanceManager: instanceManager, ); - webView = WKWebView( + webView = WKWebViewIOS( webViewConfiguration, instanceManager: instanceManager, ); @@ -801,8 +801,8 @@ void main() { }); tearDown(() { - TestWKWebViewHostApi.setup(null); - TestWKWebViewConfigurationHostApi.setup(null); + TestWKWebViewHostApi.setUp(null); + TestWKWebViewConfigurationHostApi.setUp(null); }); test('create', () async { @@ -815,7 +815,7 @@ void main() { }); test('setUIDelegate', () async { - TestWKUIDelegateHostApi.setup(MockTestWKUIDelegateHostApi()); + TestWKUIDelegateHostApi.setUp(MockTestWKUIDelegateHostApi()); final WKUIDelegate uiDelegate = WKUIDelegate( instanceManager: instanceManager, ); @@ -826,11 +826,11 @@ void main() { instanceManager.getIdentifier(uiDelegate), )); - TestWKUIDelegateHostApi.setup(null); + TestWKUIDelegateHostApi.setUp(null); }); test('setNavigationDelegate', () async { - TestWKNavigationDelegateHostApi.setup( + TestWKNavigationDelegateHostApi.setUp( MockTestWKNavigationDelegateHostApi(), ); final WKNavigationDelegate navigationDelegate = WKNavigationDelegate( @@ -843,7 +843,7 @@ void main() { instanceManager.getIdentifier(navigationDelegate), )); - TestWKNavigationDelegateHostApi.setup(null); + TestWKNavigationDelegateHostApi.setUp(null); }); test('getUrl', () { @@ -979,13 +979,13 @@ void main() { setUp(() async { mockPlatformHostApi = MockTestWKUIDelegateHostApi(); - TestWKUIDelegateHostApi.setup(mockPlatformHostApi); + TestWKUIDelegateHostApi.setUp(mockPlatformHostApi); uiDelegate = WKUIDelegate(instanceManager: instanceManager); }); tearDown(() { - TestWKUIDelegateHostApi.setup(null); + TestWKUIDelegateHostApi.setUp(null); }); test('create', () async { @@ -1017,7 +1017,7 @@ void main() { }, ); - final WKWebView webView = WKWebView.detached( + final WKWebView webView = WKWebViewIOS.detached( instanceManager: instanceManager, ); instanceManager.addHostCreatedInstance(webView, 2); @@ -1090,7 +1090,7 @@ void main() { instanceManager: instanceManager, ); - final WKWebView webView = WKWebView.detached( + final WKWebView webView = WKWebViewIOS.detached( instanceManager: instanceManager, ); const int webViewIdentifier = 42; 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 99aedf1659f7..d9a0ed01d50d 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 @@ -47,6 +47,7 @@ class MockTestWKHttpCookieStoreHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); + @override _i3.Future setCookie( int? identifier, @@ -108,6 +109,7 @@ class MockTestWKPreferencesHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void setJavaScriptEnabled( int? identifier, @@ -187,6 +189,7 @@ class MockTestWKUserContentControllerHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void addScriptMessageHandler( int? identifier, @@ -204,6 +207,7 @@ class MockTestWKUserContentControllerHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void removeScriptMessageHandler( int? identifier, @@ -219,6 +223,7 @@ class MockTestWKUserContentControllerHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void removeAllScriptMessageHandlers(int? identifier) => super.noSuchMethod( Invocation.method( @@ -227,6 +232,7 @@ class MockTestWKUserContentControllerHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void addUserScript( int? identifier, @@ -242,6 +248,7 @@ class MockTestWKUserContentControllerHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void removeAllUserScripts(int? identifier) => super.noSuchMethod( Invocation.method( @@ -269,6 +276,7 @@ class MockTestWKWebViewConfigurationHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void createFromWebView( int? identifier, @@ -284,6 +292,7 @@ class MockTestWKWebViewConfigurationHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void setAllowsInlineMediaPlayback( int? identifier, @@ -299,6 +308,7 @@ class MockTestWKWebViewConfigurationHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void setLimitsNavigationsToAppBoundDomains( int? identifier, @@ -314,6 +324,7 @@ class MockTestWKWebViewConfigurationHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void setMediaTypesRequiringUserActionForPlayback( int? identifier, @@ -355,6 +366,7 @@ class MockTestWKWebViewHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void setUIDelegate( int? identifier, @@ -370,6 +382,7 @@ class MockTestWKWebViewHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void setNavigationDelegate( int? identifier, @@ -385,11 +398,13 @@ 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( @@ -398,6 +413,7 @@ class MockTestWKWebViewHostApi extends _i1.Mock ), returnValue: 0.0, ) as double); + @override void loadRequest( int? identifier, @@ -413,6 +429,7 @@ class MockTestWKWebViewHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void loadHtmlString( int? identifier, @@ -430,6 +447,7 @@ class MockTestWKWebViewHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void loadFileUrl( int? identifier, @@ -447,6 +465,7 @@ class MockTestWKWebViewHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void loadFlutterAsset( int? identifier, @@ -462,6 +481,7 @@ class MockTestWKWebViewHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); + @override bool canGoBack(int? identifier) => (super.noSuchMethod( Invocation.method( @@ -470,6 +490,7 @@ class MockTestWKWebViewHostApi extends _i1.Mock ), returnValue: false, ) as bool); + @override bool canGoForward(int? identifier) => (super.noSuchMethod( Invocation.method( @@ -478,6 +499,7 @@ class MockTestWKWebViewHostApi extends _i1.Mock ), returnValue: false, ) as bool); + @override void goBack(int? identifier) => super.noSuchMethod( Invocation.method( @@ -486,6 +508,7 @@ class MockTestWKWebViewHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void goForward(int? identifier) => super.noSuchMethod( Invocation.method( @@ -494,6 +517,7 @@ class MockTestWKWebViewHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void reload(int? identifier) => super.noSuchMethod( Invocation.method( @@ -502,11 +526,13 @@ 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, @@ -522,6 +548,7 @@ class MockTestWKWebViewHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void setCustomUserAgent( int? identifier, @@ -537,6 +564,7 @@ class MockTestWKWebViewHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); + @override _i3.Future evaluateJavaScript( int? identifier, @@ -552,6 +580,7 @@ class MockTestWKWebViewHostApi extends _i1.Mock ), returnValue: _i3.Future.value(), ) as _i3.Future); + @override void setInspectable( int? identifier, @@ -567,6 +596,7 @@ class MockTestWKWebViewHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); + @override String? getCustomUserAgent(int? identifier) => (super.noSuchMethod(Invocation.method( @@ -599,6 +629,7 @@ class MockTestWKWebsiteDataStoreHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void createDefaultDataStore(int? identifier) => super.noSuchMethod( Invocation.method( @@ -607,6 +638,7 @@ class MockTestWKWebsiteDataStoreHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); + @override _i3.Future removeDataOfTypes( int? identifier, diff --git a/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_navigation_delegate_test.dart b/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_navigation_delegate_test.dart index da8675886f7e..8a1ba88ee26d 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_navigation_delegate_test.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_navigation_delegate_test.dart @@ -42,7 +42,7 @@ void main() { webKitDelegate.setOnPageFinished((String url) => callbackUrl = url); CapturingNavigationDelegate.lastCreatedDelegate.didFinishNavigation!( - WKWebView.detached(), + WKWebViewIOS.detached(), 'https://www.google.com', ); @@ -64,7 +64,7 @@ void main() { CapturingNavigationDelegate .lastCreatedDelegate.didStartProvisionalNavigation!( - WKWebView.detached(), + WKWebViewIOS.detached(), 'https://www.google.com', ); @@ -90,7 +90,7 @@ void main() { CapturingNavigationDelegate .lastCreatedDelegate.decidePolicyForNavigationResponse!( - WKWebView.detached(), + WKWebViewIOS.detached(), const WKNavigationResponse( response: NSHttpUrlResponse(statusCode: 401), forMainFrame: true), ); @@ -117,7 +117,7 @@ void main() { CapturingNavigationDelegate .lastCreatedDelegate.decidePolicyForNavigationResponse!( - WKWebView.detached(), + WKWebViewIOS.detached(), const WKNavigationResponse( response: NSHttpUrlResponse(statusCode: 399), forMainFrame: true), ); @@ -143,7 +143,7 @@ void main() { webKitDelegate.setOnWebResourceError(onWebResourceError); CapturingNavigationDelegate.lastCreatedDelegate.didFailNavigation!( - WKWebView.detached(), + WKWebViewIOS.detached(), const NSError( code: WKErrorCode.webViewInvalidated, domain: 'domain', @@ -182,7 +182,7 @@ void main() { CapturingNavigationDelegate .lastCreatedDelegate.didFailProvisionalNavigation!( - WKWebView.detached(), + WKWebViewIOS.detached(), const NSError( code: WKErrorCode.webViewInvalidated, domain: 'domain', @@ -221,7 +221,7 @@ void main() { CapturingNavigationDelegate .lastCreatedDelegate.webViewWebContentProcessDidTerminate!( - WKWebView.detached(), + WKWebViewIOS.detached(), ); expect(callbackError.description, ''); @@ -256,7 +256,7 @@ void main() { expect( CapturingNavigationDelegate .lastCreatedDelegate.decidePolicyForNavigationAction!( - WKWebView.detached(), + WKWebViewIOS.detached(), const WKNavigationAction( request: NSUrlRequest(url: 'https://www.google.com'), targetFrame: WKFrameInfo( @@ -295,7 +295,7 @@ void main() { CapturingNavigationDelegate .lastCreatedDelegate.didReceiveAuthenticationChallenge!( - WKWebView.detached(), + WKWebViewIOS.detached(), NSUrlAuthenticationChallenge.detached( protectionSpace: NSUrlProtectionSpace.detached( host: expectedHost, @@ -309,6 +309,44 @@ void main() { expect(callbackHost, expectedHost); expect(callbackRealm, expectedRealm); }); + + test('onHttpNtlmAuthRequest emits host and realm', () { + final WebKitNavigationDelegate iosNavigationDelegate = + WebKitNavigationDelegate( + const WebKitNavigationDelegateCreationParams( + webKitProxy: WebKitProxy( + createNavigationDelegate: CapturingNavigationDelegate.new, + ), + ), + ); + + String? callbackHost; + String? callbackRealm; + + iosNavigationDelegate.setOnHttpAuthRequest((HttpAuthRequest request) { + callbackHost = request.host; + callbackRealm = request.realm; + }); + + const String expectedHost = 'expectedHost'; + const String expectedRealm = 'expectedRealm'; + + CapturingNavigationDelegate + .lastCreatedDelegate.didReceiveAuthenticationChallenge!( + WKWebViewIOS.detached(), + NSUrlAuthenticationChallenge.detached( + protectionSpace: NSUrlProtectionSpace.detached( + host: expectedHost, + realm: expectedRealm, + authenticationMethod: NSUrlAuthenticationMethod.httpNtlm, + ), + ), + (NSUrlSessionAuthChallengeDisposition disposition, + NSUrlCredential? credential) {}); + + expect(callbackHost, expectedHost); + expect(callbackRealm, expectedRealm); + }); }); } diff --git a/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_webview_controller_test.dart b/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_webview_controller_test.dart index b5f731f97357..d7aab4b54266 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_webview_controller_test.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_webview_controller_test.dart @@ -27,7 +27,7 @@ import 'webkit_webview_controller_test.mocks.dart'; WKPreferences, WKUserContentController, WKWebsiteDataStore, - WKWebView, + WKWebViewIOS, WKWebViewConfiguration, WKScriptMessageHandler, ]) @@ -42,7 +42,7 @@ void main() { WKUIDelegate? uiDelegate, MockWKUserContentController? mockUserContentController, MockWKWebsiteDataStore? mockWebsiteDataStore, - MockWKWebView Function( + MockWKWebViewIOS Function( WKWebViewConfiguration configuration, { void Function( String keyPath, @@ -55,7 +55,7 @@ void main() { }) { final MockWKWebViewConfiguration nonNullMockWebViewConfiguration = mockWebViewConfiguration ?? MockWKWebViewConfiguration(); - late final MockWKWebView nonNullMockWebView; + late final MockWKWebViewIOS nonNullMockWebView; final PlatformWebViewControllerCreationParams controllerCreationParams = WebKitWebViewControllerCreationParams( @@ -73,7 +73,7 @@ void main() { InstanceManager? instanceManager, }) { nonNullMockWebView = createMockWebView == null - ? MockWKWebView() + ? MockWKWebViewIOS() : createMockWebView( nonNullMockWebViewConfiguration, observeValue: observeValue, @@ -275,7 +275,7 @@ void main() { }); test('loadFile', () async { - final MockWKWebView mockWebView = MockWKWebView(); + final MockWKWebViewIOS mockWebView = MockWKWebViewIOS(); final WebKitWebViewController controller = createControllerWithMocks( createMockWebView: (_, {dynamic observeValue}) => mockWebView, @@ -289,7 +289,7 @@ void main() { }); test('loadFlutterAsset', () async { - final MockWKWebView mockWebView = MockWKWebView(); + final MockWKWebViewIOS mockWebView = MockWKWebViewIOS(); final WebKitWebViewController controller = createControllerWithMocks( createMockWebView: (_, {dynamic observeValue}) => mockWebView, @@ -300,7 +300,7 @@ void main() { }); test('loadHtmlString', () async { - final MockWKWebView mockWebView = MockWKWebView(); + final MockWKWebViewIOS mockWebView = MockWKWebViewIOS(); final WebKitWebViewController controller = createControllerWithMocks( createMockWebView: (_, {dynamic observeValue}) => mockWebView, @@ -317,7 +317,7 @@ void main() { group('loadRequest', () { test('Throws ArgumentError for empty scheme', () async { - final MockWKWebView mockWebView = MockWKWebView(); + final MockWKWebViewIOS mockWebView = MockWKWebViewIOS(); final WebKitWebViewController controller = createControllerWithMocks( createMockWebView: (_, {dynamic observeValue}) => mockWebView, @@ -332,7 +332,7 @@ void main() { }); test('GET without headers', () async { - final MockWKWebView mockWebView = MockWKWebView(); + final MockWKWebViewIOS mockWebView = MockWKWebViewIOS(); final WebKitWebViewController controller = createControllerWithMocks( createMockWebView: (_, {dynamic observeValue}) => mockWebView, @@ -351,7 +351,7 @@ void main() { }); test('GET with headers', () async { - final MockWKWebView mockWebView = MockWKWebView(); + final MockWKWebViewIOS mockWebView = MockWKWebViewIOS(); final WebKitWebViewController controller = createControllerWithMocks( createMockWebView: (_, {dynamic observeValue}) => mockWebView, @@ -373,7 +373,7 @@ void main() { }); test('POST without body', () async { - final MockWKWebView mockWebView = MockWKWebView(); + final MockWKWebViewIOS mockWebView = MockWKWebViewIOS(); final WebKitWebViewController controller = createControllerWithMocks( createMockWebView: (_, {dynamic observeValue}) => mockWebView, @@ -392,7 +392,7 @@ void main() { }); test('POST with body', () async { - final MockWKWebView mockWebView = MockWKWebView(); + final MockWKWebViewIOS mockWebView = MockWKWebViewIOS(); final WebKitWebViewController controller = createControllerWithMocks( createMockWebView: (_, {dynamic observeValue}) => mockWebView, @@ -417,7 +417,7 @@ void main() { }); test('canGoBack', () { - final MockWKWebView mockWebView = MockWKWebView(); + final MockWKWebViewIOS mockWebView = MockWKWebViewIOS(); final WebKitWebViewController controller = createControllerWithMocks( createMockWebView: (_, {dynamic observeValue}) => mockWebView, @@ -430,7 +430,7 @@ void main() { }); test('canGoForward', () { - final MockWKWebView mockWebView = MockWKWebView(); + final MockWKWebViewIOS mockWebView = MockWKWebViewIOS(); final WebKitWebViewController controller = createControllerWithMocks( createMockWebView: (_, {dynamic observeValue}) => mockWebView, @@ -443,7 +443,7 @@ void main() { }); test('goBack', () async { - final MockWKWebView mockWebView = MockWKWebView(); + final MockWKWebViewIOS mockWebView = MockWKWebViewIOS(); final WebKitWebViewController controller = createControllerWithMocks( createMockWebView: (_, {dynamic observeValue}) => mockWebView, @@ -454,7 +454,7 @@ void main() { }); test('goForward', () async { - final MockWKWebView mockWebView = MockWKWebView(); + final MockWKWebViewIOS mockWebView = MockWKWebViewIOS(); final WebKitWebViewController controller = createControllerWithMocks( createMockWebView: (_, {dynamic observeValue}) => mockWebView, @@ -465,7 +465,7 @@ void main() { }); test('reload', () async { - final MockWKWebView mockWebView = MockWKWebView(); + final MockWKWebViewIOS mockWebView = MockWKWebViewIOS(); final WebKitWebViewController controller = createControllerWithMocks( createMockWebView: (_, {dynamic observeValue}) => mockWebView, @@ -476,7 +476,7 @@ void main() { }); test('setAllowsBackForwardNavigationGestures', () async { - final MockWKWebView mockWebView = MockWKWebView(); + final MockWKWebViewIOS mockWebView = MockWKWebViewIOS(); final WebKitWebViewController controller = createControllerWithMocks( createMockWebView: (_, {dynamic observeValue}) => mockWebView, @@ -487,7 +487,7 @@ void main() { }); test('runJavaScriptReturningResult', () { - final MockWKWebView mockWebView = MockWKWebView(); + final MockWKWebViewIOS mockWebView = MockWKWebViewIOS(); final WebKitWebViewController controller = createControllerWithMocks( createMockWebView: (_, {dynamic observeValue}) => mockWebView, @@ -504,7 +504,7 @@ void main() { }); test('runJavaScriptReturningResult throws error on null return value', () { - final MockWKWebView mockWebView = MockWKWebView(); + final MockWKWebViewIOS mockWebView = MockWKWebViewIOS(); final WebKitWebViewController controller = createControllerWithMocks( createMockWebView: (_, {dynamic observeValue}) => mockWebView, @@ -520,7 +520,7 @@ void main() { }); test('runJavaScript', () { - final MockWKWebView mockWebView = MockWKWebView(); + final MockWKWebViewIOS mockWebView = MockWKWebViewIOS(); final WebKitWebViewController controller = createControllerWithMocks( createMockWebView: (_, {dynamic observeValue}) => mockWebView, @@ -537,7 +537,7 @@ void main() { test('runJavaScript ignores exception with unsupported javaScript type', () { - final MockWKWebView mockWebView = MockWKWebView(); + final MockWKWebViewIOS mockWebView = MockWKWebViewIOS(); final WebKitWebViewController controller = createControllerWithMocks( createMockWebView: (_, {dynamic observeValue}) => mockWebView, @@ -558,7 +558,7 @@ void main() { }); test('getTitle', () async { - final MockWKWebView mockWebView = MockWKWebView(); + final MockWKWebViewIOS mockWebView = MockWKWebViewIOS(); final WebKitWebViewController controller = createControllerWithMocks( createMockWebView: (_, {dynamic observeValue}) => mockWebView, @@ -570,7 +570,7 @@ void main() { }); test('currentUrl', () { - final MockWKWebView mockWebView = MockWKWebView(); + final MockWKWebViewIOS mockWebView = MockWKWebViewIOS(); final WebKitWebViewController controller = createControllerWithMocks( createMockWebView: (_, {dynamic observeValue}) => mockWebView, @@ -646,7 +646,7 @@ void main() { }); test('setBackgroundColor', () async { - final MockWKWebView mockWebView = MockWKWebView(); + final MockWKWebViewIOS mockWebView = MockWKWebViewIOS(); final MockUIScrollView mockScrollView = MockUIScrollView(); final WebKitWebViewController controller = createControllerWithMocks( @@ -665,7 +665,7 @@ void main() { }); test('userAgent', () async { - final MockWKWebView mockWebView = MockWKWebView(); + final MockWKWebViewIOS mockWebView = MockWKWebViewIOS(); final WebKitWebViewController controller = createControllerWithMocks( createMockWebView: (_, {dynamic observeValue}) => mockWebView, @@ -910,7 +910,7 @@ void main() { }); test('getUserAgent', () { - final MockWKWebView mockWebView = MockWKWebView(); + final MockWKWebViewIOS mockWebView = MockWKWebViewIOS(); final WebKitWebViewController controller = createControllerWithMocks( createMockWebView: (_, {dynamic observeValue}) => mockWebView, @@ -925,7 +925,7 @@ void main() { }); test('setPlatformNavigationDelegate', () { - final MockWKWebView mockWebView = MockWKWebView(); + final MockWKWebViewIOS mockWebView = MockWKWebViewIOS(); final WebKitWebViewController controller = createControllerWithMocks( createMockWebView: (_, {dynamic observeValue}) => mockWebView, @@ -951,7 +951,7 @@ void main() { }); test('setPlatformNavigationDelegate onProgress', () async { - final MockWKWebView mockWebView = MockWKWebView(); + final MockWKWebViewIOS mockWebView = MockWKWebViewIOS(); late final void Function( String keyPath, @@ -1017,7 +1017,7 @@ void main() { // CapturingUIDelegate.lastCreatedDelegate. createControllerWithMocks(); - final MockWKWebView mockWebView = MockWKWebView(); + final MockWKWebViewIOS mockWebView = MockWKWebViewIOS(); const NSUrlRequest request = NSUrlRequest(url: 'https://www.google.com'); CapturingUIDelegate.lastCreatedDelegate.onCreateWebView!( @@ -1038,7 +1038,7 @@ void main() { test( 'setPlatformNavigationDelegate onProgress can be changed by the WebKitNavigationDelegate', () async { - final MockWKWebView mockWebView = MockWKWebView(); + final MockWKWebViewIOS mockWebView = MockWKWebViewIOS(); late final void Function( String keyPath, @@ -1090,7 +1090,7 @@ void main() { }); test('setPlatformNavigationDelegate onUrlChange', () async { - final MockWKWebView mockWebView = MockWKWebView(); + final MockWKWebViewIOS mockWebView = MockWKWebViewIOS(); late final void Function( String keyPath, @@ -1154,7 +1154,7 @@ void main() { }); test('setPlatformNavigationDelegate onUrlChange to null NSUrl', () async { - final MockWKWebView mockWebView = MockWKWebView(); + final MockWKWebViewIOS mockWebView = MockWKWebViewIOS(); late final void Function( String keyPath, @@ -1207,8 +1207,8 @@ void main() { final InstanceManager instanceManager = InstanceManager( onWeakReferenceRemoved: (_) {}, ); - final MockWKWebView mockWebView = MockWKWebView(); - when(mockWebView.copy()).thenReturn(MockWKWebView()); + final MockWKWebViewIOS mockWebView = MockWKWebViewIOS(); + when(mockWebView.copy()).thenReturn(MockWKWebViewIOS()); instanceManager.addHostCreatedInstance(mockWebView, 0); final WebKitWebViewController controller = createControllerWithMocks( @@ -1244,7 +1244,7 @@ void main() { final WKPermissionDecision decision = await onPermissionRequestCallback( CapturingUIDelegate.lastCreatedDelegate, - WKWebView.detached(), + WKWebViewIOS.detached(), const WKSecurityOrigin(host: '', port: 0, protocol: ''), const WKFrameInfo( isMainFrame: false, @@ -1337,7 +1337,7 @@ void main() { }); test('inspectable', () async { - final MockWKWebView mockWebView = MockWKWebView(); + final MockWKWebViewIOS mockWebView = MockWKWebViewIOS(); final WebKitWebViewController controller = createControllerWithMocks( createMockWebView: (_, {dynamic observeValue}) => mockWebView, 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 932c567fb1e5..0c4924df62dc 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 @@ -159,6 +159,7 @@ class MockNSUrl extends _i1.Mock implements _i2.NSUrl { ), returnValue: _i6.Future.value(), ) as _i6.Future); + @override _i2.NSObject copy() => (super.noSuchMethod( Invocation.method( @@ -173,6 +174,7 @@ class MockNSUrl extends _i1.Mock implements _i2.NSUrl { ), ), ) as _i2.NSObject); + @override _i6.Future addObserver( _i2.NSObject? observer, { @@ -191,6 +193,7 @@ 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, { @@ -230,6 +233,7 @@ class MockUIScrollView extends _i1.Mock implements _i4.UIScrollView { ), )), ) as _i6.Future<_i3.Point>); + @override _i6.Future scrollBy(_i3.Point? offset) => (super.noSuchMethod( Invocation.method( @@ -239,6 +243,7 @@ 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( @@ -249,6 +254,7 @@ class MockUIScrollView extends _i1.Mock implements _i4.UIScrollView { returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); + @override _i6.Future setDelegate(_i4.UIScrollViewDelegate? delegate) => (super.noSuchMethod( @@ -259,6 +265,7 @@ 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( @@ -273,6 +280,7 @@ class MockUIScrollView extends _i1.Mock implements _i4.UIScrollView { ), ), ) as _i4.UIScrollView); + @override _i6.Future setBackgroundColor(_i7.Color? color) => (super.noSuchMethod( Invocation.method( @@ -282,6 +290,7 @@ 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( @@ -291,6 +300,7 @@ 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, { @@ -309,6 +319,7 @@ 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, { @@ -349,6 +360,7 @@ class MockUIScrollViewDelegate extends _i1.Mock ), ), ) as _i4.UIScrollViewDelegate); + @override _i6.Future addObserver( _i2.NSObject? observer, { @@ -367,6 +379,7 @@ class MockUIScrollViewDelegate extends _i1.Mock returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); + @override _i6.Future removeObserver( _i2.NSObject? observer, { @@ -401,6 +414,7 @@ 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( @@ -415,6 +429,7 @@ class MockWKPreferences extends _i1.Mock implements _i5.WKPreferences { ), ), ) as _i5.WKPreferences); + @override _i6.Future addObserver( _i2.NSObject? observer, { @@ -433,6 +448,7 @@ 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, { @@ -475,6 +491,7 @@ class MockWKUserContentController extends _i1.Mock returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); + @override _i6.Future removeScriptMessageHandler(String? name) => (super.noSuchMethod( @@ -485,6 +502,7 @@ class MockWKUserContentController extends _i1.Mock returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); + @override _i6.Future removeAllScriptMessageHandlers() => (super.noSuchMethod( Invocation.method( @@ -494,6 +512,7 @@ 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( @@ -504,6 +523,7 @@ class MockWKUserContentController extends _i1.Mock returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); + @override _i6.Future removeAllUserScripts() => (super.noSuchMethod( Invocation.method( @@ -513,6 +533,7 @@ class MockWKUserContentController extends _i1.Mock returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); + @override _i5.WKUserContentController copy() => (super.noSuchMethod( Invocation.method( @@ -527,6 +548,7 @@ class MockWKUserContentController extends _i1.Mock ), ), ) as _i5.WKUserContentController); + @override _i6.Future addObserver( _i2.NSObject? observer, { @@ -545,6 +567,7 @@ class MockWKUserContentController extends _i1.Mock returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); + @override _i6.Future removeObserver( _i2.NSObject? observer, { @@ -579,6 +602,7 @@ class MockWKWebsiteDataStore extends _i1.Mock Invocation.getter(#httpCookieStore), ), ) as _i5.WKHttpCookieStore); + @override _i6.Future removeDataOfTypes( Set<_i5.WKWebsiteDataType>? dataTypes, @@ -594,6 +618,7 @@ class MockWKWebsiteDataStore extends _i1.Mock ), returnValue: _i6.Future.value(false), ) as _i6.Future); + @override _i5.WKWebsiteDataStore copy() => (super.noSuchMethod( Invocation.method( @@ -608,6 +633,7 @@ class MockWKWebsiteDataStore extends _i1.Mock ), ), ) as _i5.WKWebsiteDataStore); + @override _i6.Future addObserver( _i2.NSObject? observer, { @@ -626,6 +652,7 @@ class MockWKWebsiteDataStore extends _i1.Mock returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); + @override _i6.Future removeObserver( _i2.NSObject? observer, { @@ -642,15 +669,23 @@ class MockWKWebsiteDataStore extends _i1.Mock ) as _i6.Future); } -/// A class which mocks [WKWebView]. +/// A class which mocks [WKWebViewIOS]. /// /// See the documentation for Mockito's code generation for more information. -// ignore: must_be_immutable -class MockWKWebView extends _i1.Mock implements _i5.WKWebView { - MockWKWebView() { +class MockWKWebViewIOS extends _i1.Mock implements _i5.WKWebViewIOS { + MockWKWebViewIOS() { _i1.throwOnMissingStub(this); } + @override + _i4.UIScrollView get scrollView => (super.noSuchMethod( + Invocation.getter(#scrollView), + returnValue: _FakeUIScrollView_2( + this, + Invocation.getter(#scrollView), + ), + ) as _i4.UIScrollView); + @override _i5.WKWebViewConfiguration get configuration => (super.noSuchMethod( Invocation.getter(#configuration), @@ -659,14 +694,42 @@ class MockWKWebView extends _i1.Mock implements _i5.WKWebView { Invocation.getter(#configuration), ), ) as _i5.WKWebViewConfiguration); + @override - _i4.UIScrollView get scrollView => (super.noSuchMethod( - Invocation.getter(#scrollView), - returnValue: _FakeUIScrollView_2( + _i5.WKWebView copy() => (super.noSuchMethod( + Invocation.method( + #copy, + [], + ), + returnValue: _FakeWKWebView_9( this, - Invocation.getter(#scrollView), + Invocation.method( + #copy, + [], + ), ), - ) as _i4.UIScrollView); + ) as _i5.WKWebView); + + @override + _i6.Future setBackgroundColor(_i7.Color? color) => (super.noSuchMethod( + Invocation.method( + #setBackgroundColor, + [color], + ), + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); + + @override + _i6.Future setOpaque(bool? opaque) => (super.noSuchMethod( + Invocation.method( + #setOpaque, + [opaque], + ), + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); + @override _i6.Future setUIDelegate(_i5.WKUIDelegate? delegate) => (super.noSuchMethod( @@ -677,6 +740,7 @@ 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( @@ -687,6 +751,7 @@ 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( @@ -695,6 +760,7 @@ class MockWKWebView extends _i1.Mock implements _i5.WKWebView { ), returnValue: _i6.Future.value(), ) as _i6.Future); + @override _i6.Future getEstimatedProgress() => (super.noSuchMethod( Invocation.method( @@ -703,6 +769,7 @@ 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( @@ -713,6 +780,7 @@ 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, { @@ -727,6 +795,7 @@ 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, { @@ -741,6 +810,7 @@ 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( @@ -750,6 +820,7 @@ 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( @@ -758,6 +829,7 @@ class MockWKWebView extends _i1.Mock implements _i5.WKWebView { ), returnValue: _i6.Future.value(false), ) as _i6.Future); + @override _i6.Future canGoForward() => (super.noSuchMethod( Invocation.method( @@ -766,6 +838,7 @@ class MockWKWebView extends _i1.Mock implements _i5.WKWebView { ), returnValue: _i6.Future.value(false), ) as _i6.Future); + @override _i6.Future goBack() => (super.noSuchMethod( Invocation.method( @@ -775,6 +848,7 @@ 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( @@ -784,6 +858,7 @@ 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( @@ -793,6 +868,7 @@ 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( @@ -801,6 +877,16 @@ class MockWKWebView extends _i1.Mock implements _i5.WKWebView { ), returnValue: _i6.Future.value(), ) as _i6.Future); + + @override + _i6.Future getCustomUserAgent() => (super.noSuchMethod( + Invocation.method( + #getCustomUserAgent, + [], + ), + returnValue: _i6.Future.value(), + ) as _i6.Future); + @override _i6.Future setAllowsBackForwardNavigationGestures(bool? allow) => (super.noSuchMethod( @@ -811,6 +897,7 @@ 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( @@ -820,6 +907,7 @@ 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( @@ -829,6 +917,7 @@ 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( @@ -838,46 +927,7 @@ 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( - #getCustomUserAgent, - [], - ), - returnValue: _i6.Future.value(), - ) as _i6.Future); - @override - _i5.WKWebView copy() => (super.noSuchMethod( - Invocation.method( - #copy, - [], - ), - returnValue: _FakeWKWebView_9( - this, - Invocation.method( - #copy, - [], - ), - ), - ) as _i5.WKWebView); - @override - _i6.Future setBackgroundColor(_i7.Color? color) => (super.noSuchMethod( - Invocation.method( - #setBackgroundColor, - [color], - ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); - @override - _i6.Future setOpaque(bool? opaque) => (super.noSuchMethod( - Invocation.method( - #setOpaque, - [opaque], - ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + @override _i6.Future addObserver( _i2.NSObject? observer, { @@ -896,6 +946,7 @@ 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, { @@ -930,6 +981,7 @@ class MockWKWebViewConfiguration extends _i1.Mock Invocation.getter(#userContentController), ), ) as _i5.WKUserContentController); + @override _i5.WKPreferences get preferences => (super.noSuchMethod( Invocation.getter(#preferences), @@ -938,6 +990,7 @@ class MockWKWebViewConfiguration extends _i1.Mock Invocation.getter(#preferences), ), ) as _i5.WKPreferences); + @override _i5.WKWebsiteDataStore get websiteDataStore => (super.noSuchMethod( Invocation.getter(#websiteDataStore), @@ -946,6 +999,7 @@ class MockWKWebViewConfiguration extends _i1.Mock Invocation.getter(#websiteDataStore), ), ) as _i5.WKWebsiteDataStore); + @override _i6.Future setAllowsInlineMediaPlayback(bool? allow) => (super.noSuchMethod( @@ -956,6 +1010,7 @@ class MockWKWebViewConfiguration extends _i1.Mock returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); + @override _i6.Future setLimitsNavigationsToAppBoundDomains(bool? limit) => (super.noSuchMethod( @@ -966,6 +1021,7 @@ class MockWKWebViewConfiguration extends _i1.Mock returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); + @override _i6.Future setMediaTypesRequiringUserActionForPlayback( Set<_i5.WKAudiovisualMediaType>? types) => @@ -977,6 +1033,7 @@ class MockWKWebViewConfiguration extends _i1.Mock returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); + @override _i5.WKWebViewConfiguration copy() => (super.noSuchMethod( Invocation.method( @@ -991,6 +1048,7 @@ class MockWKWebViewConfiguration extends _i1.Mock ), ), ) as _i5.WKWebViewConfiguration); + @override _i6.Future addObserver( _i2.NSObject? observer, { @@ -1009,6 +1067,7 @@ class MockWKWebViewConfiguration extends _i1.Mock returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); + @override _i6.Future removeObserver( _i2.NSObject? observer, { @@ -1049,6 +1108,7 @@ class MockWKScriptMessageHandler extends _i1.Mock _i5.WKUserContentController, _i5.WKScriptMessage, )); + @override _i5.WKScriptMessageHandler copy() => (super.noSuchMethod( Invocation.method( @@ -1063,6 +1123,7 @@ class MockWKScriptMessageHandler extends _i1.Mock ), ), ) as _i5.WKScriptMessageHandler); + @override _i6.Future addObserver( _i2.NSObject? observer, { @@ -1081,6 +1142,7 @@ 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 d9d21dab8db5..bda15f7cec78 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 @@ -63,6 +63,7 @@ class MockWKWebsiteDataStore extends _i1.Mock Invocation.getter(#httpCookieStore), ), ) as _i2.WKHttpCookieStore); + @override _i3.Future removeDataOfTypes( Set<_i2.WKWebsiteDataType>? dataTypes, @@ -78,6 +79,7 @@ class MockWKWebsiteDataStore extends _i1.Mock ), returnValue: _i3.Future.value(false), ) as _i3.Future); + @override _i2.WKWebsiteDataStore copy() => (super.noSuchMethod( Invocation.method( @@ -92,6 +94,7 @@ class MockWKWebsiteDataStore extends _i1.Mock ), ), ) as _i2.WKWebsiteDataStore); + @override _i3.Future addObserver( _i4.NSObject? observer, { @@ -110,6 +113,7 @@ class MockWKWebsiteDataStore extends _i1.Mock returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); + @override _i3.Future removeObserver( _i4.NSObject? observer, { @@ -144,6 +148,7 @@ 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( @@ -158,6 +163,7 @@ class MockWKHttpCookieStore extends _i1.Mock implements _i2.WKHttpCookieStore { ), ), ) as _i2.WKHttpCookieStore); + @override _i3.Future addObserver( _i4.NSObject? observer, { @@ -176,6 +182,7 @@ 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.dart b/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_webview_widget_test.dart index ff7da8715218..3a17047c3edb 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_webview_widget_test.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_webview_widget_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'; + import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/annotations.dart'; @@ -41,7 +43,8 @@ void main() { Builder(builder: (BuildContext context) => widget.build(context)), ); - expect(find.byType(UiKitView), findsOneWidget); + expect(find.byType(Platform.isMacOS ? AppKitView : UiKitView), + findsOneWidget); expect(find.byKey(const Key('keyValue')), findsOneWidget); }); @@ -187,7 +190,7 @@ WebKitWebViewController createTestWebViewController( )? observeValue, InstanceManager? instanceManager, }) { - final WKWebView webView = WKWebView.detached( + final WKWebView webView = WKWebViewIOS.detached( instanceManager: testInstanceManager, ); testInstanceManager.addDartCreatedInstance(webView); 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 8c511d9f8025..2aff8e964b60 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 @@ -99,6 +99,7 @@ class MockWKUIDelegate extends _i1.Mock implements _i2.WKUIDelegate { ), ), ) as _i2.WKUIDelegate); + @override _i3.Future addObserver( _i4.NSObject? observer, { @@ -117,6 +118,7 @@ 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, { @@ -151,6 +153,7 @@ class MockWKWebViewConfiguration extends _i1.Mock Invocation.getter(#userContentController), ), ) as _i2.WKUserContentController); + @override _i2.WKPreferences get preferences => (super.noSuchMethod( Invocation.getter(#preferences), @@ -159,6 +162,7 @@ class MockWKWebViewConfiguration extends _i1.Mock Invocation.getter(#preferences), ), ) as _i2.WKPreferences); + @override _i2.WKWebsiteDataStore get websiteDataStore => (super.noSuchMethod( Invocation.getter(#websiteDataStore), @@ -167,6 +171,7 @@ class MockWKWebViewConfiguration extends _i1.Mock Invocation.getter(#websiteDataStore), ), ) as _i2.WKWebsiteDataStore); + @override _i3.Future setAllowsInlineMediaPlayback(bool? allow) => (super.noSuchMethod( @@ -177,6 +182,7 @@ class MockWKWebViewConfiguration extends _i1.Mock returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); + @override _i3.Future setLimitsNavigationsToAppBoundDomains(bool? limit) => (super.noSuchMethod( @@ -187,6 +193,7 @@ class MockWKWebViewConfiguration extends _i1.Mock returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); + @override _i3.Future setMediaTypesRequiringUserActionForPlayback( Set<_i2.WKAudiovisualMediaType>? types) => @@ -198,6 +205,7 @@ class MockWKWebViewConfiguration extends _i1.Mock returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); + @override _i2.WKWebViewConfiguration copy() => (super.noSuchMethod( Invocation.method( @@ -212,6 +220,7 @@ class MockWKWebViewConfiguration extends _i1.Mock ), ), ) as _i2.WKWebViewConfiguration); + @override _i3.Future addObserver( _i4.NSObject? observer, { @@ -230,6 +239,7 @@ 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/packages/xdg_directories/CHANGELOG.md b/packages/xdg_directories/CHANGELOG.md index 3e08c9927ed1..caad99371e95 100644 --- a/packages/xdg_directories/CHANGELOG.md +++ b/packages/xdg_directories/CHANGELOG.md @@ -1,6 +1,7 @@ -## NEXT +## 1.1.0 * Updates minimum supported SDK version to Flutter 3.19/Dart 3.3. +* Adds `stateHome` property for `XDG_STATE_HOME`. ## 1.0.4 diff --git a/packages/xdg_directories/example/lib/main.dart b/packages/xdg_directories/example/lib/main.dart index fb3695d62436..32ac09c8901c 100644 --- a/packages/xdg_directories/example/lib/main.dart +++ b/packages/xdg_directories/example/lib/main.dart @@ -67,6 +67,7 @@ class _MyHomePageState extends State { 'Config Directories: \n${configDirs.map((Directory directory) => directory.path).toList().join('\n')}\n'), Text('Cache Home: \n${cacheHome.path}\n'), Text('Runtime Directory: \n${runtimeDir?.path}\n'), + Text('State Home: \n${stateHome.path}\n'), const SizedBox( height: 100, ), diff --git a/packages/xdg_directories/lib/xdg_directories.dart b/packages/xdg_directories/lib/xdg_directories.dart index 60448a0ddc2f..4c9330ea7bc7 100644 --- a/packages/xdg_directories/lib/xdg_directories.dart +++ b/packages/xdg_directories/lib/xdg_directories.dart @@ -174,6 +174,13 @@ Directory get dataHome => /// Throws [StateError] if the HOME environment variable is not set. Directory? get runtimeDir => _directoryFromEnvironment('XDG_RUNTIME_DIR'); +/// The base directory relative to which user-specific state data should be +/// written. (Corresponds to `$XDG_STATE_HOME`). +/// +/// Throws [StateError] if the HOME environment variable is not set. +Directory get stateHome => + _directoryFromEnvironmentWithFallback('XDG_STATE_HOME', '.local/state'); + /// Gets the xdg user directory named by `dirName`. /// /// Use [getUserDirectoryNames] to find out the list of available names. diff --git a/packages/xdg_directories/pubspec.yaml b/packages/xdg_directories/pubspec.yaml index 19b030ed1b50..732bf2cd3f44 100644 --- a/packages/xdg_directories/pubspec.yaml +++ b/packages/xdg_directories/pubspec.yaml @@ -2,7 +2,7 @@ name: xdg_directories description: A Dart package for reading XDG directory configuration information on Linux. repository: https://github.com/flutter/packages/tree/main/packages/xdg_directories issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+xdg_directories%22 -version: 1.0.4 +version: 1.1.0 environment: sdk: ^3.3.0 diff --git a/packages/xdg_directories/test/xdg_directories_test.dart b/packages/xdg_directories/test/xdg_directories_test.dart index 9c99afdaf8d9..f84e3374d790 100644 --- a/packages/xdg_directories/test/xdg_directories_test.dart +++ b/packages/xdg_directories/test/xdg_directories_test.dart @@ -38,10 +38,12 @@ void main() { '${testPath('usr/local/test_share')}:${testPath('usr/test_share')}'; fakeEnv['XDG_DATA_HOME'] = testPath('.local/test_share'); fakeEnv['XDG_RUNTIME_DIR'] = testPath('.local/test_runtime'); + fakeEnv['XDG_STATE_HOME'] = testPath('.local/test_state'); Directory(fakeEnv['XDG_CONFIG_HOME']!).createSync(recursive: true); Directory(fakeEnv['XDG_CACHE_HOME']!).createSync(recursive: true); Directory(fakeEnv['XDG_DATA_HOME']!).createSync(recursive: true); Directory(fakeEnv['XDG_RUNTIME_DIR']!).createSync(recursive: true); + Directory(fakeEnv['XDG_STATE_HOME']!).createSync(recursive: true); File(path.join(fakeEnv['XDG_CONFIG_HOME']!, 'user-dirs.dirs')) .writeAsStringSync(r''' XDG_DESKTOP_DIR="$HOME/Desktop" @@ -73,6 +75,7 @@ XDG_VIDEOS_DIR="$HOME/Videos" expect(xdg.cacheHome.path, equals(testPath('.cache'))); expect(xdg.configHome.path, equals(testPath('.config'))); expect(xdg.dataHome.path, equals(testPath('.local/share'))); + expect(xdg.stateHome.path, equals(testPath('.local/state'))); expect(xdg.runtimeDir, isNull); expectDirList(xdg.configDirs, ['/etc/xdg']); @@ -85,6 +88,7 @@ XDG_VIDEOS_DIR="$HOME/Videos" expect(xdg.dataHome.path, equals(testPath('.local/test_share'))); expect(xdg.runtimeDir, isNotNull); expect(xdg.runtimeDir!.path, equals(testPath('.local/test_runtime'))); + expect(xdg.stateHome.path, equals(testPath('.local/test_state'))); expectDirList(xdg.configDirs, [testPath('etc/test_xdg')]); expectDirList(xdg.dataDirs, [ diff --git a/script/configs/allowed_pinned_deps.yaml b/script/configs/allowed_pinned_deps.yaml index 1bc4d26f1b4a..22aad2078c0e 100644 --- a/script/configs/allowed_pinned_deps.yaml +++ b/script/configs/allowed_pinned_deps.yaml @@ -15,12 +15,3 @@ # This should be removed; see # https://github.com/flutter/flutter/issues/130897 - provider - -## Allowed by default - -# Dart-owned -- dart_style -- mockito - -# Google-owned -- file_testing diff --git a/script/configs/allowed_unpinned_deps.yaml b/script/configs/allowed_unpinned_deps.yaml index fa23bb48c910..fead5f119d45 100644 --- a/script/configs/allowed_unpinned_deps.yaml +++ b/script/configs/allowed_unpinned_deps.yaml @@ -32,6 +32,7 @@ - fake_async - ffi - gcloud +- graphs - html - http - intl @@ -43,8 +44,10 @@ - markdown - meta - mime +- mockito - path - platform +- pub_semver - shelf - shelf_static - source_gen @@ -59,6 +62,7 @@ - _discoveryapis_commons - adaptive_navigation - file +- file_testing - googleapis - googleapis_auth - json_annotation diff --git a/script/configs/exclude_xcode_deprecation.yaml b/script/configs/exclude_xcode_deprecation.yaml new file mode 100644 index 000000000000..416839c8e381 --- /dev/null +++ b/script/configs/exclude_xcode_deprecation.yaml @@ -0,0 +1,2 @@ +# TODO(louisehsu): Remove deprecation check when StoreKit 2 is adopted. https://github.com/flutter/flutter/issues/116383 +- in_app_purchase_storekit diff --git a/script/tool/lib/src/common/package_state_utils.dart b/script/tool/lib/src/common/package_state_utils.dart index 316251d4f01a..3d985cf9caf6 100644 --- a/script/tool/lib/src/common/package_state_utils.dart +++ b/script/tool/lib/src/common/package_state_utils.dart @@ -226,6 +226,7 @@ bool _isExampleBuildFile(List pathComponents) { pathComponents.contains('Podfile') || pathComponents.contains('CMakeLists.txt') || pathComponents.contains('.pluginToolsConfig.yaml') || + pathComponents.contains('settings.gradle') || pathComponents.contains('pubspec.yaml'); } diff --git a/script/tool/lib/src/format_command.dart b/script/tool/lib/src/format_command.dart index 3091cf2e11f3..b5e6086b5b30 100644 --- a/script/tool/lib/src/format_command.dart +++ b/script/tool/lib/src/format_command.dart @@ -47,7 +47,7 @@ class FormatCommand extends PackageCommand { super.processRunner, super.platform, }) { - argParser.addFlag('fail-on-change', hide: true); + argParser.addFlag(_failonChangeArg, hide: true); argParser.addFlag(_dartArg, help: 'Format Dart files', defaultsTo: true); argParser.addFlag(_clangFormatArg, help: 'Format with "clang-format"', defaultsTo: true); @@ -66,6 +66,7 @@ class FormatCommand extends PackageCommand { static const String _dartArg = 'dart'; static const String _clangFormatArg = 'clang-format'; + static const String _failonChangeArg = 'fail-on-change'; static const String _kotlinArg = 'kotlin'; static const String _javaArg = 'java'; static const String _swiftArg = 'swift'; @@ -109,7 +110,7 @@ class FormatCommand extends PackageCommand { await _formatAndLintSwift(files); } - if (getBoolArg('fail-on-change')) { + if (getBoolArg(_failonChangeArg)) { final bool modified = await _didModifyAnything(); if (modified) { throw ToolExit(exitCommandFoundErrors); @@ -120,8 +121,13 @@ class FormatCommand extends PackageCommand { Future _didModifyAnything() async { final io.ProcessResult modifiedFiles = await processRunner.run( 'git', - ['ls-files', '--modified'], - workingDir: packagesDir, + [ + 'ls-files', + '--modified', + packagesDir.path, + thirdPartyPackagesDir.path + ], + workingDir: packagesDir.parent, logOnError: true, ); if (modifiedFiles.exitCode != 0) { @@ -146,8 +152,8 @@ class FormatCommand extends PackageCommand { final io.ProcessResult diff = await processRunner.run( 'git', - ['diff'], - workingDir: packagesDir, + ['diff', packagesDir.path, thirdPartyPackagesDir.path], + workingDir: packagesDir.parent, logOnError: true, ); if (diff.exitCode != 0) { diff --git a/script/tool/lib/src/gradle_check_command.dart b/script/tool/lib/src/gradle_check_command.dart index 38977d91c984..a4657560d3f4 100644 --- a/script/tool/lib/src/gradle_check_command.dart +++ b/script/tool/lib/src/gradle_check_command.dart @@ -298,31 +298,13 @@ apply plugin: "com.google.cloud.artifactregistry.gradle-plugin" final RegExpMatch? namespaceMatch = namespaceRegex.firstMatch(gradleContents); - // For plugins, make sure the namespace is conditionalized so that it - // doesn't break client apps using AGP 4.1 and earlier (which don't have - // a namespace property, and will fail to build if it's set). - const String namespaceConditional = - 'if (project.android.hasProperty("namespace"))'; - String exampleSetNamespace = "namespace 'dev.flutter.foo'"; - if (!isExample) { - exampleSetNamespace = ''' -$namespaceConditional { - $exampleSetNamespace -}'''; - } - // Wrap the namespace command in an `android` block, adding the indentation - // to make it line up correctly. - final String exampleAndroidNamespaceBlock = ''' - android { - ${exampleSetNamespace.split('\n').join('\n ')} - } -'''; - if (namespaceMatch == null) { - final String errorMessage = ''' + const String errorMessage = ''' build.gradle must set a "namespace": -$exampleAndroidNamespaceBlock + android { + namespace 'dev.flutter.foo' + } The value must match the "package" attribute in AndroidManifest.xml, if one is present. For more information, see: @@ -333,18 +315,6 @@ https://developer.android.com/build/publish-library/prep-lib-release#choose-name '$indentation${errorMessage.split('\n').join('\n$indentation')}'); return false; } else { - if (!isExample && !gradleContents.contains(namespaceConditional)) { - final String errorMessage = ''' -build.gradle for a plugin must conditionalize "namespace": - -$exampleAndroidNamespaceBlock -'''; - - printError( - '$indentation${errorMessage.split('\n').join('\n$indentation')}'); - return false; - } - return _validateNamespaceMatchesManifest(package, isExample: isExample, namespace: namespaceMatch.group(1)!); } @@ -398,15 +368,15 @@ build.gradle must set an explicit Java compatibility version. This can be done either via "sourceCompatibility"/"targetCompatibility": android { compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_11 + targetCompatibility JavaVersion.VERSION_11 } } or "toolchain": java { toolchain { - languageVersion = JavaLanguageVersion.of(8) + languageVersion = JavaLanguageVersion.of(11) } } diff --git a/script/tool/lib/src/native_test_command.dart b/script/tool/lib/src/native_test_command.dart index 53bf41298d8f..1cd7afb6b4ae 100644 --- a/script/tool/lib/src/native_test_command.dart +++ b/script/tool/lib/src/native_test_command.dart @@ -367,10 +367,21 @@ this command. 'notAnnotation=io.flutter.plugins.DartIntegrationTest'; print('Running integration tests...'); + // Explicitly request all ABIs, as Flutter would if being called + // without a specific target (see + // https://github.com/flutter/flutter/pull/154476) to ensure it can + // run on any architecture emulator. + const List abis = [ + 'android-arm', + 'android-arm64', + 'android-x64', + 'android-x86' + ]; final int exitCode = await project.runCommand( 'app:connectedAndroidTest', arguments: [ '-Pandroid.testInstrumentationRunnerArguments.$filter', + '-Ptarget-platform=${abis.join(',')}', ], ); if (exitCode != 0) { @@ -500,7 +511,6 @@ this command. if (exampleHasUnitTests) { ranUnitTests = true; } - break; } } diff --git a/script/tool/lib/src/podspec_check_command.dart b/script/tool/lib/src/podspec_check_command.dart index 4f1b5e0dfa55..b8aa218ffbc3 100644 --- a/script/tool/lib/src/podspec_check_command.dart +++ b/script/tool/lib/src/podspec_check_command.dart @@ -95,7 +95,8 @@ class PodspecCheckCommand extends PackageLoopingCommand { } } - if (pluginSupportsPlatform(platformIOS, package) && + if ((pluginSupportsPlatform(platformIOS, package) || + pluginSupportsPlatform(platformMacOS, package)) && !podspecs.any(_hasPrivacyManifest)) { printError('No PrivacyInfo.xcprivacy file specified. Please ensure that ' 'a privacy manifest is included in the build using ' diff --git a/script/tool/lib/src/update_excerpts_command.dart b/script/tool/lib/src/update_excerpts_command.dart index 4b4147182b10..5c081ff57a73 100644 --- a/script/tool/lib/src/update_excerpts_command.dart +++ b/script/tool/lib/src/update_excerpts_command.dart @@ -149,7 +149,6 @@ class UpdateExcerptsCommand extends PackageLoopingCommand { language = 'groovy'; default: language = extension.substring(1); - break; } final String section = match.namedGroup('section')!; final String plaster = match.namedGroup('plaster') ?? '···'; diff --git a/script/tool/pubspec.yaml b/script/tool/pubspec.yaml index fef6bc94e7df..73790da9899e 100644 --- a/script/tool/pubspec.yaml +++ b/script/tool/pubspec.yaml @@ -28,7 +28,7 @@ dependencies: dev_dependencies: build_runner: ^2.0.3 matcher: ^0.12.10 - mockito: '>=5.3.2 <=5.5.0' + mockito: ^5.4.4 environment: sdk: '>=3.0.0 <4.0.0' diff --git a/script/tool/test/format_command_test.dart b/script/tool/test/format_command_test.dart index d05aa14c2de8..33f5104ce136 100644 --- a/script/tool/test/format_command_test.dart +++ b/script/tool/test/format_command_test.dart @@ -814,6 +814,25 @@ void main() { 'https://github.com/flutter/packages/blob/main/script/tool/README.md#format-code'), contains('patch -p1 <[ + ProcessCall( + 'git', + [ + 'ls-files', + '--modified', + packagesDir.path, + thirdPartyDir.path + ], + packagesDir.parent.path, + ), + ])); }); test('fails if git ls-files fails', () async { diff --git a/script/tool/test/gradle_check_command_test.dart b/script/tool/test/gradle_check_command_test.dart index 0e6c78ff1fe4..11376e063dc1 100644 --- a/script/tool/test/gradle_check_command_test.dart +++ b/script/tool/test/gradle_check_command_test.dart @@ -41,7 +41,6 @@ void main() { bool includeTargetCompat = false, bool commentSourceLanguage = false, bool includeNamespace = true, - bool conditionalizeNamespace = true, bool commentNamespace = false, bool warningsConfigured = true, }) { @@ -67,18 +66,11 @@ java { '''; final String sourceCompat = - '${commentSourceLanguage ? '// ' : ''}sourceCompatibility JavaVersion.VERSION_1_8'; + '${commentSourceLanguage ? '// ' : ''}sourceCompatibility JavaVersion.VERSION_11'; final String targetCompat = - '${commentSourceLanguage ? '// ' : ''}targetCompatibility JavaVersion.VERSION_1_8'; - String namespace = + '${commentSourceLanguage ? '// ' : ''}targetCompatibility JavaVersion.VERSION_11'; + final String namespace = " ${commentNamespace ? '// ' : ''}namespace '$_defaultFakeNamespace'"; - if (conditionalizeNamespace) { - namespace = ''' - if (project.android.hasProperty("namespace")) { - $namespace - } -'''; - } buildGradle.writeAsStringSync(''' group 'dev.flutter.plugins.fake' @@ -490,28 +482,6 @@ dependencies { ); }); - test('fails when plugin namespace is not conditional', () async { - final RepositoryPackage package = - createFakePlugin('a_plugin', packagesDir, examples: []); - writeFakePluginBuildGradle(package, - includeLanguageVersion: true, conditionalizeNamespace: false); - writeFakeManifest(package); - - Error? commandError; - final List output = await runCapturingPrint( - runner, ['gradle-check'], errorHandler: (Error e) { - commandError = e; - }); - - expect(commandError, isA()); - expect( - output, - containsAllInOrder([ - contains('build.gradle for a plugin must conditionalize "namespace"'), - ]), - ); - }); - test('fails when namespace is missing', () async { final RepositoryPackage package = createFakePlugin('a_plugin', packagesDir, examples: []); diff --git a/script/tool/test/native_test_command_test.dart b/script/tool/test/native_test_command_test.dart index cd3569739e22..02cd5c2c43ea 100644 --- a/script/tool/test/native_test_command_test.dart +++ b/script/tool/test/native_test_command_test.dart @@ -20,6 +20,9 @@ import 'package:test/test.dart'; import 'mocks.dart'; import 'util.dart'; +const String _allAbiFlag = + '-Ptarget-platform=android-arm,android-arm64,android-x64,android-x86'; + const String _androidIntegrationTestFilter = '-Pandroid.testInstrumentationRunnerArguments.' 'notAnnotation=io.flutter.plugins.DartIntegrationTest'; @@ -563,6 +566,7 @@ void main() { const [ 'app:connectedAndroidTest', _androidIntegrationTestFilter, + _allAbiFlag, ], androidFolder.path, ), @@ -697,6 +701,7 @@ public class FlutterActivityTest { const [ 'app:connectedAndroidTest', _androidIntegrationTestFilter, + _allAbiFlag, ], androidFolder.path, ), @@ -734,6 +739,7 @@ public class FlutterActivityTest { const [ 'app:connectedAndroidTest', _androidIntegrationTestFilter, + _allAbiFlag, ], androidFolder.path, ), @@ -1469,12 +1475,12 @@ public class FlutterActivityTest { processRunner.mockProcessesForExecutable['xcrun'] = [ getMockXcodebuildListProcess( ['RunnerTests', 'RunnerUITests']), // iOS list - FakeProcessInfo( - MockProcess(), ['xcodebuild', 'clean', 'test']), // iOS run + FakeProcessInfo(MockProcess(), + ['xcodebuild', 'clean', 'test']), // iOS run getMockXcodebuildListProcess( ['RunnerTests', 'RunnerUITests']), // macOS list - FakeProcessInfo( - MockProcess(), ['xcodebuild', 'clean', 'test']), // macOS run + FakeProcessInfo(MockProcess(), + ['xcodebuild', 'clean', 'test']), // macOS run ]; final List output = await runCapturingPrint(runner, [ diff --git a/script/tool/test/podspec_check_command_test.dart b/script/tool/test/podspec_check_command_test.dart index e416a488fc74..ddbf9db05a5a 100644 --- a/script/tool/test/podspec_check_command_test.dart +++ b/script/tool/test/podspec_check_command_test.dart @@ -605,5 +605,49 @@ void main() { [contains('Ran for 1 package(s)')], )); }); + + test('fails when a macOS plugin is missing a privacy manifest', () async { + final RepositoryPackage plugin = createFakePlugin( + 'plugin1', + packagesDir, + platformSupport: { + Platform.macOS: const PlatformDetails(PlatformSupport.inline), + }, + ); + _writeFakePodspec(plugin, 'macos'); + + Error? commandError; + final List output = await runCapturingPrint( + runner, ['podspec-check'], errorHandler: (Error e) { + commandError = e; + }); + + expect(commandError, isA()); + expect( + output, + containsAllInOrder( + [contains('No PrivacyInfo.xcprivacy file specified.')], + )); + }); + + test('passes when a macOS plugin has a privacy manifest', () async { + final RepositoryPackage plugin = createFakePlugin( + 'plugin1', + packagesDir, + platformSupport: { + Platform.macOS: const PlatformDetails(PlatformSupport.inline), + }, + ); + _writeFakePodspec(plugin, 'macos', includePrivacyManifest: true); + + final List output = + await runCapturingPrint(runner, ['podspec-check']); + + expect( + output, + containsAllInOrder( + [contains('Ran for 1 package(s)')], + )); + }); }); } diff --git a/script/tool/test/util.dart b/script/tool/test/util.dart index c7bdd129fb73..150508dbd161 100644 --- a/script/tool/test/util.dart +++ b/script/tool/test/util.dart @@ -313,7 +313,6 @@ String _pluginPlatformSection( ]); default: assert(false, 'Unrecognized platform: $platform'); - break; } entry = '${lines.join('\n')}\n'; } diff --git a/third_party/packages/cupertino_icons/pubspec.yaml b/third_party/packages/cupertino_icons/pubspec.yaml index 9be062cde69b..76e5962fd4e1 100644 --- a/third_party/packages/cupertino_icons/pubspec.yaml +++ b/third_party/packages/cupertino_icons/pubspec.yaml @@ -9,10 +9,12 @@ environment: sdk: ^3.3.0 dev_dependencies: + collection: ^1.18.0 flutter: sdk: flutter flutter_test: sdk: flutter + path: ^1.9.0 flutter: fonts: diff --git a/third_party/packages/cupertino_icons/test/cupertino_icons_golden_test.dart b/third_party/packages/cupertino_icons/test/cupertino_icons_golden_test.dart new file mode 100644 index 000000000000..8ddf57cb5c54 --- /dev/null +++ b/third_party/packages/cupertino_icons/test/cupertino_icons_golden_test.dart @@ -0,0 +1,99 @@ +// 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:io' show File, Platform; + +import 'package:collection/collection.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/foundation.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:path/path.dart' as path; + +import 'icons_list.dart'; + +// The EM of the font is 512. Keep this a power of 2 for fixed-point arithmetic. +const double iconSize = 128.0; +const int iconsPerRow = 5; +const int iconsPerCol = 5; +const int iconsPerImage = iconsPerRow * iconsPerCol; + +void main() async { + // Do not run on web since this test uses dart:io. + // The golden test runs on Linux only to avoid platform rendering differences. + if (kIsWeb || !Platform.isLinux) { + return; + } + final bool isMainChannel = !Platform.environment.containsKey('CHANNEL') || + Platform.environment['CHANNEL'] == 'main' || + Platform.environment['CHANNEL'] == 'master'; + // Only test against main to avoid rendering differences between flutter channels. + if (!isMainChannel) { + return; + } + // Load font. + final String effectiveFontFamily = const TextStyle( + fontFamily: CupertinoIcons.iconFont, + package: CupertinoIcons.iconFontPackage) + .fontFamily!; + final FontLoader fontLoader = FontLoader(effectiveFontFamily); + final String filePath = path.canonicalize('assets/CupertinoIcons.ttf'); + final File file = File(filePath); + fontLoader + .addFont(file.readAsBytes().then((Uint8List v) => v.buffer.asByteData())); + await fontLoader.load(); + + assert(icons.isNotEmpty); + for (int index = 0; index < icons.length;) { + final int groupEndCodePoint = + (icons[index].codePoint ~/ iconsPerImage + 1) * iconsPerImage; + final int next = icons.indexWhere( + (IconData icon) => icon.codePoint >= groupEndCodePoint, index); + final int nextIndex = next < 0 ? icons.length : next; + registerTestForIconGroup(icons.slice(index, nextIndex)); + index = nextIndex; + } +} + +// Generating goldens for each glyph is very slow. Group the sorted icons +// into codepoint-aligned groups (each of which has a max capacity of +// iconsPerRow * iconsPerCol), so the goldens are easier to review when +// symbols are added or removed. +void registerTestForIconGroup(List iconGroup) { + assert(iconGroup.isNotEmpty); + String hexCodePoint(int codePoint) => + codePoint.toRadixString(16).toUpperCase().padLeft(4, '0'); + final int groupStartCodePoint = + (iconGroup.first.codePoint ~/ iconsPerImage) * iconsPerImage; + final String range = + 'U+${hexCodePoint(groupStartCodePoint)}-${hexCodePoint(groupStartCodePoint + iconsPerImage - 1)}'; + + testWidgets('font golden test: $range', (WidgetTester tester) async { + addTearDown(tester.view.reset); + const Size canvasSize = + Size(iconSize * iconsPerRow, iconSize * iconsPerCol); + tester.view.physicalSize = canvasSize * tester.view.devicePixelRatio; + + const Widget fillerBox = SizedBox.square(dimension: iconSize); + final List children = List.filled(iconsPerImage, fillerBox); + for (final IconData icon in iconGroup) { + children[icon.codePoint - groupStartCodePoint] = + Icon(icon, size: iconSize); + } + + final Widget widget = Directionality( + textDirection: TextDirection.ltr, + child: Center( + child: SizedBox( + height: iconSize * iconsPerCol, + width: iconSize * iconsPerRow, + child: RepaintBoundary(child: Wrap(children: children)), + ), + ), + ); + await tester.pumpWidget(widget); + await expectLater( + find.byType(Wrap), matchesGoldenFile('goldens/glyph_$range.png')); + }); +} diff --git a/third_party/packages/cupertino_icons/test/goldens/glyph_U+F104-F11C.png b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F104-F11C.png new file mode 100644 index 000000000000..e5927df0546e Binary files /dev/null and b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F104-F11C.png differ diff --git a/third_party/packages/cupertino_icons/test/goldens/glyph_U+F217-F22F.png b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F217-F22F.png new file mode 100644 index 000000000000..f5a0f89d8d98 Binary files /dev/null and b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F217-F22F.png differ diff --git a/third_party/packages/cupertino_icons/test/goldens/glyph_U+F2AD-F2C5.png b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F2AD-F2C5.png new file mode 100644 index 000000000000..5126404ba592 Binary files /dev/null and b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F2AD-F2C5.png differ diff --git a/third_party/packages/cupertino_icons/test/goldens/glyph_U+F2C6-F2DE.png b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F2C6-F2DE.png new file mode 100644 index 000000000000..c60178699ea1 Binary files /dev/null and b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F2C6-F2DE.png differ diff --git a/third_party/packages/cupertino_icons/test/goldens/glyph_U+F2DF-F2F7.png b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F2DF-F2F7.png new file mode 100644 index 000000000000..d0cb8e8e650f Binary files /dev/null and b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F2DF-F2F7.png differ diff --git a/third_party/packages/cupertino_icons/test/goldens/glyph_U+F35C-F374.png b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F35C-F374.png new file mode 100644 index 000000000000..44f1a07f82da Binary files /dev/null and b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F35C-F374.png differ diff --git a/third_party/packages/cupertino_icons/test/goldens/glyph_U+F375-F38D.png b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F375-F38D.png new file mode 100644 index 000000000000..7ae1156164ea Binary files /dev/null and b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F375-F38D.png differ diff --git a/third_party/packages/cupertino_icons/test/goldens/glyph_U+F3A7-F3BF.png b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F3A7-F3BF.png new file mode 100644 index 000000000000..6dde064a9309 Binary files /dev/null and b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F3A7-F3BF.png differ diff --git a/third_party/packages/cupertino_icons/test/goldens/glyph_U+F3C0-F3D8.png b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F3C0-F3D8.png new file mode 100644 index 000000000000..90f09269d51d Binary files /dev/null and b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F3C0-F3D8.png differ diff --git a/third_party/packages/cupertino_icons/test/goldens/glyph_U+F3D9-F3F1.png b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F3D9-F3F1.png new file mode 100644 index 000000000000..f46b2aff49ae Binary files /dev/null and b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F3D9-F3F1.png differ diff --git a/third_party/packages/cupertino_icons/test/goldens/glyph_U+F3F2-F40A.png b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F3F2-F40A.png new file mode 100644 index 000000000000..74f9ab98a6d1 Binary files /dev/null and b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F3F2-F40A.png differ diff --git a/third_party/packages/cupertino_icons/test/goldens/glyph_U+F40B-F423.png b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F40B-F423.png new file mode 100644 index 000000000000..3c194729bb2d Binary files /dev/null and b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F40B-F423.png differ diff --git a/third_party/packages/cupertino_icons/test/goldens/glyph_U+F424-F43C.png b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F424-F43C.png new file mode 100644 index 000000000000..be248a1d932b Binary files /dev/null and b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F424-F43C.png differ diff --git a/third_party/packages/cupertino_icons/test/goldens/glyph_U+F43D-F455.png b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F43D-F455.png new file mode 100644 index 000000000000..80e8a035945f Binary files /dev/null and b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F43D-F455.png differ diff --git a/third_party/packages/cupertino_icons/test/goldens/glyph_U+F456-F46E.png b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F456-F46E.png new file mode 100644 index 000000000000..1eafb9c376dc Binary files /dev/null and b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F456-F46E.png differ diff --git a/third_party/packages/cupertino_icons/test/goldens/glyph_U+F46F-F487.png b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F46F-F487.png new file mode 100644 index 000000000000..4b5d27e3a48f Binary files /dev/null and b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F46F-F487.png differ diff --git a/third_party/packages/cupertino_icons/test/goldens/glyph_U+F488-F4A0.png b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F488-F4A0.png new file mode 100644 index 000000000000..0ed83f9115a7 Binary files /dev/null and b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F488-F4A0.png differ diff --git a/third_party/packages/cupertino_icons/test/goldens/glyph_U+F4A1-F4B9.png b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F4A1-F4B9.png new file mode 100644 index 000000000000..ae57a04060ad Binary files /dev/null and b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F4A1-F4B9.png differ diff --git a/third_party/packages/cupertino_icons/test/goldens/glyph_U+F4BA-F4D2.png b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F4BA-F4D2.png new file mode 100644 index 000000000000..be1ff5d04915 Binary files /dev/null and b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F4BA-F4D2.png differ diff --git a/third_party/packages/cupertino_icons/test/goldens/glyph_U+F4D3-F4EB.png b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F4D3-F4EB.png new file mode 100644 index 000000000000..f1ba65338e6a Binary files /dev/null and b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F4D3-F4EB.png differ diff --git a/third_party/packages/cupertino_icons/test/goldens/glyph_U+F4EC-F504.png b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F4EC-F504.png new file mode 100644 index 000000000000..b02c941040fb Binary files /dev/null and b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F4EC-F504.png differ diff --git a/third_party/packages/cupertino_icons/test/goldens/glyph_U+F505-F51D.png b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F505-F51D.png new file mode 100644 index 000000000000..f840f8ed73e7 Binary files /dev/null and b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F505-F51D.png differ diff --git a/third_party/packages/cupertino_icons/test/goldens/glyph_U+F51E-F536.png b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F51E-F536.png new file mode 100644 index 000000000000..9edb30fae98b Binary files /dev/null and b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F51E-F536.png differ diff --git a/third_party/packages/cupertino_icons/test/goldens/glyph_U+F537-F54F.png b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F537-F54F.png new file mode 100644 index 000000000000..bd98f77307ed Binary files /dev/null and b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F537-F54F.png differ diff --git a/third_party/packages/cupertino_icons/test/goldens/glyph_U+F550-F568.png b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F550-F568.png new file mode 100644 index 000000000000..9d335d1fadf6 Binary files /dev/null and b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F550-F568.png differ diff --git a/third_party/packages/cupertino_icons/test/goldens/glyph_U+F569-F581.png b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F569-F581.png new file mode 100644 index 000000000000..e46f813e6398 Binary files /dev/null and b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F569-F581.png differ diff --git a/third_party/packages/cupertino_icons/test/goldens/glyph_U+F582-F59A.png b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F582-F59A.png new file mode 100644 index 000000000000..fe797949b595 Binary files /dev/null and b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F582-F59A.png differ diff --git a/third_party/packages/cupertino_icons/test/goldens/glyph_U+F59B-F5B3.png b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F59B-F5B3.png new file mode 100644 index 000000000000..4d3e3c29e1dd Binary files /dev/null and b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F59B-F5B3.png differ diff --git a/third_party/packages/cupertino_icons/test/goldens/glyph_U+F5B4-F5CC.png b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F5B4-F5CC.png new file mode 100644 index 000000000000..f20bb4f74f2a Binary files /dev/null and b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F5B4-F5CC.png differ diff --git a/third_party/packages/cupertino_icons/test/goldens/glyph_U+F5CD-F5E5.png b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F5CD-F5E5.png new file mode 100644 index 000000000000..d57fd95c738d Binary files /dev/null and b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F5CD-F5E5.png differ diff --git a/third_party/packages/cupertino_icons/test/goldens/glyph_U+F5E6-F5FE.png b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F5E6-F5FE.png new file mode 100644 index 000000000000..e8438113aacf Binary files /dev/null and b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F5E6-F5FE.png differ diff --git a/third_party/packages/cupertino_icons/test/goldens/glyph_U+F5FF-F617.png b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F5FF-F617.png new file mode 100644 index 000000000000..0391b2dfed90 Binary files /dev/null and b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F5FF-F617.png differ diff --git a/third_party/packages/cupertino_icons/test/goldens/glyph_U+F618-F630.png b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F618-F630.png new file mode 100644 index 000000000000..730785a2e053 Binary files /dev/null and b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F618-F630.png differ diff --git a/third_party/packages/cupertino_icons/test/goldens/glyph_U+F631-F649.png b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F631-F649.png new file mode 100644 index 000000000000..4a20fe7055a9 Binary files /dev/null and b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F631-F649.png differ diff --git a/third_party/packages/cupertino_icons/test/goldens/glyph_U+F64A-F662.png b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F64A-F662.png new file mode 100644 index 000000000000..bbc565cd096d Binary files /dev/null and b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F64A-F662.png differ diff --git a/third_party/packages/cupertino_icons/test/goldens/glyph_U+F663-F67B.png b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F663-F67B.png new file mode 100644 index 000000000000..d135aea368a2 Binary files /dev/null and b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F663-F67B.png differ diff --git a/third_party/packages/cupertino_icons/test/goldens/glyph_U+F67C-F694.png b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F67C-F694.png new file mode 100644 index 000000000000..eb89c1897413 Binary files /dev/null and b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F67C-F694.png differ diff --git a/third_party/packages/cupertino_icons/test/goldens/glyph_U+F695-F6AD.png b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F695-F6AD.png new file mode 100644 index 000000000000..c051159994f4 Binary files /dev/null and b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F695-F6AD.png differ diff --git a/third_party/packages/cupertino_icons/test/goldens/glyph_U+F6AE-F6C6.png b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F6AE-F6C6.png new file mode 100644 index 000000000000..e24047ef0039 Binary files /dev/null and b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F6AE-F6C6.png differ diff --git a/third_party/packages/cupertino_icons/test/goldens/glyph_U+F6C7-F6DF.png b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F6C7-F6DF.png new file mode 100644 index 000000000000..2326f02f878e Binary files /dev/null and b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F6C7-F6DF.png differ diff --git a/third_party/packages/cupertino_icons/test/goldens/glyph_U+F6E0-F6F8.png b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F6E0-F6F8.png new file mode 100644 index 000000000000..cd561db61fca Binary files /dev/null and b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F6E0-F6F8.png differ diff --git a/third_party/packages/cupertino_icons/test/goldens/glyph_U+F6F9-F711.png b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F6F9-F711.png new file mode 100644 index 000000000000..b91e6259f726 Binary files /dev/null and b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F6F9-F711.png differ diff --git a/third_party/packages/cupertino_icons/test/goldens/glyph_U+F712-F72A.png b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F712-F72A.png new file mode 100644 index 000000000000..c05928e842ec Binary files /dev/null and b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F712-F72A.png differ diff --git a/third_party/packages/cupertino_icons/test/goldens/glyph_U+F72B-F743.png b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F72B-F743.png new file mode 100644 index 000000000000..4a5b57e90665 Binary files /dev/null and b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F72B-F743.png differ diff --git a/third_party/packages/cupertino_icons/test/goldens/glyph_U+F744-F75C.png b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F744-F75C.png new file mode 100644 index 000000000000..159c2e700363 Binary files /dev/null and b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F744-F75C.png differ diff --git a/third_party/packages/cupertino_icons/test/goldens/glyph_U+F75D-F775.png b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F75D-F775.png new file mode 100644 index 000000000000..d0159de9ea06 Binary files /dev/null and b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F75D-F775.png differ diff --git a/third_party/packages/cupertino_icons/test/goldens/glyph_U+F776-F78E.png b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F776-F78E.png new file mode 100644 index 000000000000..c4b0d0c7fa1b Binary files /dev/null and b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F776-F78E.png differ diff --git a/third_party/packages/cupertino_icons/test/goldens/glyph_U+F78F-F7A7.png b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F78F-F7A7.png new file mode 100644 index 000000000000..43d48d13aad0 Binary files /dev/null and b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F78F-F7A7.png differ diff --git a/third_party/packages/cupertino_icons/test/goldens/glyph_U+F7A8-F7C0.png b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F7A8-F7C0.png new file mode 100644 index 000000000000..0038ddc2d8fe Binary files /dev/null and b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F7A8-F7C0.png differ diff --git a/third_party/packages/cupertino_icons/test/goldens/glyph_U+F7C1-F7D9.png b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F7C1-F7D9.png new file mode 100644 index 000000000000..52ee286a66eb Binary files /dev/null and b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F7C1-F7D9.png differ diff --git a/third_party/packages/cupertino_icons/test/goldens/glyph_U+F7DA-F7F2.png b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F7DA-F7F2.png new file mode 100644 index 000000000000..e7ee9f1349c8 Binary files /dev/null and b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F7DA-F7F2.png differ diff --git a/third_party/packages/cupertino_icons/test/goldens/glyph_U+F7F3-F80B.png b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F7F3-F80B.png new file mode 100644 index 000000000000..116f98b887c3 Binary files /dev/null and b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F7F3-F80B.png differ diff --git a/third_party/packages/cupertino_icons/test/goldens/glyph_U+F80C-F824.png b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F80C-F824.png new file mode 100644 index 000000000000..d1358391d28b Binary files /dev/null and b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F80C-F824.png differ diff --git a/third_party/packages/cupertino_icons/test/goldens/glyph_U+F825-F83D.png b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F825-F83D.png new file mode 100644 index 000000000000..0aeade09a74f Binary files /dev/null and b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F825-F83D.png differ diff --git a/third_party/packages/cupertino_icons/test/goldens/glyph_U+F83E-F856.png b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F83E-F856.png new file mode 100644 index 000000000000..17b8766d4d2d Binary files /dev/null and b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F83E-F856.png differ diff --git a/third_party/packages/cupertino_icons/test/goldens/glyph_U+F857-F86F.png b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F857-F86F.png new file mode 100644 index 000000000000..acd7909e4d5b Binary files /dev/null and b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F857-F86F.png differ diff --git a/third_party/packages/cupertino_icons/test/goldens/glyph_U+F870-F888.png b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F870-F888.png new file mode 100644 index 000000000000..789ebe880926 Binary files /dev/null and b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F870-F888.png differ diff --git a/third_party/packages/cupertino_icons/test/goldens/glyph_U+F889-F8A1.png b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F889-F8A1.png new file mode 100644 index 000000000000..0324a7f6ea2b Binary files /dev/null and b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F889-F8A1.png differ diff --git a/third_party/packages/cupertino_icons/test/goldens/glyph_U+F8A2-F8BA.png b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F8A2-F8BA.png new file mode 100644 index 000000000000..34fcb8cb210d Binary files /dev/null and b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F8A2-F8BA.png differ diff --git a/third_party/packages/cupertino_icons/test/goldens/glyph_U+F8BB-F8D3.png b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F8BB-F8D3.png new file mode 100644 index 000000000000..98cfb2311b36 Binary files /dev/null and b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F8BB-F8D3.png differ diff --git a/third_party/packages/cupertino_icons/test/goldens/glyph_U+F8D4-F8EC.png b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F8D4-F8EC.png new file mode 100644 index 000000000000..5b21aa2dc823 Binary files /dev/null and b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F8D4-F8EC.png differ diff --git a/third_party/packages/cupertino_icons/test/goldens/glyph_U+F8ED-F905.png b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F8ED-F905.png new file mode 100644 index 000000000000..adaa706c08a6 Binary files /dev/null and b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F8ED-F905.png differ diff --git a/third_party/packages/cupertino_icons/test/goldens/glyph_U+F906-F91E.png b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F906-F91E.png new file mode 100644 index 000000000000..44dd153e8348 Binary files /dev/null and b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F906-F91E.png differ diff --git a/third_party/packages/cupertino_icons/test/goldens/glyph_U+F91F-F937.png b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F91F-F937.png new file mode 100644 index 000000000000..e73a44de0240 Binary files /dev/null and b/third_party/packages/cupertino_icons/test/goldens/glyph_U+F91F-F937.png differ diff --git a/third_party/packages/cupertino_icons/test/icons_list.dart b/third_party/packages/cupertino_icons/test/icons_list.dart new file mode 100644 index 000000000000..fb4753bb10de --- /dev/null +++ b/third_party/packages/cupertino_icons/test/icons_list.dart @@ -0,0 +1,1340 @@ +// 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'; + +int _compare(IconData a, IconData b) => a.codePoint.compareTo(b.codePoint); + +/// The full list of [IconData] constants defined in the [CupertinoIcons] class, +/// sorted by their code points in ascending order. +/// +/// After making changes to the font, if the change requires code change in the +/// [CupertinoIcons] class (adding new icons, for example), consider updating +/// this list. +/// +/// This list cannot be mutated by tests. +final List icons = List.unmodifiable([ + CupertinoIcons.left_chevron, + CupertinoIcons.right_chevron, + CupertinoIcons.share, + CupertinoIcons.share_solid, + CupertinoIcons.book, + CupertinoIcons.book_solid, + CupertinoIcons.bookmark, + CupertinoIcons.bookmark_solid, + CupertinoIcons.info, + CupertinoIcons.reply, + CupertinoIcons.conversation_bubble, + CupertinoIcons.profile_circled, + CupertinoIcons.plus_circled, + CupertinoIcons.minus_circled, + CupertinoIcons.flag, + CupertinoIcons.search, + CupertinoIcons.check_mark, + CupertinoIcons.check_mark_circled, + CupertinoIcons.check_mark_circled_solid, + CupertinoIcons.circle, + CupertinoIcons.circle_filled, + CupertinoIcons.back, + CupertinoIcons.forward, + CupertinoIcons.home, + CupertinoIcons.shopping_cart, + CupertinoIcons.ellipsis, + CupertinoIcons.phone, + CupertinoIcons.phone_solid, + CupertinoIcons.down_arrow, + CupertinoIcons.up_arrow, + CupertinoIcons.battery_charging, + CupertinoIcons.battery_empty, + CupertinoIcons.battery_full, + CupertinoIcons.battery_75_percent, + CupertinoIcons.battery_25_percent, + CupertinoIcons.bluetooth, + CupertinoIcons.restart, + CupertinoIcons.reply_all, + CupertinoIcons.reply_thick_solid, + CupertinoIcons.share_up, + CupertinoIcons.shuffle, + CupertinoIcons.shuffle_medium, + CupertinoIcons.shuffle_thick, + CupertinoIcons.photo_camera, + CupertinoIcons.photo_camera_solid, + CupertinoIcons.video_camera, + CupertinoIcons.video_camera_solid, + CupertinoIcons.switch_camera, + CupertinoIcons.switch_camera_solid, + CupertinoIcons.collections, + CupertinoIcons.collections_solid, + CupertinoIcons.folder, + CupertinoIcons.folder_solid, + CupertinoIcons.folder_open, + CupertinoIcons.delete, + CupertinoIcons.delete_solid, + CupertinoIcons.delete_simple, + CupertinoIcons.pen, + CupertinoIcons.pencil, + CupertinoIcons.create, + CupertinoIcons.create_solid, + CupertinoIcons.refresh, + CupertinoIcons.refresh_circled, + CupertinoIcons.refresh_circled_solid, + CupertinoIcons.refresh_thin, + CupertinoIcons.refresh_thick, + CupertinoIcons.refresh_bold, + CupertinoIcons.clear_thick, + CupertinoIcons.clear_thick_circled, + CupertinoIcons.clear, + CupertinoIcons.clear_circled, + CupertinoIcons.clear_circled_solid, + CupertinoIcons.add, + CupertinoIcons.add_circled, + CupertinoIcons.add_circled_solid, + CupertinoIcons.gear, + CupertinoIcons.gear_solid, + CupertinoIcons.gear_big, + CupertinoIcons.settings, + CupertinoIcons.settings_solid, + CupertinoIcons.music_note, + CupertinoIcons.double_music_note, + CupertinoIcons.play_arrow, + CupertinoIcons.play_arrow_solid, + CupertinoIcons.pause, + CupertinoIcons.pause_solid, + CupertinoIcons.loop, + CupertinoIcons.loop_thick, + CupertinoIcons.volume_down, + CupertinoIcons.volume_mute, + CupertinoIcons.volume_off, + CupertinoIcons.volume_up, + CupertinoIcons.fullscreen, + CupertinoIcons.fullscreen_exit, + CupertinoIcons.mic_off, + CupertinoIcons.mic, + CupertinoIcons.mic_solid, + CupertinoIcons.clock, + CupertinoIcons.clock_solid, + CupertinoIcons.time, + CupertinoIcons.time_solid, + CupertinoIcons.padlock, + CupertinoIcons.padlock_solid, + CupertinoIcons.eye, + CupertinoIcons.eye_solid, + CupertinoIcons.person, + CupertinoIcons.person_solid, + CupertinoIcons.person_add, + CupertinoIcons.person_add_solid, + CupertinoIcons.group, + CupertinoIcons.group_solid, + CupertinoIcons.mail, + CupertinoIcons.mail_solid, + CupertinoIcons.location, + CupertinoIcons.location_solid, + CupertinoIcons.tag, + CupertinoIcons.tag_solid, + CupertinoIcons.tags, + CupertinoIcons.tags_solid, + CupertinoIcons.bus, + CupertinoIcons.car, + CupertinoIcons.car_detailed, + CupertinoIcons.train_style_one, + CupertinoIcons.train_style_two, + CupertinoIcons.paw, + CupertinoIcons.paw_solid, + CupertinoIcons.game_controller, + CupertinoIcons.game_controller_solid, + CupertinoIcons.lab_flask, + CupertinoIcons.lab_flask_solid, + CupertinoIcons.heart, + CupertinoIcons.heart_solid, + CupertinoIcons.bell, + CupertinoIcons.bell_solid, + CupertinoIcons.news, + CupertinoIcons.news_solid, + CupertinoIcons.brightness, + CupertinoIcons.brightness_solid, + CupertinoIcons.airplane, + CupertinoIcons.alarm, + CupertinoIcons.alarm_fill, + CupertinoIcons.alt, + CupertinoIcons.ant, + CupertinoIcons.ant_circle, + CupertinoIcons.ant_circle_fill, + CupertinoIcons.ant_fill, + CupertinoIcons.antenna_radiowaves_left_right, + CupertinoIcons.app, + CupertinoIcons.app_badge, + CupertinoIcons.app_badge_fill, + CupertinoIcons.app_fill, + CupertinoIcons.archivebox, + CupertinoIcons.archivebox_fill, + CupertinoIcons.arrow_2_circlepath, + CupertinoIcons.arrow_2_circlepath_circle, + CupertinoIcons.arrow_2_circlepath_circle_fill, + CupertinoIcons.arrow_2_squarepath, + CupertinoIcons.arrow_3_trianglepath, + CupertinoIcons.arrow_branch, + CupertinoIcons.arrow_clockwise, + CupertinoIcons.arrow_clockwise_circle, + CupertinoIcons.arrow_clockwise_circle_fill, + CupertinoIcons.arrow_counterclockwise, + CupertinoIcons.arrow_counterclockwise_circle, + CupertinoIcons.arrow_counterclockwise_circle_fill, + CupertinoIcons.arrow_down, + CupertinoIcons.arrow_down_circle, + CupertinoIcons.arrow_down_circle_fill, + CupertinoIcons.arrow_down_doc, + CupertinoIcons.arrow_down_doc_fill, + CupertinoIcons.arrow_down_left, + CupertinoIcons.arrow_down_left_circle, + CupertinoIcons.arrow_down_left_circle_fill, + CupertinoIcons.arrow_down_left_square, + CupertinoIcons.arrow_down_left_square_fill, + CupertinoIcons.arrow_down_right, + CupertinoIcons.arrow_down_right_arrow_up_left, + CupertinoIcons.arrow_down_right_circle, + CupertinoIcons.arrow_down_right_circle_fill, + CupertinoIcons.arrow_down_right_square, + CupertinoIcons.arrow_down_right_square_fill, + CupertinoIcons.arrow_down_square, + CupertinoIcons.arrow_down_square_fill, + CupertinoIcons.arrow_down_to_line, + CupertinoIcons.arrow_down_to_line_alt, + CupertinoIcons.arrow_left, + CupertinoIcons.arrow_left_circle, + CupertinoIcons.arrow_left_circle_fill, + CupertinoIcons.arrow_left_right, + CupertinoIcons.arrow_left_right_circle, + CupertinoIcons.arrow_left_right_circle_fill, + CupertinoIcons.arrow_left_right_square, + CupertinoIcons.arrow_left_right_square_fill, + CupertinoIcons.arrow_left_square, + CupertinoIcons.arrow_left_square_fill, + CupertinoIcons.arrow_left_to_line, + CupertinoIcons.arrow_left_to_line_alt, + CupertinoIcons.arrow_merge, + CupertinoIcons.arrow_right, + CupertinoIcons.arrow_right_arrow_left, + CupertinoIcons.arrow_right_arrow_left_circle, + CupertinoIcons.arrow_right_arrow_left_circle_fill, + CupertinoIcons.arrow_right_arrow_left_square, + CupertinoIcons.arrow_right_arrow_left_square_fill, + CupertinoIcons.arrow_right_circle, + CupertinoIcons.arrow_right_circle_fill, + CupertinoIcons.arrow_right_square, + CupertinoIcons.arrow_right_square_fill, + CupertinoIcons.arrow_right_to_line, + CupertinoIcons.arrow_right_to_line_alt, + CupertinoIcons.arrow_swap, + CupertinoIcons.arrow_turn_down_left, + CupertinoIcons.arrow_turn_down_right, + CupertinoIcons.arrow_turn_left_down, + CupertinoIcons.arrow_turn_left_up, + CupertinoIcons.arrow_turn_right_down, + CupertinoIcons.arrow_turn_right_up, + CupertinoIcons.arrow_turn_up_left, + CupertinoIcons.arrow_turn_up_right, + CupertinoIcons.arrow_up, + CupertinoIcons.arrow_up_arrow_down, + CupertinoIcons.arrow_up_arrow_down_circle, + CupertinoIcons.arrow_up_arrow_down_circle_fill, + CupertinoIcons.arrow_up_arrow_down_square, + CupertinoIcons.arrow_up_arrow_down_square_fill, + CupertinoIcons.arrow_up_bin, + CupertinoIcons.arrow_up_bin_fill, + CupertinoIcons.arrow_up_circle, + CupertinoIcons.arrow_up_circle_fill, + CupertinoIcons.arrow_up_doc, + CupertinoIcons.arrow_up_doc_fill, + CupertinoIcons.arrow_up_down, + CupertinoIcons.arrow_up_down_circle, + CupertinoIcons.arrow_up_down_circle_fill, + CupertinoIcons.arrow_up_down_square, + CupertinoIcons.arrow_up_down_square_fill, + CupertinoIcons.arrow_up_left, + CupertinoIcons.arrow_up_left_arrow_down_right, + CupertinoIcons.arrow_up_left_circle, + CupertinoIcons.arrow_up_left_circle_fill, + CupertinoIcons.arrow_up_left_square, + CupertinoIcons.arrow_up_left_square_fill, + CupertinoIcons.arrow_up_right, + CupertinoIcons.arrow_up_right_circle, + CupertinoIcons.arrow_up_right_circle_fill, + CupertinoIcons.arrow_up_right_diamond, + CupertinoIcons.arrow_up_right_diamond_fill, + CupertinoIcons.arrow_up_right_square, + CupertinoIcons.arrow_up_right_square_fill, + CupertinoIcons.arrow_up_square, + CupertinoIcons.arrow_up_square_fill, + CupertinoIcons.arrow_up_to_line, + CupertinoIcons.arrow_up_to_line_alt, + CupertinoIcons.arrow_uturn_down, + CupertinoIcons.arrow_uturn_down_circle, + CupertinoIcons.arrow_uturn_down_circle_fill, + CupertinoIcons.arrow_uturn_down_square, + CupertinoIcons.arrow_uturn_down_square_fill, + CupertinoIcons.arrow_uturn_left, + CupertinoIcons.arrow_uturn_left_circle, + CupertinoIcons.arrow_uturn_left_circle_fill, + CupertinoIcons.arrow_uturn_left_square, + CupertinoIcons.arrow_uturn_left_square_fill, + CupertinoIcons.arrow_uturn_right, + CupertinoIcons.arrow_uturn_right_circle, + CupertinoIcons.arrow_uturn_right_circle_fill, + CupertinoIcons.arrow_uturn_right_square, + CupertinoIcons.arrow_uturn_right_square_fill, + CupertinoIcons.arrow_uturn_up, + CupertinoIcons.arrow_uturn_up_circle, + CupertinoIcons.arrow_uturn_up_circle_fill, + CupertinoIcons.arrow_uturn_up_square, + CupertinoIcons.arrow_uturn_up_square_fill, + CupertinoIcons.arrowshape_turn_up_left, + CupertinoIcons.arrowshape_turn_up_left_2, + CupertinoIcons.arrowshape_turn_up_left_2_fill, + CupertinoIcons.arrowshape_turn_up_left_circle, + CupertinoIcons.arrowshape_turn_up_left_circle_fill, + CupertinoIcons.arrowshape_turn_up_left_fill, + CupertinoIcons.arrowshape_turn_up_right, + CupertinoIcons.arrowshape_turn_up_right_circle, + CupertinoIcons.arrowshape_turn_up_right_circle_fill, + CupertinoIcons.arrowshape_turn_up_right_fill, + CupertinoIcons.arrowtriangle_down, + CupertinoIcons.arrowtriangle_down_circle, + CupertinoIcons.arrowtriangle_down_circle_fill, + CupertinoIcons.arrowtriangle_down_fill, + CupertinoIcons.arrowtriangle_down_square, + CupertinoIcons.arrowtriangle_down_square_fill, + CupertinoIcons.arrowtriangle_left, + CupertinoIcons.arrowtriangle_left_circle, + CupertinoIcons.arrowtriangle_left_circle_fill, + CupertinoIcons.arrowtriangle_left_fill, + CupertinoIcons.arrowtriangle_left_square, + CupertinoIcons.arrowtriangle_left_square_fill, + CupertinoIcons.arrowtriangle_right, + CupertinoIcons.arrowtriangle_right_circle, + CupertinoIcons.arrowtriangle_right_circle_fill, + CupertinoIcons.arrowtriangle_right_fill, + CupertinoIcons.arrowtriangle_right_square, + CupertinoIcons.arrowtriangle_right_square_fill, + CupertinoIcons.arrowtriangle_up, + CupertinoIcons.arrowtriangle_up_circle, + CupertinoIcons.arrowtriangle_up_circle_fill, + CupertinoIcons.arrowtriangle_up_fill, + CupertinoIcons.arrowtriangle_up_square, + CupertinoIcons.arrowtriangle_up_square_fill, + CupertinoIcons.asterisk_circle, + CupertinoIcons.asterisk_circle_fill, + CupertinoIcons.at, + CupertinoIcons.at_badge_minus, + CupertinoIcons.at_badge_plus, + CupertinoIcons.at_circle, + CupertinoIcons.at_circle_fill, + CupertinoIcons.backward, + CupertinoIcons.backward_end, + CupertinoIcons.backward_end_alt, + CupertinoIcons.backward_end_alt_fill, + CupertinoIcons.backward_end_fill, + CupertinoIcons.backward_fill, + CupertinoIcons.badge_plus_radiowaves_right, + CupertinoIcons.bag, + CupertinoIcons.bag_badge_minus, + CupertinoIcons.bag_badge_plus, + CupertinoIcons.bag_fill, + CupertinoIcons.bag_fill_badge_minus, + CupertinoIcons.bag_fill_badge_plus, + CupertinoIcons.bandage, + CupertinoIcons.bandage_fill, + CupertinoIcons.barcode, + CupertinoIcons.barcode_viewfinder, + CupertinoIcons.bars, + CupertinoIcons.battery_0, + CupertinoIcons.battery_100, + CupertinoIcons.battery_25, + CupertinoIcons.bed_double, + CupertinoIcons.bed_double_fill, + CupertinoIcons.bell_circle, + CupertinoIcons.bell_circle_fill, + CupertinoIcons.bell_fill, + CupertinoIcons.bell_slash, + CupertinoIcons.bell_slash_fill, + CupertinoIcons.bin_xmark, + CupertinoIcons.bin_xmark_fill, + CupertinoIcons.bitcoin, + CupertinoIcons.bitcoin_circle, + CupertinoIcons.bitcoin_circle_fill, + CupertinoIcons.bold, + CupertinoIcons.bold_italic_underline, + CupertinoIcons.bold_underline, + CupertinoIcons.bolt, + CupertinoIcons.bolt_badge_a, + CupertinoIcons.bolt_badge_a_fill, + CupertinoIcons.bolt_circle, + CupertinoIcons.bolt_circle_fill, + CupertinoIcons.bolt_fill, + CupertinoIcons.bolt_horizontal, + CupertinoIcons.bolt_horizontal_circle, + CupertinoIcons.bolt_horizontal_circle_fill, + CupertinoIcons.bolt_horizontal_fill, + CupertinoIcons.bolt_slash, + CupertinoIcons.bolt_slash_fill, + CupertinoIcons.book_circle, + CupertinoIcons.book_circle_fill, + CupertinoIcons.book_fill, + CupertinoIcons.bookmark_fill, + CupertinoIcons.briefcase, + CupertinoIcons.briefcase_fill, + CupertinoIcons.bubble_left, + CupertinoIcons.bubble_left_bubble_right, + CupertinoIcons.bubble_left_bubble_right_fill, + CupertinoIcons.bubble_left_fill, + CupertinoIcons.bubble_middle_bottom, + CupertinoIcons.bubble_middle_bottom_fill, + CupertinoIcons.bubble_middle_top, + CupertinoIcons.bubble_middle_top_fill, + CupertinoIcons.bubble_right, + CupertinoIcons.bubble_right_fill, + CupertinoIcons.building_2_fill, + CupertinoIcons.burn, + CupertinoIcons.burst, + CupertinoIcons.burst_fill, + CupertinoIcons.calendar, + CupertinoIcons.calendar_badge_minus, + CupertinoIcons.calendar_badge_plus, + CupertinoIcons.calendar_circle, + CupertinoIcons.calendar_circle_fill, + CupertinoIcons.calendar_today, + CupertinoIcons.camera, + CupertinoIcons.camera_circle, + CupertinoIcons.camera_circle_fill, + CupertinoIcons.camera_fill, + CupertinoIcons.camera_on_rectangle, + CupertinoIcons.camera_on_rectangle_fill, + CupertinoIcons.camera_rotate, + CupertinoIcons.camera_rotate_fill, + CupertinoIcons.camera_viewfinder, + CupertinoIcons.capslock, + CupertinoIcons.capslock_fill, + CupertinoIcons.capsule, + CupertinoIcons.capsule_fill, + CupertinoIcons.captions_bubble, + CupertinoIcons.captions_bubble_fill, + CupertinoIcons.car_fill, + CupertinoIcons.cart, + CupertinoIcons.cart_badge_minus, + CupertinoIcons.cart_badge_plus, + CupertinoIcons.cart_fill, + CupertinoIcons.cart_fill_badge_minus, + CupertinoIcons.cart_fill_badge_plus, + CupertinoIcons.chart_bar, + CupertinoIcons.chart_bar_alt_fill, + CupertinoIcons.chart_bar_circle, + CupertinoIcons.chart_bar_circle_fill, + CupertinoIcons.chart_bar_fill, + CupertinoIcons.chart_bar_square, + CupertinoIcons.chart_bar_square_fill, + CupertinoIcons.chart_pie, + CupertinoIcons.chart_pie_fill, + CupertinoIcons.chat_bubble, + CupertinoIcons.chat_bubble_2, + CupertinoIcons.chat_bubble_2_fill, + CupertinoIcons.chat_bubble_fill, + CupertinoIcons.chat_bubble_text, + CupertinoIcons.chat_bubble_text_fill, + CupertinoIcons.checkmark, + CupertinoIcons.checkmark_alt, + CupertinoIcons.checkmark_alt_circle, + CupertinoIcons.checkmark_alt_circle_fill, + CupertinoIcons.checkmark_circle, + CupertinoIcons.checkmark_circle_fill, + CupertinoIcons.checkmark_rectangle, + CupertinoIcons.checkmark_rectangle_fill, + CupertinoIcons.checkmark_seal, + CupertinoIcons.checkmark_seal_fill, + CupertinoIcons.checkmark_shield, + CupertinoIcons.checkmark_shield_fill, + CupertinoIcons.checkmark_square, + CupertinoIcons.checkmark_square_fill, + CupertinoIcons.chevron_back, + CupertinoIcons.chevron_compact_down, + CupertinoIcons.chevron_compact_left, + CupertinoIcons.chevron_compact_right, + CupertinoIcons.chevron_compact_up, + CupertinoIcons.chevron_down, + CupertinoIcons.chevron_down_circle, + CupertinoIcons.chevron_down_circle_fill, + CupertinoIcons.chevron_down_square, + CupertinoIcons.chevron_down_square_fill, + CupertinoIcons.chevron_forward, + CupertinoIcons.chevron_left, + CupertinoIcons.chevron_left_2, + CupertinoIcons.chevron_left_circle, + CupertinoIcons.chevron_left_circle_fill, + CupertinoIcons.chevron_left_slash_chevron_right, + CupertinoIcons.chevron_left_square, + CupertinoIcons.chevron_left_square_fill, + CupertinoIcons.chevron_right, + CupertinoIcons.chevron_right_2, + CupertinoIcons.chevron_right_circle, + CupertinoIcons.chevron_right_circle_fill, + CupertinoIcons.chevron_right_square, + CupertinoIcons.chevron_right_square_fill, + CupertinoIcons.chevron_up, + CupertinoIcons.chevron_up_chevron_down, + CupertinoIcons.chevron_up_circle, + CupertinoIcons.chevron_up_circle_fill, + CupertinoIcons.chevron_up_square, + CupertinoIcons.chevron_up_square_fill, + CupertinoIcons.circle_bottomthird_split, + CupertinoIcons.circle_fill, + CupertinoIcons.circle_grid_3x3, + CupertinoIcons.circle_grid_3x3_fill, + CupertinoIcons.circle_grid_hex, + CupertinoIcons.circle_grid_hex_fill, + CupertinoIcons.circle_lefthalf_fill, + CupertinoIcons.circle_righthalf_fill, + CupertinoIcons.clear_fill, + CupertinoIcons.clock_fill, + CupertinoIcons.cloud, + CupertinoIcons.cloud_bolt, + CupertinoIcons.cloud_bolt_fill, + CupertinoIcons.cloud_bolt_rain, + CupertinoIcons.cloud_bolt_rain_fill, + CupertinoIcons.cloud_download, + CupertinoIcons.cloud_download_fill, + CupertinoIcons.cloud_drizzle, + CupertinoIcons.cloud_drizzle_fill, + CupertinoIcons.cloud_fill, + CupertinoIcons.cloud_fog, + CupertinoIcons.cloud_fog_fill, + CupertinoIcons.cloud_hail, + CupertinoIcons.cloud_hail_fill, + CupertinoIcons.cloud_heavyrain, + CupertinoIcons.cloud_heavyrain_fill, + CupertinoIcons.cloud_moon, + CupertinoIcons.cloud_moon_bolt, + CupertinoIcons.cloud_moon_bolt_fill, + CupertinoIcons.cloud_moon_fill, + CupertinoIcons.cloud_moon_rain, + CupertinoIcons.cloud_moon_rain_fill, + CupertinoIcons.cloud_rain, + CupertinoIcons.cloud_rain_fill, + CupertinoIcons.cloud_sleet, + CupertinoIcons.cloud_sleet_fill, + CupertinoIcons.cloud_snow, + CupertinoIcons.cloud_snow_fill, + CupertinoIcons.cloud_sun, + CupertinoIcons.cloud_sun_bolt, + CupertinoIcons.cloud_sun_bolt_fill, + CupertinoIcons.cloud_sun_fill, + CupertinoIcons.cloud_sun_rain, + CupertinoIcons.cloud_sun_rain_fill, + CupertinoIcons.cloud_upload, + CupertinoIcons.cloud_upload_fill, + CupertinoIcons.color_filter, + CupertinoIcons.color_filter_fill, + CupertinoIcons.command, + CupertinoIcons.compass, + CupertinoIcons.compass_fill, + CupertinoIcons.control, + CupertinoIcons.creditcard, + CupertinoIcons.creditcard_fill, + CupertinoIcons.crop, + CupertinoIcons.crop_rotate, + CupertinoIcons.cube, + CupertinoIcons.cube_box, + CupertinoIcons.cube_box_fill, + CupertinoIcons.cube_fill, + CupertinoIcons.cursor_rays, + CupertinoIcons.decrease_indent, + CupertinoIcons.decrease_quotelevel, + CupertinoIcons.delete_left, + CupertinoIcons.delete_left_fill, + CupertinoIcons.delete_right, + CupertinoIcons.delete_right_fill, + CupertinoIcons.desktopcomputer, + CupertinoIcons.device_desktop, + CupertinoIcons.device_laptop, + CupertinoIcons.device_phone_landscape, + CupertinoIcons.device_phone_portrait, + CupertinoIcons.dial, + CupertinoIcons.dial_fill, + CupertinoIcons.divide, + CupertinoIcons.divide_circle, + CupertinoIcons.divide_circle_fill, + CupertinoIcons.divide_square, + CupertinoIcons.divide_square_fill, + CupertinoIcons.doc, + CupertinoIcons.doc_append, + CupertinoIcons.doc_chart, + CupertinoIcons.doc_chart_fill, + CupertinoIcons.doc_checkmark, + CupertinoIcons.doc_checkmark_fill, + CupertinoIcons.doc_circle, + CupertinoIcons.doc_circle_fill, + CupertinoIcons.doc_fill, + CupertinoIcons.doc_on_clipboard, + CupertinoIcons.doc_on_clipboard_fill, + CupertinoIcons.doc_on_doc, + CupertinoIcons.doc_on_doc_fill, + CupertinoIcons.doc_person, + CupertinoIcons.doc_person_fill, + CupertinoIcons.doc_plaintext, + CupertinoIcons.doc_richtext, + CupertinoIcons.doc_text, + CupertinoIcons.doc_text_fill, + CupertinoIcons.doc_text_search, + CupertinoIcons.doc_text_viewfinder, + CupertinoIcons.dot_radiowaves_left_right, + CupertinoIcons.dot_radiowaves_right, + CupertinoIcons.dot_square, + CupertinoIcons.dot_square_fill, + CupertinoIcons.download_circle, + CupertinoIcons.download_circle_fill, + CupertinoIcons.drop, + CupertinoIcons.drop_fill, + CupertinoIcons.drop_triangle, + CupertinoIcons.drop_triangle_fill, + CupertinoIcons.ear, + CupertinoIcons.eject, + CupertinoIcons.eject_fill, + CupertinoIcons.ellipses_bubble, + CupertinoIcons.ellipses_bubble_fill, + CupertinoIcons.ellipsis_circle, + CupertinoIcons.ellipsis_circle_fill, + CupertinoIcons.ellipsis_vertical, + CupertinoIcons.ellipsis_vertical_circle, + CupertinoIcons.ellipsis_vertical_circle_fill, + CupertinoIcons.envelope, + CupertinoIcons.envelope_badge, + CupertinoIcons.envelope_badge_fill, + CupertinoIcons.envelope_circle, + CupertinoIcons.envelope_circle_fill, + CupertinoIcons.envelope_fill, + CupertinoIcons.envelope_open, + CupertinoIcons.envelope_open_fill, + CupertinoIcons.equal, + CupertinoIcons.equal_circle, + CupertinoIcons.equal_circle_fill, + CupertinoIcons.equal_square, + CupertinoIcons.equal_square_fill, + CupertinoIcons.escape, + CupertinoIcons.exclamationmark, + CupertinoIcons.exclamationmark_bubble, + CupertinoIcons.exclamationmark_bubble_fill, + CupertinoIcons.exclamationmark_circle, + CupertinoIcons.exclamationmark_circle_fill, + CupertinoIcons.exclamationmark_octagon, + CupertinoIcons.exclamationmark_octagon_fill, + CupertinoIcons.exclamationmark_shield, + CupertinoIcons.exclamationmark_shield_fill, + CupertinoIcons.exclamationmark_square, + CupertinoIcons.exclamationmark_square_fill, + CupertinoIcons.exclamationmark_triangle, + CupertinoIcons.exclamationmark_triangle_fill, + CupertinoIcons.eye_fill, + CupertinoIcons.eye_slash, + CupertinoIcons.eye_slash_fill, + CupertinoIcons.eyedropper, + CupertinoIcons.eyedropper_full, + CupertinoIcons.eyedropper_halffull, + CupertinoIcons.eyeglasses, + CupertinoIcons.f_cursive, + CupertinoIcons.f_cursive_circle, + CupertinoIcons.f_cursive_circle_fill, + CupertinoIcons.film, + CupertinoIcons.film_fill, + CupertinoIcons.flag_circle, + CupertinoIcons.flag_circle_fill, + CupertinoIcons.flag_fill, + CupertinoIcons.flag_slash, + CupertinoIcons.flag_slash_fill, + CupertinoIcons.flame, + CupertinoIcons.flame_fill, + CupertinoIcons.floppy_disk, + CupertinoIcons.flowchart, + CupertinoIcons.flowchart_fill, + CupertinoIcons.folder_badge_minus, + CupertinoIcons.folder_badge_person_crop, + CupertinoIcons.folder_badge_plus, + CupertinoIcons.folder_circle, + CupertinoIcons.folder_circle_fill, + CupertinoIcons.folder_fill, + CupertinoIcons.folder_fill_badge_minus, + CupertinoIcons.folder_fill_badge_person_crop, + CupertinoIcons.folder_fill_badge_plus, + CupertinoIcons.forward_end, + CupertinoIcons.forward_end_alt, + CupertinoIcons.forward_end_alt_fill, + CupertinoIcons.forward_end_fill, + CupertinoIcons.forward_fill, + CupertinoIcons.function, + CupertinoIcons.fx, + CupertinoIcons.gamecontroller, + CupertinoIcons.gamecontroller_alt_fill, + CupertinoIcons.gamecontroller_fill, + CupertinoIcons.gauge, + CupertinoIcons.gauge_badge_minus, + CupertinoIcons.gauge_badge_plus, + CupertinoIcons.gear_alt, + CupertinoIcons.gear_alt_fill, + CupertinoIcons.gift, + CupertinoIcons.gift_alt, + CupertinoIcons.gift_alt_fill, + CupertinoIcons.gift_fill, + CupertinoIcons.globe, + CupertinoIcons.gobackward, + CupertinoIcons.gobackward_10, + CupertinoIcons.gobackward_15, + CupertinoIcons.gobackward_30, + CupertinoIcons.gobackward_45, + CupertinoIcons.gobackward_60, + CupertinoIcons.gobackward_75, + CupertinoIcons.gobackward_90, + CupertinoIcons.gobackward_minus, + CupertinoIcons.goforward, + CupertinoIcons.goforward_10, + CupertinoIcons.goforward_15, + CupertinoIcons.goforward_30, + CupertinoIcons.goforward_45, + CupertinoIcons.goforward_60, + CupertinoIcons.goforward_75, + CupertinoIcons.goforward_90, + CupertinoIcons.goforward_plus, + CupertinoIcons.graph_circle, + CupertinoIcons.graph_circle_fill, + CupertinoIcons.graph_square, + CupertinoIcons.graph_square_fill, + CupertinoIcons.greaterthan, + CupertinoIcons.greaterthan_circle, + CupertinoIcons.greaterthan_circle_fill, + CupertinoIcons.greaterthan_square, + CupertinoIcons.greaterthan_square_fill, + CupertinoIcons.grid, + CupertinoIcons.grid_circle, + CupertinoIcons.grid_circle_fill, + CupertinoIcons.guitars, + CupertinoIcons.hammer, + CupertinoIcons.hammer_fill, + CupertinoIcons.hand_draw, + CupertinoIcons.hand_draw_fill, + CupertinoIcons.hand_point_left, + CupertinoIcons.hand_point_left_fill, + CupertinoIcons.hand_point_right, + CupertinoIcons.hand_point_right_fill, + CupertinoIcons.hand_raised, + CupertinoIcons.hand_raised_fill, + CupertinoIcons.hand_raised_slash, + CupertinoIcons.hand_raised_slash_fill, + CupertinoIcons.hand_thumbsdown, + CupertinoIcons.hand_thumbsdown_fill, + CupertinoIcons.hand_thumbsup, + CupertinoIcons.hand_thumbsup_fill, + CupertinoIcons.hare, + CupertinoIcons.hare_fill, + CupertinoIcons.headphones, + CupertinoIcons.heart_circle, + CupertinoIcons.heart_circle_fill, + CupertinoIcons.heart_fill, + CupertinoIcons.heart_slash, + CupertinoIcons.heart_slash_circle, + CupertinoIcons.heart_slash_circle_fill, + CupertinoIcons.heart_slash_fill, + CupertinoIcons.helm, + CupertinoIcons.hexagon, + CupertinoIcons.hexagon_fill, + CupertinoIcons.hifispeaker, + CupertinoIcons.hifispeaker_fill, + CupertinoIcons.hourglass, + CupertinoIcons.hourglass_bottomhalf_fill, + CupertinoIcons.hourglass_tophalf_fill, + CupertinoIcons.house, + CupertinoIcons.house_alt, + CupertinoIcons.house_alt_fill, + CupertinoIcons.house_fill, + CupertinoIcons.hurricane, + CupertinoIcons.increase_indent, + CupertinoIcons.increase_quotelevel, + CupertinoIcons.infinite, + CupertinoIcons.info_circle, + CupertinoIcons.info_circle_fill, + CupertinoIcons.italic, + CupertinoIcons.keyboard, + CupertinoIcons.keyboard_chevron_compact_down, + CupertinoIcons.largecircle_fill_circle, + CupertinoIcons.lasso, + CupertinoIcons.layers, + CupertinoIcons.layers_alt, + CupertinoIcons.layers_alt_fill, + CupertinoIcons.layers_fill, + CupertinoIcons.leaf_arrow_circlepath, + CupertinoIcons.lessthan, + CupertinoIcons.lessthan_circle, + CupertinoIcons.lessthan_circle_fill, + CupertinoIcons.lessthan_square, + CupertinoIcons.lessthan_square_fill, + CupertinoIcons.light_max, + CupertinoIcons.light_min, + CupertinoIcons.lightbulb, + CupertinoIcons.lightbulb_fill, + CupertinoIcons.lightbulb_slash, + CupertinoIcons.lightbulb_slash_fill, + CupertinoIcons.line_horizontal_3, + CupertinoIcons.line_horizontal_3_decrease, + CupertinoIcons.line_horizontal_3_decrease_circle, + CupertinoIcons.line_horizontal_3_decrease_circle_fill, + CupertinoIcons.link, + CupertinoIcons.link_circle, + CupertinoIcons.link_circle_fill, + CupertinoIcons.list_bullet, + CupertinoIcons.list_bullet_below_rectangle, + CupertinoIcons.list_bullet_indent, + CupertinoIcons.list_dash, + CupertinoIcons.list_number, + CupertinoIcons.list_number_rtl, + CupertinoIcons.location_circle, + CupertinoIcons.location_circle_fill, + CupertinoIcons.location_fill, + CupertinoIcons.location_north, + CupertinoIcons.location_north_fill, + CupertinoIcons.location_north_line, + CupertinoIcons.location_north_line_fill, + CupertinoIcons.location_slash, + CupertinoIcons.location_slash_fill, + CupertinoIcons.lock, + CupertinoIcons.lock_circle, + CupertinoIcons.lock_circle_fill, + CupertinoIcons.lock_fill, + CupertinoIcons.lock_open, + CupertinoIcons.lock_open_fill, + CupertinoIcons.lock_rotation, + CupertinoIcons.lock_rotation_open, + CupertinoIcons.lock_shield, + CupertinoIcons.lock_shield_fill, + CupertinoIcons.lock_slash, + CupertinoIcons.lock_slash_fill, + CupertinoIcons.macwindow, + CupertinoIcons.map, + CupertinoIcons.map_fill, + CupertinoIcons.map_pin, + CupertinoIcons.map_pin_ellipse, + CupertinoIcons.map_pin_slash, + CupertinoIcons.memories, + CupertinoIcons.memories_badge_minus, + CupertinoIcons.memories_badge_plus, + CupertinoIcons.metronome, + CupertinoIcons.mic_circle, + CupertinoIcons.mic_circle_fill, + CupertinoIcons.mic_fill, + CupertinoIcons.mic_slash, + CupertinoIcons.mic_slash_fill, + CupertinoIcons.minus, + CupertinoIcons.minus_circle, + CupertinoIcons.minus_circle_fill, + CupertinoIcons.minus_rectangle, + CupertinoIcons.minus_rectangle_fill, + CupertinoIcons.minus_slash_plus, + CupertinoIcons.minus_square, + CupertinoIcons.minus_square_fill, + CupertinoIcons.money_dollar, + CupertinoIcons.money_dollar_circle, + CupertinoIcons.money_dollar_circle_fill, + CupertinoIcons.money_euro, + CupertinoIcons.money_euro_circle, + CupertinoIcons.money_euro_circle_fill, + CupertinoIcons.money_pound, + CupertinoIcons.money_pound_circle, + CupertinoIcons.money_pound_circle_fill, + CupertinoIcons.money_rubl, + CupertinoIcons.money_rubl_circle, + CupertinoIcons.money_rubl_circle_fill, + CupertinoIcons.money_yen, + CupertinoIcons.money_yen_circle, + CupertinoIcons.money_yen_circle_fill, + CupertinoIcons.moon, + CupertinoIcons.moon_circle, + CupertinoIcons.moon_circle_fill, + CupertinoIcons.moon_fill, + CupertinoIcons.moon_stars, + CupertinoIcons.moon_stars_fill, + CupertinoIcons.moon_zzz, + CupertinoIcons.moon_zzz_fill, + CupertinoIcons.move, + CupertinoIcons.multiply, + CupertinoIcons.multiply_circle, + CupertinoIcons.multiply_circle_fill, + CupertinoIcons.multiply_square, + CupertinoIcons.multiply_square_fill, + CupertinoIcons.music_albums, + CupertinoIcons.music_albums_fill, + CupertinoIcons.music_house, + CupertinoIcons.music_house_fill, + CupertinoIcons.music_mic, + CupertinoIcons.music_note_2, + CupertinoIcons.music_note_list, + CupertinoIcons.nosign, + CupertinoIcons.number, + CupertinoIcons.number_circle, + CupertinoIcons.number_circle_fill, + CupertinoIcons.number_square, + CupertinoIcons.number_square_fill, + CupertinoIcons.option, + CupertinoIcons.paintbrush, + CupertinoIcons.paintbrush_fill, + CupertinoIcons.pano, + CupertinoIcons.pano_fill, + CupertinoIcons.paperclip, + CupertinoIcons.paperplane, + CupertinoIcons.paperplane_fill, + CupertinoIcons.paragraph, + CupertinoIcons.pause_circle, + CupertinoIcons.pause_circle_fill, + CupertinoIcons.pause_fill, + CupertinoIcons.pause_rectangle, + CupertinoIcons.pause_rectangle_fill, + CupertinoIcons.pencil_circle, + CupertinoIcons.pencil_circle_fill, + CupertinoIcons.pencil_ellipsis_rectangle, + CupertinoIcons.pencil_outline, + CupertinoIcons.pencil_slash, + CupertinoIcons.percent, + CupertinoIcons.person_2, + CupertinoIcons.person_2_alt, + CupertinoIcons.person_2_fill, + CupertinoIcons.person_2_square_stack, + CupertinoIcons.person_2_square_stack_fill, + CupertinoIcons.person_3, + CupertinoIcons.person_3_fill, + CupertinoIcons.person_alt, + CupertinoIcons.person_alt_circle, + CupertinoIcons.person_alt_circle_fill, + CupertinoIcons.person_badge_minus, + CupertinoIcons.person_badge_minus_fill, + CupertinoIcons.person_badge_plus, + CupertinoIcons.person_badge_plus_fill, + CupertinoIcons.person_circle, + CupertinoIcons.person_circle_fill, + CupertinoIcons.person_crop_circle, + CupertinoIcons.person_crop_circle_badge_checkmark, + CupertinoIcons.person_crop_circle_badge_exclam, + CupertinoIcons.person_crop_circle_badge_minus, + CupertinoIcons.person_crop_circle_badge_plus, + CupertinoIcons.person_crop_circle_badge_xmark, + CupertinoIcons.person_crop_circle_fill, + CupertinoIcons.person_crop_circle_fill_badge_checkmark, + CupertinoIcons.person_crop_circle_fill_badge_exclam, + CupertinoIcons.person_crop_circle_fill_badge_minus, + CupertinoIcons.person_crop_circle_fill_badge_plus, + CupertinoIcons.person_crop_circle_fill_badge_xmark, + CupertinoIcons.person_crop_rectangle, + CupertinoIcons.person_crop_rectangle_fill, + CupertinoIcons.person_crop_square, + CupertinoIcons.person_crop_square_fill, + CupertinoIcons.person_fill, + CupertinoIcons.personalhotspot, + CupertinoIcons.perspective, + CupertinoIcons.phone_arrow_down_left, + CupertinoIcons.phone_arrow_right, + CupertinoIcons.phone_arrow_up_right, + CupertinoIcons.phone_badge_plus, + CupertinoIcons.phone_circle, + CupertinoIcons.phone_circle_fill, + CupertinoIcons.phone_down, + CupertinoIcons.phone_down_circle, + CupertinoIcons.phone_down_circle_fill, + CupertinoIcons.phone_down_fill, + CupertinoIcons.phone_fill, + CupertinoIcons.phone_fill_arrow_down_left, + CupertinoIcons.phone_fill_arrow_right, + CupertinoIcons.phone_fill_arrow_up_right, + CupertinoIcons.phone_fill_badge_plus, + CupertinoIcons.photo, + CupertinoIcons.photo_fill, + CupertinoIcons.photo_fill_on_rectangle_fill, + CupertinoIcons.photo_on_rectangle, + CupertinoIcons.piano, + CupertinoIcons.pin, + CupertinoIcons.pin_fill, + CupertinoIcons.pin_slash, + CupertinoIcons.pin_slash_fill, + CupertinoIcons.placemark, + CupertinoIcons.placemark_fill, + CupertinoIcons.play, + CupertinoIcons.play_circle, + CupertinoIcons.play_circle_fill, + CupertinoIcons.play_fill, + CupertinoIcons.play_rectangle, + CupertinoIcons.play_rectangle_fill, + CupertinoIcons.playpause, + CupertinoIcons.playpause_fill, + CupertinoIcons.plus, + CupertinoIcons.plus_app, + CupertinoIcons.plus_app_fill, + CupertinoIcons.plus_bubble, + CupertinoIcons.plus_bubble_fill, + CupertinoIcons.plus_circle, + CupertinoIcons.plus_circle_fill, + CupertinoIcons.plus_rectangle, + CupertinoIcons.plus_rectangle_fill, + CupertinoIcons.plus_rectangle_fill_on_rectangle_fill, + CupertinoIcons.plus_rectangle_on_rectangle, + CupertinoIcons.plus_slash_minus, + CupertinoIcons.plus_square, + CupertinoIcons.plus_square_fill, + CupertinoIcons.plus_square_fill_on_square_fill, + CupertinoIcons.plus_square_on_square, + CupertinoIcons.plusminus, + CupertinoIcons.plusminus_circle, + CupertinoIcons.plusminus_circle_fill, + CupertinoIcons.power, + CupertinoIcons.printer, + CupertinoIcons.printer_fill, + CupertinoIcons.projective, + CupertinoIcons.purchased, + CupertinoIcons.purchased_circle, + CupertinoIcons.purchased_circle_fill, + CupertinoIcons.qrcode, + CupertinoIcons.qrcode_viewfinder, + CupertinoIcons.question, + CupertinoIcons.question_circle, + CupertinoIcons.question_circle_fill, + CupertinoIcons.question_diamond, + CupertinoIcons.question_diamond_fill, + CupertinoIcons.question_square, + CupertinoIcons.question_square_fill, + CupertinoIcons.quote_bubble, + CupertinoIcons.quote_bubble_fill, + CupertinoIcons.radiowaves_left, + CupertinoIcons.radiowaves_right, + CupertinoIcons.rays, + CupertinoIcons.recordingtape, + CupertinoIcons.rectangle, + CupertinoIcons.rectangle_3_offgrid, + CupertinoIcons.rectangle_3_offgrid_fill, + CupertinoIcons.rectangle_arrow_up_right_arrow_down_left, + CupertinoIcons.rectangle_arrow_up_right_arrow_down_left_slash, + CupertinoIcons.rectangle_badge_checkmark, + CupertinoIcons.rectangle_badge_xmark, + CupertinoIcons.rectangle_compress_vertical, + CupertinoIcons.rectangle_dock, + CupertinoIcons.rectangle_expand_vertical, + CupertinoIcons.rectangle_fill, + CupertinoIcons.rectangle_fill_badge_checkmark, + CupertinoIcons.rectangle_fill_badge_xmark, + CupertinoIcons.rectangle_fill_on_rectangle_angled_fill, + CupertinoIcons.rectangle_fill_on_rectangle_fill, + CupertinoIcons.rectangle_grid_1x2, + CupertinoIcons.rectangle_grid_1x2_fill, + CupertinoIcons.rectangle_grid_2x2, + CupertinoIcons.rectangle_grid_2x2_fill, + CupertinoIcons.rectangle_grid_3x2, + CupertinoIcons.rectangle_grid_3x2_fill, + CupertinoIcons.rectangle_on_rectangle, + CupertinoIcons.rectangle_on_rectangle_angled, + CupertinoIcons.rectangle_paperclip, + CupertinoIcons.rectangle_split_3x1, + CupertinoIcons.rectangle_split_3x1_fill, + CupertinoIcons.rectangle_split_3x3, + CupertinoIcons.rectangle_split_3x3_fill, + CupertinoIcons.rectangle_stack, + CupertinoIcons.rectangle_stack_badge_minus, + CupertinoIcons.rectangle_stack_badge_person_crop, + CupertinoIcons.rectangle_stack_badge_plus, + CupertinoIcons.rectangle_stack_fill, + CupertinoIcons.rectangle_stack_fill_badge_minus, + CupertinoIcons.rectangle_stack_fill_badge_person_crop, + CupertinoIcons.rectangle_stack_fill_badge_plus, + CupertinoIcons.rectangle_stack_person_crop, + CupertinoIcons.rectangle_stack_person_crop_fill, + CupertinoIcons.repeat, + CupertinoIcons.repeat_1, + CupertinoIcons.resize, + CupertinoIcons.resize_h, + CupertinoIcons.resize_v, + CupertinoIcons.return_icon, + CupertinoIcons.rhombus, + CupertinoIcons.rhombus_fill, + CupertinoIcons.rocket, + CupertinoIcons.rocket_fill, + CupertinoIcons.rosette, + CupertinoIcons.rotate_left, + CupertinoIcons.rotate_left_fill, + CupertinoIcons.rotate_right, + CupertinoIcons.rotate_right_fill, + CupertinoIcons.scissors, + CupertinoIcons.scissors_alt, + CupertinoIcons.scope, + CupertinoIcons.scribble, + CupertinoIcons.search_circle, + CupertinoIcons.search_circle_fill, + CupertinoIcons.selection_pin_in_out, + CupertinoIcons.shield, + CupertinoIcons.shield_fill, + CupertinoIcons.shield_lefthalf_fill, + CupertinoIcons.shield_slash, + CupertinoIcons.shield_slash_fill, + CupertinoIcons.shift, + CupertinoIcons.shift_fill, + CupertinoIcons.sidebar_left, + CupertinoIcons.sidebar_right, + CupertinoIcons.signature, + CupertinoIcons.skew, + CupertinoIcons.slash_circle, + CupertinoIcons.slash_circle_fill, + CupertinoIcons.slider_horizontal_3, + CupertinoIcons.slider_horizontal_below_rectangle, + CupertinoIcons.slowmo, + CupertinoIcons.smallcircle_circle, + CupertinoIcons.smallcircle_circle_fill, + CupertinoIcons.smallcircle_fill_circle, + CupertinoIcons.smallcircle_fill_circle_fill, + CupertinoIcons.smiley, + CupertinoIcons.smiley_fill, + CupertinoIcons.smoke, + CupertinoIcons.smoke_fill, + CupertinoIcons.snow, + CupertinoIcons.sort_down, + CupertinoIcons.sort_down_circle, + CupertinoIcons.sort_down_circle_fill, + CupertinoIcons.sort_up, + CupertinoIcons.sort_up_circle, + CupertinoIcons.sort_up_circle_fill, + CupertinoIcons.sparkles, + CupertinoIcons.speaker, + CupertinoIcons.speaker_1, + CupertinoIcons.speaker_1_fill, + CupertinoIcons.speaker_2, + CupertinoIcons.speaker_2_fill, + CupertinoIcons.speaker_3, + CupertinoIcons.speaker_3_fill, + CupertinoIcons.speaker_fill, + CupertinoIcons.speaker_slash, + CupertinoIcons.speaker_slash_fill, + CupertinoIcons.speaker_slash_fill_rtl, + CupertinoIcons.speaker_slash_rtl, + CupertinoIcons.speaker_zzz, + CupertinoIcons.speaker_zzz_fill, + CupertinoIcons.speaker_zzz_fill_rtl, + CupertinoIcons.speaker_zzz_rtl, + CupertinoIcons.speedometer, + CupertinoIcons.sportscourt, + CupertinoIcons.sportscourt_fill, + CupertinoIcons.square, + CupertinoIcons.square_arrow_down, + CupertinoIcons.square_arrow_down_fill, + CupertinoIcons.square_arrow_down_on_square, + CupertinoIcons.square_arrow_down_on_square_fill, + CupertinoIcons.square_arrow_left, + CupertinoIcons.square_arrow_left_fill, + CupertinoIcons.square_arrow_right, + CupertinoIcons.square_arrow_right_fill, + CupertinoIcons.square_arrow_up, + CupertinoIcons.square_arrow_up_fill, + CupertinoIcons.square_arrow_up_on_square, + CupertinoIcons.square_arrow_up_on_square_fill, + CupertinoIcons.square_favorites, + CupertinoIcons.square_favorites_alt, + CupertinoIcons.square_favorites_alt_fill, + CupertinoIcons.square_favorites_fill, + CupertinoIcons.square_fill, + CupertinoIcons.square_fill_line_vertical_square, + CupertinoIcons.square_fill_line_vertical_square_fill, + CupertinoIcons.square_fill_on_circle_fill, + CupertinoIcons.square_fill_on_square_fill, + CupertinoIcons.square_grid_2x2, + CupertinoIcons.square_grid_2x2_fill, + CupertinoIcons.square_grid_3x2, + CupertinoIcons.square_grid_3x2_fill, + CupertinoIcons.square_grid_4x3_fill, + CupertinoIcons.square_lefthalf_fill, + CupertinoIcons.square_line_vertical_square, + CupertinoIcons.square_line_vertical_square_fill, + CupertinoIcons.square_list, + CupertinoIcons.square_list_fill, + CupertinoIcons.square_on_circle, + CupertinoIcons.square_on_square, + CupertinoIcons.square_pencil, + CupertinoIcons.square_pencil_fill, + CupertinoIcons.square_righthalf_fill, + CupertinoIcons.square_split_1x2, + CupertinoIcons.square_split_1x2_fill, + CupertinoIcons.square_split_2x1, + CupertinoIcons.square_split_2x1_fill, + CupertinoIcons.square_split_2x2, + CupertinoIcons.square_split_2x2_fill, + CupertinoIcons.square_stack, + CupertinoIcons.square_stack_3d_down_dottedline, + CupertinoIcons.square_stack_3d_down_right, + CupertinoIcons.square_stack_3d_down_right_fill, + CupertinoIcons.square_stack_3d_up, + CupertinoIcons.square_stack_3d_up_fill, + CupertinoIcons.square_stack_3d_up_slash, + CupertinoIcons.square_stack_3d_up_slash_fill, + CupertinoIcons.square_stack_fill, + CupertinoIcons.squares_below_rectangle, + CupertinoIcons.star, + CupertinoIcons.star_circle, + CupertinoIcons.star_circle_fill, + CupertinoIcons.star_fill, + CupertinoIcons.star_lefthalf_fill, + CupertinoIcons.star_slash, + CupertinoIcons.star_slash_fill, + CupertinoIcons.staroflife, + CupertinoIcons.staroflife_fill, + CupertinoIcons.stop, + CupertinoIcons.stop_circle, + CupertinoIcons.stop_circle_fill, + CupertinoIcons.stop_fill, + CupertinoIcons.stopwatch, + CupertinoIcons.stopwatch_fill, + CupertinoIcons.strikethrough, + CupertinoIcons.suit_club, + CupertinoIcons.suit_club_fill, + CupertinoIcons.suit_diamond, + CupertinoIcons.suit_diamond_fill, + CupertinoIcons.suit_heart, + CupertinoIcons.suit_heart_fill, + CupertinoIcons.suit_spade, + CupertinoIcons.suit_spade_fill, + CupertinoIcons.sum, + CupertinoIcons.sun_dust, + CupertinoIcons.sun_dust_fill, + CupertinoIcons.sun_haze, + CupertinoIcons.sun_haze_fill, + CupertinoIcons.sun_max, + CupertinoIcons.sun_max_fill, + CupertinoIcons.sun_min, + CupertinoIcons.sun_min_fill, + CupertinoIcons.sunrise, + CupertinoIcons.sunrise_fill, + CupertinoIcons.sunset, + CupertinoIcons.sunset_fill, + CupertinoIcons.t_bubble, + CupertinoIcons.t_bubble_fill, + CupertinoIcons.table, + CupertinoIcons.table_badge_more, + CupertinoIcons.table_badge_more_fill, + CupertinoIcons.table_fill, + CupertinoIcons.tag_circle, + CupertinoIcons.tag_circle_fill, + CupertinoIcons.tag_fill, + CupertinoIcons.text_aligncenter, + CupertinoIcons.text_alignleft, + CupertinoIcons.text_alignright, + CupertinoIcons.text_append, + CupertinoIcons.text_badge_checkmark, + CupertinoIcons.text_badge_minus, + CupertinoIcons.text_badge_plus, + CupertinoIcons.text_badge_star, + CupertinoIcons.text_badge_xmark, + CupertinoIcons.text_bubble, + CupertinoIcons.text_bubble_fill, + CupertinoIcons.text_cursor, + CupertinoIcons.text_insert, + CupertinoIcons.text_justify, + CupertinoIcons.text_justifyleft, + CupertinoIcons.text_justifyright, + CupertinoIcons.text_quote, + CupertinoIcons.textbox, + CupertinoIcons.textformat, + CupertinoIcons.textformat_123, + CupertinoIcons.textformat_abc, + CupertinoIcons.textformat_abc_dottedunderline, + CupertinoIcons.textformat_alt, + CupertinoIcons.textformat_size, + CupertinoIcons.textformat_subscript, + CupertinoIcons.textformat_superscript, + CupertinoIcons.thermometer, + CupertinoIcons.thermometer_snowflake, + CupertinoIcons.thermometer_sun, + CupertinoIcons.ticket, + CupertinoIcons.ticket_fill, + CupertinoIcons.tickets, + CupertinoIcons.tickets_fill, + CupertinoIcons.timelapse, + CupertinoIcons.timer, + CupertinoIcons.timer_fill, + CupertinoIcons.today, + CupertinoIcons.today_fill, + CupertinoIcons.tornado, + CupertinoIcons.tortoise, + CupertinoIcons.tortoise_fill, + CupertinoIcons.tram_fill, + CupertinoIcons.trash, + CupertinoIcons.trash_circle, + CupertinoIcons.trash_circle_fill, + CupertinoIcons.trash_fill, + CupertinoIcons.trash_slash, + CupertinoIcons.trash_slash_fill, + CupertinoIcons.tray, + CupertinoIcons.tray_2, + CupertinoIcons.tray_2_fill, + CupertinoIcons.tray_arrow_down, + CupertinoIcons.tray_arrow_down_fill, + CupertinoIcons.tray_arrow_up, + CupertinoIcons.tray_arrow_up_fill, + CupertinoIcons.tray_fill, + CupertinoIcons.tray_full, + CupertinoIcons.tray_full_fill, + CupertinoIcons.tree, + CupertinoIcons.triangle, + CupertinoIcons.triangle_fill, + CupertinoIcons.triangle_lefthalf_fill, + CupertinoIcons.triangle_righthalf_fill, + CupertinoIcons.tropicalstorm, + CupertinoIcons.tuningfork, + CupertinoIcons.tv, + CupertinoIcons.tv_circle, + CupertinoIcons.tv_circle_fill, + CupertinoIcons.tv_fill, + CupertinoIcons.tv_music_note, + CupertinoIcons.tv_music_note_fill, + CupertinoIcons.uiwindow_split_2x1, + CupertinoIcons.umbrella, + CupertinoIcons.umbrella_fill, + CupertinoIcons.underline, + CupertinoIcons.upload_circle, + CupertinoIcons.upload_circle_fill, + CupertinoIcons.videocam, + CupertinoIcons.videocam_circle, + CupertinoIcons.videocam_circle_fill, + CupertinoIcons.videocam_fill, + CupertinoIcons.view_2d, + CupertinoIcons.view_3d, + CupertinoIcons.viewfinder, + CupertinoIcons.viewfinder_circle, + CupertinoIcons.viewfinder_circle_fill, + CupertinoIcons.wand_rays, + CupertinoIcons.wand_rays_inverse, + CupertinoIcons.wand_stars, + CupertinoIcons.wand_stars_inverse, + CupertinoIcons.waveform, + CupertinoIcons.waveform_circle, + CupertinoIcons.waveform_circle_fill, + CupertinoIcons.waveform_path, + CupertinoIcons.waveform_path_badge_minus, + CupertinoIcons.waveform_path_badge_plus, + CupertinoIcons.waveform_path_ecg, + CupertinoIcons.wifi, + CupertinoIcons.wifi_exclamationmark, + CupertinoIcons.wifi_slash, + CupertinoIcons.wind, + CupertinoIcons.wind_snow, + CupertinoIcons.wrench, + CupertinoIcons.wrench_fill, + CupertinoIcons.xmark, + CupertinoIcons.xmark_circle, + CupertinoIcons.xmark_circle_fill, + CupertinoIcons.xmark_octagon, + CupertinoIcons.xmark_octagon_fill, + CupertinoIcons.xmark_rectangle, + CupertinoIcons.xmark_rectangle_fill, + CupertinoIcons.xmark_seal, + CupertinoIcons.xmark_seal_fill, + CupertinoIcons.xmark_shield, + CupertinoIcons.xmark_shield_fill, + CupertinoIcons.xmark_square, + CupertinoIcons.xmark_square_fill, + CupertinoIcons.zoom_in, + CupertinoIcons.zoom_out, + CupertinoIcons.zzz +]..sort(_compare));